/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/git/commands.py

  • Committer: Jelmer Vernooij
  • Date: 2019-08-11 13:33:45 UTC
  • mfrom: (7379 work)
  • mto: This revision was merged to the branch mainline in revision 7389.
  • Revision ID: jelmer@jelmer.uk-20190811133345-dp9j3c569vxj4l9y
merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
from __future__ import absolute_import
25
25
 
26
26
import breezy.bzr  # noqa: F401
 
27
from breezy import controldir
27
28
from ..commands import (
28
29
    Command,
29
30
    display_command,
30
31
    )
31
32
from ..option import (
32
33
    Option,
 
34
    RegistryOption,
33
35
    )
34
36
from ..sixish import (
35
37
    text_type,
46
48
 
47
49
    takes_options = [
48
50
        Option('colocated', help='Create colocated branches.'),
 
51
        RegistryOption('dest-format',
 
52
                       help='Specify a format for this branch. '
 
53
                       'See "help formats" for a full list.',
 
54
                       lazy_registry=('breezy.controldir', 'format_registry'),
 
55
                       converter=lambda name: controldir.format_registry.make_controldir(
 
56
                            name),
 
57
                       value_switches=True,
 
58
                       title="Branch format",
 
59
                       ),
49
60
        ]
50
61
 
51
62
    def _get_colocated_branch(self, target_controldir, name):
69
80
        except NotBranchError:
70
81
            return head_controldir.create_branch()
71
82
 
72
 
    def run(self, src_location, dest_location=None, colocated=False):
 
83
    def run(self, src_location, dest_location=None, colocated=False, dest_format=None):
73
84
        import os
74
85
        from .. import (
75
86
            controldir,
100
111
            )
101
112
        from .repository import GitRepository
102
113
 
103
 
        dest_format = controldir.ControlDirFormat.get_default_format()
104
114
        if dest_format is None:
105
 
            raise BzrError('no default format')
 
115
            dest_format = controldir.format_registry.make_controldir('default')
106
116
 
107
117
        if dest_location is None:
108
118
            dest_location = os.path.basename(src_location.rstrip("/\\"))