~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revision.py

  • Committer: Aaron Bentley
  • Date: 2006-02-22 14:39:42 UTC
  • mto: (2027.1.2 revert-subpath-56549)
  • mto: This revision was merged to the branch mainline in revision 1570.
  • Revision ID: abentley@panoramicfeedback.com-20060222143942-ae72299f2de66767
Fixed build_tree with symlinks

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
                raise ValueError("invalid property value %r for %r" % 
79
79
                                 (name, value))
80
80
 
 
81
    def get_history(self, repository):
 
82
        """Return the canonical line-of-history for this revision.
 
83
 
 
84
        If ghosts are present this may differ in result from a ghost-free
 
85
        repository.
 
86
        """
 
87
        current_revision = self
 
88
        reversed_result = []
 
89
        while current_revision is not None:
 
90
            reversed_result.append(current_revision.revision_id)
 
91
            if not len (current_revision.parent_ids):
 
92
                reversed_result.append(None)
 
93
                current_revision = None
 
94
            else:
 
95
                next_revision_id = current_revision.parent_ids[0]
 
96
                current_revision = repository.get_revision(next_revision_id)
 
97
        reversed_result.reverse()
 
98
        return reversed_result
 
99
 
81
100
 
82
101
def is_ancestor(revision_id, candidate_id, branch):
83
102
    """Return true if candidate_id is an ancestor of revision_id.
88
107
    revisions_source is an object supporting a get_revision operation that
89
108
    behaves like Branch's.
90
109
    """
91
 
    return candidate_id in branch.get_ancestry(revision_id)
 
110
    return candidate_id in branch.repository.get_ancestry(revision_id)
92
111
 
93
112
 
94
113
def iter_ancestors(revision_id, revision_source, only_present=False):