aboutsummaryrefslogtreecommitdiff
path: root/git/util.py
AgeCommit message (Collapse)Author
2017-03-09Spelling fixesVille Skyttä
2016-12-08Merge pull request #541 from andy-maier/py26_fixesSebastian Thiel
Fixes to support Python 2.6 again.
2016-12-08Merge pull request #554 from nvie/masterVincent Driessen
Don't change the meaning of string literals
2016-12-08chore(lint): flake8Sebastian Thiel
Interestingly only shows in particular python versions on travis. Maybe some caching effect? Locally it is reproducible easily, with the latest flake8
2016-12-07Don't change the meaning of string literalsVincent Driessen
2016-10-24Fixes to support Python 2.6 again.Andreas Maier
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).
2016-10-22Merge branch 'cygwin' of https://github.com/ankostis/GitPython into ↵Sebastian Thiel
ankostis-cygwin
2016-10-20Fix some typosSantiago Castro
2016-10-16ci, deps: no PY26, ddt>=1.1.1, CIs `pip install test-requirements`Kostis Anagnostopoulos
+ Use environment-markers in requirement files (see http://stackoverflow.com/a/33451105/548792).
2016-10-16src: reduce needless deps to `gitdb.util`Kostis Anagnostopoulos
2016-10-16src: import os.path as ospKostis Anagnostopoulos
2016-10-16cygwin, #533: polish abs-paths in `git add` commandsKostis Anagnostopoulos
+ 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
2016-10-14cygwin, #533: Allow '/cygdrive/c/' paths on repo initKostis Anagnostopoulos
- Cygwin TCs failing: - PY2: err: 13, fail: 2 - PY3: err: 12, fail: 2
2016-10-14cygwin, #533: Try to make it work with Cygwin's Git.Kostis Anagnostopoulos
+ 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
2016-10-14remote, #525: FIX BUG push-cmd misses error messagesKostis Anagnostopoulos
+ Bug discovered after enabling TC in prev commit and rework of fetch. + remote_tc: unitestize assertions. + util: DEL unused `_mktemp()`.
2016-10-13remote, #525: pump fetch-infos instead of GIL-read stderrKostis Anagnostopoulos
+ `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).
2016-10-13test, #525: allow disabling freeze errors separatelyKostis Anagnostopoulos
+ cmd: use DEVNULL for non PIPEs; no open-file. + TCs: some unitestize-assertions on base & remote TCs.
2016-10-11FIX #526: Do not depend on test-sourcesKostis Anagnostopoulos
+ 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.
2016-10-04src: No PyDev warningsKostis Anagnostopoulos
+ 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
2016-10-04hidden win-errs: Let leaking TCs run till end, then hideKostis Anagnostopoulos
+ 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.
2016-10-02RF: use @functools.wraps within decorators instead of manual __name__ ↵Yaroslav Halchenko
reassignment @wraps does more and does it right ;)
2016-10-01io, #519: ALL open() --> with open()Kostis Anagnostopoulos
+ Some cases had restructuring of code.
2016-10-01repo-TCs, #519: FIX config resource leaksKostis Anagnostopoulos
+ 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...
2016-10-01ci: restore ci log-level to normal, coverage on Win-AppveyorKostis Anagnostopoulos
+ Extract util-method to delete lock-files, also on Windows (will be needed by TCs).
2016-09-28remote, #519: FIX1-of-2 double-decoding push-infosKostis Anagnostopoulos
+ When `universal_lines==True` (515a6b9ccf8) must tel `handle_process_output` to stop decoding strings.
2016-09-28Win, hook, #519: Consume Hook Popen-proc out of GILKostis Anagnostopoulos
+ 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.
2016-09-28Win, #519: FIX with_rw_directory() to remove read-only dirsKostis Anagnostopoulos
+ Stop using gitdb's respective helper. + Fix files chmod(555) which CANNOT DELETE on Windows (but do on Linux).
2016-09-28src: constify is_<platform>() callsKostis Anagnostopoulos
+ TCs: unittest-asserts for git-tests.
2016-09-27src, #519: collect all is_<platform>() callsKostis Anagnostopoulos
2016-09-26test, #519: Popen() pump: remove WaitGroupKostis Anagnostopoulos
2016-06-13fix(misc): various cleanupSebastian Thiel
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.
2016-05-30Make sure that stderr is converted to bytesBarry Scott
remove stderr for a wait() that is not the GitPython wrapper.
2016-05-30Fix flake8 complaintsBarry Scott
2016-05-29Return stderr lines from a pull() call that failsBarry Scott
2016-05-29chore(remote): better super-class call syntaxSebastian Thiel
Python :) !! Related to #451
2016-05-29chore(flake8): whitespace ...Sebastian Thiel
Related to #451 Signed-off-by: Sebastian Thiel <byronimo@gmail.com>
2016-05-29Fix traceback because _seen_ops is not initialisedBarry Scott
must call the base class __init__
2016-05-29fix(remote): Add CallableRemoteProgressSebastian Thiel
That way, the base type doesn't need any adjustment. Related to #450
2016-05-29chore(misc): cleanup and docsSebastian Thiel
Minor adjustments to PR to match current code style. Related to #450
2016-05-28The progress arg to push, pull, fetch and clone is now a python callable.Barry Scott
This simplifies the API and removes the parser, RemoteProgres, from the API as RemoteProgress is an internal detail of the implementation. progress is accepted as: * None - drop progress messages * callable (function etc) - call the function with the same args as update * object - assume its RemoteProgress derived as use as before RemoteProgress takes an optional progress_function argument. It will call the progress function if not None otherwise call self.update as it used to.
2016-05-25fix(RemoteProgress): improve message sanitizationSebastian Thiel
Don't allow `, ` prefixes or suffixes in messages. Fixes #438
2016-02-14fix(cmd): allow improved errors during clone operationSebastian Thiel
Related to #383
2015-12-02Forgot to update _num_op_codesThibault Clerice
2015-12-02Added CHECKING_OUT as a logged operationThibault Clerice
Closes #330
2015-07-28don't 'log' to stderr in `RemoteProgress`Sebastian Thiel
There is simply no excuse to doing that. Closes #330
2015-06-26fix(logging): monkeypatch logging with NullHandlerSebastian Thiel
This will make usage of the `NullHandler` possible in python 2.6 and below.
2015-04-16fix(indent): flake-8 happynessSebastian Thiel
2015-04-15fix(util): Correct number of op codesMatt Jordan
The previous patch failed to update the expected number of op_codes, which would result in an exception when creating an instance of RemoteProgress. This patch corrects the value to the new expected number of op_codes (8)
2015-04-15fix(util): Handle 'Finding sources' messages in RemoteProgressMatt Jordan
When running a long running operation (such as a clone on a large repo), Git may return a message indicating that it is 'Finding sources'. Since there is no bit field value for this message, this causes a large amount of error messages to be emitted to stderr. This patch fixes this by adding another bit field value for this message, FINDING_SOURCES. Derived classes can look for this op_code and handle it appropriately.
2015-04-08fix(remote): allow to raise during push/fetchSebastian Thiel
Do not swallow non-zero exit status during push and fetch unless we managed to parse head information. This behaviour will effetively handle cases were no work was done due to invalid refspecs or insufficient permissions. Fixes #271