Merge lp:~therve/bzr-pipeline/optional-webbrowser into lp:bzr-pipeline

Proposed by Thomas Herve
Status: Merged
Merged at revision: not available
Proposed branch: lp:~therve/bzr-pipeline/optional-webbrowser
Merge into: lp:bzr-pipeline
Diff against target: 41 lines (+5/-4)
2 files modified
commands.py (+2/-2)
lp_submit.py (+3/-2)
To merge this branch: bzr merge lp:~therve/bzr-pipeline/optional-webbrowser
Reviewer Review Type Date Requested Status
Aaron Bentley Approve
Review via email: mp+18609@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Thomas Herve (therve) wrote :

This add a argument to run and submit to control the webbrowser.open.

Revision history for this message
Aaron Bentley (abentley) wrote :

You have not added an --open-webpage (or --no-open-webpage) option to the lp-submit command itself. Is this deliberate? If so, why?

Also, note that this command has been merged into bzr core as lp-propose, so it will be eliminated from pipeline soon.

review: Needs Information
Revision history for this message
Thomas Herve (therve) wrote :

Thanks for the review! It's somewhat deliberate, because we don't need it as our custom submit command will call lp_submit with the correct parameters, and not use the command line parameters.

Revision history for this message
Aaron Bentley (abentley) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thomas Herve wrote:
> Thanks for the review! It's somewhat deliberate, because we don't need it as our custom submit command will call lp_submit with the correct parameters, and not use the command line parameters.

Okay, I'll take it as-is. When you propose a similar change to bzr
core, I suggest changing Proposer to return the URL, and letting the
lp-propose command decide whether to open it in a web browser or print
it for the user or whatever.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkuAKukACgkQ0F+nu1YWqI2pbwCaA5i0+fMtYdcCTOrqvxxmnemm
LtsAni1ZSTMqc5YFB0OquDipiR2P0JrH
=LxMK
-----END PGP SIGNATURE-----

Revision history for this message
Aaron Bentley (abentley) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'commands.py'
2--- commands.py 2010-02-02 01:17:20 +0000
3+++ commands.py 2010-02-04 12:52:15 +0000
4@@ -384,7 +384,7 @@
5 takes_args = ['submit_branch?']
6
7 def run(self, submit_branch=None, review=None, staging=False,
8- message=None):
9+ message=None, open_webpage=True):
10 from bzrlib.plugins.pipeline import lp_submit
11 checkout, manager = self._get_checkout_manager(checkout_optional=True,
12 allow_tree=True)
13@@ -406,4 +406,4 @@
14 submitter = lp_submit.Submitter(checkout, manager, target, message,
15 reviews, staging)
16 submitter.check_submission()
17- submitter.submit()
18+ submitter.submit(open_webpage)
19
20=== modified file 'lp_submit.py'
21--- lp_submit.py 2009-12-18 22:28:50 +0000
22+++ lp_submit.py 2010-02-04 12:52:15 +0000
23@@ -247,7 +247,7 @@
24 'There is already a branch merge proposal: %s' %
25 canonical_url(mp))
26
27- def submit(self):
28+ def submit(self, open_webpage):
29 prev_pipe = self.manager.get_prev_pipe()
30 if prev_pipe is not None:
31 prerequisite_branch = MegaBranch.from_bzr(prev_pipe)
32@@ -278,7 +278,8 @@
33 break
34 print line
35 else:
36- webbrowser.open(canonical_url(mp))
37+ if open_webpage:
38+ webbrowser.open(canonical_url(mp))
39
40 def canonical_url(object):
41 url = object.self_link.replace('https://api.', 'https://code.')

Subscribers

People subscribed via source and target branches