/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 breezy/commit_signature_commands.py

  • Committer: Jelmer Vernooij
  • Date: 2018-11-18 18:55:35 UTC
  • mto: This revision was merged to the branch mainline in revision 7197.
  • Revision ID: jelmer@jelmer.uk-20181118185535-2v2fm7cpykhzdbkp
Fix index page for API.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
    controldir,
23
23
    errors,
24
24
    gpg,
25
 
    repository as _mod_repository,
26
25
    revision as _mod_revision,
27
26
    )
28
27
from .commands import Command
67
66
        count = 0
68
67
        with repo.lock_write():
69
68
            graph = repo.get_graph()
70
 
            with _mod_repository.WriteGroup(repo):
 
69
            repo.start_write_group()
 
70
            try:
71
71
                for rev_id, parents in graph.iter_ancestry(
72
72
                        [branch.last_revision()]):
73
73
                    if _mod_revision.is_null(rev_id):
86
86
                    count += 1
87
87
                    if not dry_run:
88
88
                        repo.sign_revision(rev_id, gpg_strategy)
 
89
            except BaseException:
 
90
                repo.abort_write_group()
 
91
                raise
 
92
            else:
 
93
                repo.commit_write_group()
89
94
        self.outf.write(
90
95
            ngettext('Signed %d revision.\n', 'Signed %d revisions.\n',
91
96
                     count) % count)