/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/bzrdir.py

  • Committer: Ian Clatworthy
  • Date: 2007-09-21 07:29:37 UTC
  • mto: (2867.1.1 ianc-integration2)
  • mto: This revision was merged to the branch mainline in revision 2869.
  • Revision ID: ian.clatworthy@internode.on.net-20070921072937-ase3yh9f1pune4vq
Incorporate feedback from poolie's review

Show diffs side-by-side

added added

removed removed

Lines of Context:
377
377
        """
378
378
        raise NotImplementedError(self.create_workingtree)
379
379
 
380
 
    def retire_bzrdir(self):
 
380
    def retire_bzrdir(self, limit=10000):
381
381
        """Permanently disable the bzrdir.
382
382
 
383
383
        This is done by renaming it to give the user some ability to recover
385
385
 
386
386
        This will have horrible consequences if anyone has anything locked or
387
387
        in use.
 
388
        :param limit: number of times to retry
388
389
        """
389
 
        for i in xrange(10000):
 
390
        i  = 0
 
391
        while True:
390
392
            try:
391
393
                to_path = '.bzr.retired.%d' % i
392
394
                self.root_transport.rename('.bzr', to_path)
394
396
                    % (self.root_transport.abspath('.bzr'), to_path))
395
397
                return
396
398
            except (errors.TransportError, IOError, errors.PathError):
397
 
                pass
398
 
        raise errors.RetireFailed(self.root_transport.abspath('.bzr'))
 
399
                i += 1
 
400
                if i > limit:
 
401
                    raise
 
402
                else:
 
403
                    pass
399
404
 
400
405
    def destroy_workingtree(self):
401
406
        """Destroy the working tree at this BzrDir.
580
585
            # Let's try with a new transport
581
586
            # FIXME: If 'transport' has a qualifier, this should
582
587
            # be applied again to the new transport *iff* the
583
 
            # schemes used are the same. It's a bit tricky to
584
 
            # verify, so I'll punt for now
 
588
            # schemes used are the same. Uncomment this code
 
589
            # once the function (and tests) exist.
585
590
            # -- vila20070212
586
 
            #qualified_target = e.get_target_url()[:-len(relpath)]
587
 
            #return get_transport(qualified_target)
 
591
            #target = urlutils.copy_url_qualifiers(original, target)
588
592
            return get_transport(target)
589
593
 
590
594
        try: