Tag command breaks badly with empty repository
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Medium
|
Unassigned |
Bug Description
[niemeyer@burma ~]% mkdir a
[niemeyer@burma ~]% cd a
[niemeyer@burma ~/a]% bzr init --format=
[niemeyer@burma ~/a]% bzr tag foo
bzr: ERROR: exceptions.
Traceback (most recent call last):
File "/usr/lib/
return run_bzr(argv)
File "/usr/lib/
ret = run(*run_argv)
File "/usr/lib/
return self.run(
File "/usr/lib/
branch.
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
return bencode.bencode(td)
File "/usr/lib/
encode_
File "/usr/lib/
encode_
KeyError: <type 'NoneType'>
bzr 0.15.0candidate2 on python 2.4.4.candidate.1 (linux2)
arguments: ['/usr/bin/bzr', 'tag', 'foo']
** please send this report to <email address hidden>
This seems to be 2-fold
First, with no commits "bzr tag foo" is creating a tag and pointing it at None, which I don't think we really want.
This is being exposed at the bencode layer, because bencode cannot handle None.
bencode should probably be exposing a better exception, but since it isn't our code, we may just need to do that at a higher level.
But I *think* the 'bzr tag' command should just complain "You are trying to create a tag pointing to None".
Either that, or it should change tags pointing to None into pointing them at "null:". But I probably would rather not expose "null:" if we can help it.