Skip to content

Commit 48fab54

Browse files
committedJun 13, 2011
test_submodule: Will now load everything into memory if smmap is present, to help the submodule test to work even on windows
1 parent 4a8bdce commit 48fab54

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed
 

‎git/ext/gitdb

Submodule gitdb updated 1 file

‎git/test/test_submodule.py

+14
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,22 @@
88
from git.util import to_native_path_linux, join_path_native
99
import shutil
1010
import git
11+
import sys
1112
import os
1213

14+
# Change the configuration if possible to prevent the underlying memory manager
15+
# to keep file handles open. On windows we get problems as they are not properly
16+
# closed due to mmap bugs on windows (as it appears)
17+
if sys.platform == 'win32':
18+
try:
19+
import smmap.util
20+
smmap.util.MapRegion._test_read_into_memory = True
21+
except ImportError:
22+
sys.stderr.write("The submodule tests will fail as some files cannot be removed due to open file handles.\n")
23+
sys.stderr.write("The latest version of gitdb uses a memory map manager which can be configured to work around this problem")
24+
#END handle windows platform
25+
26+
1327
class TestRootProgress(RootUpdateProgress):
1428
"""Just prints messages, for now without checking the correctness of the states"""
1529

0 commit comments

Comments
 (0)
Please sign in to comment.