Show More
@@ -60,6 +60,8 b' class convert(object):' | |||
|
60 | 60 | self.authorfile = self.dest.authorfile() |
|
61 | 61 | |
|
62 | 62 | def walktree(self, heads): |
|
63 | '''Return a mapping that identifies the uncommitted parents of every | |
|
64 | uncommitted changeset.''' | |
|
63 | 65 | visit = heads |
|
64 | 66 | known = {} |
|
65 | 67 | parents = {} |
@@ -69,13 +71,16 b' class convert(object):' | |||
|
69 | 71 | known[n] = 1 |
|
70 | 72 | self.commitcache[n] = self.source.getcommit(n) |
|
71 | 73 | cp = self.commitcache[n].parents |
|
74 | parents[n] = [] | |
|
72 | 75 | for p in cp: |
|
73 |
parents |
|
|
76 | parents[n].append(p) | |
|
74 | 77 | visit.append(p) |
|
75 | 78 | |
|
76 | 79 | return parents |
|
77 | 80 | |
|
78 | 81 | def toposort(self, parents): |
|
82 | '''Return an ordering such that every uncommitted changeset is | |
|
83 | preceeded by all its uncommitted ancestors.''' | |
|
79 | 84 | visit = parents.keys() |
|
80 | 85 | seen = {} |
|
81 | 86 | children = {} |
@@ -84,13 +89,13 b' class convert(object):' | |||
|
84 | 89 | n = visit.pop(0) |
|
85 | 90 | if n in seen: continue |
|
86 | 91 | seen[n] = 1 |
|
87 | pc = 0 | |
|
88 |
|
|
|
89 | for p in parents[n]: | |
|
90 | if p not in self.map: pc += 1 | |
|
92 | # Ensure that nodes without parents are present in the 'children' | |
|
93 | # mapping. | |
|
94 | children.setdefault(n, []) | |
|
95 | for p in parents[n]: | |
|
96 | if not p in self.map: | |
|
91 | 97 | visit.append(p) |
|
92 |
|
|
|
93 | if not pc: root = n | |
|
98 | children.setdefault(p, []).append(n) | |
|
94 | 99 | |
|
95 | 100 | s = [] |
|
96 | 101 | removed = {} |
General Comments 0
You need to be logged in to leave comments.
Login now