So in the case of upgrade_explicit_knit, the strange thing is that the source directory does in fact seem to contain weaves, so I'm not sure why it's complaining
BadConversionTarget: Cannot convert from format <RepositoryFormat2a> to format <RepositoryFormatKnit1>. Does not support rich root data.
I can reproduce this interactively:
mbp@lithe% ./bzr init --metaweave /tmp/meta
default2a plugin set default format to 2a
Format <RepositoryFormat7> for file:///tmp/meta/.bzr/ is deprecated - please use 'bzr upgrade' to get better performance
Created a standalone tree (format: metaweave)
mbp@lithe% ./bzr info /tmp/meta
default2a plugin set default format to 2a
Format <RepositoryFormat7> for file:///tmp/meta/.bzr/ is deprecated - please use 'bzr upgrade' to get better performance
Standalone tree (format: metaweave)
Location:
branch root: /tmp/meta
mbp@lithe% ./bzr upgrade --knit /tmp/meta
default2a plugin set default format to 2a
Format <RepositoryFormat7> for file:///tmp/meta/.bzr/ is deprecated - please use 'bzr upgrade' to get better performance
bzr: ERROR: Cannot convert from format <RepositoryFormat2a> to format <RepositoryFormatKnit1>. Does not support rich root data.
however with the default2a plugin removed, it succeeds.
The problem seems to be that the BzrDirFormat object for the source doesn't reflect the formats that are actually present:
(Pdb) l
130
131 def check_conversion_target(self, target_format):
132 target_repo_format = target_format.repository_format
133 source_repo_format = self._format.repository_format
134 import pdb;pdb.set_trace()
135 -> source_repo_format.check_conversion_target(target_repo_format)
136
137 @staticmethod
138 def _check_supported(format, allow_unsupported,
139 recommend_upgrade=True,
140 basedir=None):
(Pdb) p source_repo_format
<bzrlib.repofmt.groupcompress_repo.RepositoryFormat2a object at 0xa2a212c>
(Pdb) p self
<bzrlib.bzrdir.BzrDirMeta1 object at 0xb798ca0c>
(Pdb) p self._format
<bzrlib.bzrdir.BzrDirMetaFormat1 object at 0xa257d6c>
(Pdb) p self._format.repository_format
<bzrlib.repofmt.groupcompress_repo.RepositoryFormat2a object at 0xa350bec>
(Pdb) p self.open_repository()
WeaveMetaDirRepository('file:///tmp/meta/.bzr/repository/')
(Pdb) p self.open_repository()._format
<bzrlib.repofmt.weaverepo.RepositoryFormat7 object at 0xa350ecc>
I suspect that line 133 should be asking what format is actually there - or indeed perhaps this whole thing should be delegated to the source repository object.
There are several check_conversion_target methods on random RepositoryFormats and I suspect they shouldn't be overriding to remove the checks.
So in the case of upgrade_ explicit_ knit, the strange thing is that the source directory does in fact seem to contain weaves, so I'm not sure why it's complaining
BadConversionTa rget: Cannot convert from format <RepositoryForm at2a> to format <RepositoryForm atKnit1> . Does not support rich root data.
I can reproduce this interactively:
mbp@lithe% ./bzr init --metaweave /tmp/meta /tmp/meta/ .bzr/ is deprecated - please use 'bzr upgrade' to get better performance /tmp/meta/ .bzr/ is deprecated - please use 'bzr upgrade' to get better performance /tmp/meta/ .bzr/ is deprecated - please use 'bzr upgrade' to get better performance at2a> to format <RepositoryForm atKnit1> . Does not support rich root data.
default2a plugin set default format to 2a
Format <RepositoryFormat7> for file://
Created a standalone tree (format: metaweave)
mbp@lithe% ./bzr info /tmp/meta
default2a plugin set default format to 2a
Format <RepositoryFormat7> for file://
Standalone tree (format: metaweave)
Location:
branch root: /tmp/meta
mbp@lithe% ./bzr upgrade --knit /tmp/meta
default2a plugin set default format to 2a
Format <RepositoryFormat7> for file://
bzr: ERROR: Cannot convert from format <RepositoryForm
however with the default2a plugin removed, it succeeds.
The problem seems to be that the BzrDirFormat object for the source doesn't reflect the formats that are actually present:
(Pdb) l n_target( self, target_format): format. repository_ format repository_ format repo_format. check_conversio n_target( target_ repo_format) supported( format, allow_unsupported, upgrade= True, repofmt. groupcompress_ repo.Repository Format2a object at 0xa2a212c> bzrdir. BzrDirMeta1 object at 0xb798ca0c> bzrdir. BzrDirMetaForma t1 object at 0xa257d6c> repository_ format repofmt. groupcompress_ repo.Repository Format2a object at 0xa350bec> repository( ) ository( 'file:/ //tmp/meta/ .bzr/repository /') repository( )._format repofmt. weaverepo. RepositoryForma t7 object at 0xa350ecc>
130
131 def check_conversio
132 target_repo_format = target_
133 source_repo_format = self._format.
134 import pdb;pdb.set_trace()
135 -> source_
136
137 @staticmethod
138 def _check_
139 recommend_
140 basedir=None):
(Pdb) p source_repo_format
<bzrlib.
(Pdb) p self
<bzrlib.
(Pdb) p self._format
<bzrlib.
(Pdb) p self._format.
<bzrlib.
(Pdb) p self.open_
WeaveMetaDirRep
(Pdb) p self.open_
<bzrlib.
I suspect that line 133 should be asking what format is actually there - or indeed perhaps this whole thing should be delegated to the source repository object.
There are several check_conversio n_target methods on random RepositoryFormats and I suspect they shouldn't be overriding to remove the checks.