[PATCH stable] tests: test `clone --rebase` when local has mq patches applied

Matt Mackall mpm at selenic.com
Thu Oct 28 15:37:49 CDT 2010


On Fri, 2010-10-29 at 00:43 +0900, Nicolas Dumazet wrote:
> # HG changeset patch
> # User Nicolas Dumazet <nicdumz.commits at gmail.com>
> # Date 1288280500 -32400
> # Branch stable
> # Node ID 8765973514b30ff06409d2c455ed0a67cde92ee5
> # Parent  e1855dee28c164be291755af2e11b26efe77a64e
> tests: test `clone --rebase` when local has mq patches applied

Can we get a bit of an explanation of what's going on here and why it's
the right behavior?

> diff --git a/tests/test-rebase-pull.t b/tests/test-rebase-pull.t
> --- a/tests/test-rebase-pull.t
> +++ b/tests/test-rebase-pull.t
> @@ -1,5 +1,6 @@
>    $ cat >> $HGRCPATH <<EOF
>    > [extensions]
> +  > mq=
>    > graphlog=
>    > rebase=
>    > 
> @@ -29,6 +30,10 @@
>    updating to branch default
>    2 files updated, 0 files merged, 0 files removed, 0 files unresolved
>  
> +  $ hg clone a mq
> +  updating to branch default
> +  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
> +
>    $ cd b
>  
>    $ echo L1 > L1
> @@ -111,3 +116,93 @@
>    o  2: 'R1'
>    |
>  
> +Interactions with mq:
> +
> +First queue a patch
> +
> +  $ cd ../mq
> +  $ hg qnew patch-to-rebase
> +  $ echo C3 > C3
> +  $ hg add
> +  adding C3
> +  $ hg qref
> +
> +Now test what happens when some mq patches are applied:
> +
> +Linear history works:
> +
> +  $ hg pull --rebase ../a
> +  pulling from ../a
> +  searching for changes
> +  adding changesets
> +  adding manifests
> +  adding file changes
> +  added 1 changesets with 1 changes to 1 files (+1 heads)
> +  patch patch-to-rebase finalized without changeset message
> +  saved backup bundle to $TESTTMP/mq/.hg/strip-backup/*-backup.hg (glob)
> +  $ hg tglog
> +  @  3: '[mq]: patch-to-rebase'
> +  |
> +  o  2: 'R1'
> +  |
> +  o  1: 'C2'
> +  |
> +  o  0: 'C1'
> +  
> +
> +Add a stable branch:
> +
> +  $ cd ../a
> +  $ hg branch stable
> +  marked working directory as branch stable
> +  $ echo Stable1 > Stable1
> +  $ hg ci -Am'Stable1'
> +  adding Stable1
> +  $ hg up default
> +  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
> +  $ echo C4 > C4
> +  $ hg ci -Am'C4'
> +  adding C4
> +  $ hg tglog -l3
> +  @  4: 'C4'
> +  |
> +  | o  3: 'Stable1' stable
> +  |/
> +  o  2: 'R1'
> +  |
> +
> +  $ cd ../mq
> +  $ hg pull --rebase ../a#stable
> +  pulling from ../a
> +  searching for changes
> +  adding changesets
> +  adding manifests
> +  adding file changes
> +  added 1 changesets with 1 changes to 1 files (+1 heads)
> +  abort: cannot rebase onto an applied mq patch
> +  [255]
> +  $ hg tglog -l3
> +  o  4: 'Stable1' stable
> +  |
> +  | @  3: '[mq]: patch-to-rebase'
> +  |/
> +  o  2: 'R1'
> +  |
> +  $ hg pull --rebase ../a
> +  pulling from ../a
> +  searching for changes
> +  adding changesets
> +  adding manifests
> +  adding file changes
> +  added 1 changesets with 1 changes to 1 files (+1 heads)
> +  patch patch-to-rebase finalized without changeset message
> +  saved backup bundle to $TESTTMP/mq/.hg/strip-backup/*-backup.hg (glob)
> +  $ hg tglog -l4
> +  @  5: '[mq]: patch-to-rebase'
> +  |
> +  o  4: 'C4'
> +  |
> +  | o  3: 'Stable1' stable
> +  |/
> +  o  2: 'R1'
> +  |
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list