D4194: changegroup: inline _close()

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Thu Aug 9 18:52:28 UTC 2018


indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4194

AFFECTED FILES
  mercurial/changegroup.py

CHANGE DETAILS

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -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)



To: indygreg, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list