~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/sign_my_commits.py

  • Committer: Jonathan Riddell
  • Date: 2011-06-15 16:14:59 UTC
  • mto: (5971.2.3 bzr-gpgme)
  • mto: This revision was merged to the branch mainline in revision 6003.
  • Revision ID: jriddell@canonical.com-20110615161459-9q2ownx1qbj7ov9o
add acceptable-keys option

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
    Verifies that all commits in the branch are signed by known GnuPG keys.
95
95
    """
96
96
 
97
 
    def run(self):
 
97
    takes_options = [
 
98
            Option('acceptable-keys',
 
99
                   help='Comma separated list of GPG key patterns which are'
 
100
                        ' acceptable for verification.',
 
101
                   short_name='k',
 
102
                   type=str,),
 
103
            ]
 
104
 
 
105
    def run(self, acceptable_keys=None):
98
106
        bzrdir = _mod_bzrdir.BzrDir.open_containing('.')[0]
99
107
        branch = bzrdir.open_branch()
100
108
        repo = branch.repository
101
109
        branch_config = branch.get_config()
102
110
 
103
111
        gpg_strategy = gpg.GPGStrategy(branch_config)
104
 
        ##gpg_strategy.addacceptablekeys()
 
112
        if acceptable_keys is not None:
 
113
            gpg_strategy.set_acceptable_keys(acceptable_keys)
105
114
 
106
115
        count = {gpg.SIGNATURE_VALID: 0,
107
116
                 gpg.SIGNATURE_KEY_MISSING: 0,