~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-12-03 05:08:05 UTC
  • mfrom: (4854.1.1 merge-2.0-into-devel)
  • Revision ID: pqm@pqm.ubuntu.com-20091203050805-s70sybyrsrbbs10c
(andrew) Merge lp:bzr/2.0 into 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"