/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-11 04:02:41 UTC
  • mfrom: (5017.2.2 tariff)
  • Revision ID: pqm@pqm.ubuntu.com-20100211040241-w6n021dz0uus341n
(mbp) add import-tariff tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
from bzrlib.inventory import InventoryFile
37
37
from bzrlib.inter import InterObject
38
38
from bzrlib.osutils import fingerprint_file
 
39
import bzrlib.revision
39
40
from bzrlib.symbol_versioning import deprecated_function, deprecated_in
40
41
from bzrlib.trace import note
41
42
 
404
405
            bit_iter = iter(path.split("/"))
405
406
            for elt in bit_iter:
406
407
                lelt = elt.lower()
407
 
                new_path = None
408
408
                for child in self.iter_children(cur_id):
409
409
                    try:
410
 
                        # XXX: it seem like if the child is known to be in the
411
 
                        # tree, we shouldn't need to go from its id back to
412
 
                        # its path -- mbp 2010-02-11
413
 
                        #
414
 
                        # XXX: it seems like we could be more efficient
415
 
                        # by just directly looking up the original name and
416
 
                        # only then searching all children; also by not
417
 
                        # chopping paths so much. -- mbp 2010-02-11
418
410
                        child_base = os.path.basename(self.id2path(child))
419
 
                        if (child_base == elt):
420
 
                            # if we found an exact match, we can stop now; if
421
 
                            # we found an approximate match we need to keep
422
 
                            # searching because there might be an exact match
423
 
                            # later.  
 
411
                        if child_base.lower() == lelt:
424
412
                            cur_id = child
425
 
                            new_path = osutils.pathjoin(cur_path, child_base)
 
413
                            cur_path = osutils.pathjoin(cur_path, child_base)
426
414
                            break
427
 
                        elif child_base.lower() == lelt:
428
 
                            cur_id = child
429
 
                            new_path = osutils.pathjoin(cur_path, child_base)
430
415
                    except NoSuchId:
431
416
                        # before a change is committed we can see this error...
432
417
                        continue
433
 
                if new_path:
434
 
                    cur_path = new_path
435
418
                else:
436
419
                    # got to the end of this directory and no entries matched.
437
420
                    # Return what matched so far, plus the rest as specified.