[issue2286] bookmark command alias gives TypeError for invalid arguments

Brodie Rao bugs at mercurial.selenic.com
Wed Jul 14 19:39:14 UTC 2010


New submission from Brodie Rao <brodie at bitheap.org>:

Normally "hg bookmarks" will correctly say "invalid arguments" when given multiple positional arguments (it 
only accepts a single bookmark name). However, when the command is called from an alias under this 
circumstance, hg raises a TypeError.

$ hg init foo
$ cd foo
$ hg bookmark foo
$ hg bookmark bar
$ hg --config alias.bm=bookmark bm -d foo bar
** unknown exception encountered, details follow
** report bug details to http://mercurial.selenic.com/bts/
** or mercurial at selenic.com
** Python 2.7 (r27:82500, Jul 11 2010, 23:01:58) [GCC 4.2.1 (Apple Inc. build 5664)]
** Mercurial Distributed SCM (version 1.6)
** Extensions loaded: bookmarks
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/hg", line 27, in <module>
    mercurial.dispatch.run()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages/mercurial/dispatch.py", line 16, in run
    sys.exit(dispatch(sys.argv[1:]))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages/mercurial/dispatch.py", line 34, in dispatch
    return _runcatch(u, args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages/mercurial/dispatch.py", line 54, in _runcatch
    return _dispatch(ui, args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages/mercurial/dispatch.py", line 483, in _dispatch
    cmdpats, cmdoptions)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages/mercurial/dispatch.py", line 351, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages/mercurial/dispatch.py", line 534, in _runcommand
    return checkargs()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages/mercurial/dispatch.py", line 488, in checkargs
    return cmdfunc()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages/mercurial/dispatch.py", line 481, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages/mercurial/util.py", line 420, in check
    return func(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages/mercurial/dispatch.py", line 251, in __call__
    return self.fn(ui, *args, **opts)
TypeError: bookmark() got multiple values for keyword argument 'rev'

----------
messages: 13099
nosy: brodie, dsp
priority: bug
status: unread
title: bookmark command alias gives TypeError for invalid arguments
topic: bookmarks

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


More information about the Mercurial-devel mailing list