@@ -210,33 +210,34 @@ class RemoteProgress(object):
210
210
DONE_TOKEN = 'done.'
211
211
TOKEN_SEPARATOR = ', '
212
212
213
- __slots__ = ("_cur_line" , "_seen_ops" , "_error_lines" )
213
+ __slots__ = ('_cur_line' ,
214
+ '_seen_ops' ,
215
+ 'error_lines' , # Lines that started with 'error:' or 'fatal:'.
216
+ 'other_lines' ) # Lines not denoting progress (i.e.g. push-infos).
214
217
re_op_absolute = re .compile (r"(remote: )?([\w\s]+):\s+()(\d+)()(.*)" )
215
218
re_op_relative = re .compile (r"(remote: )?([\w\s]+):\s+(\d+)% \((\d+)/(\d+)\)(.*)" )
216
219
217
220
def __init__ (self ):
218
221
self ._seen_ops = list ()
219
222
self ._cur_line = None
220
- self ._error_lines = []
221
-
222
- def error_lines (self ):
223
- """Returns all lines that started with error: or fatal:"""
224
- return self ._error_lines
223
+ self .error_lines = []
224
+ self .other_lines = []
225
225
226
226
def _parse_progress_line (self , line ):
227
227
"""Parse progress information from the given line as retrieved by git-push
228
228
or git-fetch.
229
229
230
- Lines that seem to contain an error (i.e. start with error: or fatal:) are stored
231
- separately and can be queried using `error_lines()`.
230
+ - Lines that do not contain progress info are stored in :attr:`other_lines`.
231
+ - Lines that seem to contain an error (i.e. start with error: or fatal:) are stored
232
+ in :attr:`error_lines`.
232
233
233
234
:return: list(line, ...) list of lines that could not be processed"""
234
235
# handle
235
236
# Counting objects: 4, done.
236
237
# Compressing objects: 50% (1/2) \rCompressing objects: 100% (2/2) \rCompressing objects: 100% (2/2), done.
237
238
self ._cur_line = line
238
- if len (self ._error_lines ) > 0 or self ._cur_line .startswith (('error:' , 'fatal:' )):
239
- self ._error_lines .append (self ._cur_line )
239
+ if len (self .error_lines ) > 0 or self ._cur_line .startswith (('error:' , 'fatal:' )):
240
+ self .error_lines .append (self ._cur_line )
240
241
return []
241
242
242
243
sub_lines = line .split ('\r ' )
@@ -295,6 +296,7 @@ def _parse_progress_line(self, line):
295
296
self .line_dropped (sline )
296
297
# Note: Don't add this line to the failed lines, as we have to silently
297
298
# drop it
299
+ self .other_lines .extend (failed_lines )
298
300
return failed_lines
299
301
# END handle op code
300
302
@@ -320,6 +322,7 @@ def _parse_progress_line(self, line):
320
322
max_count and float (max_count ),
321
323
message )
322
324
# END for each sub line
325
+ self .other_lines .extend (failed_lines )
323
326
return failed_lines
324
327
325
328
def new_message_handler (self ):
0 commit comments