~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/switch.py

  • Committer: Jelmer Vernooij
  • Date: 2012-02-23 16:48:41 UTC
  • mto: (6437.41.3 rmbranch-active)
  • mto: This revision was merged to the branch mainline in revision 6481.
  • Revision ID: jelmer@samba.org-20120223164841-eyy9xljbpblkchba
Support colocated branches in 'bzr rmbranch'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007, 2009-2012 Canonical Ltd.
 
1
# Copyright (C) 2007, 2009, 2010 Canonical Ltd.
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
105
105
                        'Unable to connect to current master branch %(target)s: '
106
106
                        '%(error)s To switch anyway, use --force.') %
107
107
                        e.__dict__)
108
 
            b.lock_write()
109
 
            try:
110
 
                b.set_bound_location(None)
111
 
                b.pull(to_branch, overwrite=True,
112
 
                       possible_transports=possible_transports)
113
 
                b.set_bound_location(to_branch.base)
114
 
                b.set_parent(b.get_master_branch().get_parent())
115
 
            finally:
116
 
                b.unlock()
 
108
            b.set_bound_location(None)
 
109
            b.pull(to_branch, overwrite=True,
 
110
                possible_transports=possible_transports)
 
111
            b.set_bound_location(to_branch.base)
 
112
            b.set_parent(b.get_master_branch().get_parent())
117
113
        else:
118
114
            # If this is a standalone tree and the new branch
119
115
            # is derived from this one, create a lightweight checkout.