diff mercurial/commandserver.py @ 37995:6f9ac3cb0987

dispatch: unify handling of None returned by a command function A command function may return None in place of 0 just for convenience, but dispatch() doesn't need to inherit that property. This patch makes it be friendly to callers.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 12 May 2018 15:33:09 +0900
parents 6715e8035b4f
children c07424ec633c
line wrap: on
line diff
--- a/mercurial/commandserver.py	Fri May 11 21:23:48 2018 -0700
+++ b/mercurial/commandserver.py	Sat May 12 15:33:09 2018 +0900
@@ -256,7 +256,7 @@
                                self.cout, self.cerr)
 
         try:
-            ret = (dispatch.dispatch(req) or 0) & 255 # might return None
+            ret = dispatch.dispatch(req) & 255
             self.cresult.write(struct.pack('>i', int(ret)))
         finally:
             # restore old cwd