[PATCH 2 of 2 STABLE] rebase: restrict rebase destination to the pulled set (issue5214)

Yuya Nishihara yuya at tcha.org
Sun May 1 06:24:22 UTC 2016


On Sat, 30 Apr 2016 19:20:54 +0200, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
> # Date 1462034379 -7200
> #      Sat Apr 30 18:39:39 2016 +0200
> # Branch stable
> # Node ID 69addd286d938fcd032c37657be606792cc8ecb3
> # Parent  ff7be3798ec9465d9306a30e01ab976c941c0967
> # EXP-Topic issue5214
> rebase: restrict rebase destination to the pulled set (issue5214)

These changes look good and safe to me, so pushed to the committed repo,
thanks. (Someone might want to do English tweak. I'm not the right person.)

> Before this patch, `hg pull --rebase` would be a strict sequence of `hg pull`
> followed by `hg rebase` if anything was pulled.
> 
> Now that rebase pick his default destination the same way than merge, than
> `hg rebase` step would abort in the case the repo already had multiple anonymous
> heads (because of the ambiguity). (changed in fac3a24be50e)
> 
> The intend of the user with `hg pull --rebase` is clearly to rebase on pulled
> content. This used to be (mostly) enforced by the former default destination for
> rebase, "tipmost changeset of the branch" as the tipmost would likely a
> changeset that just got pulled. But this intended was no longer enforced with
> the new defaul destination (unified with merge).
> 
> This changeset makes use of the '_destspace' mechanism introduced in the previous
> changeset to enforce this.
> 
> This partially fixes issue5214 as no change at all have been made to the new
> handling of the case with bookmark (unified with merge).


> diff -r ff7be3798ec9 -r 69addd286d93 hgext/rebase.py
> --- a/hgext/rebase.py	Sat Apr 30 18:41:08 2016 +0200
> +++ b/hgext/rebase.py	Sat Apr 30 18:39:39 2016 +0200
> @@ -1244,6 +1244,9 @@
>                  # --source.
>                  if 'source' in opts:
>                      del opts['source']
> +                # revsprepull is the len of the repo, not revnum of tip.
> +                destspace = list(repo.changelog.revs(start=revsprepull))
> +                opts['_destspace'] = destspace

We could use a smart set for _destspace handling, but that is beyond the scope
of this patch.


More information about the Mercurial-devel mailing list