changegroup: inline _close()
authorGregory Szorc <gregory.szorc@gmail.com>
Tue, 07 Aug 2018 14:53:42 -0700
changeset 39002 eb8a0139ace3
parent 39001 a6e1ff40e335
child 39003 58377518201c
changegroup: inline _close() Now that it doesn't clear self._clrevtolocalrev on every invocation and is a simple one-liner that calls another function, we can do away with this method and inline its content into all call sites. Differential Revision: https://phab.mercurial-scm.org/D4194
mercurial/changegroup.py
--- a/mercurial/changegroup.py	Tue Aug 07 14:52:00 2018 -0700
+++ b/mercurial/changegroup.py	Tue Aug 07 14:53:42 2018 -0700
@@ -658,9 +658,6 @@
         else:
             self._verbosenote = lambda s: None
 
-    def _close(self):
-        return closechunk()
-
     def group(self, revs, store, ischangelog, lookup, units=None,
               clrevtolocalrev=None):
         """Calculate a delta group, yielding a sequence of changegroup chunks
@@ -678,7 +675,7 @@
         """
         # if we don't have any revisions touched by these changesets, bail
         if len(revs) == 0:
-            yield self._close()
+            yield closechunk()
             return
 
         cl = self._repo.changelog
@@ -729,7 +726,8 @@
 
         if progress:
             progress.complete()
-        yield self._close()
+
+        yield closechunk()
 
     # filter any nodes that claim to be part of the known set
     def _prune(self, store, missing, commonrevs):
@@ -819,7 +817,7 @@
                                         fnodes, clrevs):
             yield chunk
 
-        yield self._close()
+        yield closechunk()
 
         if clnodes:
             repo.hook('outgoing', node=hex(clnodes[0]), source=source)