[PATCH 2 of 2] push: introduce --readonly to make push behave more like pull
Gregory Szorc
gregory.szorc at gmail.com
Mon Aug 22 12:02:03 EDT 2016
> On Aug 22, 2016, at 07:25, Augie Fackler <raf at durin42.com> wrote:
>
>> On Sun, Aug 21, 2016 at 01:33:14AM +0200, Mads Kiilerich wrote:
>> # HG changeset patch
>> # User Mads Kiilerich <madski at unity3d.com>
>> # Date 1471735620 -7200
>> # Sun Aug 21 01:27:00 2016 +0200
>> # Branch stable
>> # Node ID 48f4ae36a49929c2389bfb75064f96d16159b2d0
>> # Parent 7880f56ca7495a2d0365a8280935eccd1e63f0c8
>> push: introduce --readonly to make push behave more like pull
>
> Hm, interesting. To clarify the use case, you've got two local
> repositories, and you want to move some draft changes between them,
> but because (for example) push allows a revset, it's easier to push
> than to pull?
>
> So the goal here is to "push without publishing", and if the
> destination supports drafts, you want to push the draft changes as
> drafts, otherwise fail? Is that right?
>
>>
>> Push and pull are almost symmetric ... except when they are not.
>>
>> For example, push makes it possible to use a revset to specify the revisions to
>> push. Push can also be more suitable for distributing changes to multiple
>> mirrors than pull is. Finally, push will by default publish draft changesets.
>>
>> Often, it is correct and desirable that push tries to update phases and thus
>> locks the repository while pushing ... put that also means that there can't be
>> multiple concurrent pushes and that pushing from non-publishing repositories
>> depends on correct configuration of the target repository.
>>
>> We thus introduce --readonly to prevent push from locking the source repository
>> and thus prevent it from publishing. Push with --readonly is thus more
>> symmetric to pull.
>
> I wonder if we should have --[no-]publish flags on push, wherein the
> --no-publish form would make it easy to "push these draft changes but
> only if it doesn't publish them" and the --publish form would make it
> easier to "push and publish these, but don't make them public unless
> the push succeeds." Thoughts?
I proposed adding a path sub-option to disable publishing as well. I think the use case is marginal enough that it shouldn't be a command argument.
More information about the Mercurial-devel
mailing list