~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_push.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-07-20 07:58:14 UTC
  • mfrom: (4547.2.4 bundle-typo)
  • Revision ID: pqm@pqm.ubuntu.com-20090720075814-ft956w3a10qwaygk
(andrew) Fix NameError when handling redirection loops in
        read_mergeable_from_transport.

Show diffs side-by-side

added added

removed removed

Lines of Context:
512
512
class RedirectingMemoryTransport(memory.MemoryTransport):
513
513
 
514
514
    def mkdir(self, relpath, mode=None):
515
 
        from bzrlib.trace import mutter
516
515
        if self._cwd == '/source/':
517
516
            raise errors.RedirectRequested(self.abspath(relpath),
518
517
                                           self.abspath('../target'),
525
524
            return super(RedirectingMemoryTransport, self).mkdir(
526
525
                relpath, mode)
527
526
 
 
527
    def get(self, relpath):
 
528
        if self.clone(relpath)._cwd == '/infinite-loop/':
 
529
            raise errors.RedirectRequested(self.abspath(relpath),
 
530
                                           self.abspath('../infinite-loop'),
 
531
                                           is_permanent=True)
 
532
        else:
 
533
            return super(RedirectingMemoryTransport, self).get(relpath)
 
534
 
528
535
    def _redirected_to(self, source, target):
529
536
        # We do accept redirections
530
537
        return transport.get_transport(target)