[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: getRevision, accidentally "sent" that last message too soon.

From: Jennifer Bevan <jen_at_alouysius.net>
Date: 2005-01-12 09:38:54 CET

Hi again,
The other concern I had was the ability to specify seconds in the input
format for getRevision. This patch allows this by changing the expected
time format from DateFormat.SHORT to DateFormat.MEDIUM. I also
modified the error message to use DateFormat character codes, which
seems to be more informative for me...if anyone has objections to that,
of course, that part of the patch can be ignored...

This patch also incorporates the earlier patch, where the format of the
outgoing string from SVNRevision$DateSpec.toString() was modified
to be acceptable by svn.

-Jennifer Bevan

Index: SVNRevision.java
===================================================================
--- SVNRevision.java (revision 1202)
+++ SVNRevision.java (working copy)
@@ -115,7 +115,7 @@
 
         public String toString() {
             
- SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, d
MMM yyyy HH:mm:ss Z", Locale.US);
+ SimpleDateFormat dateFormat = new
SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z", Locale.US);
             return '{'+dateFormat.format(revDate)+'}';
         }
 
@@ -205,7 +205,7 @@
         }
         
         // try date
- DateFormat df =
DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT,
Locale.US);
+ DateFormat df =
DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM,
Locale.US);
         try
         {
             Date revisionDate = df.parse(revision);
@@ -214,7 +214,7 @@
         {
         }
         
- throw new ParseException("Invalid revision. Revision should be
a number, a date in MM/DD/YYYY HH:MM AM_PM format or HEAD, BASE,
COMMITED or PREV",0);
+ throw new ParseException("Invalid revision. Revision should be
a number, a date in MM/dd/yyyy HH:mm:ss AM_PM format or HEAD, BASE,
COMMITED or PREV",0);
     }
     
 }

Jennifer Bevan wrote:

> Here's the patch, and thanks for the info about the timezone,
>
>
Received on Wed Jan 12 19:38:54 2005

This is an archived mail posted to the Subclipse Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.