maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r895004 - /maven/plugins/trunk/maven-patch-plugin/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
Date Fri, 01 Jan 2010 13:07:35 GMT
Author: bentmann
Date: Fri Jan  1 13:07:35 2010
New Revision: 895004

URL: http://svn.apache.org/viewvc?rev=895004&view=rev
Log:
[MPATCH-11] Plugin generates faulty command line when originalFile and destFile parameters
are used

Modified:
    maven/plugins/trunk/maven-patch-plugin/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java

Modified: maven/plugins/trunk/maven-patch-plugin/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-patch-plugin/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java?rev=895004&r1=895003&r2=895004&view=diff
==============================================================================
--- maven/plugins/trunk/maven-patch-plugin/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
(original)
+++ maven/plugins/trunk/maven-patch-plugin/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
Fri Jan  1 13:07:35 2010
@@ -218,7 +218,8 @@
     private File originalFile;
 
     /**
-     * The output file which is the original file, plus modifications from the patch.
+     * The output file which is the original file, plus modifications from the patch. By
default, the file(s) will be
+     * patched inplace.
      * 
      * @parameter
      */
@@ -565,19 +566,6 @@
 
         cli.setWorkingDirectory( targetDirectory.getAbsolutePath() );
 
-        if ( originalFile != null )
-        {
-            cli.createArg().setFile( originalFile );
-
-            if ( destFile != null )
-            {
-                cli.createArg().setValue( "-o" );
-                cli.createArg().setFile( destFile );
-            }
-
-            cli.createArg().setFile( patchFile );
-        }
-
         cli.createArg().setValue( "-p" + strip );
 
         if ( ignoreWhitespace )
@@ -603,6 +591,17 @@
         cli.createArg().setValue( "-i" );
         cli.createArg().setFile( patchFile );
 
+        if ( destFile != null )
+        {
+            cli.createArg().setValue( "-o" );
+            cli.createArg().setFile( destFile );
+        }
+
+        if ( originalFile != null )
+        {
+            cli.createArg().setFile( originalFile );
+        }
+
         return cli;
     }
 



Mime
View raw message