Making "hg push -r foo" changes phases
Jordi Gutiérrez Hermoso
jordigh at octave.org
Mon Jun 17 18:29:01 UTC 2013
On 17 June 2013 14:23, Angel Ezquerra <angel.ezquerra at gmail.com> wrote:
> 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.
You are again conflating sharing and changing. These are two different
things. They are related, which is why we only have three phases, not
four (i.e. not all possible combinations of
shared/unshared+modifiable/unmodifiable).
Secret phases are about whether things should be shared or not, not
about whether they should be modified or not. Once a revision has been
shared, changing a draft revision back to the secret phase is
potentially a kind of lie, unless the locations in which it's been
shared are scrubbed.
The evolve extension is about collaboratively editing draft commits.
Not about making sure that you don't publish commits you don't want
to publish.
- Jordi G. H.
More information about the Mercurial-devel
mailing list