3033
3033
"%r is not present in revision %s" % (
3034
3034
filename, rev_tree.get_revision_id()))
3036
content = rev_tree.get_file_text(old_file_id)
3036
actual_file_id = old_file_id
3038
3038
cur_file_id = tree.path2id(relpath)
3040
if cur_file_id is not None:
3041
# Then try with the actual file id
3043
content = rev_tree.get_file_text(cur_file_id)
3045
except errors.NoSuchId:
3046
# The actual file id didn't exist at that time
3048
if not found and old_file_id is not None:
3049
# Finally try with the old file id
3050
content = rev_tree.get_file_text(old_file_id)
3053
# Can't be found anywhere
3039
if cur_file_id is not None and rev_tree.has_id(cur_file_id):
3040
actual_file_id = cur_file_id
3041
elif old_file_id is not None:
3042
actual_file_id = old_file_id
3054
3044
raise errors.BzrCommandError(
3055
3045
"%r is not present in revision %s" % (
3056
3046
filename, rev_tree.get_revision_id()))
3058
from bzrlib.filters import (
3059
ContentFilterContext,
3060
filtered_output_bytes,
3062
filters = rev_tree._content_filter_stack(relpath)
3063
chunks = content.splitlines(True)
3064
content = filtered_output_bytes(chunks, filters,
3065
ContentFilterContext(relpath, rev_tree))
3067
self.outf.writelines(content)
3048
from bzrlib.filter_tree import ContentFilterTree
3049
filter_tree = ContentFilterTree(rev_tree,
3050
rev_tree._content_filter_stack)
3051
content = filter_tree.get_file_text(actual_file_id)
3070
self.outf.write(content)
3053
content = rev_tree.get_file_text(actual_file_id)
3055
self.outf.write(content)
3073
3058
class cmd_local_time_offset(Command):