[Bug 5088] New: histedit crash with filtered node caused by commit -i --amend

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Mon Feb 8 02:39:47 UTC 2016


https://bz.mercurial-scm.org/show_bug.cgi?id=5088

            Bug ID: 5088
           Summary: histedit crash with filtered node caused by commit -i
                    --amend
           Product: Mercurial
           Version: 3.7.1
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: histedit
          Assignee: bugzilla at selenic.com
          Reporter: timeless at gmail.com
                CC: mercurial-devel at selenic.com

(py)[timeless at gcc2-power8 tests]$ hg histedit --cont --traceback --debugger
entering debugger - type c to continue starting hg or h for help
Traceback (most recent call last):
  File "/home/timeless/hg/crew/mercurial/dispatch.py", line 214, in _runcatch
    return _dispatch(req)
  File "/home/timeless/hg/crew/mercurial/dispatch.py", line 998, in _dispatch
    cmdpats, cmdoptions)
  File "/home/timeless/hg/crew/mercurial/dispatch.py", line 752, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/home/timeless/hg/crew/mercurial/extensions.py", line 195, in closure
    return func(*(args + a), **kw)
  File "/home/timeless/hg/crew/hgext/color.py", line 518, in colorcmd
    return orig(ui_, opts, cmd, cmdfunc)
  File "/home/timeless/hg/crew/mercurial/dispatch.py", line 1134, in
_runcommand
    return checkargs()
  File "/home/timeless/hg/crew/mercurial/dispatch.py", line 1092, in checkargs
    return cmdfunc()
  File "/home/timeless/hg/crew/mercurial/dispatch.py", line 995, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/home/timeless/hg/crew/mercurial/util.py", line 992, in check
    return func(*args, **kwargs)
  File "/home/timeless/hg/crew/mercurial/extensions.py", line 195, in closure
    return func(*(args + a), **kw)
  File "/home/timeless/hg/crew/mercurial/util.py", line 992, in check
    return func(*args, **kwargs)
  File "/home/timeless/hg/evolve-main/hgext/evolve.py", line 727, in
warnobserrors
    ret = orig(ui, repo, *args, **kwargs)
  File "/home/timeless/hg/crew/mercurial/util.py", line 992, in check
    return func(*args, **kwargs)
  File "/home/timeless/hg/crew/mercurial/extensions.py", line 195, in closure
    return func(*(args + a), **kw)
  File "/home/timeless/hg/crew/mercurial/util.py", line 992, in check
    return func(*args, **kwargs)
  File "/home/timeless/hg/crew/hgext/mq.py", line 3516, in mqcommand
    return orig(ui, repo, *args, **kwargs)
  File "/home/timeless/hg/crew/mercurial/util.py", line 992, in check
    return func(*args, **kwargs)
  File "/home/timeless/hg/crew/hgext/histedit.py", line 981, in histedit
    _histedit(ui, repo, state, *freeargs, **opts)
  File "/home/timeless/hg/crew/hgext/histedit.py", line 1183, in _histedit
    mapping, tmpnodes, created, ntm = processreplacement(state)
  File "/home/timeless/hg/crew/hgext/histedit.py", line 1422, in
processreplacement
    newtopmost = sorted(new, key=state.repo.changelog.rev)[-1]
  File "/home/timeless/hg/crew/mercurial/changelog.py", line 212, in rev
    _('filtered node'))
FilteredLookupError: 00changelog.i at 0973a1e2cbc4850937de375c5307a5b453e78ea2:
filtered node


I'm running blackbox while using histedit to make changes to blackbox, here's
the first part of the log:
2016/02/08 01:49:22 timeless @965333dff411 (80008)> histedit 28481
2016/02/08 01:49:33 timeless @94a44dd8fee3+ (80008)> Editing (04584da5365e),
you may commit or record as needed now.
2016/02/08 01:49:33 timeless @94a44dd8fee3+ (80008)> (hg histedit --continue to
resume)
2016/02/08 01:49:33 timeless @94a44dd8fee3+ (80008)> histedit 28481 exited 1
after 10.71 seconds

2016/02/08 01:49:34 timeless (80030)> diff --git -p
2016/02/08 01:49:45 timeless (80573)> histedit --edit-plan
2016/02/08 01:49:55 timeless (81009)> histedit --cont
2016/02/08 01:51:50 timeless (108979)> commit -i --amend
2016/02/08 01:52:11 timeless (108979)> commit -i --amend exited -1 after 20.92
seconds
2016/02/08 01:52:37 timeless (113329)> histedit --edit-plan
2016/02/08 01:52:49 timeless (113904)> commit -i --amend
2016/02/08 01:52:58 timeless (113904)> commit -i --amend exited -1 after 9.83
seconds
2016/02/08 01:53:43 timeless (122458)> log --hidden -G -r
7d55ab6425b5b8836560e0de40e20e47c762a0f9::
2016/02/08 01:54:05 timeless (135262)> log --hidden -Gr ::28202
2016/02/08 01:54:37 timeless (144241)> log --hidden -Gpr ::28202
2016/02/08 01:55:27 timeless (156103)> log -Gr ::.
2016/02/08 01:55:36 timeless (156958)> commit -i --amend
^ this triggers the eventual crash
28495 + 28496 => 28497
2016/02/08 01:56:03 timeless (163685)> diff --git -p
2016/02/08 01:56:27 timeless (3658)> histedit --edit-plan
2016/02/08 01:56:45 timeless (3983)> histedit --cont
2016/02/08 01:56:48 timeless (3983)> histedit --cont exited 1 after 2.69
seconds
2016/02/08 01:57:08 timeless (4550)> histedit --cont
2016/02/08 01:57:10 timeless (4550)> histedit --cont exited -1 after 2.82
seconds
2016/02/08 01:59:16 timeless @b73f4b0b562a (4978)> log --hidden -r
0973a1e2cbc4850937de375c5307a5b453e78ea2

Here's what ended up being in my histedit plan:
(py)[timeless at gcc2-power8 tests]$ cat ../.hg/histedit-last-edit.txt
edit 758a17e0e432 28483 blackbox: avoid creating multiple file handles for a
...
e    21ccd81b0d92 28484 util: enable getpid to be replaced
d    d589445a0049 28485 os
p    9a98d9e3d199 28486 tests: mock getpid to reduce glob usage
pick e28636b66452 28487 run-tests: factor out escapepath
pick 5f8c8e565eb1 28488 tests: replace python dir with $PYTHONDIR in test
output
pick 02e769c6a1e7 28489 blackbox: log working directory version
pick 6b183159a7ab 28490 blackbox: store the blackbox ui object instead of
the...
pick 855e9d2469ed 28491 blackbox: properly replace ui class
pick 9c7eaac98e69 28492 blackbox: retry opening the log file
pick c099ba012ab6 28493 ui: log devel warnings
pick 965333dff411 28494 dispatch: log everything

# Edit history between 0973a1e2cbc4 and 965333dff411

Using my histedit-tags code (running from a different instance of hg), we can
see that I indeed didn't tell histedit about the commit-amend, as far as it was
concerned, 28495 was applied:
(py)[timeless at gcc2-power8 crew.notgd]$ ./hg log -G -R ../crew --hidden -r
28481:: |cat
@  changeset:   28508:b73f4b0b562a
|  tag:         h_12_applied
|  tag:         tip
|  user:        timeless <timeless at mozdev.org>
|  date:        Wed Feb 03 07:01:50 2016 +0000
|  summary:     dispatch: log everything
|
o  changeset:   28507:f6c23797043d
|  tag:         h_11_applied
|  user:        timeless <timeless at mozdev.org>
|  date:        Fri Jan 29 14:37:16 2016 +0000
|  summary:     ui: log devel warnings
|
o  changeset:   28506:2edd2f46232f
|  tag:         h_10_applied
|  user:        timeless <timeless at mozdev.org>
|  date:        Thu Jan 28 20:08:23 2016 +0000
|  summary:     blackbox: retry opening the log file
|
o  changeset:   28505:303edac0b8bc
|  tag:         h_9_applied
|  user:        timeless <timeless at mozdev.org>
|  date:        Wed Feb 03 04:54:40 2016 +0000
|  summary:     blackbox: properly replace ui class
|
o  changeset:   28504:51cd37695428
|  tag:         h_8_applied
|  user:        timeless <timeless at mozdev.org>
|  date:        Wed Feb 03 17:05:04 2016 +0000
|  summary:     blackbox: store the blackbox ui object instead of the log file
|
o  changeset:   28503:a16785ef4b5b
|  tag:         h_7_applied
|  user:        timeless <timeless at mozdev.org>
|  date:        Thu Jan 28 20:07:54 2016 +0000
|  summary:     blackbox: log working directory version
|
o  changeset:   28502:feecde6805c9
|  tag:         h_6_applied
|  user:        timeless <timeless at mozdev.org>
|  date:        Fri Jan 29 14:37:16 2016 +0000
|  summary:     tests: replace python dir with $PYTHONDIR in test output
|
o  changeset:   28501:86747b371d71
|  tag:         h_5_applied
|  user:        timeless <timeless at mozdev.org>
|  date:        Fri Jan 29 14:35:34 2016 +0000
|  summary:     run-tests: factor out escapepath
|
o  changeset:   28500:cb61d8b0b207
|  tag:         h_4_applied
|  user:        timeless <timeless at mozdev.org>
|  date:        Wed Feb 03 04:37:04 2016 +0000
|  summary:     tests: mock getpid to reduce glob usage
|
o  changeset:   28499:b5885295f0c3
|  tag:         h_2_applied
|  user:        timeless <timeless at mozdev.org>
|  date:        Wed Feb 03 09:11:22 2016 +0000
|  summary:     util: enable getpid to be replaced
|
o  changeset:   28498:1f65466c7f0b
|  tag:         h_1_applied
|  user:        timeless <timeless at mozdev.org>
|  date:        Wed Feb 03 15:41:31 2016 +0000
|  summary:     blackbox: avoid creating multiple file handles for a single log
|
o  changeset:   28497:b4bf2552f272
|  parent:      28481:94a44dd8fee3
|  user:        timeless <timeless at mozdev.org>
|  date:        Mon Feb 08 00:47:36 2016 +0000
|  summary:     blackbox: refactor use of vfs as _bbvfs
|
| x  changeset:   28496:5ea71f9d556d
| |  user:        timeless <timeless at mozdev.org>
| |  date:        Mon Feb 08 00:47:36 2016 +0000
| |  summary:     temporary amend commit for 0973a1e2cbc4
| |
| x  changeset:   28495:0973a1e2cbc4
|/   tag:         h_0_applied
|    parent:      28481:94a44dd8fee3
|    user:        timeless <timeless at mozdev.org>
|    date:        Mon Feb 08 00:47:36 2016 +0000
|    summary:     blackbox: rename _bbvfs
|
| o  changeset:   28494:965333dff411
| |  bookmark:    blackbox
| |  tag:         h-prev
| |  tag:         h_12
| |  tag:         h_12_origin
| |  user:        timeless <timeless at mozdev.org>
| |  date:        Wed Feb 03 07:01:50 2016 +0000
| |  summary:     dispatch: log everything
| |
| o  changeset:   28493:c099ba012ab6
| |  tag:         h_11
| |  tag:         h_11_origin
| |  user:        timeless <timeless at mozdev.org>
| |  date:        Fri Jan 29 14:37:16 2016 +0000
| |  summary:     ui: log devel warnings
| |
| o  changeset:   28492:9c7eaac98e69
| |  tag:         h_10
| |  tag:         h_10_origin
| |  user:        timeless <timeless at mozdev.org>
| |  date:        Thu Jan 28 20:08:23 2016 +0000
| |  summary:     blackbox: retry opening the log file
| |
| o  changeset:   28491:855e9d2469ed
| |  tag:         h_9
| |  tag:         h_9_origin
| |  user:        timeless <timeless at mozdev.org>
| |  date:        Wed Feb 03 04:54:40 2016 +0000
| |  summary:     blackbox: properly replace ui class
| |
| o  changeset:   28490:6b183159a7ab
| |  tag:         h_8
| |  tag:         h_8_origin
| |  user:        timeless <timeless at mozdev.org>
| |  date:        Wed Feb 03 17:05:04 2016 +0000
| |  summary:     blackbox: store the blackbox ui object instead of the log
file
| |
| o  changeset:   28489:02e769c6a1e7
| |  tag:         h_7
| |  tag:         h_7_origin
| |  user:        timeless <timeless at mozdev.org>
| |  date:        Thu Jan 28 20:07:54 2016 +0000
| |  summary:     blackbox: log working directory version
| |
| o  changeset:   28488:5f8c8e565eb1
| |  tag:         h_6
| |  tag:         h_6_origin
| |  user:        timeless <timeless at mozdev.org>
| |  date:        Fri Jan 29 14:37:16 2016 +0000
| |  summary:     tests: replace python dir with $PYTHONDIR in test output
| |
| o  changeset:   28487:e28636b66452
| |  tag:         h_5
| |  tag:         h_5_origin
| |  user:        timeless <timeless at mozdev.org>
| |  date:        Fri Jan 29 14:35:34 2016 +0000
| |  summary:     run-tests: factor out escapepath
| |
| o  changeset:   28486:9a98d9e3d199
| |  tag:         h_4
| |  tag:         h_4_origin
| |  user:        timeless <timeless at mozdev.org>
| |  date:        Wed Feb 03 04:37:04 2016 +0000
| |  summary:     tests: mock getpid to reduce glob usage
| |
| o  changeset:   28485:d589445a0049
| |  tag:         h_3
| |  tag:         h_3_dropped
| |  user:        timeless <timeless at mozdev.org>
| |  date:        Mon Feb 08 01:40:04 2016 +0000
| |  summary:     os
| |
| o  changeset:   28484:21ccd81b0d92
| |  tag:         h_2
| |  tag:         h_2_origin
| |  user:        timeless <timeless at mozdev.org>
| |  date:        Wed Feb 03 09:11:22 2016 +0000
| |  summary:     util: enable getpid to be replaced
| |
| o  changeset:   28483:758a17e0e432
| |  tag:         h_1
| |  tag:         h_1_origin
| |  user:        timeless <timeless at mozdev.org>
| |  date:        Wed Feb 03 15:41:31 2016 +0000
| |  summary:     blackbox: avoid creating multiple file handles for a single
log
| |
| o  changeset:   28482:04584da5365e
|/   tag:         h_0
|    tag:         h_0_origin
|    user:        timeless <timeless at mozdev.org>
|    date:        Mon Feb 08 00:47:36 2016 +0000
|    summary:     blackbox: rename _bbvfs
|
o  changeset:   28481:94a44dd8fee3
|  user:        timeless <timeless at mozdev.org>
|  date:        Wed Feb 03 15:18:29 2016 +0000
|  summary:     blackbox: flush output file descriptor
|

the crash is from:
    # computed topmost element (necessary for bookmark)
    if new:
        newtopmost = sorted(new, key=state.repo.changelog.rev)[-1]

>>> [state.repo.unfiltered()[c].rev() for c in list(new)]
[28507, 28500, 28498, 28499, 28503, 28504, 28506, 28501, 28508, 28495, 28502,
28505]
                                                                  ^ this is the
unhappy node

My lazy tentative fix is to have processreplacement use unfiltered...

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list