[issue1481] KeyError: 'modified' at commands.py#l2751

Sridhar Ratnakumar mercurial-bugs at selenic.com
Sat Jan 24 20:18:00 CST 2009


New submission from Sridhar Ratnakumar <sridhar.ratna at gmail.com>:

http://selenic.com/repo/index.cgi/hg/file/43cfbb21f04d/mercurial/commands.py#l2751

In [41]: commands.status(uio, r)
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)

/home/srid/code/amalgam/<ipython console> in <module>()

/home/srid/code/amalgam/p26/lib/python2.6/site-packages/mercurial-1.1.2-py2.6-linux-i686.egg/mercurial/commands.pyc
in status(ui, repo, *pats, **opts)
   2721     copy = {}
   2722     states = 'modified added removed deleted unknown ignored clean'.split()
-> 2723     show = [k for k in states if opts[k]]
   2724     if opts.get('all'):
   2725         show += ui.quiet and (states[:4] + ['clean']) or states

KeyError: 'modified'

====

The fix is to modify the line 2751 to:

  show = [k for k in states if k in opts]

Otherwise, the user has to explicitly list all keywords in function call:

  commands.status(uio, r, modified=True, added=True, removed=True, deleted=True,
unknown=True, ignored=True, clean=False)

----------
messages: 8478
nosy: srid
priority: bug
status: unread
title: KeyError: 'modified' at commands.py#l2751

____________________________________________________
Mercurial issue tracker <mercurial-bugs at selenic.com>
<http://www.selenic.com/mercurial/bts/issue1481>
____________________________________________________



More information about the Mercurial-devel mailing list