[PATCH] revset: allow negative integers to list child revs

Pierre-Yves David pierre-yves.david at ens-lyon.org
Tue Oct 7 14:57:25 CDT 2014



On 10/07/2014 11:40 AM, Sean Farley wrote:
>
> Pierre-Yves David writes:
>
>> On 10/04/2014 09:57 AM, Sean Farley wrote:
>>> # HG changeset patch
>>> # User Sean Farley <sean.michael.farley at gmail.com>
>>> # Date 1412441841 25200
>>> #      Sat Oct 04 09:57:21 2014 -0700
>>> # Node ID c3bd6d6457bf42d2fbcaba89cf0418a0d0604239
>>> # Parent  78c916f24dd99a56e4c29153a5df3bd7d1c40edd
>>> revset: allow negative integers to list child revs
>>
>> Quick reply on various subject.
>>
>> As X^1 and X^2 return a single revision (per X) (short version for p1(X)
>> and P2(X)) It would be a bad idea to have X^-1 return multiple revision.
>
> I agree.
>
>> first(children(X)) have less good defined semantic as first(parents(X))
>> as it no deterministic and will change over time. the first parent of a
>> changeset is carved in stone. The amount of Children change over time
>> and with history rewriting, their order change over time. So you cannot
>> really predict the order. You need to (a) have one parent or (b) look
>> the number up (c) use a more precise revsets:
>>     children(X) and ::bookmarkname
>>     children(X) and desc(yyy)
>
> They should always be returned in the revlog order. That is what we
> currently do with referring to children via revision numbers. This would
> be no added confusion.

You got me wrong. Their will of course be returned in revlog order. This 
means that if you have three child A, B, C. You initially have

   children(X) = A, B, C

Then you amend A. So you get

   children(X) = B, C, A

And C get touched. So you get


   children(X) = B, A, C

Then you pull a new version X from someone with a children D. You evolve 
and you end up with:

   children(X) = D, B, A, C

So you cannot blindly rely on c(X, 1) to give you stable result. And 
normal human being have too look up the revset or use more precise revset.

(will get to reply to the rest later)

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list