tests/test-evolve-bumped.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Fri, 01 Sep 2017 17:37:47 +0200
changeset 2897 bd04a614b866
parent 2858 4b934144ed11
child 3000 bd7e8be29542
permissions -rw-r--r--
topic: move a status message in the right scope The finally get runs on failure so we should not advertise rewrite topic in the case. In addition the 'rewrote' variable can be undefined in the finally.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1150
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     1
  $ hg init public
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     2
  $ cd public
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     3
  $ echo a > a
1417
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
     4
  $ mkcommit() {
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
     5
  >    echo "$1" > "$1"
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
     6
  >    hg add "$1"
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
     7
  >    hg ci -m "add $1"
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
     8
  > }
1150
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     9
  $ hg commit -A -m init
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    10
  adding a
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    11
  $ cd ..
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    12
1806
9f42f819267b evolve: move the extensions to 'hgext3rd'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1453
diff changeset
    13
  $ evolvepath=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/
1150
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    14
  $ hg clone -U public private
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    15
  $ cd private
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    16
  $ cat >> .hg/hgrc <<EOF
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    17
  > [extensions]
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    18
  > evolve = $evolvepath
1416
b8a9d2e8c772 test-evolve-bumped: improve tests legibility
Laurent Charignon <lcharignon@fb.com>
parents: 1404
diff changeset
    19
  > [ui]
b8a9d2e8c772 test-evolve-bumped: improve tests legibility
Laurent Charignon <lcharignon@fb.com>
parents: 1404
diff changeset
    20
  > logtemplate = {rev}:{node|short}@{branch}({phase}) {desc|firstline}\n
1150
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    21
  > [phases]
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    22
  > publish = false
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    23
  > EOF
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    24
  $ cd ..
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    25
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    26
  $ cp -a private alice
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    27
  $ cp -a private bob
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    28
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    29
  $ cd alice
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    30
  $ hg update
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    31
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    32
  $ echo a >> a
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    33
  $ hg commit -u alice -m 'modify a'
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    34
  $ hg push ../private
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    35
  pushing to ../private
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    36
  searching for changes
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    37
  adding changesets
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    38
  adding manifests
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    39
  adding file changes
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    40
  added 1 changesets with 1 changes to 1 files
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    41
  $ hg log -r 'draft()'
1416
b8a9d2e8c772 test-evolve-bumped: improve tests legibility
Laurent Charignon <lcharignon@fb.com>
parents: 1404
diff changeset
    42
  1:4d1169d82e47@default(draft) modify a
1150
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    43
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    44
  $ cd ../bob
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    45
  $ hg pull ../private
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    46
  pulling from ../private
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    47
  searching for changes
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    48
  adding changesets
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    49
  adding manifests
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    50
  adding file changes
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    51
  added 1 changesets with 1 changes to 1 files
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    52
  (run 'hg update' to get a working copy)
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    53
  $ hg log -r 'draft()'
1416
b8a9d2e8c772 test-evolve-bumped: improve tests legibility
Laurent Charignon <lcharignon@fb.com>
parents: 1404
diff changeset
    54
  1:4d1169d82e47@default(draft) modify a
1150
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    55
  $ hg push ../public
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    56
  pushing to ../public
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    57
  searching for changes
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    58
  adding changesets
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    59
  adding manifests
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    60
  adding file changes
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    61
  added 1 changesets with 1 changes to 1 files
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    62
  $ hg log -r 'draft()'
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    63
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    64
  $ cd ../alice
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    65
  $ hg amend -m 'tweak a'
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    66
  $ hg pull ../public
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    67
  pulling from ../public
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    68
  searching for changes
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    69
  no changes found
2858
4b934144ed11 messages: use hyphenated '{phase,content}-divergent' in user messages
Martin von Zweigbergk <martinvonz@google.com>
parents: 2855
diff changeset
    70
  1 new phase-divergent changesets
1150
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    71
2836
feaa52680682 log: bumped was renamed into phasedivergent
Boris Feld <boris.feld@octobus.net>
parents: 1806
diff changeset
    72
  $ hg evolve -a -A --phasedivergent
1150
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    73
  recreate:[2] tweak a
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    74
  atop:[1] modify a
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    75
  computing new diff
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    76
  committed as 4d1169d82e47
2c99d92faa62 evolve: fix error during iteration over bumped changesets (bug38)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    77
  working directory is now at 4d1169d82e47
1417
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
    78
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
    79
Bumped Merge changeset:
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
    80
-----------------------
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
    81
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
    82
We currently cannot automatically solve bumped changeset that is the
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
    83
product of a merge, we add a test for it.
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
    84
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
    85
  $ mkcommit _a
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
    86
  $ hg up .^
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
    87
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
    88
  $ mkcommit _b
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
    89
  created new head
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
    90
  $ mkcommit _c
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
    91
  $ hg log -G
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
    92
  @  5:eeaf70969381@default(draft) add _c
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
    93
  |
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
    94
  o  4:6612fc0ddeb6@default(draft) add _b
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
    95
  |
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
    96
  | o  3:154ad198ff4a@default(draft) add _a
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
    97
  |/
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
    98
  o  1:4d1169d82e47@default(public) modify a
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
    99
  |
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   100
  o  0:d3873e73d99e@default(public) init
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   101
  
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   102
  $ hg merge 3
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   103
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   104
  (branch merge, don't forget to commit)
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   105
  $ hg commit -m "merge"
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   106
  $ hg commit --amend -m "New message"
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   107
  $ hg phase --public 551127da2a8a --hidden
2858
4b934144ed11 messages: use hyphenated '{phase,content}-divergent' in user messages
Martin von Zweigbergk <martinvonz@google.com>
parents: 2855
diff changeset
   108
  1 new phase-divergent changesets
1417
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   109
  $ hg log -G
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   110
  @    7:b28e84916d8c@default(draft) New message
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   111
  |\
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   112
  +---o  6:551127da2a8a@default(public) merge
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   113
  | |/
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   114
  | o  5:eeaf70969381@default(public) add _c
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   115
  | |
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   116
  | o  4:6612fc0ddeb6@default(public) add _b
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   117
  | |
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   118
  o |  3:154ad198ff4a@default(public) add _a
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   119
  |/
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   120
  o  1:4d1169d82e47@default(public) modify a
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   121
  |
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   122
  o  0:d3873e73d99e@default(public) init
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   123
  
2836
feaa52680682 log: bumped was renamed into phasedivergent
Boris Feld <boris.feld@octobus.net>
parents: 1806
diff changeset
   124
  $ hg evolve --all --phasedivergent
1417
9e7da169f66e test-evolve-bumped: add new test case for merge
Laurent Charignon <lcharignon@fb.com>
parents: 1416
diff changeset
   125
  skipping b28e84916d8c : we do not handle merge yet