# HG changeset patch # User Sune Foldager <c...@cyanite.org> # Date 1268923958 -3600 # Node ID 91433048e0f5bc464bab07d1ade3340c0d22a308 # Parent 01b1f48bd9e14978d8fb8236ea128df205cc7848 hgtk: spawn background process when using --repository
When forking, relative paths are a problem since we have switched to the target repository directory already, and will do so again after forking. This is solved by switching back to the original working directory prior to spawning the new process. diff --git a/tortoisehg/hgtk/hgtk.py b/tortoisehg/hgtk/hgtk.py --- a/tortoisehg/hgtk/hgtk.py +++ b/tortoisehg/hgtk/hgtk.py @@ -87,10 +87,10 @@ else: gtkrun(run, u, **opts) +origwdir = os.getcwd() def portable_fork(ui, opts): if 'THG_HGTK_SPAWN' in os.environ or ( - not opts.get('fork') and ( - opts.get('nofork') or opts.get('repository'))): + not opts.get('fork') and opts.get('nofork')): return elif ui.configbool('tortoisehg', 'hgtkfork', None) is not None: if not ui.configbool('tortoisehg', 'hgtkfork'): @@ -104,6 +104,7 @@ args = [sys.executable] + sys.argv os.environ['THG_HGTK_SPAWN'] = '1' cmdline = subprocess.list2cmdline(args) + os.chdir(origwdir) subprocess.Popen(cmdline, close_fds=True, creationflags=openflags, ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Tortoisehg-develop mailing list Tortoisehg-develop@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop