[issue2320] Key Error when pushing non existing bookmark

Stefan Thalauer bugs at mercurial.selenic.com
Thu Aug 5 20:41:07 UTC 2010


New submission from Stefan Thalauer <sthalauer at gmail.com>:

When you try to push a non existing bookmark via:
"hg push -B" you get a Failure inc. Traceback.

Possible fix attached.

Steps to reproduce:

hg init
hg clone . /tmp/clone.hg
hg push -B invalid_bookmark /tmp/clone.hg

deleting remote bookmark invalid_bookmark
** Unbekannter Fehler, Details folgen
** Problemdetails bitte bei http://www.selenic.com/mercurial/bts
** oder mercurial at selenic.com melden
** Python 2.7 (r27:82508, Jul  3 2010, 20:17:05) [GCC 4.0.1 (Apple Inc.
build 5493)]
** Mercurial Distributed SCM (version 1.6)
** Erweiterungen geladen: bookmarks, graphlog
Traceback (most recent call last):
  File "/usr/local/bin/hg", line 27, in <module>
    mercurial.dispatch.run()
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
16, in run
    sys.exit(dispatch(sys.argv[1:]))
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
34, in dispatch
    return _runcatch(u, args)
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
54, in _runcatch
    return _dispatch(ui, args)
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
483, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
351, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
534, in _runcommand
    return checkargs()
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
488, in checkargs
    return cmdfunc()
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
481, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/local/lib/python2.7/site-packages/mercurial/util.py", line 420,
in check
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/mercurial/extensions.py",
line 116, in wrap
    util.checksignature(origfn), *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/mercurial/util.py", line 420,
in check
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/hgext/bookmarks.py", line
446, in push
    r = other.pushkey('bookmarks', b, old, new)
  File "/usr/local/lib/python2.7/site-packages/mercurial/localrepo.py", line
1856, in pushkey
    return pushkey.push(self, namespace, key, old, new)
  File "/usr/local/lib/python2.7/site-packages/mercurial/pushkey.py", line
25, in push
    return pk(repo, key, old, new)
  File "/usr/local/lib/python2.7/site-packages/hgext/bookmarks.py", line
382, in pushbookmark
    del marks[key]
KeyError: 'invalid_bookmark'

----------
files: hg.export
messages: 13297
nosy: thalze
priority: bug
status: unread
title: Key Error when pushing non existing bookmark
topic: bookmarks

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2320>
____________________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hg.export
Type: application/octet-stream
Size: 1115 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100805/e3325a4c/attachment.obj>


More information about the Mercurial-devel mailing list