summaryrefslogtreecommitdiff
path: root/git/repo/base.py
Commit message (Collapse)AuthorAgeFilesLines
* io: Wrap (probably) allconfig_writers in `with` blocksKostis Anagnostopoulos2016-10-041-4/+2
|
* FIX regression by #519 on reading stdout/stderr of cmdsKostis Anagnostopoulos2016-10-021-2/+6
|
* Win, #519: FIX repo TCs.Kostis Anagnostopoulos2016-10-011-6/+2
| | | | | | | | | | | | | | | + 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-12/+6
| | | | | | + 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...
* 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-3/+4
|
* fix(repo): make it serializable with pickleSebastian Thiel2016-09-111-1/+0
| | | | | | | It's entirely untested if this repo still does the right thing, but I'd think it does. Fixes #504
* use $GIT_DIR when setPiotr Gaczkowski2016-08-171-1/+1
|
* Merge pull request #496 from haizaar/masterSebastian Thiel2016-08-021-4/+7
|\ | | | | is_dirty supports path. Fixes #482.
| * is_dirty supports path. Fixes #482.Zaar Hai2016-08-011-4/+7
| |
* | fix(blame): lazily fetch full commit messageSebastian Thiel2016-07-171-4/+2
|/ | | | | | | | | | 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
* fix(repo): prevent error messages from being swallowedSebastian Thiel2016-06-131-1/+2
| | | | | | | This issue must have rosen from `to_progress_instance()` being inserted in a spot where `None` was a legit value. Fixes #462
* chore(misc): cleanup and docsSebastian Thiel2016-05-291-2/+2
| | | | | | Minor adjustments to PR to match current code style. Related to #450
* The progress arg to push, pull, fetch and clone is now a python callable.Barry Scott2016-05-281-1/+4
| | | | | | | | | | | | | 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.
* Ignore trailing last empty string in .split() outputVincent Driessen2016-05-241-4/+1
|
* Check if byte string is empty for py3 compatibilityJonathan Chu2016-05-241-1/+1
|
* Split lines by new line charactersJonathan Chu2016-05-241-2/+4
| | | | | | Opt to split lines by the new line character instead of letting `splitlines()` do this. This helps catch the issue when there are special characters in the line, particular the commit summary section.
* Use correct mode for executable filesSebastian Thiel2016-05-191-1/+1
| | | | Fixes #430
* Clarify costs of certain propertiesSebastian Thiel2016-05-191-2/+7
| | | | Fixes #428
* Return all available data from git-blameVincent Driessen2016-04-141-6/+16
| | | | | Returning this now to avoid having to change the function's return value structure later on if we want to emit more information.
* Drop dependency on sixVincent Driessen2016-04-141-1/+1
|
* Allow passing args to git-blameVincent Driessen2016-04-131-3/+3
| | | | This can be used to pass options like -C or -M.
* Add incremental blame supportVincent Driessen2016-04-131-2/+64
| | | | | | | | | | | | | | | 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.
* enable config parsers to be used as context managersRaphael Boidol2016-02-201-1/+1
| | | | if used as context managers, the parsers will automatically release their file locks.
* fix(cmd): allow improved errors during clone operationSebastian Thiel2016-02-141-2/+2
| | | | Related to #383
* fix(clone): call communicate if there is no progress handlerSebastian Thiel2016-02-071-0/+1
| | | | | | Previously, it could have happened that pipes ran full, deadlocking the operation Related to #72
* fix(repo): use GitCmdObjectDB by defaultSebastian Thiel2015-08-221-5/+2
| | | | | | This should fix resource leaking issues once and for all. Related #304
* Implement is_ancestorSandy Carter2015-07-211-0/+15
| | | | | Wrap `git merge-base --is-ancestor` into its own function because it acts as a boolean check unlike base `git merge-base call`
* fix(flake8): remove unused importSebastian Thiel2015-07-201-1/+0
| | | | | | I knew that flake would eventually get me, especially when least suspected. This time it's even useful, as it is a non-whitespace related issue.
* fix(encoding): in `untracked_files()`Sebastian Thiel2015-07-201-2/+9
| | | | | | | I have no idea why PY3 requires such a mess of encoding/decoding statements, but let's just be happy it works. Also let's be sure I never ever write python code again ... EVER.
* fix(encoding): in untracked_files() and indexSebastian Thiel2015-07-201-1/+1
| | | | | | | | | | | | * 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
* Correct doc errorsMarian Wieczorek2015-07-161-1/+1
| | | | | | | | | revA..revB &rarr; revA...revB (three instead of two dots) [base.py, line 467](https://github.com/gitpython-developers/GitPython/blob/master/git/repo/base.py#L467) rorepo is a ~~a~~ Repo instance [test_docs.py, line 21](https://github.com/gitpython-developers/GitPython/blob/master/git/test/test_docs.py#L21) closes #314
* Add env parameter to Repo.clone_from() for setting environment variablesJon Lund Steffensen2015-06-301-2/+6
| | | | | | | Adds the optional keyword parameter env to Repo.clone_from(). The parameter is a dictionary containing the desired environment variables for the git clone invocation. The environment is applied to the temporary Git instance before calling Repo._clone().
* Fix docstring of Repo.clone_from()Jon Lund Steffensen2015-06-291-0/+1
|
* Merge pull request #291 from hvnsweeting/support-init-choosing-backendSebastian Thiel2015-06-101-2/+7
|\ | | | | support passing odbt for using with Repo
| * add docstring for new argHung Nguyen Viet2015-06-011-0/+5
| |
| * support passing odbt for using with RepoHung Nguyen Viet2015-06-011-2/+2
| |
* | refactor(repo): parameter renaming and cleanupSebastian Thiel2015-06-101-6/+3
| | | | | | | | | | | | | | | | | | | | * renamed `consider_submodules` to `submodules` to be in line with the existing parameters. Nowadays I would prefer the `consider_` prefix, but can't change the existing API and thus stick to the current naming scheme. * reduced amount of code in one portion to make it more maintainable. Related to #294
* | Allow submodules to be ignored in is_dirtyjavex2015-06-051-4/+14
|/ | | | | | There are cases when might not consider a directory dirty when a submodule has changes. Particular case was git-up stashing changes where submodules are irrelevant.
* Added previously missing parameter documentation for Repo.__init__ .Sebastian Thiel2015-02-091-0/+5
| | | | Related to #255
* Added test for `sshkey` context manager.Sebastian Thiel2015-01-221-2/+1
| | | | | | | | It verifies that the script is actually called. Interestingly, the shell script version works within an msysgit environment on windows. Fixes #234
* Overhauled all tutorials, and placed them in a unit-test.Sebastian Thiel2015-01-221-7/+13
| | | | | | That way they are protected from regression. Fixes #239
* Added advance usage examples to tutorial and made minor fixes.Sebastian Thiel2015-01-211-4/+2
| | | | | | GIT_PYTHON_TRACE would actually fail (now) if we debugged archive operations. Related to #239
* Improved installation docs to mention `pip`, not `easy_install`Sebastian Thiel2015-01-191-2/+3
| | | | | Fixes #235 [ci skip]
* Implemented Submodule.rename()Sebastian Thiel2015-01-191-0/+9
| | | | | | A test verifies it's truly working. Related to #238
* Submodule.remove() now seems to work properly, nearly all tests are back.Sebastian Thiel2015-01-171-2/+2
| | | | | | This also means that now we seem to be able to properly handle .git files in submodules Related to #233
* Submodule.remove() now deals with .git files correctly.Sebastian Thiel2015-01-171-2/+6
| | | | A simple test verifies this at least.
* Fixed some doc strings to build correctly with sphinxSebastian Thiel2015-01-141-14/+12
| | | | | | Fixes #7 [ci skip]
* Added 'path' keyword argument to Repo.archive().Sebastian Thiel2015-01-141-2/+9
| | | | | | | This allows sub-trees to be archived as well, and makes `.archive()` feature complete. Fixes #67
* GitConfigParser now respects and merges 'include' sectionsSebastian Thiel2015-01-141-2/+2
| | | | | | | | | | | | | We implement it as described in this article: http://stackoverflow.com/questions/1557183/is-it-possible-to-include-a-file-in-your-gitconfig Thus we handle * cycles * relative and absolute include paths * write-backs in case of writable GitConfigParser instances Fixes #201