Fixed bookmark handling when using shared repositories.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 22 Nov 2016 20:11:53 +0000
changeset 719 6c05b8adbcb3
parent 718 d1a254dba5d2
child 720 7d4cae753d3b
Fixed bookmark handling when using shared repositories. When using a shared repositories, we must enable share extension for *all* commands, not only for `share` command itself. Otherwise other commands (suc as `bookmark`, `log` etc) won't be aware about shared bookmarks. Enablng shared bookmarks is safe - share extension is distributed with Mercurial since 1.3 - stx:libscm does not support such an ancient version anyway. This fixes regression HGStXTests>>test_commit_30b.
mercurial/HGCommand.st
mercurial/HGTests.st
--- a/mercurial/HGCommand.st	Sat Nov 19 22:36:18 2016 +0000
+++ b/mercurial/HGCommand.st	Tue Nov 22 20:11:53 2016 +0000
@@ -1048,6 +1048,14 @@
         s nextPut: self executable.
         s nextPutAll: self class hgExecutableArguments ? #().
         s nextPut: '--noninteractive'.
+        
+        "/ We must enable share extension to make sure bookmarks
+        "/ work fine. This should be safe as share extension is
+        "/ distributed with mercurial since 1.3 (which is not supported
+        "/ by libscm) so it's always available
+
+	s nextPut: '--config'.
+	s nextPut: 'extensions.share='.
         self argumentsGlobalOn:s.
         s nextPut:self command.
         self argumentsCommandOn:s.
@@ -1068,12 +1076,14 @@
     "Modified: / 16-11-2012 / 22:31:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-argumentsGlobalOn:arg
+argumentsGlobalOn:stream
     "Called to get global options"
 
+
     "Created: / 11-05-2011 / 07:58:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified (format): / 27-12-2011 / 15:47:10 / dundee"
     "Modified: / 30-09-2012 / 23:43:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 22-11-2016 / 20:02:13 / jenkins"
 !
 
 command
@@ -2015,13 +2025,14 @@
     "Modified: / 27-11-2014 / 23:24:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-argumentsGlobalOn:arg
+argumentsGlobalOn:stream
     "Called to get global options"
 
+    super argumentsGlobalOn:stream.
     hidden == true ifTrue:[
         "/ --hidden is supported since 2.5
         HGCommand hgVersionIsGreaterOrEqualThan_2_5 ifTrue:[
-            arg nextPut: '--hidden'
+            stream nextPut: '--hidden'
         ].
     ].
 
@@ -2565,12 +2576,6 @@
     "Modified: / 14-09-2015 / 05:43:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-argumentsGlobalOn: stream
-    stream nextPut: '--config'; nextPut:'extensions.share='
-
-    "Created: / 25-08-2015 / 01:47:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
 parseOutput:stream
     "superclass Command says that I am responsible to implement this method"
 
--- a/mercurial/HGTests.st	Sat Nov 19 22:36:18 2016 +0000
+++ b/mercurial/HGTests.st	Tue Nov 22 20:11:53 2016 +0000
@@ -1400,23 +1400,27 @@
         UserPreferences current hgCommand: ('python "%1"' bindWith: pathOfHgCommand).
         cmd := HGCommand commit message:'123'.
         self assert: (cmd executable = pathOfPython).
-        self assert: (cmd arguments size == 6).
+        self assert: (cmd arguments size == 8).
         self assert: (cmd arguments at:1) = pathOfPython.
         self assert: (cmd arguments at:2) = pathOfHgCommand.
-        self assert: (cmd arguments at:3) = '--noninteractive'.
-        self assert: (cmd arguments at:4) = 'commit'.
-        self assert: (cmd arguments at:5) = '-m'.
+        self assert: (cmd arguments at:3) = '--noninteractive'.	
+        self assert: (cmd arguments at:4) = '--config'.
+        self assert: (cmd arguments at:5) = 'extensions.share='.
+        self assert: (cmd arguments at:6) = 'commit'.
+        self assert: (cmd arguments at:7) = '-m'.
 
         HGCommand hgCommand: nil.
         UserPreferences current hgCommand: ('"%1" "%2"' bindWith: pathOfPython with: pathOfHgCommand).         
         cmd := HGCommand commit message:'123'.
         self assert: (cmd executable = pathOfPython).
-        self assert: (cmd arguments size == 6).
+        self assert: (cmd arguments size == 8).
         self assert: (cmd arguments at:1) = pathOfPython.
         self assert: (cmd arguments at:2) = pathOfHgCommand.
         self assert: (cmd arguments at:3) = '--noninteractive'.
-        self assert: (cmd arguments at:4) = 'commit'.
-        self assert: (cmd arguments at:5) = '-m'. 
+        self assert: (cmd arguments at:4) = '--config'.
+        self assert: (cmd arguments at:5) = 'extensions.share='. 
+        self assert: (cmd arguments at:6) = 'commit'.
+        self assert: (cmd arguments at:7) = '-m'. 
     ] ensure:[ 
         UserPreferences current hgCommand: savedHgCommand. 
         HGCommand hgCommand: nil.