Mercurial > hg
comparison mercurial/chgserver.py @ 40875:e7110f44ee2d
commandserver: pass around option to hook repo instance creation
This is necessary to wrap a repo instance so the master process will be
notified on repo.close().
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 31 Oct 2018 21:57:11 +0900 |
parents | 25e9089c7686 |
children | cf8677cd7286 |
comparison
equal
deleted
inserted
replaced
40874:348352658e4b | 40875:e7110f44ee2d |
---|---|
311 ('cout', 'fout', r'wb'), | 311 ('cout', 'fout', r'wb'), |
312 ('cerr', 'ferr', r'wb'), | 312 ('cerr', 'ferr', r'wb'), |
313 ] | 313 ] |
314 | 314 |
315 class chgcmdserver(commandserver.server): | 315 class chgcmdserver(commandserver.server): |
316 def __init__(self, ui, repo, fin, fout, sock, hashstate, baseaddress): | 316 def __init__(self, ui, repo, fin, fout, sock, prereposetups, |
317 hashstate, baseaddress): | |
317 super(chgcmdserver, self).__init__( | 318 super(chgcmdserver, self).__init__( |
318 _newchgui(ui, channeledsystem(fin, fout, 'S'), self.attachio), | 319 _newchgui(ui, channeledsystem(fin, fout, 'S'), self.attachio), |
319 repo, fin, fout) | 320 repo, fin, fout, prereposetups) |
320 self.clientsock = sock | 321 self.clientsock = sock |
321 self._ioattached = False | 322 self._ioattached = False |
322 self._oldios = [] # original (self.ch, ui.fp, fd) before "attachio" | 323 self._oldios = [] # original (self.ch, ui.fp, fd) before "attachio" |
323 self.hashstate = hashstate | 324 self.hashstate = hashstate |
324 self.baseaddress = baseaddress | 325 self.baseaddress = baseaddress |
615 return False | 616 return False |
616 | 617 |
617 def newconnection(self): | 618 def newconnection(self): |
618 self._lastactive = time.time() | 619 self._lastactive = time.time() |
619 | 620 |
620 def createcmdserver(self, repo, conn, fin, fout): | 621 def createcmdserver(self, repo, conn, fin, fout, prereposetups): |
621 return chgcmdserver(self.ui, repo, fin, fout, conn, | 622 return chgcmdserver(self.ui, repo, fin, fout, conn, prereposetups, |
622 self._hashstate, self._baseaddress) | 623 self._hashstate, self._baseaddress) |
623 | 624 |
624 def chgunixservice(ui, repo, opts): | 625 def chgunixservice(ui, repo, opts): |
625 # CHGINTERNALMARK is set by chg client. It is an indication of things are | 626 # CHGINTERNALMARK is set by chg client. It is an indication of things are |
626 # started by chg so other code can do things accordingly, like disabling | 627 # started by chg so other code can do things accordingly, like disabling |