Patchwork [2,of,2] test: add an extra case for obsolescence distributed case

login
register
mail settings
Submitter Boris Feld
Date Oct. 12, 2017, 10:29 a.m.
Message ID <cf572fd4e79604e0f774.1507804165@FB>
Download mbox | patch
Permalink /patch/24770/
State Superseded
Headers show

Comments

Boris Feld - Oct. 12, 2017, 10:29 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1506807440 -3600
#      Sat Sep 30 22:37:20 2017 +0100
# Node ID cf572fd4e79604e0f774869c11e24b05f1d3517f
# Parent  8252157034b4e4f9f851f328633ef86df44cc9cf
# EXP-Topic obs-tests
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r cf572fd4e796
test: add an extra case for obsolescence distributed case

This changeset introduces a new documented test case for a distributed
obsolescence scenario. The scenario involves a simple case where some
obsolescence markers are retrieved before the changeset they affect. See the
test case documentation for details.

We also test variants where the changesets are added from a bundle.
Denis Laxalde - Oct. 12, 2017, 11:56 a.m.
Boris Feld a écrit :
> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1506807440 -3600
> #      Sat Sep 30 22:37:20 2017 +0100
> # Node ID cf572fd4e79604e0f774869c11e24b05f1d3517f
> # Parent  8252157034b4e4f9f851f328633ef86df44cc9cf
> # EXP-Topic obs-tests
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r cf572fd4e796
> test: add an extra case for obsolescence distributed case
> 
> This changeset introduces a new documented test case for a distributed
> obsolescence scenario. The scenario involves a simple case where some
> obsolescence markers are retrieved before the changeset they affect. See the
> test case documentation for details.
> 
> We also test variants where the changesets are added from a bundle.
> 
> diff --git a/tests/test-obsolete-distributed.t b/tests/test-obsolete-distributed.t
> --- a/tests/test-obsolete-distributed.t
> +++ b/tests/test-obsolete-distributed.t
> @@ -8,6 +8,8 @@
>   
>     $ . $TESTDIR/testlib/obsmarker-common.sh
>     $ cat >> $HGRCPATH << EOF
> +  > [extensions]
> +  > rebase =
>     > [experimental]
>     > evolution = all
>     > [phases]
> @@ -197,3 +199,253 @@
>     $ hg debugobsolete
>     d1ada4861b7669f79a948eefaea6950b5e543855 23422fed6b3d22e1b9d89fb82bdb68edc19079b4 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>     23422fed6b3d22e1b9d89fb82bdb68edc19079b4 b305f85f127a9d2e608bcbd83c59373fec615cb2 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +  $ cd ..
> +
> +Check getting changesets after getting the markers
> +=================================================
> +
> +This test case covers the scenario where commits are received -after- we
> +received some obsolescence markers turning them obsolete.
> +
> +For example, we pull some successors from a repository (with associated
> +predecessors marker chain) and then later we pull some intermediate
> +precedessors changeset from another repository. Obsolescence markers must
> +apply to the intermediate changeset. They have to be obsolete (and hidden).
> +
> +Avoiding pulling the changeset in the first place is a tricky decision because
> +there could be non-obsolete ancestors that need to be pulled, but the
> +discovery cannot currently find these (this is not the case in this tests). In
> +addition, we could also have to pull the changeset because they have children.
> +In this case, they would not be hidden (yet) because of the orphan descendant,
> +but they would still have to be obsolete. (This is not tested in this case
> +either).
> +
> +  $ mkdir distributed-chain-building
> +  $ cd distributed-chain-building
> +  $ hg init server
> +  $ cd server
> +  $ mkcommit ROOT
> +  $ cd ..
> +  $ hg clone server repo-Alice
> +  updating to branch default
> +  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> +  $ hg clone server repo-Bob
> +  updating to branch default
> +  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> +  $ hg clone server repo-Celeste
> +  updating to branch default
> +  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> +

Same as in the first patch, ui.username=Alice/Bob/Celest would be really
nice.

> +Create some changesets locally
> +
> +  $ cd repo-Alice
> +  $ mkcommit c_A0
> +  $ mkcommit c_B0
> +  $ cd ..
> +
> +Bob pull from Alice and rewrite them

Bob pulls from Alice and rewrites them

> +
> +  $ cd repo-Bob
> +  $ hg pull ../repo-Alice
> +  pulling from ../repo-Alice
> +  searching for changes
> +  adding changesets
> +  adding manifests
> +  adding file changes
> +  added 2 changesets with 2 changes to 2 files
> +  (run 'hg update' to get a working copy)
> +  $ hg up 'desc("c_A")'
> +  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> +  $ hg commit --amend -m 'c_A1'
> +  $ hg rebase -r 'desc("c_B0")' -d . # no easy way to rewrite the message with the rebase
> +  rebasing 2:3378110892d3 "c_B0"
> +  $ hg up
> +  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> +  $ hg commit --amend -m 'c_B1'
> +  $ hg log -G
> +  @  5:22b4da3eca41 c_B1
> +  |
> +  o  3:338fcca61785 c_A1
> +  |
> +  o  0:ea207398892e ROOT
> +
> +  $ hg log -G --hidden
> +  @  5:22b4da3eca41 c_B1
> +  |
> +  | x  4:2bd2cdfdc4ee c_B0 [rewritten using amend as 5:22b4da3eca41 by test (at 1970-01-01 00:00 +0000); ]
> +  |/
> +  o  3:338fcca61785 c_A1
> +  |
> +  | x  2:3378110892d3 c_B0 [rewritten using rebase as 4:2bd2cdfdc4ee by test (at 1970-01-01 00:00 +0000); ]
> +  | |
> +  | x  1:d1ada4861b76 c_A0 [rewritten using amend as 3:338fcca61785 by test (at 1970-01-01 00:00 +0000); ]
> +  |/
> +  o  0:ea207398892e ROOT
> +
> +  $ hg debugobsolete
> +  d1ada4861b7669f79a948eefaea6950b5e543855 338fcca617859ace5cda45d0c8869954a70529c1 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
> +  3378110892d3dd34d39e22fba45483c1a986a455 2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'}
> +  2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 22b4da3eca4124971655daff24953461b15e62e8 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
> +  $ cd ..
> +
> +Celeste pull from Bob and rewrite them again

pulls ... rewrites

> +
> +  $ cd repo-Celeste
> +  $ hg pull ../repo-Bob
> +  pulling from ../repo-Bob
> +  searching for changes
> +  adding changesets
> +  adding manifests
> +  adding file changes
> +  added 2 changesets with 2 changes to 2 files
> +  3 new obsolescence markers
> +  (run 'hg update' to get a working copy)
> +  $ hg up 'desc("c_A")'
> +  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> +  $ hg commit --amend -m 'c_A2'
> +  $ hg rebase -r 'desc("c_B1")' -d . # no easy way to rewrite the message with the rebase
> +  rebasing 2:22b4da3eca41 "c_B1"
> +  $ hg up
> +  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> +  $ hg commit --amend -m 'c_B2'
> +  $ hg log -G
> +  @  5:2caf15685f04 c_B2
> +  |
> +  o  3:0269888bb02e c_A2
> +  |
> +  o  0:ea207398892e ROOT
> +
> +  $ hg log -G --hidden
> +  @  5:2caf15685f04 c_B2
> +  |
> +  | x  4:5f660b874f72 c_B1 [rewritten using amend as 5:2caf15685f04 by test (at 1970-01-01 00:00 +0000); ]
> +  |/
> +  o  3:0269888bb02e c_A2
> +  |
> +  | x  2:22b4da3eca41 c_B1 [rewritten using rebase as 4:5f660b874f72 by test (at 1970-01-01 00:00 +0000); ]
> +  | |
> +  | x  1:338fcca61785 c_A1 [rewritten using amend as 3:0269888bb02e by test (at 1970-01-01 00:00 +0000); ]
> +  |/
> +  o  0:ea207398892e ROOT
> +
> +  $ hg debugobsolete
> +  2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 22b4da3eca4124971655daff24953461b15e62e8 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
> +  3378110892d3dd34d39e22fba45483c1a986a455 2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'}
> +  d1ada4861b7669f79a948eefaea6950b5e543855 338fcca617859ace5cda45d0c8869954a70529c1 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
> +  338fcca617859ace5cda45d0c8869954a70529c1 0269888bb02e58ade44a9201228d924d3e09b5d7 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
> +  22b4da3eca4124971655daff24953461b15e62e8 5f660b874f7281e7a428ab85f01460e5cf0c704b 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'}
> +  5f660b874f7281e7a428ab85f01460e5cf0c704b 2caf15685f04a4f816e319081f999dfcea07a440 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
> +
> +Celeste now push to the server

pushes

> +
> +(note: it would be enough to just have direct Celeste -> Alice exchange here.
> +However using a central server seems more common)
> +
> +  $ hg push
> +  pushing to $TESTTMP/distributed-chain-building/distributed-chain-building/server (glob)
> +  searching for changes
> +  adding changesets
> +  adding manifests
> +  adding file changes
> +  added 2 changesets with 2 changes to 2 files
> +  6 new obsolescence markers
> +  $ cd ..
> +
> +Now Alice pull from the server, then from Bob

pulls (also a couple or more below)

> +Alice first retrieve the new evolution of its changesets and associated markers
> +from the server (note: could be from Celeste directly)

retrieves ...

> +  $ cd repo-Alice
> +  $ hg up 'desc(ROOT)'
> +  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
> +  $ hg pull
> +  pulling from $TESTTMP/distributed-chain-building/distributed-chain-building/server (glob)
> +  searching for changes
> +  adding changesets
> +  adding manifests
> +  adding file changes
> +  added 2 changesets with 0 changes to 2 files (+1 heads)
> +  6 new obsolescence markers
> +  obsoleted 2 changesets
> +  (run 'hg heads' to see heads)
> +  $ hg debugobsolete
> +  22b4da3eca4124971655daff24953461b15e62e8 5f660b874f7281e7a428ab85f01460e5cf0c704b 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'}
> +  2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 22b4da3eca4124971655daff24953461b15e62e8 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
> +  3378110892d3dd34d39e22fba45483c1a986a455 2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'}
> +  338fcca617859ace5cda45d0c8869954a70529c1 0269888bb02e58ade44a9201228d924d3e09b5d7 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
> +  5f660b874f7281e7a428ab85f01460e5cf0c704b 2caf15685f04a4f816e319081f999dfcea07a440 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
> +  d1ada4861b7669f79a948eefaea6950b5e543855 338fcca617859ace5cda45d0c8869954a70529c1 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
> +
> +Then, it pull from Bob, pulling predecessors of the changeset it has already
> +pulled. The changesets are not obsoleted in the Bob repo yet. Their successors
> +do not exist in Bob repository yet.
> +
> +  $ hg pull ../repo-Bob
> +  pulling from ../repo-Bob
> +  searching for changes
> +  adding changesets
> +  adding manifests
> +  adding file changes
> +  added 2 changesets with 0 changes to 2 files (+1 heads)
> +  (run 'hg heads' to see heads)
> +  $ hg log -G
> +  o  4:2caf15685f04 c_B2
> +  |
> +  o  3:0269888bb02e c_A2
> +  |
> +  @  0:ea207398892e ROOT
> +
> +  $ hg debugobsolete
> +  22b4da3eca4124971655daff24953461b15e62e8 5f660b874f7281e7a428ab85f01460e5cf0c704b 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'}
> +  2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 22b4da3eca4124971655daff24953461b15e62e8 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
> +  3378110892d3dd34d39e22fba45483c1a986a455 2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'}
> +  338fcca617859ace5cda45d0c8869954a70529c1 0269888bb02e58ade44a9201228d924d3e09b5d7 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
> +  5f660b874f7281e7a428ab85f01460e5cf0c704b 2caf15685f04a4f816e319081f999dfcea07a440 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
> +  d1ada4861b7669f79a948eefaea6950b5e543855 338fcca617859ace5cda45d0c8869954a70529c1 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
> +
> +Same tests, but change coming from a bundle
> +(testing with a bundle is interesting because absolutely no discovery or
> +decision is made in that case, so receiving the changesets are not an option).
> +
> +  $ hg rollback
> +  repository tip rolled back to revision 4 (undo pull)
> +  $ hg log -G
> +  o  4:2caf15685f04 c_B2
> +  |
> +  o  3:0269888bb02e c_A2
> +  |
> +  @  0:ea207398892e ROOT
> +
> +  $ hg debugobsolete
> +  22b4da3eca4124971655daff24953461b15e62e8 5f660b874f7281e7a428ab85f01460e5cf0c704b 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'}
> +  2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 22b4da3eca4124971655daff24953461b15e62e8 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
> +  3378110892d3dd34d39e22fba45483c1a986a455 2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'}
> +  338fcca617859ace5cda45d0c8869954a70529c1 0269888bb02e58ade44a9201228d924d3e09b5d7 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
> +  5f660b874f7281e7a428ab85f01460e5cf0c704b 2caf15685f04a4f816e319081f999dfcea07a440 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
> +  d1ada4861b7669f79a948eefaea6950b5e543855 338fcca617859ace5cda45d0c8869954a70529c1 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
> +  $ hg -R ../repo-Bob bundle ../step-1.hg
> +  searching for changes
> +  2 changesets found
> +  $ hg unbundle ../step-1.hg
> +  adding changesets
> +  adding manifests
> +  adding file changes
> +  added 2 changesets with 0 changes to 2 files (+1 heads)
> +  (run 'hg heads' to see heads)
> +  $ hg log -G
> +  o  4:2caf15685f04 c_B2
> +  |
> +  o  3:0269888bb02e c_A2
> +  |
> +  @  0:ea207398892e ROOT
> +
> +  $ hg debugobsolete
> +  22b4da3eca4124971655daff24953461b15e62e8 5f660b874f7281e7a428ab85f01460e5cf0c704b 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'}
> +  2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 22b4da3eca4124971655daff24953461b15e62e8 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
> +  3378110892d3dd34d39e22fba45483c1a986a455 2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'}
> +  338fcca617859ace5cda45d0c8869954a70529c1 0269888bb02e58ade44a9201228d924d3e09b5d7 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
> +  5f660b874f7281e7a428ab85f01460e5cf0c704b 2caf15685f04a4f816e319081f999dfcea07a440 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
> +  d1ada4861b7669f79a948eefaea6950b5e543855 338fcca617859ace5cda45d0c8869954a70529c1 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
> +
> +  $ cd ..
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/tests/test-obsolete-distributed.t b/tests/test-obsolete-distributed.t
--- a/tests/test-obsolete-distributed.t
+++ b/tests/test-obsolete-distributed.t
@@ -8,6 +8,8 @@ 
 
   $ . $TESTDIR/testlib/obsmarker-common.sh
   $ cat >> $HGRCPATH << EOF
+  > [extensions]
+  > rebase =
   > [experimental]
   > evolution = all
   > [phases]
@@ -197,3 +199,253 @@ 
   $ hg debugobsolete
   d1ada4861b7669f79a948eefaea6950b5e543855 23422fed6b3d22e1b9d89fb82bdb68edc19079b4 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   23422fed6b3d22e1b9d89fb82bdb68edc19079b4 b305f85f127a9d2e608bcbd83c59373fec615cb2 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+  $ cd ..
+
+Check getting changesets after getting the markers
+=================================================
+
+This test case covers the scenario where commits are received -after- we
+received some obsolescence markers turning them obsolete.
+
+For example, we pull some successors from a repository (with associated
+predecessors marker chain) and then later we pull some intermediate
+precedessors changeset from another repository. Obsolescence markers must
+apply to the intermediate changeset. They have to be obsolete (and hidden).
+
+Avoiding pulling the changeset in the first place is a tricky decision because
+there could be non-obsolete ancestors that need to be pulled, but the
+discovery cannot currently find these (this is not the case in this tests). In
+addition, we could also have to pull the changeset because they have children.
+In this case, they would not be hidden (yet) because of the orphan descendant,
+but they would still have to be obsolete. (This is not tested in this case
+either).
+
+  $ mkdir distributed-chain-building
+  $ cd distributed-chain-building
+  $ hg init server
+  $ cd server
+  $ mkcommit ROOT
+  $ cd ..
+  $ hg clone server repo-Alice
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg clone server repo-Bob
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg clone server repo-Celeste
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Create some changesets locally
+
+  $ cd repo-Alice
+  $ mkcommit c_A0
+  $ mkcommit c_B0
+  $ cd ..
+
+Bob pull from Alice and rewrite them
+
+  $ cd repo-Bob
+  $ hg pull ../repo-Alice
+  pulling from ../repo-Alice
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 2 files
+  (run 'hg update' to get a working copy)
+  $ hg up 'desc("c_A")'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg commit --amend -m 'c_A1'
+  $ hg rebase -r 'desc("c_B0")' -d . # no easy way to rewrite the message with the rebase
+  rebasing 2:3378110892d3 "c_B0"
+  $ hg up
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg commit --amend -m 'c_B1'
+  $ hg log -G
+  @  5:22b4da3eca41 c_B1
+  |
+  o  3:338fcca61785 c_A1
+  |
+  o  0:ea207398892e ROOT
+  
+  $ hg log -G --hidden
+  @  5:22b4da3eca41 c_B1
+  |
+  | x  4:2bd2cdfdc4ee c_B0 [rewritten using amend as 5:22b4da3eca41 by test (at 1970-01-01 00:00 +0000); ]
+  |/
+  o  3:338fcca61785 c_A1
+  |
+  | x  2:3378110892d3 c_B0 [rewritten using rebase as 4:2bd2cdfdc4ee by test (at 1970-01-01 00:00 +0000); ]
+  | |
+  | x  1:d1ada4861b76 c_A0 [rewritten using amend as 3:338fcca61785 by test (at 1970-01-01 00:00 +0000); ]
+  |/
+  o  0:ea207398892e ROOT
+  
+  $ hg debugobsolete
+  d1ada4861b7669f79a948eefaea6950b5e543855 338fcca617859ace5cda45d0c8869954a70529c1 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
+  3378110892d3dd34d39e22fba45483c1a986a455 2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'}
+  2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 22b4da3eca4124971655daff24953461b15e62e8 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
+  $ cd ..
+
+Celeste pull from Bob and rewrite them again
+
+  $ cd repo-Celeste
+  $ hg pull ../repo-Bob
+  pulling from ../repo-Bob
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 2 files
+  3 new obsolescence markers
+  (run 'hg update' to get a working copy)
+  $ hg up 'desc("c_A")'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg commit --amend -m 'c_A2'
+  $ hg rebase -r 'desc("c_B1")' -d . # no easy way to rewrite the message with the rebase
+  rebasing 2:22b4da3eca41 "c_B1"
+  $ hg up
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg commit --amend -m 'c_B2'
+  $ hg log -G
+  @  5:2caf15685f04 c_B2
+  |
+  o  3:0269888bb02e c_A2
+  |
+  o  0:ea207398892e ROOT
+  
+  $ hg log -G --hidden
+  @  5:2caf15685f04 c_B2
+  |
+  | x  4:5f660b874f72 c_B1 [rewritten using amend as 5:2caf15685f04 by test (at 1970-01-01 00:00 +0000); ]
+  |/
+  o  3:0269888bb02e c_A2
+  |
+  | x  2:22b4da3eca41 c_B1 [rewritten using rebase as 4:5f660b874f72 by test (at 1970-01-01 00:00 +0000); ]
+  | |
+  | x  1:338fcca61785 c_A1 [rewritten using amend as 3:0269888bb02e by test (at 1970-01-01 00:00 +0000); ]
+  |/
+  o  0:ea207398892e ROOT
+  
+  $ hg debugobsolete
+  2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 22b4da3eca4124971655daff24953461b15e62e8 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
+  3378110892d3dd34d39e22fba45483c1a986a455 2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'}
+  d1ada4861b7669f79a948eefaea6950b5e543855 338fcca617859ace5cda45d0c8869954a70529c1 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
+  338fcca617859ace5cda45d0c8869954a70529c1 0269888bb02e58ade44a9201228d924d3e09b5d7 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
+  22b4da3eca4124971655daff24953461b15e62e8 5f660b874f7281e7a428ab85f01460e5cf0c704b 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'}
+  5f660b874f7281e7a428ab85f01460e5cf0c704b 2caf15685f04a4f816e319081f999dfcea07a440 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
+
+Celeste now push to the server
+
+(note: it would be enough to just have direct Celeste -> Alice exchange here.
+However using a central server seems more common)
+
+  $ hg push
+  pushing to $TESTTMP/distributed-chain-building/distributed-chain-building/server (glob)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 2 files
+  6 new obsolescence markers
+  $ cd ..
+
+Now Alice pull from the server, then from Bob
+
+Alice first retrieve the new evolution of its changesets and associated markers
+from the server (note: could be from Celeste directly)
+
+  $ cd repo-Alice
+  $ hg up 'desc(ROOT)'
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ hg pull
+  pulling from $TESTTMP/distributed-chain-building/distributed-chain-building/server (glob)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 0 changes to 2 files (+1 heads)
+  6 new obsolescence markers
+  obsoleted 2 changesets
+  (run 'hg heads' to see heads)
+  $ hg debugobsolete
+  22b4da3eca4124971655daff24953461b15e62e8 5f660b874f7281e7a428ab85f01460e5cf0c704b 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'}
+  2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 22b4da3eca4124971655daff24953461b15e62e8 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
+  3378110892d3dd34d39e22fba45483c1a986a455 2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'}
+  338fcca617859ace5cda45d0c8869954a70529c1 0269888bb02e58ade44a9201228d924d3e09b5d7 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
+  5f660b874f7281e7a428ab85f01460e5cf0c704b 2caf15685f04a4f816e319081f999dfcea07a440 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
+  d1ada4861b7669f79a948eefaea6950b5e543855 338fcca617859ace5cda45d0c8869954a70529c1 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
+
+Then, it pull from Bob, pulling predecessors of the changeset it has already
+pulled. The changesets are not obsoleted in the Bob repo yet. Their successors
+do not exist in Bob repository yet.
+
+  $ hg pull ../repo-Bob
+  pulling from ../repo-Bob
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 0 changes to 2 files (+1 heads)
+  (run 'hg heads' to see heads)
+  $ hg log -G
+  o  4:2caf15685f04 c_B2
+  |
+  o  3:0269888bb02e c_A2
+  |
+  @  0:ea207398892e ROOT
+  
+  $ hg debugobsolete
+  22b4da3eca4124971655daff24953461b15e62e8 5f660b874f7281e7a428ab85f01460e5cf0c704b 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'}
+  2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 22b4da3eca4124971655daff24953461b15e62e8 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
+  3378110892d3dd34d39e22fba45483c1a986a455 2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'}
+  338fcca617859ace5cda45d0c8869954a70529c1 0269888bb02e58ade44a9201228d924d3e09b5d7 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
+  5f660b874f7281e7a428ab85f01460e5cf0c704b 2caf15685f04a4f816e319081f999dfcea07a440 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
+  d1ada4861b7669f79a948eefaea6950b5e543855 338fcca617859ace5cda45d0c8869954a70529c1 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
+
+Same tests, but change coming from a bundle
+(testing with a bundle is interesting because absolutely no discovery or
+decision is made in that case, so receiving the changesets are not an option).
+
+  $ hg rollback
+  repository tip rolled back to revision 4 (undo pull)
+  $ hg log -G
+  o  4:2caf15685f04 c_B2
+  |
+  o  3:0269888bb02e c_A2
+  |
+  @  0:ea207398892e ROOT
+  
+  $ hg debugobsolete
+  22b4da3eca4124971655daff24953461b15e62e8 5f660b874f7281e7a428ab85f01460e5cf0c704b 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'}
+  2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 22b4da3eca4124971655daff24953461b15e62e8 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
+  3378110892d3dd34d39e22fba45483c1a986a455 2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'}
+  338fcca617859ace5cda45d0c8869954a70529c1 0269888bb02e58ade44a9201228d924d3e09b5d7 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
+  5f660b874f7281e7a428ab85f01460e5cf0c704b 2caf15685f04a4f816e319081f999dfcea07a440 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
+  d1ada4861b7669f79a948eefaea6950b5e543855 338fcca617859ace5cda45d0c8869954a70529c1 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
+  $ hg -R ../repo-Bob bundle ../step-1.hg
+  searching for changes
+  2 changesets found
+  $ hg unbundle ../step-1.hg
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 0 changes to 2 files (+1 heads)
+  (run 'hg heads' to see heads)
+  $ hg log -G
+  o  4:2caf15685f04 c_B2
+  |
+  o  3:0269888bb02e c_A2
+  |
+  @  0:ea207398892e ROOT
+  
+  $ hg debugobsolete
+  22b4da3eca4124971655daff24953461b15e62e8 5f660b874f7281e7a428ab85f01460e5cf0c704b 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'}
+  2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 22b4da3eca4124971655daff24953461b15e62e8 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
+  3378110892d3dd34d39e22fba45483c1a986a455 2bd2cdfdc4ee08104659c2e9d39691d9ae50a208 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'}
+  338fcca617859ace5cda45d0c8869954a70529c1 0269888bb02e58ade44a9201228d924d3e09b5d7 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
+  5f660b874f7281e7a428ab85f01460e5cf0c704b 2caf15685f04a4f816e319081f999dfcea07a440 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
+  d1ada4861b7669f79a948eefaea6950b5e543855 338fcca617859ace5cda45d0c8869954a70529c1 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'}
+
+  $ cd ..