##// END OF EJS Templates
commandserver: restore cwd in case of exception...
Gregory Szorc -
r35670:40da2d7b default
parent child Browse files
Show More
@@ -247,13 +247,13 b' class server(object):'
247 req = dispatch.request(args[:], copiedui, self.repo, self.cin,
247 req = dispatch.request(args[:], copiedui, self.repo, self.cin,
248 self.cout, self.cerr)
248 self.cout, self.cerr)
249
249
250 ret = (dispatch.dispatch(req) or 0) & 255 # might return None
250 try:
251
251 ret = (dispatch.dispatch(req) or 0) & 255 # might return None
252 # restore old cwd
252 self.cresult.write(struct.pack('>i', int(ret)))
253 if '--cwd' in args:
253 finally:
254 os.chdir(self.cwd)
254 # restore old cwd
255
255 if '--cwd' in args:
256 self.cresult.write(struct.pack('>i', int(ret)))
256 os.chdir(self.cwd)
257
257
258 def getencoding(self):
258 def getencoding(self):
259 """ writes the current encoding to the result channel """
259 """ writes the current encoding to the result channel """
General Comments 0
You need to be logged in to leave comments. Login now