~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-11-23 04:39:53 UTC
  • mfrom: (3015.1.2 ianc-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20071123043953-lv68pawzrpa4s9t9
Migrate switch command into the core (Ian Clatworthy)

Show diffs side-by-side

added added

removed removed

Lines of Context:
4324
4324
        reconfiguration.apply(force)
4325
4325
 
4326
4326
 
 
4327
class cmd_switch(Command):
 
4328
    """Set the branch of a lightweight checkout and update."""
 
4329
 
 
4330
    takes_args = ['to_location']
 
4331
 
 
4332
    def run(self, to_location):
 
4333
        from bzrlib import switch
 
4334
        to_branch = Branch.open(to_location)
 
4335
        tree_location = '.'
 
4336
        control_dir = bzrdir.BzrDir.open_containing(tree_location)[0]
 
4337
        switch.switch(control_dir, to_branch)
 
4338
        note('Switched to branch: %s',
 
4339
            urlutils.unescape_for_display(to_branch.base, 'utf-8'))
 
4340
 
 
4341
 
4327
4342
def _create_prefix(cur_transport):
4328
4343
    needed = [cur_transport]
4329
4344
    # Recurse upwards until we can create a directory successfully