| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
44 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,18 +21,17 @@ environment: | |||
| 21 | 21 | IS_CONDA: "yes" | |
| 22 | 22 | GIT_PATH: "%GIT_DAEMON_PATH%" | |
| 23 | 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%" | ||
| 24 | + ## Cygwin | ||
| 25 | + # | ||
| 26 | + - PYTHON: "C:\\Miniconda-x64" | ||
| 27 | + PYTHON_VERSION: "2.7" | ||
| 28 | + IS_CONDA: "yes" | ||
| 29 | + IS_CYGWIN: "yes" | ||
| 30 | + GIT_PATH: "%CYGWIN_GIT_PATH%" | ||
| 31 | + - PYTHON: "C:\\Python35-x64" | ||
| 32 | + PYTHON_VERSION: "3.5" | ||
| 33 | + GIT_PATH: "%CYGWIN64_GIT_PATH%" | ||
| 34 | + IS_CYGWIN: "yes" | ||
| 36 | 35 | ||
| 37 | 36 | ||
| 38 | 37 | install: | |
@@ -48,14 +47,12 @@ install: | |||
| 48 | 47 | python --version | |
| 49 | 48 | python -c "import struct; print(struct.calcsize('P') * 8)" | |
| 50 | 49 | ||
| 51 | - - IF "%IS_CONDA%"=="yes" ( | ||
| 50 | + - IF "%IS_CONDA%" == "yes" ( | ||
| 52 | 51 | conda info -a & | |
| 53 | 52 | conda install --yes --quiet pip | |
| 54 | 53 | ) | |
| 55 | - - pip install nose ddt wheel codecov | ||
| 56 | - - IF "%PYTHON_VERSION%"=="2.7" ( | ||
| 57 | - pip install mock | ||
| 58 | - ) | ||
| 54 | + - pip install -r test-requirements.txt | ||
| 55 | + - pip install codecov | ||
| 59 | 56 | ||
| 60 | 57 | ## Copied from `init-tests-after-clone.sh`. | |
| 61 | 58 | # | |
@@ -79,7 +76,15 @@ install: | |||
| 79 | 76 | build: false | |
| 80 | 77 | ||
| 81 | 78 | test_script: | |
| 82 | - - IF "%PYTHON_VERSION%"=="3.5" (nosetests -v --with-coverage) ELSE (nosetests -v) | ||
| 79 | + - IF "%IS_CYGWIN%" == "yes" ( | ||
| 80 | + nosetests -v | ||
| 81 | + ) ELSE ( | ||
| 82 | + IF "%PYTHON_VERSION%" == "3.5" ( | ||
| 83 | + nosetests -v --with-coverage | ||
| 84 | + ) ELSE ( | ||
| 85 | + nosetests -v | ||
| 86 | + ) | ||
| 87 | + ) | ||
| 83 | 88 | ||
| 84 | 89 | on_success: | |
| 85 | - - IF "%PYTHON_VERSION%"=="3.5" (codecov) | ||
| 90 | + - IF "%PYTHON_VERSION%" == "3.5" IF NOT "%IS_CYGWIN%" == "yes" (codecov) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,14 +1,10 @@ | |||
| 1 | 1 | language: python | |
| 2 | 2 | python: | |
| 3 | - - "2.6" | ||
| 4 | 3 | - "2.7" | |
| 5 | 4 | - "3.3" | |
| 6 | 5 | - "3.4" | |
| 7 | 6 | - "3.5" | |
| 8 | 7 | # - "pypy" - won't work as smmap doesn't work (see gitdb/.travis.yml for details) | |
| 9 | - matrix: | ||
| 10 | - allow_failures: | ||
| 11 | - - python: "2.6" | ||
| 12 | 8 | git: | |
| 13 | 9 | # a higher depth is needed for most of the tests - must be high enough to not actually be shallow | |
| 14 | 10 | # as we clone our own repository in the process | |
@@ -17,7 +13,8 @@ install: | |||
| 17 | 13 | - python --version; git --version | |
| 18 | 14 | - git submodule update --init --recursive | |
| 19 | 15 | - git fetch --tags | |
| 20 | - - pip install codecov flake8 ddt sphinx | ||
| 16 | + - pip install -r test-requirements.txt | ||
| 17 | + - pip install codecov sphinx | ||
| 21 | 18 | ||
| 22 | 19 | # generate some reflog as git-python tests need it (in master) | |
| 23 | 20 | - ./init-tests-after-clone.sh | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,9 +5,12 @@ | |||
| 5 | 5 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 6 | 6 | # flake8: noqa | |
| 7 | 7 | #@PydevCodeAnalysisIgnore | |
| 8 | + import inspect | ||
| 8 | 9 | import os | |
| 9 | 10 | import sys | |
| 10 | - import inspect | ||
| 11 | + | ||
| 12 | + import os.path as osp | ||
| 13 | + | ||
| 11 | 14 | ||
| 12 | 15 | __version__ = 'git' | |
| 13 | 16 | ||
@@ -16,7 +19,7 @@ | |||
| 16 | 19 | def _init_externals(): | |
| 17 | 20 | """Initialize external projects by putting them into the path""" | |
| 18 | 21 | if __version__ == 'git': | |
| 19 | - sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'ext', 'gitdb')) | ||
| 22 | + sys.path.insert(0, osp.join(osp.dirname(__file__), 'ext', 'gitdb')) | ||
| 20 | 23 | ||
| 21 | 24 | try: | |
| 22 | 25 | import gitdb | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,6 +31,7 @@ | |||
| 31 | 31 | ) | |
| 32 | 32 | from git.exc import CommandError | |
| 33 | 33 | from git.odict import OrderedDict | |
| 34 | + from git.util import is_cygwin_git, cygpath | ||
| 34 | 35 | ||
| 35 | 36 | from .exc import ( | |
| 36 | 37 | GitCommandError, | |
@@ -191,8 +192,26 @@ def __setstate__(self, d): | |||
| 191 | 192 | USE_SHELL = False | |
| 192 | 193 | ||
| 193 | 194 | @classmethod | |
| 194 | - def polish_url(cls, url): | ||
| 195 | - return url.replace("\\\\", "\\").replace("\\", "/") | ||
| 195 | + def is_cygwin(cls): | ||
| 196 | + return is_cygwin_git(cls.GIT_PYTHON_GIT_EXECUTABLE) | ||
| 197 | + | ||
| 198 | + @classmethod | ||
| 199 | + def polish_url(cls, url, is_cygwin=None): | ||
| 200 | + if is_cygwin is None: | ||
| 201 | + is_cygwin = cls.is_cygwin() | ||
| 202 | + | ||
| 203 | + if is_cygwin: | ||
| 204 | + url = cygpath(url) | ||
| 205 | + else: | ||
| 206 | + """Remove any backslahes from urls to be written in config files. | ||
| 207 | + | ||
| 208 | + Windows might create config-files containing paths with backslashed, | ||
| 209 | + but git stops liking them as it will escape the backslashes. | ||
| 210 | + Hence we undo the escaping just to be sure. | ||
| 211 | + """ | ||
| 212 | + url = url.replace("\\\\", "\\").replace("\\", "/") | ||
| 213 | + | ||
| 214 | + return url | ||
| 196 | 215 | ||
| 197 | 216 | class AutoInterrupt(object): | |
| 198 | 217 | """Kill/Interrupt the stored process instance once this instance goes out of scope. It is | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,21 +6,13 @@ | |||
| 6 | 6 | """Module containing module parser implementation able to properly read and write | |
| 7 | 7 | configuration files""" | |
| 8 | 8 | ||
| 9 | - import re | ||
| 10 | - try: | ||
| 11 | - import ConfigParser as cp | ||
| 12 | - except ImportError: | ||
| 13 | - # PY3 | ||
| 14 | - import configparser as cp | ||
| 9 | + import abc | ||
| 10 | + from functools import wraps | ||
| 15 | 11 | import inspect | |
| 16 | 12 | import logging | |
| 17 | - import abc | ||
| 18 | 13 | import os | |
| 14 | + import re | ||
| 19 | 15 | ||
| 20 | - from functools import wraps | ||
| 21 | - | ||
| 22 | - from git.odict import OrderedDict | ||
| 23 | - from git.util import LockFile | ||
| 24 | 16 | from git.compat import ( | |
| 25 | 17 | string_types, | |
| 26 | 18 | FileType, | |
@@ -29,6 +21,18 @@ | |||
| 29 | 21 | with_metaclass, | |
| 30 | 22 | PY3 | |
| 31 | 23 | ) | |
| 24 | + from git.odict import OrderedDict | ||
| 25 | + from git.util import LockFile | ||
| 26 | + | ||
| 27 | + import os.path as osp | ||
| 28 | + | ||
| 29 | + | ||
| 30 | + try: | ||
| 31 | + import ConfigParser as cp | ||
| 32 | + except ImportError: | ||
| 33 | + # PY3 | ||
| 34 | + import configparser as cp | ||
| 35 | + | ||
| 32 | 36 | ||
| 33 | 37 | __all__ = ('GitConfigParser', 'SectionConstraint') | |
| 34 | 38 | ||
@@ -408,15 +412,15 @@ def read(self): | |||
| 408 | 412 | if self._has_includes(): | |
| 409 | 413 | for _, include_path in self.items('include'): | |
| 410 | 414 | if include_path.startswith('~'): | |
| 411 | - include_path = os.path.expanduser(include_path) | ||
| 412 | - if not os.path.isabs(include_path): | ||
| 415 | + include_path = osp.expanduser(include_path) | ||
| 416 | + if not osp.isabs(include_path): | ||
| 413 | 417 | if not file_ok: | |
| 414 | 418 | continue | |
| 415 | 419 | # end ignore relative paths if we don't know the configuration file path | |
| 416 | - assert os.path.isabs(file_path), "Need absolute paths to be sure our cycle checks will work" | ||
| 417 | - include_path = os.path.join(os.path.dirname(file_path), include_path) | ||
| 420 | + assert osp.isabs(file_path), "Need absolute paths to be sure our cycle checks will work" | ||
| 421 | + include_path = osp.join(osp.dirname(file_path), include_path) | ||
| 418 | 422 | # end make include path absolute | |
| 419 | - include_path = os.path.normpath(include_path) | ||
| 423 | + include_path = osp.normpath(include_path) | ||
| 420 | 424 | if include_path in seen or not os.access(include_path, os.R_OK): | |
| 421 | 425 | continue | |
| 422 | 426 | seen.add(include_path) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,12 +1,9 @@ | |||
| 1 | 1 | """Module with our own gitdb implementation - it uses the git command""" | |
| 2 | + from git.util import bin_to_hex, hex_to_bin | ||
| 2 | 3 | from gitdb.base import ( | |
| 3 | 4 | OInfo, | |
| 4 | 5 | OStream | |
| 5 | 6 | ) | |
| 6 | - from gitdb.util import ( | ||
| 7 | - bin_to_hex, | ||
| 8 | - hex_to_bin | ||
| 9 | - ) | ||
| 10 | 7 | from gitdb.db import GitDB # @UnusedImport | |
| 11 | 8 | from gitdb.db import LooseObjectDB | |
| 12 | 9 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,18 +5,17 @@ | |||
| 5 | 5 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 6 | 6 | import re | |
| 7 | 7 | ||
| 8 | - from gitdb.util import hex_to_bin | ||
| 8 | + from git.cmd import handle_process_output | ||
| 9 | + from git.compat import ( | ||
| 10 | + defenc, | ||
| 11 | + PY3 | ||
| 12 | + ) | ||
| 13 | + from git.util import finalize_process, hex_to_bin | ||
| 9 | 14 | ||
| 10 | 15 | from .compat import binary_type | |
| 11 | 16 | from .objects.blob import Blob | |
| 12 | 17 | from .objects.util import mode_str_to_int | |
| 13 | 18 | ||
| 14 | - from git.compat import ( | ||
| 15 | - defenc, | ||
| 16 | - PY3 | ||
| 17 | - ) | ||
| 18 | - from git.cmd import handle_process_output | ||
| 19 | - from git.util import finalize_process | ||
| 20 | 19 | ||
| 21 | 20 | __all__ = ('Diffable', 'DiffIndex', 'Diff', 'NULL_TREE') | |
| 22 | 21 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments