[PATCH 2 of 4] serve: add chdir command for --daemon-postexec
Jun Wu
quark at fb.com
Tue Mar 8 21:23:24 EST 2016
# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1457486222 0
# Wed Mar 09 01:17:02 2016 +0000
# Node ID 671eb2d843fbac71cbaaaae875985941e920ed2a
# Parent 05d74711cf855d7a5c1ab35d5eca6425f963dbfd
serve: add chdir command for --daemon-postexec
For chgserver, it probably needs a chdir to /. This patch adds chdir command
support for --daemon-postexec so chg client can make use of it.
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -835,6 +835,8 @@
if inst.startswith('unlink:'):
lockpath = inst[7:]
os.unlink(lockpath)
+ elif inst.startswith('chdir:'):
+ os.chdir(inst[6:])
elif inst != 'none':
raise error.Abort(_('invalid value for --daemon-postexec: %s')
% inst)
More information about the Mercurial-devel
mailing list