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

Pierre-Yves David pierre-yves.david at logilab.fr
Tue Jan 3 12:47:24 CST 2012


On Tue, Jan 03, 2012 at 12:36:51PM -0600, Matt Mackall wrote:
> 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.

In mercurial-core public() if 15K changeset big while mutable() should be less
that hundred. I think it worth some benchmarking.

> > 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.

I do not think so. The external and internal interface should be as close as
possible and the suggest change above would applied to both place.

As you are the final judge on such topic it would help that you rephase your
exigence so we can start a positive suggestion cycle on this topic.


-- 
Pierre-Yves David

http://www.logilab.fr/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20120103/317ccf3e/attachment.pgp>


More information about the Mercurial-devel mailing list