16
def canonicalize_revision(branch, revnos):
17
"""Turn some sort of revision information into a single
18
set of from-to revision ids.
20
A revision id can be None if there is no associated revison.
22
:param revnos: A list of revisions to lookup, should be at most 2 long
25
# If only 1 entry is given, then we assume we want just the
26
# changeset between that entry and it's base (we assume parents[0])
29
elif len(revnos) == 1:
30
revnos = [None, revnos[0]]
33
new = branch.last_patch()
35
new = branch.lookup_revision(revnos[1])
37
old = branch.get_revision(new).parents[0].revision_id
39
old = branch.lookup_revision(revnos[0])