changeset 19866:993b24488679

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.
author Siddharth Agarwal <sid0@fb.com>
date Wed, 02 Oct 2013 14:20:26 -0700
parents ba6577a19656
children edce20ebe1f3
files hgext/inotify/server.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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()