[PATCH 1 of 4] inotify: add pidfile to parent options

Siddharth Agarwal sid0 at fb.com
Wed Oct 2 23:19:43 UTC 2013


# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1380748826 25200
#      Wed Oct 02 14:20:26 2013 -0700
# Node ID 63a4ad5b170b08c5b1b33b992710c3da3b518b16
# Parent  35400b87043aefd7fea1d8b29059172c6d63130e
inotify: add pidfile to parent options

An upcoming patch will move pidfile writing from the parent to the child. This
means that if the pid file isn't specified on the command-line but is specified
as a config option, it needs to be added to the parent's opts dict.

diff --git a/hgext/inotify/server.py b/hgext/inotify/server.py
--- a/hgext/inotify/server.py
+++ b/hgext/inotify/server.py
@@ -451,7 +451,9 @@
         runargs = util.hgcmd() + sys.argv[1:]
 
     pidfile = ui.config('inotify', 'pidfile')
-    if opts['daemon'] and pidfile is not None and 'pid-file' not in runargs:
+    opts.setdefault('pid_file', '')
+    if opts['daemon'] and pidfile is not None and not opts['pid_file']:
+        opts['pid_file'] = pidfile
         runargs.append("--pid-file=%s" % pidfile)
 
     service = service()



More information about the Mercurial-devel mailing list