I can see this
cur_file_id = tree.path2id(relpath)
rev_tree = b.repository.revision_tree(revision_id)
old_file_id = rev_tree.path2id(relpath)
if name_from_revision:
if old_file_id is None: raise errors.BzrCommandError("%r is not present in revision %s" % (filename, revision_id))
else: content = rev_tree.get_file_text(old_file_id)
elif cur_file_id is not None:
content = rev_tree.get_file_text(cur_file_id)
elif old_file_id is not None:
content = rev_tree.get_file_text(old_file_id)
so it assumes that a file id in a newer revision will be present in an older one.
I haven't thought it through, but it probably wants to either try old_file_id first,
or catch the error in the new_file_id use.
I think the former, othewise there may be no way to access certain paths in
the old revision.
This sort of thing occurs in a few places, maybe we need to look
at a way to specify whether you are talking about a current path,
an old one, or a specific path over time, regarless of file ids (for log).
Hi,
Thanks for the bug.
I can see this relpath) revision_ tree(revision_ id) path2id( relpath)
cur_file_id = tree.path2id(
rev_tree = b.repository.
old_file_id = rev_tree.
if name_from_revision:
raise errors. BzrCommandError ("%r is not present in revision %s"
% (filename, revision_id))
content = rev_tree. get_file_ text(old_ file_id) get_file_ text(cur_ file_id) get_file_ text(old_ file_id)
if old_file_id is None:
else:
elif cur_file_id is not None:
content = rev_tree.
elif old_file_id is not None:
content = rev_tree.
so it assumes that a file id in a newer revision will be present in an older one.
I haven't thought it through, but it probably wants to either try old_file_id first,
or catch the error in the new_file_id use.
I think the former, othewise there may be no way to access certain paths in
the old revision.
This sort of thing occurs in a few places, maybe we need to look
at a way to specify whether you are talking about a current path,
an old one, or a specific path over time, regarless of file ids (for log).
Thanks,
James