~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

(jam) Merge 2.4 into trunk, including bugs #825027 and #837293

Show diffs side-by-side

added added

removed removed

Lines of Context:
2561
2561
        real branch.
2562
2562
        """
2563
2563
        root = TestCaseWithMemoryTransport.TEST_ROOT
2564
 
        wt = bzrdir.BzrDir.create_standalone_workingtree(root)
 
2564
        try:
 
2565
            # Make sure we get a readable and accessible home for .bzr.log
 
2566
            # and/or config files, and not fallback to weird defaults (see
 
2567
            # http://pad.lv/825027).
 
2568
            self.assertIs(None, os.environ.get('BZR_HOME', None))
 
2569
            os.environ['BZR_HOME'] = root
 
2570
            wt = bzrdir.BzrDir.create_standalone_workingtree(root)
 
2571
            del os.environ['BZR_HOME']
 
2572
        except Exception, e:
 
2573
            self.fail("Fail to initialize the safety net: %r\nExiting\n" % (e,))
2565
2574
        # Hack for speed: remember the raw bytes of the dirstate file so that
2566
2575
        # we don't need to re-open the wt to check it hasn't changed.
2567
2576
        TestCaseWithMemoryTransport._SAFETY_NET_PRISTINE_DIRSTATE = (