/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/push.py

  • Committer: Martin Pool
  • Date: 2009-01-13 05:16:26 UTC
  • mfrom: (3936 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3940.
  • Revision ID: mbp@sourcefrog.net-20090113051626-0d5q6luqdoyx4xaf
Fix recommend_upgrade ui and merge trunk

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
147
146
        # (We don't need to successfully push because of possible divergence.)
148
147
        if br_from.get_push_location() is None or remember:
149
148
            br_from.set_push_location(br_to.base)
150
 
        if verbose:
151
 
            old_rh = br_to.revision_history()
152
149
        try:
153
150
            try:
154
151
                tree_to = dir_to.open_workingtree()
174
171
                                    '  Try using "merge" and then "push".')
175
172
    if push_result is not None:
176
173
        push_result.report(to_file)
177
 
    elif verbose:
178
 
        new_rh = br_to.revision_history()
179
 
        if old_rh != new_rh:
180
 
            # Something changed
181
 
            from bzrlib.log import show_changed_revisions
182
 
            show_changed_revisions(br_to, old_rh, new_rh,
183
 
                                   to_file=to_file)
 
174
        old_revid = push_result.old_revid
 
175
        old_revno = push_result.old_revno
184
176
    else:
185
 
        # we probably did a clone rather than a push, so a message was
186
 
        # emitted above
187
 
        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()