mercurial/HGCommand.st
changeset 419 2f7fa37437e9
parent 403 237ed0ed6c49
parent 418 91d981298a96
child 437 fa687128ae25
--- a/mercurial/HGCommand.st	Wed Apr 02 15:33:36 2014 +0200
+++ b/mercurial/HGCommand.st	Mon Apr 14 11:44:33 2014 +0200
@@ -5,7 +5,7 @@
 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
-version 2.1 of the License. 
+version 2.1 of the License.
 
 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -197,7 +197,7 @@
 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
-version 2.1 of the License. 
+version 2.1 of the License.
 
 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -239,10 +239,10 @@
     HGExecutable isNil ifTrue:[
         | executable |
         executable :=  UserPreferences current hgCommand.
-        executable isNil ifTrue:[ 
+        executable isNil ifTrue:[
             OperatingSystem isMSWINDOWSlike ifTrue:[
                 "/        | h |
-                "/ 
+                "/
                 "/        h := Win32OperatingSystem registryEntry
                 "/                key:'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\svn.exe'.
                 "/        h notNil ifTrue:[HGExecutable := h valueNamed:''].
@@ -254,8 +254,8 @@
                 ]
             ].
         ].
-        executable := self hgCommandValidate: executable.            
-        HGExecutable := executable. 
+        executable := self hgCommandValidate: executable.
+        HGExecutable := executable.
     ].
     ^ HGExecutable
 
@@ -283,15 +283,15 @@
 hgCommandValidate: executable
     "/ Given a `executable`, checks whether it is a valid hg binary.
     "/ Returns absolute path to hg binary or raise an
-    "/ HGInvalidExecutableError or HGInvalidVersionError 
+    "/ HGInvalidExecutableError or HGInvalidVersionError
     "/ if `executable` is not valid hg binary.
-    "/ 
+    "/
     | path version |
 
     path := executable asFilename.
-    path isAbsolute ifFalse:[ 
+    path isAbsolute ifFalse:[
         path := path asAbsoluteFilename.
-        path exists ifFalse:[ 
+        path exists ifFalse:[
             "/ Also try to find specified command along PATH, maybe somebody
             "/ just typed 'hg' in...
             (executable includes: Filename separator) ifFalse:[
@@ -308,16 +308,16 @@
         HGInvalidExecutableError raiseErrorString:('Specified ''hg'' executable (%1) does not exists!!' bindWith: path pathName).
         ^ nil
     ].
-    path isDirectory ifTrue:[ 
+    path isDirectory ifTrue:[
         HGInvalidExecutableError raiseErrorString:('Specified ''hg'' executable (%1) is actually a directory!!' bindWith: path pathName).
         ^ nil
     ].
-    path isExecutable ifFalse:[ 
+    path isExecutable ifFalse:[
         HGInvalidExecutableError raiseErrorString:('Specified ''hg'' executable (%1) is cannot be executed!!' bindWith: path pathName).
         ^ nil
     ].
-    [ 
-        version := self hgVersionOf: path pathName.  
+    [
+        version := self hgVersionOf: path pathName.
     ] on: Error do:[:ex |
         HGInvalidExecutableError newException
             parameter: ex;
@@ -325,7 +325,7 @@
             raise.
         ^ nil
     ].
-    (self hgVersionIsSupported: version) ifFalse:[ 
+    (self hgVersionIsSupported: version) ifFalse:[
         HGInvalidVersionError newException
             parameter: version;
             messageText: ('Unsuported Mercurial version (%1)' bindWith: (version asStringWith:$.));
@@ -636,9 +636,11 @@
     Trace ifTrue:[
         Logger log: 'cmd: propagating: ' , anException class name , ' - ', anException description severity: #trace facility: 'HG'.
     ].
-    Debug ifTrue:[ 
-        anException isNotification ifFalse:[ 
-            thisContext fullPrintAllOn: Transcript.  
+    Debug ifTrue:[
+    	anException isNotification ifFalse:[
+            anException suspendedContext notNil ifTrue:[
+                anException suspendedContext fullPrintAllOn: Transcript.
+            ].
         ].
     ].
     errors nextPut: anException.
@@ -684,8 +686,8 @@
                     ifTrue:[OperatingSystem getEnvironment copy]
                     ifFalse:[environment := Dictionary new].
     environment at: 'HGEDITOR' put: 'true'.
-
     environment at:'LANG' put:'C'.
+    environment at:'LC_MESSAGES' put:'C'.
 
     args := self arguments.
     OperatingSystem isMSWINDOWSlike ifTrue:[
@@ -729,6 +731,8 @@
         stdout readWaitWithTimeoutMs: 10.
         stderr readWaitWithTimeoutMs: 10.
         Debug ifTrue:[
+            "/ Transcript showCR:'hg stdout:'; showCR:stdout contents asString.
+            "/ Transcript showCR:'hg stderr:'; showCR:stderr contents asString.
             stdout := stdout contents asString readStream.
             stderr := stderr contents asString readStream.
         ]
@@ -880,11 +884,11 @@
 
     | worker |
 
-    worker := [ 
+    worker := [
         Trace ifTrue:[
             Logger log: 'cmd: worker ''', name , ''' spawned' severity: #trace facility: 'HG'.
         ].
-        block on: Error do:[:ex|self propagate:ex] 
+        block on: Error do:[:ex|self propagate:ex]
     ] newProcess.
     worker addExitAction:[
         Trace ifTrue:[
@@ -911,7 +915,7 @@
 !
 
 spawnOutputReaderOn: stdout
-    outputReader isNil ifTrue:[    
+    outputReader isNil ifTrue:[
         outputReader := self spawn: [ result := self parseOutput: stdout ] name: 'Output reader'.
     ]
 
@@ -984,7 +988,7 @@
 
 argumentsCommandOn:stream
     revision notNil ifTrue:[
-        stream 
+        stream
             nextPut: '-r';
             nextPut: revision asString.
     ].
@@ -995,7 +999,7 @@
     "Modified: / 20-03-2014 / 18:43:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-parseError:stream 
+parseError:stream
     ^ (self parserOn: stream) parseErrorBookmark
 
     "Created: / 20-03-2014 / 17:27:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -1044,7 +1048,7 @@
     "Created: / 21-03-2014 / 01:21:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-parseError:stream 
+parseError:stream
     ^ (self parserOn: stream) parseErrorBookmark
 
     "Created: / 20-03-2014 / 17:27:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -1099,7 +1103,7 @@
     "Created: / 27-11-2012 / 19:54:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-parseError:stream 
+parseError:stream
     ^ (self parserOn: stream) parseErrorBranches.
 
     "Created: / 06-02-2013 / 19:20:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -1510,7 +1514,7 @@
 
     | template |
 
-    template := HGCommandParser templateLog.       
+    template := HGCommandParser templateLog.
     path isNil ifTrue:[
         revsets isEmptyOrNil ifTrue:[
             self error:'No revisions given'.
@@ -1527,8 +1531,8 @@
     ] ifFalse:[
         stream nextPut: '--follow'.
     ].
-    idsOnly == true ifTrue:[ 
-        template := HGCommandParser templateLogIdsOnly. 
+    idsOnly == true ifTrue:[
+        template := HGCommandParser templateLogIdsOnly.
     ].
 
     childrenOnly == true ifTrue:[
@@ -1539,8 +1543,8 @@
         nextPut:'--debug';
         nextPut:'--template';
         nextPut:template.
-    limit notNil ifTrue:[ 
-        stream 
+    limit notNil ifTrue:[
+        stream
             nextPut: '-l';
             nextPut: limit printString
     ].
@@ -2043,13 +2047,21 @@
 
 !HGCommand class methodsFor:'documentation'!
 
+version
+    ^ '$Header: /cvs/stx/stx/libscm/mercurial/HGCommand.st,v 1.4 2014/04/13 15:02:07 cg Exp $'
+!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/libscm/mercurial/HGCommand.st,v 1.4 2014/04/13 15:02:07 cg Exp $'
+!
+
 version_HG
 
     ^ '$Changeset: <not expanded> $'
 !
 
 version_SVN
-    ^ 'Id::                                                                                                                        '
+    ^ '$Id: HGCommand.st,v 1.4 2014/04/13 15:02:07 cg Exp $'
 ! !