Mercurial > hg
diff mercurial/cmdutil.py @ 5062:3d35c8cb5eb4
Simplify/correct finding the hg executable (fixes issue644)
Simply use find_exe('hg') as the default value for $HG and require to manually
set it if you have special requirements.
While the default will not always be 100% correct (i.e. the identical hg
version) for many users it is and for the others the hg executable found in
the PATH should do most things correctly.
Developers or other users with multiple installs can set $HG or run something
like util.set_hgexecutable in their shell or python scripts.
Additionally util.hgexecutable() is now available so extensions can access
the value with a public interface, too.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Sat, 04 Aug 2007 22:25:12 +0200 |
parents | 10afa3fab6b4 |
children | d5126a0172ba cbe6e263357b |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Tue Jul 10 10:06:24 2007 -0700 +++ b/mercurial/cmdutil.py Sat Aug 04 22:25:12 2007 +0200 @@ -20,7 +20,7 @@ class ParseError(Exception): """Exception raised on errors in parsing the command line.""" -def runcatch(ui, args, argv0=None): +def runcatch(ui, args): def catchterm(*args): raise util.SignalInterrupt @@ -34,7 +34,7 @@ if '--debugger' in args: pdb.set_trace() try: - return dispatch(ui, args, argv0=argv0) + return dispatch(ui, args) finally: ui.flush() except: @@ -276,10 +276,7 @@ pos += 1 return values -def dispatch(ui, args, argv0=None): - # remember how to call 'hg' before changing the working dir - util.set_hgexecutable(argv0) - +def dispatch(ui, args): # read --config before doing anything else # (e.g. to change trust settings for reading .hg/hgrc) config = earlygetopt(['--config'], args)