[PATCH 09 of 10] mq: mq.secret prevent mq changeset outside secret phase

Pierre-Yves David pierre-yves.david at logilab.fr
Tue Jan 31 10:25:58 CST 2012

On Mon, Jan 30, 2012 at 02:03:27PM -0600, Matt Mackall wrote:
> On Mon, 2012-01-30 at 17:49 +0100, pierre-yves.david at logilab.fr wrote:
> > +  $ cp -r . ../remote
> > +  $ hg -R ../remote qfinish qbase
> > +  patch add-file1 finalized without changeset message
> > +  $ hg pull ../remote # phase sync
> > +  pulling from ../remote
> > +  searching for changes
> > +  no changes found
> > +  abort: cannot set mq changeset to public with mq in secret mode
> > +  (qfinish them or disable mq.secret)
> It's not obvious to me that this is a good thing.

As stated before I think it's a good idea to prevent case for mq secret to
because draft. In particular if this case is rare but probable. Because it will
break user expectation on the tool which is Bad (mayve even Not Cool™)

My test case is a bit minimalistisc but it also cover the  following situation
(see issue1099):

You have two paches applied localy

    o C (MQ)
    o B (MQ)
    o A

With one existing remotly (because you sent it for review and it got accepted)

    o D
    o B
    o A

The pull will result in the following:

    o D
    | o C (MQ)
    o B (MQ)
    o A

This is very bad because this is an invalid mq state (because of D) (and mq
will fails to qpop or qref B)

Moreover this result in B to because either draft or public (with out without D to exist)

A) if mq.secret=true and B becomes draft: This break user expectation

B) if B becomes public: we have a public changeset handle by mq that can
   rewrite it. this break expection of the public phase.

(Note, this patch does not take care of B)

Aborting early in such situation seems the thing to do. Catching phase movement
to detect patological situation is a partial solution.

Pierre-Yves David


-------------- 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/20120131/db36d60a/attachment.pgp>

More information about the Mercurial-devel mailing list