--- a/mercurial/HGCommandParser.st Mon Jan 14 14:39:05 2013 +0000
+++ b/mercurial/HGCommandParser.st Mon Jan 14 17:01:55 2013 +0000
@@ -269,6 +269,42 @@
"Modified: / 16-12-2012 / 00:38:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
+parseMergePath: info
+ "Parses 'merging Make.proto' line"
+
+ self expect: 'merging '.
+ self parsePath.
+ self expectLineEnd.
+
+ "Created: / 14-01-2013 / 15:56:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+parseMergeSummary
+ ^self parseMergeSummary: HGMergeInfo new
+
+ "Created: / 14-01-2013 / 15:48:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+parseMergeSummary: info
+ "Example:
+
+ '9 files updated, 0 files merged, 1 files removed, 0 files unresolved'
+ "
+
+ info setNumUpdated: self parseInteger.
+ self expect: ' files updated, '.
+ info setNumMerged: self parseInteger.
+ self expect: ' files merged, '.
+ info setNumRemoved: self parseInteger.
+ self expect: ' files removed, '.
+ info setNumUnresolved: self parseInteger.
+ self expect: ' files unresolved'.
+ self expectLineEnd.
+ ^info
+
+ "Created: / 14-01-2013 / 15:52:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
parseName
^String streamContents:[:out|
[ stream peek isSeparator ] whileFalse:[
@@ -513,6 +549,23 @@
"Created: / 05-12-2012 / 19:15:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
+parseCommandMerge
+ "Parse output of 'hg update' command. "
+
+ | info |
+
+ info := HGMergeInfo new.
+ [ stream peek == $m ] whileTrue:[
+ self parseMergePath: info.
+ ].
+ self parseMergeSummary: info.
+ self expect: 'use ''hg resolve'' to retry unresolved file merges or ''hg update -C .'' to abandon'.
+ self expectLineEnd.
+ ^info
+
+ "Created: / 14-01-2013 / 15:57:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
parseCommandPush
"Parse output of 'hg push' command. "
@@ -538,6 +591,30 @@
"Created: / 10-12-2012 / 02:15:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
+parseCommandResolveList
+ "Parse output of 'hg resolve --list' command. Return dictionary <path,status>"
+
+ | statuses |
+
+ statuses := Dictionary new.
+
+ [ stream atEnd ] whileFalse:[
+ | status path |
+
+ status := stream next.
+ (status == $U or:[status == $R]) ifFalse:[
+ self error:'Unknown resolution status: ', status.
+ ].
+ self expectSpace.
+ path := self parsePath.
+ statuses at: path put: status.
+ self expectLineEnd.
+ ].
+ ^statuses
+
+ "Created: / 14-01-2013 / 16:45:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
parseCommandShowConfig
"Parse output of 'hg showconfig' command, assuming the template given
was HGCommandParser templateLog. Return a list of HGChangeset."
@@ -575,6 +652,14 @@
"Modified: / 21-11-2012 / 01:09:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
+parseCommandUpdate
+ "Parse output of 'hg update' command. "
+
+ ^self parseMergeSummary
+
+ "Created: / 14-01-2013 / 15:48:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
parseCommandVersion
"Parse output of 'hg --version'"