[Commented On] D10986: dirstate-item: use the properties in dirstatemap
baymax (Baymax, Your Personal Patch-care Companion)
phabricator at mercurial-scm.org
Tue Jul 6 17:35:48 UTC 2021
baymax added a comment.
baymax updated this revision to Diff 28841.
✅ refresh by Heptapod after a successful CI run (🐙 💚)
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D10986?vs=28807&id=28841
BRANCH
default
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D10986/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D10986
AFFECTED FILES
mercurial/dirstatemap.py
CHANGE DETAILS
diff --git a/mercurial/dirstatemap.py b/mercurial/dirstatemap.py
--- a/mercurial/dirstatemap.py
+++ b/mercurial/dirstatemap.py
@@ -219,13 +219,13 @@
# backup the previous state
if entry.merged: # merge
size = NONNORMAL
- elif entry[0] == b'n' and entry.from_p2:
+ elif entry.from_p2:
size = FROM_P2
self.otherparentset.add(f)
if size == 0:
self.copymap.pop(f, None)
- if entry is not None and entry[0] != b'r' and "_dirs" in self.__dict__:
+ if entry is not None and entry.removed and "_dirs" in self.__dict__:
self._dirs.delpath(f)
if entry is None and "_alldirs" in self.__dict__:
self._alldirs.addpath(f)
@@ -260,8 +260,10 @@
def clearambiguoustimes(self, files, now):
for f in files:
e = self.get(f)
- if e is not None and e[0] == b'n' and e[3] == now:
- self._map[f] = DirstateItem(e[0], e[1], e[2], AMBIGUOUS_TIME)
+ if e is not None and e.need_delay(now):
+ self._map[f] = DirstateItem(
+ e.state, e.mode, e.size, AMBIGUOUS_TIME
+ )
self.nonnormalset.add(f)
def nonnormalentries(self):
@@ -272,9 +274,9 @@
nonnorm = set()
otherparent = set()
for fname, e in pycompat.iteritems(self._map):
- if e[0] != b'n' or e[3] == AMBIGUOUS_TIME:
+ if e.state != b'n' or e.mtime == AMBIGUOUS_TIME:
nonnorm.add(fname)
- if e[0] == b'n' and e[2] == FROM_P2:
+ if e.from_p2:
otherparent.add(fname)
return nonnorm, otherparent
@@ -295,7 +297,7 @@
f = {}
normcase = util.normcase
for name, s in pycompat.iteritems(self._map):
- if s[0] != b'r':
+ if not s.removed:
f[normcase(name)] = name
f[b'.'] = b'.' # prevents useless util.fspath() invocation
return f
To: marmoute, #hg-reviewers, SimonSapin
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210706/6c5837bb/attachment-0002.html>
More information about the Mercurial-patches
mailing list