mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Merge pull request #3432 from joehealy/develop
Modified check for existence of hg binary to also work on windows
This commit is contained in:
commit
36abc09fc2
@ -5,9 +5,14 @@ Support for the Mercurial SCM
|
||||
# Import salt libs
|
||||
from salt import utils
|
||||
|
||||
if utils.is_windows():
|
||||
hg_binary = "hg.exe"
|
||||
else:
|
||||
hg_binary = "hg"
|
||||
|
||||
|
||||
def _check_hg():
|
||||
utils.check_or_die('hg')
|
||||
utils.check_or_die(hg_binary)
|
||||
|
||||
def revision(cwd, rev='tip', short=False, user=None):
|
||||
'''
|
||||
|
@ -23,15 +23,20 @@ import shutil
|
||||
|
||||
# Import salt libs
|
||||
from salt.states.git import _fail, _neutral_test
|
||||
from salt import utils
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
if utils.is_windows():
|
||||
hg_binary = "hg.exe"
|
||||
else:
|
||||
hg_binary = "hg"
|
||||
|
||||
def __virtual__():
|
||||
'''
|
||||
Only load if hg is available
|
||||
'''
|
||||
return 'hg' if __salt__['cmd.has_exec']('hg') else False
|
||||
return 'hg' if __salt__['cmd.has_exec'](hg_binary) else False
|
||||
|
||||
|
||||
def latest(name,
|
||||
|
Loading…
Reference in New Issue
Block a user