Merge lp:~maxb/lpreview-body/fix-package into lp:~launchpad-committers/lpreview-body/packaging

Proposed by Max Bowsher
Status: Merged
Approved by: Gavin Panella
Approved revision: 23
Merged at revision: 23
Proposed branch: lp:~maxb/lpreview-body/fix-package
Merge into: lp:~launchpad-committers/lpreview-body/packaging
Diff against target: 108 lines (+39/-17)
4 files modified
__init__.py (+27/-16)
debian/changelog (+10/-0)
debian/control (+1/-0)
qa_ready.py (+1/-1)
To merge this branch: bzr merge lp:~maxb/lpreview-body/fix-package
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+59137@code.launchpad.net

Commit message

[r=allenap][bug=766149] New upstream snapshot (Use lazy hook installation with bzr >= 2.4; Correct regexp used for getting revno currently on edge); Add missing XB-Python-Version field to control, fixing incorrect installation path of the Python files.

Description of the change

Fix the package, which is currently totally broken due to installing the Python files in the incorrect directory.

Then, pull in a couple of upstream changes whilst we're rebuilding it anyway.

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) wrote :

I know almost nothing about the dirty work involved in packaging, but
a search led me to the following:

  The use of XB-Python-Version in the binary package paragraphs of
  debian/control file has been deprecated and should be removed in the
  normal course of package updates. It never achieved sufficient
  deployment to support it's intended purpose of managing Python
  transitions. This can be adequately accomplished by examining
  package dependencies.

  http://www.debian.org/doc/packaging-manuals/python-policy/ch-module_packages.html

Should you instead be using X-Python-Version?

review: Needs Information
Revision history for this message
Max Bowsher (maxb) wrote :

> The use of XB-Python-Version in the binary package paragraphs of
> debian/control file has been deprecated
...
> Should you instead be using X-Python-Version?

If we were targetting Debian sid or Ubuntu natty, then yes. However this packaging is specifically using forms that are now considered deprecated in order to target Ubuntu >= lucid.

Revision history for this message
Gavin Panella (allenap) wrote :

Thanks for the explanation.

review: Approve
Revision history for this message
Gavin Panella (allenap) wrote :

Do you need someone to land this for you?

Revision history for this message
Max Bowsher (maxb) wrote :

> Do you need someone to land this for you?

Currently yes, though Robert implied I could be given write access to the branch in bug 766149.

Revision history for this message
Gavin Panella (allenap) wrote :

Okay, set a commit message and I'll send it off.

Revision history for this message
Gavin Panella (allenap) wrote :

Max, I had to squish the commit message because PQM, bless its cotton socks, can't deal with more than a single line at a time.

Revision history for this message
Max Bowsher (maxb) wrote :

PQM hasn't been used on this branch before, and I now have commit access. Can you see any reason why I shouldn't just push these revisions at the branch directly?

Revision history for this message
Gavin Panella (allenap) wrote :

No, just land it then. Sorry for the bother!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '__init__.py'
2--- __init__.py 2010-08-04 10:58:33 +0000
3+++ __init__.py 2011-04-26 22:01:28 +0000
4@@ -16,8 +16,7 @@
5
6 """Provide review message bodies for proposed merges to Launchpad itself."""
7
8-from bzrlib import commands, merge_directive
9-
10+from bzrlib import commands
11
12 def shim(params):
13 from body_callback import body_callback
14@@ -31,25 +30,37 @@
15 hook_params['old_body'])
16
17
18-if getattr(merge_directive.MergeDirective, 'hooks', None) is not None:
19- merge_directive.MergeDirective.hooks.install_named_hook(
20- 'merge_request_body',
21- shim, 'Generate a message body for Launchpad merge requests.'
22- )
23 try:
24- from bzrlib.plugins.launchpad import lp_propose
25-except ImportError:
26- pass
27+ from bzrlib.hooks import install_lazy_named_hook
28+except ImportError: # bzr < 2.4
29+ from bzrlib import merge_directive
30+ if getattr(merge_directive.MergeDirective, 'hooks', None) is not None:
31+ merge_directive.MergeDirective.hooks.install_named_hook(
32+ 'merge_request_body',
33+ shim, 'Generate a message body for Launchpad merge requests.'
34+ )
35+ try:
36+ from bzrlib.plugins.launchpad import lp_propose
37+ except ImportError:
38+ pass
39+ else:
40+ lp_propose.Proposer.hooks.install_named_hook(
41+ 'merge_proposal_body',
42+ proposer_callback,
43+ 'Generate a message body for Launchpad merge requests.'
44+ )
45 else:
46- lp_propose.Proposer.hooks.install_named_hook(
47- 'merge_proposal_body',
48- proposer_callback,
49- 'Generate a message body for Launchpad merge requests.'
50- )
51+ install_lazy_named_hook(
52+ "bzrlib.merge_directive", "MergeDirective.hooks",
53+ 'merge_request_body',
54+ shim, 'Generate a message body for Launchpad merge requests.')
55+ install_lazy_named_hook(
56+ "bzrlib.plugins.launcjpad.lp_propose", "Proposer.hooks",
57+ 'merge_proposal_body', proposer_callback,
58+ 'Generate a message body for Launchpad merge requests.')
59
60
61 commands.plugin_cmds.register_lazy(
62 'cmd_qa_ready', [], 'bzrlib.plugins.lpreview_body.qa_ready')
63-
64 commands.plugin_cmds.register_lazy(
65 'cmd_lp_link_bug', [], 'bzrlib.plugins.lpreview_body.link_bug')
66
67=== modified file 'debian/changelog'
68--- debian/changelog 2010-08-05 09:06:04 +0000
69+++ debian/changelog 2011-04-26 22:01:28 +0000
70@@ -1,3 +1,13 @@
71+bzr-lpreview-body (0.1~bzr22-0launchpad1) lucid; urgency=low
72+
73+ * Add missing XB-Python-Version field to control, fixing incorrect
74+ installation path of the Python files. (LP: #766149)
75+ * New upstream snapshot:
76+ - Use lazy hook installation with bzr >= 2.4.
77+ - Correct regexp used for getting revno currently on edge.
78+
79+ -- Max Bowsher <maxb@f2s.com> Tue, 26 Apr 2011 22:53:48 +0100
80+
81 bzr-lpreview-body (0.1~bzr20-0ubuntu1~launchpad1) lucid; urgency=low
82
83 * Initial release.
84
85=== modified file 'debian/control'
86--- debian/control 2010-08-04 11:03:39 +0000
87+++ debian/control 2011-04-26 22:01:28 +0000
88@@ -10,6 +10,7 @@
89 Package: bzr-lpreview-body
90 Architecture: all
91 Depends: bzr, ${misc:Depends}
92+XB-Python-Version: ${python:Versions}
93 Description: Bazaar plugin to provide review message bodies for Launchpad
94 This Bazaar plugin generates a standard template for the message body, with
95 lint output at the bottom.
96
97=== modified file 'qa_ready.py'
98--- qa_ready.py 2010-04-21 22:53:07 +0000
99+++ qa_ready.py 2011-04-26 22:01:28 +0000
100@@ -32,7 +32,7 @@
101 """
102 t = get_transport('https://edge.launchpad.net/')
103 html = t.get_bytes('index.html')
104- revision_re = re.compile(r'\(r(\d+)\)')
105+ revision_re = re.compile(r' +r(\d+)')
106 for line in html.splitlines():
107 matches = revision_re.search(line)
108 if matches:

Subscribers

People subscribed via source and target branches

to all changes: