mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
pull: report progress to ui.progress so progress bars can appear
This commit is contained in:
parent
13566db0d1
commit
cd6997844e
@ -256,6 +256,11 @@ def pull(repo, source, heads=[], force=False):
|
||||
'remains unimplemented.')
|
||||
|
||||
oldrevisions = len(meta.revmap)
|
||||
cnt = 0
|
||||
if stopat_rev:
|
||||
total = stopat_rev - start
|
||||
else:
|
||||
total = svn.HEAD - start
|
||||
try:
|
||||
try:
|
||||
# start converting revisions
|
||||
@ -277,6 +282,8 @@ def pull(repo, source, heads=[], force=False):
|
||||
msg = [s.strip() for s in msg.splitlines() if s][0]
|
||||
w = hgutil.termwidth()
|
||||
bits = (r.revnum, r.author, msg)
|
||||
cnt += 1
|
||||
ui.progress('pull', cnt, total=total)
|
||||
ui.status(('[r%d] %s: %s\n' % bits)[:w])
|
||||
|
||||
meta.save_tbdelta(tbdelta)
|
||||
@ -305,6 +312,7 @@ def pull(repo, source, heads=[], force=False):
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
finally:
|
||||
ui.progress('pull', None, total=total)
|
||||
util.swap_out_encoding(old_encoding)
|
||||
|
||||
revisions = len(meta.revmap) - oldrevisions
|
||||
|
Loading…
Reference in New Issue
Block a user