/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: John Arbash Meinel
  • Date: 2009-08-04 14:10:09 UTC
  • mfrom: (4585 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4588.
  • Revision ID: john@arbash-meinel.com-20090804141009-uety2n17v1atk5ok
Merge bzr.dev 4585, resolve NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
1472
1472
            title='Deletion Strategy', value_switches=True, enum_switch=False,
1473
1473
            safe='Only delete files if they can be'
1474
1474
                 ' safely recovered (default).',
1475
 
            keep="Don't delete any files.",
 
1475
            keep='Delete from bzr but leave the working copy.',
1476
1476
            force='Delete all the specified files, even if they can not be '
1477
1477
                'recovered and even if they are non-empty directories.')]
1478
1478
    aliases = ['rm', 'del']
3788
3788
            base_branch, base_path = Branch.open_containing(base_loc,
3789
3789
                possible_transports)
3790
3790
        # Find the revision ids
3791
 
        if revision is None or len(revision) < 1 or revision[-1] is None:
 
3791
        other_revision_id = None
 
3792
        base_revision_id = None
 
3793
        if revision is not None:
 
3794
            if len(revision) >= 1:
 
3795
                other_revision_id = revision[-1].as_revision_id(other_branch)
 
3796
            if len(revision) == 2:
 
3797
                base_revision_id = revision[0].as_revision_id(base_branch)
 
3798
        if other_revision_id is None:
3792
3799
            other_revision_id = _mod_revision.ensure_null(
3793
3800
                other_branch.last_revision())
3794
 
        else:
3795
 
            other_revision_id = revision[-1].as_revision_id(other_branch)
3796
 
        if (revision is not None and len(revision) == 2
3797
 
            and revision[0] is not None):
3798
 
            base_revision_id = revision[0].as_revision_id(base_branch)
3799
 
        else:
3800
 
            base_revision_id = None
3801
3801
        # Remember where we merge from
3802
3802
        if ((remember or tree.branch.get_submit_branch() is None) and
3803
3803
             user_location is not None):
5259
5259
            ),
5260
5260
        Option('bind-to', help='Branch to bind checkout to.', type=str),
5261
5261
        Option('force',
5262
 
               help='Perform reconfiguration even if local changes'
5263
 
               ' will be lost.')
 
5262
            help='Perform reconfiguration even if local changes'
 
5263
            ' will be lost.'),
 
5264
        Option('stacked-on',
 
5265
            help='Reconfigure a branch to be stacked on another branch.',
 
5266
            type=unicode,
 
5267
            ),
 
5268
        Option('unstacked',
 
5269
            help='Reconfigure a branch to be unstacked.  This '
 
5270
                'may require copying substantial data into it.',
 
5271
            ),
5264
5272
        ]
5265
5273
 
5266
 
    def run(self, location=None, target_type=None, bind_to=None, force=False):
 
5274
    def run(self, location=None, target_type=None, bind_to=None, force=False,
 
5275
            stacked_on=None,
 
5276
            unstacked=None):
5267
5277
        directory = bzrdir.BzrDir.open(location)
 
5278
        if stacked_on and unstacked:
 
5279
            raise BzrCommandError("Can't use both --stacked-on and --unstacked")
 
5280
        elif stacked_on is not None:
 
5281
            reconfigure.ReconfigureStackedOn().apply(directory, stacked_on)
 
5282
        elif unstacked:
 
5283
            reconfigure.ReconfigureUnstacked().apply(directory)
 
5284
        # At the moment you can use --stacked-on and a different
 
5285
        # reconfiguration shape at the same time; there seems no good reason
 
5286
        # to ban it.
5268
5287
        if target_type is None:
5269
 
            raise errors.BzrCommandError('No target configuration specified')
 
5288
            if stacked_on or unstacked:
 
5289
                return
 
5290
            else:
 
5291
                raise errors.BzrCommandError('No target configuration '
 
5292
                    'specified')
5270
5293
        elif target_type == 'branch':
5271
5294
            reconfiguration = reconfigure.Reconfigure.to_branch(directory)
5272
5295
        elif target_type == 'tree':