~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Patch Queue Manager
  • Date: 2012-07-23 17:56:45 UTC
  • mfrom: (6538.1.34 branch-store)
  • Revision ID: pqm@pqm.ubuntu.com-20120723175645-92crzj8j7bfnuglm
(abentley) switch --store stores uncommitted changes in branch (Aaron
 Bentley)

Show diffs side-by-side

added added

removed removed

Lines of Context:
6233
6233
                     Option('create-branch', short_name='b',
6234
6234
                        help='Create the target branch from this one before'
6235
6235
                             ' switching to it.'),
 
6236
                     Option('store',
 
6237
                        help='Store and restore uncommitted changes in the'
 
6238
                             ' branch.'),
6236
6239
                    ]
6237
6240
 
6238
6241
    def run(self, to_location=None, force=False, create_branch=False,
6239
 
            revision=None, directory=u'.'):
 
6242
            revision=None, directory=u'.', store=False):
6240
6243
        from bzrlib import switch
6241
6244
        tree_location = directory
6242
6245
        revision = _get_one_revision('switch', revision)
6273
6276
                    possible_transports=possible_transports)
6274
6277
        if revision is not None:
6275
6278
            revision = revision.as_revision_id(to_branch)
6276
 
        switch.switch(control_dir, to_branch, force, revision_id=revision)
 
6279
        switch.switch(control_dir, to_branch, force, revision_id=revision,
 
6280
                      store_uncommitted=store)
6277
6281
        if had_explicit_nick:
6278
6282
            branch = control_dir.open_branch() #get the new branch!
6279
6283
            branch.nick = to_branch.nick