summaryrefslogtreecommitdiff
path: root/git/test/test_index.py
Commit message (Collapse)AuthorAgeFilesLines
* Python 3.6 invalid escape sequence deprecation fixesVille Skyttä2017-04-091-1/+1
| | | | https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior
* Fixes to support Python 2.6 again.Andreas Maier2016-10-241-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* cygwin, appveyor, #533: Enable actual failures, hide certain 2+2 casesKostis Anagnostopoulos2016-10-161-2/+9
|
* src: reduce needless deps to `gitdb.util`Kostis Anagnostopoulos2016-10-161-2/+1
|
* src: import os.path as ospKostis Anagnostopoulos2016-10-161-24/+26
|
* FIX #526: Do not depend on test-sourcesKostis Anagnostopoulos2016-10-111-1/+1
| | | | | | + 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.
* io: Wrap (probably) allconfig_writers in `with` blocksKostis Anagnostopoulos2016-10-041-4/+3
|
* src: No PyDev warningsKostis Anagnostopoulos2016-10-041-2/+2
| | | | | | | | + 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/+1
| | | | | | | | | + 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.
* Appveyor: Add and set HIDE_WINDOWS_KNOWN_ERRORS=Falsewinerr_showKostis Anagnostopoulos2016-10-031-22/+28
| | | | | + Collect all "acknowledged" failing TCs on Appveyor and use "HIDE_WINDOWS_KNOWN_ERRORS" var to hide them.
* Win, #519: FIX repo TCs.Kostis Anagnostopoulos2016-10-011-18/+17
| | | | | | | | | | | | | | | + FIX TestRepo.test_submodule_update(): + submod: del `.git` file prior overwrite; Windows denied otherwise! + FIX TestRepo.test_untracked_files(): + In the `git add <file>` case, it failed with unicode args on PY2. Had to encode them with `locale.getpreferredencoding()` AND use SHELL. + cmd: add `shell` into `execute()` kwds, for overriding USE_SHELL per command. + repo: replace blocky `communicate()` in `_clone()` with thread-pumps. + test_repo.py: unittestize (almost all) assertions. + Replace open --> with open for index (base and TC). + test_index.py: Enabled a dormant assertion.
* FIX tox/requirementsKostis Anagnostopoulos2016-09-291-3/+3
|
* Proc, #519: Rework error-exc msgs & log thread-pumps errorsKostis Anagnostopoulos2016-09-281-1/+1
| | | | | + No WindowsError exception. + Add `test_exc.py` for unicode issues. + Single-arg for decoding-streams in pump-func.
* Win, hook, #519: Consume Hook Popen-proc out of GILKostis Anagnostopoulos2016-09-281-71/+85
| | | | | | | | + 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-5/+4
| | | | | + 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-3/+3
| | | + TCs: unittest-asserts for git-tests.
* src, #519: collect all is_<platform>() callsKostis Anagnostopoulos2016-09-271-4/+4
|
* test, #519: FIX appveyor conda & failures in py2.6 `assertRaisesRegexp`Kostis Anagnostopoulos2016-09-261-3/+7
|
* fix(test): deal with py2 and py3Sebastian Thiel2016-09-251-1/+3
| | | | | | It ain't pretty, but should do the job. Related to #514
* fix(index): improve LockedFD handlingSebastian Thiel2016-09-251-0/+17
| | | | | | | | | | Relying on the destructor will not work, even though the code used to rely on it. Now we handle failures more explicitly. Far from perfect, but a good start for a fix. Fixes #514
* Need spaces in Emacs style encoding commentSteven Colby2016-05-181-1/+1
| | | | | Although it's hard to see, PEP-0263 does have ws delimiting the 'coding' string. This commit will fix the root cause of (at least) one bug: https://lists.fedoraproject.org/archives/list/eclipse-sig@lists.fedoraproject.org/thread/5XQ5JRHG6DPPMGRDU7TA2AO4EYS2H7AG/
* fixed unittest of issue #407 for Python3Piotr Pietraszkiewicz2016-04-131-1/+1
|
* fix(index): avoid recursing endlessly in add()Piotr Pietraszkiewicz2016-04-131-0/+11
| | | | Issue #407
* fix(compat): make test work with git >= 2.5Sebastian Thiel2015-08-291-0/+3
|
* fix(test_index): fix encodingSebastian Thiel2015-08-171-2/+2
| | | | | | | | | | I really never want to touch python again, and never deal with py2/3 unicode handling anymore. By now, it seems pretty much anything is better. Is python to be blamed for it entirely ? Probably not, but there are better alternatives. Nim ? Rust ? Ruby ? Totally
* fix(index):allow adding non-unicode paths to indexSebastian Thiel2015-07-291-0/+13
| | | | | | | | | This issue only surfaced in python 2, in case paths containing unicode characters were not actual unicode objects. In python 3, this was never the issue. Closes #331
* added tests for commits with datesavi2015-07-171-0/+11
|
* fix(index): handle adding symlinks to dirsSebastian Thiel2015-06-261-12/+16
| | | | | | | | | | When expanding directories, check if it is a symlink and don't expand them at all. Previously, we followed symlinks and expanded their contents, which could lead to weird index files. Fixes #302
* fix(index): don't write extension data by defaultSebastian Thiel2015-04-081-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | It turned out that the index is not actually corrupted, which is good news. What happens is that `git` writes `TREE` extension data into the index, which causes it to write out the given tree *as is* next time a `git commit` is executed. When using `git add`, this extension data is maintained automatically. However, GitPython doesn't do that ... . Usually this is no problem at all, as you are supposed to use `IndexFile.commit(...)` along with `IndexFile.add(...)`. Thanks to a shortcoming in the GitPython API, the index was automatically written out whenever files have been added, without providing control over whether or not *extension data* will be written along with it. My fix consists of an additional flag in `IndexFile.add(...)`, which causes extension data not to be written by default, so commits can be safely done via `git commit` or `IndexFile.commit(...)`. However, this might introduce new subtle bugs in case someone is relying on extension data to be written. As this can be controlled through the said flag though, a fix is easily done in that case. Fixes #265
* test(index): test for #265Sebastian Thiel2015-04-071-0/+15
| | | | | However, it doesn't reproduce on the latest version of GitPython. Maybe it's on an older one.
* Fixed regression in test-suite for IndexFileSebastian Thiel2015-01-211-4/+8
| | | | | Previously, it checked for AssertionErrors, now we have to implement need-unbare-repo check ourselves.
* Improved unicode handling when using os.environ or GitConfigParserSebastian Thiel2015-01-191-1/+2
| | | | | | | Assured unicode values are supported when reading the configuration, and when getting author/committer information from the environment. Fixes #237
* IndexFile.commit() now runs pre-commit and post-commit hooks.Sebastian Thiel2015-01-121-0/+21
| | | | | | | | | However, it does so only on posix. The test-case will run on posix only as well. Please note that in theory, even on windows we will attempt to run hooks, even though I am not sure that this will actually work. Fixes #81
* Removed os.path.realpath invocations as they are not necessary if paths are ↵Sebastian Thiel2015-01-121-1/+1
| | | | | | | | used consistently. This will save IOPs, and make the code easier to understand (I suppose). Related to #224
* Made sure commits accept unicode or unicode charactersSebastian Thiel2015-01-071-6/+8
|
* fix pep8firm12015-01-071-2/+3
|
* add tests for commit by actorfirm12015-01-071-0/+16
|
* test_repo worksSebastian Thiel2015-01-061-0/+1
|
* test_index worksSebastian Thiel2015-01-061-18/+19
|
* Fixed io types to make tests work on PY2 once again.py3Sebastian Thiel2015-01-051-3/+3
| | | | Now it's about going through PY3 issues
* Dum brute force conversion of all types.Sebastian Thiel2015-01-041-1/+2
| | | | | | However, StringIO really is ByteIO in most cases, and py2.7 should run but doesn't. This should be made work first.
* initial set of adjustments to make (most) imports work.Sebastian Thiel2015-01-041-1/+1
| | | | More to come, especially when it's about strings
* Replaced ordered dict with standard version; used logging moduleSebastian Thiel2015-01-041-1/+0
| | | | All performance tests still print to stderr, but do so in a py3 compatible way
* Removed 'from X import *' whereever possibleSebastian Thiel2015-01-041-2/+17
|
* Bumped version, updated changelog, reduced code smellSebastian Thiel2015-01-041-19/+18
| | | | | There is more work to do though, as many imports are still incorrect. Also, there are still print statements
* Applied autopep8Sebastian Thiel2015-01-041-1/+1
| | | | autopep8 -v -j 8 --max-line-length 120 --in-place --recursive
* Fixed all remaining non-performance testsSebastian Thiel2015-01-031-2/+8
| | | | | | | * travis configuration adjusted to hopefully work better than before Performance traversal still fails when using git-python as standard repository. It naturally wants a larger one. On travis these tests are skipped though.
* Applied autopep8Sebastian Thiel2014-11-191-8/+11
| | | | | Commandline was autopep8 -j 8 --max-line-length 120 --in-place --recursive --exclude "*gitdb*,*async*" git/
* Allow Index.add() on bare repositoriesSebastian Thiel2014-11-171-0/+34
|
* pep8 linting (trailing whitespace)Antoine Musso2014-11-161-26/+26
| | | | W291 trailing whitespace