~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/push.py

  • Committer: Danny van Heumen
  • Date: 2010-03-09 21:42:11 UTC
  • mto: (4634.139.5 2.0)
  • mto: This revision was merged to the branch mainline in revision 5160.
  • Revision ID: danny@dannyvanheumen.nl-20100309214211-iqh42x6qcikgd9p3
Reverted now-useless TODO list.

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"
103
110
                    "\nYou may supply --create-prefix to create all"
104
111
                    " leading parent directories."
105
112
                    % location)
 
113
            # This shouldn't occur (because create_prefix is true, so
 
114
            # create_clone_on_transport should be catching NoSuchFile and
 
115
            # creating the missing directories) but if it does the original
 
116
            # NoSuchFile error will be more informative than an
 
117
            # UnboundLocalError for br_to.
 
118
            raise
106
119
        except errors.TooManyRedirections:
107
120
            raise errors.BzrCommandError("Too many redirections trying "
108
121
                                         "to make %s." % location)