Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commandserver.py @ 29532:dda6bf886839
commandserver: extract _cleanup() hook to clarify chg is doing differently
This makes it clear that chg needs its own way to unlink closed socket file.
I made a mistake in draft patches without noting the difference.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 22 May 2016 11:21:11 +0900 |
parents | e5b4d79a9140 |
children | 6011ad3b0a42 |
line wrap: on
line diff
--- a/mercurial/commandserver.py Sat May 21 17:06:39 2016 +0900 +++ b/mercurial/commandserver.py Sun May 22 11:21:11 2016 +0900 @@ -403,11 +403,14 @@ self.ui.status(_('listening at %s\n') % self.address) self.ui.flush() # avoid buffering of status message + def _cleanup(self): + os.unlink(self.address) + def run(self): try: self.server.serve_forever() finally: - os.unlink(self.address) + self._cleanup() _servicemap = { 'pipe': pipeservice,