mercurial/HGCommand.st
changeset 105 25e8ff9d2a31
parent 102 16bc16d9e6d5
child 106 99be3b5a40da
--- a/mercurial/HGCommand.st	Tue Nov 27 18:20:56 2012 +0000
+++ b/mercurial/HGCommand.st	Tue Nov 27 21:00:31 2012 +0000
@@ -14,6 +14,13 @@
 	privateIn:HGCommand
 !
 
+HGCommand subclass:#branches
+	instanceVariableNames:'active closed'
+	classVariableNames:''
+	poolDictionaries:''
+	privateIn:HGCommand
+!
+
 HGCommand subclass:#cat
 	instanceVariableNames:'path revision'
 	classVariableNames:''
@@ -253,6 +260,12 @@
     "Created: / 15-11-2012 / 00:06:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+branches
+    ^branches new
+
+    "Created: / 27-11-2012 / 19:56:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 cat
     ^cat new
 
@@ -519,6 +532,55 @@
     "Modified: / 15-11-2012 / 00:38:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!HGCommand::branches methodsFor:'accessing'!
+
+active
+    ^ active
+!
+
+active:aBoolean
+    active := aBoolean.
+!
+
+closed
+    ^ closed
+!
+
+closed:aBoolean
+    closed := aBoolean.
+! !
+
+!HGCommand::branches methodsFor:'private'!
+
+argumentsCommandOn:stream
+    "Called to get command specific options"
+
+    active == true ifTrue:[
+        stream nextPut:'--active'
+    ].
+    closed == true ifTrue:[
+        stream nextPut:'--closed'
+    ].
+
+    "Created: / 27-11-2012 / 19:54:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+argumentsGlobalOn:stream
+
+    stream nextPut:'--debug' "/to get full node ids
+
+    "Created: / 27-11-2012 / 19:54:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+parse: stream
+    "Parses output of 'hg' command, i.e. commit, log, update, checkout, 
+     etc."
+
+    ^ (HGCommandParser on: stream) parseCommandBranches
+
+    "Created: / 27-11-2012 / 19:55:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !HGCommand::cat methodsFor:'accessing'!
 
 path