~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/push.py

  • Committer: John Arbash Meinel
  • Date: 2011-09-12 18:40:02 UTC
  • mfrom: (6132 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6133.
  • Revision ID: john@arbash-meinel.com-20110912184002-o23eu21fdgp35h2q
Merge bzr.dev, resolve release-notes (aka NEWS) conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
    note,
27
27
    warning,
28
28
    )
29
 
from bzrlib.i18n import gettext
30
29
 
31
30
 
32
31
class PushResult(object):
48
47
        """Write a human-readable description of the result."""
49
48
        if self.branch_push_result is None:
50
49
            if self.stacked_on is not None:
51
 
                note(gettext('Created new stacked branch referring to %s.') %
 
50
                note('Created new stacked branch referring to %s.' %
52
51
                    self.stacked_on)
53
52
            else:
54
 
                note(gettext('Created new branch.'))
 
53
                note('Created new branch.')
55
54
        else:
56
55
            self.branch_push_result.report(to_file)
57
56
 
92
91
                no_tree=no_tree)
93
92
        except errors.FileExists, err:
94
93
            if err.path.endswith('/.bzr'):
95
 
                raise errors.BzrCommandError(gettext(
 
94
                raise errors.BzrCommandError(
96
95
                    "Target directory %s already contains a .bzr directory, "
97
 
                    "but it is not valid.") % (location,))
 
96
                    "but it is not valid." % (location,))
98
97
            if not use_existing_dir:
99
 
                raise errors.BzrCommandError(gettext("Target directory %s"
 
98
                raise errors.BzrCommandError("Target directory %s"
100
99
                     " already exists, but does not have a .bzr"
101
100
                     " directory. Supply --use-existing-dir to push"
102
 
                     " there anyway.") % location)
 
101
                     " there anyway." % location)
103
102
            # This shouldn't occur, but if it does the FileExists error will be
104
103
            # more informative than an UnboundLocalError for br_to.
105
104
            raise
106
105
        except errors.NoSuchFile:
107
106
            if not create_prefix:
108
 
                raise errors.BzrCommandError(gettext("Parent directory of %s"
 
107
                raise errors.BzrCommandError("Parent directory of %s"
109
108
                    " does not exist."
110
109
                    "\nYou may supply --create-prefix to create all"
111
 
                    " leading parent directories.")
 
110
                    " leading parent directories."
112
111
                    % location)
113
112
            # This shouldn't occur (because create_prefix is true, so
114
113
            # create_clone_on_transport should be catching NoSuchFile and
117
116
            # UnboundLocalError for br_to.
118
117
            raise
119
118
        except errors.TooManyRedirections:
120
 
            raise errors.BzrCommandError(gettext("Too many redirections trying "
121
 
                                         "to make %s.") % location)
 
119
            raise errors.BzrCommandError("Too many redirections trying "
 
120
                                         "to make %s." % location)
122
121
        push_result = PushResult()
123
122
        # TODO: Some more useful message about what was copied
124
123
        try:
142
141
            push_result = dir_to.push_branch(br_from, revision_id, overwrite, 
143
142
                remember, create_prefix)
144
143
        except errors.DivergedBranches:
145
 
            raise errors.BzrCommandError(gettext('These branches have diverged.'
 
144
            raise errors.BzrCommandError('These branches have diverged.'
146
145
                                    '  See "bzr help diverged-branches"'
147
 
                                    ' for more information.'))
 
146
                                    ' for more information.')
148
147
        except errors.NoRoundtrippingSupport, e:
149
 
            raise errors.BzrCommandError(gettext("It is not possible to losslessly "
150
 
                "push to %s. You may want to use dpush instead.") % 
 
148
            raise errors.BzrCommandError("It is not possible to losslessly "
 
149
                "push to %s. You may want to use dpush instead." % 
151
150
                    e.target_branch.mapping.vcs.abbreviation)
152
151
        except errors.NoRepositoryPresent:
153
152
            # we have a bzrdir but no branch or repository
154
153
            # XXX: Figure out what to do other than complain.
155
 
            raise errors.BzrCommandError(gettext("At %s you have a valid .bzr"
 
154
            raise errors.BzrCommandError("At %s you have a valid .bzr"
156
155
                " control directory, but not a branch or repository. This"
157
156
                " is an unsupported configuration. Please move the target"
158
 
                " directory out of the way and try again.") % location)
 
157
                " directory out of the way and try again." % location)
159
158
        if push_result.workingtree_updated == False:
160
159
            warning("This transport does not update the working " 
161
160
                    "tree of: %s. See 'bzr help working-trees' for "