/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to commit.py

  • Committer: Jelmer Vernooij
  • Date: 2018-03-11 22:20:47 UTC
  • mto: (0.200.1889 work)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@jelmer.uk-20180311222047-2x9npn5aumwch2jb
Support signing commits.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
    entry_factory,
30
30
    )
31
31
from ... import (
 
32
    config as _mod_config,
 
33
    gpg,
32
34
    osutils,
33
35
    revision as _mod_revision,
34
36
    )
227
229
        c.commit_timezone = self._timezone
228
230
        c.author_timezone = self._timezone
229
231
        c.message = message.encode(c.encoding)
 
232
        if self._config_stack.get('create_signatures') == _mod_config.SIGN_ALWAYS:
 
233
            strategy = gpg.GPGStrategy(self._config_stack)
 
234
            c.gpgsig = strategy.sign(c.as_raw_string(), gpg.MODE_DETACH)
230
235
        assert len(c.id) == 40
231
236
        self.store.add_object(c)
232
237
        self.repository.commit_write_group()