dirstate-item: use `any_tracked` more
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 01 Oct 2021 03:50:37 +0200
changeset 48111 d73b42f905f8
parent 48110 a88ecdeee4a1
child 48112 fabf687df0ff
dirstate-item: use `any_tracked` more This simplify more code.
mercurial/pure/parsers.py
--- a/mercurial/pure/parsers.py	Fri Oct 01 03:49:03 2021 +0200
+++ b/mercurial/pure/parsers.py	Fri Oct 01 03:50:37 2021 +0200
@@ -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')