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.
--- a/mercurial/cmdutil.py Wed Mar 09 02:07:40 2016 +0000
+++ b/mercurial/cmdutil.py Wed Mar 09 01:17:02 2016 +0000
@@ -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)