Show More
@@ -170,20 +170,38 b' class revlog:' | |||||
170 | return node |
|
170 | return node | |
171 |
|
171 | |||
172 | def ancestor(self, a, b): |
|
172 | def ancestor(self, a, b): | |
173 |
def expand( |
|
173 | def expand(list, map): | |
174 |
|
|
174 | a = [] | |
175 |
|
|
175 | while list: | |
176 |
|
|
176 | n = list.pop(0) | |
177 | if p1 in a2: return p1 |
|
177 | map[n] = 1 | |
178 |
|
|
178 | yield n | |
179 | if p1 != nullid and p1 not in a1: |
|
179 | for p in self.parents(n): | |
180 | a1[p1] = 1 |
|
180 | if p != nullid and p not in map: | |
181 |
|
|
181 | list.append(p) | |
182 | if p2 != nullid and p2 not in a1: |
|
182 | yield nullid | |
183 | a1[p2] = 1 |
|
183 | ||
184 | ne.append(p2) |
|
184 | amap = {} | |
185 | return expand(e2, ne, a2, a1) |
|
185 | bmap = {} | |
186 |
|
|
186 | ag = expand([a], amap) | |
|
187 | bg = expand([b], bmap) | |||
|
188 | adone = bdone = 0 | |||
|
189 | ||||
|
190 | while not adone or not bdone: | |||
|
191 | if not adone: | |||
|
192 | an = ag.next() | |||
|
193 | if an == nullid: | |||
|
194 | adone = 1 | |||
|
195 | elif an in bmap: | |||
|
196 | return an | |||
|
197 | if not bdone: | |||
|
198 | bn = bg.next() | |||
|
199 | if bn == nullid: | |||
|
200 | bdone = 1 | |||
|
201 | elif bn in amap: | |||
|
202 | return bn | |||
|
203 | ||||
|
204 | return nullid | |||
187 |
|
205 | |||
188 | def mergedag(self, other, transaction, linkseq, accumulate = None): |
|
206 | def mergedag(self, other, transaction, linkseq, accumulate = None): | |
189 | """combine the nodes from other's DAG into ours""" |
|
207 | """combine the nodes from other's DAG into ours""" |
General Comments 0
You need to be logged in to leave comments.
Login now