~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit_signature_commands.py

  • Committer: Martin Packman
  • Date: 2012-01-05 09:50:04 UTC
  • mfrom: (6424 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6426.
  • Revision ID: martin.packman@canonical.com-20120105095004-mia9xb7y0efmto0v
Merge bzr.dev to resolve conflicts in bzrlib.builtins

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 __future__ import absolute_import
 
21
 
20
22
from bzrlib.lazy_import import lazy_import
21
23
lazy_import(globals(), """
22
24
from bzrlib import (
23
 
    bzrdir as _mod_bzrdir,
 
25
    controldir,
24
26
    errors,
25
27
    gpg,
26
28
    revision as _mod_revision,
51
53
 
52
54
    def run(self, location=None, committer=None, dry_run=False):
53
55
        if location is None:
54
 
            bzrdir = _mod_bzrdir.BzrDir.open_containing('.')[0]
 
56
            bzrdir = controldir.ControlDir.open_containing('.')[0]
55
57
        else:
56
58
            # Passed in locations should be exact
57
 
            bzrdir = _mod_bzrdir.BzrDir.open(location)
 
59
            bzrdir = controldir.ControlDir.open(location)
58
60
        branch = bzrdir.open_branch()
59
61
        repo = branch.repository
60
62
        branch_config = branch.get_config()
61
63
 
62
64
        if committer is None:
63
65
            committer = branch_config.username()
64
 
        gpg_strategy = gpg.GPGStrategy(branch_config)
 
66
        gpg_strategy = gpg.GPGStrategy(branch.get_config_stack())
65
67
 
66
68
        count = 0
67
69
        repo.lock_write()
116
118
 
117
119
    def run(self, acceptable_keys=None, revision=None, verbose=None,
118
120
                                                            location=u'.'):
119
 
        bzrdir = _mod_bzrdir.BzrDir.open_containing(location)[0]
 
121
        bzrdir = controldir.ControlDir.open_containing(location)[0]
120
122
        branch = bzrdir.open_branch()
121
123
        repo = branch.repository
122
 
        branch_config = branch.get_config()
 
124
        branch_config = branch.get_config_stack()
123
125
        gpg_strategy = gpg.GPGStrategy(branch_config)
124
126
 
125
127
        gpg_strategy.set_acceptable_keys(acceptable_keys)
141
143
                if to_revid is None:
142
144
                    to_revno = branch.revno()
143
145
                if from_revno is None or to_revno is None:
144
 
                    raise errors.BzrCommandError('Cannot verify a range of '\
145
 
                                               'non-revision-history revisions')
 
146
                    raise errors.BzrCommandError(gettext(
 
147
                    'Cannot verify a range of non-revision-history revisions'))
146
148
                for revno in range(from_revno, to_revno + 1):
147
149
                    revisions.append(branch.get_rev_id(revno))
148
150
        else: