~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Haw Loeung (hloeung)
  • Date: 2012-07-24 12:53:36 UTC
  • mfrom: (6541 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6542.
  • Revision ID: haw.loeung@canonical.com-20120724125336-r3wzxm02lyec7jm6
[hloeung] Merged with upstream resolving conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1615
1615
    code.)
1616
1616
    """
1617
1617
 
1618
 
    _see_also = ['checkouts', 'branch']
 
1618
    _see_also = ['checkouts', 'branch', 'working-trees', 'remove-tree']
1619
1619
    takes_args = ['branch_location?', 'to_location?']
1620
1620
    takes_options = ['revision',
1621
1621
                     Option('lightweight',
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