reconfigure --standalone raises IncompatibleRepositories

Bug #248932 reported by Martin von Gagern
14
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Martin von Gagern

Bug Description

$ bzr init-repo --rich-root-pack repo
$ cd repo
$ bzr init branch
$ cd branch
$ bzr reconfigure --standalone
bzr: ERROR: Repository KnitPackRepository('file://.../repo/branch/.bzr/repository/') is not compatible with repository KnitPackRepository('file://.../repo/.bzr/repository/')

bzr version: bzr.dev r3542 (1.6b3).
Same problem for --rich-root, but not for --pack-0.92.
Seems to make no difference whether the branch has seen any commits or not.
State of the branch seems to be standalone afterwards, but I'm not sure everything got migrated.

Related branches

Revision history for this message
Martin von Gagern (gagern) wrote :

I've got a backtrace for you:

bzrlib/commands.py(848)main()
-> ret = run_bzr_catch_errors(argv)
bzrlib/commands.py(857)run_bzr_catch_errors()
-> return run_bzr(argv)
bzrlib/commands.py(797)run_bzr()
-> ret = run(*run_argv)
bzrlib/commands.py(499)run_argv_aliases()
-> return self.run(**all_cmd_args)
bzrlib/builtins.py(4417)run()
-> reconfiguration.apply(force)
bzrlib/reconfigure.py(258)apply()
-> self.local_branch.last_revision())
bzrlib/repository.py(963)fetch()
-> raise errors.IncompatibleRepositories(source, self)

I did some more debugging. The immediate cause seems to be a NotImplementedError raised by InterRepository.fetch, which is due to the lack of a specialized InterRepository provider, which in turn is due to the fact that the _same_model check fails because source.supports_rich_root() == True but target.supports_rich_root() == False.

Revision history for this message
Martin von Gagern (gagern) wrote :

The reconfiguration was indeed not successful, as I just found out while trying to revert on the working copy I had tried to reconfigure before. This can be reproduced as follows:

$ bzr init-repo --rich-root-pack repo
$ cd repo
$ bzr init branch
$ cd branch
$ echo foo > file
$ bzr add
$ bzr ci -m r1
$ bzr reconfigure --standalone
(errors as described above)
$ echo bar > file
$ bzr revert
bzr: ERROR: bzrlib.errors.NoSuchRevision: KnitPackRepository('file://.../repo/branch/.bzr/repository/') has no revision ('...',)

Traceback (most recent call last):
  File "bzr.dev/bzrlib/commands.py", line 857, in run_bzr_catch_errors
    return run_bzr(argv)
  File "bzr.dev/bzrlib/commands.py", line 797, in run_bzr
    ret = run(*run_argv)
  File "bzr.dev/bzrlib/commands.py", line 499, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "bzr.dev/bzrlib/builtins.py", line 3147, in run
    self._revert_tree_to_revision(tree, revision, file_list, no_backup)
  File "bzr.dev/bzrlib/builtins.py", line 3160, in _revert_tree_to_revision
    tree.branch.repository.revision_tree(rev_id),
  File "bzr.dev/bzrlib/decorators.py", line 138, in read_locked
    result = unbound(self, *args, **kwargs)
  File "bzr.dev/bzrlib/repository.py", line 1652, in revision_tree
    inv = self.get_revision_inventory(revision_id)
  File "bzr.dev/bzrlib/decorators.py", line 138, in read_locked
    result = unbound(self, *args, **kwargs)
  File "bzr.dev/bzrlib/repository.py", line 1615, in get_revision_inventory
    return self.get_inventory(revision_id)
  File "bzr.dev/bzrlib/decorators.py", line 138, in read_locked
    result = unbound(self, *args, **kwargs)
  File "bzr.dev/bzrlib/repository.py", line 1508, in get_inventory
    return self.iter_inventories([revision_id]).next()
  File "bzr.dev/bzrlib/repository.py", line 1526, in _iter_inventories
    for text, revision_id in self._iter_inventory_xmls(revision_ids):
  File "bzr.dev/bzrlib/repository.py", line 1537, in _iter_inventory_xmls
    raise errors.NoSuchRevision(self, record.key)
NoSuchRevision: KnitPackRepository('file://.../repo/branch/.bzr/repository/') has no revision ('...',)

bzr 1.6b3 on python 2.5.2 (linux2)
arguments: ['bzr.dev/bzr', 'revert']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'de_DE.utf8'
plugins:
  bzrtools site-packages/bzrlib/plugins/bzrtools [1.6.0]
  launchpad bzr.dev/bzrlib/plugins/launchpad [unknown]
  svn $HOME/.bazaar/plugins/svn [0.4.11exp0]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.

I consider the problem quite serious, as it can severely damage a branch. Unless you have backups around, this could cause serious trouble. Thus I suggest an increase to the importance of this issue.

Revision history for this message
James Westby (james-w) wrote :

Hi,

I imagine that this fails as the default format is selected,
when it should be a compatible one.

Perhaps selecting the same format is the way to ensure that
the repositories will be compatible.

Thanks,

James

Changed in bzr:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
James Westby (james-w) wrote :

I chose High importance, as you state that this breaks the branch.

Revision history for this message
James Westby (james-w) wrote :

bug 268469 indicates that this happens for reconfigure --branch
in a checkout as well.

Thanks,

James

Revision history for this message
pdf23ds (pdf23ds) wrote :

I experienced this bug too, in the process of an import (custom written). Fortunately, it was after a split, so I didn't lose anything.

Vincent Ladeuil (vila)
Changed in bzr:
assignee: nobody → Martin von Gagern (gagern)
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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