# HG changeset patch # User Alexis S. L. Carvalho # Date 1184188521 10800 # Node ID 0875082d547197a3199f9fd0faa93514c835b13b # Parent 6f08bc1bd00bc5df390e36cd7671ef4c9a58f152 util._hgexecutable: default to 'hg' This should make hooks work even if util.set_hgexecutable is not called (e.g. hgweb.cgi). Fixes issue625. diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -540,7 +540,7 @@ def _matcher(canonroot, cwd, names, inc, return (roots, match, (inc or exc or anypats) and True) -_hgexecutable = None +_hgexecutable = 'hg' def set_hgexecutable(path): """remember location of the 'hg' executable if easily possible @@ -549,7 +549,8 @@ def set_hgexecutable(path): fall back to 'hg' in this case. """ global _hgexecutable - _hgexecutable = path and os.path.abspath(path) or 'hg' + if path: + _hgexecutable = os.path.abspath(path) def system(cmd, environ={}, cwd=None, onerr=None, errprefix=None): '''enhanced shell command execution.