~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/sign_my_commits.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-06-19 18:33:40 UTC
  • mfrom: (5972.3.25 get-ancestry-is-evil)
  • Revision ID: pqm@pqm.ubuntu.com-20110619183340-ds1rpql77nxrmo4n
(jelmer) Deprecate Repository.get_ancestry(). (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
lazy_import(globals(), """
22
22
from bzrlib import (
23
23
    bzrdir as _mod_bzrdir,
 
24
    errors,
24
25
    gpg,
 
26
    revision as _mod_revision,
25
27
    )
26
28
""")
27
29
from bzrlib.commands import Command
64
66
        count = 0
65
67
        repo.lock_write()
66
68
        try:
 
69
            graph = repo.get_graph()
67
70
            repo.start_write_group()
68
71
            try:
69
 
                for rev_id in repo.get_ancestry(branch.last_revision())[1:]:
 
72
                for rev_id, parents in graph.iter_ancestry(
 
73
                        [branch.last_revision()]):
 
74
                    if _mod_revision.is_null(rev_id):
 
75
                        continue
 
76
                    if parents is None:
 
77
                        # Ignore ghosts
 
78
                        continue
70
79
                    if repo.has_signature_for_revision_id(rev_id):
71
80
                        continue
72
81
                    rev = repo.get_revision(rev_id)