1
# Copyright (C) 2005, 2006, 2007, 2009 Canonical Ltd
1
# Copyright (C) 2005-2010 Canonical Ltd
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
536
536
def _generate_all_revisions(branch, start_rev_id, end_rev_id, direction,
537
delayed_graph_generation):
537
delayed_graph_generation):
538
538
# On large trees, generating the merge graph can take 30-60 seconds
539
539
# so we delay doing it until a merge is detected, incrementally
540
540
# returning initial (non-merge) revisions while we can.
542
# The above is only true for old formats (<= 0.92), for newer formats, a
543
# couple of seconds only should be needed to load the whole graph and the
544
# other graph operations needed are even faster than that -- vila 100201
541
545
initial_revisions = []
542
546
if delayed_graph_generation:
544
for rev_id, revno, depth in \
545
_linear_view_revisions(branch, start_rev_id, end_rev_id):
548
for rev_id, revno, depth in _linear_view_revisions(
549
branch, start_rev_id, end_rev_id):
546
550
if _has_merges(branch, rev_id):
551
# The end_rev_id can be nested down somewhere. We need an
552
# explicit ancestry check. There is an ambiguity here as we
553
# may not raise _StartNotLinearAncestor for a revision that
554
# is an ancestor but not a *linear* one. But since we have
555
# loaded the graph to do the check (or calculate a dotted
556
# revno), we may as well accept to show the log...
558
graph = branch.repository.get_graph()
559
if not graph.is_ancestor(start_rev_id, end_rev_id):
560
raise _StartNotLinearAncestor()
547
561
end_rev_id = rev_id
1411
1425
# Revision comes directly from a foreign repository
1412
1426
if isinstance(rev, foreign.ForeignRevision):
1413
return rev.mapping.vcs.show_foreign_revid(rev.foreign_revid)
1427
return self._format_properties(rev.mapping.vcs.show_foreign_revid(rev.foreign_revid))
1415
1429
# Imported foreign revision revision ids always contain :
1416
1430
if not ":" in rev.revision_id: