~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/gpg.py

  • Committer: Patch Queue Manager
  • Date: 2011-12-15 09:58:47 UTC
  • mfrom: (6372.1.5 904550-default-gpg-key)
  • Revision ID: pqm@pqm.ubuntu.com-20111215095847-ups4vccjrbfq6tvr
(jelmer) Fix GPG signing key to default to user identity again. (Vincent
 Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
import subprocess
28
28
 
29
29
from bzrlib import (
 
30
    config,
30
31
    errors,
31
32
    trace,
32
33
    ui,
181
182
            return False
182
183
 
183
184
    def _command_line(self):
 
185
        key = self._config_stack.get('gpg_signing_key')
 
186
        if key is None or key == 'default':
 
187
            # 'default' or not setting gpg_signing_key at all means we should
 
188
            # use the user email address
 
189
            key = config.extract_email_address(self._config_stack.get('email'))
184
190
        return [self._config_stack.get('gpg_signing_command'), '--clearsign',
185
 
                '-u', self._config_stack.get('gpg_signing_key')]
 
191
                '-u', key]
186
192
 
187
193
    def sign(self, content):
188
194
        if isinstance(content, unicode):