@@ -199,33 +199,34 @@ class RemoteProgress(object):
199
199
DONE_TOKEN = 'done.'
200
200
TOKEN_SEPARATOR = ', '
201
201
202
- __slots__ = ("_cur_line" , "_seen_ops" , "_error_lines" )
202
+ __slots__ = ('_cur_line' ,
203
+ '_seen_ops' ,
204
+ 'error_lines' , # Lines that started with 'error:' or 'fatal:'.
205
+ 'other_lines' ) # Lines not denoting progress (i.e.g. push-infos).
203
206
re_op_absolute = re .compile (r"(remote: )?([\w\s]+):\s+()(\d+)()(.*)" )
204
207
re_op_relative = re .compile (r"(remote: )?([\w\s]+):\s+(\d+)% \((\d+)/(\d+)\)(.*)" )
205
208
206
209
def __init__ (self ):
207
210
self ._seen_ops = list ()
208
211
self ._cur_line = None
209
- self ._error_lines = []
210
-
211
- def error_lines (self ):
212
- """Returns all lines that started with error: or fatal:"""
213
- return self ._error_lines
212
+ self .error_lines = []
213
+ self .other_lines = []
214
214
215
215
def _parse_progress_line (self , line ):
216
216
"""Parse progress information from the given line as retrieved by git-push
217
217
or git-fetch.
218
218
219
- Lines that seem to contain an error (i.e. start with error: or fatal:) are stored
220
- separately and can be queried using `error_lines()`.
219
+ - Lines that do not contain progress info are stored in :attr:`other_lines`.
220
+ - Lines that seem to contain an error (i.e. start with error: or fatal:) are stored
221
+ in :attr:`error_lines`.
221
222
222
223
:return: list(line, ...) list of lines that could not be processed"""
223
224
# handle
224
225
# Counting objects: 4, done.
225
226
# Compressing objects: 50% (1/2) \rCompressing objects: 100% (2/2) \rCompressing objects: 100% (2/2), done.
226
227
self ._cur_line = line
227
- if len (self ._error_lines ) > 0 or self ._cur_line .startswith (('error:' , 'fatal:' )):
228
- self ._error_lines .append (self ._cur_line )
228
+ if len (self .error_lines ) > 0 or self ._cur_line .startswith (('error:' , 'fatal:' )):
229
+ self .error_lines .append (self ._cur_line )
229
230
return []
230
231
231
232
sub_lines = line .split ('\r ' )
@@ -284,6 +285,7 @@ def _parse_progress_line(self, line):
284
285
self .line_dropped (sline )
285
286
# Note: Don't add this line to the failed lines, as we have to silently
286
287
# drop it
288
+ self .other_lines .extend (failed_lines )
287
289
return failed_lines
288
290
# END handle op code
289
291
@@ -309,6 +311,7 @@ def _parse_progress_line(self, line):
309
311
max_count and float (max_count ),
310
312
message )
311
313
# END for each sub line
314
+ self .other_lines .extend (failed_lines )
312
315
return failed_lines
313
316
314
317
def new_message_handler (self ):
0 commit comments