comparison tests/test-evolve-topic.t @ 3534:cd4db75413a2 stable

previous: fix behavior on obsolete cset when topic is involved (issue5708) This patch fixes the behavior of `hg previous` when done on an obsolete changeset having a successor of different topic. The underlying code is bit messed up, I wanted to split the topic handling to topic extension but I have postponed it to next bug.
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 16 Mar 2018 15:21:05 +0530
parents f06c502ce4b7
children 031d70bcbb42
comparison
equal deleted inserted replaced
3533:f06c502ce4b7 3534:cd4db75413a2
359 (use 'hg evolve' to update to its successor: 793eb6370b2d) 359 (use 'hg evolve' to update to its successor: 793eb6370b2d)
360 360
361 $ hg topic bar 361 $ hg topic bar
362 362
363 $ hg prev 363 $ hg prev
364 ** Unknown exception encountered with possibly-broken third-party extension evolve 364 no parent in topic "bar"
365 ** which supports versions 4.4 of Mercurial. 365 (do you want --no-topic)
366 ** Please disable evolve and try your action again.
367 ** If that fixes the bug please report it to https://bz.mercurial-scm.org/
368 ** Python 2.7.12 (default, Dec 4 2017, 14:50:18) [GCC 5.4.0 20160609]
369 ** Mercurial Distributed SCM (version 4.5.2+1098-cdc73e5c75af)
370 ** Extensions loaded: rebase, evolve, topic
371 Traceback (most recent call last):
372 File "/tmp/hgtests.PuAW80/install/bin/hg", line 41, in <module>
373 dispatch.run()
374 File "/tmp/hgtests.PuAW80/install/lib/python/mercurial/dispatch.py", line 88, in run
375 status = (dispatch(req) or 0)
376 File "/tmp/hgtests.PuAW80/install/lib/python/mercurial/dispatch.py", line 208, in dispatch
377 ret = _runcatch(req)
378 File "/tmp/hgtests.PuAW80/install/lib/python/mercurial/dispatch.py", line 349, in _runcatch
379 return _callcatch(ui, _runcatchfunc)
380 File "/tmp/hgtests.PuAW80/install/lib/python/mercurial/dispatch.py", line 357, in _callcatch
381 return scmutil.callcatch(ui, func)
382 File "/tmp/hgtests.PuAW80/install/lib/python/mercurial/scmutil.py", line 154, in callcatch
383 return func()
384 File "/tmp/hgtests.PuAW80/install/lib/python/mercurial/dispatch.py", line 339, in _runcatchfunc
385 return _dispatch(req)
386 File "/tmp/hgtests.PuAW80/install/lib/python/mercurial/dispatch.py", line 943, in _dispatch
387 cmdpats, cmdoptions)
388 File "/tmp/hgtests.PuAW80/install/lib/python/mercurial/dispatch.py", line 700, in runcommand
389 ret = _runcommand(ui, options, cmd, d)
390 File "/tmp/hgtests.PuAW80/install/lib/python/mercurial/dispatch.py", line 951, in _runcommand
391 return cmdfunc()
392 File "/tmp/hgtests.PuAW80/install/lib/python/mercurial/dispatch.py", line 940, in <lambda>
393 d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
394 File "/tmp/hgtests.PuAW80/install/lib/python/mercurial/util.py", line 1497, in check
395 return func(*args, **kwargs)
396 File "/home/foobar/repo/mutable-history/hgext3rd/evolve/__init__.py", line 1051, in cmdprevious
397 opts.get('move_bookmark'), topic)
398 File "/home/foobar/repo/mutable-history/hgext3rd/evolve/__init__.py", line 995, in _findprevtarget
399 if currenttopic and topic and _gettopicidx(p1) != 1:
400 File "/home/foobar/repo/mutable-history/hgext3rd/evolve/__init__.py", line 957, in _gettopicidx
401 return getattr(ctx, 'topicidx', lambda: None)()
402 File "/home/foobar/repo/mutable-history/hgext3rd/topic/__init__.py", line 247, in _contexttopicidx
403 return revlist.index(succ)
404 File "/home/foobar/repo/mutable-history/hgext3rd/topic/stack.py", line 95, in index
405 return self.revs.index(item)
406 ValueError: 18 is not in list
407 [1] 366 [1]
408 367
409 When current topic and obsolete cset topic are same but successor has different 368 When current topic and obsolete cset topic are same but successor has different
410 one 369 one
411 370
412 $ hg up 070c5573d8f9 371 $ hg up 070c5573d8f9
413 switching to topic foo 372 switching to topic foo
414 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 373 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
415 $ hg prev 374 $ hg prev
416 ** Unknown exception encountered with possibly-broken third-party extension evolve 375 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
417 ** which supports versions 4.4 of Mercurial. 376 [12] add eee
418 ** Please disable evolve and try your action again.
419 ** If that fixes the bug please report it to https://bz.mercurial-scm.org/
420 ** Python 2.7.12 (default, Dec 4 2017, 14:50:18) [GCC 5.4.0 20160609]
421 ** Mercurial Distributed SCM (version 4.5.2+1098-cdc73e5c75af)
422 ** Extensions loaded: rebase, evolve, topic
423 Traceback (most recent call last):
424 File "/tmp/hgtests.PuAW80/install/bin/hg", line 41, in <module>
425 dispatch.run()
426 File "/tmp/hgtests.PuAW80/install/lib/python/mercurial/dispatch.py", line 88, in run
427 status = (dispatch(req) or 0)
428 File "/tmp/hgtests.PuAW80/install/lib/python/mercurial/dispatch.py", line 208, in dispatch
429 ret = _runcatch(req)
430 File "/tmp/hgtests.PuAW80/install/lib/python/mercurial/dispatch.py", line 349, in _runcatch
431 return _callcatch(ui, _runcatchfunc)
432 File "/tmp/hgtests.PuAW80/install/lib/python/mercurial/dispatch.py", line 357, in _callcatch
433 return scmutil.callcatch(ui, func)
434 File "/tmp/hgtests.PuAW80/install/lib/python/mercurial/scmutil.py", line 154, in callcatch
435 return func()
436 File "/tmp/hgtests.PuAW80/install/lib/python/mercurial/dispatch.py", line 339, in _runcatchfunc
437 return _dispatch(req)
438 File "/tmp/hgtests.PuAW80/install/lib/python/mercurial/dispatch.py", line 943, in _dispatch
439 cmdpats, cmdoptions)
440 File "/tmp/hgtests.PuAW80/install/lib/python/mercurial/dispatch.py", line 700, in runcommand
441 ret = _runcommand(ui, options, cmd, d)
442 File "/tmp/hgtests.PuAW80/install/lib/python/mercurial/dispatch.py", line 951, in _runcommand
443 return cmdfunc()
444 File "/tmp/hgtests.PuAW80/install/lib/python/mercurial/dispatch.py", line 940, in <lambda>
445 d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
446 File "/tmp/hgtests.PuAW80/install/lib/python/mercurial/util.py", line 1497, in check
447 return func(*args, **kwargs)
448 File "/home/foobar/repo/mutable-history/hgext3rd/evolve/__init__.py", line 1051, in cmdprevious
449 opts.get('move_bookmark'), topic)
450 File "/home/foobar/repo/mutable-history/hgext3rd/evolve/__init__.py", line 995, in _findprevtarget
451 if currenttopic and topic and _gettopicidx(p1) != 1:
452 File "/home/foobar/repo/mutable-history/hgext3rd/evolve/__init__.py", line 957, in _gettopicidx
453 return getattr(ctx, 'topicidx', lambda: None)()
454 File "/home/foobar/repo/mutable-history/hgext3rd/topic/__init__.py", line 247, in _contexttopicidx
455 return revlist.index(succ)
456 File "/home/foobar/repo/mutable-history/hgext3rd/topic/stack.py", line 95, in index
457 return self.revs.index(item)
458 ValueError: 18 is not in list
459 [1]