Mercurial > hg
diff hgext/convert/monotone.py @ 8123:933b874e402f
convert/mtn: handle files moved in a moved directory (issue1619/2)
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Tue, 21 Apr 2009 22:31:16 +0200 |
parents | d8229670710f |
children | d883bfbd2e60 |
line wrap: on
line diff
--- a/hgext/convert/monotone.py Tue Apr 21 15:57:15 2009 +0200 +++ b/hgext/convert/monotone.py Tue Apr 21 22:31:16 2009 +0200 @@ -122,14 +122,14 @@ #revision = self.mtncmd("get_revision %s" % rev).split("\n\n") revision = self.mtnrun("get_revision", rev).split("\n\n") files = {} - addedfiles = {} + ignoremove = {} renameddirs = [] copies = {} for e in revision: m = self.add_file_re.match(e) if m: files[m.group(1)] = rev - addedfiles[m.group(1)] = rev + ignoremove[m.group(1)] = rev m = self.patch_re.match(e) if m: files[m.group(1)] = rev @@ -144,6 +144,7 @@ toname = m.group(2) fromname = m.group(1) if self.mtnisfile(toname, rev): + ignoremove[toname] = 1 copies[toname] = fromname files[toname] = rev files[fromname] = rev @@ -155,7 +156,7 @@ for fromdir, todir in renameddirs: renamed = {} for tofile in self.files: - if tofile in addedfiles: + if tofile in ignoremove: continue if tofile.startswith(todir + '/'): renamed[tofile] = fromdir + tofile[len(todir):]