diff tests/test_util.py @ 944:d6db289f1548

pull: add hgsubversion.filestoresize to control memory consumption The configuration entry defines the size of the replay or stupid edited file store, that is the maximum amount of edited files data in megabytes which can be kept in memory before falling back to storing it in a temporary directory. Default to 200 (megabytes), use -1 to disable.
author Patrick Mezard <patrick@mezard.eu>
date Fri, 28 Sep 2012 21:43:50 +0200
parents 5bacb9c63e3e
children 9c3b4f59e7e6
line wrap: on
line diff
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -333,8 +333,9 @@ class TestBase(unittest.TestCase):
             tarball.extract(entry, path)
         return path
 
-    def fetch(self, repo_path, subdir=None, stupid=False, layout='auto', startrev=0,
-              externals=None, noupdate=True, dest=None, rev=None):
+    def fetch(self, repo_path, subdir=None, stupid=False, layout='auto',
+            startrev=0, externals=None, noupdate=True, dest=None, rev=None,
+            config=None):
         if layout == 'single':
             if subdir is None:
                 subdir = 'trunk'
@@ -357,8 +358,11 @@ class TestBase(unittest.TestCase):
             cmd.append('--noupdate')
         if rev is not None:
             cmd.append('--rev=%s' % rev)
+        config = dict(config or {})
         if externals:
-            cmd[:0] = ['--config', 'hgsubversion.externals=%s' % externals]
+            config['hgsubversion.externals'] = str(externals)
+        for k,v in reversed(sorted(config.iteritems())):
+            cmd[:0] = ['--config', '%s=%s' % (k, v)]
 
         dispatch(cmd)