changeset 28452:0bb01c8754bf

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.
author Jun Wu <quark@fb.com>
date Wed, 09 Mar 2016 01:17:02 +0000
parents c90cfe76e024
children 8a7110e351ec
files mercurial/cmdutil.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)