/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 bzrlib/transform.py

Got real root moves working

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
        
70
70
        We do this by undoing the association of root's transaction id with the
71
71
        current tree.  This allows us to create a new directory with that
72
 
        transaction id.  We unversion the root directory, and hope someone
73
 
        versions it later.
 
72
        transaction id.  We unversion the root directory and version the 
 
73
        physically new directory, and hope someone versions the tree root
 
74
        later.
74
75
        """
75
76
        old_root = self._new_root
76
77
        old_root_file_id = self.final_file_id(old_root)
79
80
            if child_id != parent:
80
81
                self.adjust_path(self.final_name(child_id), 
81
82
                                 self.final_parent(child_id), child_id)
 
83
            file_id = self.final_file_id(child_id)
 
84
            if file_id is not None:
 
85
                self.unversion_file(child_id)
 
86
            self.version_file(file_id, child_id)
82
87
        
83
88
        # the physical root needs a new transaction id
84
89
        self._tree_path_ids.pop("")
88
93
            parent = self._new_root
89
94
        self.adjust_path(name, parent, old_root)
90
95
        self.create_directory(old_root)
91
 
        #self.version_file(old_root_file_id, old_root)
92
 
        #self.unversion_file(self._new_root)
 
96
        self.version_file(old_root_file_id, old_root)
 
97
        self.unversion_file(self._new_root)
93
98
 
94
99
    def get_id_tree(self, inventory_id):
95
100
        """Determine the transaction id of a working tree file.
511
516
                    if e.errno != errno.ENOENT:
512
517
                        raise
513
518
            if trans_id in self._removed_id:
514
 
                del inv[self.get_tree_file_id(trans_id)]
 
519
                if trans_id == self._new_root:
 
520
                    file_id = self._tree.inventory.root.file_id
 
521
                else:
 
522
                    file_id = self.get_tree_file_id(trans_id)
 
523
                del inv[file_id]
515
524
            elif trans_id in self._new_name or trans_id in self._new_parent:
516
525
                file_id = self.get_tree_file_id(trans_id)
517
526
                if file_id is not None:
555
564
            if trans_id in self._new_id:
556
565
                if kind is None:
557
566
                    kind = file_kind(self._tree.abspath(path))
558
 
                inv.add_path(path, kind, self._new_id[trans_id])
 
567
                try:
 
568
                    inv.add_path(path, kind, self._new_id[trans_id])
 
569
                except:
 
570
                    raise repr((path, kind, self._new_id[trans_id]))
559
571
            elif trans_id in self._new_name or trans_id in self._new_parent:
560
572
                entry = limbo_inv.get(trans_id)
561
573
                if entry is not None: