405
405
bit_iter = iter(path.split("/"))
406
406
for elt in bit_iter:
407
407
lelt = elt.lower()
408
409
for child in self.iter_children(cur_id):
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
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
413
cur_path = osutils.pathjoin(cur_path, child_base)
426
new_path = osutils.pathjoin(cur_path, child_base)
428
elif child_base.lower() == lelt:
430
new_path = osutils.pathjoin(cur_path, child_base)
416
432
# before a change is committed we can see this error...
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.