Patchwork D2488: narrow: move changegroup.supportedoutgoingversions() override to core

login
register
mail settings
Submitter phabricator
Date March 1, 2018, 2:17 a.m.
Message ID <15eb51ee52e4cf868c9555c3431b404c@localhost.localdomain>
Download mbox | patch
Permalink /patch/28519/
State Not Applicable
Headers show

Comments

phabricator - March 1, 2018, 2:17 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGbd947b538f0e: narrow: move changegroup.supportedoutgoingversions() override to core (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2488?vs=6188&id=6221

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

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

CHANGE DETAILS




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

Patch

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -898,6 +898,11 @@ 
         # support versions 01 and 02.
         versions.discard('01')
         versions.discard('02')
+    if NARROW_REQUIREMENT in repo.requirements:
+        # Versions 01 and 02 don't support revlog flags, and we need to
+        # support that for stripping and unbundling to work.
+        versions.discard('01')
+        versions.discard('02')
     return versions
 
 def localversion(repo):
diff --git a/hgext/narrow/narrowchangegroup.py b/hgext/narrow/narrowchangegroup.py
--- a/hgext/narrow/narrowchangegroup.py
+++ b/hgext/narrow/narrowchangegroup.py
@@ -21,16 +21,6 @@ 
 
 def setup():
 
-    def supportedoutgoingversions(orig, repo):
-        versions = orig(repo)
-        if changegroup.NARROW_REQUIREMENT in repo.requirements:
-            versions.discard('01')
-            versions.discard('02')
-        return versions
-
-    extensions.wrapfunction(changegroup, 'supportedoutgoingversions',
-                            supportedoutgoingversions)
-
     def prune(orig, self, revlog, missing, commonrevs):
         if isinstance(revlog, manifest.manifestrevlog):
             matcher = getattr(self._repo, 'narrowmatch',