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

Add a new method ``Tree.revision_tree`` which allows access to cached
trees for arbitrary revisions. This allows the in development dirstate
tree format to provide access to the callers to cached copies of 
inventory data which are cheaper to access than inventories from the
repository. (Robert Collins, Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
566
566
        args = (DEPRECATED_PARAMETER, message, ) + args
567
567
        committed_id = Commit().commit( working_tree=self, revprops=revprops,
568
568
            *args, **kwargs)
569
 
        self._set_inventory(self.read_working_inventory())
570
569
        return committed_id
571
570
 
572
571
    def id2abspath(self, file_id):
1105
1104
        for subp in self.extras():
1106
1105
            if not self.is_ignored(subp):
1107
1106
                yield subp
1108
 
 
 
1107
    
 
1108
    @needs_write_lock
 
1109
    def unversion(self, file_ids):
 
1110
        """Remove the file ids in file_ids from the current versioned set.
 
1111
 
 
1112
        When a file_id is unversioned, all of its children are automatically
 
1113
        unversioned.
 
1114
 
 
1115
        :param file_ids: The file ids to stop versioning.
 
1116
        :raises: NoSuchId if any fileid is not currently versioned.
 
1117
        """
 
1118
        for file_id in file_ids:
 
1119
            if self._inventory.has_id(file_id):
 
1120
                self._inventory.remove_recursive_id(file_id)
 
1121
            else:
 
1122
                raise errors.NoSuchId(self, file_id)
 
1123
        if len(file_ids):
 
1124
            # in the future this should just set a dirty bit to wait for the 
 
1125
            # final unlock. However, until all methods of workingtree start
 
1126
            # with the current in -memory inventory rather than triggering 
 
1127
            # a read, it is more complex - we need to teach read_inventory
 
1128
            # to know when to read, and when to not read first... and possibly
 
1129
            # to save first when the in memory one may be corrupted.
 
1130
            # so for now, we just only write it if it is indeed dirty.
 
1131
            # - RBC 20060907
 
1132
            self._write_inventory(self._inventory)
 
1133
    
1109
1134
    @deprecated_method(zero_eight)
1110
1135
    def iter_conflicts(self):
1111
1136
        """List all files in the tree that have text or content conflicts.
1333
1358
    def kind(self, file_id):
1334
1359
        return file_kind(self.id2abspath(file_id))
1335
1360
 
1336
 
    @deprecated_method(zero_eleven)
1337
1361
    def last_revision(self):
1338
1362
        """Return the last revision id of this working tree.
1339
1363