##// END OF EJS Templates
serve: accept multiple values for --daemon-postexec...
Jun Wu -
r28451:c90cfe76 default
parent child Browse files
Show More
@@ -827,16 +827,17 b' def service(opts, parentfn=None, initfn='
827 827 writepid(util.getpid())
828 828
829 829 if opts['daemon_postexec']:
830 inst = opts['daemon_postexec']
831 830 try:
832 831 os.setsid()
833 832 except AttributeError:
834 833 pass
835 if inst.startswith('unlink:'):
836 lockpath = inst[7:]
837 os.unlink(lockpath)
838 elif inst != 'none':
839 raise error.Abort(_('invalid value for --daemon-postexec'))
834 for inst in opts['daemon_postexec']:
835 if inst.startswith('unlink:'):
836 lockpath = inst[7:]
837 os.unlink(lockpath)
838 elif inst != 'none':
839 raise error.Abort(_('invalid value for --daemon-postexec: %s')
840 % inst)
840 841 util.hidewindow()
841 842 sys.stdout.flush()
842 843 sys.stderr.flush()
@@ -6320,7 +6320,7 b' def root(ui, repo):'
6320 6320 [('A', 'accesslog', '', _('name of access log file to write to'),
6321 6321 _('FILE')),
6322 6322 ('d', 'daemon', None, _('run server in background')),
6323 ('', 'daemon-postexec', '', _('used internally by daemon mode')),
6323 ('', 'daemon-postexec', [], _('used internally by daemon mode')),
6324 6324 ('E', 'errorlog', '', _('name of error log file to write to'), _('FILE')),
6325 6325 # use string type, then we can check if something was passed
6326 6326 ('p', 'port', '', _('port to listen on (default: 8000)'), _('PORT')),
@@ -38,7 +38,7 b" if __name__ == '__main__':"
38 38 parser.add_option('-f', '--foreground', dest='foreground',
39 39 action='store_true',
40 40 help='do not start the HTTP server in the background')
41 parser.add_option('--daemon-postexec')
41 parser.add_option('--daemon-postexec', action='append')
42 42
43 43 (options, args) = parser.parse_args()
44 44
General Comments 0
You need to be logged in to leave comments. Login now