/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/push.py

  • Committer: Andrew Bennetts
  • Date: 2010-02-12 04:33:05 UTC
  • mfrom: (5031 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5032.
  • Revision ID: andrew.bennetts@canonical.com-20100212043305-ujdbsdoviql2t7i3
MergeĀ lp:bzr

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
            br_to = br_from.create_clone_on_transport(to_transport,
91
91
                revision_id=revision_id, stacked_on=stacked_on,
92
92
                create_prefix=create_prefix, use_existing_dir=use_existing_dir)
93
 
        except errors.FileExists:
 
93
        except errors.FileExists, err:
 
94
            if err.path.endswith('/.bzr'):
 
95
                raise errors.BzrCommandError(
 
96
                    "Target directory %s already contains a .bzr directory, "
 
97
                    "but it is not valid." % (location,))
94
98
            if not use_existing_dir:
95
99
                raise errors.BzrCommandError("Target directory %s"
96
 
                     " already exists, but does not have a valid .bzr"
 
100
                     " already exists, but does not have a .bzr"
97
101
                     " directory. Supply --use-existing-dir to push"
98
102
                     " there anyway." % location)
 
103
            # This shouldn't occur, but if it does the FileExists error will be
 
104
            # more informative than an UnboundLocalError for br_to.
 
105
            raise
99
106
        except errors.NoSuchFile:
100
107
            if not create_prefix:
101
108
                raise errors.BzrCommandError("Parent directory of %s"
130
137
            raise errors.BzrCommandError('These branches have diverged.'
131
138
                                    '  See "bzr help diverged-branches"'
132
139
                                    ' for more information.')
 
140
        except errors.NoRoundtrippingSupport, e:
 
141
            raise errors.BzrCommandError("It is not possible to losslessly "
 
142
                "push to %s. You may want to use dpush instead." % 
 
143
                    e.target_branch.mapping.vcs.abbreviation)
133
144
        except errors.NoRepositoryPresent:
134
145
            # we have a bzrdir but no branch or repository
135
146
            # XXX: Figure out what to do other than complain.