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

Matt Mackall mpm at selenic.com
Tue Jan 3 12:36:51 CST 2012


On Tue, 2012-01-03 at 09:50 +0100, Pierre-Yves David wrote:
> On 2 janv. 2012, at 20:00, Matt Mackall wrote:
> 
> >>> 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)
> 
> People will both want to express < and > operation.
> I expect negation negation on revset symbol be much less efficient for certain operation.
>
> 	(eg, not public() vs mutable())

I think it will be hard to measure a difference.

> The strength of proposal C is to have a simple and central way to express when we want "<" or ">"

Ok, but we're not talking about proposal C here?

> > 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()".
> 
> In practice changesets special property mostly come from the fact of
> being "not draft". Draft can been seen as the current behavior of
> changeset with old client. The "public" phase  (<draft) add
> immutability while the "secret" phase (>draft) add "not being shared".
> This make the "pick" decent and steadily evolving attributes
> non-trivial.
> 
> In the current documentation, we picked "immutable" and "shared". But
> as changeset property we picked mutable (to avoid the ugly "not
> ctx.immutable"). Shifting this logic will give something like:
> "mutable" and "hold". I find "hold" less explicit than "shared".
> 
> If we pick "mutable" and "shared":
> 
> 	mutable() = (phase >= 1)
> 	hold() = (phase >= 2)
> 	shared() = not hold() # shared won't exist on it's own.

If you think I'm going to be _less_ insistent about having a consistent
_internal_ interface, you are mistaken.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list