~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_info.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-01-20 17:19:44 UTC
  • mfrom: (4973.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100120171944-8gkub20gotjcye67
(spiv) Implement a per-file merge hook

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