Patchwork D4064: changegroup: move close() from narrow

login
register
mail settings
Submitter phabricator
Date Aug. 6, 2018, 6:56 a.m.
Message ID <a217ae47edc28b494f352fc6b35070f5@localhost.localdomain>
Download mbox | patch
Permalink /patch/33288/
State Not Applicable
Headers show

Comments

phabricator - Aug. 6, 2018, 6:56 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG75d6139e69f9: changegroup: move close() from narrow (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4064?vs=9804&id=9946

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

AFFECTED FILES
  hgext/narrow/narrowchangegroup.py
  mercurial/changegroup.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -544,6 +544,13 @@ 
             self._verbosenote = lambda s: None
 
     def close(self):
+        # Ellipses serving mode.
+        getattr(self, 'clrev_to_localrev', {}).clear()
+        if getattr(self, 'next_clrev_to_localrev', {}):
+            self.clrev_to_localrev = self.next_clrev_to_localrev
+            del self.next_clrev_to_localrev
+        self.changelog_done = True
+
         return closechunk()
 
     def fileheader(self, fname):
diff --git a/hgext/narrow/narrowchangegroup.py b/hgext/narrow/narrowchangegroup.py
--- a/hgext/narrow/narrowchangegroup.py
+++ b/hgext/narrow/narrowchangegroup.py
@@ -51,15 +51,6 @@ 
     extensions.wrapfunction(
         changegroup.cg1packer, 'generatefiles', generatefiles)
 
-    def close(orig, self):
-        getattr(self, 'clrev_to_localrev', {}).clear()
-        if getattr(self, 'next_clrev_to_localrev', {}):
-            self.clrev_to_localrev = self.next_clrev_to_localrev
-            del self.next_clrev_to_localrev
-        self.changelog_done = True
-        return orig(self)
-    extensions.wrapfunction(changegroup.cg1packer, 'close', close)
-
     # In a perfect world, we'd generate better ellipsis-ified graphs
     # for non-changelog revlogs. In practice, we haven't started doing
     # that yet, so the resulting DAGs for the manifestlog and filelogs