~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/push.py

  • Committer: Frank Aspell
  • Date: 2009-02-17 11:40:05 UTC
  • mto: (4054.1.1 doc)
  • mto: This revision was merged to the branch mainline in revision 4056.
  • Revision ID: frankaspell@googlemail.com-20090217114005-ojufrp6rqht664um
Fixed typos.

Fixed some typos in bzr doc's using "aspell -l en -c FILENAME".

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""UI helper for the push command."""
18
18
 
19
 
from bzrlib import builtins, bzrdir, errors, transport
 
19
from bzrlib import (builtins, bzrdir, errors, revision as _mod_revision,
 
20
                    transport)
20
21
from bzrlib.trace import note, warning
21
22
 
22
23
 
63
64
            repository_to = br_to.repository
64
65
 
65
66
    push_result = None
66
 
    if verbose:
67
 
        old_rh = []
68
67
    if dir_to is None:
69
68
        # The destination doesn't exist; create it.
70
69
        # XXX: Refactor the create_prefix/no_create_prefix code into a
74
73
            transport.mkdir('.')
75
74
            return transport
76
75
 
77
 
        def redirected(redirected_transport, e, redirection_notice):
78
 
            return transport.get_transport(e.get_target_url())
 
76
        def redirected(transport, e, redirection_notice):
 
77
            note(redirection_notice)
 
78
            return transport._redirected_to(e.source, e.target)
79
79
 
80
80
        try:
81
81
            to_transport = transport.do_catching_redirections(
146
146
        # (We don't need to successfully push because of possible divergence.)
147
147
        if br_from.get_push_location() is None or remember:
148
148
            br_from.set_push_location(br_to.base)
149
 
        if verbose:
150
 
            old_rh = br_to.revision_history()
151
149
        try:
152
150
            try:
153
151
                tree_to = dir_to.open_workingtree()
173
171
                                    '  Try using "merge" and then "push".')
174
172
    if push_result is not None:
175
173
        push_result.report(to_file)
176
 
    elif verbose:
177
 
        new_rh = br_to.revision_history()
178
 
        if old_rh != new_rh:
179
 
            # Something changed
180
 
            from bzrlib.log import show_changed_revisions
181
 
            show_changed_revisions(br_to, old_rh, new_rh,
182
 
                                   to_file=to_file)
 
174
        old_revid = push_result.old_revid
 
175
        old_revno = push_result.old_revno
183
176
    else:
184
 
        # we probably did a clone rather than a push, so a message was
185
 
        # emitted above
186
 
        pass
 
177
        old_revid = _mod_revision.NULL_REVISION
 
178
        old_revno = 0
 
179
    if verbose:
 
180
        br_to.lock_read()
 
181
        try:
 
182
            from bzrlib.log import show_branch_change
 
183
            show_branch_change(br_to, to_file, old_revno, old_revid)
 
184
        finally:
 
185
            br_to.unlock()