Fixed date (Timestamp) parsing after changes in Timestamp 1.159
Cherry-picked from 0c2c8eb5df33.
--- 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