tests/test-exchange-C4.t
author Pierre-Yves David <pierre-yves.david@fb.com>
Fri, 25 Jul 2014 14:27:16 +0200
changeset 1001 f7f4a1fac6c0
parent 957 2cde59f3cb5d
child 1037 bddee73b361e
permissions -rw-r--r--
test: use `hg log` in the `getid` function using `hg id` to retrieve full lenght node requires to use --debug. This may include debug output (regarding branch cache invalidation for example) that breaks the test. We now use `hg log` with a custom template. This is a simple, clean and robust solution.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
847
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     1
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     2
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     3
Initial setup
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     4
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     5
  $ . $TESTDIR/_exc-util.sh
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     6
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     7
=== C.4 multiple successors, one is pruned ===
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     8
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     9
.. Another case were prune are confusing? (A is killed without its successors being
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    10
.. pushed)
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    11
..
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    12
.. (could split of divergence, if split see the Z section)
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    13
..
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    14
.. {{{
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    15
..        A
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    16
..    B ○⇢ø⇠⊗ C
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    17
..       \|/
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    18
..         O
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    19
.. }}}
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    20
..
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    21
.. Marker exist from:
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    22
..
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    23
..  * `A ø⇠○ B`
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    24
..  * `A ø⇠○ C`
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    25
..  * C (prune)
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    26
..
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    27
..
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    28
.. Command run:
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    29
..
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    30
..  * hg push -r O
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    31
..
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    32
.. Expected exchange:
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    33
..
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    34
..  * `A ø⇠○ C`
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    35
..  * C (prune)
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    36
..
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    37
.. Expected exclude:
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    38
..
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    39
..  * `A ø⇠○ B`
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    40
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    41
Implemented as the non-split version
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    42
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    43
  $ setuprepos C.4
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    44
  creating test repo for test case C.4
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    45
  - pulldest
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    46
  - main
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    47
  - pushdest
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    48
  cd into `main` and proceed with env setup
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    49
  $ cd main
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    50
  $ mkcommit A
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    51
  $ hg update -q 0
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    52
  $ mkcommit B
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    53
  created new head
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    54
  $ hg update -q 0
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    55
  $ mkcommit C
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    56
  created new head
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    57
  $ hg debugobsolete --hidden `getid 'desc(A)'` `getid 'desc(B)'`
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    58
  $ hg debugobsolete --hidden `getid 'desc(A)'` `getid 'desc(C)'`
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    59
  $ hg prune -qd '0 0' .
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    60
  $ hg log -G --hidden
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    61
  x  7f7f229b13a6 (draft): C
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    62
  |
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    63
  | o  35b183996678 (draft): B
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    64
  |/
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    65
  | x  f5bc6836db60 (draft): A
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    66
  |/
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    67
  @  a9bdc8b26820 (public): O
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    68
  
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    69
  $ hg debugobsolete
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    70
  f5bc6836db60e308a17ba08bf050154ba9c4fad7 35b1839966785d5703a01607229eea932db42f87 0 {'date': '', 'user': 'test'}
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    71
  f5bc6836db60e308a17ba08bf050154ba9c4fad7 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {'date': '', 'user': 'test'}
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    72
  7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {'date': '0 0', 'p1': 'a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04', 'user': 'test'}
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    73
  $ cd ..
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    74
  $ cd ..
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    75
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    76
Actual Test
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    77
-------------------------------------
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    78
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    79
  $ dotest C.4 O
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    80
  ## Running testcase C.4
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    81
  # testing echange of "O" (a9bdc8b26820)
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    82
  ## initial state
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    83
  # obstore: main
905
b177fde040dd exchange: use fixed order for obstore content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 847
diff changeset
    84
  7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {'date': '0 0', 'p1': 'a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04', 'user': 'test'}
847
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    85
  f5bc6836db60e308a17ba08bf050154ba9c4fad7 35b1839966785d5703a01607229eea932db42f87 0 {'date': '', 'user': 'test'}
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    86
  f5bc6836db60e308a17ba08bf050154ba9c4fad7 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {'date': '', 'user': 'test'}
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    87
  # obstore: pushdest
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    88
  # obstore: pulldest
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    89
  ## pushing "O" from main to pushdest
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    90
  pushing to pushdest
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    91
  searching for changes
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    92
  no changes found
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    93
  OBSEXC: computing relevant nodes
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    94
  OBSEXC: computing markers relevant to 1 nodes
957
2cde59f3cb5d evolve: add a push pass using bundle2
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 956
diff changeset
    95
  OBSEXC: pushing 2 markers (150 bytes)
847
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    96
  OBSEXC: DONE
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    97
  ## post push state
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    98
  # obstore: main
905
b177fde040dd exchange: use fixed order for obstore content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 847
diff changeset
    99
  7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {'date': '0 0', 'p1': 'a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04', 'user': 'test'}
847
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   100
  f5bc6836db60e308a17ba08bf050154ba9c4fad7 35b1839966785d5703a01607229eea932db42f87 0 {'date': '', 'user': 'test'}
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   101
  f5bc6836db60e308a17ba08bf050154ba9c4fad7 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {'date': '', 'user': 'test'}
905
b177fde040dd exchange: use fixed order for obstore content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 847
diff changeset
   102
  # obstore: pushdest
847
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   103
  7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {'date': '0 0', 'p1': 'a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04', 'user': 'test'}
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   104
  f5bc6836db60e308a17ba08bf050154ba9c4fad7 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {'date': '', 'user': 'test'}
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   105
  # obstore: pulldest
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   106
  ## pulling "a9bdc8b26820" from main into pulldest
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   107
  pulling from main
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   108
  no changes found
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   109
  OBSEXC: pull obsolescence markers
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   110
  OBSEXC: merging obsolescence markers (150 bytes)
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   111
  OBSEXC: 2 markers added
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   112
  OBSEXC: DONE
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   113
  ## post pull state
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   114
  # obstore: main
905
b177fde040dd exchange: use fixed order for obstore content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 847
diff changeset
   115
  7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {'date': '0 0', 'p1': 'a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04', 'user': 'test'}
847
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   116
  f5bc6836db60e308a17ba08bf050154ba9c4fad7 35b1839966785d5703a01607229eea932db42f87 0 {'date': '', 'user': 'test'}
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   117
  f5bc6836db60e308a17ba08bf050154ba9c4fad7 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {'date': '', 'user': 'test'}
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   118
  # obstore: pushdest
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   119
  7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {'date': '0 0', 'p1': 'a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04', 'user': 'test'}
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   120
  f5bc6836db60e308a17ba08bf050154ba9c4fad7 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {'date': '', 'user': 'test'}
905
b177fde040dd exchange: use fixed order for obstore content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 847
diff changeset
   121
  # obstore: pulldest
847
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   122
  7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {'date': '0 0', 'p1': 'a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04', 'user': 'test'}
905
b177fde040dd exchange: use fixed order for obstore content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 847
diff changeset
   123
  f5bc6836db60e308a17ba08bf050154ba9c4fad7 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {'date': '', 'user': 'test'}
847
d11446392c1d exchange: add test case for C.4
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   124