##// END OF EJS Templates
commandserver: extract _cleanup() hook to clarify chg is doing differently...
Yuya Nishihara -
r29532:dda6bf88 default
parent child Browse files
Show More
@@ -651,10 +651,7 b' class chgunixservice(commandserver.unixs'
651 os.symlink(os.path.basename(self.address), tempaddress)
651 os.symlink(os.path.basename(self.address), tempaddress)
652 util.rename(tempaddress, self.baseaddress)
652 util.rename(tempaddress, self.baseaddress)
653
653
654 def run(self):
654 def _cleanup(self):
655 try:
656 self.server.serve_forever()
657 finally:
658 self.server.unlinksocketfile()
655 self.server.unlinksocketfile()
659
656
660 def uisetup(ui):
657 def uisetup(ui):
@@ -403,11 +403,14 b' class unixservice(object):'
403 self.ui.status(_('listening at %s\n') % self.address)
403 self.ui.status(_('listening at %s\n') % self.address)
404 self.ui.flush() # avoid buffering of status message
404 self.ui.flush() # avoid buffering of status message
405
405
406 def _cleanup(self):
407 os.unlink(self.address)
408
406 def run(self):
409 def run(self):
407 try:
410 try:
408 self.server.serve_forever()
411 self.server.serve_forever()
409 finally:
412 finally:
410 os.unlink(self.address)
413 self._cleanup()
411
414
412 _servicemap = {
415 _servicemap = {
413 'pipe': pipeservice,
416 'pipe': pipeservice,
General Comments 0
You need to be logged in to leave comments. Login now