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

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-09-14 22:58:47 UTC
  • mfrom: (7104.3.4 brz-git-renames)
  • Revision ID: breezy.the.bot@gmail.com-20180914225847-0qnfeylaf94259b0
Some refactoring around get_canonical_inventory_paths.

* Drop the 'inventory' bit since it doesn't apply to non-inventory trees
* Move to working trees; canonicalization currently only matters there, where
  files can be stored on case-insensitive (VFAT) or normalizing filesystems
  (i.e. Mac OS X)
* Run tests against all working tree formats, including Git, not just InventoryTree ones

This fixes 'bzr mv' and 'bzr rename' for Git.

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

Show diffs side-by-side

added added

removed removed

Lines of Context:
1043
1043
                into_existing = False
1044
1044
            else:
1045
1045
                # 'fix' the case of a potential 'from'
1046
 
                from_path = tree.get_canonical_inventory_path(rel_names[0])
 
1046
                from_path = tree.get_canonical_path(rel_names[0])
1047
1047
                if (not osutils.lexists(names_list[0]) and
1048
1048
                    tree.is_versioned(from_path) and
1049
1049
                    tree.stored_kind(from_path) == "directory"):
1053
1053
            # move into existing directory
1054
1054
            # All entries reference existing inventory items, so fix them up
1055
1055
            # for cicp file-systems.
1056
 
            rel_names = tree.get_canonical_inventory_paths(rel_names)
 
1056
            rel_names = list(tree.get_canonical_paths(rel_names))
1057
1057
            for src, dest in tree.move(rel_names[:-1], rel_names[-1], after=after):
1058
1058
                if not is_quiet():
1059
1059
                    self.outf.write("%s => %s\n" % (src, dest))
1065
1065
 
1066
1066
            # for cicp file-systems: the src references an existing inventory
1067
1067
            # item:
1068
 
            src = tree.get_canonical_inventory_path(rel_names[0])
 
1068
            src = tree.get_canonical_path(rel_names[0])
1069
1069
            # Find the canonical version of the destination:  In all cases, the
1070
1070
            # parent of the target must be in the inventory, so we fetch the
1071
1071
            # canonical version from there (we do not always *use* the
1072
1072
            # canonicalized tail portion - we may be attempting to rename the
1073
1073
            # case of the tail)
1074
 
            canon_dest = tree.get_canonical_inventory_path(rel_names[1])
 
1074
            canon_dest = tree.get_canonical_path(rel_names[1])
1075
1075
            dest_parent = osutils.dirname(canon_dest)
1076
1076
            spec_tail = osutils.basename(rel_names[1])
1077
1077
            # For a CICP file-system, we need to avoid creating 2 inventory