diff options
author | Barry Scott <barry@barrys-emacs.org> | 2016-05-28 12:05:23 +0100 |
---|---|---|
committer | Barry Scott <barry@barrys-emacs.org> | 2016-05-28 12:05:23 +0100 |
commit | b4492c7965cd8e3c5faaf28b2a6414b04984720b (patch) | |
tree | 201c035534ac5809a3ef2436bdf7826775d195b5 /git/repo/base.py | |
parent | bed46300fe5dcb376d43da56bbcd448d73bb2ea0 (diff) | |
download | gitpython-b4492c7965cd8e3c5faaf28b2a6414b04984720b.tar.gz |
The progress arg to push, pull, fetch and clone is now a python callable.
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.
Diffstat (limited to 'git/repo/base.py')
-rw-r--r-- | git/repo/base.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/git/repo/base.py b/git/repo/base.py index bc5a7c35..9ba2b1d2 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -32,7 +32,8 @@ from git.index import IndexFile from git.config import GitConfigParser from git.remote import ( Remote, - add_progress + add_progress, + progress_object ) from git.db import GitCmdObjectDB @@ -872,6 +873,8 @@ class Repo(object): @classmethod def _clone(cls, git, url, path, odb_default_type, progress, **kwargs): + progress = progress_object(progress) + # special handling for windows for path at which the clone should be # created. # tilde '~' will be expanded to the HOME no matter where the ~ occours. Hence |