equal
deleted
inserted
replaced
3 # Copyright 2005-2007 Olivia Mackall <olivia@selenic.com> |
3 # Copyright 2005-2007 Olivia Mackall <olivia@selenic.com> |
4 # |
4 # |
5 # This software may be used and distributed according to the terms of the |
5 # This software may be used and distributed according to the terms of the |
6 # GNU General Public License version 2 or any later version. |
6 # GNU General Public License version 2 or any later version. |
7 |
7 |
8 from __future__ import absolute_import |
|
9 |
8 |
10 import os |
9 import os |
11 |
10 |
12 from .i18n import _ |
11 from .i18n import _ |
13 from .pycompat import open |
12 from .pycompat import open |
91 if not runargs: |
90 if not runargs: |
92 runargs = procutil.hgcmd() + pycompat.sysargv[1:] |
91 runargs = procutil.hgcmd() + pycompat.sysargv[1:] |
93 runargs.append(b'--daemon-postexec=unlink:%s' % lockpath) |
92 runargs.append(b'--daemon-postexec=unlink:%s' % lockpath) |
94 # Don't pass --cwd to the child process, because we've already |
93 # Don't pass --cwd to the child process, because we've already |
95 # changed directory. |
94 # changed directory. |
96 for i in pycompat.xrange(1, len(runargs)): |
95 for i in range(1, len(runargs)): |
97 if runargs[i].startswith(b'--cwd='): |
96 if runargs[i].startswith(b'--cwd='): |
98 del runargs[i] |
97 del runargs[i] |
99 break |
98 break |
100 elif runargs[i].startswith(b'--cwd'): |
99 elif runargs[i].startswith(b'--cwd'): |
101 del runargs[i : i + 2] |
100 del runargs[i : i + 2] |