~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/push.py

  • Committer: Jelmer Vernooij
  • Date: 2011-11-27 17:42:25 UTC
  • mto: This revision was merged to the branch mainline in revision 6311.
  • Revision ID: jelmer@samba.org-20111127174225-tspfeewl0gwxxumt
Add possible_transports in a couple more places.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008-2012 Canonical Ltd
 
1
# Copyright (C) 2008, 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
16
16
 
17
17
"""UI helper for the push command."""
18
18
 
19
 
from __future__ import absolute_import
20
 
 
21
19
from bzrlib import (
22
20
    controldir,
23
21
    errors,
92
90
                revision_id=revision_id, stacked_on=stacked_on,
93
91
                create_prefix=create_prefix, use_existing_dir=use_existing_dir,
94
92
                no_tree=no_tree)
95
 
        except errors.AlreadyControlDirError, err:
96
 
            raise errors.BzrCommandError(gettext(
97
 
                "Target directory %s already contains a .bzr directory, "
98
 
                "but it is not valid.") % (location,))
99
93
        except errors.FileExists, err:
 
94
            if err.path.endswith('/.bzr'):
 
95
                raise errors.BzrCommandError(gettext(
 
96
                    "Target directory %s already contains a .bzr directory, "
 
97
                    "but it is not valid.") % (location,))
100
98
            if not use_existing_dir:
101
99
                raise errors.BzrCommandError(gettext("Target directory %s"
102
100
                     " already exists, but does not have a .bzr"
135
133
        # Remembers if asked explicitly or no previous location is set
136
134
        if (remember
137
135
            or (remember is None and br_from.get_push_location() is None)):
138
 
            # FIXME: Should be done only if we succeed ? -- vila 2012-01-18
139
136
            br_from.set_push_location(br_to.base)
140
137
    else:
141
138
        if stacked_on is not None: