~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/push.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-11-17 03:20:35 UTC
  • mfrom: (4792.4.3 456036)
  • Revision ID: pqm@pqm.ubuntu.com-20091117032035-s3sgtlixj1lrminn
(Gordon Tyler) Fix IndexError during 'bzr ignore /' (#456036)

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, 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,))
 
93
        except errors.FileExists:
98
94
            if not use_existing_dir:
99
95
                raise errors.BzrCommandError("Target directory %s"
100
 
                     " already exists, but does not have a .bzr"
 
96
                     " already exists, but does not have a valid .bzr"
101
97
                     " directory. Supply --use-existing-dir to push"
102
98
                     " 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
106
99
        except errors.NoSuchFile:
107
100
            if not create_prefix:
108
101
                raise errors.BzrCommandError("Parent directory of %s"
137
130
            raise errors.BzrCommandError('These branches have diverged.'
138
131
                                    '  See "bzr help diverged-branches"'
139
132
                                    ' 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)
144
133
        except errors.NoRepositoryPresent:
145
134
            # we have a bzrdir but no branch or repository
146
135
            # XXX: Figure out what to do other than complain.