# HG changeset patch # User Mads Kiilerich # Date 1396905471 -7200 # Node ID a05d694599f94c14c989740272db0996633f01be # Parent d9e211a658eb4fb17e1d951bcd9438d4b2c8ddb2 revlog: use context ancestor instead of changelog ancestor We want to move in this direction. diff -r d9e211a658eb -r a05d694599f9 mercurial/revset.py --- a/mercurial/revset.py Tue Feb 25 20:31:53 2014 +0100 +++ b/mercurial/revset.py Mon Apr 07 23:17:51 2014 +0200 @@ -320,7 +320,7 @@ def ancestor(repo, subset, x): """``ancestor(*changeset)`` - Greatest common ancestor of the changesets. + A greatest common ancestor of the changesets. Accepts 0 or more changesets. Will return empty list when passed no args. @@ -332,18 +332,15 @@ anc = None # (getset(repo, rl, i) for i in l) generates a list of lists - rev = repo.changelog.rev - ancestor = repo.changelog.ancestor - node = repo.changelog.node for revs in (getset(repo, rl, i) for i in l): for r in revs: if anc is None: - anc = r + anc = repo[r] else: - anc = rev(ancestor(node(anc), node(r))) - - if anc is not None and anc in subset: - return baseset([anc]) + anc = anc.ancestor(repo[r]) + + if anc is not None and anc.rev() in subset: + return baseset([anc.rev()]) return baseset([]) def _ancestors(repo, subset, x, followfirst=False):