summaryrefslogtreecommitdiff
path: root/git/test/test_repo.py
Commit message (Collapse)AuthorAgeFilesLines
* chore(flake): satisfy linterSebastian Thiel2017-02-251-2/+0
|
* check for GIT_WORK_TREETimothy B. Hartman2017-02-241-0/+29
|
* Fixes to support Python 2.6 again.Andreas Maier2016-10-241-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* fix(win_mmap): unmark hidden win_errors due to smmap unicode foesKostis Anagnostopoulos2016-10-221-2/+0
| | | | | | | Now 2 more TCs pass in Windows: + TestRepo.test_file_handle_leaks() + TestObjDbPerformance.test_random_access() See https://github.com/gitpython-developers/smmap/pull/30
* cygwin, appveyor, #533: Enable actual failures, hide certain 2+2 casesKostis Anagnostopoulos2016-10-161-0/+8
|
* cygwin, #533: FIX submodules detection (~10TCs fixed)Kostis Anagnostopoulos2016-10-161-1/+1
| | | | | | | | | | | | | + Decygpath sm's `.git` file contents. + Polish another path in `git add`; actually no main-code changes, just a replace \-->/ on a relative(!) path to make cygwin-git to work. - REGRESSION `test_git_submodules_and_add_sm_with_new_commit` asks for user/email settings. - Cygwin TCs failing: - PY2: err: 2, fail: 1 - PY3: err: 2, fail: 1
* ci, deps: no PY26, ddt>=1.1.1, CIs `pip install test-requirements`Kostis Anagnostopoulos2016-10-161-3/+0
| | | | + Use environment-markers in requirement files (see http://stackoverflow.com/a/33451105/548792).
* src: reduce needless deps to `gitdb.util`Kostis Anagnostopoulos2016-10-161-2/+1
|
* src: import os.path as ospKostis Anagnostopoulos2016-10-161-12/+12
|
* cygwin, #533: Allow '/cygdrive/c/' paths on repo initKostis Anagnostopoulos2016-10-141-1/+3
| | | | | | - Cygwin TCs failing: - PY2: err: 13, fail: 2 - PY3: err: 12, fail: 2
* daemon, #525: FIX remote urls in config-filesKostis Anagnostopoulos2016-10-121-4/+8
| | | | | | | | | | | | + Parse most remote & config-urls \-->/. + Used relative daemon-paths. + Use git-daemon PORT above 10k; on Windows all below need Admin rights. +FIXED git-daemon @with_rw_and_rw_remote_repo(): + test_base.test_with_rw_remote_and_rw_repo() PASS. + test_remote.test_base() now freezes! (so still hidden win_err) + repo_test: minor finally delete test-repos created inside this repo. + util: delete unused `absolute_project_path()`.
* remote: unfix fetch-infos paring of 8a2f7dce4(pydev fixes)Kostis Anagnostopoulos2016-10-111-1/+4
| | | + Mark another TC failing when not in master.
* FIX #526: Do not depend on test-sourcesKostis Anagnostopoulos2016-10-111-2/+2
| | | | | | + 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-1/+1
| | | | | | | | + 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-4/+4
| | | | | | | | | + 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-3/+8
| | | | | + Collect all "acknowledged" failing TCs on Appveyor and use "HIDE_WINDOWS_KNOWN_ERRORS" var to hide them.
* repo-TC: FIX HOME-expansion check, Appveyor has no HOME varKostis Anagnostopoulos2016-10-031-3/+4
|
* TC, #519: DISABLE failing testsKostis Anagnostopoulos2016-10-011-0/+2
| | | + Just to see Apveyor all green and merge; the TCs HAVE TO BE FIXED.
* io, #519: ALL open() --> with open()Kostis Anagnostopoulos2016-10-011-2/+4
| | | + Some cases had restructuring of code.
* Win, #519: FIX repo TCs.Kostis Anagnostopoulos2016-10-011-96/+117
| | | | | | | | | | | | | | | + 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.
* repo-TCs, #519: FIX config resource leaksKostis Anagnostopoulos2016-10-011-35/+45
| | | | | | + 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...
* Win, #519: FIX with_rw_directory() to remove read-only dirsKostis Anagnostopoulos2016-09-281-7/+6
| | | | | + Stop using gitdb's respective helper. + Fix files chmod(555) which CANNOT DELETE on Windows (but do on Linux).
* test, #519: FIX appveyor conda & failures in py2.6 `assertRaisesRegexp`Kostis Anagnostopoulos2016-09-261-1/+4
|
* win: GC.collect on all TC.tearDown to fix appveyor hang runsKostis Anagnostopoulos2016-09-261-0/+4
| | | | | + Fixed the hangs at `test_git:TestGit.test_handle_process_output()`. [travisci skip]
* fix(test): put `test_commits` backSebastian Thiel2016-09-251-0/+1
| | | | Thanks to @yarikoptic for catching this one !
* fix(repo): make it serializable with pickleSebastian Thiel2016-09-111-1/+5
| | | | | | | It's entirely untested if this repo still does the right thing, but I'd think it does. Fixes #504
* Merge pull request #496 from haizaar/masterSebastian Thiel2016-08-021-0/+18
|\ | | | | is_dirty supports path. Fixes #482.
| * is_dirty supports path. Fixes #482.Zaar Hai2016-08-011-0/+18
| |
* | fix flake8 problemsBarry Scott2016-08-011-3/+3
| |
* | add test to detect the corrupt logBarry Scott2016-08-011-1/+12
| | | | | | | | - add a second line to commit messages with the "BAD MESSAGE" text - read in the log and confirm that the seond line is not in the log file
* | fix(blame): lazily fetch full commit messageSebastian Thiel2016-07-171-1/+1
|/ | | | | | | | | | That way, we will not only get the summary line contained in the blame, but fetch the full message. This is more costly than the previous implementation allowed it to be, but being less surprising/correct certainly is the preferred behaviour here. Fixes #485
* 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/
* Return all available data from git-blameVincent Driessen2016-04-141-2/+9
| | | | | Returning this now to avoid having to change the function's return value structure later on if we want to emit more information.
* Add incremental blame supportVincent Driessen2016-04-131-0/+24
| | | | | | | | | | | | | | | This adds a sibling method to Repo's blame method: Repo.blame_incremental(rev, path, **kwargs) This can alternatively be called using: Repo.blame(rev, path, incremental=True) The main difference is that blame incremental is a bit more efficient and does not return the full file's contents, just the commits and the line number ranges. The parser is a bit more straight-forward and faster since the incremental output format is defined a little stricter.
* Fix testsVincent Driessen2016-04-071-3/+3
|
* ENH: skip test_is_ancestor on git versions < 1.8.0 not supporting git ↵Yaroslav Halchenko2016-02-141-0/+4
| | | | merge-base --is-ancestor
* chore(flake8): unnused importSebastian Thiel2016-02-071-1/+0
|
* fix(clone): call communicate if there is no progress handlerSebastian Thiel2016-02-071-1/+1
| | | | | | Previously, it could have happened that pipes ran full, deadlocking the operation Related to #72
* DOC: minor typosYaroslav Halchenko2016-01-081-1/+1
|
* fix(repo): fail loudly if worktrees are usedSebastian Thiel2015-08-291-1/+19
| | | | | | | | | | | | | | | As GitPython is in maintenance mode, there will be no new features. However, I believe it's good idea to explicitly state we do not support certain things if this is the case. Therefore, when worktrees are encountered, we will throw an specific exception to indicate that. The current implementation is hacky to speed up development, and increases the risk of failing due to false-positive worktree directories. Related to #344
* fix(repo): use GitCmdObjectDB by defaultSebastian Thiel2015-08-221-1/+1
| | | | | | This should fix resource leaking issues once and for all. Related #304
* Implement is_ancestorSandy Carter2015-07-211-0/+14
| | | | | Wrap `git merge-base --is-ancestor` into its own function because it acts as a boolean check unlike base `git merge-base call`
* fix(encoding): in untracked_files() and indexSebastian Thiel2015-07-201-13/+15
| | | | | | | | | | | | * untracked_files could, if there were spaces in the path returned, re-rencode the previously decoded unicode string thanks to a `decode("string_escape")` call. Now re-encode into utf-8 afterwards - added test to assure this works indeed * IndexFile.add() didn't handle unicode correctly and would write broken index files. The solution was to compute the path length after encoding it into utf-8 bytes, not before ... . Closes #320
* Bumped version to 0.3.6Sebastian Thiel2015-01-221-6/+1
| | | | | | Unfortunately, installation of a executable script has proven to be so difficult thanks setuptools gloriousness, which will force me to remove that feature
* Improved performance of rev-parse test.Sebastian Thiel2015-01-221-2/+9
| | | | | | Hoping to make this significantly faster on travis. Related to #245
* Fixed flake8 and a minor test regression.Sebastian Thiel2015-01-201-2/+2
| | | | | The latter happened as now BadName is thrown, instead of BadObject. Changes.rst was marked accordingly
* Implemented Submodule.rename()Sebastian Thiel2015-01-191-0/+2
| | | | | | A test verifies it's truly working. Related to #238
* Added 'path' keyword argument to Repo.archive().Sebastian Thiel2015-01-141-1/+1
| | | | | | | This allows sub-trees to be archived as well, and makes `.archive()` feature complete. Fixes #67
* Added `Repo.merge_base(...)` implementation, including test-case.Sebastian Thiel2015-01-131-1/+23
| | | | Fixes #169
* Added specific test for roughly checking configuration paths.Sebastian Thiel2015-01-121-0/+5
| | | | | | | For some reason, I didn't trust the existing one as it tests that code more indirectly. Related to #160