tests/test-exchange-obsmarkers-case-B3.t
author Pulkit Goyal <7895pulkit@gmail.com>
Sun, 29 Apr 2018 17:54:01 +0530
changeset 3734 aae54e80c95c
parent 3566 e6bea259c227
child 3591 98941c28f3e2
child 4093 ef22eef37ecc
permissions -rw-r--r--
evolve: store divergent nodes in evolvestate when resolving content-divergence We need to store the divergent nodes in evolvestate so that we can continue an interrupted phase divergence resolution.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
     1
============================================
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
     2
Testing obsolescence markers push: Cases B.3
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
     3
============================================
839
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     4
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
     5
Mercurial pushes obsolescences markers relevant to the "pushed-set", the set of
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
     6
all changesets that requested to be "in sync" after the push (even if they are
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
     7
already on both side).
839
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     8
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
     9
This test belongs to a series of tests checking such set is properly computed
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
    10
and applied. This does not tests "obsmarkers" discovery capabilities.
839
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    11
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
    12
Category B: pruning case
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
    13
TestCase 3: Pruned changeset on non-pushed part of the history
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
    14
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
    15
B.3 Pruned changeset on non-pushed part of the history
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
    16
======================================================
839
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    17
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    18
.. {{{
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    19
..    C
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    20
..   |
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    21
..    B
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    22
..   |  A
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    23
..   |/
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    24
..    O
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    25
.. }}}
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    26
..
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
    27
.. Marker exists from:
839
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    28
..
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    29
..  * C (prune)
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    30
..
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
    31
.. Commands run:
839
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    32
..
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    33
..  * hg push -r A
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    34
..
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    35
.. Expected exchange:
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    36
..
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    37
..  * ø
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    38
..
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
    39
.. Expected exclude:
839
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    40
..
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    41
..  * chain from B
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    42
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
    43
Setup
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
    44
-----
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
    45
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
    46
  $ . $TESTDIR/testlib/exchange-obsmarker-util.sh
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
    47
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
    48
initial
839
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    49
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    50
  $ setuprepos B.3
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    51
  creating test repo for test case B.3
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    52
  - pulldest
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    53
  - main
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    54
  - pushdest
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    55
  cd into `main` and proceed with env setup
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    56
  $ cd main
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    57
  $ mkcommit A
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    58
  $ hg up --quiet 0
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    59
  $ mkcommit B
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    60
  created new head
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    61
  $ mkcommit C
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    62
  $ hg prune -qd '0 0' .
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    63
  $ hg log -G --hidden
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    64
  x  e56289ab6378 (draft): C
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    65
  |
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    66
  @  35b183996678 (draft): B
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    67
  |
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    68
  | o  f5bc6836db60 (draft): A
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    69
  |/
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    70
  o  a9bdc8b26820 (public): O
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    71
  
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
    72
  $ inspect_obsmarkers
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
    73
  obsstore content
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
    74
  ================
3566
e6bea259c227 prune: include "operation" metadata in obsmarkers
Martin von Zweigbergk <martinvonz@google.com>
parents: 3559
diff changeset
    75
  e56289ab6378dc752fd7965f8bf66b58bda740bd 0 {35b1839966785d5703a01607229eea932db42f87} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'prune', 'user': 'test'}
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
    76
  obshashtree
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
    77
  ===========
2083
778afb036245 discovery: introduce a official 'obshash associated to a range
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1093
diff changeset
    78
  a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04 0000000000000000000000000000000000000000
778afb036245 discovery: introduce a official 'obshash associated to a range
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1093
diff changeset
    79
  f5bc6836db60e308a17ba08bf050154ba9c4fad7 0000000000000000000000000000000000000000
3566
e6bea259c227 prune: include "operation" metadata in obsmarkers
Martin von Zweigbergk <martinvonz@google.com>
parents: 3559
diff changeset
    80
  35b1839966785d5703a01607229eea932db42f87 3bb8cd8ac8f52487f2ef21e0bdf795a5cd293351
e6bea259c227 prune: include "operation" metadata in obsmarkers
Martin von Zweigbergk <martinvonz@google.com>
parents: 3559
diff changeset
    81
  e56289ab6378dc752fd7965f8bf66b58bda740bd b62eedd8d9194225136e5908c492ab03569079da
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
    82
  obshashrange
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
    83
  ============
2228
3b18440cca74 debugstablerange: improve output spacing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2118
diff changeset
    84
           rev         node        index         size        depth      obshash
3566
e6bea259c227 prune: include "operation" metadata in obsmarkers
Martin von Zweigbergk <martinvonz@google.com>
parents: 3559
diff changeset
    85
             2 35b183996678            0            2            2 3bb8cd8ac8f5
2228
3b18440cca74 debugstablerange: improve output spacing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2118
diff changeset
    86
             1 f5bc6836db60            0            2            2 000000000000
3566
e6bea259c227 prune: include "operation" metadata in obsmarkers
Martin von Zweigbergk <martinvonz@google.com>
parents: 3559
diff changeset
    87
             2 35b183996678            1            1            2 3bb8cd8ac8f5
2228
3b18440cca74 debugstablerange: improve output spacing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2118
diff changeset
    88
             0 a9bdc8b26820            0            1            1 000000000000
3b18440cca74 debugstablerange: improve output spacing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2118
diff changeset
    89
             1 f5bc6836db60            1            1            2 000000000000
839
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    90
  $ cd ..
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    91
  $ cd ..
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    92
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    93
Actual Test
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    94
-----------------------------------
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    95
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    96
  $ dotest B.3 A
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    97
  ## Running testcase B.3
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    98
  # testing echange of "A" (f5bc6836db60)
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    99
  ## initial state
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   100
  # obstore: main
3566
e6bea259c227 prune: include "operation" metadata in obsmarkers
Martin von Zweigbergk <martinvonz@google.com>
parents: 3559
diff changeset
   101
  e56289ab6378dc752fd7965f8bf66b58bda740bd 0 {35b1839966785d5703a01607229eea932db42f87} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'prune', 'user': 'test'}
839
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   102
  # obstore: pushdest
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   103
  # obstore: pulldest
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   104
  ## pushing "A" from main to pushdest
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   105
  pushing to pushdest
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   106
  searching for changes
1089
cdd22a5e5ef1 enable bundle2
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1088
diff changeset
   107
  remote: adding changesets
cdd22a5e5ef1 enable bundle2
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1088
diff changeset
   108
  remote: adding manifests
cdd22a5e5ef1 enable bundle2
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1088
diff changeset
   109
  remote: adding file changes
cdd22a5e5ef1 enable bundle2
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1088
diff changeset
   110
  remote: added 1 changesets with 1 changes to 1 files
839
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   111
  ## post push state
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   112
  # obstore: main
3566
e6bea259c227 prune: include "operation" metadata in obsmarkers
Martin von Zweigbergk <martinvonz@google.com>
parents: 3559
diff changeset
   113
  e56289ab6378dc752fd7965f8bf66b58bda740bd 0 {35b1839966785d5703a01607229eea932db42f87} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'prune', 'user': 'test'}
839
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   114
  # obstore: pushdest
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   115
  # obstore: pulldest
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   116
  ## pulling "f5bc6836db60" from main into pulldest
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   117
  pulling from main
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   118
  searching for changes
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   119
  adding changesets
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   120
  adding manifests
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   121
  adding file changes
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   122
  added 1 changesets with 1 changes to 1 files
3075
8feb2cae7eae test: adapt to output change from eb586ed5d8ce
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2580
diff changeset
   123
  new changesets f5bc6836db60
839
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   124
  (run 'hg update' to get a working copy)
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   125
  ## post pull state
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   126
  # obstore: main
3566
e6bea259c227 prune: include "operation" metadata in obsmarkers
Martin von Zweigbergk <martinvonz@google.com>
parents: 3559
diff changeset
   127
  e56289ab6378dc752fd7965f8bf66b58bda740bd 0 {35b1839966785d5703a01607229eea932db42f87} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'prune', 'user': 'test'}
839
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   128
  # obstore: pushdest
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   129
  # obstore: pulldest
b4f696ad9dee exchange: add test case for B.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   130