442 raise ImportError |
444 raise ImportError |
443 |
445 |
444 master = _server.master |
446 master = _server.master |
445 |
447 |
446 def start(ui, dirstate, root, opts): |
448 def start(ui, dirstate, root, opts): |
447 timeout = opts.get('timeout') |
449 timeout = opts.get('idle_timeout') |
448 if timeout: |
450 if timeout: |
449 timeout = float(timeout) * 1e3 |
451 timeout = float(timeout) * 60000 |
|
452 else: |
|
453 timeout = None |
450 |
454 |
451 class service(object): |
455 class service(object): |
452 def init(self): |
456 def init(self): |
453 try: |
457 try: |
454 self.master = master(ui, dirstate, root, timeout) |
458 self.master = master(ui, dirstate, root, timeout) |
455 except AlreadyStartedException, inst: |
459 except AlreadyStartedException, inst: |
456 raise util.Abort("inotify-server: %s" % inst) |
460 raise util.Abort("inotify-server: %s" % inst) |
457 |
461 |
458 def run(self): |
462 def run(self): |
459 try: |
463 try: |
460 self.master.run() |
464 try: |
|
465 self.master.run() |
|
466 except TimeoutException: |
|
467 pass |
461 finally: |
468 finally: |
462 self.master.shutdown() |
469 self.master.shutdown() |
463 |
470 |
464 if 'inserve' not in sys.argv: |
471 if 'inserve' not in sys.argv: |
465 runargs = util.hgcmd() + ['inserve', '-R', root] |
472 runargs = util.hgcmd() + ['inserve', '-R', root] |