RFC: Phase UI (revset, phase command and others)

Matt Mackall mpm at selenic.com
Mon Jan 2 19:00:47 UTC 2012


On Mon, 2012-01-02 at 17:27 +0100, Pierre-Yves David wrote:
> On Thu, Dec 29, 2011 at 02:16:28PM -0600, Matt Mackall wrote:
> > On Tue, 2011-12-27 at 00:11 +0100, Pierre-Yves David wrote:
> > > 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.
> > 
> > Exchanged and mutable? What happened to shared and immutable?
> > 
> > Also exchanged is a <= operation while mutable is a >= operation.
> > 
> > But yes, I think we need attribute predicates.
> 
> the idea is to provided simple way to say "phaseN() or phaseN+1()". From this point of view, usefull symbol are:
> 
>     shared() == public() + draft() == not secret()
>     mutable() == draft() + secret() == not public()

What I don't see an answer to is:

> Also exchanged is a <= operation while mutable is a >= operation.

shared = (phase < 2)
mutable = (phase > 1)

If we publish a table that looks like to explain phases:

         A  B  C  D
public   x  x  x  x
draft       x  x  x
secret         x  x
trash             x

then the attributes should either steadily add or disappear. That is,
they're all of the form A = (phase > n) or A = (phase < n). And we
should use only those names A, B, C, D when describing those columns,
and not synonyms or antonyms.

(I've added extra rows and columns here to emphasize the triangular
structure.)

Preferably, we can come up with a set of attributes that are not already
negations, so that we don't find ourselves writing "not immutable()".

-- 
Mathematics is the supreme nostalgia of our time.





More information about the Mercurial-devel mailing list