tests/test-evolve-continue.t
changeset 3489 ee72cdc2387b
child 3490 51c0a23b519e
equal deleted inserted replaced
3488:1baf32675ec6 3489:ee72cdc2387b
       
     1 Testing the continue functionality of `hg evolve`
       
     2 
       
     3   $ cat >> $HGRCPATH <<EOF
       
     4   > [ui]
       
     5   > interactive = True
       
     6   > [alias]
       
     7   > glog = log -GT "{rev}:{node|short} {desc}\n ({bookmarks}) {phase}"
       
     8   > [extensions]
       
     9   > rebase =
       
    10   > EOF
       
    11   $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
       
    12 
       
    13 Setting up the repo
       
    14 
       
    15   $ hg init repo
       
    16   $ cd repo
       
    17   $ echo ".*\.orig" > .hgignore
       
    18   $ hg add .hgignore
       
    19   $ hg ci -m "added hgignore"
       
    20   $ for ch in a b c d; do echo foo>$ch; hg add $ch; hg ci -qm "added "$ch; done
       
    21 
       
    22   $ hg glog
       
    23   @  4:c41c793e0ef1 added d
       
    24   |   () draft
       
    25   o  3:ca1b80f7960a added c
       
    26   |   () draft
       
    27   o  2:b1661037fa25 added b
       
    28   |   () draft
       
    29   o  1:c7586e2a9264 added a
       
    30   |   () draft
       
    31   o  0:8fa14d15e168 added hgignore
       
    32       () draft
       
    33 
       
    34 Simple case of evolve --continue
       
    35 
       
    36   $ hg up ca1b80f7960a
       
    37   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
    38   $ echo bar > d
       
    39   $ hg add d
       
    40   $ hg amend
       
    41   1 new orphan changesets
       
    42   $ hg glog
       
    43   @  5:cb6a2ab625bb added c
       
    44   |   () draft
       
    45   | *  4:c41c793e0ef1 added d
       
    46   | |   () draft
       
    47   | x  3:ca1b80f7960a added c
       
    48   |/    () draft
       
    49   o  2:b1661037fa25 added b
       
    50   |   () draft
       
    51   o  1:c7586e2a9264 added a
       
    52   |   () draft
       
    53   o  0:8fa14d15e168 added hgignore
       
    54       () draft
       
    55 
       
    56   $ hg evolve --all
       
    57   move:[4] added d
       
    58   atop:[5] added c
       
    59   merging d
       
    60   warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
       
    61   evolve failed!
       
    62   fix conflict and run 'hg evolve --continue' or use 'hg update -C .' to abort
       
    63   abort: unresolved merge conflicts (see hg help resolve)
       
    64   [255]
       
    65 
       
    66   $ echo foo > d
       
    67   $ hg resolve -m
       
    68   (no more unresolved files)
       
    69   continue: hg evolve --continue
       
    70 
       
    71   $ hg evolve --continue
       
    72   evolving 4:c41c793e0ef1 "added d"
       
    73 
       
    74   $ hg glog
       
    75   @  6:2a4e03d422e2 added d
       
    76   |   () draft
       
    77   o  5:cb6a2ab625bb added c
       
    78   |   () draft
       
    79   o  2:b1661037fa25 added b
       
    80   |   () draft
       
    81   o  1:c7586e2a9264 added a
       
    82   |   () draft
       
    83   o  0:8fa14d15e168 added hgignore
       
    84       () draft
       
    85 
       
    86 Case when conflicts resolution lead to empty wdir in evolve --continue
       
    87 
       
    88   $ echo foo > e
       
    89   $ hg ci -Aqm "added e"
       
    90   $ hg prev
       
    91   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
    92   [6] added d
       
    93   $ echo bar > e
       
    94   $ hg add e
       
    95   $ hg amend
       
    96   1 new orphan changesets
       
    97 
       
    98   $ hg glog
       
    99   @  8:00a5c774cc37 added d
       
   100   |   () draft
       
   101   | *  7:ad0a59d83efe added e
       
   102   | |   () draft
       
   103   | x  6:2a4e03d422e2 added d
       
   104   |/    () draft
       
   105   o  5:cb6a2ab625bb added c
       
   106   |   () draft
       
   107   o  2:b1661037fa25 added b
       
   108   |   () draft
       
   109   o  1:c7586e2a9264 added a
       
   110   |   () draft
       
   111   o  0:8fa14d15e168 added hgignore
       
   112       () draft
       
   113 
       
   114   $ hg evolve
       
   115   move:[7] added e
       
   116   atop:[8] added d
       
   117   merging e
       
   118   warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
       
   119   evolve failed!
       
   120   fix conflict and run 'hg evolve --continue' or use 'hg update -C .' to abort
       
   121   abort: unresolved merge conflicts (see hg help resolve)
       
   122   [255]
       
   123 
       
   124   $ echo bar > e
       
   125   $ hg resolve -m
       
   126   (no more unresolved files)
       
   127   continue: hg evolve --continue
       
   128   $ hg diff
       
   129 
       
   130 XXX: maybe we should add a message here about evolve resulting in no commit
       
   131   $ hg evolve --continue
       
   132   evolving 7:ad0a59d83efe "added e"
       
   133   ** Unknown exception encountered with possibly-broken third-party extension evolve
       
   134   ** which supports versions 4.4 of Mercurial.
       
   135   ** Please disable evolve and try your action again.
       
   136   ** If that fixes the bug please report it to https://bz.mercurial-scm.org/
       
   137   ** Python 2.7.12 (default, Dec  4 2017, 14:50:18) [GCC 5.4.0 20160609]
       
   138   ** Mercurial Distributed SCM (version 4.5+64-87416288be98)
       
   139   ** Extensions loaded: rebase, evolve
       
   140   Traceback (most recent call last):
       
   141     File "/tmp/hgtests.vDbR61/install/bin/hg", line 41, in <module>
       
   142       dispatch.run()
       
   143     File "/tmp/hgtests.vDbR61/install/lib/python/mercurial/dispatch.py", line 88, in run
       
   144       status = (dispatch(req) or 0) & 255
       
   145     File "/tmp/hgtests.vDbR61/install/lib/python/mercurial/dispatch.py", line 183, in dispatch
       
   146       ret = _runcatch(req)
       
   147     File "/tmp/hgtests.vDbR61/install/lib/python/mercurial/dispatch.py", line 324, in _runcatch
       
   148       return _callcatch(ui, _runcatchfunc)
       
   149     File "/tmp/hgtests.vDbR61/install/lib/python/mercurial/dispatch.py", line 332, in _callcatch
       
   150       return scmutil.callcatch(ui, func)
       
   151     File "/tmp/hgtests.vDbR61/install/lib/python/mercurial/scmutil.py", line 154, in callcatch
       
   152       return func()
       
   153     File "/tmp/hgtests.vDbR61/install/lib/python/mercurial/dispatch.py", line 314, in _runcatchfunc
       
   154       return _dispatch(req)
       
   155     File "/tmp/hgtests.vDbR61/install/lib/python/mercurial/dispatch.py", line 918, in _dispatch
       
   156       cmdpats, cmdoptions)
       
   157     File "/tmp/hgtests.vDbR61/install/lib/python/mercurial/dispatch.py", line 673, in runcommand
       
   158       ret = _runcommand(ui, options, cmd, d)
       
   159     File "/tmp/hgtests.vDbR61/install/lib/python/mercurial/dispatch.py", line 926, in _runcommand
       
   160       return cmdfunc()
       
   161     File "/tmp/hgtests.vDbR61/install/lib/python/mercurial/dispatch.py", line 915, in <lambda>
       
   162       d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
       
   163     File "/tmp/hgtests.vDbR61/install/lib/python/mercurial/util.py", line 1195, in check
       
   164       return func(*args, **kwargs)
       
   165     File "/home/foobar/repo/mutable-history/hgext3rd/evolve/evolvecmd.py", line 1141, in evolve
       
   166       obsolete.createmarkers(repo, [(ctx, (repo[node],))])
       
   167     File "/tmp/hgtests.vDbR61/install/lib/python/mercurial/obsolete.py", line 1115, in createmarkers
       
   168       ui=repo.ui)
       
   169     File "/tmp/hgtests.vDbR61/install/lib/python/mercurial/obsolete.py", line 621, in create
       
   170       if len(succ) != 20:
       
   171   TypeError: object of type 'NoneType' has no len()
       
   172   [1]
       
   173 
       
   174   $ hg glog
       
   175   @  8:00a5c774cc37 added d
       
   176   |   () draft
       
   177   | *  7:ad0a59d83efe added e
       
   178   | |   () draft
       
   179   | x  6:2a4e03d422e2 added d
       
   180   |/    () draft
       
   181   o  5:cb6a2ab625bb added c
       
   182   |   () draft
       
   183   o  2:b1661037fa25 added b
       
   184   |   () draft
       
   185   o  1:c7586e2a9264 added a
       
   186   |   () draft
       
   187   o  0:8fa14d15e168 added hgignore
       
   188       () draft
       
   189