The diff is likely still a problem - here is a manual diff. === modified file 'NEWS' --- NEWS 2009-08-15 09:15:03 +0000 +++ NEWS 2009-08-17 23:19:17 +0000 @@ -9,6 +9,21 @@ In Development ############## +Compatibility Breaks +******************** + +* The default format for bzr is now ``2a``. This format brings many + significant performance and size improvements. bzr can pull from + any existing repository into a ``2a`` one, but can only transfer + into ``rich-root`` repositories from ``2a``. The Upgrade guide + has more information about this change. (Robert Collins) + +New Features +************ + +Bug Fixes +********* + Improvements ************ @@ -16,6 +31,18 @@ --version`` and ``bzr selftest``. (Martin Pool, #409137) +Documentation +************* + +API Changes +*********** + +Internals +********* + +Testing +******* + bzr 1.18 ######## @@ -58,6 +85,11 @@ * StreamSource generates rich roots from non-rich root sources correctly now. (Andrew Bennetts, #368921) +* When deciding whether a repository was compatible for upgrading or + fetching, we previously incorrectly checked the default repository + format for the bzrdir format, rather than the format that was actually + present on disk. (Martin Pool, #408824) + Improvements ************ @@ -105,8 +137,8 @@ can run the https tests. (Denys Duchier, #392401) -bzr 1.18 -######## +bzr 1.18rc1 +########### :Codename: little traveller :1.18rc1: 2009-08-10 === modified file 'bzrlib/branch.py' --- bzrlib/branch.py 2009-08-17 06:17:21 +0000 +++ bzrlib/branch.py 2009-08-17 06:19:20 +0000 @@ -2067,7 +2067,7 @@ BranchFormat.register_format(__format6) BranchFormat.register_format(__format7) BranchFormat.register_format(__format8) -BranchFormat.set_default_format(__format6) +BranchFormat.set_default_format(__format7) _legacy_formats = [BzrBranchFormat4(), ] network_format_registry.register( === modified file 'bzrlib/bzrdir.py' --- bzrlib/bzrdir.py 2009-08-17 06:17:21 +0000 +++ bzrlib/bzrdir.py 2009-08-17 07:47:50 +0000 @@ -130,8 +130,7 @@ def check_conversion_target(self, target_format): target_repo_format = target_format.repository_format - source_repo_format = self._format.repository_format - source_repo_format.check_conversion_target(target_repo_format) + self.open_repository()._format.check_conversion_target(target_repo_format) @staticmethod def _check_supported(format, allow_unsupported, @@ -3865,11 +3864,11 @@ # The following format should be an alias for the rich root equivalent # of the default format format_registry.register_metadir('default-rich-root', - 'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack4', - help='Default format, rich root variant. (needed for bzr-svn and bzr-git).', - branch_format='bzrlib.branch.BzrBranchFormat6', - tree_format='bzrlib.workingtree.WorkingTreeFormat4', + 'bzrlib.repofmt.groupcompress_repo.RepositoryFormat2a', + branch_format='bzrlib.branch.BzrBranchFormat7', + tree_format='bzrlib.workingtree.WorkingTreeFormat6', alias=True, - ) + help='Same as 2a.') + # The current format that is made on 'bzr init'. -format_registry.set_default('pack-0.92') +format_registry.set_default('2a') === modified file 'bzrlib/remote.py' --- bzrlib/remote.py 2009-08-14 09:31:37 +0000 +++ bzrlib/remote.py 2009-08-17 03:47:44 +0000 @@ -566,17 +566,6 @@ def __eq__(self, other): return self.__class__ is other.__class__ - def check_conversion_target(self, target_format): - if self.rich_root_data and not target_format.rich_root_data: - raise errors.BadConversionTarget( - 'Does not support rich root data.', target_format, - from_format=self) - if (self.supports_tree_reference and - not getattr(target_format, 'supports_tree_reference', False)): - raise errors.BadConversionTarget( - 'Does not support nested trees', target_format, - from_format=self) - def network_name(self): if self._network_name: return self._network_name === modified file 'bzrlib/repofmt/groupcompress_repo.py' --- bzrlib/repofmt/groupcompress_repo.py 2009-08-14 09:37:57 +0000 +++ bzrlib/repofmt/groupcompress_repo.py 2009-08-17 03:45:22 +0000 @@ -810,9 +810,15 @@ yield inventory.CHKInventory.deserialise(self.chk_bytes, texts[key], key) def _iter_inventory_xmls(self, revision_ids, ordering): - # Without a native 'xml' inventory, this method doesn't make sense, so - # make it raise to trap naughty direct users. - raise NotImplementedError(self._iter_inventory_xmls) + # Without a native 'xml' inventory, this method doesn't make sense. + # However older working trees, and older bundles want it - so we supply + # it allowing get_inventory_xml to work. Bundles currently use the + # serializer directly; this also isn't ideal, but there isn't an xml + # iteration interface offered at all for repositories. We could make + # _iter_inventory_xmls be part of the contract, even if kept private. + inv_to_str = self._serializer.write_inventory_to_string + for inv in self.iter_inventories(revision_ids, ordering): + yield inv_to_str(inv), inv.revision_id def _find_present_inventory_keys(self, revision_keys): parent_map = self.inventories.get_parent_map(revision_keys) === modified file 'bzrlib/repofmt/knitrepo.py' --- bzrlib/repofmt/knitrepo.py 2009-08-14 09:37:57 +0000 +++ bzrlib/repofmt/knitrepo.py 2009-08-17 03:47:44 +0000 @@ -424,9 +424,6 @@ """See RepositoryFormat.get_format_description().""" return "Knit repository format 1" - def check_conversion_target(self, target_format): - pass - class RepositoryFormatKnit3(RepositoryFormatKnit): """Bzr repository knit format 3. === modified file 'bzrlib/repofmt/pack_repo.py' --- bzrlib/repofmt/pack_repo.py 2009-08-14 09:37:57 +0000 +++ bzrlib/repofmt/pack_repo.py 2009-08-17 03:47:44 +0000 @@ -2529,9 +2529,6 @@ """See RepositoryFormat.get_format_description().""" return "Packs containing knits without subtree support" - def check_conversion_target(self, target_format): - pass - class RepositoryFormatKnitPack3(RepositoryFormatPack): """A subtrees parameterized Pack repository. @@ -2647,9 +2644,6 @@ """See RepositoryFormat.get_format_description().""" return "Packs 5 (adds stacking support, requires bzr 1.6)" - def check_conversion_target(self, target_format): - pass - class RepositoryFormatKnitPack5RichRoot(RepositoryFormatPack): """A repository with rich roots and stacking. @@ -2771,9 +2765,6 @@ """See RepositoryFormat.get_format_description().""" return "Packs 6 (uses btree indexes, requires bzr 1.9)" - def check_conversion_target(self, target_format): - pass - class RepositoryFormatKnitPack6RichRoot(RepositoryFormatPack): """A repository with rich roots, no subtrees, stacking and btree indexes. === modified file 'bzrlib/repofmt/weaverepo.py' --- bzrlib/repofmt/weaverepo.py 2009-04-09 20:23:07 +0000 +++ bzrlib/repofmt/weaverepo.py 2009-08-17 03:47:44 +0000 @@ -319,9 +319,6 @@ result.chk_bytes = None return result - def check_conversion_target(self, target_format): - pass - class RepositoryFormat4(PreSplitOutRepositoryFormat): """Bzr repository format 4. @@ -494,9 +491,6 @@ """See RepositoryFormat.get_format_description().""" return "Weave repository format 7" - def check_conversion_target(self, target_format): - pass - def _get_inventories(self, repo_transport, repo, name='inventory'): mapper = versionedfile.ConstantMapper(name) return versionedfile.ThunkedVersionedFiles(repo_transport, === modified file 'bzrlib/tests/blackbox/test_info.py' --- bzrlib/tests/blackbox/test_info.py 2009-08-14 13:55:30 +0000 +++ bzrlib/tests/blackbox/test_info.py 2009-08-17 03:40:53 +0000 @@ -37,11 +37,7 @@ def setUp(self): ExternalBase.setUp(self) - self._repo_strings = ( - "1.6 or 1.6.1-rich-root " - "or 1.9 or 1.9-rich-root " - "or dirstate or dirstate-tags or " - "pack-0.92 or rich-root or rich-root-pack") + self._repo_strings = "2a or development-subtree" def test_info_non_existing(self): if sys.platform == "win32": @@ -291,7 +287,7 @@ Format: control: Meta directory format 1 - working tree: Working tree format 4 + working tree: Working tree format 6 branch: Branch format 4 repository: Weave repository format 6 @@ -453,7 +449,7 @@ Format: control: Meta directory format 1 - working tree: Working tree format 4 + working tree: Working tree format 6 branch: Branch format 4 repository: Weave repository format 6 @@ -586,7 +582,7 @@ Format: control: Meta directory format 1 - working tree: Working tree format 4 + working tree: Working tree format 6 branch: %s repository: %s @@ -617,14 +613,14 @@ # Out of date checkout out, err = self.run_bzr('info -v tree/checkout') self.assertEqualDiff( -"""Checkout (format: dirstate) +"""Checkout (format: unnamed) Location: checkout root: tree/checkout checkout of branch: repo/branch Format: control: Meta directory format 1 - working tree: Working tree format 4 + working tree: Working tree format 6 branch: %s repository: %s @@ -656,14 +652,14 @@ tree3.add('b') out, err = self.run_bzr('info tree/checkout --verbose') self.assertEqualDiff( -"""Checkout (format: dirstate) +"""Checkout (format: unnamed) Location: checkout root: tree/checkout checkout of branch: repo/branch Format: control: Meta directory format 1 - working tree: Working tree format 4 + working tree: Working tree format 6 branch: %s repository: %s @@ -705,7 +701,7 @@ Format: control: Meta directory format 1 - working tree: Working tree format 4 + working tree: Working tree format 6 branch: %s repository: %s @@ -1131,7 +1127,7 @@ (False, False): 'Checkout', }[(shared_repo is not None, light_checkout)] format = {True: self._repo_strings, - False: 'dirstate'}[light_checkout] + False: 'unnamed'}[light_checkout] if repo_locked: repo_locked = lco_tree.branch.repository.get_physical_lock_status() if repo_locked or branch_locked or tree_locked: === modified file 'bzrlib/tests/blackbox/test_init.py' --- bzrlib/tests/blackbox/test_init.py 2009-08-12 21:58:32 +0000 +++ bzrlib/tests/blackbox/test_init.py 2009-08-12 22:15:57 +0000 @@ -35,7 +35,7 @@ def setUp(self): ExternalBase.setUp(self) - self._default_label = 'pack-0.92' + self._default_label = '2a' def test_init_with_format(self): # Verify bzr init --format constructs something plausible === modified file 'bzrlib/tests/blackbox/test_shared_repository.py' --- bzrlib/tests/blackbox/test_shared_repository.py 2009-03-23 14:59:43 +0000 +++ bzrlib/tests/blackbox/test_shared_repository.py 2009-08-12 23:52:09 +0000 @@ -27,7 +27,7 @@ def test_make_repository(self): out, err = self.run_bzr("init-repository a") self.assertEqual(out, -"""Shared repository with trees (format: pack-0.92) +"""Shared repository with trees (format: 2a) Location: shared repository: a """) === modified file 'bzrlib/tests/per_repository/test_add_fallback_repository.py' --- bzrlib/tests/per_repository/test_add_fallback_repository.py 2009-03-23 14:59:43 +0000 +++ bzrlib/tests/per_repository/test_add_fallback_repository.py 2009-08-13 05:16:31 +0000 @@ -29,14 +29,7 @@ class TestAddFallbackRepository(TestCaseWithRepository): def test_add_fallback_repository(self): - if isinstance(self.repository_format, remote.RemoteRepositoryFormat): - # RemoteRepository by default builds a default format real - # repository, but the default format is unstackble. So explicitly - # make a stackable real repository and use that. - repo = self.make_repository('repo', format='1.9') - repo = bzrdir.BzrDir.open(self.get_url('repo')).open_repository() - else: - repo = self.make_repository('repo') + repo = self.make_repository('repo') tree = self.make_branch_and_tree('branch') if not repo._format.supports_external_lookups: self.assertRaises(errors.UnstackableRepositoryFormat, === modified file 'bzrlib/tests/per_repository/test_repository.py' --- bzrlib/tests/per_repository/test_repository.py 2009-06-26 09:24:34 +0000 +++ bzrlib/tests/per_repository/test_repository.py 2009-08-17 21:43:56 +0000 @@ -929,8 +929,14 @@ transport.mkdir('.') target_bzrdir = bzrdir_format.initialize_on_transport(transport) branch = BzrBranchFormat6().initialize(target_bzrdir) - #branch = self.make_branch('repo/branch', format='pack-0.92') - self.make_branch('stack-on-me') + if not repo.supports_rich_root(): + stack_on_format = "pack-0.92" + else: + if repo._format.supports_chks: + stack_on_format = "2a" + else: + stack_on_format = "1.9-rich-root" + self.make_branch('stack-on-me', format=stack_on_format) self.make_bzrdir('.').get_config().set_default_stack_on('stack-on-me') target = branch.bzrdir.clone(self.get_url('target')) # The target branch supports stacking if the source repository does. === modified file 'bzrlib/tests/test_branch.py' --- bzrlib/tests/test_branch.py 2009-07-10 05:49:34 +0000 +++ bzrlib/tests/test_branch.py 2009-08-17 21:12:19 +0000 @@ -40,6 +40,7 @@ BzrBranch5, BzrBranchFormat5, BzrBranchFormat6, + BzrBranchFormat7, PullResult, _run_with_write_locked_target, ) @@ -60,7 +61,7 @@ def test_default_format(self): # update this if you change the default branch format self.assertIsInstance(BranchFormat.get_default_format(), - BzrBranchFormat6) + BzrBranchFormat7) def test_default_format_is_same_as_bzrdir_default(self): # XXX: it might be nice if there was only one place the default was === modified file 'bzrlib/tests/test_dirstate.py' --- bzrlib/tests/test_dirstate.py 2009-07-15 01:13:20 +0000 +++ bzrlib/tests/test_dirstate.py 2009-08-17 03:33:36 +0000 @@ -419,7 +419,7 @@ (('', '', tree.get_root_id()), # common details [('d', '', 0, False, dirstate.DirState.NULLSTAT), # current tree ('d', '', 0, False, rev_id), # first parent details - ('d', '', 0, False, rev_id2), # second parent details + ('d', '', 0, False, rev_id), # second parent details ])]) state = dirstate.DirState.from_tree(tree, 'dirstate') self.check_state_with_reopen(expected_result, state) @@ -500,7 +500,7 @@ (('', '', tree.get_root_id()), # common details [('d', '', 0, False, dirstate.DirState.NULLSTAT), # current tree ('d', '', 0, False, rev_id), # first parent details - ('d', '', 0, False, rev_id2), # second parent details + ('d', '', 0, False, rev_id), # second parent details ]), (('', 'a file', 'a-file-id'), # common [('f', '', 0, False, dirstate.DirState.NULLSTAT), # current @@ -1000,7 +1000,7 @@ [(('', '', root_id), [ ('d', '', 0, False, dirstate.DirState.NULLSTAT), ('d', '', 0, False, revid1), - ('d', '', 0, False, revid2) + ('d', '', 0, False, revid1) ])], list(state._iter_entries())) finally: @@ -1034,7 +1034,7 @@ (('', '', root_id), [ ('d', '', 0, False, dirstate.DirState.NULLSTAT), ('d', '', 0, False, revid1.encode('utf8')), - ('d', '', 0, False, revid2.encode('utf8')) + ('d', '', 0, False, revid1.encode('utf8')) ]), (('', 'a file', 'file-id'), [ ('a', '', 0, False, ''), === modified file 'bzrlib/tests/test_foreign.py' --- bzrlib/tests/test_foreign.py 2009-08-14 04:30:32 +0000 +++ bzrlib/tests/test_foreign.py 2009-08-17 07:51:55 +0000 @@ -320,7 +320,7 @@ foreign.update_workingtree_fileids(wt, target_basis) wt.lock_read() try: - self.assertEquals([root_id, "bla-b"], list(wt.inventory)) + self.assertEquals(set([root_id, "bla-b"]), set(wt.inventory)) finally: wt.unlock() === modified file 'bzrlib/tests/test_log.py' --- bzrlib/tests/test_log.py 2009-08-17 19:31:29 +0000 +++ bzrlib/tests/test_log.py 2009-08-17 23:00:40 +0000 @@ -142,6 +142,9 @@ lf = LogCatcher() log.show_log(wt.branch, lf, verbose=True) committed_msg = lf.revisions[0].rev.message + if msg == committed_msg: + raise tests.KnownFailure( + "Commit message was preserved, but it wasn't expected to be.") self.assertNotEqual(msg, committed_msg) self.assertTrue(len(committed_msg) > len(msg)) === modified file 'bzrlib/tests/test_remote.py' --- bzrlib/tests/test_remote.py 2009-08-14 00:55:42 +0000 +++ bzrlib/tests/test_remote.py 2009-08-17 21:21:36 +0000 @@ -661,8 +661,9 @@ network_name = reference_format.network_name() client.add_expected_call( 'BzrDir.create_repository', ('quack/', - 'Bazaar pack repository format 1 (needs bzr 0.92)\n', 'False'), - 'success', ('ok', 'no', 'no', 'no', network_name)) + 'Bazaar repository format 2a (needs bzr 1.16 or later)\n', + 'False'), + 'success', ('ok', 'yes', 'yes', 'yes', network_name)) a_bzrdir = RemoteBzrDir(transport, remote.RemoteBzrDirFormat(), _client=client) repo = a_bzrdir.create_repository() @@ -670,9 +671,9 @@ self.assertIsInstance(repo, remote.RemoteRepository) # its format should have the settings from the response format = repo._format - self.assertFalse(format.rich_root_data) - self.assertFalse(format.supports_tree_reference) - self.assertFalse(format.supports_external_lookups) + self.assertTrue(format.rich_root_data) + self.assertTrue(format.supports_tree_reference) + self.assertTrue(format.supports_external_lookups) self.assertEqual(network_name, format.network_name()) @@ -2354,6 +2355,7 @@ """ # Define a stream using generators so that it isn't rewindable. inv = inventory.Inventory(revision_id='rev1') + inv.root.revision = 'rev1' def stream_with_inv_delta(): yield ('inventories', inventories_substream()) yield ('inventory-deltas', inventory_delta_substream()) === modified file 'bzrlib/tests/test_selftest.py' --- bzrlib/tests/test_selftest.py 2009-08-15 09:15:03 +0000 +++ bzrlib/tests/test_selftest.py 2009-08-17 03:40:04 +0000 @@ -40,6 +40,7 @@ workingtree, ) from bzrlib.repofmt import ( + groupcompress_repo, pack_repo, weaverepo, ) @@ -215,24 +216,24 @@ from bzrlib.tests.per_repository import formats_to_scenarios formats = [("(c)", remote.RemoteRepositoryFormat()), ("(d)", repository.format_registry.get( - 'Bazaar pack repository format 1 (needs bzr 0.92)\n'))] + 'Bazaar repository format 2a (needs bzr 1.16 or later)\n'))] no_vfs_scenarios = formats_to_scenarios(formats, "server", "readonly", None) vfs_scenarios = formats_to_scenarios(formats, "server", "readonly", vfs_transport_factory="vfs") # no_vfs generate scenarios without vfs_transport_factory - self.assertEqual([ + expected = [ ('RemoteRepositoryFormat(c)', {'bzrdir_format': remote.RemoteBzrDirFormat(), 'repository_format': remote.RemoteRepositoryFormat(), 'transport_readonly_server': 'readonly', 'transport_server': 'server'}), - ('RepositoryFormatKnitPack1(d)', + ('RepositoryFormat2a(d)', {'bzrdir_format': bzrdir.BzrDirMetaFormat1(), - 'repository_format': pack_repo.RepositoryFormatKnitPack1(), + 'repository_format': groupcompress_repo.RepositoryFormat2a(), 'transport_readonly_server': 'readonly', - 'transport_server': 'server'})], - no_vfs_scenarios) + 'transport_server': 'server'})] + self.assertEqual(expected, no_vfs_scenarios) self.assertEqual([ ('RemoteRepositoryFormat(c)', {'bzrdir_format': remote.RemoteBzrDirFormat(), @@ -240,9 +241,9 @@ 'transport_readonly_server': 'readonly', 'transport_server': 'server', 'vfs_transport_factory': 'vfs'}), - ('RepositoryFormatKnitPack1(d)', + ('RepositoryFormat2a(d)', {'bzrdir_format': bzrdir.BzrDirMetaFormat1(), - 'repository_format': pack_repo.RepositoryFormatKnitPack1(), + 'repository_format': groupcompress_repo.RepositoryFormat2a(), 'transport_readonly_server': 'readonly', 'transport_server': 'server', 'vfs_transport_factory': 'vfs'})], === modified file 'bzrlib/tests/test_smart.py' --- bzrlib/tests/test_smart.py 2009-08-17 20:53:59 +0000 +++ bzrlib/tests/test_smart.py 2009-08-17 23:00:40 +0000 @@ -456,7 +456,7 @@ def test_stacked_branch(self): """Opening a stacked branch does not open the stacked-on branch.""" trunk = self.make_branch('trunk') - feature = self.make_branch('feature', format='1.9') + feature = self.make_branch('feature') feature.set_stacked_on_url(trunk.base) opened_branches = [] Branch.hooks.install_named_hook('open', opened_branches.append, None) === modified file 'bzrlib/tests/test_version_info.py' --- bzrlib/tests/test_version_info.py 2009-04-06 02:54:14 +0000 +++ bzrlib/tests/test_version_info.py 2009-08-12 21:26:59 +0000 @@ -148,12 +148,11 @@ stanza = regen(check_for_clean=True, include_file_revisions=True) self.assertEqual(['False'], stanza.get_all('clean')) - # XXX: This assumes it's being run against a repository that updates - # the root revision on every commit. Newer ones that use - # RootCommitBuilder won't update it on each commit. + # This assumes it's being run against a tree that does not update the + # root revision on every commit. file_rev_stanza = get_one_stanza(stanza, 'file-revisions') self.assertEqual(['', 'a', 'b', 'c'], file_rev_stanza.get_all('path')) - self.assertEqual(['r3', 'r3', 'r2', 'unversioned'], + self.assertEqual(['r1', 'r3', 'r2', 'unversioned'], file_rev_stanza.get_all('revision')) os.remove('branch/c') @@ -171,7 +170,7 @@ file_rev_stanza = get_one_stanza(stanza, 'file-revisions') self.assertEqual(['', 'a', 'b', 'c', 'd'], file_rev_stanza.get_all('path')) - self.assertEqual(['r3', 'modified', 'renamed to d', 'new', + self.assertEqual(['r1', 'modified', 'renamed to d', 'new', 'renamed from b'], file_rev_stanza.get_all('revision')) @@ -181,7 +180,7 @@ stanza = regen(check_for_clean=True, include_file_revisions=True) file_rev_stanza = get_one_stanza(stanza, 'file-revisions') self.assertEqual(['', 'a', 'c', 'd'], file_rev_stanza.get_all('path')) - self.assertEqual(['r4', 'r4', 'unversioned', 'removed'], + self.assertEqual(['r1', 'r4', 'unversioned', 'removed'], file_rev_stanza.get_all('revision')) def test_python_null(self): === modified file 'bzrlib/workingtree.py' --- bzrlib/workingtree.py 2009-08-04 04:36:34 +0000 +++ bzrlib/workingtree.py 2009-08-14 02:43:19 +0000 @@ -1893,8 +1893,8 @@ firstline = xml.split('\n', 1)[0] if (not 'revision_id="' in firstline or 'format="7"' not in firstline): - inv = self.branch.repository.deserialise_inventory( - new_revision, xml) + inv = self.branch.repository._serializer.read_inventory_from_string( + xml, new_revision) xml = self._create_basis_xml_from_inventory(new_revision, inv) self._write_basis_inventory(xml) except (errors.NoSuchRevision, errors.RevisionNotPresent): @@ -3030,10 +3030,10 @@ return self.get_format_string() -__default_format = WorkingTreeFormat4() +__default_format = WorkingTreeFormat6() WorkingTreeFormat.register_format(__default_format) -WorkingTreeFormat.register_format(WorkingTreeFormat6()) WorkingTreeFormat.register_format(WorkingTreeFormat5()) +WorkingTreeFormat.register_format(WorkingTreeFormat4()) WorkingTreeFormat.register_format(WorkingTreeFormat3()) WorkingTreeFormat.set_default_format(__default_format) # formats which have no format string are not discoverable