628
628
base_id = self.old_contents_id(file_id)
629
629
if (base_id is not None and
630
630
base_id != self.base_tree.get_root_id()):
631
old_path = self.old_path(path)
631
632
patch_original = self.base_tree.get_file(
632
self.base_tree.id2path(base_id), base_id)
634
635
patch_original = None
635
636
file_patch = self.patches.get(path)
651
652
return self._targets[path]
653
return self.base_tree.get_symlink_target(path, file_id)
654
old_path = self.old_path(path)
655
return self.base_tree.get_symlink_target(old_path, file_id)
655
657
def kind(self, path, file_id=None):
657
659
return self._kinds[path]
659
return self.base_tree.kind(path, file_id)
661
old_path = self.old_path(path)
662
return self.base_tree.kind(old_path, file_id)
661
664
def get_file_revision(self, path, file_id=None):
662
665
if path in self._last_changed:
663
666
return self._last_changed[path]
665
return self.base_tree.get_file_revision(path, file_id)
668
old_path = self.old_path(path)
669
return self.base_tree.get_file_revision(old_path, file_id)
667
671
def is_executable(self, path, file_id=None):
668
672
if path in self._executable:
669
673
return self._executable[path]
671
return self.base_tree.is_executable(path, file_id)
675
old_path = self.old_path(path)
676
return self.base_tree.is_executable(old_path, file_id)
673
678
def get_last_changed(self, path, file_id=None):
674
679
if path in self._last_changed:
675
680
return self._last_changed[path]
676
return self.base_tree.get_file_revision(path, file_id)
681
old_path = self.old_path(path)
682
return self.base_tree.get_file_revision(old_path, file_id)
678
684
def get_size_and_sha1(self, new_path, file_id=None):
679
685
"""Return the size and sha1 hash of the given file id.
685
691
if new_path not in self.patches:
686
692
# If the entry does not have a patch, then the
687
693
# contents must be the same as in the base_tree
688
base_path = self.base_tree.id2path(file_id)
694
base_path = self.old_path(new_path)
689
695
text_size = self.base_tree.get_file_size(base_path, file_id)
690
696
text_sha1 = self.base_tree.get_file_sha1(base_path, file_id)
691
697
return text_size, text_sha1