ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject svn commit: r463852 - /ant/antlibs/svn/trunk/src/main/org/apache/ant/svn/SvnChangeLogTask.java
Date Fri, 13 Oct 2006 22:21:22 GMT
Author: peterreilly
Date: Fri Oct 13 15:21:19 2006
New Revision: 463852

URL: http://svn.apache.org/viewvc?view=rev&rev=463852
Log:
Bugzill 40704, fix for cygwin version of svn dealing with dates

Modified:
    ant/antlibs/svn/trunk/src/main/org/apache/ant/svn/SvnChangeLogTask.java

Modified: ant/antlibs/svn/trunk/src/main/org/apache/ant/svn/SvnChangeLogTask.java
URL: http://svn.apache.org/viewvc/ant/antlibs/svn/trunk/src/main/org/apache/ant/svn/SvnChangeLogTask.java?view=diff&rev=463852&r1=463851&r2=463852
==============================================================================
--- ant/antlibs/svn/trunk/src/main/org/apache/ant/svn/SvnChangeLogTask.java (original)
+++ ant/antlibs/svn/trunk/src/main/org/apache/ant/svn/SvnChangeLogTask.java Fri Oct 13 15:21:19
2006
@@ -35,6 +35,7 @@
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.taskdefs.LogOutputStream;
 import org.apache.tools.ant.taskdefs.PumpStreamHandler;
+import org.apache.tools.ant.taskdefs.condition.Os;
 import org.apache.tools.ant.taskdefs.cvslib.CvsUser;
 import org.apache.tools.ant.types.FileSet;
 import org.apache.tools.ant.util.FileUtils;
@@ -68,6 +69,9 @@
  * @ant.task name="svnchangelog" category="scm"
  */
 public class SvnChangeLogTask extends AbstractSvnTask {
+    // ? On windows ?
+    private static final boolean ON_WINDOWS = Os.isFamily("windows");
+
     /** User list */
     private File usersFile;
 
@@ -165,7 +169,16 @@
 
         final SimpleDateFormat outputDate =
             new SimpleDateFormat("{yyyy-MM-dd}");
-        setStart(outputDate.format(new Date(time)));
+        String formattedDate = outputDate.format(new Date(time));
+        if (ON_WINDOWS) {
+            // BugZilla: 40704
+            // http://issues.apache.org/bugzilla/show_bug.cgi?id=40704
+            // cygwin svn has a bug in handling parameters with {}
+            // putting quotes around the date fixes this, the
+            // fix also works for the normal svn cli command.
+            formattedDate = "\"" + formattedDate + "\"";
+        }
+        setStart(formattedDate);
     }
 
 
@@ -397,4 +410,3 @@
         return true;
     }
 }
-



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message