~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_info.py

  • Committer: Robert Collins
  • Date: 2009-03-27 04:10:25 UTC
  • mfrom: (4208 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4216.
  • Revision ID: robertc@robertcollins.net-20090327041025-rgutx4q03xo4pq6l
Resolve NEWS conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2011 Canonical Ltd
 
1
# Copyright (C) 2007 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
18
19
 
19
20
from bzrlib import (
20
21
    branch as _mod_branch,
142
143
                # We don't require that experimental formats support checkouts
143
144
                # or describe correctly in the UI.
144
145
                continue
145
 
            if bzrdir.format_registry.get_info(key).hidden:
146
 
                continue
147
146
            expected = None
148
 
            if key in ('pack-0.92',):
149
 
                expected = 'pack-0.92'
 
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'
150
155
            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'
 
156
                expected = 'knit or metaweave'
 
157
            elif key in ('development-wt5', 'development-wt5-rich-root'):
 
158
                expected = 'development-wt5 or development-wt5-rich-root'
157
159
            self.assertCheckoutDescription(key, expected)
158
160
 
159
161
    def test_describe_branch_format(self):
160
162
        for key in bzrdir.format_registry.keys():
161
163
            if key in bzrdir.format_registry.aliases():
162
164
                continue
163
 
            if bzrdir.format_registry.get_info(key).hidden:
164
 
                continue
165
165
            expected = None
166
166
            if key in ('dirstate', 'knit'):
167
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'
 
168
            elif key in ('1.9', 'development-wt5'):
 
169
                expected = '1.9 or development-wt5'
 
170
            elif key in ('1.9-rich-root', 'development-wt5-rich-root'):
 
171
                expected = '1.9-rich-root or development-wt5-rich-root'
172
172
            self.assertBranchDescription(key, expected)
173
173
 
174
174
    def test_describe_repo_format(self):
175
175
        for key in bzrdir.format_registry.keys():
176
176
            if key in bzrdir.format_registry.aliases():
177
177
                continue
178
 
            if bzrdir.format_registry.get_info(key).hidden:
179
 
                continue
180
178
            expected = None
181
179
            if key in ('dirstate', 'knit', 'dirstate-tags'):
182
180
                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'
 
181
            elif key in ('1.9', 'development-wt5'):
 
182
                expected = '1.9 or development-wt5'
 
183
            elif key in ('1.9-rich-root', 'development-wt5-rich-root'):
 
184
                expected = '1.9-rich-root or development-wt5-rich-root'
187
185
            self.assertRepoDescription(key, expected)
188
186
 
189
 
        format = bzrdir.format_registry.make_bzrdir('knit')
 
187
        format = bzrdir.format_registry.make_bzrdir('metaweave')
190
188
        format.set_branch_format(_mod_branch.BzrBranchFormat6())
191
189
        tree = self.make_branch_and_tree('unknown', format=format)
192
190
        self.assertEqual('unnamed', info.describe_format(tree.bzrdir,