Skip to content
Snippets Groups Projects
Commit 9a6683d0 authored by Kevin Bullock's avatar Kevin Bullock
Browse files

progress: update GitProgress to use makeprogress()

parent 1013d58d
No related branches found
No related tags found
No related merge requests found
......@@ -69,7 +69,7 @@
def __init__(self, ui):
self.ui = ui
self.lasttopic = None
self._progress = None
self.msgbuf = ''
def progress(self, msg):
......@@ -88,5 +88,5 @@
m = RE_GIT_PROGRESS.search(data)
if m:
if self.lasttopic and self.lasttopic != topic:
if self._progress and self._progress.topic != topic:
self.flush()
......@@ -92,4 +92,5 @@
self.flush()
self.lasttopic = topic
if not self._progress:
self._progress = compat.makeprogress(self.ui, topic)
pos, total = map(int, m.group(1, 2))
......@@ -94,7 +95,7 @@
pos, total = map(int, m.group(1, 2))
self.ui.progress(topic, pos, total=total)
self._progress.update(pos, total=total)
else:
self.flush(msg)
def flush(self, msg=None):
......@@ -97,10 +98,11 @@
else:
self.flush(msg)
def flush(self, msg=None):
if self.lasttopic:
self.ui.progress(self.lasttopic, None)
self.lasttopic = None
if self._progress is None:
return
self._progress.complete()
self._progress = None
if msg:
self.ui.note(msg + '\n')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment