~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-12 12:55:36 UTC
  • mfrom: (5031.1.3 merge-2.1-into-devel)
  • Revision ID: pqm@pqm.ubuntu.com-20100212125536-75ekp8giqbsnunmu
(andrew) Merge lp:bzr/2.1 to lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
405
405
            bit_iter = iter(path.split("/"))
406
406
            for elt in bit_iter:
407
407
                lelt = elt.lower()
 
408
                new_path = None
408
409
                for child in self.iter_children(cur_id):
409
410
                    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
410
419
                        child_base = os.path.basename(self.id2path(child))
411
 
                        if child_base.lower() == lelt:
 
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.  
412
425
                            cur_id = child
413
 
                            cur_path = osutils.pathjoin(cur_path, child_base)
 
426
                            new_path = osutils.pathjoin(cur_path, child_base)
414
427
                            break
 
428
                        elif child_base.lower() == lelt:
 
429
                            cur_id = child
 
430
                            new_path = osutils.pathjoin(cur_path, child_base)
415
431
                    except NoSuchId:
416
432
                        # before a change is committed we can see this error...
417
433
                        continue
 
434
                if new_path:
 
435
                    cur_path = new_path
418
436
                else:
419
437
                    # got to the end of this directory and no entries matched.
420
438
                    # Return what matched so far, plus the rest as specified.