tests/test-exchange-A4.t
author Pierre-Yves David <pierre-yves.david@fb.com>
Tue, 20 May 2014 13:41:27 -0700
changeset 957 2cde59f3cb5d
parent 956 b107f3549ec2
child 984 b286f77d680c
permissions -rw-r--r--
evolve: add a push pass using bundle2 Instead of using a dedicated wireprotocol commands, we use bundle2 to transmit an obs marker parts. This aims at both testing bundle2 more and to limit the amount of special code we needs to put in simple for server to fit our needs. The massive test changes comes from the fact we can use this fast path for both remote and local push.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
833
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     1
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     2
Initial setup
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     3
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     4
  $ . $TESTDIR/_exc-util.sh
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     5
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     6
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     7
=== A.4 Push in the middle of the obsolescence chain ===
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     8
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     9
.. (Where we show that we should not push the marker without the successors)
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    10
..
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    11
.. {{{
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    12
..   B 
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    13
..     |
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    14
..   A⇠ø⇠○ A'
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    15
..     |/
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    16
..     ● O
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    17
.. }}}
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    18
..
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    19
.. Marker exist from:
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    20
..
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    21
..  * `Aø⇠○ A'`
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    22
..  * chain from A
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    23
..
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    24
.. Command run:
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    25
..
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    26
..  * hg push -r B
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    27
..
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    28
.. Expected exchange:
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    29
..
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    30
..  * Chain from A
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    31
..
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    32
.. Expected Exclude:
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    33
..
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    34
..  * `⇠○ A'`
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    35
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    36
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    37
initial
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    38
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    39
  $ setuprepos A.4
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    40
  creating test repo for test case A.4
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    41
  - pulldest
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    42
  - main
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    43
  - pushdest
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    44
  cd into `main` and proceed with env setup
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    45
  $ cd main
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    46
  $ mkcommit A0
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    47
  $ mkcommit B
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    48
  $ hg update 0
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    49
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    50
  $ mkcommit A1
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    51
  created new head
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    52
  $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa `getid 'desc(A0)'`
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    53
  $ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(A1)'`
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    54
  $ hg log -G --hidden
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    55
  @  e5ea8f9c7314 (draft): A1
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    56
  |
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    57
  | o  06055a7959d4 (draft): B
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    58
  | |
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    59
  | x  28b51eb45704 (draft): A0
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    60
  |/
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    61
  o  a9bdc8b26820 (public): O
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    62
  
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    63
  $ hg debugobsolete
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    64
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 {'date': '', 'user': 'test'}
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    65
  28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {'date': '', 'user': 'test'}
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    66
  $ cd ..
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    67
  $ cd ..
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    68
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    69
Actual Test for first version (changeset unknown remotly)
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    70
---------------------------------------------------------
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    71
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    72
  $ dotest A.4 B -f
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    73
  ## Running testcase A.4
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    74
  # testing echange of "B" (06055a7959d4)
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    75
  ## initial state
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    76
  # obstore: main
905
b177fde040dd exchange: use fixed order for obstore content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 833
diff changeset
    77
  28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {'date': '', 'user': 'test'}
833
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    78
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 {'date': '', 'user': 'test'}
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    79
  # obstore: pushdest
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    80
  # obstore: pulldest
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    81
  ## pushing "B" from main to pushdest
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    82
  pushing to pushdest
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    83
  searching for changes
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    84
  adding changesets
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    85
  adding manifests
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    86
  adding file changes
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    87
  added 2 changesets with 2 changes to 2 files
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    88
  OBSEXC: computing relevant nodes
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    89
  OBSEXC: computing markers relevant to 3 nodes
957
2cde59f3cb5d evolve: add a push pass using bundle2
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 956
diff changeset
    90
  OBSEXC: pushing 1 markers (62 bytes)
833
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    91
  OBSEXC: DONE
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    92
  ## post push state
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    93
  # obstore: main
905
b177fde040dd exchange: use fixed order for obstore content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 833
diff changeset
    94
  28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {'date': '', 'user': 'test'}
833
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    95
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 {'date': '', 'user': 'test'}
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    96
  # obstore: pushdest
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    97
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 {'date': '', 'user': 'test'}
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    98
  # obstore: pulldest
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    99
  ## pulling "06055a7959d4" from main into pulldest
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   100
  pulling from main
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   101
  searching for changes
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   102
  adding changesets
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   103
  adding manifests
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   104
  adding file changes
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   105
  added 2 changesets with 2 changes to 2 files
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   106
  OBSEXC: pull obsolescence markers
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   107
  OBSEXC: merging obsolescence markers (62 bytes)
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   108
  OBSEXC: 1 markers added
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   109
  OBSEXC: DONE
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   110
  (run 'hg update' to get a working copy)
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   111
  ## post pull state
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   112
  # obstore: main
905
b177fde040dd exchange: use fixed order for obstore content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 833
diff changeset
   113
  28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {'date': '', 'user': 'test'}
833
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   114
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 {'date': '', 'user': 'test'}
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   115
  # obstore: pushdest
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   116
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 {'date': '', 'user': 'test'}
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   117
  # obstore: pulldest
cf803a36e3fb exchange: add test case for A.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   118
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 {'date': '', 'user': 'test'}