Show More
@@ -189,7 +189,7 b' static void execcmdserver(const struct c' | |||||
189 | "--cwd", "/", |
|
189 | "--cwd", "/", | |
190 | "--cmdserver", "chgunix", |
|
190 | "--cmdserver", "chgunix", | |
191 | "--address", opts->sockname, |
|
191 | "--address", opts->sockname, | |
192 |
"--daemon-p |
|
192 | "--daemon-postexec", opts->lockfile, | |
193 | "--pid-file", opts->pidfile, |
|
193 | "--pid-file", opts->pidfile, | |
194 | "--config", "extensions.chgserver=", |
|
194 | "--config", "extensions.chgserver=", | |
195 | /* wrap root ui so that it can be disabled/enabled by config */ |
|
195 | /* wrap root ui so that it can be disabled/enabled by config */ |
@@ -758,14 +758,14 b' def service(opts, parentfn=None, initfn=' | |||||
758 | fp.write(str(pid) + '\n') |
|
758 | fp.write(str(pid) + '\n') | |
759 | fp.close() |
|
759 | fp.close() | |
760 |
|
760 | |||
761 |
if opts['daemon'] and not opts['daemon_p |
|
761 | if opts['daemon'] and not opts['daemon_postexec']: | |
762 | # Signal child process startup with file removal |
|
762 | # Signal child process startup with file removal | |
763 | lockfd, lockpath = tempfile.mkstemp(prefix='hg-service-') |
|
763 | lockfd, lockpath = tempfile.mkstemp(prefix='hg-service-') | |
764 | os.close(lockfd) |
|
764 | os.close(lockfd) | |
765 | try: |
|
765 | try: | |
766 | if not runargs: |
|
766 | if not runargs: | |
767 | runargs = util.hgcmd() + sys.argv[1:] |
|
767 | runargs = util.hgcmd() + sys.argv[1:] | |
768 |
runargs.append('--daemon-p |
|
768 | runargs.append('--daemon-postexec=%s' % lockpath) | |
769 | # Don't pass --cwd to the child process, because we've already |
|
769 | # Don't pass --cwd to the child process, because we've already | |
770 | # changed directory. |
|
770 | # changed directory. | |
771 | for i in xrange(1, len(runargs)): |
|
771 | for i in xrange(1, len(runargs)): | |
@@ -798,8 +798,8 b' def service(opts, parentfn=None, initfn=' | |||||
798 | if not opts['daemon']: |
|
798 | if not opts['daemon']: | |
799 | writepid(util.getpid()) |
|
799 | writepid(util.getpid()) | |
800 |
|
800 | |||
801 |
if opts['daemon_p |
|
801 | if opts['daemon_postexec']: | |
802 |
lockpath = opts['daemon_p |
|
802 | lockpath = opts['daemon_postexec'] | |
803 | try: |
|
803 | try: | |
804 | os.setsid() |
|
804 | os.setsid() | |
805 | except AttributeError: |
|
805 | except AttributeError: |
@@ -6208,7 +6208,7 b' def root(ui, repo):' | |||||
6208 | [('A', 'accesslog', '', _('name of access log file to write to'), |
|
6208 | [('A', 'accesslog', '', _('name of access log file to write to'), | |
6209 | _('FILE')), |
|
6209 | _('FILE')), | |
6210 | ('d', 'daemon', None, _('run server in background')), |
|
6210 | ('d', 'daemon', None, _('run server in background')), | |
6211 |
('', 'daemon-p |
|
6211 | ('', 'daemon-postexec', '', _('used internally by daemon mode')), | |
6212 | ('E', 'errorlog', '', _('name of error log file to write to'), _('FILE')), |
|
6212 | ('E', 'errorlog', '', _('name of error log file to write to'), _('FILE')), | |
6213 | # use string type, then we can check if something was passed |
|
6213 | # use string type, then we can check if something was passed | |
6214 | ('p', 'port', '', _('port to listen on (default: 8000)'), _('PORT')), |
|
6214 | ('p', 'port', '', _('port to listen on (default: 8000)'), _('PORT')), |
@@ -38,7 +38,7 b" if __name__ == '__main__':" | |||||
38 | parser.add_option('-f', '--foreground', dest='foreground', |
|
38 | parser.add_option('-f', '--foreground', dest='foreground', | |
39 | action='store_true', |
|
39 | action='store_true', | |
40 | help='do not start the HTTP server in the background') |
|
40 | help='do not start the HTTP server in the background') | |
41 |
parser.add_option('--daemon-p |
|
41 | parser.add_option('--daemon-postexec') | |
42 |
|
42 | |||
43 | (options, args) = parser.parse_args() |
|
43 | (options, args) = parser.parse_args() | |
44 |
|
44 | |||
@@ -49,7 +49,7 b" if __name__ == '__main__':" | |||||
49 |
|
49 | |||
50 | opts = {'pid_file': options.pid, |
|
50 | opts = {'pid_file': options.pid, | |
51 | 'daemon': not options.foreground, |
|
51 | 'daemon': not options.foreground, | |
52 |
'daemon_p |
|
52 | 'daemon_postexec': options.daemon_postexec} | |
53 | service = simplehttpservice(options.host, options.port) |
|
53 | service = simplehttpservice(options.host, options.port) | |
54 | cmdutil.service(opts, initfn=service.init, runfn=service.run, |
|
54 | cmdutil.service(opts, initfn=service.init, runfn=service.run, | |
55 | runargs=[sys.executable, __file__] + sys.argv[1:]) |
|
55 | runargs=[sys.executable, __file__] + sys.argv[1:]) |
@@ -158,7 +158,7 b' Show the options for the "serve" command' | |||||
158 | --config |
|
158 | --config | |
159 | --cwd |
|
159 | --cwd | |
160 | --daemon |
|
160 | --daemon | |
161 |
--daemon-p |
|
161 | --daemon-postexec | |
162 | --debug |
|
162 | --debug | |
163 | --debugger |
|
163 | --debugger | |
164 | --encoding |
|
164 | --encoding | |
@@ -218,7 +218,7 b' Show all commands + options' | |||||
218 | pull: update, force, rev, bookmark, branch, ssh, remotecmd, insecure |
|
218 | pull: update, force, rev, bookmark, branch, ssh, remotecmd, insecure | |
219 | push: force, rev, bookmark, branch, new-branch, ssh, remotecmd, insecure |
|
219 | push: force, rev, bookmark, branch, new-branch, ssh, remotecmd, insecure | |
220 | remove: after, force, subrepos, include, exclude |
|
220 | remove: after, force, subrepos, include, exclude | |
221 |
serve: accesslog, daemon, daemon-p |
|
221 | serve: accesslog, daemon, daemon-postexec, errorlog, port, address, prefix, name, web-conf, webdir-conf, pid-file, stdio, cmdserver, templates, style, ipv6, certificate | |
222 | status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, copies, print0, rev, change, include, exclude, subrepos, template |
|
222 | status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, copies, print0, rev, change, include, exclude, subrepos, template | |
223 | summary: remote |
|
223 | summary: remote | |
224 | update: clean, check, date, rev, tool |
|
224 | update: clean, check, date, rev, tool |
General Comments 0
You need to be logged in to leave comments.
Login now