[PATCH] push: add --publish flag to change phase of pushed changesets

Yuya Nishihara yuya at tcha.org
Tue Nov 20 07:55:42 EST 2018


On Mon, 19 Nov 2018 20:23:04 +0800, Anton Shestakov wrote:
> # HG changeset patch
> # User Anton Shestakov <av6 at dwimlabs.net>
> # Date 1540646003 -28800
> #      Sat Oct 27 21:13:23 2018 +0800
> # Node ID 0a301fe43764ea8dc5ea86c08f0693a831d1e36d
> # Parent  69268a13ffa576b71a693f9e208f3eda35e3a46e
> # EXP-Topic push-publish
> push: add --publish flag to change phase of pushed changesets
> 
> This flag is copied from topic extension, where it proved to be useful. It
> makes all pushed changesets public on both ends if the push succeeds.

I have no idea if we want this, but it sounds somewhat useful.

Any concerns?

> @@ -641,6 +643,11 @@ def _pushdiscoveryphase(pushop):
>                         outgoing.missing, droots))
>          fdroots = [f.node() for f in fdroots]
>          future = list(unfi.set(revset, fdroots, pushop.futureheads))
> +
> +    if not pushop.remotephases.publishing and pushop.publish:
> +        revset = '%ln and (not public() or %ln::)'
> +        future = list(unfi.set(revset, pushop.futureheads, droots))

Perhaps this can be move to the above if-else block. I don't think
there's data dependency on the previous "future" value.


More information about the Mercurial-devel mailing list