Merge lp:~sinzui/bzr-gtk/gpush-do-push into lp:bzr-gtk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Jelmer Vernooij | ||||
Approved revision: | 799 | ||||
Merged at revision: | 788 | ||||
Proposed branch: | lp:~sinzui/bzr-gtk/gpush-do-push | ||||
Merge into: | lp: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:~sinzui/bzr-gtk/gpush-do-push | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jelmer Vernooij (community) | Approve | ||
Review via email: mp+96928@code.launchpad.net |
Description of the change
Update gpush.do_push to use fast, non-deprecated calls.
do_push() call branch.
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_
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_
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_
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`.