/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/push.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
from __future__ import absolute_import
20
20
 
21
 
from bzrlib import (
 
21
from . import (
22
22
    controldir,
23
23
    errors,
24
24
    revision as _mod_revision,
25
25
    transport,
26
26
    )
27
 
from bzrlib.trace import (
 
27
from .trace import (
28
28
    note,
29
29
    warning,
30
30
    )
31
 
from bzrlib.i18n import gettext
 
31
from .i18n import gettext
32
32
 
33
33
 
34
34
class PushResult(object):
92
92
                revision_id=revision_id, stacked_on=stacked_on,
93
93
                create_prefix=create_prefix, use_existing_dir=use_existing_dir,
94
94
                no_tree=no_tree)
95
 
        except errors.AlreadyControlDirError, err:
 
95
        except errors.AlreadyControlDirError as err:
96
96
            raise errors.BzrCommandError(gettext(
97
97
                "Target directory %s already contains a .bzr directory, "
98
98
                "but it is not valid.") % (location,))
99
 
        except errors.FileExists, err:
 
99
        except errors.FileExists as err:
100
100
            if not use_existing_dir:
101
101
                raise errors.BzrCommandError(gettext("Target directory %s"
102
102
                     " already exists, but does not have a .bzr"
146
146
                remember, create_prefix)
147
147
        except errors.DivergedBranches:
148
148
            raise errors.BzrCommandError(gettext('These branches have diverged.'
149
 
                                    '  See "bzr help diverged-branches"'
 
149
                                    '  See "brz help diverged-branches"'
150
150
                                    ' for more information.'))
151
 
        except errors.NoRoundtrippingSupport, e:
 
151
        except errors.NoRoundtrippingSupport as e:
152
152
            raise errors.BzrCommandError(gettext("It is not possible to losslessly "
153
153
                "push to %s. You may want to use dpush instead.") % 
154
154
                    e.target_branch.mapping.vcs.abbreviation)
161
161
                " directory out of the way and try again.") % location)
162
162
        if push_result.workingtree_updated == False:
163
163
            warning("This transport does not update the working " 
164
 
                    "tree of: %s. See 'bzr help working-trees' for "
 
164
                    "tree of: %s. See 'brz help working-trees' for "
165
165
                    "more information." % push_result.target_branch.base)
166
166
    push_result.report(to_file)
167
167
    if verbose:
168
168
        br_to = push_result.target_branch
169
169
        br_to.lock_read()
170
170
        try:
171
 
            from bzrlib.log import show_branch_change
 
171
            from .log import show_branch_change
172
172
            show_branch_change(br_to, to_file, push_result.old_revno, 
173
173
                               push_result.old_revid)
174
174
        finally: