[PATCH] rebase: do not add second parent to rebased changeset (drop detach option) (BC)

Patrick Mézard patrick at mezard.eu
Wed Jun 20 16:32:56 UTC 2012


Le 20/06/12 17:49, pierre-yves.david at logilab.fr a écrit :
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
> # Date 1340203780 -7200
> # Node ID a71426b6a3a13874cc5855ace938a611187e4bcd
> # Parent  132ea1736751cb02b16992cf421e7de8bad888a1
> rebase: do not add second parent to rebased changeset (drop detach option) (BC)
> 
> Rebase now behaves as if --detach was always passed. Non-merges are
> rebased as non-merges, regardless of their parent being an ancestor of
> the destination. Merges will usually be rebased as merges unless both of
> their parents are ancestors of the destination, or one of their parents
> is pruned when rebased.
> 
> This only alters the behavior of rebase when using the --source/--rev
> options. --detach option is deprecated.
> 
> All test changes were carefully validated.

After fixing the test bug below, +1.

> diff --git a/tests/test-rebase-scenario-global.t b/tests/test-rebase-scenario-global.t
> --- a/tests/test-rebase-scenario-global.t
> +++ b/tests/test-rebase-scenario-global.t
> @@ -304,11 +304,11 @@ Source phase greater or equal to destina
>    secret
>  Source phase lower than destination phase: new changeset get the phase of destination:
>    $ hg rebase -s7 -d9
>    saved backup bundle to $TESTTMP/a7/.hg/strip-backup/c9659aac0000-backup.hg (glob)
>    $ hg log --template "{phase}\n" -r 9
> -  secret
> +  draft

The phase is changed because the rebased revision is pruned and rev(9) no longer exists, then "-r 9" is resolved to "2:9520eea781bc".

Rebasing 8 onto 9 would fix the test, hardening using -r 'rev(9)' or printing the commit message is welcome.

>  
>    $ cd ..
>  
>  Test for revset
>  

--
Patrick Mézard



More information about the Mercurial-devel mailing list