/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/bundle/bundle_data.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-04-01 18:42:03 UTC
  • mfrom: (6928.1.5 path2id-path-only)
  • Revision ID: breezy.the.bot@gmail.com-20180401184203-4qix0p9r914c0jxu
In InventoryTree, always use path if specified.

Merged from https://code.launchpad.net/~jelmer/brz/path2id-path-only/+merge/342253

Show diffs side-by-side

added added

removed removed

Lines of Context:
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)
 
633
                    old_path, base_id)
633
634
        else:
634
635
            patch_original = None
635
636
        file_patch = self.patches.get(path)
650
651
        try:
651
652
            return self._targets[path]
652
653
        except KeyError:
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)
654
656
 
655
657
    def kind(self, path, file_id=None):
656
658
        try:
657
659
            return self._kinds[path]
658
660
        except KeyError:
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)
660
663
 
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]
664
667
        else:
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)
666
670
 
667
671
    def is_executable(self, path, file_id=None):
668
672
        if path in self._executable:
669
673
            return self._executable[path]
670
674
        else:
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)
672
677
 
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)
677
683
 
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