Merge lp://qastaging/~sinzui/bzr-gtk/gpush-do-push into lp://qastaging/bzr-gtk

Proposed by Curtis Hovey
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 799
Merged at revision: 788
Proposed branch: lp://qastaging/~sinzui/bzr-gtk/gpush-do-push
Merge into: lp://qastaging/bzr-gtk
Diff against target: 209 lines (+146/-31)
2 files modified
push.py (+51/-31)
tests/test_push.py (+95/-0)
To merge this branch: bzr merge lp://qastaging/~sinzui/bzr-gtk/gpush-do-push
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) Approve
Review via email: mp+96928@code.qastaging.launchpad.net

Description of the change

Update gpush.do_push to use fast, non-deprecated calls.

do_push() call branch.revision_history() and and PullResult.__init__
which are deprecated. Working with revision_history slows down the push.

--------------------------------------------------------------------

RULES

    * Add tests for the current do_push().
    * Base a new do_push on bzrlib.push which uses create_clone_on_transport
      or push_branch to do the task and it is much faster.
      * Do not call deprecated methods.
    * Remove the old do_push() with the new do_push() when the tests pass for
      both.
    * Provide a better method to show messages about the push to the user.

QA

    BZR_PLUGINS_AT=gtk@./ bzr gpush

IMPLEMENTATION

The diff is a little surprising since I had the new and old do_push
method running in parallel for a time. I struggled writing tests that
setup the three main condition of the old do_push(). The methods
push_branch() and create_clone_on_transport() handle some of the
try-except and if-else rules of the old do_push method. I had to add a
method the create a PushResult to ensure consistent data was available
to make a message. The message function makes a message for the UI based
on the old do_push message and the messages that were created for the
text UI when using `bzr push`.

To post a comment you must log in.
799. By Curtis Hovey

Merged trunk.

Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: