~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/switch.py

  • Committer: Vincent Ladeuil
  • Date: 2009-06-22 12:52:39 UTC
  • mto: (4471.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4472.
  • Revision ID: v.ladeuil+lp@free.fr-20090622125239-kabo9smxt9c3vnir
Use a consistent scheme for naming pyrex source files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
# Original author: David Allouche
18
18
 
79
79
            # synchronise the local branch with the new remote branch
80
80
            # and bind to it
81
81
            possible_transports = []
82
 
            if not force and _any_local_commits(b, possible_transports):
 
82
            try:
 
83
                if not force and _any_local_commits(b, possible_transports):
 
84
                    raise errors.BzrCommandError(
 
85
                        'Cannot switch as local commits found in the checkout. '
 
86
                        'Commit these to the bound branch or use --force to '
 
87
                        'throw them away.')
 
88
            except errors.BoundBranchConnectionFailure, e:
83
89
                raise errors.BzrCommandError(
84
 
                    'Cannot switch as local commits found in the checkout. '
85
 
                    'Commit these to the bound branch or use --force to '
86
 
                    'throw them away.')
 
90
                        'Unable to connect to current master branch %(target)s: '
 
91
                        '%(error)s To switch anyway, use --force.' %
 
92
                        e.__dict__)
87
93
            b.set_bound_location(None)
88
94
            b.pull(to_branch, overwrite=True,
89
95
                possible_transports=possible_transports)