/breezy/3.1

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/3.1

« back to all changes in this revision

Viewing changes to breezy/transform.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-02-09 17:46:22 UTC
  • mfrom: (7357.1.8 intertree-find-target-path)
  • Revision ID: breezy.the.bot@gmail.com-20200209174622-7ucfq64y2r6v80wv
Use InterTree object when looking for renames.

Merged from https://code.launchpad.net/~jelmer/brz/intertree-renames/+merge/378777

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
    viewvalues,
72
72
    )
73
73
from .tree import (
74
 
    find_previous_path,
 
74
    InterTree,
75
75
    TreeChange,
76
76
    )
77
77
 
2961
2961
                        if basis_tree is None:
2962
2962
                            basis_tree = working_tree.basis_tree()
2963
2963
                            basis_tree.lock_read()
2964
 
                        basis_path = find_previous_path(
2965
 
                            working_tree, basis_tree, wt_path)
 
2964
                        basis_inter = InterTree.get(basis_tree, working_tree)
 
2965
                        basis_path = basis_inter.find_source_path(wt_path)
2966
2966
                        if basis_path is None:
2967
2967
                            if target_kind is None and not target_versioned:
2968
2968
                                keep_content = True
3001
3001
                        basis_tree = working_tree.basis_tree()
3002
3002
                        basis_tree.lock_read()
3003
3003
                    new_sha1 = target_tree.get_file_sha1(target_path)
3004
 
                    basis_path = find_previous_path(target_tree, basis_tree, target_path)
 
3004
                    basis_inter = InterTree.get(basis_tree, target_tree)
 
3005
                    basis_path = basis_inter.find_source_path(target_path)
3005
3006
                    if (basis_path is not None and
3006
3007
                            new_sha1 == basis_tree.get_file_sha1(basis_path)):
3007
3008
                        # If the new contents of the file match what is in basis,