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
=== modified file 'feed-pqm'
--- feed-pqm 2011-10-18 13:40:41 +0000
+++ feed-pqm 2011-12-21 11:33:27 +0000
@@ -16,9 +16,7 @@
16# TODO: some way to persistently say "not for me" and not be asked again16# TODO: some way to persistently say "not for me" and not be asked again
1717
1818
19import datetime
20import optparse19import optparse
21import os
22import sys20import sys
2321
24try:22try:
@@ -38,8 +36,11 @@
38 atexit.register(context.__enter__().__exit__, None, None, None)36 atexit.register(context.__enter__().__exit__, None, None, None)
3937
40from bzrlib.email_message import EmailMessage38from bzrlib.email_message import EmailMessage
41from bzrlib.config import GlobalConfig39from bzrlib import (
42from bzrlib import gpg40 config as _mod_config,
41 gpg,
42 version_info as bzrlib_version,
43 )
43from bzrlib.smtp_connection import SMTPConnection44from bzrlib.smtp_connection import SMTPConnection
4445
45import hydrazine46import hydrazine
@@ -146,8 +147,12 @@
146 mp.target_branch.composePublicURL(scheme='http')))147 mp.target_branch.composePublicURL(scheme='http')))
147 print raw_message148 print raw_message
148149
149 config = GlobalConfig()150 if bzrlib_version < (2, 5):
150 my_email = config.user_email()151 config = _mod_config.GlobalConfig()
152 my_email = config.user_email()
153 else:
154 config = _mod_config.GlobalStack()
155 my_email = config.get('email')
151 print "Will send email from address <%s>" % (my_email,)156 print "Will send email from address <%s>" % (my_email,)
152 signer = gpg.GPGStrategy(config)157 signer = gpg.GPGStrategy(config)
153 signed_message = signer.sign(raw_message.encode('utf8'))158 signed_message = signer.sign(raw_message.encode('utf8'))

Subscribers

People subscribed via source and target branches

to all changes: