~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revision.py

  • Committer: John Arbash Meinel
  • Date: 2006-07-30 13:54:37 UTC
  • mto: (1946.2.6 reduce-knit-churn)
  • mto: This revision was merged to the branch mainline in revision 1898.
  • Revision ID: john@arbash-meinel.com-20060730135437-1d722abdb14bff76
(jelmer) Install new intertree tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005, 2006 Canonical
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
28
28
 
29
29
NULL_REVISION="null:"
30
30
 
31
 
 
32
31
class Revision(object):
33
32
    """Single revision on a branch.
34
33
 
118
117
    revisions_source is an object supporting a get_revision operation that
119
118
    behaves like Branch's.
120
119
    """
121
 
    return (candidate_id in branch.repository.get_ancestry(revision_id))
 
120
    return candidate_id in branch.repository.get_ancestry(revision_id)
122
121
 
123
122
 
124
123
def iter_ancestors(revision_id, revision_source, only_present=False):
154
153
    anc_iter = enumerate(iter_ancestors(revision_id, revision_source,
155
154
                         only_present=True))
156
155
    for anc_order, (anc_id, anc_distance) in anc_iter:
157
 
        if anc_id not in found_ancestors:
 
156
        if not found_ancestors.has_key(anc_id):
158
157
            found_ancestors[anc_id] = (anc_order, anc_distance)
159
158
    return found_ancestors
160
159