rage: show progress bar per steps

Summary:
Show progress bar for each step so people know what information takes long to
collect.

Avoid using the "paste" word since with `-p` there is no paste.

As we're here, uncapitalize the message so it's consistent with the rest of the
code.

Reviewed By: markbt

Differential Revision: D9443605

fbshipit-source-id: 74672a1cf52d44289e438abeb1ca10019e37b531
This commit is contained in:
Jun Wu 2018-08-22 21:26:55 -07:00 committed by Facebook Github Bot
parent 90cce90542
commit 95957edcf2

View File

@ -373,7 +373,8 @@ def _makerage(ui, repo, **opts):
profile.append((time.time() - allstart, "basic info", None))
for name, gen in detailed:
start = time.time()
value = _failsafe(gen)
with progress.spinner(ui, "collecting %r" % name):
value = _failsafe(gen)
finish = time.time()
msg.append(
"%s: (%.2f s)\n---------------------------\n%s\n\n"
@ -415,14 +416,14 @@ def rage(ui, repo, *pats, **opts):
advice = Please see our FAQ guide: https://...
"""
with progress.spinner(ui, "Generating paste"):
with progress.spinner(ui, "collecting information"):
msg = _makerage(ui, repo, **opts)
if opts.get("preview"):
ui.write("%s\n" % msg)
return
with progress.spinner(ui, "Saving paste"):
with progress.spinner(ui, "saving paste"):
try:
p = subprocess.Popen(
["arc", "paste", "--lang", "hgrage", "--title", "hgrage"],