test_upgrade_up_to_date fails in 2a with "Cannot convert from format Branch format 7 to format <class 'bzrlib.branch.BzrBranchFormat6'>."

Bug #413541 reported by Martin Pool
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Martin Pool

Bug Description

Follow-on from bug 408824:

FAIL: test_upgrade_up_to_date (bzrlib.tests.blackbox.test_upgrade.TestWithUpgradableBranches)

vvvv[log from bzrlib.tests.blackbox.test_upgrade.TestWithUpgradableBranches.test_upgrade_up_to_date]
5.556 creating repository in file:///tmp/testbzr-uX2AvT.tmp/bzrlib.tests.blackbox.test_upgrade.TestWithUpgradableBranches.test_upgrade_up_to_date/work/current_format_branch/.bzr/.
5.562 creating branch <bzrlib.branch.BzrBranchFormat7 object at 0xbb10aac> in file:///tmp/testbzr-uX2AvT.tmp/bzrlib.tests.blackbox.test_upgrade.TestWithUpgradableBranches.test_upgrade_up_to_date/work/current_format_branch/.bzr/
5.578 trying to create missing lock '/tmp/testbzr-uX2AvT.tmp/bzrlib.tests.blackbox.test_upgrade.TestWithUpgradableBranches.test_upgrade_up_to_date/work/current_format_branch/.bzr/checkout/dirstate'
5.578 opening working tree '/tmp/testbzr-uX2AvT.tmp/bzrlib.tests.blackbox.test_upgrade.TestWithUpgradableBranches.test_upgrade_up_to_date/work/current_format_branch'
5.593 opening working tree '/tmp/testbzr-uX2AvT.tmp/bzrlib.tests.blackbox.test_upgrade.TestWithUpgradableBranches.test_upgrade_up_to_date/work/current_format_branch'
5.596 creating branch reference in file:///tmp/testbzr-uX2AvT.tmp/bzrlib.tests.blackbox.test_upgrade.TestWithUpgradableBranches.test_upgrade_up_to_date/work/current_format_checkout/.bzr/
5.605 trying to create missing lock '/tmp/testbzr-uX2AvT.tmp/bzrlib.tests.blackbox.test_upgrade.TestWithUpgradableBranches.test_upgrade_up_to_date/work/current_format_checkout/.bzr/checkout/dirstate'
5.605 opening working tree '/tmp/testbzr-uX2AvT.tmp/bzrlib.tests.blackbox.test_upgrade.TestWithUpgradableBranches.test_upgrade_up_to_date/work/current_format_checkout'
5.614 run bzr: ['upgrade', 'current_format_branch']
5.615 bzr arguments: ['upgrade', 'current_format_branch']
5.618 encoding stdout as sys.stdout encoding 'UTF-8'
5.643 creating repository in file:///tmp/testbzr-uX2AvT.tmp/bzrlib.tests.blackbox.test_upgrade.TestWithUpgradableBranches.test_upgrade_up_to_date/work/current_format_branch/.bzr/.
5.655 Traceback (most recent call last):
  File "/home/mbp/bzr/408824-test-upgrade/bzrlib/commands.py", line 1131, in run_bzr_catch_user_errors
    return run_bzr(argv)
  File "/home/mbp/bzr/408824-test-upgrade/bzrlib/commands.py", line 1030, in run_bzr
    ret = run(*run_argv)
  File "/home/mbp/bzr/408824-test-upgrade/bzrlib/commands.py", line 647, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/mbp/bzr/408824-test-upgrade/bzrlib/builtins.py", line 3140, in run
    upgrade(url, format)
  File "/home/mbp/bzr/408824-test-upgrade/bzrlib/upgrade.py", line 85, in upgrade
    Convert(url, format)
  File "/home/mbp/bzr/408824-test-upgrade/bzrlib/upgrade.py", line 40, in __init__
    self.convert()
  File "/home/mbp/bzr/408824-test-upgrade/bzrlib/upgrade.py", line 79, in convert
    self.bzrdir = converter.convert(self.bzrdir, self.pb)
  File "/home/mbp/bzr/408824-test-upgrade/bzrlib/bzrdir.py", line 3042, in convert
    branch._format)
BadConversionTarget: Cannot convert from format Branch format 7 to format <class 'bzrlib.branch.BzrBranchFormat6'>. No converter

5.655 output:
'starting upgrade of file:///tmp/testbzr-uX2AvT.tmp/bzrlib.tests.blackbox.test_upgrade.TestWithUpgradableBranches.test_upgrade_up_to_date/work/current_format_branch/\nmaking backup of file:///tmp/testbzr-uX2AvT.tmp/bzrlib.tests.blackbox.test_upgrade.TestWithUpgradableBranches.test_upgrade_up_to_date/work/current_format_branch/.bzr\n to file:///tmp/testbzr-uX2AvT.tmp/bzrlib.tests.blackbox.test_upgrade.TestWithUpgradableBranches.test_upgrade_up_to_date/work/current_format_branch/backup.bzr\nstarting repository conversion\nrepository converted\n'
5.655 errors:
"bzr: ERROR: Cannot convert from format Branch format 7 to format <class 'bzrlib.branch.BzrBranchFormat6'>. No converter\n"
5.665 opening working tree '/tmp/testbzr-uX2AvT.tmp'

^^^^[log from bzrlib.tests.blackbox.test_upgrade.TestWithUpgradableBranches.test_upgrade_up_to_date]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mbp/bzr/408824-test-upgrade/bzrlib/tests/blackbox/test_upgrade.py", line 76, in test_upgrade_up_to_date
    self.assertEqual("", out)
AssertionError: not equal:
a = ''
b = 'starting upgrade of file:///tmp/testbzr-uX2AvT.tmp/bzrlib.tests.blackbox.test_upgrade.TestWithUpgradableBranches.test_upgrade_up_to_date/work/current_format_branch/\nmaking backup of file:///tmp/testbzr-uX2AvT.tmp/bzrlib.tests.blackbox.test_upgrade.TestWithUpgradableBranches.test_upgrade_up_to_date/work/current_format_branch/.bzr\n to file:///tmp/testbzr-uX2AvT.tmp/bzrlib.tests.blackbox.test_upgrade.TestWithUpgradableBranches.test_upgrade_up_to_date/work/current_format_branch/backup.bzr\nstarting repository conversion\nrepository converted\n'

Tags: upgrade
Revision history for this message
Martin Pool (mbp) wrote :

This too can be reproduced interactively

mbp@lithe% ./bzr init /tmp/aa
default2a plugin set default format to 2a
Created a standalone tree (format: 2a)
mbp@lithe% ./bzr upgrade /tmp/aa
default2a plugin set default format to 2a
starting upgrade of file:///tmp/aa/
making backup of file:///tmp/aa/.bzr
  to file:///tmp/aa/backup.bzr
starting repository conversion
repository converted
bzr: ERROR: Cannot convert from format Branch format 7 to format <class 'bzrlib.branch.BzrBranchFormat6'>. No converter

but not when the format is explicitly specified

mbp@lithe% bzr -Dno_default2a init --2a /tmp/a2
Created a standalone tree (format: 2a)
mbp@lithe% bzr -Dno_default2a upgrade --2a /tmp/a2
bzr: ERROR: The branch format Meta directory format 1 is already at the most recent format.

It should be branch 7 here so the question is why is it trying to go back to branch 6?

  File "/home/mbp/bzr/408824-test-upgrade/bzrlib/commands.py", line 835, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/home/mbp/bzr/408824-test-upgrade/bzrlib/commands.py", line 1030, in run_bzr
    ret = run(*run_argv)
  File "/home/mbp/bzr/408824-test-upgrade/bzrlib/commands.py", line 647, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/mbp/bzr/408824-test-upgrade/bzrlib/builtins.py", line 3140, in run
    upgrade(url, format)
  File "/home/mbp/bzr/408824-test-upgrade/bzrlib/upgrade.py", line 85, in upgrade
    Convert(url, format)
  File "/home/mbp/bzr/408824-test-upgrade/bzrlib/upgrade.py", line 40, in __init__
    self.convert()
  File "/home/mbp/bzr/408824-test-upgrade/bzrlib/upgrade.py", line 79, in convert
    self.bzrdir = converter.convert(self.bzrdir, self.pb)
  File "/home/mbp/bzr/408824-test-upgrade/bzrlib/bzrdir.py", line 3042, in convert
    branch._format)
BadConversionTarget: Cannot convert from format Branch format 7 to format <class 'bzrlib.branch.BzrBranchFormat6'>. No converter

The format being passed in as the conversion target has branch format 6.

upgrade.py has some special code to use default-rich-root and I think my plugin isn't correctly updating that.

Revision history for this message
Martin Pool (mbp) wrote :

The same failure seems to occur in Robert's branch, but maybe he forgot to change this too.

With my default2a plugin changed to register default-rich-root, this problem goes away.

Revision history for this message
Martin Pool (mbp) wrote :

That does fix it; I've pushed it into my bug 398668 branch.

Changed in bzr:
status: In Progress → Fix Committed
Changed in bzr:
status: Fix Committed → Fix Released
milestone: none → 2.0
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.