/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 bzrlib/sign_my_commits.py

  • Committer: Martin Pool
  • Date: 2006-06-10 23:16:19 UTC
  • mfrom: (1759 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1761.
  • Revision ID: mbp@sourcefrog.net-20060610231619-05b997deeb005d02
[merge] bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
        gpg_strategy = bzrlib.gpg.GPGStrategy(config)
59
59
 
60
60
        count = 0
61
 
        for rev_id in repo.get_ancestry(branch.last_revision())[1:]:
62
 
            if repo.has_signature_for_revision_id(rev_id):
63
 
                continue
64
 
            
65
 
            rev = repo.get_revision(rev_id)
66
 
            if rev.committer != committer:
67
 
                continue
68
 
 
69
 
            # We have a revision without a signature who has a 
70
 
            # matching committer, start signing
71
 
            print rev_id
72
 
            count += 1
73
 
            if not dry_run:
74
 
                repo.sign_revision(rev_id, gpg_strategy)
 
61
        repo.lock_write()
 
62
        try:
 
63
            for rev_id in repo.get_ancestry(branch.last_revision())[1:]:
 
64
                if repo.has_signature_for_revision_id(rev_id):
 
65
                    continue
 
66
                rev = repo.get_revision(rev_id)
 
67
                if rev.committer != committer:
 
68
                    continue
 
69
                # We have a revision without a signature who has a 
 
70
                # matching committer, start signing
 
71
                print rev_id
 
72
                count += 1
 
73
                if not dry_run:
 
74
                    repo.sign_revision(rev_id, gpg_strategy)
 
75
        finally:
 
76
            repo.unlock()
75
77
        print 'Signed %d revisions' % (count,)
76
78
 
77
79