exchange: add test case for A.2
Testcase defined here: http://mercurial.selenic.com/wiki/ObsolescenceMarkersExchange
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-exchange-A2.t Fri Feb 28 16:36:37 2014 -0800
@@ -0,0 +1,141 @@
+
+
+Initial setup
+
+ $ cat >> $HGRCPATH <<EOF
+ > [web]
+ > push_ssl = false
+ > allow_push = *
+ > [ui]
+ > logtemplate ="{node|short} ({phase}): {desc}\n"
+ > [phases]
+ > publish=False
+ > [extensions]
+ > hgext.rebase=
+ > EOF
+ $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext/evolve.py" >> $HGRCPATH
+
+ $ mkcommit() {
+ > echo "$1" > "$1"
+ > hg add "$1"
+ > hg ci -m "$1"
+ > }
+ $ getid() {
+ > hg id --hidden --debug -ir "$1"
+ > }
+
+
+
+
+
+=== A.2 Two heads ===
+
+.. {{{
+.. ⇠○ B
+.. ⇠◔ | A
+.. |/
+.. ● O
+.. }}}
+..
+.. Marker exist from:
+..
+.. * A
+.. * B
+..
+..
+.. Command run:
+..
+.. * hg push -r A
+..
+.. Expected exchange:
+..
+.. * chain from A
+..
+.. Expected Exclude:
+..
+.. * chain from B
+
+initial
+
+ $ mkdir A.2
+ $ cd A.2
+ $ hg init main
+ $ hg init pushdest
+ $ hg init pulldest
+ $ cd main
+ $ mkcommit O
+ $ hg phase --public .
+ $ hg push -q ../pushdest
+ $ hg push -q ../pulldest
+ $ mkcommit A
+ $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa `getid 'desc(A)'`
+ $ hg up .^
+ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ $ mkcommit B
+ created new head
+ $ hg debugobsolete bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb `getid 'desc(B)'`
+ $ hg log -G
+ @ 35b183996678 (draft): B
+ |
+ | o f5bc6836db60 (draft): A
+ |/
+ o a9bdc8b26820 (public): O
+
+ $ hg debugobsolete
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 35b1839966785d5703a01607229eea932db42f87 0 {'date': '', 'user': 'test'}
+ $ cd ..
+ $ cd ..
+
+
+Actual Test
+---------------
+
+ $ cd A.2
+ $ hg -R main id -r 'desc(A)'
+ f5bc6836db60
+ $ hg -R main debugobsolete
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 35b1839966785d5703a01607229eea932db42f87 0 {'date': '', 'user': 'test'}
+ $ hg -R pushdest debugobsolete
+ $ hg -R pulldest debugobsolete
+
+ $ hg -R main push -r 'desc(A)' pushdest
+ pushing to pushdest
+ searching for changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 1 changesets with 1 changes to 1 files
+ OBSEXC: computing relevant nodes
+ OBSEXC: computing markers relevant to 2 nodes
+ OBSEXC: encoding 1 markers
+ OBSEXC: sending 1 pushkey payload (78 bytes)
+ OBSEXC: DONE
+ $ hg -R main debugobsolete
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 35b1839966785d5703a01607229eea932db42f87 0 {'date': '', 'user': 'test'}
+ $ hg -R pushdest debugobsolete
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
+ $ hg -R pulldest debugobsolete
+ $ hg -R pulldest pull -r 'f5bc6836db60' main
+ pulling from main
+ searching for changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 1 changesets with 1 changes to 1 files
+ OBSEXC: pull obsolescence markers
+ OBSEXC: merging obsolescence markers (62 bytes)
+ OBSEXC: 1 markers added
+ OBSEXC: DONE
+ (run 'hg update' to get a working copy)
+ $ hg -R main debugobsolete
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 35b1839966785d5703a01607229eea932db42f87 0 {'date': '', 'user': 'test'}
+ $ hg -R pushdest debugobsolete
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
+ $ hg -R pulldest debugobsolete
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
+
+ $ cd ..