tests/test-evolve-issue5958.t
author Sushil khanchi <sushilkhanchi97@gmail.com>
Wed, 04 Dec 2019 21:06:39 +0530
changeset 5235 a1cf66165e69
parent 5013 18fe83bf7b14
permissions -rw-r--r--
metaedit: use pre-checking before rewriting csets Changes in test file demonstrate the changed behaviour.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4849
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     1
Content divergence and trying to relocate a node on top of itself (issue5958)
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     2
https://bz.mercurial-scm.org/show_bug.cgi?id=5958
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     3
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     4
  $ . $TESTDIR/testlib/common.sh
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     5
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     6
  $ cat << EOF >> $HGRCPATH
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     7
  > [extensions]
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     8
  > rebase =
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     9
  > evolve =
5235
a1cf66165e69 metaedit: use pre-checking before rewriting csets
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 5013
diff changeset
    10
  > [experimental]
a1cf66165e69 metaedit: use pre-checking before rewriting csets
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 5013
diff changeset
    11
  > evolution.allowdivergence = True
4849
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    12
  > EOF
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    13
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    14
  $ hg init issue5958
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    15
  $ cd issue5958
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    16
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    17
  $ echo hi > r0
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    18
  $ hg ci -qAm 'add r0'
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    19
  $ echo hi > foo.txt
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    20
  $ hg ci -qAm 'add foo.txt'
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    21
  $ hg metaedit -r . -d '0 2'
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    22
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    23
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    24
(Make changes in unrelated files so that we don't have any merge conflicts
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    25
during the rebase, but the two touched revisions aren't identical)
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    26
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    27
  $ echo hi > bar.txt
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    28
  $ hg add -q bar.txt
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    29
  $ hg amend -q
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    30
  $ hg metaedit -r 1 -d '0 1' --hidden
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    31
  2 new content-divergent changesets
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    32
  $ hg log -r tip
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    33
  changeset:   4:c17bf400a278
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    34
  tag:         tip
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    35
  parent:      0:a24ed8ad918c
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    36
  user:        test
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    37
  date:        Wed Dec 31 23:59:59 1969 -0000
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    38
  instability: content-divergent
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    39
  summary:     add foo.txt
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    40
  
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    41
  $ echo hi > baz.txt
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    42
  $ hg add -q baz.txt
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    43
  $ hg amend -q
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    44
  $ hg rebase -qr tip -d 4
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    45
  $ hg log -G
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    46
  @  changeset:   6:08bc7ba82799
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    47
  |  tag:         tip
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    48
  |  parent:      4:c17bf400a278
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    49
  |  user:        test
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    50
  |  date:        Wed Dec 31 23:59:58 1969 -0000
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    51
  |  instability: content-divergent
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    52
  |  summary:     add foo.txt
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    53
  |
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    54
  *  changeset:   4:c17bf400a278
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    55
  |  parent:      0:a24ed8ad918c
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    56
  |  user:        test
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    57
  |  date:        Wed Dec 31 23:59:59 1969 -0000
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    58
  |  instability: content-divergent
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    59
  |  summary:     add foo.txt
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    60
  |
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    61
  o  changeset:   0:a24ed8ad918c
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    62
     user:        test
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    63
     date:        Thu Jan 01 00:00:00 1970 +0000
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    64
     summary:     add r0
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    65
  
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    66
  $ hg obslog -a -r .
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    67
  @  08bc7ba82799 (6) add foo.txt
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    68
  |
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    69
  | *  c17bf400a278 (4) add foo.txt
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    70
  | |
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    71
  x |  1d1fc409af98 (5) add foo.txt
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    72
  | |    rewritten(parent, content) as 08bc7ba82799 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    73
  | |
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    74
  x |  a25dd7af6cf6 (3) add foo.txt
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    75
  | |    rewritten(content) as 1d1fc409af98 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    76
  | |
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    77
  x |  0065551bd38f (2) add foo.txt
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    78
  |/     rewritten(content) as a25dd7af6cf6 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    79
  |
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    80
  x  cc71ffbc7c00 (1) add foo.txt
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    81
       rewritten(date) as 0065551bd38f using metaedit by test (Thu Jan 01 00:00:00 1970 +0000)
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    82
       rewritten(date) as c17bf400a278 using metaedit by test (Thu Jan 01 00:00:00 1970 +0000)
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    83
  
4850
6d898fa6e5c3 evolve: check that relocating makes sense in _solvedivergent() (issue5958)
Anton Shestakov <av6@dwimlabs.net>
parents: 4849
diff changeset
    84
  $ hg evolve --content-divergent
4849
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    85
  merge:[6] add foo.txt
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    86
  with: [4] add foo.txt
b9b6f421688a tests: demonstrate content divergence causing "relocate node on top of itself"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    87
  base: [1] add foo.txt
4850
6d898fa6e5c3 evolve: check that relocating makes sense in _solvedivergent() (issue5958)
Anton Shestakov <av6@dwimlabs.net>
parents: 4849
diff changeset
    88
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
6d898fa6e5c3 evolve: check that relocating makes sense in _solvedivergent() (issue5958)
Anton Shestakov <av6@dwimlabs.net>
parents: 4849
diff changeset
    89
  1 new orphan changesets
4998
88b816a9d990 evolve: preserve date when resolving content-divergence (issue6202)
Manuel Jacob <me@manueljacob.de>
parents: 4997
diff changeset
    90
  working directory is now at 459c64f7eaad