tests/test-exchange-D2.t
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Fri, 24 Mar 2017 09:42:39 +0100
changeset 2229 575561934439
parent 2228 3b18440cca74
child 2230 a202f3af890c
permissions -rw-r--r--
debug: rename 'debugstablerange' to 'debugobshashrange' The command is more about the 'obshashrange' computation.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
849
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     1
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     2
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     3
Initial setup
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     4
2118
d0bc98161794 tests: move exchange utility in testlib
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2083
diff changeset
     5
  $ . $TESTDIR/testlib/exchange-util.sh
849
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     6
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     7
=== D.2 missing prune target (prune in "pushed set") ===
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     8
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     9
{{{
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    10
}}}
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    11
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    12
Marker exist from:
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    13
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    14
 * A' succeed to A
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    15
 * A' (prune)
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    16
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    17
Command run:
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    18
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    19
 * hg push
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    20
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    21
Expected exchange:
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    22
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    23
 * `A ø⇠o A'`
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    24
 * A' (prune)
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    25
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    26
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    27
  $ setuprepos D.2
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    28
  creating test repo for test case D.2
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    29
  - pulldest
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    30
  - main
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    31
  - pushdest
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    32
  cd into `main` and proceed with env setup
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    33
  $ cd main
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    34
  $ mkcommit A0
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    35
  $ hg up -q 0
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    36
  $ mkcommit A1
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    37
  created new head
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    38
  $ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(A1)'`
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    39
  $ hg prune --date '0 0' .
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    40
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    41
  working directory now at a9bdc8b26820
1239
8a06b32061ce evolve: apply prune update before creating obsolescence markers
Laurent Charignon <lcharignon@fb.com>
parents: 1093
diff changeset
    42
  1 changesets pruned
849
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    43
  $ hg strip --hidden -q 'desc(A1)'
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    44
  $ hg log -G --hidden
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    45
  x  28b51eb45704 (draft): A0
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    46
  |
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    47
  @  a9bdc8b26820 (public): O
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    48
  
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    49
  $ hg debugobsolete
1065
f355bbc124fc test: update test to new date formatting in debuobsolete output
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1060
diff changeset
    50
  28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1067
5d063fed9e3d evolve: yield to relevant markers handling in core
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1065
diff changeset
    51
  e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
2083
778afb036245 discovery: introduce a official 'obshash associated to a range
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1239
diff changeset
    52
  $ hg debugobsrelsethashtree
778afb036245 discovery: introduce a official 'obshash associated to a range
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1239
diff changeset
    53
  a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04 554c0b12f7d9fff20cb904c26e12eee337e3309c
778afb036245 discovery: introduce a official 'obshash associated to a range
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1239
diff changeset
    54
  28b51eb45704506b5c603decd6bf7ac5e0f6a52f 5c81c58ce0a8ad61dd9cf4c6949846b5990af30d
2229
575561934439 debug: rename 'debugstablerange' to 'debugobshashrange'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2228
diff changeset
    55
  $ hg debugobshashrange --rev 'head()'
2228
3b18440cca74 debugstablerange: improve output spacing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2118
diff changeset
    56
           rev         node        index         size        depth      obshash
3b18440cca74 debugstablerange: improve output spacing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2118
diff changeset
    57
             0 a9bdc8b26820            0            1            1 554c0b12f7d9
849
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    58
  $ cd ..
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    59
  $ cd ..
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    60
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    61
Actual Test
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    62
-------------------------------------
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    63
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    64
  $ dotest D.2
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    65
  ## Running testcase D.2
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    66
  ## initial state
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    67
  # obstore: main
1065
f355bbc124fc test: update test to new date formatting in debuobsolete output
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1060
diff changeset
    68
  28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1067
5d063fed9e3d evolve: yield to relevant markers handling in core
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1065
diff changeset
    69
  e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
849
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    70
  # obstore: pushdest
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    71
  # obstore: pulldest
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    72
  ## pushing from main to pushdest
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    73
  pushing to pushdest
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    74
  searching for changes
1078
5717d023da63 obsexc: use the common discovery
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1067
diff changeset
    75
  no changes found
1093
a49f2e7a2755 obsexch: respect todosteps when using the old push
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1088
diff changeset
    76
  remote: 2 new obsolescence markers
849
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    77
  ## post push state
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    78
  # obstore: main
1065
f355bbc124fc test: update test to new date formatting in debuobsolete output
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1060
diff changeset
    79
  28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1067
5d063fed9e3d evolve: yield to relevant markers handling in core
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1065
diff changeset
    80
  e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
849
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    81
  # obstore: pushdest
1065
f355bbc124fc test: update test to new date formatting in debuobsolete output
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1060
diff changeset
    82
  28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1067
5d063fed9e3d evolve: yield to relevant markers handling in core
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1065
diff changeset
    83
  e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
849
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    84
  # obstore: pulldest
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    85
  ## pulling from main into pulldest
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    86
  pulling from main
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    87
  searching for changes
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    88
  no changes found
1093
a49f2e7a2755 obsexch: respect todosteps when using the old push
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1088
diff changeset
    89
  2 new obsolescence markers
849
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    90
  ## post pull state
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    91
  # obstore: main
1065
f355bbc124fc test: update test to new date formatting in debuobsolete output
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1060
diff changeset
    92
  28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1067
5d063fed9e3d evolve: yield to relevant markers handling in core
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1065
diff changeset
    93
  e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
849
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    94
  # obstore: pushdest
1065
f355bbc124fc test: update test to new date formatting in debuobsolete output
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1060
diff changeset
    95
  28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1067
5d063fed9e3d evolve: yield to relevant markers handling in core
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1065
diff changeset
    96
  e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
849
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    97
  # obstore: pulldest
1065
f355bbc124fc test: update test to new date formatting in debuobsolete output
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1060
diff changeset
    98
  28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1067
5d063fed9e3d evolve: yield to relevant markers handling in core
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1065
diff changeset
    99
  e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
849
cddac452fa40 exchange: add test case for D.2
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   100