Patchwork D10657: sidedata: use the "feature" to detect that sidedata are enabled

login
register
mail settings
Submitter phabricator
Date May 4, 2021, 2:20 p.m.
Message ID <differential-rev-PHID-DREV-zqffv7lgkq7jjnflx2ou-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48978/
State Superseded
Headers show

Comments

phabricator - May 4, 2021, 2:20 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This is more versatile than relying on the revlogv2 requirements.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -3366,7 +3366,7 @@ 
         return self.pathto(fp.name[len(self.root) + 1 :])
 
     def register_wanted_sidedata(self, category):
-        if requirementsmod.REVLOGV2_REQUIREMENT not in self.requirements:
+        if repository.REPO_FEATURE_SIDE_DATA not in self.features:
             # Only revlogv2 repos can want sidedata.
             return
         self._wanted_sidedata.add(pycompat.bytestr(category))