diff hgsubversion/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 7a98fbadcae9
children bd9c292665fd
line wrap: on
line diff
--- a/hgsubversion/util.py
+++ b/hgsubversion/util.py
@@ -327,3 +327,12 @@ revsets = {
     'fromsvn': revset_fromsvn,
     'svnrev': revset_svnrev,
 }
+
+def getfilestoresize(ui):
+    """Return the replay or stupid file memory store size in megabytes or -1"""
+    size = ui.configint('hgsubversion', 'filestoresize', 200)
+    if size >= 0:
+        size = size*(2**20)
+    else:
+        size = -1
+    return size