view tests/test-exchange-A2.t @ 830:f3b3a09ba312

exchange: have a function doing all the common initial setup This will help creation of further test.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 03 Mar 2014 13:27:53 -0800
parents 0943f327e2fb
children a6af6919888d
line wrap: on
line source



Initial setup

  $ . $TESTDIR/_exc-util.sh

=== 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

  $ setuprepos A.2
  creating test repo for test case A.2
  - pulldest
  - main
  - pushdest
  cd into `main` and proceed with env setup
  $ cd main
  $ 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 ..