comparison mercurial/phases.py @ 45356:f025b97f3758

repository: introduce constant for internal phase repo requirement and use it In future we will like to much cleaner logic around which requirement is for working copy and which can go in store. To start with that, we first need to de-clutter the requirement values spread around and replace them with constants. Differential Revision: https://phab.mercurial-scm.org/D8912
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 07 Aug 2020 18:01:48 +0530
parents 61e7464477ac
children 77b8588dd84e
comparison
equal deleted inserted replaced
45355:a1f51c7dce0f 45356:f025b97f3758
123 pycompat, 123 pycompat,
124 smartset, 124 smartset,
125 txnutil, 125 txnutil,
126 util, 126 util,
127 ) 127 )
128 from .interfaces import repository
128 129
129 _fphasesentry = struct.Struct(b'>i20s') 130 _fphasesentry = struct.Struct(b'>i20s')
130 131
131 # record phase index 132 # record phase index
132 public, draft, secret = range(3) 133 public, draft, secret = range(3)
152 localhiddenphases = (internal, archived) 153 localhiddenphases = (internal, archived)
153 154
154 155
155 def supportinternal(repo): 156 def supportinternal(repo):
156 """True if the internal phase can be used on a repository""" 157 """True if the internal phase can be used on a repository"""
157 return b'internal-phase' in repo.requirements 158 return repository.INTERNAL_PHASE_REQUIREMENT in repo.requirements
158 159
159 160
160 def _readroots(repo, phasedefaults=None): 161 def _readroots(repo, phasedefaults=None):
161 """Read phase roots from disk 162 """Read phase roots from disk
162 163