comparison mercurial/sshserver.py @ 12703:40bb5853fc4b

wireproto: introduce pusherr() to deal with "unsynced changes" error The behaviour between http and ssh still differ: - the "unsynced changes" is seen as a remote output in the http cases - but it is correctly seen as a push error for ssh
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Mon, 11 Oct 2010 12:45:36 -0500
parents 6a6149487817
children cc9bf81382f5
comparison
equal deleted inserted replaced
12702:f747c085b789 12703:40bb5853fc4b
77 77
78 def sendpushresponse(self, rsp): 78 def sendpushresponse(self, rsp):
79 self.sendresponse('') 79 self.sendresponse('')
80 self.sendresponse(str(rsp.res)) 80 self.sendresponse(str(rsp.res))
81 81
82 def sendpusherror(self, rsp):
83 self.sendresponse(rsp.res)
84
82 def serve_forever(self): 85 def serve_forever(self):
83 try: 86 try:
84 while self.serve_one(): 87 while self.serve_one():
85 pass 88 pass
86 finally: 89 finally:
90 93
91 handlers = { 94 handlers = {
92 str: sendresponse, 95 str: sendresponse,
93 wireproto.streamres: sendstream, 96 wireproto.streamres: sendstream,
94 wireproto.pushres: sendpushresponse, 97 wireproto.pushres: sendpushresponse,
98 wireproto.pusherr: sendpusherror,
95 } 99 }
96 100
97 def serve_one(self): 101 def serve_one(self):
98 cmd = self.fin.readline()[:-1] 102 cmd = self.fin.readline()[:-1]
99 if cmd and cmd in wireproto.commands: 103 if cmd and cmd in wireproto.commands: