~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_info.py

(jelmer) Support upgrading between the 2a and development-colo formats.
 (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007 Canonical Ltd
 
1
# Copyright (C) 2007-2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
import sys
18
 
from urllib import quote
19
18
 
20
19
from bzrlib import (
21
20
    branch as _mod_branch,
143
142
                # We don't require that experimental formats support checkouts
144
143
                # or describe correctly in the UI.
145
144
                continue
 
145
            if bzrdir.format_registry.get_info(key).hidden:
 
146
                continue
146
147
            expected = None
147
 
            if key in ('dirstate', 'dirstate-tags', 'dirstate-with-subtree',
148
 
                'pack-0.92', 'pack-0.92-subtree', 'rich-root',
149
 
                'rich-root-pack'):
150
 
                expected = 'dirstate or dirstate-tags or pack-0.92 or'\
151
 
                    ' rich-root or rich-root-pack'
152
 
            if key in ('knit', 'metaweave'):
153
 
                expected = 'knit or metaweave'
 
148
            if key in ('pack-0.92',):
 
149
                expected = 'pack-0.92'
 
150
            elif key in ('knit', 'metaweave'):
 
151
                if 'metaweave' in bzrdir.format_registry:
 
152
                    expected = 'knit or metaweave'
 
153
                else:
 
154
                    expected = 'knit'
 
155
            elif key in ('1.14', '1.14-rich-root'):
 
156
                expected = '1.14 or 1.14-rich-root'
154
157
            self.assertCheckoutDescription(key, expected)
155
158
 
156
159
    def test_describe_branch_format(self):
157
160
        for key in bzrdir.format_registry.keys():
158
161
            if key in bzrdir.format_registry.aliases():
159
162
                continue
 
163
            if bzrdir.format_registry.get_info(key).hidden:
 
164
                continue
160
165
            expected = None
161
166
            if key in ('dirstate', 'knit'):
162
167
                expected = 'dirstate or knit'
 
168
            elif key in ('1.14',):
 
169
                expected = '1.14'
 
170
            elif key in ('1.14-rich-root',):
 
171
                expected = '1.14-rich-root'
163
172
            self.assertBranchDescription(key, expected)
164
173
 
165
174
    def test_describe_repo_format(self):
166
175
        for key in bzrdir.format_registry.keys():
167
176
            if key in bzrdir.format_registry.aliases():
168
177
                continue
 
178
            if bzrdir.format_registry.get_info(key).hidden:
 
179
                continue
169
180
            expected = None
170
181
            if key in ('dirstate', 'knit', 'dirstate-tags'):
171
182
                expected = 'dirstate or dirstate-tags or knit'
 
183
            elif key in ('1.14',):
 
184
                expected = '1.14'
 
185
            elif key in ('1.14-rich-root',):
 
186
                expected = '1.14-rich-root'
172
187
            self.assertRepoDescription(key, expected)
173
188
 
174
 
        format = bzrdir.format_registry.make_bzrdir('metaweave')
 
189
        format = bzrdir.format_registry.make_bzrdir('knit')
175
190
        format.set_branch_format(_mod_branch.BzrBranchFormat6())
176
191
        tree = self.make_branch_and_tree('unknown', format=format)
177
192
        self.assertEqual('unnamed', info.describe_format(tree.bzrdir,