##// END OF EJS Templates
revlog: ancestors(*revs) becomes ancestors(revs) (API)...
Bryan O'Sullivan -
r16866:91f3ac20 default
parent child Browse files
Show More
@@ -74,7 +74,7 b' def perftags(ui, repo):'
74 74 def perfancestors(ui, repo):
75 75 heads = repo.changelog.headrevs()
76 76 def d():
77 for a in repo.changelog.ancestors(*heads):
77 for a in repo.changelog.ancestors(heads):
78 78 pass
79 79 timer(d)
80 80
@@ -224,7 +224,7 b' def rebase(ui, repo, **opts):'
224 224 else:
225 225 originalwd, target, state = result
226 226 if collapsef:
227 targetancestors = set(repo.changelog.ancestors(target))
227 targetancestors = set(repo.changelog.ancestors([target]))
228 228 targetancestors.add(target)
229 229 external = checkexternal(repo, state, targetancestors)
230 230
@@ -243,7 +243,7 b' def rebase(ui, repo, **opts):'
243 243
244 244 # Rebase
245 245 if not targetancestors:
246 targetancestors = set(repo.changelog.ancestors(target))
246 targetancestors = set(repo.changelog.ancestors([target]))
247 247 targetancestors.add(target)
248 248
249 249 # Keep track of the current bookmarks in order to reset them later
@@ -5396,12 +5396,12 b' def summary(ui, repo, **opts):'
5396 5396 cl = repo.changelog
5397 5397 for a in [cl.rev(n) for n in bheads]:
5398 5398 new[a] = 1
5399 for a in cl.ancestors(*[cl.rev(n) for n in bheads]):
5399 for a in cl.ancestors([cl.rev(n) for n in bheads]):
5400 5400 new[a] = 1
5401 5401 for a in [p.rev() for p in parents]:
5402 5402 if a >= 0:
5403 5403 new[a] = 0
5404 for a in cl.ancestors(*[p.rev() for p in parents]):
5404 for a in cl.ancestors([p.rev() for p in parents]):
5405 5405 new[a] = 0
5406 5406 new = sum(new)
5407 5407
@@ -223,7 +223,7 b' class changectx(object):'
223 223 return [changectx(self._repo, x) for x in c]
224 224
225 225 def ancestors(self):
226 for a in self._repo.changelog.ancestors(self._rev):
226 for a in self._repo.changelog.ancestors([self._rev]):
227 227 yield changectx(self._repo, a)
228 228
229 229 def descendants(self):
@@ -1019,7 +1019,7 b' class workingctx(changectx):'
1019 1019
1020 1020 def ancestors(self):
1021 1021 for a in self._repo.changelog.ancestors(
1022 *[p.rev() for p in self._parents]):
1022 [p.rev() for p in self._parents]):
1023 1023 yield changectx(self._repo, a)
1024 1024
1025 1025 def undelete(self, list):
@@ -140,7 +140,7 b' def findcommonoutgoing(repo, other, only'
140 140 og._computecommonmissing()
141 141 cl = repo.changelog
142 142 missingrevs = set(cl.rev(n) for n in og._missing)
143 og._common = set(cl.ancestors(*missingrevs)) - missingrevs
143 og._common = set(cl.ancestors(missingrevs)) - missingrevs
144 144 commonheads = set(og.commonheads)
145 145 og.missingheads = [h for h in og.missingheads if h not in commonheads]
146 146
@@ -1791,7 +1791,7 b' class localrepository(repo.repository):'
1791 1791 bases = [nullid]
1792 1792 csets, bases, heads = cl.nodesbetween(bases, heads)
1793 1793 # We assume that all ancestors of bases are known
1794 common = set(cl.ancestors(*[cl.rev(n) for n in bases]))
1794 common = set(cl.ancestors([cl.rev(n) for n in bases]))
1795 1795 return self._changegroupsubset(common, csets, heads, source)
1796 1796
1797 1797 def getlocalbundle(self, source, outgoing):
@@ -381,7 +381,7 b' class revlog(object):'
381 381 visit.append(p)
382 382 return reachable
383 383
384 def ancestors(self, *revs):
384 def ancestors(self, revs):
385 385 """Generate the ancestors of 'revs' in reverse topological order.
386 386
387 387 Yield a sequence of revision numbers starting with the parents
@@ -441,7 +441,7 b' class revlog(object):'
441 441 heads = [self.rev(n) for n in heads]
442 442
443 443 # we want the ancestors, but inclusive
444 has = set(self.ancestors(*common))
444 has = set(self.ancestors(common))
445 445 has.add(nullrev)
446 446 has.update(common)
447 447
@@ -47,15 +47,15 b" if __name__ == '__main__':"
47 47
48 48 # Ancestors
49 49 print 'Ancestors of 5'
50 for r in repo.changelog.ancestors(5):
50 for r in repo.changelog.ancestors([5]):
51 51 print r,
52 52
53 53 print '\nAncestors of 6 and 5'
54 for r in repo.changelog.ancestors(6, 5):
54 for r in repo.changelog.ancestors([6, 5]):
55 55 print r,
56 56
57 57 print '\nAncestors of 5 and 4'
58 for r in repo.changelog.ancestors(5, 4):
58 for r in repo.changelog.ancestors([5, 4]):
59 59 print r,
60 60
61 61 # Descendants
General Comments 0
You need to be logged in to leave comments. Login now