Merge pull request #3432 from joehealy/develop

Modified check for existence of hg binary to also work on windows
This commit is contained in:
David Boucha 2013-01-24 16:53:20 -08:00
commit 36abc09fc2
2 changed files with 12 additions and 2 deletions

View File

@ -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):
'''

View File

@ -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,