comparison mercurial/cmdutil.py @ 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 5508cf9a52fe
comparison
equal deleted inserted replaced
28451:c90cfe76e024 28452:0bb01c8754bf
833 pass 833 pass
834 for inst in opts['daemon_postexec']: 834 for inst in opts['daemon_postexec']:
835 if inst.startswith('unlink:'): 835 if inst.startswith('unlink:'):
836 lockpath = inst[7:] 836 lockpath = inst[7:]
837 os.unlink(lockpath) 837 os.unlink(lockpath)
838 elif inst.startswith('chdir:'):
839 os.chdir(inst[6:])
838 elif inst != 'none': 840 elif inst != 'none':
839 raise error.Abort(_('invalid value for --daemon-postexec: %s') 841 raise error.Abort(_('invalid value for --daemon-postexec: %s')
840 % inst) 842 % inst)
841 util.hidewindow() 843 util.hidewindow()
842 sys.stdout.flush() 844 sys.stdout.flush()