tests/test-exchange-D3.t
author Matt Harbison <matt_harbison@yahoo.com>
Sat, 09 Aug 2014 19:12:16 -0400
branchstable
changeset 1106 6b0cf1b73693
parent 1067 5d063fed9e3d
child 1078 5717d023da63
permissions -rw-r--r--
evolve: replace each obsolete sha1 in the description with its latest successor Obsolete csets are hidden by default and don't get pushed to the parent repo. In order to avoid broken references in commit messages, it makes sense to evolve those references to the latest and greatest successor, as each cset containing them is evolved. Of course, stale references can still occur if a commit in branch 'A' references something in branch 'B', and that something in 'B' is evolved but 'A' isn't subsequently evolved. This alleviates the user that is evolving a series of commits from having to 1) recognize that there is a hash that needs updating in any one of the series 2) look up the latest successor manually 3) hg amend -e The regular expression for matching and the logic for replacing are borrowed from the convert extension [1]. It might be nice for the output to state the reason that the reference couldn't be updated (it was pruned, split or diverged), but that may be excessive for something only displayed in verbose mode. (Maybe it should be a ui.status() instead?) [1] http://selenic.com/hg/rev/45562379ce4e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     1
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     2
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     3
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     4
Initial setup
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     5
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     6
  $ . $TESTDIR/_exc-util.sh
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     7
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     8
=== D.2 missing prune target (prune in "pushed set") ===
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     9
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    10
{{{
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    11
}}}
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    12
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    13
Marker exist from:
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    14
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    15
 * A' succeed to A
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    16
 * A' (prune)
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    17
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    18
Command run:
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    19
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    20
 * hg push
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    21
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    22
Expected exchange:
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    23
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    24
 * `A ø⇠o A'`
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    25
 * A' (prune)
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    26
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    27
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    28
  $ setuprepos D.2
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    29
  creating test repo for test case D.2
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    30
  - pulldest
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    31
  - main
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    32
  - pushdest
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    33
  cd into `main` and proceed with env setup
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    34
  $ cd main
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    35
  $ mkcommit A0
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    36
  $ hg up -q 0
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    37
  $ mkcommit B
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    38
  created new head
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    39
  $ mkcommit A1
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    40
  $ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(A1)'`
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    41
  $ hg prune -d '0 0' .
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    42
  1 changesets pruned
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    43
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    44
  working directory now at 35b183996678
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    45
  $ hg strip --hidden -q 'desc(A1)'
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    46
  $ hg log -G --hidden
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    47
  @  35b183996678 (draft): B
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    48
  |
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    49
  | x  28b51eb45704 (draft): A0
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    50
  |/
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    51
  o  a9bdc8b26820 (public): O
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    52
  
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    53
  $ 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
    54
  28b51eb45704506b5c603decd6bf7ac5e0f6a52f 6aa67a7b4baa6fb41b06aed38d5b1201436546e2 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
    55
  6aa67a7b4baa6fb41b06aed38d5b1201436546e2 0 {35b1839966785d5703a01607229eea932db42f87} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    56
  $ cd ..
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    57
  $ cd ..
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    58
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    59
Actual Test
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    60
-------------------------------------
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    61
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    62
  $ dotest D.2 O
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    63
  ## Running testcase D.2
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    64
  # testing echange of "O" (a9bdc8b26820)
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    65
  ## initial state
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    66
  # 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
    67
  28b51eb45704506b5c603decd6bf7ac5e0f6a52f 6aa67a7b4baa6fb41b06aed38d5b1201436546e2 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
    68
  6aa67a7b4baa6fb41b06aed38d5b1201436546e2 0 {35b1839966785d5703a01607229eea932db42f87} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    69
  # obstore: pushdest
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    70
  # obstore: pulldest
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    71
  ## pushing "O" from main to pushdest
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    72
  pushing to pushdest
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    73
  searching for changes
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    74
  no changes found
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    75
  OBSEXC: computing relevant nodes
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    76
  OBSEXC: computing markers relevant to 1 nodes
864
401da1b38cca discovery: implement a discovery process and use it for push
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 850
diff changeset
    77
  OBSEXC: no marker to push
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    78
  OBSEXC: DONE
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    79
  ## post push state
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    80
  # 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
    81
  28b51eb45704506b5c603decd6bf7ac5e0f6a52f 6aa67a7b4baa6fb41b06aed38d5b1201436546e2 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
    82
  6aa67a7b4baa6fb41b06aed38d5b1201436546e2 0 {35b1839966785d5703a01607229eea932db42f87} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    83
  # obstore: pushdest
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    84
  # obstore: pulldest
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    85
  ## pulling "a9bdc8b26820" from main into pulldest
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    86
  pulling from main
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    87
  no changes found
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    88
  OBSEXC: pull obsolescence markers
865
5c40b2a4b52f discovery: use the discovery process for pull
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 864
diff changeset
    89
  OBSEXC: no unknown remote markers
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    90
  OBSEXC: DONE
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    91
  ## post pull state
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    92
  # 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
    93
  28b51eb45704506b5c603decd6bf7ac5e0f6a52f 6aa67a7b4baa6fb41b06aed38d5b1201436546e2 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
    94
  6aa67a7b4baa6fb41b06aed38d5b1201436546e2 0 {35b1839966785d5703a01607229eea932db42f87} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    95
  # obstore: pushdest
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    96
  # obstore: pulldest
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    97