522
522
if not self.has_revision(revision_id):
523
523
raise errors.NoSuchRevision(self, revision_id)
524
524
w = self.get_inventory_weave()
525
return [None] + w.get_ancestry(revision_id)
525
candidates = w.get_ancestry(revision_id)
526
return [None] + candidates # self._eliminate_revisions_not_present(candidates)
528
529
def print_file(self, file, revision_id):
699
700
if revision_id is None:
701
702
vf = self._revision_store.get_revision_file(self.get_transaction())
702
return [None] + vf.get_ancestry(revision_id)
704
return [None] + vf.get_ancestry(revision_id)
705
except errors.RevisionNotPresent:
706
raise errors.NoSuchRevision(self, revision_id)
709
def get_revision_graph_with_ghosts(self, revision_ids=None):
710
"""Return a graph of the revisions with ghosts marked as applicable.
712
:param revision_ids: an iterable of revisions to graph or None for all.
713
:return: a Graph object with the graph reachable from revision_ids.
716
vf = self._revision_store.get_revision_file(self.get_transaction())
717
versions = vf.versions()
719
pending = set(self.all_revision_ids())
722
pending = set(revision_ids)
723
required = set(revision_ids)
726
revision_id = pending.pop()
727
if not revision_id in versions:
728
if revision_id in required:
729
raise errors.NoSuchRevision(self, revision_id)
731
result.add_ghost(revision_id)
733
parent_ids = vf.get_parents_with_ghosts(revision_id)
734
for parent_id in parent_ids:
735
# is this queued or done ?
736
if (parent_id not in pending and
737
parent_id not in done):
739
pending.add(parent_id)
740
result.add_node(revision_id, parent_ids)
704
744
@needs_write_lock
705
745
def reconcile(self):