Patchwork D11553: dirstate-item: use `any_tracked` more

login
register
mail settings
Submitter phabricator
Date Oct. 1, 2021, 6:40 p.m.
Message ID <differential-rev-PHID-DREV-ivglgny3zkcdok6cns2o-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49877/
State Superseded
Headers show

Comments

phabricator - Oct. 1, 2021, 6:40 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This simplify more code.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/pure/parsers.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/pure/parsers.py b/mercurial/pure/parsers.py
--- a/mercurial/pure/parsers.py
+++ b/mercurial/pure/parsers.py
@@ -305,7 +305,7 @@ 
         dirstatev1 format. It would make sense to ultimately deprecate it in
         favor of the more "semantic" attributes.
         """
-        if not (self._p1_tracked or self._p2_tracked or self._wc_tracked):
+        if not self.any_tracked:
             return b'?'
         return self.v1_state()
 
@@ -383,7 +383,7 @@ 
 
     def v1_size(self):
         """return a "size" suitable for v1 serialization"""
-        if not (self._p1_tracked or self._p2_tracked or self._wc_tracked):
+        if not self.any_tracked:
             # the object has no state to record, this is -currently-
             # unsupported
             raise RuntimeError('untracked item')
@@ -406,7 +406,7 @@ 
 
     def v1_mtime(self):
         """return a "mtime" suitable for v1 serialization"""
-        if not (self._p1_tracked or self._p2_tracked or self._wc_tracked):
+        if not self.any_tracked:
             # the object has no state to record, this is -currently-
             # unsupported
             raise RuntimeError('untracked item')