serve: add chdir command for --daemon-postexec
authorJun Wu <quark@fb.com>
Wed, 09 Mar 2016 01:17:02 +0000
changeset 28452 0bb01c8754bf
parent 28451 c90cfe76e024
child 28453 8a7110e351ec
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.
mercurial/cmdutil.py
--- 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)