/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/tests/__init__.py

Update with new parent-ids patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
594
594
            'HOME': os.getcwd(),
595
595
            'APPDATA': os.getcwd(),
596
596
            'BZR_EMAIL': None,
 
597
            'BZREMAIL': None, # may still be present in the environment
597
598
            'EMAIL': None,
598
599
        }
599
600
        self.__old_env = {}
964
965
        shape is a sequence of file specifications.  If the final
965
966
        character is '/', a directory is created.
966
967
 
 
968
        This assumes that all the elements in the tree being built are new.
 
969
 
967
970
        This doesn't add anything to a branch.
968
971
        :param line_endings: Either 'binary' or 'native'
969
972
                             in binary mode, exact contents are written
974
977
                          VFS's. If the transport is readonly or None,
975
978
                          "." is opened automatically.
976
979
        """
977
 
        # XXX: It's OK to just create them using forward slashes on windows?
 
980
        # It's OK to just create them using forward slashes on windows.
978
981
        if transport is None or transport.is_readonly():
979
982
            transport = get_transport(".")
980
983
        for name in shape:
989
992
                else:
990
993
                    raise errors.BzrError('Invalid line ending request %r' % (line_endings,))
991
994
                content = "contents of %s%s" % (name.encode('utf-8'), end)
992
 
                transport.put(urlutils.escape(name), StringIO(content))
 
995
                # Technically 'put()' is the right command. However, put
 
996
                # uses an AtomicFile, which requires an extra rename into place
 
997
                # As long as the files didn't exist in the past, append() will
 
998
                # do the same thing as put()
 
999
                # On jam's machine, make_kernel_like_tree is:
 
1000
                #   put:    4.5-7.5s (averaging 6s)
 
1001
                #   append: 2.9-4.5s
 
1002
                transport.append(urlutils.escape(name), StringIO(content))
993
1003
 
994
1004
    def build_tree_contents(self, shape):
995
1005
        build_tree_contents(shape)
1226
1236
             test_suite_factory=None,
1227
1237
             lsprof_timed=None):
1228
1238
    """Run the whole test suite under the enhanced runner"""
 
1239
    # XXX: Very ugly way to do this...
 
1240
    # Disable warning about old formats because we don't want it to disturb
 
1241
    # any blackbox tests.
 
1242
    from bzrlib import repository
 
1243
    repository._deprecation_warning_done = True
 
1244
 
1229
1245
    global default_transport
1230
1246
    if transport is None:
1231
1247
        transport = default_transport
1253
1269
    testmod_names = [
1254
1270
                   'bzrlib.tests.test_ancestry',
1255
1271
                   'bzrlib.tests.test_api',
 
1272
                   'bzrlib.tests.test_atomicfile',
1256
1273
                   'bzrlib.tests.test_bad_files',
1257
1274
                   'bzrlib.tests.test_branch',
1258
1275
                   'bzrlib.tests.test_bundle',
1259
1276
                   'bzrlib.tests.test_bzrdir',
 
1277
                   'bzrlib.tests.test_cache_utf8',
1260
1278
                   'bzrlib.tests.test_command',
1261
1279
                   'bzrlib.tests.test_commit',
1262
1280
                   'bzrlib.tests.test_commit_merge',