phase revset and property name (was RFC: Phase UI (revset, phase command and others))
pierre-yves.david at ens-lyon.org
Tue Jan 3 02:50:32 CST 2012
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())
The strength of proposal C is to have a simple and central way to express when we want "<" or ">"
> 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
> 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.
More information about the Mercurial-devel