Mercurial > hg
diff mercurial/cmdutil.py @ 4686:849f011dbf79
Remember path to 'hg' executable and pass to external tools and hooks as $HG.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Sat, 23 Jun 2007 20:21:10 +0200 |
parents | 150afe6becf6 |
children | a741293793f6 |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Sat Jun 23 12:05:00 2007 +0200 +++ b/mercurial/cmdutil.py Sat Jun 23 20:21:10 2007 +0200 @@ -20,7 +20,7 @@ class ParseError(Exception): """Exception raised on errors in parsing the command line.""" -def runcatch(ui, args): +def runcatch(ui, args, argv0=None): def catchterm(*args): raise util.SignalInterrupt @@ -34,7 +34,7 @@ if '--debugger' in args: pdb.set_trace() try: - return dispatch(ui, args) + return dispatch(ui, args, argv0=argv0) finally: ui.flush() except: @@ -255,7 +255,10 @@ return args[args.index(opt) + 1] return None -def dispatch(ui, args): +def dispatch(ui, args, argv0=None): + # remember how to call 'hg' before changing the working dir + util.set_hgexecutable(argv0) + # check for cwd first cwd = earlygetopt(['--cwd'], args) if cwd: