Making "hg push -r foo" changes phases

Angel Ezquerra angel.ezquerra at gmail.com
Mon Jun 17 13:23:57 CDT 2013


On Mon, Jun 17, 2013 at 6:37 PM, Jordi Gutiérrez Hermoso
<jordigh at octave.org> wrote:
> On 17 June 2013 12:32, Angel Ezquerra <angel.ezquerra at gmail.com> wrote:
>> On Mon, Jun 17, 2013 at 6:19 PM, Jordi Gutiérrez Hermoso
>> <jordigh at octave.org> wrote:
>
>>> The reason why draft->secret requires a force is that drafts can be
>>> shared between non-publishing repos. It's a kind of sharing that isn't
>>> as widespread as a public repo, but it's still sharing. If you push a
>>> secret phase to a non-publishing repo, it is now a draft, and it
>>> should stay this way.
>>
>> I don't think that is a very strong reason to require a --force option
>> for the draft-secret phase transition.
>>
>> It is true that draft revisions can be shared, but they are still
>> mutable. Making a public changeset draft is dangerous because then
>> mercurial will let you modify it (e.g. though amend, etc) where you
>> could not modify it when it was public. Making a draft revision secret
>> does not let you do things that you could not do before since draft
>> revisions are already mutable.
>
> There are two things that phases indicate: (1) should this commit be
> pushed? (2) should this commit be modifiable? Once a commit is already
> shareable, e.g. after it's already been shared, then to paraphrase
> 4chan, "what has been shared cannot be easily unshared." The force
> here is there to indicate that we cannot easily unshare. It's part of
> the whole point of phases.

When you push to a non publishing repo, you do not expect a draft
revision to remain immutable.

In a way, you could say that one of the main reasons for the the
changeset evolution work that has been going on for the past few
releases (and of which phases is one of the foundations) is to be able
to make the sentence "what has been shared cannot be easily unshared."
false :-)

Or at least that is my interpretation.

Angel


More information about the Mercurial-devel mailing list