~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Robert Collins
  • Date: 2006-05-24 03:00:14 UTC
  • mto: (1755.1.2 integration)
  • mto: This revision was merged to the branch mainline in revision 1757.
  • Revision ID: robertc@robertcollins.net-20060524030014-0af2706006ed9f98
Bugfix create_branch_convenience at the root of a file system to not loop
infinitely. Teach Benchmark.make_kernel_like_Tree to support making a tree
in a ramdisk to remove external IO costs for the repository when desired.

Show diffs side-by-side

added added

removed removed

Lines of Context:
343
343
            pass
344
344
        next_transport = self.root_transport.clone('..')
345
345
        while True:
 
346
            # find the next containing bzrdir
346
347
            try:
347
348
                found_bzrdir = BzrDir.open_containing_from_transport(
348
349
                    next_transport)[0]
349
350
            except errors.NotBranchError:
 
351
                # none found
350
352
                raise errors.NoRepositoryPresent(self)
 
353
            # does it have a repository ?
351
354
            try:
352
355
                repository = found_bzrdir.open_repository()
353
356
            except errors.NoRepositoryPresent:
354
357
                next_transport = found_bzrdir.root_transport.clone('..')
355
 
                continue
 
358
                if (found_bzrdir.root_transport.base == next_transport.base):
 
359
                    # top of the file system
 
360
                    break
 
361
                else:
 
362
                    continue
356
363
            if ((found_bzrdir.root_transport.base == 
357
364
                 self.root_transport.base) or repository.is_shared()):
358
365
                return repository