Mercurial > hg > mercurial-source
changeset 9898:b5170b8b32a5
merge with stable
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Fri, 20 Nov 2009 02:34:56 +0100 |
parents | 30a2aa8e5290 (current diff) 97eda2133a9b (diff) |
children | cb2a1836c50a 0ebef7e813df |
files | |
diffstat | 6 files changed, 28 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/inotify/server.py +++ b/hgext/inotify/server.py @@ -849,9 +849,14 @@ finally: self.master.shutdown() - runargs = None if 'inserve' not in sys.argv: runargs = [sys.argv[0], 'inserve', '-R', root] + else: + runargs = sys.argv[:] + + pidfile = ui.config('inotify', 'pidfile') + if opts['daemon'] and pidfile is not None and 'pid-file' not in runargs: + runargs.append("--pid-file=%s" % pidfile) service = service() logfile = ui.config('inotify', 'log')
--- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -571,7 +571,7 @@ if parentfn: return parentfn(pid) else: - os._exit(0) + return if initfn: initfn()
--- a/tests/test-inotify +++ b/tests/test-inotify @@ -2,7 +2,8 @@ "$TESTDIR/hghave" inotify || exit 80 -hg init +hg init repo1 +cd repo1 touch a b c d e mkdir dir @@ -10,10 +11,22 @@ touch dir/x dir/y dir/bar/foo hg ci -Am m +cd .. +hg clone repo1 repo2 echo "[extensions]" >> $HGRCPATH echo "inotify=" >> $HGRCPATH +cd repo2 +echo b >> a +# check that daemon started automatically works correctly +# and make sure that inotify.pidfile works +hg --config "inotify.pidfile=../hg2.pid" status + +# make sure that pidfile worked. Output should be silent. +kill `cat ../hg2.pid` + +cd ../repo1 echo % inserve hg inserve -d --pid-file=hg.pid cat hg.pid >> "$DAEMON_PIDS"
--- a/tests/test-inotify-dirty-dirstate +++ b/tests/test-inotify-dirty-dirstate @@ -20,10 +20,10 @@ cd .. -hg --config "extensions.inotify=!" clone test test2 +hg --config "inotify.pidfile=../hg2.pid" clone test test2 +cat ../hg2.pid >> "$DAEMON_PIDS" + cd test2 -hg inserve -d --pid-file=../hg2.pid -cat ../hg2.pid >> "$DAEMON_PIDS" echo bar > bar hg add hg ci -m bar