# HG changeset patch # User Matt Mackall # Date 2012-02-26 22:45:59 # Node ID 828fe2ca7cbb91be73e574adeb6fb7fd26e9e112 # Parent b8c1a8a57540ef994cb1db25960d06b16a68cac6 copies: use ctx.dirs() for directory rename detection diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -18,15 +18,6 @@ def _dirname(f): 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 @@ def mergecopies(repo, c1, c2, ca): 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