@@ -141,14 +141,17 @@ def get_push_info(repo, remotename_or_url, proc, progress):
141141 finalize_process (proc )
142142 return output
143143
144- def add_progress (kwargs , git ):
144+ def add_progress (kwargs , git , progress ):
145145 """Add the --progress flag to the given kwargs dict if supported by the
146- git command
146+ git command. If the actual progress in the given progress instance is not
147+ given, we do not request any progress
147148 :return: possibly altered kwargs"""
148- v = git .version_info
149- if v [0 ] > 1 or v [1 ] > 7 or v [2 ] > 0 or v [3 ] > 3 :
150- kwargs ['progress' ] = True
151- #END handle --progress
149+ if progress ._progress is not None :
150+ v = git .version_info
151+ if v [0 ] > 1 or v [1 ] > 7 or v [2 ] > 0 or v [3 ] > 3 :
152+ kwargs ['progress' ] = True
153+ #END handle --progress
154+ #END handle progress
152155 return kwargs
153156
154157#} END utilities
@@ -218,6 +221,10 @@ def _parse_progress_line(self, line):
218221 op_code |= self .COMPRESSING
219222 elif op_name == "Writing objects" :
220223 op_code |= self .WRITING
224+ elif op_name == "Receiving objects" :
225+ op_code |= self .RECEIVING
226+ elif op_name == "Resolving deltas" :
227+ op_code |= self .RESOLVING
221228 else :
222229 raise ValueError ("Operation name %r unknown" % op_name )
223230
@@ -527,8 +534,9 @@ def push(self, url, refspecs=None, progress=None, **kwargs):
527534 :param refspecs: single string, RefSpec instance or list of such or None.
528535 :param progress: RemoteProgress derived instance or None
529536 :param **kwargs: Additional arguments to be passed to the git-push process"""
530- proc = self ._git .push (url , refspecs , porcelain = True , as_process = True , ** add_progress (kwargs , self .git ))
531- return get_push_info (self , url , proc , CmdRemoteProgress (progress ))
537+ progress = CmdRemoteProgress (progress )
538+ proc = self ._git .push (url , refspecs , porcelain = True , as_process = True , ** add_progress (kwargs , self .git , progress ))
539+ return get_push_info (self , url , proc , progress )
532540
533541 def pull (self , url , refspecs = None , progress = None , ** kwargs ):
534542 """Fetch and merge the given refspecs.
@@ -537,16 +545,18 @@ def pull(self, url, refspecs=None, progress=None, **kwargs):
537545 :param url: may be a remote name or a url
538546 :param refspecs: see push()
539547 :param progress: see push()"""
540- proc = self ._git .pull (url , refspecs , with_extended_output = True , as_process = True , v = True , ** add_progress (kwargs , self .git ))
541- return get_fetch_info_from_stderr (self , proc , CmdRemoteProgress (progress ))
548+ progress = CmdRemoteProgress (progress )
549+ proc = self ._git .pull (url , refspecs , with_extended_output = True , as_process = True , v = True , ** add_progress (kwargs , self .git , progress ))
550+ return get_fetch_info_from_stderr (self , proc , progress )
542551
543552 def fetch (self , url , refspecs = None , progress = None , ** kwargs ):
544553 """Fetch the latest changes
545554 :param url: may be a remote name or a url
546555 :param refspecs: see push()
547556 :param progress: see push()"""
548- proc = self ._git .fetch (url , refspecs , with_extended_output = True , as_process = True , v = True , ** add_progress (kwargs , self .git ))
549- return get_fetch_info_from_stderr (self , proc , CmdRemoteProgress (progress ))
557+ progress = CmdRemoteProgress (progress )
558+ proc = self ._git .fetch (url , refspecs , with_extended_output = True , as_process = True , v = True , ** add_progress (kwargs , self .git , progress ))
559+ return get_fetch_info_from_stderr (self , proc , progress )
550560
551561 #} end transport db interface
552562
@@ -750,7 +760,7 @@ def _clone(cls, git, url, path, progress, **kwargs):
750760 # END windows handling
751761
752762 try :
753- proc = git .clone (url , path , with_extended_output = True , as_process = True , v = True , ** add_progress (kwargs , git ))
763+ proc = git .clone (url , path , with_extended_output = True , as_process = True , v = True , ** add_progress (kwargs , git , progress ))
754764 if progress is not None :
755765 digest_process_messages (proc .stderr , progress )
756766 #END digest progress messages
0 commit comments