~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: Martin Packman
  • Date: 2012-01-05 09:50:04 UTC
  • mfrom: (6424 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6426.
  • Revision ID: martin.packman@canonical.com-20120105095004-mia9xb7y0efmto0v
Merge bzr.dev to resolve conflicts in bzrlib.builtins

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Tree classes, representing directory at point in time.
18
18
"""
19
19
 
 
20
from __future__ import absolute_import
 
21
 
20
22
import os
21
23
 
22
24
from bzrlib.lazy_import import lazy_import
35
37
    rules,
36
38
    trace,
37
39
    )
 
40
from bzrlib.i18n import gettext
38
41
""")
39
42
 
40
43
from bzrlib.decorators import needs_read_lock
58
61
    trees or versioned trees.
59
62
    """
60
63
 
 
64
    def has_versioned_directories(self):
 
65
        """Whether this tree can contain explicitly versioned directories.
 
66
 
 
67
        This defaults to True, but some implementations may want to override
 
68
        it.
 
69
        """
 
70
        return True
 
71
 
61
72
    def changes_from(self, other, want_unchanged=False, specific_files=None,
62
73
        extra_trees=None, require_versioned=False, include_root=False,
63
74
        want_unversioned=False):
346
357
        """
347
358
        raise NotImplementedError(self.get_file_size)
348
359
 
349
 
    def get_file_by_path(self, path):
350
 
        raise NotImplementedError(self.get_file_by_path)
351
 
 
352
360
    def is_executable(self, file_id, path=None):
353
361
        """Check if a file is executable.
354
362
 
623
631
        prefs = self.iter_search_rules([path], filter_pref_names).next()
624
632
        stk = filters._get_filter_stack_for(prefs)
625
633
        if 'filters' in debug.debug_flags:
626
 
            trace.note("*** %s content-filter: %s => %r" % (path,prefs,stk))
 
634
            trace.note(gettext("*** {0} content-filter: {1} => {2!r}").format(path,prefs,stk))
627
635
        return stk
628
636
 
629
637
    def _content_filter_stack_provider(self):
818
826
        return self.inventory.iter_entries_by_dir(
819
827
            specific_file_ids=specific_file_ids, yield_parents=yield_parents)
820
828
 
 
829
    @deprecated_method(deprecated_in((2, 5, 0)))
821
830
    def get_file_by_path(self, path):
822
 
        return self.get_file(self._inventory.path2id(path), path)
 
831
        return self.get_file(self.path2id(path), path)
823
832
 
824
833
 
825
834
def find_ids_across_trees(filenames, trees, require_versioned=True):