| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f1d2d06 commit 3959556
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,32 +5,36 @@ environment: | |||
| 5 | 5 | CYGWIN64_GIT_PATH: "C:\\cygwin64\\bin;%GIT_DAEMON_PATH%" | |
| 6 | 6 | ||
| 7 | 7 | matrix: | |
| 8 | + ## MINGW | ||
| 9 | + # | ||
| 8 | 10 | - PYTHON: "C:\\Python27" | |
| 9 | 11 | PYTHON_VERSION: "2.7" | |
| 10 | 12 | 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 | - | ||
| 16 | 13 | - PYTHON: "C:\\Python34-x64" | |
| 17 | 14 | PYTHON_VERSION: "3.4" | |
| 18 | 15 | GIT_PATH: "%GIT_DAEMON_PATH%" | |
| 19 | - - PYTHON: "C:\\Python34-x64" | ||
| 20 | - PYTHON_VERSION: "3.4" | ||
| 21 | - GIT_PATH: "%CYGWIN_GIT_PATH%" | ||
| 22 | - | ||
| 23 | 16 | - PYTHON: "C:\\Python35-x64" | |
| 24 | 17 | PYTHON_VERSION: "3.5" | |
| 25 | 18 | GIT_PATH: "%GIT_DAEMON_PATH%" | |
| 26 | - - PYTHON: "C:\\Python35-x64" | ||
| 27 | - PYTHON_VERSION: "3.5" | ||
| 28 | - GIT_PATH: "%CYGWIN64_GIT_PATH%" | ||
| 29 | 19 | - PYTHON: "C:\\Miniconda35-x64" | |
| 30 | 20 | PYTHON_VERSION: "3.5" | |
| 31 | 21 | IS_CONDA: "yes" | |
| 32 | 22 | GIT_PATH: "%GIT_DAEMON_PATH%" | |
| 33 | 23 | ||
| 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 | + | ||
| 34 | 38 | install: | |
| 35 | 39 | - set PATH=%PYTHON%;%PYTHON%\Scripts;%GIT_PATH%;%PATH% | |
| 36 | 40 | ||
@@ -44,9 +48,9 @@ install: | |||
| 44 | 48 | ||
| 45 | 49 | - IF "%IS_CONDA%"=="yes" ( | |
| 46 | 50 | conda info -a & | |
| 47 | - conda install --yes --quiet pip | ||
| 51 | + conda install --yes --quiet pip | ||
| 48 | 52 | ) | |
| 49 | - - pip install nose ddt wheel coveralls | ||
| 53 | + - pip install nose ddt wheel coveralls | ||
| 50 | 54 | - IF "%PYTHON_VERSION%"=="2.7" ( | |
| 51 | 55 | pip install mock | |
| 52 | 56 | ) | |
@@ -73,7 +77,7 @@ install: | |||
| 73 | 77 | build: false | |
| 74 | 78 | ||
| 75 | 79 | test_script: | |
| 76 | - - nosetests -v | ||
| 80 | + - nosetests | ||
| 77 | 81 | ||
| 78 | 82 | #on_success: | |
| 79 | 83 | # - IF "%PYTHON_VERSION%"=="3.4" (coveralls) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -66,6 +66,16 @@ def safe_decode(s): | |||
| 66 | 66 | raise TypeError('Expected bytes or text, but got %r' % (s,)) | |
| 67 | 67 | ||
| 68 | 68 | ||
| 69 | + def safe_encode(s): | ||
| 70 | + """Safely decodes a binary string to unicode""" | ||
| 71 | + if isinstance(s, unicode): | ||
| 72 | + return s.encode(defenc) | ||
| 73 | + elif isinstance(s, bytes): | ||
| 74 | + return s | ||
| 75 | + elif s is not None: | ||
| 76 | + raise TypeError('Expected bytes or text, but got %r' % (s,)) | ||
| 77 | + | ||
| 78 | + | ||
| 69 | 79 | def with_metaclass(meta, *bases): | |
| 70 | 80 | """copied from https://github.com/Byron/bcore/blob/master/src/python/butility/future.py#L15""" | |
| 71 | 81 | class metaclass(meta): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,10 +41,13 @@ | |||
| 41 | 41 | from gitdb.base import IStream | |
| 42 | 42 | from gitdb.typ import str_tree_type | |
| 43 | 43 | from git.compat import ( | |
| 44 | + PY3, | ||
| 44 | 45 | defenc, | |
| 45 | 46 | force_text, | |
| 46 | 47 | force_bytes, | |
| 47 | 48 | is_posix, | |
| 49 | + safe_encode, | ||
| 50 | + safe_decode, | ||
| 48 | 51 | ) | |
| 49 | 52 | ||
| 50 | 53 | S_IFGITLINK = S_IFLNK | S_IFDIR # a submodule | |
@@ -69,7 +72,7 @@ def run_commit_hook(name, index): | |||
| 69 | 72 | return | |
| 70 | 73 | ||
| 71 | 74 | env = os.environ.copy() | |
| 72 | - env['GIT_INDEX_FILE'] = index.path | ||
| 75 | + env['GIT_INDEX_FILE'] = safe_decode(index.path) if PY3 else safe_encode(index.path) | ||
| 73 | 76 | env['GIT_EDITOR'] = ':' | |
| 74 | 77 | try: | |
| 75 | 78 | cmd = subprocess.Popen(hp, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -848,13 +848,15 @@ def remove(self, module=True, force=False, configuration=True, dry_run=False): | |||
| 848 | 848 | ||
| 849 | 849 | # finally delete our own submodule | |
| 850 | 850 | if not dry_run: | |
| 851 | + self._clear_cache() | ||
| 851 | 852 | wtd = mod.working_tree_dir | |
| 852 | 853 | del(mod) # release file-handles (windows) | |
| 853 | 854 | rmtree(wtd) | |
| 854 | 855 | # END delete tree if possible | |
| 855 | 856 | # END handle force | |
| 856 | 857 | ||
| 857 | 858 | if not dry_run and os.path.isdir(git_dir): | |
| 859 | + self._clear_cache() | ||
| 858 | 860 | rmtree(git_dir) | |
| 859 | 861 | # end handle separate bare repository | |
| 860 | 862 | # END handle module deletion | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -87,6 +87,9 @@ def test_large_data_streaming(self, rwrepo): | |||
| 87 | 87 | % (size_kib, desc, cs_kib, elapsed_readchunks, size_kib / elapsed_readchunks), file=sys.stderr) | |
| 88 | 88 | ||
| 89 | 89 | # del db file so git has something to do | |
| 90 | + ostream = None | ||
| 91 | + import gc | ||
| 92 | + gc.collect() | ||
| 90 | 93 | os.remove(db_file) | |
| 91 | 94 | ||
| 92 | 95 | # VS. CGIT | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -90,10 +90,11 @@ def test_blocking_lock_file(self): | |||
| 90 | 90 | wait_lock = BlockingLockFile(my_file, 0.05, wait_time) | |
| 91 | 91 | self.failUnlessRaises(IOError, wait_lock._obtain_lock) | |
| 92 | 92 | elapsed = time.time() - start | |
| 93 | - extra_time = 0.2 | ||
| 93 | + extra_time = 0.02 | ||
| 94 | 94 | if is_win: | |
| 95 | + # for Appveyor | ||
| 95 | 96 | extra_time *= 6 # NOTE: Indeterministic failures here... | |
| 96 | - self.assertLess(elapsed, wait_time + 0.02) | ||
| 97 | + self.assertLess(elapsed, wait_time + extra_time) | ||
| 97 | 98 | ||
| 98 | 99 | def test_user_id(self): | |
| 99 | 100 | assert '@' in get_user_id() | |
| Back | FazBrowse Home | New Git URL |
0 commit comments