[issue3153] hg diff -r <rev1> -r <rev2> -S falls over if a subrepo has been removed

Alistair Bell bugs at mercurial.selenic.com
Tue Dec 13 10:51:28 CST 2011


New submission from Alistair Bell <mercurial at bellsonline.com>:

In executing hg diff -r <rev1> -r <rev2> -S, if a subrepo exists in rev1 but 
not rev2, the command falls over with a traceback in diffordiffstat 
(attached).

The traceback attached is with a patched 1.8.3; however, I've checked that the 
identical code is in crew. Essentially, diffordiffstat grabs all the subrepos 
with subrepo.itersubrepos(), and then assumes that they will be keys of 
ctx2.substate . The fix is probably to set node2 to some form of null revision 
when subpath is not in ctx2.substate, but unfortunately I don't know this code 
well enough to fix it myself.

----------
files: hg-diff-S-traceback.txt
messages: 18301
nosy: ThreeIfByAir
priority: bug
status: unread
title: hg diff -r <rev1> -r <rev2> -S falls over if a subrepo has been removed

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue3153>
____________________________________________________
-------------- next part --------------
Command "hg -R /regress/thornham/workareas/deity_20111213_103804_abell.18753 diff -r 0bc8d3c5427e -r 42fe865f3a6f -S" error:
** unknown exception encountered, please report by visiting
**  http://mercurial.selenic.com/wiki/BugTracker
** Python 2.6.6 (r266:84292, Apr 14 2011, 22:36:26) [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)]
** Mercurial Distributed SCM (version 1.8.3+1-83c97de81f27)
** Extensions loaded: extdiff, graphlog, hgk
Traceback (most recent call last):
  File "/tools/mercurial/mercurial-1.8.3-crew-thin/bin/hg", line 38, in <module>
    mercurial.dispatch.run()
  File "/tools/mercurial/mercurial-1.8.3-crew-thin/lib/python2.6/site-packages/mercurial/dispatch.py", line 16, in run
    sys.exit(dispatch(sys.argv[1:]))
  File "/tools/mercurial/mercurial-1.8.3-crew-thin/lib/python2.6/site-packages/mercurial/dispatch.py", line 36, in dispatch
    return _runcatch(u, args)
  File "/tools/mercurial/mercurial-1.8.3-crew-thin/lib/python2.6/site-packages/mercurial/dispatch.py", line 58, in _runcatch
    return _dispatch(ui, args)
  File "/tools/mercurial/mercurial-1.8.3-crew-thin/lib/python2.6/site-packages/mercurial/dispatch.py", line 601, in _dispatch
    cmdpats, cmdoptions)
  File "/tools/mercurial/mercurial-1.8.3-crew-thin/lib/python2.6/site-packages/mercurial/dispatch.py", line 406, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/tools/mercurial/mercurial-1.8.3-crew-thin/lib/python2.6/site-packages/mercurial/dispatch.py", line 655, in _runcommand
    return checkargs()
  File "/tools/mercurial/mercurial-1.8.3-crew-thin/lib/python2.6/site-packages/mercurial/dispatch.py", line 609, in checkargs
    return cmdfunc()
  File "/tools/mercurial/mercurial-1.8.3-crew-thin/lib/python2.6/site-packages/mercurial/dispatch.py", line 598, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/tools/mercurial/mercurial-1.8.3-crew-thin/lib/python2.6/site-packages/mercurial/util.py", line 433, in check
    return func(*args, **kwargs)
  File "/tools/mercurial/mercurial-1.8.3-crew-thin/lib/python2.6/site-packages/mercurial/commands.py", line 1610, in diff
    listsubrepos=opts.get('subrepos'))
  File "/tools/mercurial/mercurial-1.8.3-crew-thin/lib/python2.6/site-packages/mercurial/cmdutil.py", line 745, in diffordiffstat
    node2 = ctx2.substate[subpath][1]
KeyError: 'design/simple_arbiter.hg'


More information about the Mercurial-devel mailing list