diff mercurial/cmdutil.py @ 28194:7623ba92af72

serve: rename --daemon-pipefds to --daemon-postexec (BC) Initially we use --daemon-pipefds to pass file descriptors for synchronization. Later, in order to support Windows, --daemon-pipefds is changed to accept a file path to unlink instead. The name is outdated since then. chg client is designed to use flock, which will be held before starting a server and until the client actually connects to the server it started. The unlink synchronization approach is not so helpful in this case. To address the issues, this patch renames pipefds to postexec and the following patch will allow the value of --daemon-postexec to be things like 'unlink:/path/to/file' or 'none'.
author Jun Wu <quark@fb.com>
date Mon, 22 Feb 2016 16:59:08 +0000
parents ed4d06f180b8
children 213c8cf02c49
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Mon Feb 22 23:18:19 2016 -0800
+++ b/mercurial/cmdutil.py	Mon Feb 22 16:59:08 2016 +0000
@@ -758,14 +758,14 @@
             fp.write(str(pid) + '\n')
             fp.close()
 
-    if opts['daemon'] and not opts['daemon_pipefds']:
+    if opts['daemon'] and not opts['daemon_postexec']:
         # Signal child process startup with file removal
         lockfd, lockpath = tempfile.mkstemp(prefix='hg-service-')
         os.close(lockfd)
         try:
             if not runargs:
                 runargs = util.hgcmd() + sys.argv[1:]
-            runargs.append('--daemon-pipefds=%s' % lockpath)
+            runargs.append('--daemon-postexec=%s' % lockpath)
             # Don't pass --cwd to the child process, because we've already
             # changed directory.
             for i in xrange(1, len(runargs)):
@@ -798,8 +798,8 @@
     if not opts['daemon']:
         writepid(util.getpid())
 
-    if opts['daemon_pipefds']:
-        lockpath = opts['daemon_pipefds']
+    if opts['daemon_postexec']:
+        lockpath = opts['daemon_postexec']
         try:
             os.setsid()
         except AttributeError: