Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3959556

Browse files
committed
FIX hook TC on PY3+Win & indeterministic lock timing.
+ Cannot `index.path` into ENV, it is bytes!+ The hook TC never runs on linux!+ Unblock removal of odbfile in perf-large streams TC.+ Attempt to unblock removal of submodule file by intensive cleaning.more unblock files
1 parentf1d2d06 commit3959556

File tree

6 files changed

+41
-18
lines changed

6 files changed

+41
-18
lines changed

‎.appveyor.yml‎

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,36 @@ environment:
55
CYGWIN64_GIT_PATH:"C:\\cygwin64\\bin;%GIT_DAEMON_PATH%"
66

77
matrix:
8+
## MINGW
9+
#
810
-PYTHON:"C:\\Python27"
911
PYTHON_VERSION:"2.7"
1012
GIT_PATH:"%GIT_DAEMON_PATH%"
11-
-PYTHON:"C:\\Miniconda-x64"
12-
PYTHON_VERSION:"2.7"
13-
IS_CONDA:"yes"
14-
GIT_PATH:"%CYGWIN_GIT_PATH%"
15-
1613
-PYTHON:"C:\\Python34-x64"
1714
PYTHON_VERSION:"3.4"
1815
GIT_PATH:"%GIT_DAEMON_PATH%"
19-
-PYTHON:"C:\\Python34-x64"
20-
PYTHON_VERSION:"3.4"
21-
GIT_PATH:"%CYGWIN_GIT_PATH%"
22-
2316
-PYTHON:"C:\\Python35-x64"
2417
PYTHON_VERSION:"3.5"
2518
GIT_PATH:"%GIT_DAEMON_PATH%"
26-
-PYTHON:"C:\\Python35-x64"
27-
PYTHON_VERSION:"3.5"
28-
GIT_PATH:"%CYGWIN64_GIT_PATH%"
2919
-PYTHON:"C:\\Miniconda35-x64"
3020
PYTHON_VERSION:"3.5"
3121
IS_CONDA:"yes"
3222
GIT_PATH:"%GIT_DAEMON_PATH%"
3323

24+
## Cygwin
25+
#
26+
-PYTHON:"C:\\Miniconda-x64"
27+
PYTHON_VERSION:"2.7"
28+
IS_CONDA:"yes"
29+
GIT_PATH:"%CYGWIN_GIT_PATH%"
30+
-PYTHON:"C:\\Python34-x64"
31+
PYTHON_VERSION:"3.4"
32+
GIT_PATH:"%CYGWIN_GIT_PATH%"
33+
-PYTHON:"C:\\Python35-x64"
34+
PYTHON_VERSION:"3.5"
35+
GIT_PATH:"%CYGWIN64_GIT_PATH%"
36+
37+
3438
install:
3539
-set PATH=%PYTHON%;%PYTHON%\Scripts;%GIT_PATH%;%PATH%
3640

@@ -44,9 +48,9 @@ install:
4448
4549
-IF "%IS_CONDA%"=="yes" (
4650
conda info -a &
47-
conda install --yes --quiet pip
51+
conda install --yes --quiet pip
4852
)
49-
-pip install nose ddt wheel coveralls
53+
-pip install nose ddt wheel coveralls
5054
-IF "%PYTHON_VERSION%"=="2.7" (
5155
pip install mock
5256
)
@@ -73,7 +77,7 @@ install:
7377
build:false
7478

7579
test_script:
76-
-nosetests -v
80+
-nosetests
7781

7882
#on_success:
7983
# - IF "%PYTHON_VERSION%"=="3.4" (coveralls)

‎git/compat.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ def safe_decode(s):
6666
raiseTypeError('Expected bytes or text, but got %r'% (s,))
6767

6868

69+
defsafe_encode(s):
70+
"""Safely decodes a binary string to unicode"""
71+
ifisinstance(s,unicode):
72+
returns.encode(defenc)
73+
elifisinstance(s,bytes):
74+
returns
75+
elifsisnotNone:
76+
raiseTypeError('Expected bytes or text, but got %r'% (s,))
77+
78+
6979
defwith_metaclass(meta,*bases):
7080
"""copied from https://github.com/Byron/bcore/blob/master/src/python/butility/future.py#L15"""
7181
classmetaclass(meta):

‎git/index/fun.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,13 @@
4141
fromgitdb.baseimportIStream
4242
fromgitdb.typimportstr_tree_type
4343
fromgit.compatimport (
44+
PY3,
4445
defenc,
4546
force_text,
4647
force_bytes,
4748
is_posix,
49+
safe_encode,
50+
safe_decode,
4851
)
4952

5053
S_IFGITLINK=S_IFLNK|S_IFDIR# a submodule
@@ -69,7 +72,7 @@ def run_commit_hook(name, index):
6972
return
7073

7174
env=os.environ.copy()
72-
env['GIT_INDEX_FILE']=index.path
75+
env['GIT_INDEX_FILE']=safe_decode(index.path)ifPY3elsesafe_encode(index.path)
7376
env['GIT_EDITOR']=':'
7477
try:
7578
cmd=subprocess.Popen(hp,

‎git/objects/submodule/base.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,13 +848,15 @@ def remove(self, module=True, force=False, configuration=True, dry_run=False):
848848

849849
# finally delete our own submodule
850850
ifnotdry_run:
851+
self._clear_cache()
851852
wtd=mod.working_tree_dir
852853
del(mod)# release file-handles (windows)
853854
rmtree(wtd)
854855
# END delete tree if possible
855856
# END handle force
856857

857858
ifnotdry_runandos.path.isdir(git_dir):
859+
self._clear_cache()
858860
rmtree(git_dir)
859861
# end handle separate bare repository
860862
# END handle module deletion

‎git/test/performance/test_streams.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ def test_large_data_streaming(self, rwrepo):
8787
% (size_kib,desc,cs_kib,elapsed_readchunks,size_kib/elapsed_readchunks),file=sys.stderr)
8888

8989
# del db file so git has something to do
90+
ostream=None
91+
importgc
92+
gc.collect()
9093
os.remove(db_file)
9194

9295
# VS. CGIT

‎git/test/test_util.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,11 @@ def test_blocking_lock_file(self):
9090
wait_lock=BlockingLockFile(my_file,0.05,wait_time)
9191
self.failUnlessRaises(IOError,wait_lock._obtain_lock)
9292
elapsed=time.time()-start
93-
extra_time=0.2
93+
extra_time=0.02
9494
ifis_win:
95+
# for Appveyor
9596
extra_time*=6# NOTE: Indeterministic failures here...
96-
self.assertLess(elapsed,wait_time+0.02)
97+
self.assertLess(elapsed,wait_time+extra_time)
9798

9899
deftest_user_id(self):
99100
assert'@'inget_user_id()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp