~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/sign_my_commits.py

[merge] bzr.dev 1807

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Command which looks for unsigned commits by the current user, and signs them.
18
18
"""
19
19
 
 
20
from bzrlib import config, gpg
20
21
from bzrlib.commands import Command
21
 
import bzrlib.config
22
 
import bzrlib.errors as errors
23
 
import bzrlib.gpg
 
22
from bzrlib.bzrdir import BzrDir
24
23
from bzrlib.option import Option
25
24
 
26
25
 
44
43
 
45
44
    def run(self, location=None, committer=None, dry_run=False):
46
45
        if location is None:
47
 
            bzrdir = bzrlib.bzrdir.BzrDir.open_containing('.')[0]
 
46
            bzrdir = BzrDir.open_containing('.')[0]
48
47
        else:
49
48
            # Passed in locations should be exact
50
 
            bzrdir = bzrlib.bzrdir.BzrDir.open(location)
 
49
            bzrdir = BzrDir.open(location)
51
50
        branch = bzrdir.open_branch()
52
51
        repo = branch.repository
53
 
        config = bzrlib.config.BranchConfig(branch)
 
52
        branch_config = branch.get_config()
54
53
 
55
54
        if committer is None:
56
 
            committer = config.username()
57
 
 
58
 
        gpg_strategy = bzrlib.gpg.GPGStrategy(config)
 
55
            committer = branch_config.username()
 
56
        gpg_strategy = gpg.GPGStrategy(branch_config)
59
57
 
60
58
        count = 0
61
59
        repo.lock_write()