diff mercurial/copies.py @ 27876:602add6ad9e5

copies: fix detection of divergent directory renames If we move all the files out of one directory, but into two different directories, we should not consider it a directory rename. The detection of this case was broken.
author Matt Mackall <mpm@selenic.com>
date Wed, 13 Jan 2016 10:10:05 -0600
parents 1aee2ab0f902
children d4247c306d82
line wrap: on
line diff
--- a/mercurial/copies.py	Fri Jan 15 13:14:49 2016 -0800
+++ b/mercurial/copies.py	Wed Jan 13 10:10:05 2016 -0600
@@ -401,13 +401,13 @@
             continue
         elif dsrc in d1 and ddst in d1:
             # directory wasn't entirely moved locally
-            invalid.add(dsrc)
+            invalid.add(dsrc + "/")
         elif dsrc in d2 and ddst in d2:
             # directory wasn't entirely moved remotely
-            invalid.add(dsrc)
-        elif dsrc in dirmove and dirmove[dsrc] != ddst:
+            invalid.add(dsrc + "/")
+        elif dsrc + "/" in dirmove and dirmove[dsrc + "/"] != ddst + "/":
             # files from the same directory moved to two different places
-            invalid.add(dsrc)
+            invalid.add(dsrc + "/")
         else:
             # looks good so far
             dirmove[dsrc + "/"] = ddst + "/"