Mercurial > hg
comparison mercurial/phases.py @ 45372:77b8588dd84e
requirements: introduce new requirements related module
It was not clear where all requirements should and related APIs should be, this
patch introduces a requirements module which will have all exitsing requirements
and related APIs.
Differential Revision: https://phab.mercurial-scm.org/D8917
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sat, 08 Aug 2020 16:24:12 +0530 |
parents | f025b97f3758 |
children | 29a259be6424 |
comparison
equal
deleted
inserted
replaced
45371:e58e234096de | 45372:77b8588dd84e |
---|---|
119 setattr, | 119 setattr, |
120 ) | 120 ) |
121 from . import ( | 121 from . import ( |
122 error, | 122 error, |
123 pycompat, | 123 pycompat, |
124 requirements, | |
124 smartset, | 125 smartset, |
125 txnutil, | 126 txnutil, |
126 util, | 127 util, |
127 ) | 128 ) |
128 from .interfaces import repository | |
129 | 129 |
130 _fphasesentry = struct.Struct(b'>i20s') | 130 _fphasesentry = struct.Struct(b'>i20s') |
131 | 131 |
132 # record phase index | 132 # record phase index |
133 public, draft, secret = range(3) | 133 public, draft, secret = range(3) |
153 localhiddenphases = (internal, archived) | 153 localhiddenphases = (internal, archived) |
154 | 154 |
155 | 155 |
156 def supportinternal(repo): | 156 def supportinternal(repo): |
157 """True if the internal phase can be used on a repository""" | 157 """True if the internal phase can be used on a repository""" |
158 return repository.INTERNAL_PHASE_REQUIREMENT in repo.requirements | 158 return requirements.INTERNAL_PHASE_REQUIREMENT in repo.requirements |
159 | 159 |
160 | 160 |
161 def _readroots(repo, phasedefaults=None): | 161 def _readroots(repo, phasedefaults=None): |
162 """Read phase roots from disk | 162 """Read phase roots from disk |
163 | 163 |