copies: use ctx.dirs() for directory rename detection
authorMatt Mackall <mpm@selenic.com>
Sun, 26 Feb 2012 16:45:59 -0600
changeset 16178 828fe2ca7cbb
parent 16177 b8c1a8a57540
child 16180 46a96cc830c2
copies: use ctx.dirs() for directory rename detection
mercurial/copies.py
--- a/mercurial/copies.py	Sun Feb 26 15:51:56 2012 -0600
+++ b/mercurial/copies.py	Sun Feb 26 16:45:59 2012 -0600
@@ -18,15 +18,6 @@
         return ""
     return f[:s]
 
-def _dirs(files):
-    d = set()
-    for f in files:
-        f = _dirname(f)
-        while f not in d:
-            d.add(f)
-            f = _dirname(f)
-    return d
-
 def _findlimit(repo, a, b):
     """Find the earliest revision that's an ancestor of a or b but not both,
     None if no such revision exists.
@@ -316,8 +307,8 @@
     repo.ui.debug("  checking for directory renames\n")
 
     # generate a directory move map
-    d1, d2 = _dirs(m1), _dirs(m2)
-    invalid = set()
+    d1, d2 = c1.dirs(), c2.dirs()
+    invalid = set([""])
     dirmove = {}
 
     # examine each file copy for a potential directory move, which is