assertionerror trips on pull --overwrite in dirstate branch with non-canonical history
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
High
|
John A Meinel |
Bug Description
There are apparently branches out there in the wild with sufficiently strange revision-history files as to seriously trip up bzr.dev when you try to pull --overwrite:
mwh@grond:tmp$ bzr.dev branch http://
Branched 37 revision(s).
mwh@grond:tmp$ cd win32/
mwh@grond:win32$ bzr.dev pull --overwrite .
bzr: ERROR: exceptions.
Traceback (most recent call last):
File "/home/
return run_bzr(argv)
File "/home/
ret = run(*run_argv)
File "/home/
return self.run(
File "/home/
possible_
File "/home/
return unbound(self, *args, **kwargs)
File "/home/
possible_
File "/home/
return unbound(self, *args, **kwargs)
File "/home/
run_
File "/home/
return unbound(self, *args, **kwargs)
File "/home/
self.
File "/home/
return unbound(self, *args, **kwargs)
File "/home/
other_
File "/home/
return unbound(self, *args, **kwargs)
File "/home/
assert len(history) == revno, '%d != %d' % (len(history), revno)
AssertionError: 36 != 37
bzr 1.1.0.dev.0 on python 2.5.1.final.0 (linux2)
arguments: ['/home/
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_GB.UTF-8'
plugins:
gtk /home/mwh/
launchpad /home/mwh/
lpreview /home/mwh/
multiparent /home/mwh/
svn /home/mwh/
*** Bazaar has encountered an internal error.
Please report a bug at https:/
including this traceback, and a description of what you
were doing when the error occurred.
If you upgrade to dirstate-tags, this goes away, but you're left with this strange situation:
mwh@grond:win32$ bzr.dev revno
37
mwh@grond:win32$ bzr.dev revision-history | wc -l
36
(bzr 0.92.0 reports the revno as 36, though).
Older versions of Bazaar allowed "bzr pull" to add nodes to the tip of your revision history, without renormalizing it. So if you had:
A
|\
B C
| |
D |
|/
E
A branch at E could have rh=A,B,D,E rn=4, or rh=A,C,E,rn=3
After about 0.8, we changed it so that 'pull' would always generate A,B,D,E
In 1.0 we changed 'pull' so that instead of doing: set_revision_ history( source. get_revision_ history( )) set_last_ revision_ info(source. get_last_ revision_ info())
target.
To doing:
target.
For <= dirstate branches (Branch5), set_last_ revision_ info regenerates the revision history from the repository. It then checks that the revno is correct. And as you notice, there is a mismatch.
Branch6 doesn't do the rebuild and check, (because it scales with O(history)).
So what we need is just an update to check/reconcile to fix this, and turn the error into a warning that you should run 'reconcile' on the source branch.