D5790: diff: drop duplicate filter of copies by destination

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu Jan 31 19:52:38 EST 2019


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I'm pretty sure we don't need to filter copies by destination, at
  least since the previous patch.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/patch.py

CHANGE DETAILS

diff --git a/mercurial/patch.py b/mercurial/patch.py
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -2343,10 +2343,10 @@
             copy = copies.pathcopies(ctx1, ctx2, match=match)
 
     if relroot:
-        # filter out copies where either side isn't inside the relative root
-        copy = dict(((dst, src) for (dst, src) in copy.iteritems()
-                     if dst.startswith(relroot)
-                     and src.startswith(relroot)))
+        # filter out copies where source side isn't inside the relative root
+        # (copies.pathcopies() already filtered out the destination)
+        copy = {dst: src for dst, src in copy.iteritems()
+                if src.startswith(relroot)}
 
     modifiedset = set(modified)
     addedset = set(added)



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list