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
1=== modified file 'NEWS'
2--- NEWS 2009-06-11 09:11:21 +0000
3+++ NEWS 2009-06-12 00:35:14 +0000
4@@ -20,6 +20,25 @@
5 New Features
6 ************
7
8+* A new repository format ``2a`` has been added. This is a beta release
9+ of the the brisbane-core (aka group-compress) project. This format now
10+ suitable for wider testing by advanced users willing to deal with some
11+ bugs. We would appreciate test reports, either positive or negative.
12+ Format 2a is substantially smaller and faster for many operations on
13+ many trees. This format or an updated version will become the default
14+ in bzr 2.0.
15+
16+ This is a rich-root format, so this repository format can be used with
17+ bzr-svn. Bazaar branches in previous non-rich-root formats can be
18+ converted (including by merge, push and pull) to format 2a, but not vice
19+ versa. We recommend upgrading previous development formats to 2a.
20+
21+ Upgrading to this format can take considerable time because it expands
22+ and more concisely repacks the full history.
23+
24+ If you use stacked branches, you must upgrade the stacked branches
25+ before the stacked-on branches. (See <https://bugs.launchpad.net/bugs/374735>)
26+
27 * ``--development7-rich-root`` is a new dev format, similar to ``--dev6``
28 but using a Revision serializer using bencode rather than XML.
29 (Jelmer Vernooij, John Arbash Meinel)
30
31=== modified file 'bzrlib/bzrdir.py'
32--- bzrlib/bzrdir.py 2009-06-11 11:02:53 +0000
33+++ bzrlib/bzrdir.py 2009-06-12 00:35:14 +0000
34@@ -3831,6 +3831,18 @@
35 experimental=True,
36 )
37
38+format_registry.register_metadir('2a',
39+ 'bzrlib.repofmt.groupcompress_repo.RepositoryFormat2a',
40+ help='First format for bzr 2.0 series.\n'
41+ 'Uses group-compress storage.\n'
42+ 'Provides rich roots which are a one-way transition.\n',
43+ # 'storage in packs, 255-way hashed CHK inventory, bencode revision, group compress, '
44+ # 'rich roots. Supported by bzr 1.16 and later.',
45+ branch_format='bzrlib.branch.BzrBranchFormat7',
46+ tree_format='bzrlib.workingtree.WorkingTreeFormat6',
47+ experimental=True,
48+ )
49+
50 # The following format should be an alias for the rich root equivalent
51 # of the default format
52 format_registry.register_metadir('default-rich-root',
53
54=== modified file 'bzrlib/repofmt/groupcompress_repo.py'
55--- bzrlib/repofmt/groupcompress_repo.py 2009-06-10 03:56:49 +0000
56+++ bzrlib/repofmt/groupcompress_repo.py 2009-06-12 00:35:14 +0000
57@@ -1069,3 +1069,21 @@
58 'revision serialization (needs bzr.dev from 1.15)\n')
59
60
61+class RepositoryFormat2a(RepositoryFormatCHK2):
62+ """A CHK repository that uses the bencode revision serializer.
63+
64+ This is the same as RepositoryFormatCHK2 but with a public name.
65+ """
66+
67+ _serializer = chk_serializer.chk_bencode_serializer
68+
69+ def _get_matching_bzrdir(self):
70+ return bzrdir.format_registry.make_bzrdir('2a')
71+
72+ def _ignore_setting_bzrdir(self, format):
73+ pass
74+
75+ _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
76+
77+ def get_format_string(self):
78+ return ('Bazaar repository format 2a (needs bzr 1.16 or later)\n')
79
80=== modified file 'bzrlib/repository.py'
81--- bzrlib/repository.py 2009-06-10 03:56:49 +0000
82+++ bzrlib/repository.py 2009-06-12 00:35:14 +0000
83@@ -3066,6 +3066,11 @@
84 'bzrlib.repofmt.groupcompress_repo',
85 'RepositoryFormatCHK2',
86 )
87+format_registry.register_lazy(
88+ 'Bazaar repository format 2a (needs bzr 1.16 or later)\n',
89+ 'bzrlib.repofmt.groupcompress_repo',
90+ 'RepositoryFormat2a',
91+ )
92
93
94 class InterRepository(InterObject):
95
96=== modified file 'bzrlib/tests/blackbox/test_init.py'
97--- bzrlib/tests/blackbox/test_init.py 2009-03-23 14:59:43 +0000
98+++ bzrlib/tests/blackbox/test_init.py 2009-06-12 00:35:14 +0000
99@@ -1,4 +1,4 @@
100-# Copyright (C) 2006, 2007 Canonical Ltd
101+# Copyright (C) 2006, 2007, 2009 Canonical Ltd
102 #
103 # This program is free software; you can redistribute it and/or modify
104 # it under the terms of the GNU General Public License as published by
105@@ -49,6 +49,13 @@
106 out)
107 self.assertEqual('', err)
108
109+ def test_init_format_2a(self):
110+ """Smoke test for constructing a format 2a repoistory."""
111+ out, err = self.run_bzr('init --format=2a')
112+ self.assertEqual("""Created a standalone tree (format: 2a)\n""",
113+ out)
114+ self.assertEqual('', err)
115+
116 def test_init_at_repository_root(self):
117 # bzr init at the root of a repository should create a branch
118 # and working tree even when creation of working trees is disabled.