~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: Vincent Ladeuil
  • Date: 2010-02-03 07:18:36 UTC
  • mto: (5008.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5009.
  • Revision ID: v.ladeuil+lp@free.fr-20100203071836-u9b86q68fr9ri5s6
Fix NEWS.

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.