196
195
revision_id = osutils.safe_revision_id(revision_id)
197
196
return self.get_revision_reconcile(revision_id)
199
@symbol_versioning.deprecated_method(symbol_versioning.one_four)
201
def get_revision_graph(self, revision_id=None):
202
"""Return a dictionary containing the revision graph.
204
:param revision_id: The revision_id to get a graph from. If None, then
205
the entire revision graph is returned. This is a deprecated mode of
206
operation and will be removed in the future.
207
:return: a dictionary of revision_id->revision_parents_list.
209
if 'evil' in debug.debug_flags:
211
"get_revision_graph scales with size of history.")
212
# special case NULL_REVISION
213
if revision_id == _mod_revision.NULL_REVISION:
215
a_weave = self._get_revision_vf()
216
if revision_id is None:
217
return a_weave.get_graph()
218
if revision_id not in a_weave:
219
raise errors.NoSuchRevision(self, revision_id)
221
# add what can be reached from revision_id
222
return a_weave.get_graph([revision_id])
225
@symbol_versioning.deprecated_method(symbol_versioning.one_three)
226
def get_revision_graph_with_ghosts(self, revision_ids=None):
227
"""Return a graph of the revisions with ghosts marked as applicable.
229
:param revision_ids: an iterable of revisions to graph or None for all.
230
:return: a Graph object with the graph reachable from revision_ids.
232
if 'evil' in debug.debug_flags:
234
"get_revision_graph_with_ghosts scales with size of history.")
235
result = deprecated_graph.Graph()
236
vf = self._get_revision_vf()
237
versions = set(vf.versions())
239
pending = set(self.all_revision_ids())
242
pending = set(revision_ids)
243
# special case NULL_REVISION
244
if _mod_revision.NULL_REVISION in pending:
245
pending.remove(_mod_revision.NULL_REVISION)
246
required = set(pending)
249
revision_id = pending.pop()
250
if not revision_id in versions:
251
if revision_id in required:
252
raise errors.NoSuchRevision(self, revision_id)
254
result.add_ghost(revision_id)
255
# mark it as done so we don't try for it again.
256
done.add(revision_id)
258
parent_ids = vf.get_parents_with_ghosts(revision_id)
259
for parent_id in parent_ids:
260
# is this queued or done ?
261
if (parent_id not in pending and
262
parent_id not in done):
264
pending.add(parent_id)
265
result.add_node(revision_id, parent_ids)
266
done.add(revision_id)
269
198
def _get_revision_vf(self):
270
199
""":return: a versioned file containing the revisions."""
271
200
vf = self._revision_store.get_revision_file(self.get_transaction())