[Updated] D8912: repository: introduce constant for internal phase repo requirement and use it

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Sat Aug 8 17:30:25 UTC 2020


Closed by commit rHGf025b97f3758: repository: introduce constant for internal phase repo requirement and use it (authored by pulkit).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8912?vs=22326&id=22355

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8912/new/

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

AFFECTED FILES
  mercurial/interfaces/repository.py
  mercurial/localrepo.py
  mercurial/phases.py

CHANGE DETAILS

diff --git a/mercurial/phases.py b/mercurial/phases.py
--- a/mercurial/phases.py
+++ b/mercurial/phases.py
@@ -125,6 +125,7 @@
     txnutil,
     util,
 )
+from .interfaces import repository
 
 _fphasesentry = struct.Struct(b'>i20s')
 
@@ -154,7 +155,7 @@
 
 def supportinternal(repo):
     """True if the internal phase can be used on a repository"""
-    return b'internal-phase' in repo.requirements
+    return repository.INTERNAL_PHASE_REQUIREMENT in repo.requirements
 
 
 def _readroots(repo, phasedefaults=None):
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1068,7 +1068,7 @@
         b'relshared',
         b'dotencode',
         repository.SPARSE_REQUIREMENT,
-        b'internal-phase',
+        repository.INTERNAL_PHASE_REQUIREMENT,
     }
 
     # list of prefix for file which can be written without 'wlock'
@@ -3324,7 +3324,7 @@
         requirements.add(REVLOGV2_REQUIREMENT)
     # experimental config: format.internal-phase
     if ui.configbool(b'format', b'internal-phase'):
-        requirements.add(b'internal-phase')
+        requirements.add(repository.INTERNAL_PHASE_REQUIREMENT)
 
     if createopts.get(b'narrowfiles'):
         requirements.add(repository.NARROW_REQUIREMENT)
diff --git a/mercurial/interfaces/repository.py b/mercurial/interfaces/repository.py
--- a/mercurial/interfaces/repository.py
+++ b/mercurial/interfaces/repository.py
@@ -18,6 +18,10 @@
 # Enables sparse working directory usage
 SPARSE_REQUIREMENT = b'exp-sparse'
 
+# Enables the internal phase which is used to hide changesets instead
+# of stripping them
+INTERNAL_PHASE_REQUIREMENT = b'internal-phase'
+
 # Local repository feature string.
 
 # Revlogs are being used for file storage.



To: pulkit, #hg-reviewers, indygreg
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200808/13f8018f/attachment-0002.html>


More information about the Mercurial-patches mailing list