Mercurial > hg > mercurial-crew-with-dirclash
diff hgext/convert/git.py @ 5380:a5a7f7fd5554
convert_git: add --filemap support
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Thu, 04 Oct 2007 23:21:37 -0300 |
parents | 24de027551c1 |
children | 67d3daa8ac42 |
line wrap: on
line diff
--- a/hgext/convert/git.py +++ b/hgext/convert/git.py @@ -122,3 +122,21 @@ class convert_git(converter_source): tags[tag] = node return tags + + def getchangedfiles(self, version, i): + changes = [] + if i is None: + fh = self.gitcmd("git-diff-tree --root -m -r %s" % version) + for l in fh: + if "\t" not in l: + continue + m, f = l[:-1].split("\t") + changes.append(f) + fh.close() + else: + fh = self.gitcmd("git-diff-tree --name-only --root -r %s %s^%s --" + % (version, version, i+1)) + changes = [f.rstrip('\n') for f in fh] + fh.close() + + return changes