Questions about revset.py

Matt Mackall mpm at selenic.com
Sun Apr 8 11:55:17 CDT 2012


On Sun, 2012-04-08 at 11:53 +0200, Patrick Mézard wrote:
> Hello,
> 
> 1- Should revset.match() preserve input revisions order?
> 
> orset() reorders by matched subexpressions.

Yeah, this isn't terribly well-defined. But in general, we should try
to.

For instance {1 2 3} or {0 1 2} = ?

Right now, we give {1 2 3 0}, preserving the order of the first set, and
appending new elements from the second set, again in order.

> 2- Should revset.match() preserve input revisions cardinality?
> 
> I think rangeset() enforces unicity.

I can't think of a case where we'd want to have repeated revisions in
the output.

> 3- Should revset.match() sort input revisions itself (for performance reasons) or leave that to the caller?

Not sure what you mean here.

> It makes a big difference when working on large revision sets and I did not notice it until I ran benchmarks. I also suspect that some revsets like rangeset() expect the input sequence to be in ascending order.
> 
> I have no strong opinions about the answers but I would like revset.match() properties to be documented more clearly, I got bitten by wrong assumptions when implementing the glog/log revset version.
> --
> Patrick Mézard


-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list