~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/mutabletree.py

  • Committer: John Arbash Meinel
  • Date: 2008-10-30 00:55:00 UTC
  • mto: (3815.2.5 prepare-1.9)
  • mto: This revision was merged to the branch mainline in revision 3811.
  • Revision ID: john@arbash-meinel.com-20081030005500-r5cej1cxflqhs3io
Switch so that we are using a simple timestamp as the first action.

Show diffs side-by-side

added added

removed removed

Lines of Context:
201
201
        """Helper function for add - sets the entries of kinds."""
202
202
        raise NotImplementedError(self._gather_kinds)
203
203
 
 
204
    def get_file_with_stat(self, file_id, path=None):
 
205
        """Get a file handle and stat object for file_id.
 
206
 
 
207
        The default implementation returns (self.get_file, None) for backwards
 
208
        compatibility.
 
209
 
 
210
        :param file_id: The file id to read.
 
211
        :param path: The path of the file, if it is known.
 
212
        :return: A tuple (file_handle, stat_value_or_None). If the tree has
 
213
            no stat facility, or need for a stat cache feedback during commit,
 
214
            it may return None for the second element of the tuple.
 
215
        """
 
216
        return (self.get_file(file_id, path), None)
 
217
 
204
218
    @needs_read_lock
205
219
    def last_revision(self):
206
220
        """Return the revision id of the last commit performed in this tree.
247
261
        """
248
262
        raise NotImplementedError(self.mkdir)
249
263
 
 
264
    def _observed_sha1(self, file_id, path, (sha1, stat_value)):
 
265
        """Tell the tree we have observed a paths sha1.
 
266
 
 
267
        The intent of this function is to allow trees that have a hashcache to
 
268
        update the hashcache during commit. If the observed file is too new
 
269
        (based on the stat_value) to be safely hash-cached the tree will ignore
 
270
        it. 
 
271
 
 
272
        The default implementation does nothing.
 
273
 
 
274
        :param file_id: The file id
 
275
        :param path: The file path
 
276
        :param sha1: The sha 1 that was observed.
 
277
        :param stat_value: A stat result for the file the sha1 was read from.
 
278
        :return: None
 
279
        """
 
280
 
250
281
    @needs_write_lock
251
282
    def put_file_bytes_non_atomic(self, file_id, bytes):
252
283
        """Update the content of a file in the tree.