[Updated] D11592: dirstate-item: use the `p2_info` property to replace more verbose call

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Sun Oct 3 21:36:15 UTC 2021


Closed by commit rHGe2753a7acfa7: dirstate-item: use the `p2_info` property to replace more verbose call (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11592?vs=30597&id=30650

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11592/new/

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

AFFECTED FILES
  mercurial/dirstate.py
  mercurial/dirstatemap.py

CHANGE DETAILS

diff --git a/mercurial/dirstatemap.py b/mercurial/dirstatemap.py
--- a/mercurial/dirstatemap.py
+++ b/mercurial/dirstatemap.py
@@ -332,7 +332,7 @@
         if fold_p2:
             for f, s in pycompat.iteritems(self._map):
                 # Discard "merged" markers when moving away from a merge state
-                if s.merged or s.from_p2:
+                if s.p2_info:
                     source = self.copymap.pop(f, None)
                     if source:
                         copies[f] = source
@@ -604,7 +604,7 @@
                 # enables in-place mutation of elements of a collection while
                 # iterating it, without mutating the collection itself.
                 files_with_p2_info = [
-                    f for f, s in self._map.items() if s.merged or s.from_p2
+                    f for f, s in self._map.items() if s.p2_info
                 ]
                 rust_map = self._map
                 for f in files_with_p2_info:
diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -1372,7 +1372,7 @@
 
             if not st and t.tracked:
                 dadd(fn)
-            elif t.merged or t.from_p2:
+            elif t.p2_info:
                 madd(fn)
             elif t.added:
                 aadd(fn)



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/20211003/1f3a15c4/attachment-0002.html>


More information about the Mercurial-patches mailing list