Merge lp:~jelmer/hydrazine/bzr2.5-compat into lp:hydrazine

Proposed by Jelmer Vernooij
Status: Merged
Merged at revision: 102
Proposed branch: lp:~jelmer/hydrazine/bzr2.5-compat
Merge into: lp:hydrazine
Diff against target: 42 lines (+11/-6)
1 file modified
feed-pqm (+11/-6)
To merge this branch: bzr merge lp:~jelmer/hydrazine/bzr2.5-compat
Reviewer Review Type Date Requested Status
Martin Pool Approve
Review via email: mp+86547@code.launchpad.net

Description of the change

Fix compatibility with current versions of bzr 2.5, which use config stacks in SMTPConnection and GPG signing.

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

thanks
  vote approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'feed-pqm'
2--- feed-pqm 2011-10-18 13:40:41 +0000
3+++ feed-pqm 2011-12-21 11:33:27 +0000
4@@ -16,9 +16,7 @@
5 # TODO: some way to persistently say "not for me" and not be asked again
6
7
8-import datetime
9 import optparse
10-import os
11 import sys
12
13 try:
14@@ -38,8 +36,11 @@
15 atexit.register(context.__enter__().__exit__, None, None, None)
16
17 from bzrlib.email_message import EmailMessage
18-from bzrlib.config import GlobalConfig
19-from bzrlib import gpg
20+from bzrlib import (
21+ config as _mod_config,
22+ gpg,
23+ version_info as bzrlib_version,
24+ )
25 from bzrlib.smtp_connection import SMTPConnection
26
27 import hydrazine
28@@ -146,8 +147,12 @@
29 mp.target_branch.composePublicURL(scheme='http')))
30 print raw_message
31
32- config = GlobalConfig()
33- my_email = config.user_email()
34+ if bzrlib_version < (2, 5):
35+ config = _mod_config.GlobalConfig()
36+ my_email = config.user_email()
37+ else:
38+ config = _mod_config.GlobalStack()
39+ my_email = config.get('email')
40 print "Will send email from address <%s>" % (my_email,)
41 signer = gpg.GPGStrategy(config)
42 signed_message = signer.sign(raw_message.encode('utf8'))

Subscribers

People subscribed via source and target branches

to all changes: