~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/sign_my_commits.py

Move doctest import to increase speed

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
21
20
from bzrlib.commands import Command
22
 
from bzrlib.bzrdir import BzrDir
 
21
import bzrlib.config
 
22
import bzrlib.errors as errors
 
23
import bzrlib.gpg
23
24
from bzrlib.option import Option
24
25
 
25
26
 
43
44
 
44
45
    def run(self, location=None, committer=None, dry_run=False):
45
46
        if location is None:
46
 
            bzrdir = BzrDir.open_containing('.')[0]
 
47
            bzrdir = bzrlib.bzrdir.BzrDir.open_containing('.')[0]
47
48
        else:
48
49
            # Passed in locations should be exact
49
 
            bzrdir = BzrDir.open(location)
 
50
            bzrdir = bzrlib.bzrdir.BzrDir.open(location)
50
51
        branch = bzrdir.open_branch()
51
52
        repo = branch.repository
52
 
        branch_config = branch.get_config()
 
53
        config = bzrlib.config.BranchConfig(branch)
53
54
 
54
55
        if committer is None:
55
 
            committer = branch_config.username()
56
 
        gpg_strategy = gpg.GPGStrategy(branch_config)
 
56
            committer = config.username()
 
57
 
 
58
        gpg_strategy = bzrlib.gpg.GPGStrategy(config)
57
59
 
58
60
        count = 0
59
61
        repo.lock_write()