~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: Ian Clatworthy
  • Date: 2009-09-03 05:09:22 UTC
  • mto: (4634.39.1 pdf-chm-docs)
  • mto: This revision was merged to the branch mainline in revision 4689.
  • Revision ID: ian.clatworthy@canonical.com-20090903050922-ww3c7dk57x8q8dyz
Split Release Notes into topics so easier to navigate and print from chm & html

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2009 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
98
98
    def iter_changes(self, from_tree, include_unchanged=False,
99
99
                     specific_files=None, pb=None, extra_trees=None,
100
100
                     require_versioned=True, want_unversioned=False):
101
 
        """See InterTree.iter_changes"""
102
101
        intertree = InterTree.get(from_tree, self)
103
102
        return intertree.iter_changes(include_unchanged, specific_files, pb,
104
103
            extra_trees, require_versioned, want_unversioned=want_unversioned)
405
404
            bit_iter = iter(path.split("/"))
406
405
            for elt in bit_iter:
407
406
                lelt = elt.lower()
408
 
                new_path = None
409
407
                for child in self.iter_children(cur_id):
410
408
                    try:
411
 
                        # XXX: it seem like if the child is known to be in the
412
 
                        # tree, we shouldn't need to go from its id back to
413
 
                        # its path -- mbp 2010-02-11
414
 
                        #
415
 
                        # XXX: it seems like we could be more efficient
416
 
                        # by just directly looking up the original name and
417
 
                        # only then searching all children; also by not
418
 
                        # chopping paths so much. -- mbp 2010-02-11
419
409
                        child_base = os.path.basename(self.id2path(child))
420
 
                        if (child_base == elt):
421
 
                            # if we found an exact match, we can stop now; if
422
 
                            # we found an approximate match we need to keep
423
 
                            # searching because there might be an exact match
424
 
                            # later.  
 
410
                        if child_base.lower() == lelt:
425
411
                            cur_id = child
426
 
                            new_path = osutils.pathjoin(cur_path, child_base)
 
412
                            cur_path = osutils.pathjoin(cur_path, child_base)
427
413
                            break
428
 
                        elif child_base.lower() == lelt:
429
 
                            cur_id = child
430
 
                            new_path = osutils.pathjoin(cur_path, child_base)
431
414
                    except NoSuchId:
432
415
                        # before a change is committed we can see this error...
433
416
                        continue
434
 
                if new_path:
435
 
                    cur_path = new_path
436
417
                else:
437
418
                    # got to the end of this directory and no entries matched.
438
419
                    # Return what matched so far, plus the rest as specified.
716
697
                for path in path_names:
717
698
                    yield searcher.get_items(path)
718
699
 
 
700
    @needs_read_lock
719
701
    def _get_rules_searcher(self, default_searcher):
720
702
        """Get the RulesSearcher for this tree given the default one."""
721
703
        searcher = default_searcher
870
852
    will pass through to InterTree as appropriate.
871
853
    """
872
854
 
873
 
    # Formats that will be used to test this InterTree. If both are
874
 
    # None, this InterTree will not be tested (e.g. because a complex
875
 
    # setup is required)
876
 
    _matching_from_tree_format = None
877
 
    _matching_to_tree_format = None
878
 
 
879
855
    _optimisers = []
880
856
 
881
857
    def _changes_from_entries(self, source_entry, target_entry,
978
954
            a PathsNotVersionedError will be thrown.
979
955
        :param want_unversioned: Scan for unversioned paths.
980
956
        """
 
957
        # NB: show_status depends on being able to pass in non-versioned files
 
958
        # and report them as unknown
981
959
        trees = (self.source,)
982
960
        if extra_trees is not None:
983
961
            trees = trees + tuple(extra_trees)