diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2011-06-13 14:55:24 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2011-06-13 17:05:14 +0200 |
commit | 4bf372dc4064b1ff30140ab4c11fa6830e695504 (patch) | |
tree | a99ee49a4153feeac826d3a9037ec2f2751aa698 | |
parent | e00bf792077d59b3344f0d14f3192806c42d54bd (diff) | |
download | gitpython-4bf372dc4064b1ff30140ab4c11fa6830e695504.tar.gz |
test_submodule: Will now load everything into memory if smmap is present, to help the submodule test to work even on windows
-rw-r--r-- | git/test/objects/test_submodule.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/git/test/objects/test_submodule.py b/git/test/objects/test_submodule.py index 530806fb..a3bc6d9f 100644 --- a/git/test/objects/test_submodule.py +++ b/git/test/objects/test_submodule.py @@ -9,9 +9,23 @@ from git.util import to_native_path_linux, join_path_native import shutil import git +import sys import os import sys +# Change the configuration if possible to prevent the underlying memory manager +# to keep file handles open. On windows we get problems as they are not properly +# closed due to mmap bugs on windows (as it appears) +if sys.platform == 'win32': + try: + import smmap.util + smmap.util.MapRegion._test_read_into_memory = True + except ImportError: + sys.stderr.write("The submodule tests will fail as some files cannot be removed due to open file handles.\n") + sys.stderr.write("The latest version of gitdb uses a memory map manager which can be configured to work around this problem") +#END handle windows platform + + class TestRootProgress(RootUpdateProgress): """Just prints messages, for now without checking the correctness of the states""" |