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
18
from urllib import quote
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
if bzrdir.format_registry.get_info(key).hidden:
147
if key in ('dirstate', 'dirstate-tags', 'dirstate-with-subtree',
148
'pack-0.92', 'pack-0.92-subtree', 'rich-root',
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'
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)
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():
163
if bzrdir.format_registry.get_info(key).hidden:
161
166
if key in ('dirstate', 'knit'):
162
167
expected = 'dirstate or knit'
168
elif key in ('1.14',):
170
elif key in ('1.14-rich-root',):
171
expected = '1.14-rich-root'
163
172
self.assertBranchDescription(key, expected)
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():
178
if bzrdir.format_registry.get_info(key).hidden:
170
181
if key in ('dirstate', 'knit', 'dirstate-tags'):
171
182
expected = 'dirstate or dirstate-tags or knit'
183
elif key in ('1.14',):
185
elif key in ('1.14-rich-root',):
186
expected = '1.14-rich-root'
172
187
self.assertRepoDescription(key, expected)
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,