1
# Copyright (C) 2005-2010 Canonical Ltd
1
# Copyright (C) 2005, 2006, 2007, 2009 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
545
541
initial_revisions = []
546
542
if delayed_graph_generation:
548
for rev_id, revno, depth in _linear_view_revisions(
549
branch, start_rev_id, end_rev_id):
544
for rev_id, revno, depth in \
545
_linear_view_revisions(branch, start_rev_id, end_rev_id):
550
546
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()
561
547
end_rev_id = rev_id
1425
1411
# Revision comes directly from a foreign repository
1426
1412
if isinstance(rev, foreign.ForeignRevision):
1427
return self._format_properties(rev.mapping.vcs.show_foreign_revid(rev.foreign_revid))
1413
return rev.mapping.vcs.show_foreign_revid(rev.foreign_revid)
1429
1415
# Imported foreign revision revision ids always contain :
1430
1416
if not ":" in rev.revision_id: