~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_info.py

  • Committer: Jelmer Vernooij
  • Date: 2011-10-14 13:56:45 UTC
  • mfrom: (6215 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6216.
  • Revision ID: jelmer@samba.org-20111014135645-phc3q3y21k2ks0s2
Merge bzr.dev.

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
15
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', '1.6', '1.6.1-rich-root',
150
 
                '1.9', '1.9-rich-root'):
151
 
                expected = '1.6 or 1.6.1-rich-root or ' \
152
 
                    '1.9 or 1.9-rich-root or ' \
153
 
                    'dirstate or dirstate-tags or pack-0.92 or'\
154
 
                    ' rich-root or rich-root-pack'
 
148
            if key in ('pack-0.92',):
 
149
                expected = 'pack-0.92'
155
150
            elif key in ('knit', 'metaweave'):
156
 
                expected = 'knit or metaweave'
 
151
                if 'metaweave' in bzrdir.format_registry:
 
152
                    expected = 'knit or metaweave'
 
153
                else:
 
154
                    expected = 'knit'
157
155
            elif key in ('1.14', '1.14-rich-root'):
158
156
                expected = '1.14 or 1.14-rich-root'
159
157
            self.assertCheckoutDescription(key, expected)
167
165
            expected = None
168
166
            if key in ('dirstate', 'knit'):
169
167
                expected = 'dirstate or knit'
170
 
            elif key in ('1.9', '1.14'):
171
 
                expected = '1.14 or 1.9'
172
 
            elif key in ('1.9-rich-root', '1.14-rich-root'):
173
 
                expected = '1.14-rich-root or 1.9-rich-root'
 
168
            elif key in ('1.14',):
 
169
                expected = '1.14'
 
170
            elif key in ('1.14-rich-root',):
 
171
                expected = '1.14-rich-root'
174
172
            self.assertBranchDescription(key, expected)
175
173
 
176
174
    def test_describe_repo_format(self):
182
180
            expected = None
183
181
            if key in ('dirstate', 'knit', 'dirstate-tags'):
184
182
                expected = 'dirstate or dirstate-tags or knit'
185
 
            elif key in ('1.9', '1.14'):
186
 
                expected = '1.14 or 1.9'
187
 
            elif key in ('1.9-rich-root', '1.14-rich-root'):
188
 
                expected = '1.14-rich-root or 1.9-rich-root'
 
183
            elif key in ('1.14',):
 
184
                expected = '1.14'
 
185
            elif key in ('1.14-rich-root',):
 
186
                expected = '1.14-rich-root'
189
187
            self.assertRepoDescription(key, expected)
190
188
 
191
 
        format = bzrdir.format_registry.make_bzrdir('metaweave')
 
189
        format = bzrdir.format_registry.make_bzrdir('knit')
192
190
        format.set_branch_format(_mod_branch.BzrBranchFormat6())
193
191
        tree = self.make_branch_and_tree('unknown', format=format)
194
192
        self.assertEqual('unnamed', info.describe_format(tree.bzrdir,