~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revision.py

Basic BzrDir support.

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
 
 
100
81
 
101
82
def is_ancestor(revision_id, candidate_id, branch):
102
83
    """Return true if candidate_id is an ancestor of revision_id.