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
17
18
from urllib import quote
19
20
from bzrlib import (
97
98
bzrdir.format_registry.make_bzrdir(format).workingtree_format
98
99
control.create_workingtree()
99
100
tree = workingtree.WorkingTree.open('%s_co' % format)
100
self.assertEqual(expected, info.describe_format(tree.bzrdir,
101
tree.branch.repository, tree.branch, tree))
101
format_description = info.describe_format(tree.bzrdir,
102
tree.branch.repository, tree.branch, tree)
103
self.assertEqual(expected, format_description,
104
"checkout of format called %r was described as %r" %
105
(expected, format_description))
103
107
control._format.workingtree_format = old_format
123
127
def test_describe_tree_format(self):
124
128
for key in bzrdir.format_registry.keys():
129
if key in bzrdir.format_registry.aliases():
127
131
self.assertTreeDescription(key)
129
133
def test_describe_checkout_format(self):
130
134
for key in bzrdir.format_registry.keys():
131
if key in ('default', 'weave'):
135
if key in bzrdir.format_registry.aliases():
136
# Aliases will not describe correctly in the UI because the
137
# real format is found.
139
# legacy: weave does not support checkouts
142
if bzrdir.format_registry.get_info(key).experimental:
143
# We don't require that experimental formats support checkouts
144
# or describe correctly in the UI.
134
if key in ('dirstate', 'dirstate-tags', 'dirstate-with-subtree'):
135
expected = 'dirstate or dirstate-tags'
136
if key in ('knit', 'metaweave'):
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'
155
elif key in ('knit', 'metaweave'):
137
156
expected = 'knit or metaweave'
157
elif key in ('1.14', '1.14-rich-root'):
158
expected = '1.14 or 1.14-rich-root'
138
159
self.assertCheckoutDescription(key, expected)
140
161
def test_describe_branch_format(self):
141
162
for key in bzrdir.format_registry.keys():
163
if key in bzrdir.format_registry.aliases():
165
if bzrdir.format_registry.get_info(key).hidden:
145
168
if key in ('dirstate', 'knit'):
146
169
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'
147
174
self.assertBranchDescription(key, expected)
149
176
def test_describe_repo_format(self):
150
177
for key in bzrdir.format_registry.keys():
178
if key in bzrdir.format_registry.aliases():
180
if bzrdir.format_registry.get_info(key).hidden:
154
183
if key in ('dirstate', 'knit', 'dirstate-tags'):
155
184
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'
156
189
self.assertRepoDescription(key, expected)
158
191
format = bzrdir.format_registry.make_bzrdir('metaweave')