[Commented On] D11363: dirstate-item: have all the logic go through the v1_ accessors
baymax (Baymax, Your Personal Patch-care Companion)
phabricator at mercurial-scm.org
Mon Aug 30 13:00:19 UTC 2021
baymax added a comment.
baymax updated this revision to Diff 30140.
✅ refresh by Heptapod after a successful CI run (🐙 💚)
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D11363?vs=30118&id=30140
BRANCH
default
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D11363/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D11363
AFFECTED FILES
mercurial/pure/parsers.py
CHANGE DETAILS
diff --git a/mercurial/pure/parsers.py b/mercurial/pure/parsers.py
--- a/mercurial/pure/parsers.py
+++ b/mercurial/pure/parsers.py
@@ -225,15 +225,15 @@
@property
def mode(self):
- return self._mode
+ return self.v1_mode()
@property
def size(self):
- return self._size
+ return self.v1_size()
@property
def mtime(self):
- return self._mtime
+ return self.v1_mtime()
@property
def state(self):
@@ -248,17 +248,17 @@
dirstatev1 format. It would make sense to ultimately deprecate it in
favor of the more "semantic" attributes.
"""
- return self._state
+ return self.v1_state()
@property
def tracked(self):
"""True is the file is tracked in the working copy"""
- return self._state in b"nma"
+ return self.v1_state() in b"nma"
@property
def added(self):
"""True if the file has been added"""
- return self._state == b'a'
+ return self.v1_state() == b'a'
@property
def merged(self):
@@ -266,7 +266,7 @@
Should only be set if a merge is in progress in the dirstate
"""
- return self._state == b'm'
+ return self.v1_state() == b'm'
@property
def from_p2(self):
@@ -276,7 +276,7 @@
Should only be set if a merge is in progress in the dirstate
"""
- return self._state == b'n' and self._size == FROM_P2
+ return self.v1_state() == b'n' and self.v1_size() == FROM_P2
@property
def from_p2_removed(self):
@@ -285,12 +285,12 @@
This property seems like an abstraction leakage and should probably be
dealt in this class (or maybe the dirstatemap) directly.
"""
- return self._state == b'r' and self._size == FROM_P2
+ return self.v1_state() == b'r' and self.v1_size() == FROM_P2
@property
def removed(self):
"""True if the file has been removed"""
- return self._state == b'r'
+ return self.v1_state() == b'r'
@property
def merged_removed(self):
@@ -299,7 +299,7 @@
This property seems like an abstraction leakage and should probably be
dealt in this class (or maybe the dirstatemap) directly.
"""
- return self._state == b'r' and self._size == NONNORMAL
+ return self.v1_state() == b'r' and self.v1_size() == NONNORMAL
@property
def dm_nonnormal(self):
@@ -307,7 +307,7 @@
There is no reason for any code, but the dirstatemap one to use this.
"""
- return self.state != b'n' or self.mtime == AMBIGUOUS_TIME
+ return self.v1_state() != b'n' or self.v1_mtime() == AMBIGUOUS_TIME
@property
def dm_otherparent(self):
@@ -315,7 +315,7 @@
There is no reason for any code, but the dirstatemap one to use this.
"""
- return self._size == FROM_P2
+ return self.v1_size() == FROM_P2
def v1_state(self):
"""return a "state" suitable for v1 serialization"""
@@ -335,7 +335,7 @@
def need_delay(self, now):
"""True if the stored mtime would be ambiguous with the current time"""
- return self._state == b'n' and self._mtime == now
+ return self.v1_state() == b'n' and self.v1_mtime() == now
def gettype(q):
To: marmoute, #hg-reviewers, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210830/4106c5ba/attachment-0002.html>
More information about the Mercurial-patches
mailing list