/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/builtins.py

  • Committer: Jelmer Vernooij
  • Date: 2018-04-06 19:28:01 UTC
  • mfrom: (6940 work)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@jelmer.uk-20180406192801-0352t3rvkwsy9s51
merge lp:brz

Show diffs side-by-side

added added

removed removed

Lines of Context:
2279
2279
 
2280
2280
        to_transport = transport.get_transport(location)
2281
2281
 
 
2282
        if format.fixed_components:
 
2283
            repo_format_name = None
 
2284
        else:
 
2285
            repo_format_name = format.repository_format.get_format_string()
 
2286
 
2282
2287
        (repo, newdir, require_stacking, repository_policy) = (
2283
2288
            format.initialize_on_transport_ex(to_transport,
2284
2289
            create_prefix=True, make_working_trees=not no_trees,
2285
2290
            shared_repo=True, force_new_repo=True,
2286
2291
            use_existing_dir=True,
2287
 
            repo_format_name=format.repository_format.get_format_string()))
 
2292
            repo_format_name=repo_format_name))
2288
2293
        if not is_quiet():
2289
2294
            from .info import show_bzrdir_info
2290
2295
            show_bzrdir_info(newdir, verbose=0, outfile=self.outf)
4200
4205
            # disallowing it currently leads to failures in many places.
4201
4206
            lazy_import.disallow_proxying()
4202
4207
 
4203
 
        from . import tests
 
4208
        try:
 
4209
            from . import tests
 
4210
        except ImportError:
 
4211
            raise errors.BzrCommandError("tests not available. Install the "
 
4212
                "breezy tests to run the breezy testsuite.")
4204
4213
 
4205
4214
        if testspecs_list is not None:
4206
4215
            pattern = '|'.join(testspecs_list)
6343
6352
                    possible_transports=possible_transports)
6344
6353
        if revision is not None:
6345
6354
            revision = revision.as_revision_id(to_branch)
6346
 
        switch.switch(control_dir, to_branch, force, revision_id=revision,
6347
 
                      store_uncommitted=store)
 
6355
        try:
 
6356
            switch.switch(control_dir, to_branch, force, revision_id=revision,
 
6357
                          store_uncommitted=store)
 
6358
        except controldir.BranchReferenceLoop:
 
6359
            raise errors.BzrCommandError(
 
6360
                    gettext('switching would create a branch reference loop. '
 
6361
                            'Use the "bzr up" command to switch to a '
 
6362
                            'different revision.'))
6348
6363
        if had_explicit_nick:
6349
6364
            branch = control_dir.open_branch() #get the new branch!
6350
6365
            branch.nick = to_branch.nick