Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Holdsworth <jholdsworth@nvidia.com>2021-12-19 18:40:28 +0300
committerJunio C Hamano <gitster@pobox.com>2021-12-20 23:55:26 +0300
commit0f829620e6f2ccc441aef1ffd6c0a546b949ee39 (patch)
tree6ef8c892d974486d66ed19887e296c654d7d1e3f /git-p4.py
parentae9b9509a76e49cbf4fb254b2b75d566be6434a8 (diff)
git-p4: show progress as an integer
When importing files from Perforce, git-p4 periodically logs the progress of file transfers as a percentage. However, the value is printed as a float with an excessive number of decimal places. For example a typical update might contain the following message: Importing revision 12345 (26.199617677553135%) This patch simply rounds the value down to the nearest integer percentage value, greatly improving readability. Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Acked-by: Luke Diamand <luke@diamand.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-p4.py')
-rwxr-xr-xgit-p4.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/git-p4.py b/git-p4.py
index 74834736fa..a625077b83 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -3637,7 +3637,8 @@ class P4Sync(Command, P4UserMap):
self.updateOptionDict(description)
if not self.silent:
- sys.stdout.write("\rImporting revision %s (%s%%)" % (change, cnt * 100 / len(changes)))
+ sys.stdout.write("\rImporting revision %s (%d%%)" % (
+ change, (cnt * 100) // len(changes)))
sys.stdout.flush()
cnt = cnt + 1