hgext/chgserver.py
changeset 28516 3bf2892f685f
parent 28514 0747ef2c4ab2
child 28535 aa082a8125da
equal deleted inserted replaced
28515:491eabd0df79 28516:3bf2892f685f
   427         An instruction string could be either:
   427         An instruction string could be either:
   428             - "unlink $path", the client should unlink the path to stop the
   428             - "unlink $path", the client should unlink the path to stop the
   429               outdated server.
   429               outdated server.
   430             - "redirect $path", the client should try to connect to another
   430             - "redirect $path", the client should try to connect to another
   431               server instead.
   431               server instead.
       
   432             - "exit $n", the client should exit directly with code n.
       
   433               This may happen if we cannot parse the config.
   432         """
   434         """
   433         args = self._readlist()
   435         args = self._readlist()
   434         self.ui = _renewui(self.ui, args)
   436         try:
       
   437             self.ui = _renewui(self.ui, args)
       
   438         except error.ParseError as inst:
       
   439             dispatch._formatparse(self.ui.warn, inst)
       
   440             self.ui.flush()
       
   441             self.cresult.write('exit 255')
       
   442             return
   435         newhash = hashstate.fromui(self.ui, self.hashstate.mtimepaths)
   443         newhash = hashstate.fromui(self.ui, self.hashstate.mtimepaths)
   436         insts = []
   444         insts = []
   437         if newhash.mtimehash != self.hashstate.mtimehash:
   445         if newhash.mtimehash != self.hashstate.mtimehash:
   438             addr = _hashaddress(self.baseaddress, self.hashstate.confighash)
   446             addr = _hashaddress(self.baseaddress, self.hashstate.confighash)
   439             insts.append('unlink %s' % addr)
   447             insts.append('unlink %s' % addr)