tests/test-evolve-content-divergent-corner-cases.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Wed, 04 Mar 2020 13:17:00 +0100
changeset 5140 c705c4069fb1
parent 5079 1f92a6aa40d6
child 5159 e5fe3ca5e6ad
child 5324 c834fdb87f90
permissions -rw-r--r--
fix: reinstall import from the right location
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4481
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
     1
========================================================
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
     2
Tests the resolution of content divergence: corner cases
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
     3
========================================================
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
     4
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
     5
This file intend to cover cases that are specific enough to not fit in the
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
     6
other cases.
1467
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     7
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     8
  $ cat >> $HGRCPATH <<EOF
4481
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
     9
  > [alias]
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
    10
  > glog = log -GT "{rev}:{node|short} {desc|firstline}\n ({bookmarks}) [{branch}] {phase}"
1467
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    11
  > [defaults]
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    12
  > amend=-d "0 0"
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    13
  > fold=-d "0 0"
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    14
  > [web]
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    15
  > push_ssl = false
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    16
  > allow_push = *
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    17
  > [phases]
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    18
  > publish = False
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    19
  > [diff]
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    20
  > git = 1
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    21
  > unified = 0
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    22
  > [ui]
4625
a4fde4e3e763 templatekw: add `instabilities` alias for `troubles`
Matt Harbison <matt_harbison@yahoo.com>
parents: 4580
diff changeset
    23
  > logtemplate = {rev}:{node|short}@{branch}({phase}) {desc|firstline} [{instabilities}]\n
5079
1f92a6aa40d6 evolve: add pre-check logic for content-divergence in rewriteutil.precheck()
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4991
diff changeset
    24
  > [experimental]
1f92a6aa40d6 evolve: add pre-check logic for content-divergence in rewriteutil.precheck()
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4991
diff changeset
    25
  > evolution.allowdivergence = True
1467
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    26
  > [extensions]
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    27
  > EOF
1806
9f42f819267b evolve: move the extensions to 'hgext3rd'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1630
diff changeset
    28
  $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
1467
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    29
  $ mkcommit() {
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    30
  >    echo "$1" > "$1"
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    31
  >    hg add "$1"
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    32
  >    hg ci -m "add $1"
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    33
  > }
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    34
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    35
  $ mkcommits() {
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    36
  >   for i in $@; do mkcommit $i ; done
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    37
  > }
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    38
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    39
Basic test of divergence: two divergent changesets with the same parents
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    40
With --all --any we dedupe the divergent and solve the divergence once
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    41
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    42
  $ hg init test1
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    43
  $ cd test1
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
    44
  $ echo a > a
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
    45
  $ hg ci -Aqm "added a"
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
    46
  $ echo b > b
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
    47
  $ hg ci -Aqm "added b"
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
    48
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
    49
  $ hg up .^
1467
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    50
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
    51
  $ echo bdivergent > bdivergent1
3799
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
    52
  $ hg ci -Am "divergent"
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
    53
  adding bdivergent1
1467
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    54
  created new head
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
    55
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
    56
  $ hg up .^
1467
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    57
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
    58
  $ echo bdivergent > bdivergent2
3799
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
    59
  $ hg ci -Am "divergent"
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
    60
  adding bdivergent2
1467
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    61
  created new head
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
    62
3799
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
    63
  $ hg prune -s 8374d2ddc3a4 "desc('added b')"
1467
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    64
  1 changesets pruned
3799
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
    65
  $ hg prune -s 593c57f2117e "desc('added b')" --hidden
1467
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    66
  1 changesets pruned
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
    67
  2 new content-divergent changesets
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
    68
1467
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    69
  $ hg log -G
3799
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
    70
  @  3:8374d2ddc3a4@default(draft) divergent [content-divergent]
1467
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    71
  |
3799
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
    72
  | *  2:593c57f2117e@default(draft) divergent [content-divergent]
1467
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    73
  |/
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
    74
  o  0:9092f1db7931@default(draft) added a []
1467
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    75
  
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
    76
4576
96ce1030d2fb tests: add --update to hg evolve to reduce test changes for the next patch
Anton Shestakov <av6@dwimlabs.net>
parents: 4493
diff changeset
    77
  $ hg evolve --all --any --content-divergent --update
3799
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
    78
  merge:[2] divergent
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
    79
  with: [3] divergent
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
    80
  base: [1] added b
1467
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    81
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
3846
f9dad99a90d5 evolve: create a new commit instead of amending one of the divergents
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3799
diff changeset
    82
  working directory is now at 45bf1312f454
1467
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    83
  $ hg log -G
3846
f9dad99a90d5 evolve: create a new commit instead of amending one of the divergents
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3799
diff changeset
    84
  @  4:45bf1312f454@default(draft) divergent []
1467
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    85
  |
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
    86
  o  0:9092f1db7931@default(draft) added a []
1467
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    87
  
1536
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    88
Test divergence resolution when it yields to an empty commit (issue4950)
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    89
cdivergent2 contains the same content than cdivergent1 and they are divergent
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    90
versions of the revision _c
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    91
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
    92
  $ hg up .^
1536
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    93
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    94
  $ mkcommit _c
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    95
  created new head
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
    96
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
    97
  $ hg up .^
1536
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    98
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    99
  $ mkcommit cdivergent1
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   100
  created new head
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
   101
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
   102
  $ hg up .^
1536
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   103
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   104
  $ echo "cdivergent1" > cdivergent1
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   105
  $ hg add cdivergent1
3799
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   106
  $ hg ci -m "add _c"
1536
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   107
  created new head
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
   108
3799
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   109
  $ hg log -G
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   110
  @  7:b2ae71172042@default(draft) add _c []
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   111
  |
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   112
  | o  6:e3ff64ce8d4c@default(draft) add cdivergent1 []
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   113
  |/
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   114
  | o  5:48819a835615@default(draft) add _c []
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   115
  |/
3846
f9dad99a90d5 evolve: create a new commit instead of amending one of the divergents
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3799
diff changeset
   116
  | o  4:45bf1312f454@default(draft) divergent []
3799
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   117
  |/
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   118
  o  0:9092f1db7931@default(draft) added a []
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   119
  
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   120
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   121
  $ hg prune -s b2ae71172042 48819a835615
1536
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   122
  1 changesets pruned
3799
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   123
  $ hg prune -s e3ff64ce8d4c 48819a835615 --hidden
1536
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   124
  1 changesets pruned
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   125
  2 new content-divergent changesets
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
   126
1536
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   127
  $ hg log -G
3799
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   128
  @  7:b2ae71172042@default(draft) add _c [content-divergent]
1536
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   129
  |
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
   130
  | *  6:e3ff64ce8d4c@default(draft) add cdivergent1 [content-divergent]
1536
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   131
  |/
3846
f9dad99a90d5 evolve: create a new commit instead of amending one of the divergents
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3799
diff changeset
   132
  | o  4:45bf1312f454@default(draft) divergent []
1536
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   133
  |/
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
   134
  o  0:9092f1db7931@default(draft) added a []
1536
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   135
  
3154
406992d0d611 evolve: rename --contentdivergent flag to --content-divergent
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3013
diff changeset
   136
  $ hg evolve --all --any --content-divergent
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   137
  merge:[6] add cdivergent1
3799
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   138
  with: [7] add _c
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   139
  base: [5] add _c
1536
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   140
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   141
  nothing changed
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
   142
  working directory is now at e3ff64ce8d4c
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
   143
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
   144
  $ cd ..
1630
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   145
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   146
Test None docstring issue of evolve divergent, which caused hg crush
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   147
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   148
  $ hg init test2
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   149
  $ cd test2
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   150
  $ mkcommits _a _b
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
   151
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
   152
  $ hg up .^
1630
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   153
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
   154
  $ echo bdivergent > bdivergent11
3799
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   155
  $ hg ci -Am "bdivergent"
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
   156
  adding bdivergent11
1630
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   157
  created new head
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
   158
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
   159
  $ hg up .^
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
   160
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
   161
  $ echo bdivergent > bdivergent22
3799
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   162
  $ hg ci -Am "bdivergent"
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
   163
  adding bdivergent22
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
   164
  created new head
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
   165
3799
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   166
  $ hg log -G
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   167
  @  3:6b096fb45070@default(draft) bdivergent []
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   168
  |
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   169
  | o  2:05a6b6a9e633@default(draft) bdivergent []
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   170
  |/
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   171
  | o  1:37445b16603b@default(draft) add _b []
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   172
  |/
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   173
  o  0:135f39f4bd78@default(draft) add _a []
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   174
  
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   175
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   176
  $ hg prune -s 6b096fb45070 37445b16603b
1630
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   177
  1 changesets pruned
3799
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   178
  $ hg prune -s 05a6b6a9e633 37445b16603b --hidden
1630
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   179
  1 changesets pruned
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   180
  2 new content-divergent changesets
1630
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   181
  $ hg log -G
3799
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   182
  @  3:6b096fb45070@default(draft) bdivergent [content-divergent]
1630
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   183
  |
3799
037ccbf41c6d tests: make sure we don't result in commit messages conflict
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3798
diff changeset
   184
  | *  2:05a6b6a9e633@default(draft) bdivergent [content-divergent]
1630
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   185
  |/
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   186
  o  0:135f39f4bd78@default(draft) add _a []
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   187
  
3798
7c05ee4a8cc7 tests: don't use mkcommit shell function in test-divergent.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3787
diff changeset
   188
1630
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   189
  $ cat >$TESTTMP/test_extension.py  << EOF
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   190
  > from mercurial import merge
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   191
  > origupdate = merge.update
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   192
  > def newupdate(*args, **kwargs):
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   193
  >   return origupdate(*args, **kwargs)
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   194
  > merge.update = newupdate
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   195
  > EOF
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   196
  $ cat >> $HGRCPATH << EOF
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   197
  > [extensions]
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   198
  > testextension=$TESTTMP/test_extension.py
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   199
  > EOF
4580
3ef96578da43 evolve: use --all by default (BC)
Anton Shestakov <av6@dwimlabs.net>
parents: 4576
diff changeset
   200
  $ hg evolve
1630
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   201
  nothing to evolve on current working copy parent
3154
406992d0d611 evolve: rename --contentdivergent flag to --content-divergent
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3013
diff changeset
   202
  (do you want to use --content-divergent)
1630
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   203
  [2]
3154
406992d0d611 evolve: rename --contentdivergent flag to --content-divergent
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3013
diff changeset
   204
  $ hg evolve --content-divergent
4580
3ef96578da43 evolve: use --all by default (BC)
Anton Shestakov <av6@dwimlabs.net>
parents: 4576
diff changeset
   205
  merge:[2] bdivergent
3ef96578da43 evolve: use --all by default (BC)
Anton Shestakov <av6@dwimlabs.net>
parents: 4576
diff changeset
   206
  with: [3] bdivergent
1630
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   207
  base: [1] add _b
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   208
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
3846
f9dad99a90d5 evolve: create a new commit instead of amending one of the divergents
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3799
diff changeset
   209
  working directory is now at 73ff357d3975
1630
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   210
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   211
  $ cd ..
4481
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   212
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   213
Test to make sure that evolve don't fall into unrecoverable state (issue6053)
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   214
------------------------------------------------------------------------------
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   215
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   216
It happened when two divergent csets has different parent (need relocation)
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   217
and resolution parent is obsolete. So this issue triggered when during
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   218
relocation we hit conflicts. So lets make the repo as described.
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   219
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   220
  $ hg init localside
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   221
  $ cd localside
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   222
  $ for ch in a b c d e; do
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   223
  > echo $ch > $ch;
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   224
  > hg add $ch;
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   225
  > hg ci -m "added "$ch;
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   226
  > done;
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   227
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   228
  $ hg glog
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   229
  @  4:8d71eadcc9df added e
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   230
  |   () [default] draft
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   231
  o  3:9150fe93bec6 added d
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   232
  |   () [default] draft
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   233
  o  2:155349b645be added c
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   234
  |   () [default] draft
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   235
  o  1:5f6d8a4bf34a added b
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   236
  |   () [default] draft
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   237
  o  0:9092f1db7931 added a
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   238
      () [default] draft
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   239
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   240
  $ echo ee > e
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   241
  $ hg amend -m "updated e"
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   242
  $ hg up 1 -q
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   243
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   244
To make sure we hit conflict while relocating
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   245
  $ echo dd > d
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   246
  $ echo ee > e
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   247
  $ hg add d e
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   248
  $ hg ci -m "updated e"
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   249
  created new head
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   250
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   251
Lets create divergence
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   252
  $ hg prune 4 -s . --hidden
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   253
  1 changesets pruned
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   254
  2 new content-divergent changesets
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   255
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   256
Making obsolete resolution parent
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   257
  $ hg prune 3
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   258
  1 changesets pruned
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   259
  1 new orphan changesets
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   260
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   261
  $ hg glog
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   262
  @  6:de4ea3103326 updated e
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   263
  |   () [default] draft
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   264
  | *  5:ff6f7cd76a7c updated e
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   265
  | |   () [default] draft
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   266
  | x  3:9150fe93bec6 added d
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   267
  | |   () [default] draft
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   268
  | o  2:155349b645be added c
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   269
  |/    () [default] draft
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   270
  o  1:5f6d8a4bf34a added b
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   271
  |   () [default] draft
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   272
  o  0:9092f1db7931 added a
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   273
      () [default] draft
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   274
4991
2928f35023a1 evolve: make sure divergence resolution doesn't undo changes (issue6203)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4676
diff changeset
   275
  $ hg evolve --content-divergent --any --update --config ui.interactive=true <<EOF
2928f35023a1 evolve: make sure divergence resolution doesn't undo changes (issue6203)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4676
diff changeset
   276
  > c
2928f35023a1 evolve: make sure divergence resolution doesn't undo changes (issue6203)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4676
diff changeset
   277
  > EOF
4481
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   278
  merge:[5] updated e
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   279
  with: [6] updated e
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   280
  base: [4] added e
4991
2928f35023a1 evolve: make sure divergence resolution doesn't undo changes (issue6203)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4676
diff changeset
   281
  rebasing "divergent" content-divergent changeset ff6f7cd76a7c on 155349b645be
2928f35023a1 evolve: make sure divergence resolution doesn't undo changes (issue6203)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4676
diff changeset
   282
  rebasing "other" content-divergent changeset de4ea3103326 on 155349b645be
2928f35023a1 evolve: make sure divergence resolution doesn't undo changes (issue6203)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4676
diff changeset
   283
  file 'd' was deleted in local but was modified in other.
2928f35023a1 evolve: make sure divergence resolution doesn't undo changes (issue6203)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4676
diff changeset
   284
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
2928f35023a1 evolve: make sure divergence resolution doesn't undo changes (issue6203)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4676
diff changeset
   285
  What do you want to do? c
2928f35023a1 evolve: make sure divergence resolution doesn't undo changes (issue6203)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4676
diff changeset
   286
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
2928f35023a1 evolve: make sure divergence resolution doesn't undo changes (issue6203)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4676
diff changeset
   287
  working directory is now at eb6357cd41b6
4481
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   288
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   289
  $ hg glog -l1
4991
2928f35023a1 evolve: make sure divergence resolution doesn't undo changes (issue6203)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4676
diff changeset
   290
  @  9:eb6357cd41b6 updated e
4481
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   291
  |   () [default] draft
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   292
  ~
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   293
d02a7c8cdee5 test: consolidate the content-divergent test cases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3846
diff changeset
   294
  $ cd ..
4493
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   295
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   296
Check that canceling of file deletion are merge correctly
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   297
---------------------------------------------------------
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   298
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   299
File addition/deletion tend to have special processing. So we better test them directory
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   300
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   301
  $ hg init non-public
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   302
  $ cd non-public
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   303
  $ echo a > a
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   304
  $ echo b > b
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   305
  $ echo c > c
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   306
  $ echo d > d
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   307
  $ hg ci -Aqm initial
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   308
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   309
oops, we meant to delete just 'a', but we deleted 'b' and 'c' too
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   310
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   311
  $ hg rm a b c
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   312
  $ hg ci -m 'delete a'
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   313
  $ hg revert -r .^ b
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   314
  $ hg amend
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   315
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   316
create some content divergence
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   317
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   318
  $ hg co dff6e52f5e41 --hidden
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   319
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   320
  updated to hidden changeset dff6e52f5e41
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   321
  (hidden revision 'dff6e52f5e41' was rewritten as: 0825dcee2670)
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   322
  working directory parent is obsolete! (dff6e52f5e41)
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   323
  (use 'hg evolve' to update to its successor: 0825dcee2670)
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   324
  $ hg revert -r .^ c
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   325
  $ hg amend
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   326
  2 new content-divergent changesets
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   327
  $ hg glog --hidden
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   328
  @  3:92ecd58f9b05 delete a
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   329
  |   () [default] draft
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   330
  | *  2:0825dcee2670 delete a
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   331
  |/    () [default] draft
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   332
  | x  1:dff6e52f5e41 delete a
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   333
  |/    () [default] draft
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   334
  o  0:75d2b02c4a5c initial
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   335
      () [default] draft
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   336
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   337
Resolve the divergence, only "a" should be removed
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   338
4576
96ce1030d2fb tests: add --update to hg evolve to reduce test changes for the next patch
Anton Shestakov <av6@dwimlabs.net>
parents: 4493
diff changeset
   339
  $ hg evolve --content-divergent --update
4580
3ef96578da43 evolve: use --all by default (BC)
Anton Shestakov <av6@dwimlabs.net>
parents: 4576
diff changeset
   340
  merge:[2] delete a
3ef96578da43 evolve: use --all by default (BC)
Anton Shestakov <av6@dwimlabs.net>
parents: 4576
diff changeset
   341
  with: [3] delete a
4493
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   342
  base: [1] delete a
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   343
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   344
  working directory is now at 7ca6a9fafcf6
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   345
  $ hg glog
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   346
  @  4:7ca6a9fafcf6 delete a
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   347
  |   () [default] draft
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   348
  o  0:75d2b02c4a5c initial
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   349
      () [default] draft
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   350
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   351
  $ hg diff --change .
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   352
  diff --git a/a b/a
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   353
  deleted file mode 100644
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   354
  --- a/a
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   355
  +++ /dev/null
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   356
  @@ -1,1 +0,0 @@
32446b7a6e7c test: add test for content-divergence with file removal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4481
diff changeset
   357
  -a