--- a/mercurial/HGCommand.st Mon Apr 25 21:40:05 2016 +0100
+++ b/mercurial/HGCommand.st Mon Apr 25 21:42:03 2016 +0100
@@ -252,6 +252,7 @@
`nil` is returned."
| command |
+
HGCommandString notNil ifTrue:[
command := HGCommandString
] ifFalse:[
@@ -260,21 +261,19 @@
command := command asString.
]
].
-
+ command := OperatingSystem pathOfCommand:'hg'.
command isNil ifTrue:[
+ | guesses |
+ guesses := #().
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:''].
- "/ HGExecutable notEmptyOrNil ifTrue:[^HGExecutable]
- command := OperatingSystem pathOfCommand:'hg'.
- ] ifFalse:[
- OperatingSystem isUNIXlike ifTrue:[
- command := OperatingSystem pathOfCommand:'hg'.
- ]
+ guesses := #(
+ 'C:\Program Files\TortoiseHg\hg.exe'
+ 'C:\Program Files\Mercurial\hg.exe'
+ 'C:\Program Files (x86)\TortoiseHg\hg.exe'
+ 'C:\Program Files (x86)\Mercurial\hg.exe'
+ ).
].
+ command := guesses detect: [ :guess | guess asFilename exists ] ifNone:[ nil ].
].
^ command
@@ -284,8 +283,7 @@
"
"Created: / 19-11-2012 / 21:48:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 17-07-2014 / 11:21:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified (comment): / 23-04-2016 / 19:29:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (format): / 25-04-2016 / 21:30:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
hgCommand: command