Merge lp:~mbp/bzr/385103-format-name into lp:~bzr/bzr/trunk-old

Proposed by Martin Pool
Status: Merged
Merged at revision: not available
Proposed branch: lp:~mbp/bzr/385103-format-name
Merge into: lp:~bzr/bzr/trunk-old
Diff against target: 118 lines
To merge this branch: bzr merge lp:~mbp/bzr/385103-format-name
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+7321@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

This patch gets 2a ready for wider testing, and takes the position we will try for no more format changes before 2.0.

* adds a new format with an on-disk and command-line name of "2a"
* adds some text to NEWS about the format - comments on this are particularly welcome

We want somewhat wider testing but we're not yet confident that everyone should switch: we want to ramp up usage, and we still know of some cases that are slow. So I'm promoting this from development7

It would still be good to do this, but I haven't yet:

* add a special fast path for upgrading development7 to 2a - there are probably so few users that they can change it themselves
* stop --format creating special options for every format; it looks a bit awful

Revision history for this message
Robert Collins (lifeless) wrote :

Needs a paragraph about the cascading effect of using this with 'normal' formats. YOu have the content already but only experts will understand it.

The help for the format in bzrdir is far to detail orientated - how about
"New format for 2.0. Uses rich roots > can be converted to, but not converted from."

Revision history for this message
Robert Collins (lifeless) wrote :

Bug https://bugs.edge.launchpad.net/bzr/+bug/374735 documents how hard it is for projects to upgrade to rich roots today. I really don't think encouraging widespread testing until we've address the issues it highlights is wise. I'm making bugs for the individual issues at the moment.

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

I don't think we needed a separate format from the existing RepositoryFormatCHK2. It has only been around ~ 1 week, so there shouldn't be many people using it that would have trouble switching.

However, the rest looks good to me, though obviously Robert had some doubts.

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

> I don't think we needed a separate format from the existing
> RepositoryFormatCHK2. It has only been around ~ 1 week, so there shouldn't be
> many people using it that would have trouble switching.
>
> However, the rest looks good to me, though obviously Robert had some doubts.

Laziness dictates not specifically removing that class now, but also not doing a specific fastpath export to switch from it.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NEWS'
--- NEWS 2009-06-11 09:11:21 +0000
+++ NEWS 2009-06-12 00:35:14 +0000
@@ -20,6 +20,25 @@
20New Features20New Features
21************21************
2222
23* A new repository format ``2a`` has been added. This is a beta release
24 of the the brisbane-core (aka group-compress) project. This format now
25 suitable for wider testing by advanced users willing to deal with some
26 bugs. We would appreciate test reports, either positive or negative.
27 Format 2a is substantially smaller and faster for many operations on
28 many trees. This format or an updated version will become the default
29 in bzr 2.0.
30
31 This is a rich-root format, so this repository format can be used with
32 bzr-svn. Bazaar branches in previous non-rich-root formats can be
33 converted (including by merge, push and pull) to format 2a, but not vice
34 versa. We recommend upgrading previous development formats to 2a.
35
36 Upgrading to this format can take considerable time because it expands
37 and more concisely repacks the full history.
38
39 If you use stacked branches, you must upgrade the stacked branches
40 before the stacked-on branches. (See <https://bugs.launchpad.net/bugs/374735>)
41
23* ``--development7-rich-root`` is a new dev format, similar to ``--dev6``42* ``--development7-rich-root`` is a new dev format, similar to ``--dev6``
24 but using a Revision serializer using bencode rather than XML.43 but using a Revision serializer using bencode rather than XML.
25 (Jelmer Vernooij, John Arbash Meinel)44 (Jelmer Vernooij, John Arbash Meinel)
2645
=== modified file 'bzrlib/bzrdir.py'
--- bzrlib/bzrdir.py 2009-06-11 11:02:53 +0000
+++ bzrlib/bzrdir.py 2009-06-12 00:35:14 +0000
@@ -3831,6 +3831,18 @@
3831 experimental=True,3831 experimental=True,
3832 )3832 )
38333833
3834format_registry.register_metadir('2a',
3835 'bzrlib.repofmt.groupcompress_repo.RepositoryFormat2a',
3836 help='First format for bzr 2.0 series.\n'
3837 'Uses group-compress storage.\n'
3838 'Provides rich roots which are a one-way transition.\n',
3839 # 'storage in packs, 255-way hashed CHK inventory, bencode revision, group compress, '
3840 # 'rich roots. Supported by bzr 1.16 and later.',
3841 branch_format='bzrlib.branch.BzrBranchFormat7',
3842 tree_format='bzrlib.workingtree.WorkingTreeFormat6',
3843 experimental=True,
3844 )
3845
3834# The following format should be an alias for the rich root equivalent 3846# The following format should be an alias for the rich root equivalent
3835# of the default format3847# of the default format
3836format_registry.register_metadir('default-rich-root',3848format_registry.register_metadir('default-rich-root',
38373849
=== modified file 'bzrlib/repofmt/groupcompress_repo.py'
--- bzrlib/repofmt/groupcompress_repo.py 2009-06-10 03:56:49 +0000
+++ bzrlib/repofmt/groupcompress_repo.py 2009-06-12 00:35:14 +0000
@@ -1069,3 +1069,21 @@
1069 'revision serialization (needs bzr.dev from 1.15)\n')1069 'revision serialization (needs bzr.dev from 1.15)\n')
10701070
10711071
1072class RepositoryFormat2a(RepositoryFormatCHK2):
1073 """A CHK repository that uses the bencode revision serializer.
1074
1075 This is the same as RepositoryFormatCHK2 but with a public name.
1076 """
1077
1078 _serializer = chk_serializer.chk_bencode_serializer
1079
1080 def _get_matching_bzrdir(self):
1081 return bzrdir.format_registry.make_bzrdir('2a')
1082
1083 def _ignore_setting_bzrdir(self, format):
1084 pass
1085
1086 _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
1087
1088 def get_format_string(self):
1089 return ('Bazaar repository format 2a (needs bzr 1.16 or later)\n')
10721090
=== modified file 'bzrlib/repository.py'
--- bzrlib/repository.py 2009-06-10 03:56:49 +0000
+++ bzrlib/repository.py 2009-06-12 00:35:14 +0000
@@ -3066,6 +3066,11 @@
3066 'bzrlib.repofmt.groupcompress_repo',3066 'bzrlib.repofmt.groupcompress_repo',
3067 'RepositoryFormatCHK2',3067 'RepositoryFormatCHK2',
3068 )3068 )
3069format_registry.register_lazy(
3070 'Bazaar repository format 2a (needs bzr 1.16 or later)\n',
3071 'bzrlib.repofmt.groupcompress_repo',
3072 'RepositoryFormat2a',
3073 )
30693074
30703075
3071class InterRepository(InterObject):3076class InterRepository(InterObject):
30723077
=== modified file 'bzrlib/tests/blackbox/test_init.py'
--- bzrlib/tests/blackbox/test_init.py 2009-03-23 14:59:43 +0000
+++ bzrlib/tests/blackbox/test_init.py 2009-06-12 00:35:14 +0000
@@ -1,4 +1,4 @@
1# Copyright (C) 2006, 2007 Canonical Ltd1# Copyright (C) 2006, 2007, 2009 Canonical Ltd
2#2#
3# This program is free software; you can redistribute it and/or modify3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by4# it under the terms of the GNU General Public License as published by
@@ -49,6 +49,13 @@
49 out)49 out)
50 self.assertEqual('', err)50 self.assertEqual('', err)
5151
52 def test_init_format_2a(self):
53 """Smoke test for constructing a format 2a repoistory."""
54 out, err = self.run_bzr('init --format=2a')
55 self.assertEqual("""Created a standalone tree (format: 2a)\n""",
56 out)
57 self.assertEqual('', err)
58
52 def test_init_at_repository_root(self):59 def test_init_at_repository_root(self):
53 # bzr init at the root of a repository should create a branch60 # bzr init at the root of a repository should create a branch
54 # and working tree even when creation of working trees is disabled.61 # and working tree even when creation of working trees is disabled.