[PATCH 3 of 3] revset: drop factory that promotes spanset to fullreposet

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sun May 17 22:12:50 CDT 2015



On 05/14/2015 04:01 PM, Yuya Nishihara wrote:
> On Wed, 13 May 2015 22:58:16 -0700, Pierre-Yves David wrote:
>> On 05/06/2015 02:00 AM, Yuya Nishihara wrote:
>>> On Wed, 06 May 2015 00:11:50 -0700, Pierre-Yves David wrote:
>>>> On related topic, one what behavior did we settle regarding usage of
>>>> "null" in revset? I cannot find anything related to this discussion in
>>>> mercurial/revset.py
>>>
>>> Not sure if it's settled. My starting point was to fix buggy handling of
>>> "null" in revset.
>>>
>>> http://thread.gmane.org/gmane.comp.version-control.mercurial.devel/75134/focus=75148
>>
>> We should probably discuss this, decide on a behavior, document it and
>> stick to it. I cannot access the gmane thread for some reason :-/. Do
>> you have another pointer to this messages?
>>
>> My current opinions is:
>>
>> - null should work when explicitly referenced
>> - null should not survive combination (and) with anything.
>
> I agree with the bullet point 1, but my opinion for 2 is:
>
> - null should work just like other revisions once appeared
>
>> In practice this means
>>
>> 1) The following include null in the result
>> - "null"
>> - "null + 2"
>> - "null::" (probably)
>> - "::null" (probably)
>>
>> 2) the following does not includes it
>> - "null and (::2)"
>> - "null and date(-9001)"
>> - "null and all()"
>> (replaces null by any of the variant in (1))
>>
>> Same should probably apply to the "working directory" revset.
>> "all()" could maybe take and argument to accept null.
>
> - "null and (:2)" -> ()       # because :2 = 0:2
> - "null and (::2)" -> (null,)
> - "null and date(-100000)" -> (null,)
> - "null and all()" -> ()      # if all() = 0:tip
>                     or (null)  # if all() = everything in sets (like "and true")
> - "wdir() and draft()" -> (wdir,)

So, there does not seems to be an obvious consensus and the question 
seems to be complicated. I think we need to take a global look at this 
issue to ensure we have something consistent in 3.5. This is especially 
important if we want to push the 'wdir()' forward.

I think we need to start a wiki page at this point. The wiki page would 
list:

- a set of relevant example usecases. With possible behavior.
- sorts -all- existing revset is a set of relevant categories taking in 
account how they are affected by null/wdir and if their implementation 
would need rework to support them.

Yuya, do you have time/willingness to build such wiki page?

On the implementation front, revset are currently not ready for a 
consistent support of null/wdir. We would probably need a special flag 
to force specific inclusive "mode" for most revset predicate.

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list