bzr unable to upgrade to rich-root/rich-root-pack format

Bug #203607 reported by Alexander Belchenko
This bug report is a duplicate of:  Bug #177874: upgrading to rich-root-pack fails. Edit Remove
6
Affects Status Importance Assigned to Milestone
Bazaar
New
Undecided
Unassigned

Bug Description

I can easily repeat rhis failure with bzr 1.2 (on Linux) and bzr 1.3rc1 (on Windows). It's seems similar to bug #177874, but I encounter this when I try to upgrade one of my own branch, not bzr.dev. And then I found the same error for branch made from scratch.

Here's steps to reproduce:

C:\Temp\2>bzr init
C:\Temp\2>bzr info
Standalone tree (format: pack-0.92)
Location:
  branch root: .
C:\Temp\2>echo foo > spam
C:\Temp\2>bzr add
added spam
C:\Temp\2>bzr ci -m 1
Committing to: C:/Temp/2/
added spam
Committed revision 1.
C:\Temp\2>echo bar > spam
C:\Temp\2>bzr ci -m 2
Committing to: C:/Temp/2/
modified spam
Committed revision 2.
C:\Temp\2>echo boo > spam
C:\Temp\2>bzr ci -m 3
Committing to: C:/Temp/2/
modified spam
Committed revision 3.
C:\Temp\2>bzr upgrade --rich-root-pack
starting upgrade of file:///C:/Temp/2/
making backup of tree history
file:///C:/Temp/2/.bzr has been backed up to file:///C:/Temp/2/backup.bzr
if conversion fails, you can move this directory back to .bzr
if it succeeds, you can remove this directory if you wish
starting repository conversion
bzr: ERROR: Revision {('<email address hidden>',)} not present in "<bzrlib.knit.KnitGraphIndex object at
 0x06136A70>".

The important part is 3rd commit. With 1 or 2 commits in the branch upgrade succeeds.

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 203607] [NEW] bzr unable to upgrade pack-0.92 to rich-root-pack format

Relevant part of .bzr.log:

0.381 encoding stdout as sys.stdout encoding 'cp866'
0.391 bzr arguments: [u'upgrade', u'--rich-root-pack']
0.391 looking for plugins in C:\work\Bazaar\plugins-repo
0.991 looking for plugins in C:/Program Files/Bazaar/plugins
1.262 encoding stdout as sys.stdout encoding 'cp866'
1.512 creating repository in file:///C:/Temp/2/.bzr/.
1.712 fetch up to rev {None}
1.803 Traceback (most recent call last):
   File "bzrlib\commands.pyc", line 834, in run_bzr_catch_errors
   File "bzrlib\commands.pyc", line 790, in run_bzr
   File "bzrlib\commands.pyc", line 492, in run_argv_aliases
   File "bzrlib\builtins.pyc", line 2460, in run
   File "bzrlib\upgrade.pyc", line 80, in upgrade
   File "bzrlib\upgrade.pyc", line 38, in __init__
   File "bzrlib\upgrade.pyc", line 66, in convert
   File "bzrlib\bzrdir.pyc", line 2353, in convert
   File "bzrlib\repository.pyc", line 3053, in convert
   File "bzrlib\repository.pyc", line 907, in copy_content_into
   File "bzrlib\decorators.pyc", line 165, in write_locked
   File "bzrlib\repository.pyc", line 2835, in copy_content
   File "bzrlib\repository.pyc", line 949, in fetch
   File "bzrlib\decorators.pyc", line 165, in write_locked
   File "bzrlib\repository.pyc", line 2814, in fetch
   File "bzrlib\fetch.pyc", line 389, in __init__
   File "bzrlib\fetch.pyc", line 109, in __init__
   File "bzrlib\fetch.pyc", line 139, in __fetch
   File "bzrlib\fetch.pyc", line 177, in _fetch_everything_for_search
   File "bzrlib\fetch.pyc", line 392, in _generate_root_texts
   File "bzrlib\fetch.pyc", line 367, in generate_root_texts
   File "bzrlib\versionedfile.pyc", line 122, in add_lines
   File "bzrlib\knit.pyc", line 990, in _add_lines
   File "bzrlib\knit.pyc", line 977, in _check_versions_present
   File "bzrlib\knit.pyc", line 1960, in check_versions_present
RevisionNotPresent: Revision {('<email address hidden>',)} not present in
"<bzrlib.knit.KnitGraphIndex object at 0x06136A70>".

1.803 return code 3

Revision history for this message
Alexander Belchenko (bialix) wrote :

Just checked: the same error with conversion from dirstate-tags format to rich-root-pack
or even simply rich-root.

Revision history for this message
John A Meinel (jameinel) wrote :

I boiled down your test case to:
bzr init
echo foo > spam
bzr add
bzr ci -m 1
echo bar > spam
bzr ci -m 2
echo boo > spam
bzr ci -m 3
bzr upgrade --rich-root-pack

And it succeeds with me.

However, if I switch it to commit 6 times, it fails again. I almost wonder if it isn't failing somewhere else, and then we are getting a second exception while doing cleanup, etc.
Specifically, because after it has failed, if I do "bzr log" I get the same exception, and it is because .bzr/repository/* is mostly empty because of the failed conversion (.bzr/repository.backup still has the old repository).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.