Mercurial > hg > mercurial-crew-with-dirclash
diff mercurial/merge.py @ 4117:c95060a5391a
merge: fix renaming of subdirectories under renamed directories
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 27 Feb 2007 16:20:06 -0600 |
parents | c0a12e6441a5 |
children | bb70d5fa02ae 7e1c8a565a4f |
line wrap: on
line diff
--- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -184,7 +184,7 @@ def findcopies(repo, m1, m2, ma, limit): invalid[dsrc] = True del dirmove[dsrc] else: - dirmove[dsrc] = ddst + dirmove[dsrc + "/"] = ddst + "/" del d1, d2, invalid @@ -194,9 +194,10 @@ def findcopies(repo, m1, m2, ma, limit): # check unaccounted nonoverlapping files for f in u1 + u2: if f not in fullcopy: - d = os.path.dirname(f) - if d in dirmove: - copy[f] = dirmove[d] + "/" + os.path.basename(f) + for d in dirmove: + if f.startswith(d): + copy[f] = dirmove[d] + f[len(d):] + break return copy