From b4492c7965cd8e3c5faaf28b2a6414b04984720b Mon Sep 17 00:00:00 2001 From: Barry Scott Date: Sat, 28 May 2016 12:05:23 +0100 Subject: 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. --- git/repo/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'git/repo/base.py') 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 -- cgit v1.2.1