bzr commit fails with revno-related AssertionError
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Medium
|
Unassigned |
Bug Description
The following shows the error that occurred and the steps I used to fix the problem. Due to the branch being for a proprietary project, I've replaced filenames with "..." where necessary.
jkakar:...$ bzr commit
modified ...
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/
reporter=
File "/usr/lib/
return unbound(self, *args, **kwargs)
File "/usr/lib/
revprops=
File "/usr/lib/
self.
File "/usr/lib/
return unbound(self, *args, **kwargs)
File "/usr/lib/
assert len(history) == revno, '%d != %d' % (len(history), revno)
AssertionError: 301 != 306
bzr 0.15.0candidate0 on python 2.4.4.candidate.1 (linux2)
arguments: ['/usr/bin/bzr', 'commit']
** please send this report to <email address hidden>
jkakar:...$ bzr st
modified:
...
jkakar:...$ python
Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02)
[GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import bzrlib.branch
>>> b = bzrlib.
>>> b.generate_
>>> len(b.revision_
300
>>>
jkakar:...$ bzr commit
modified src/...
Committed revision 301.
You should also be able to do "bzr pull --overwrite .". Which is a little funny, but should basically just regenerate the revision history.
I think the source of this bug is that very old versions of bzr allowed the 'revision-history' to be something other than the left-hand ancestry. I think that was back in bzr-0.7 or so.
Versions since that would renormalize at certain times, but wouldn't strictly require it.
And 0.15-rc1 seems to explicitly require it.
We probably should be giving either a better error, or possibly just automatically renormalizing, if we see that other pre-conditions line up. (The last revision for the branch is correct, and it's revno is also off)