wireproto: do not abort after successful lookup
authorKyle Lippincott <spectral@google.com>
Fri, 01 Sep 2017 14:00:13 -0700
changeset 34062 6c6169f71b8d
parent 34061 11499bad0359
child 34063 941c33cfde81
wireproto: do not abort after successful lookup As far as I can tell, this interface originally used 'return' here, so the "fallthrough" to self._abort made sense. When it was switched to 'yield' this didn't make sense, but doesn't impact most uses because the 'plain' wrapper in peer.py's 'batchable' decorator only attempts to yield two items (args and value). When using iterbatch, however, it attempts to verify that the @batchable generators only emit 2 results, by expecting a StopIteration when attempting to access a third. Differential Revision: https://phab.mercurial-scm.org/D608
mercurial/wireproto.py
--- a/mercurial/wireproto.py	Fri Sep 01 16:44:30 2017 -0700
+++ b/mercurial/wireproto.py	Fri Sep 01 14:00:13 2017 -0700
@@ -235,7 +235,8 @@
         success, data = d[:-1].split(" ", 1)
         if int(success):
             yield bin(data)
-        self._abort(error.RepoError(data))
+        else:
+            self._abort(error.RepoError(data))
 
     @batchable
     def heads(self):