RFC: Phase UI (revset, phase command and others)
Laurens Holst
laurens.nospam at grauw.nl
Tue Dec 27 16:59:46 CST 2011
Op 27-12-2011 0:11, Pierre-Yves David schreef:
> revset
> -------
>
> revset to select changeset according to their phase will be implemented.
>
> The naive solution is:
>
> public() match changeset in public phase.
> draft() match changeset in draft phase.
> secret() match changeset in secret phase.
>
> But in practice we want to be able to do more complicated queries:
>
> * "Match all changeset at least draft" --> (draft() + secret())
> * "Match all changeset at most draft" --> (draft() + public())
>
> There are multiple options to achieve this.
>
> Solution A: add more revset symbols
> ```````````````````````````````````````````````````
>
> Adding "exchanged()" and "mutable()" should do it.
>
> pro:
> * simple to use
> con:
> * multiplies symbols
> * Does not scale well if we add phases
>
> Solution B: add argument to revset
> ``````````````````````````````````````````````````
>
> We add an "operator" argument to revset to control how it should be
> interpreted:
>
> Match any changeset in phase draft or lower --> "draft('<=')"
>
> Possible values are '<','<=', '='(default), '>=', '>'.
>
> pro:
> * keep simple usage simple
> * cover most things people will want to express (except phase between X and Y)
> cons:
> * complicated usecase are a bit more complicated
>
>
> Solution C: Use a single symbol
> ``````````````````````````````````````````````````
>
> We can use a single "phases" revset taking a "phase-set" in argument:
>
> match changesets in draft phase --> phase('draft)
> match changesets in draft phase or lower --> phase('<=draft)
> match changeset between public and secret phase --> phase('public::draft')
>
> pro:
> * Add less symbol
> * everything is done using the same symbol
> * complex case are simpler to express
> * cover any complicated case people might want
> cons:
> * Make simple case more verbose
I like the phase(str) part of solution C but I don’t like the
microsyntax :: => <= etc. Also problem with => and <= is that the
ordering (what is left, what is right) is unintuitive.
Solution D:
Add a phases keyword:
phase('draft') -> exact match
phases('draft') -> draft + secret
! phases('secret') -> public + draft
Unions, intersections and set differences will handle the rest.
~Laurens
--
~~ Ushiko-san! Kimi wa doushite, Ushiko-san nan da!! ~~
Laurens Holst, developer, Utrecht, the Netherlands
Website: www.grauw.nl. Working @ www.roughcookie.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4332 bytes
Desc: S/MIME cryptografische ondertekening
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20111227/e1495898/attachment.bin>
More information about the Mercurial-devel
mailing list