##// END OF EJS Templates
revlog: use context ancestor instead of changelog ancestor...
Mads Kiilerich -
r20991:a05d6945 default
parent child Browse files
Show More
@@ -320,7 +320,7 b' def adds(repo, subset, x):'
320
320
321 def ancestor(repo, subset, x):
321 def ancestor(repo, subset, x):
322 """``ancestor(*changeset)``
322 """``ancestor(*changeset)``
323 Greatest common ancestor of the changesets.
323 A greatest common ancestor of the changesets.
324
324
325 Accepts 0 or more changesets.
325 Accepts 0 or more changesets.
326 Will return empty list when passed no args.
326 Will return empty list when passed no args.
@@ -332,18 +332,15 b' def ancestor(repo, subset, x):'
332 anc = None
332 anc = None
333
333
334 # (getset(repo, rl, i) for i in l) generates a list of lists
334 # (getset(repo, rl, i) for i in l) generates a list of lists
335 rev = repo.changelog.rev
336 ancestor = repo.changelog.ancestor
337 node = repo.changelog.node
338 for revs in (getset(repo, rl, i) for i in l):
335 for revs in (getset(repo, rl, i) for i in l):
339 for r in revs:
336 for r in revs:
340 if anc is None:
337 if anc is None:
341 anc = r
338 anc = repo[r]
342 else:
339 else:
343 anc = rev(ancestor(node(anc), node(r)))
340 anc = anc.ancestor(repo[r])
344
341
345 if anc is not None and anc in subset:
342 if anc is not None and anc.rev() in subset:
346 return baseset([anc])
343 return baseset([anc.rev()])
347 return baseset([])
344 return baseset([])
348
345
349 def _ancestors(repo, subset, x, followfirst=False):
346 def _ancestors(repo, subset, x, followfirst=False):
General Comments 0
You need to be logged in to leave comments. Login now