D5989: copies: filter out copies when target is not in destination manifest

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

D5989: copies: filter out copies when target is not in destination manifest

pulkit (Pulkit Goyal)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  When chaining a series of commits that copied a file with a series
  that removed the destination file, we would still include the copy in
  the result. Similar to the previous patch, I have checked that `hg
  status --copies` is not affected by this bug, but I wouldn't be
  surprised if some commands are.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/copies.py
  tests/test-copies.t

CHANGE DETAILS

diff --git a/tests/test-copies.t b/tests/test-copies.t
--- a/tests/test-copies.t
+++ b/tests/test-copies.t
@@ -194,9 +194,7 @@
   |/   x y
   o  0 add x
      x
-BROKEN: x doesn't exist here
   $ hg debugpathcopies 1 2
-  y -> x
 
 Copies via null revision (there shouldn't be any)
   $ newrepo
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -124,10 +124,13 @@
             # file is a copy of an existing file
             t[k] = v
 
-    # remove criss-crossed copies
     for k, v in list(t.items()):
+        # remove criss-crossed copies
         if k in src and v in dst:
             del t[k]
+        # remove copies to files that were then removed
+        elif k not in dst:
+            del t[k]
 
     return t
 



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D5989: copies: filter out copies when target is not in destination manifest

pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG58d50c697dc7: copies: filter out copies when target is not in destination manifest (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5989?vs=14159&id=14169

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

AFFECTED FILES
  mercurial/copies.py
  tests/test-copies.t

CHANGE DETAILS

diff --git a/tests/test-copies.t b/tests/test-copies.t
--- a/tests/test-copies.t
+++ b/tests/test-copies.t
@@ -194,9 +194,7 @@
   |/   x y
   o  0 add x
      x
-BROKEN: x doesn't exist here
   $ hg debugpathcopies 1 2
-  y -> x
 
 Copies via null revision (there shouldn't be any)
   $ newrepo
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -124,10 +124,13 @@
             # file is a copy of an existing file
             t[k] = v
 
-    # remove criss-crossed copies
     for k, v in list(t.items()):
+        # remove criss-crossed copies
         if k in src and v in dst:
             del t[k]
+        # remove copies to files that were then removed
+        elif k not in dst:
+            del t[k]
 
     return t
 



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel