/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 bzrlib/builtins.py

  • Committer: Vincent Ladeuil
  • Date: 2007-09-17 21:08:47 UTC
  • mfrom: (2828 +trunk)
  • mto: (2851.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 2852.
  • Revision ID: v.ladeuil+lp@free.fr-20070917210847-hneglal34t75toin
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    merge as _mod_merge,
43
43
    merge_directive,
44
44
    osutils,
 
45
    reconfigure,
45
46
    registry,
46
47
    repository,
47
48
    revision as _mod_revision,
3846
3847
    the preferred client can't be found (or used), your editor will be used.
3847
3848
    
3848
3849
    To use a specific mail program, set the mail_client configuration option.
3849
 
    (For Thunderbird 1.5, this works around some bugs.)  Supported values are
3850
 
    "thunderbird", "evolution", "editor", "xdg-email", "mapi", "kmail" and
3851
 
    "default".
 
3850
    (For Thunderbird 1.5, this works around some bugs.)  Supported values for
 
3851
    specific clients are "evolution", "kmail", "mutt", and "thunderbird";
 
3852
    generic options are "default", "editor", "mapi", and "xdg-email".
3852
3853
 
3853
3854
    If mail is being sent, a to address is required.  This can be supplied
3854
3855
    either on the commandline, or by setting the submit_to configuration
4152
4153
            self.outf.write('%-20s %s\n' % (tag_name, target))
4153
4154
 
4154
4155
 
 
4156
class cmd_reconfigure(Command):
 
4157
    """Reconfigure the type of a bzr directory.
 
4158
 
 
4159
    A target configuration must be specified.
 
4160
 
 
4161
    For checkouts, the bind-to location will be auto-detected if not specified.
 
4162
    The order of preference is
 
4163
    1. For a lightweight checkout, the current bound location.
 
4164
    2. For branches that used to be checkouts, the previously-bound location.
 
4165
    3. The push location.
 
4166
    4. The parent location.
 
4167
    If none of these is available, --bind-to must be specified.
 
4168
    """
 
4169
 
 
4170
    takes_args = ['location?']
 
4171
    takes_options = [RegistryOption.from_kwargs('target_type',
 
4172
                     title='Target type',
 
4173
                     help='The type to reconfigure the directory to.',
 
4174
                     value_switches=True, enum_switch=False,
 
4175
                     branch='Reconfigure to a branch.',
 
4176
                     tree='Reconfigure to a tree.',
 
4177
                     checkout='Reconfigure to a checkout.'),
 
4178
                     Option('bind-to', help='Branch to bind checkout to.',
 
4179
                            type=str),
 
4180
                     Option('force',
 
4181
                        help='Perform reconfiguration even if local changes'
 
4182
                        ' will be lost.')
 
4183
                     ]
 
4184
 
 
4185
    def run(self, location=None, target_type=None, bind_to=None, force=False):
 
4186
        directory = bzrdir.BzrDir.open(location)
 
4187
        if target_type is None:
 
4188
            raise BzrCommandError('No target configuration specified')
 
4189
        elif target_type == 'branch':
 
4190
            reconfiguration = reconfigure.Reconfigure.to_branch(directory)
 
4191
        elif target_type == 'tree':
 
4192
            reconfiguration = reconfigure.Reconfigure.to_tree(directory)
 
4193
        elif target_type == 'checkout':
 
4194
            reconfiguration = reconfigure.Reconfigure.to_checkout(directory,
 
4195
                                                                  bind_to)
 
4196
        reconfiguration.apply(force)
 
4197
 
 
4198
 
4155
4199
def _create_prefix(cur_transport):
4156
4200
    needed = [cur_transport]
4157
4201
    # Recurse upwards until we can create a directory successfully