Mercurial > hg > mercurial-crew-with-dirclash
comparison hgext/convert/git.py @ 5335:88e931f74e8b
convert_git: avoid returning two entries for the same file in getchanges
This could happen in merge changesets if the merged file was different
from both parents.
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Mon, 24 Sep 2007 19:00:11 -0300 |
parents | 9d7052f17d77 |
children | 24de027551c1 |
comparison
equal
deleted
inserted
replaced
5334:448eb46d4d84 | 5335:88e931f74e8b |
---|---|
59 | 59 |
60 def getchanges(self, version): | 60 def getchanges(self, version): |
61 self.modecache = {} | 61 self.modecache = {} |
62 fh = self.gitcmd("git-diff-tree --root -m -r %s" % version) | 62 fh = self.gitcmd("git-diff-tree --root -m -r %s" % version) |
63 changes = [] | 63 changes = [] |
64 seen = {} | |
64 for l in fh: | 65 for l in fh: |
65 if "\t" not in l: continue | 66 if "\t" not in l: |
67 continue | |
66 m, f = l[:-1].split("\t") | 68 m, f = l[:-1].split("\t") |
69 if f in seen: | |
70 continue | |
71 seen[f] = 1 | |
67 m = m.split() | 72 m = m.split() |
68 h = m[3] | 73 h = m[3] |
69 p = (m[1] == "100755") | 74 p = (m[1] == "100755") |
70 s = (m[1] == "120000") | 75 s = (m[1] == "120000") |
71 self.modecache[(f, h)] = (p and "x") or (s and "l") or "" | 76 self.modecache[(f, h)] = (p and "x") or (s and "l") or "" |