Merge lp:~mbp/launchpad/mbp-trivial into lp:launchpad

Proposed by Martin Pool
Status: Merged
Approved by: Deryck Hodge
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~mbp/launchpad/mbp-trivial
Merge into: lp:launchpad
Diff against target: 21 lines (+4/-0)
1 file modified
lib/devscripts/sourcecode.py (+4/-0)
To merge this branch: bzr merge lp:~mbp/launchpad/mbp-trivial
Reviewer Review Type Date Requested Status
Deryck Hodge (community) code Approve
Review via email: mp+12732@code.launchpad.net

Commit message

Show progress when updating bzr branches from rocketfuel-setup.

To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

This script, run from rocketfuel-setup, reimplements something like bzr branch and ought to set up a uifactory so it can show progress.

Revision history for this message
Deryck Hodge (deryck) wrote :

Hi, Martin.

Welcome to Launchpad development! :)

This looks nice. It's a small change with a nice benefit.

I don't want to be too nit-picky about such a small diff, but our style guidelines would have us format the function call differently:

ui.ui_factory = ui.make_ui_for_terminal(
    sys.stdin, sys.stdout, sys.stderr)

See https://dev.launchpad.net/PythonStyleGuide#Multiline%20function%20calls.

Other than this very minor thing, it looks ready to land. Thanks again!

Cheers,
deryck

review: Approve (code)
Revision history for this message
Martin Pool (mbp) wrote :

Thanks for the speedy review. I've updated it.

bjornt asked offline why this line is useful. The reason is that bzrlib defaults to a SilentUI that prints nothing. With this change, if you're on a tty, it will show progress bars and network activity while branching.

Revision history for this message
Martin Pool (mbp) wrote :

@deryck, could you land this for me?

Revision history for this message
Deryck Hodge (deryck) wrote :

Martin,

Sure, when PQM opens again, I'll land it. Sorry I missed doing it before now. Been meaning to, but just failed. Sorry.

Cheers,
deryck

Revision history for this message
Martin Pool (mbp) wrote :

2009/12/3 Deryck Hodge <email address hidden>:
> Martin,
>
> Sure, when PQM opens again, I'll land it.  Sorry I missed doing it before now.  Been meaning to, but just failed.  Sorry.

No problem, thanks very much.
--
Martin <http://launchpad.net/~mbp/>

Revision history for this message
Martin Pool (mbp) wrote :

OK, I've re-pushed with a merge from launchpad devel. Could you please resubmit?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/devscripts/sourcecode.py'
2--- lib/devscripts/sourcecode.py 2009-11-25 16:32:51 +0000
3+++ lib/devscripts/sourcecode.py 2009-12-09 07:48:18 +0000
4@@ -22,6 +22,7 @@
5 from bzrlib.revisionspec import RevisionSpec
6 from bzrlib.trace import report_exception
7 from bzrlib.transport import get_transport
8+from bzrlib import ui
9 from bzrlib.workingtree import WorkingTree
10
11 from devscripts import get_launchpad_root
12@@ -276,6 +277,9 @@
13 parser.error("Too many arguments.")
14 print 'Sourcecode: %s' % (sourcecode_directory,)
15 print 'Config: %s' % (config_filename,)
16+ # Tell bzr to use the terminal (if any) to show progress bars
17+ ui.ui_factory = ui.make_ui_for_terminal(
18+ sys.stdin, sys.stdout, sys.stderr)
19 load_plugins()
20 update_sourcecode(
21 sourcecode_directory, config_filename,