~garyvdm/bzr-pipeline/decoratemerge

« back to all changes in this revision

Viewing changes to commands.py

  • Committer: Aaron Bentley
  • Date: 2009-07-02 12:58:23 UTC
  • Revision ID: aaron@aaronbentley.com-20090702125823-utx0m3eil9deiiqc
Add remove-pipe --branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
153
153
    """Remove a pipe from the pipeline.
154
154
 
155
155
    By default, the current pipe is removed, but a pipe may be specified as
156
 
    the first parameter.  The pipe's branch is not deleted, only its
157
 
    association with the pipeline.
 
156
    the first parameter.  By default, only the association of the pipe with
 
157
    its pipeline is removed, but if --branch is specified, the branch is
 
158
    also deleted.
158
159
    """
159
160
 
160
161
    takes_args = ['pipe?']
 
162
    takes_options = [Option('branch', help="Remove pipe's branch.")]
161
163
 
162
 
    def run(self, pipe=None):
 
164
    def run(self, pipe=None, branch=False):
163
165
        tree, manager = self._get_checkout_manager(pipe=pipe,
164
166
                                                   checkout_optional=True,
165
167
                                                   allow_tree=True)
174
176
            tree.branch.base == manager.storage.branch.base):
175
177
            switch(tree.bzrdir, target_branch)
176
178
        manager.storage.disconnect()
 
179
        if branch:
 
180
            manager.storage.branch.bzrdir.root_transport.delete_tree('.')
177
181
 
178
182
 
179
183
class cmd_switch_pipe(PipeCommand):