Bug 3750 - Allow revset ancestor() function to take N revset arguments
Summary: Allow revset ancestor() function to take N revset arguments
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: PC Mac OS
: normal feature
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-31 19:50 UTC by Jesse Ruderman
Modified: 2013-06-07 18:09 UTC (History)
5 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Ruderman 2012-12-31 19:50 UTC
I'm trying to make a revset that means "parent, or for merges, common ancestor of the parents".  But I'm having trouble making one that works in all cases.

> hg log -r "ancestor(p1(x), p2(x))"

hg: parse error: ancestor arguments must be single revisions
(if x is not a merge changset)

> "ancestor(parents(x))"

hg: parse error: ancestor requires two arguments
Comment 1 Bryan O'Sullivan 2013-01-22 20:04 UTC
This was originally "one or two", but really any number of arguments >= 0 makes sense here, where any argument can be a revset (just union the lot), and the ancestor of the empty set-or-argument-list is the empty set.
Comment 2 Bryan O'Sullivan 2013-02-01 12:07 UTC
We have a fix, waiting to patchbomb until 2.5 is cut.
Comment 3 HG Bot 2013-02-04 15:30 UTC
Fixed by http://selenic.com/repo/hg/rev/ae645d4f084c
Paul Cavallaro <ptc@fb.com>
revset: change ancestor to accept 0 or more arguments (issue3750)

Change ancestor to accept 0 or more arguments. The greatest common ancestor of a
single changeset is that changeset. If passed no arguments, the empty list is
returned.

(please test the fix)