/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/diff.py

  • Committer: Jelmer Vernooij
  • Date: 2017-11-12 20:07:32 UTC
  • mto: This revision was merged to the branch mainline in revision 6819.
  • Revision ID: jelmer@jelmer.uk-20171112200732-ehxgen03s9jphe8n
Swap arguments for get_symlink_target and kind/stored_kind.

Show diffs side-by-side

added added

removed removed

Lines of Context:
602
602
        if 'symlink' not in (old_kind, new_kind):
603
603
            return self.CANNOT_DIFF
604
604
        if old_kind == 'symlink':
605
 
            old_target = self.old_tree.get_symlink_target(file_id)
 
605
            old_target = self.old_tree.get_symlink_target(old_path, file_id)
606
606
        elif old_kind is None:
607
607
            old_target = None
608
608
        else:
609
609
            return self.CANNOT_DIFF
610
610
        if new_kind == 'symlink':
611
 
            new_target = self.new_tree.get_symlink_target(file_id)
 
611
            new_target = self.new_tree.get_symlink_target(new_path, file_id)
612
612
        elif new_kind is None:
613
613
            new_target = None
614
614
        else:
686
686
        :param to_path: The path in the to tree or None if unknown.
687
687
        """
688
688
        def _get_text(tree, file_id, path):
689
 
            try:
690
 
                return tree.get_file_lines(path, file_id)
691
 
            except errors.NoSuchId:
 
689
            if file_id is None:
692
690
                return []
 
691
            return tree.get_file_lines(path, file_id)
693
692
        try:
694
693
            from_text = _get_text(self.old_tree, from_file_id, from_path)
695
694
            to_text = _get_text(self.new_tree, to_file_id, to_path)
1039
1038
        :param new_path: The path of the file in the new tree
1040
1039
        """
1041
1040
        try:
1042
 
            old_kind = self.old_tree.kind(file_id)
 
1041
            old_kind = self.old_tree.kind(old_path, file_id)
1043
1042
        except (errors.NoSuchId, errors.NoSuchFile):
1044
1043
            old_kind = None
1045
1044
        try:
1046
 
            new_kind = self.new_tree.kind(file_id)
 
1045
            new_kind = self.new_tree.kind(new_path, file_id)
1047
1046
        except (errors.NoSuchId, errors.NoSuchFile):
1048
1047
            new_kind = None
1049
1048
        self._diff(file_id, old_path, new_path, old_kind, new_kind)