tests/test-evolve-issue5966.t
author Martin von Zweigbergk <martinvonz@google.com>
Thu, 19 Dec 2019 21:36:59 -0800
changeset 5022 95af630d913a
parent 4676 b6c819facbe8
permissions -rw-r--r--
evolvecmd: fix a typo node->None
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4311
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     1
Testing evolve --continue with unresolved conflicts (issue5966)
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     2
https://bz.mercurial-scm.org/show_bug.cgi?id=5966
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     3
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     4
  $ . $TESTDIR/testlib/common.sh
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     5
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     6
  $ hg init issue5966
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     7
  $ cd issue5966
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     8
  $ cat > .hg/hgrc << EOF
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     9
  > [phases]
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    10
  > publish = false
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    11
  > [alias]
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    12
  > glog = log -GT "{rev}: {desc}"
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    13
  > [extensions]
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    14
  > evolve=
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    15
  > EOF
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    16
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    17
  $ touch a
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    18
  $ hg ci -Aqm 'empty'
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    19
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    20
  $ echo apple > a
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    21
  $ hg ci -m 'apple'
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    22
  $ echo banana > a
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    23
  $ hg ci -m 'banana'
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    24
  $ echo coconut > a
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    25
  $ hg ci -m 'coconut'
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    26
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    27
  $ hg glog
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    28
  @  3: coconut
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    29
  |
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    30
  o  2: banana
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    31
  |
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    32
  o  1: apple
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    33
  |
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    34
  o  0: empty
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    35
  
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    36
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    37
  $ hg up -q 1
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    38
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    39
Amending revision 1 in a way that causes conflicts
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    40
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    41
  $ echo apricot > a
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    42
  $ hg amend -m 'apricot'
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    43
  2 new orphan changesets
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    44
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    45
  $ hg glog --hidden
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    46
  @  4: apricot
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    47
  |
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    48
  | *  3: coconut
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    49
  | |
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    50
  | *  2: banana
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    51
  | |
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    52
  | x  1: apple
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    53
  |/
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    54
  o  0: empty
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    55
  
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    56
4579
e6d7d261ca4a tests: add --rev to hg evolve to reduce test changes for the next patch
Anton Shestakov <av6@dwimlabs.net>
parents: 4577
diff changeset
    57
  $ hg evolve -t :fail --rev 'first(orphan())'
4311
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    58
  move:[2] banana
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    59
  atop:[4] apricot
4676
b6c819facbe8 evolvecmd: the proper way to deal with conflicts is to resolve them
Anton Shestakov <av6@dwimlabs.net>
parents: 4579
diff changeset
    60
  unresolved merge conflicts
b6c819facbe8 evolvecmd: the proper way to deal with conflicts is to resolve them
Anton Shestakov <av6@dwimlabs.net>
parents: 4579
diff changeset
    61
  (see 'hg help evolve.interrupted')
4311
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    62
  [1]
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    63
  $ hg evolve --list
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    64
  34a690fcf6ab: banana
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    65
    orphan: 7f59f18ca4a9 (obsolete parent)
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    66
  
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    67
  feb8c0bffa1f: coconut
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    68
    orphan: 34a690fcf6ab (orphan parent)
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    69
  
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    70
Evolve should detect unresolved conflict.
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    71
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    72
  $ hg resolve --list
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    73
  U a
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    74
  $ hg evolve --continue
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    75
  abort: unresolved merge conflicts (see 'hg help resolve')
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    76
  [255]
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    77
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    78
(even when ran twice)
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    79
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    80
  $ hg evolve --continue
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    81
  abort: unresolved merge conflicts (see 'hg help resolve')
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    82
  [255]
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    83
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    84
  $ cat a
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    85
  apricot
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    86
  $ hg resolve --list
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    87
  U a
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    88
  $ hg resolve a -t :other
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    89
  (no more unresolved files)
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    90
  continue: hg evolve --continue
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    91
  $ hg resolve --list
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    92
  R a
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    93
  $ hg evolve --continue
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    94
  evolving 2:34a690fcf6ab "banana"
4577
bcd52ce0916d evolve: don't update after instability resolution by default (BC)
Anton Shestakov <av6@dwimlabs.net>
parents: 4311
diff changeset
    95
  working directory is now at 581a2bb4704c
4311
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    96
  $ hg resolve --list
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    97
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    98
evolve the rest of the stack
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    99
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   100
  $ hg evolve
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   101
  move:[3] coconut
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   102
  atop:[5] banana
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   103
  merging a
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   104
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   105
All commit evolved
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   106
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   107
  $ hg glog
4577
bcd52ce0916d evolve: don't update after instability resolution by default (BC)
Anton Shestakov <av6@dwimlabs.net>
parents: 4311
diff changeset
   108
  o  6: coconut
4311
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   109
  |
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   110
  o  5: banana
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   111
  |
4577
bcd52ce0916d evolve: don't update after instability resolution by default (BC)
Anton Shestakov <av6@dwimlabs.net>
parents: 4311
diff changeset
   112
  @  4: apricot
4311
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   113
  |
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   114
  o  0: empty
8aa28e68ac44 evolve: detect unresolved conflict during evolve --continue (issue5966)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   115