summaryrefslogtreecommitdiff
path: root/git/util.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix `AttributeError` when searching a remote by nameCésar Izurieta2019-07-211-3/+6
| | | | | | Running code like `'origin' in git.Repo('path/to/existing/repository').remotes` raises an AttributeError instead of returning a boolean. This commit fixes that behaviour by catching the error when doing an identity match on `IterableList`.
* Revert "Revert "Revert "Implement update call when the object is "up to ↵Sebastian Thiel2019-07-201-15/+0
| | | | | | | | | date" #871""" This reverts commit 9b628dccf4102d2a63c6fc8cd957ab1293bafbc6. Definitely doesn't work https://travis-ci.org/gitpython-developers/GitPython/builds/561361507
* Revert "Revert "Implement update call when the object is "up to date" #871""Sebastian Thiel2019-07-201-0/+15
| | | | | | This reverts commit 3bf002e3ccc26ec99e8ada726b8739975cd5640e. Try again
* Revert "Implement update call when the object is "up to date" #871"Sebastian Thiel2019-07-201-15/+0
| | | | | | | | This reverts commit 687c8f0494dde31f86f98dcb48b6f3e1338d4308. Causes https://travis-ci.org/gitpython-developers/GitPython/jobs/561359367 Reopen #871
* Implement update call when the object is "up to date" #871Thomas Johannesmeyer2019-07-201-0/+15
| | | | Fixes #871
* Fix regex to support empty email addresses i.e. 'name <>'Sebastian Thiel2019-07-061-2/+2
| | | | Fixes #833
* Apply fix for #564Sebastian Thiel2018-10-141-1/+1
| | | | | | As suggested in this comment https://github.com/gitpython-developers/GitPython/issues/564#issuecomment-298257402
* Rewrite unnecessary dict/list/tuple calls as literalsHugo2018-03-181-4/+4
|
* Drop support for EOL Python 2.6Hugo2018-03-181-4/+1
|
* Fix doc typossamuela2018-03-041-2/+2
|
* RF: primarily flake8 lints + minor RF to reduce duplication in PATHEXTYaroslav Halchenko2017-11-271-11/+6
| | | | | I did keep some "bare" except with catch all Exception: , while tried to disable flake8 complaints where clearly all exceptions are to be catched
* Merge branch 'master' of https://github.com/Plazmaz/GitPython into ↵Sebastian Thiel2017-09-281-2/+5
|\ | | | | | | Plazmaz-master
* | util: move expand_path from repo/base and use it in Git class initAlexis Horgix Chotard2017-08-251-0/+7
|/
* Spelling fixesVille Skyttä2017-03-091-1/+1
|
* Merge pull request #541 from andy-maier/py26_fixesSebastian Thiel2016-12-081-4/+11
|\ | | | | Fixes to support Python 2.6 again.
| * Fixes to support Python 2.6 again.Andreas Maier2016-10-241-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Details: - Added Python 2.6 again to .travis.yml (it was removed in commit 4486bcb). - Replaced the use of dictionary comprehensions in `git/cmd.py` around line 800 with the code before that change (in commit 25a2ebf). Reason: dict comprehensions were introduced only in Python 2.7. - Changed the import source for `SkipTest` and `skipIf` from `unittest.case` to first trying `unittest` and upon ImportError from `unittest2`. This was done in `git/util.py` and in several testcases. Reason: `SkipTest` and `skipIf` were introduced to unittest only in Python 2.7, and `unittest2` is a backport of `unittest` additions to Python 2.6. - In git/test/lib/helper.py, fixed the definition of `assertRaisesRegex` to work on py26. - For Python 2.6, added the `unittest2` dependency to `requirements.txt` and changed `.travis.yml` to install `unittest2`. Because git/util.py uses SkipTest from unittest/unittest2, the dependency could not be added to `test-requirements.txt`. - Fixed an assertion in `git/test/test_index.py` to also allow a Python 2.6 specific exception message. - In `is_cygwin_git()` in `git/util.py`, replaced `check_output()` with `Popen()`. It was added in Python 2.7. - Enabled Python 2.6 for Windows: - Added Python 2.6 for MINGW in .appveyor.yml. - When defining `PROC_CREATIONFLAGS` in `git/cmd.py`, made use of certain win32 and subprocess flags that were introduced in Python 2.7, dependent on whether we run on Python 2.7 or higher. - In `AutoInterrupt.__del__()` in `git/cmd.py`, allowed for `os` not having `kill()`. `os.kill()` was added for Windows in Python 2.7 (For Linux, it existed in Python 2.6 already).
* | Merge pull request #554 from nvie/masterVincent Driessen2016-12-081-2/+0
|\ \ | | | | | | Don't change the meaning of string literals
| * | Don't change the meaning of string literalsVincent Driessen2016-12-071-2/+0
| |/
* | chore(lint): flake8Sebastian Thiel2016-12-081-0/+1
|/ | | | | | | | Interestingly only shows in particular python versions on travis. Maybe some caching effect? Locally it is reproducible easily, with the latest flake8
* Merge branch 'cygwin' of https://github.com/ankostis/GitPython into ↵Sebastian Thiel2016-10-221-11/+166
|\ | | | | | | ankostis-cygwin
| * ci, deps: no PY26, ddt>=1.1.1, CIs `pip install test-requirements`Kostis Anagnostopoulos2016-10-161-1/+1
| | | | | | | | + Use environment-markers in requirement files (see http://stackoverflow.com/a/33451105/548792).
| * src: reduce needless deps to `gitdb.util`Kostis Anagnostopoulos2016-10-161-1/+4
| |
| * src: import os.path as ospKostis Anagnostopoulos2016-10-161-3/+3
| |
| * cygwin, #533: polish abs-paths in `git add` commandsKostis Anagnostopoulos2016-10-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | + Modify TCs - no main-code changes. + FIXed: + `TestSubmodule.test_git_submodules_and_add_sm_with_new_commit()` + TestDiff.test_diff_with_staged_file() - Cygwin TCs failing: - PY2: err: 12, fail: 2 - PY3: err: 11, fail: 2
| * cygwin, #533: Allow '/cygdrive/c/' paths on repo initKostis Anagnostopoulos2016-10-141-1/+13
| | | | | | | | | | | | - Cygwin TCs failing: - PY2: err: 13, fail: 2 - PY3: err: 12, fail: 2
| * cygwin, #533: Try to make it work with Cygwin's Git.Kostis Anagnostopoulos2016-10-141-8/+147
| | | | | | | | | | | | | | | | | | + Make `Git.polish_url()` convert paths into Cygwin-friendly paths. + Add utility and soe TCs for funcs for detecting cygwin and converting abs-paths to `/cygdrive/c/...`. - Cygwin TCs failing: - PY2: err: 14, fail: 3 - PY3: err: 13, fail: 3
* | Fix some typosSantiago Castro2016-10-201-4/+4
|/
* remote, #525: FIX BUG push-cmd misses error messagesKostis Anagnostopoulos2016-10-141-1/+1
| | | | | | + Bug discovered after enabling TC in prev commit and rework of fetch. + remote_tc: unitestize assertions. + util: DEL unused `_mktemp()`.
* remote, #525: pump fetch-infos instead of GIL-read stderrKostis Anagnostopoulos2016-10-131-10/+13
| | | | | | + `handle_process_output()` accepts null-finalizer, to pump completely stderr before raising any errors. + test: Enable `TestGit.test_environment()` on Windows (to checks stderr consumption).
* test, #525: allow disabling freeze errors separatelyKostis Anagnostopoulos2016-10-131-0/+1
| | | | | + cmd: use DEVNULL for non PIPEs; no open-file. + TCs: some unitestize-assertions on base & remote TCs.
* FIX #526: Do not depend on test-sourcesKostis Anagnostopoulos2016-10-111-3/+8
| | | | | | + Move `HIDE_WINDOWS_KNOWN_ERRORS` flag from `git.test.lib.helper-->git.util`; regular modules in main-sources folder also depend on that flag. + Use unittest.SkipTest instead of from non-standard `nose` lib.
* src: No PyDev warningsKostis Anagnostopoulos2016-10-041-7/+7
| | | | | | | | + Mark all unused vars and other non-pep8 (PyDev) warnings + test_utils: + enable & fix forgotten IterableList looped path. + unittestize all assertions. + remote: minor fix progress dispatching unknown err-lines
* hidden win-errs: Let leaking TCs run till end, then hideKostis Anagnostopoulos2016-10-041-1/+10
| | | | | | | | | + Detect code breaking the body of TCs eventually hidden win-errors by raising SkipTest ALAP. + submodule.base.py: import classes from `git.objects` instead of `utils`. + had to ++ ulimit 100->110 for the extra code tested (more leaks :-) + Centralize is_win detection.
* RF: use @functools.wraps within decorators instead of manual __name__ ↵Yaroslav Halchenko2016-10-021-1/+3
| | | | | | reassignment @wraps does more and does it right ;)
* io, #519: ALL open() --> with open()Kostis Anagnostopoulos2016-10-011-1/+1
| | | + Some cases had restructuring of code.
* repo-TCs, #519: FIX config resource leaksKostis Anagnostopoulos2016-10-011-1/+4
| | | | | | + Modify lock/read-config-file code to ensure files closed. + Use `with GitConfigarser()` more systematically in TCs. + Clear any locks left hanging from prev Tcs. + Util: mark lock-files as SHORT_LIVED; save some SSDs...
* ci: restore ci log-level to normal, coverage on Win-AppveyorKostis Anagnostopoulos2016-10-011-24/+29
| | | | + Extract util-method to delete lock-files, also on Windows (will be needed by TCs).
* remote, #519: FIX1-of-2 double-decoding push-infosKostis Anagnostopoulos2016-09-281-0/+1
| | | | | + When `universal_lines==True` (515a6b9ccf8) must tel `handle_process_output` to stop decoding strings.
* Win, hook, #519: Consume Hook Popen-proc out of GILKostis Anagnostopoulos2016-09-281-7/+6
| | | | | | | | + HookException thrown on Popen, and were missed on Windows. + No SHELL on Popen?? + Minor fixes: + Try harder to delete trees - no remorses. + Simplify exception reprs. + Unittest-ize test_index assertions.
* Win, #519: FIX with_rw_directory() to remove read-only dirsKostis Anagnostopoulos2016-09-281-1/+1
| | | | | + Stop using gitdb's respective helper. + Fix files chmod(555) which CANNOT DELETE on Windows (but do on Linux).
* src: constify is_<platform>() callsKostis Anagnostopoulos2016-09-281-2/+2
| | | + TCs: unittest-asserts for git-tests.
* src, #519: collect all is_<platform>() callsKostis Anagnostopoulos2016-09-271-4/+4
|
* test, #519: Popen() pump: remove WaitGroupKostis Anagnostopoulos2016-09-261-33/+3
|
* fix(misc): various cleanupSebastian Thiel2016-06-131-4/+8
| | | | | | | | | Just went through all changes and adjusted them to the best of my abilities. As there are no tests to claim otherwise, I believe this is correct enough. However, it becomes evident that it's no longer possible to just make changes without backing them with a respective test.
* Make sure that stderr is converted to bytesBarry Scott2016-05-301-2/+2
| | | remove stderr for a wait() that is not the GitPython wrapper.
* Fix flake8 complaintsBarry Scott2016-05-301-2/+2
|
* Return stderr lines from a pull() call that failsBarry Scott2016-05-291-1/+9
|
* chore(remote): better super-class call syntaxSebastian Thiel2016-05-291-1/+1
| | | | | | Python :) !! Related to #451
* chore(flake8): whitespace ...Sebastian Thiel2016-05-291-1/+1
| | | | | | Related to #451 Signed-off-by: Sebastian Thiel <byronimo@gmail.com>
* Fix traceback because _seen_ops is not initialisedBarry Scott2016-05-291-2/+2
| | | | must call the base class __init__