~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: John Arbash Meinel
  • Date: 2009-07-08 14:37:25 UTC
  • mfrom: (4516 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4517.
  • Revision ID: john@arbash-meinel.com-20090708143725-sc9sjy3mz4cxwxzz
Merge bzr.dev 4516

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
import os
21
21
from collections import deque
22
 
from cStringIO import StringIO
23
22
 
24
23
import bzrlib
25
24
from bzrlib import (
30
29
    osutils,
31
30
    revision as _mod_revision,
32
31
    rules,
33
 
    symbol_versioning,
34
32
    )
35
33
from bzrlib.decorators import needs_read_lock
36
 
from bzrlib.errors import BzrError, BzrCheckError, NoSuchId
 
34
from bzrlib.errors import BzrError, NoSuchId
37
35
from bzrlib import errors
38
 
from bzrlib.inventory import Inventory, InventoryFile
 
36
from bzrlib.inventory import InventoryFile
39
37
from bzrlib.inter import InterObject
40
38
from bzrlib.osutils import fingerprint_file
41
39
import bzrlib.revision
42
40
from bzrlib.symbol_versioning import deprecated_function, deprecated_in
43
 
from bzrlib.trace import mutter, note
 
41
from bzrlib.trace import note
44
42
 
45
43
 
46
44
class Tree(object):
263
261
        """
264
262
        raise NotImplementedError(self.get_file)
265
263
 
 
264
    def get_file_with_stat(self, file_id, path=None):
 
265
        """Get a file handle and stat object for file_id.
 
266
 
 
267
        The default implementation returns (self.get_file, None) for backwards
 
268
        compatibility.
 
269
 
 
270
        :param file_id: The file id to read.
 
271
        :param path: The path of the file, if it is known.
 
272
        :return: A tuple (file_handle, stat_value_or_None). If the tree has
 
273
            no stat facility, or need for a stat cache feedback during commit,
 
274
            it may return None for the second element of the tuple.
 
275
        """
 
276
        return (self.get_file(file_id, path), None)
 
277
 
266
278
    def get_file_text(self, file_id, path=None):
267
279
        """Return the byte content of a file.
268
280
 
423
435
        raise NotImplementedError(self.annotate_iter)
424
436
 
425
437
    def _get_plan_merge_data(self, file_id, other, base):
426
 
        from bzrlib import merge, versionedfile
 
438
        from bzrlib import versionedfile
427
439
        vf = versionedfile._PlanMergeVersionedFile(file_id)
428
440
        last_revision_a = self._get_file_revision(file_id, vf, 'this:')
429
441
        last_revision_b = other._get_file_revision(file_id, vf, 'other:')