~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

Dirty merge of the mainline

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
        self._tree_id_paths = {}
59
59
        self._new_root = self.get_id_tree(tree.get_root_id())
60
60
        self.__done = False
61
 
        self._limbodir = self._tree.branch.controlfilename('limbo')
 
61
        # XXX use the WorkingTree LockableFiles, when available
 
62
        control_files = self._tree.branch.control_files
 
63
        self._limbodir = control_files.controlfilename('limbo')
62
64
        os.mkdir(self._limbodir)
63
65
 
64
66
    def finalize(self):
571
573
 
572
574
    def _limbo_name(self, trans_id):
573
575
        """Generate the limbo name of a file"""
574
 
        limbo = self._tree.branch.controlfilename('limbo')
575
 
        return os.path.join(limbo, trans_id)
 
576
        return os.path.join(self._limbodir, trans_id)
576
577
 
577
578
    def _apply_removals(self, inv, limbo_inv):
578
579
        """Perform tree operations that remove directory/inventory names.
581
582
        need renaming into limbo.  This must be done in strict child-to-parent
582
583
        order.
583
584
        """
584
 
        limbo = self._tree.branch.controlfilename('limbo')
585
585
        tree_paths = list(self._tree_path_ids.iteritems())
586
586
        tree_paths.sort(reverse=True)
587
587
        for path, trans_id in tree_paths:
596
596
                    os.rmdir(full_path)
597
597
            elif trans_id in self._new_name or trans_id in self._new_parent:
598
598
                try:
599
 
                    os.rename(full_path, os.path.join(limbo, trans_id))
 
599
                    os.rename(full_path, self._limbo_name(trans_id))
600
600
                except OSError, e:
601
601
                    if e.errno != errno.ENOENT:
602
602
                        raise
619
619
        limbo any files that needed renaming.  This must be done in strict
620
620
        parent-to-child order.
621
621
        """
622
 
        limbo = self._tree.branch.controlfilename('limbo')
623
622
        for path, trans_id in self.new_paths():
624
623
            try:
625
624
                kind = self._new_contents[trans_id]
820
819
        interesting_ids = None
821
820
    else:
822
821
        interesting_ids = set()
823
 
        for filename in filenames:
824
 
            tree_path = working_tree.relpath(filename)
 
822
        for tree_path in filenames:
825
823
            for tree in (working_tree, target_tree):
826
824
                not_found = True
827
825
                file_id = tree.inventory.path2id(tree_path)