/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: 2019-06-03 23:48:08 UTC
  • mfrom: (7316 work)
  • mto: This revision was merged to the branch mainline in revision 7328.
  • Revision ID: jelmer@jelmer.uk-20190603234808-15yk5c7054tj8e2b
Merge trunk.

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,
25
26
    revision as _mod_revision,
26
27
    )
27
28
from .commands import Command
66
67
        count = 0
67
68
        with repo.lock_write():
68
69
            graph = repo.get_graph()
69
 
            repo.start_write_group()
70
 
            try:
 
70
            with _mod_repository.WriteGroup(repo):
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()
94
89
        self.outf.write(
95
90
            ngettext('Signed %d revision.\n', 'Signed %d revisions.\n',
96
91
                     count) % count)