inotify: add pidfile to parent options
authorSiddharth Agarwal <sid0@fb.com>
Wed, 02 Oct 2013 14:20:26 -0700
changeset 19866 993b24488679
parent 19865 ba6577a19656
child 19867 edce20ebe1f3
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.
hgext/inotify/server.py
--- a/hgext/inotify/server.py	Wed Oct 02 22:46:32 2013 +0100
+++ b/hgext/inotify/server.py	Wed Oct 02 14:20:26 2013 -0700
@@ -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()