Fixed date (Timestamp) parsing after changes in Timestamp 1.159 cvs_MAIN expecco_2_7_0 expecco_2_7_0_49 expecco_2_7_5 expecco_2_7_5a
authorJan Vrany <jan.vrany@fit.cvut.cz>
Sun, 16 Nov 2014 21:58:45 +0000
branchcvs_MAIN
changeset 504 395a5253c3d4
parent 503 14d868f983a9
child 505 d4280b9a5e98
Fixed date (Timestamp) parsing after changes in Timestamp 1.159 Cherry-picked from 0c2c8eb5df33.
mercurial/HGCommandParser.st
--- a/mercurial/HGCommandParser.st	Thu Jul 31 09:56:40 2014 +0100
+++ b/mercurial/HGCommandParser.st	Sun Nov 16 21:58:45 2014 +0000
@@ -274,22 +274,27 @@
 !
 
 parseDate
-    | ts |
+    | ts c |
     ts := Timestamp readIso8601FormatFrom:stream.
-    (stream peek == $+ or:[stream peek == $-]) ifFalse:[
-        self error:'Timezone expected, ' , stream peek , ' found'
+    c := stream peek.
+    c == Character space ifTrue:[ 
+        stream next.
+        c := stream peek.
+    ].
+    (c == $+ or:[c == $-]) ifFalse:[
+        self error:'Cannot read timezone: ''+'' or ''-'' expected, ''' , c , ''' found'
     ].
     stream next.
     4 timesRepeat:[
-        ('0123456789' includes: stream peek) ifFalse:[
-            self error:'Timezone expected, ' , stream peek , ' found'
+        ('0123456789' includes: (c := stream peek)) ifFalse:[
+            self error:'Cannot read timezone: digit expected, ''' , c , ''' found'
         ].
         stream next.
     ].
     ^ts
 
     "Created: / 13-11-2012 / 10:22:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 13-11-2012 / 17:28:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-11-2014 / 10:44:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 parseInteger