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

  • Committer: John Arbash Meinel
  • Date: 2008-07-23 02:35:09 UTC
  • mto: (3514.4.17 merge_lca_multi)
  • mto: This revision was merged to the branch mainline in revision 3748.
  • Revision ID: john@arbash-meinel.com-20080723023509-1t4wkw5wjif7h72i
Implement rename_one on MemoryTree, and expose that in the Branch Builder

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
 
23
23
from copy import deepcopy
 
24
import os
24
25
 
25
26
from bzrlib import (
26
27
    errors,
27
28
    mutabletree,
 
29
    osutils,
28
30
    revision as _mod_revision,
29
31
    )
30
32
from bzrlib.decorators import needs_read_lock, needs_write_lock
101
103
            return None, False, None
102
104
        return entry.kind, entry.executable, None
103
105
 
 
106
    @needs_tree_write_lock
 
107
    def rename_one(self, from_rel, to_rel):
 
108
        file_id = self.path2id(from_rel)
 
109
        to_dir, to_tail = os.path.split(to_rel)
 
110
        to_parent_id = self.path2id(to_dir)
 
111
        self._file_transport.move(from_rel, to_rel)
 
112
        self._inventory.rename(file_id, to_parent_id, to_tail)
 
113
        
104
114
    def path_content_summary(self, path):
105
115
        """See Tree.path_content_summary."""
106
116
        id = self.path2id(path)