tests/test-evolve-issue5958.t
branchstable
changeset 4849 b9b6f421688a
child 4850 6d898fa6e5c3
equal deleted inserted replaced
4844:2488ec1bd22f 4849:b9b6f421688a
       
     1 Content divergence and trying to relocate a node on top of itself (issue5958)
       
     2 https://bz.mercurial-scm.org/show_bug.cgi?id=5958
       
     3 
       
     4   $ . $TESTDIR/testlib/common.sh
       
     5 
       
     6   $ cat << EOF >> $HGRCPATH
       
     7   > [extensions]
       
     8   > rebase =
       
     9   > evolve =
       
    10   > EOF
       
    11 
       
    12   $ hg init issue5958
       
    13   $ cd issue5958
       
    14 
       
    15   $ echo hi > r0
       
    16   $ hg ci -qAm 'add r0'
       
    17   $ echo hi > foo.txt
       
    18   $ hg ci -qAm 'add foo.txt'
       
    19   $ hg metaedit -r . -d '0 2'
       
    20   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    21 
       
    22 (Make changes in unrelated files so that we don't have any merge conflicts
       
    23 during the rebase, but the two touched revisions aren't identical)
       
    24 
       
    25   $ echo hi > bar.txt
       
    26   $ hg add -q bar.txt
       
    27   $ hg amend -q
       
    28   $ hg metaedit -r 1 -d '0 1' --hidden
       
    29   2 new content-divergent changesets
       
    30   $ hg log -r tip
       
    31   changeset:   4:c17bf400a278
       
    32   tag:         tip
       
    33   parent:      0:a24ed8ad918c
       
    34   user:        test
       
    35   date:        Wed Dec 31 23:59:59 1969 -0000
       
    36   instability: content-divergent
       
    37   summary:     add foo.txt
       
    38   
       
    39   $ echo hi > baz.txt
       
    40   $ hg add -q baz.txt
       
    41   $ hg amend -q
       
    42   $ hg rebase -qr tip -d 4
       
    43   $ hg log -G
       
    44   @  changeset:   6:08bc7ba82799
       
    45   |  tag:         tip
       
    46   |  parent:      4:c17bf400a278
       
    47   |  user:        test
       
    48   |  date:        Wed Dec 31 23:59:58 1969 -0000
       
    49   |  instability: content-divergent
       
    50   |  summary:     add foo.txt
       
    51   |
       
    52   *  changeset:   4:c17bf400a278
       
    53   |  parent:      0:a24ed8ad918c
       
    54   |  user:        test
       
    55   |  date:        Wed Dec 31 23:59:59 1969 -0000
       
    56   |  instability: content-divergent
       
    57   |  summary:     add foo.txt
       
    58   |
       
    59   o  changeset:   0:a24ed8ad918c
       
    60      user:        test
       
    61      date:        Thu Jan 01 00:00:00 1970 +0000
       
    62      summary:     add r0
       
    63   
       
    64   $ hg obslog -a -r .
       
    65   @  08bc7ba82799 (6) add foo.txt
       
    66   |
       
    67   | *  c17bf400a278 (4) add foo.txt
       
    68   | |
       
    69   x |  1d1fc409af98 (5) add foo.txt
       
    70   | |    rewritten(parent, content) as 08bc7ba82799 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
       
    71   | |
       
    72   x |  a25dd7af6cf6 (3) add foo.txt
       
    73   | |    rewritten(content) as 1d1fc409af98 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
       
    74   | |
       
    75   x |  0065551bd38f (2) add foo.txt
       
    76   |/     rewritten(content) as a25dd7af6cf6 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
       
    77   |
       
    78   x  cc71ffbc7c00 (1) add foo.txt
       
    79        rewritten(date) as 0065551bd38f using metaedit by test (Thu Jan 01 00:00:00 1970 +0000)
       
    80        rewritten(date) as c17bf400a278 using metaedit by test (Thu Jan 01 00:00:00 1970 +0000)
       
    81   
       
    82   $ hg evolve --content-divergent 2>&1 | grep '^\S'
       
    83   merge:[6] add foo.txt
       
    84   with: [4] add foo.txt
       
    85   base: [1] add foo.txt
       
    86   rebasing "other" content-divergent changeset c17bf400a278 on c17bf400a278
       
    87   ** unknown exception encountered, please report by visiting
       
    88   ** https://mercurial-scm.org/wiki/BugTracker
       
    89   ** Python * (glob)
       
    90   ** Mercurial Distributed SCM (*) (glob)
       
    91   ** Extensions loaded: rebase, evolve
       
    92   ** ProgrammingError: tried to relocate a node on top of itself
       
    93   ** (This shouldn't happen. If you still need to move changesets, please do so manually with nothing to rebase - working directory parent is also destination)
       
    94   Traceback (most recent call last):
       
    95   mercurial.error.ProgrammingError: tried to relocate a node on top of itself