view tests/test_binaryfiles.py @ 889:7a98fbadcae9

revsets: huge speedups for fromsvn and svnrev I have a hgsubversion repo that contains over 300,000 commits. In that repo, this patch improves performance as follows: hg --time log -r 'first(fromsvn())' Before: 40.3 sec After: 0.8 sec hg --time log -r 'svnrev(350000)' Before: 40.3 sec After: 0.1 sec Note: the performance of these revset implementations is very sensitive to doing as little work as possible per line of the rev_map file. I originally attempted to hide the file format details by hoisting the parsing of each line up into RevMap.readmapfile, but the current less abstract code is dramatically (10x or more) faster. If the revmap file is missing, we error out and print a message describing what to do.
author Bryan O'Sullivan <bryano@fb.com>
date Sat, 12 May 2012 05:38:34 -0700
parents 312b37bc5e20
children d741f536f23a
line wrap: on
line source

import test_util

import unittest

class TestFetchBinaryFiles(test_util.TestBase):
    def test_binaryfiles(self, stupid=False):
        repo = self._load_fixture_and_fetch('binaryfiles.svndump', stupid=stupid)
        self.assertEqual('cce7fe400d8d', str(repo['tip']))

    def test_binaryfiles_stupid(self):
        self.test_binaryfiles(True)

def suite():
    all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestFetchBinaryFiles),
          ]
    return unittest.TestSuite(all_tests)