Patchwork [1,of,2] largefiles: show progress when checking standin hashes in outgoing changesets

login
register
mail settings
Submitter Mads Kiilerich
Date Jan. 16, 2015, 6:51 p.m.
Message ID <dead34ad89f94629703d.1421434304@ssl.google-analytics.com>
Download mbox | patch
Permalink /patch/7492/
State Accepted
Commit f2b6f37d537bc5a46f7b10ac05451a8c1a6b588f
Headers show

Comments

Mads Kiilerich - Jan. 16, 2015, 6:51 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1421434285 -3600
#      Fri Jan 16 19:51:25 2015 +0100
# Node ID dead34ad89f94629703d2595e2df6e0e351c5cc4
# Parent  049a9e3a078d7c988cb12ed456aad6ec2779ea69
largefiles: show progress when checking standin hashes in outgoing changesets

This checking can take a huge amount of time and we should give user a hint
that something is going on.

Patch

diff --git a/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py
--- a/hgext/largefiles/lfutil.py
+++ b/hgext/largefiles/lfutil.py
@@ -420,7 +420,9 @@  def getlfilestoupdate(oldstandins, newst
     return filelist
 
 def getlfilestoupload(repo, missing, addfunc):
-    for n in missing:
+    for i, n in enumerate(missing):
+        repo.ui.progress(_('finding outgoing largefiles'), i,
+            unit=_('revision'), total=len(missing))
         parents = [p for p in repo.changelog.parents(n) if p != node.nullid]
 
         oldlfstatus = repo.lfstatus
@@ -447,6 +449,7 @@  def getlfilestoupload(repo, missing, add
         for fn in files:
             if isstandin(fn) and fn in ctx:
                 addfunc(fn, ctx[fn].data().strip())
+    repo.ui.progress(_('finding outgoing largefiles'), None)
 
 def updatestandinsbymatch(repo, match):
     '''Update standins in the working directory according to specified match
diff --git a/tests/test-largefiles-misc.t b/tests/test-largefiles-misc.t
--- a/tests/test-largefiles-misc.t
+++ b/tests/test-largefiles-misc.t
@@ -590,6 +590,8 @@  check messages when there are files to u
   all remote heads known locally
   1:1acbe71ce432
   2:6095d0695d70
+  finding outgoing largefiles: 0/2 revision (0.00%)
+  finding outgoing largefiles: 1/2 revision (50.00%)
   largefiles to upload (1 entities):
   b
       89e6c98d92887913cadf06b2adb97f26cde4849b
@@ -645,6 +647,11 @@  check messages when there are files to u
   3:7983dce246cc
   4:233f12ada4ae
   5:036794ea641c
+  finding outgoing largefiles: 0/5 revision (0.00%)
+  finding outgoing largefiles: 1/5 revision (20.00%)
+  finding outgoing largefiles: 2/5 revision (40.00%)
+  finding outgoing largefiles: 3/5 revision (60.00%)
+  finding outgoing largefiles: 4/5 revision (80.00%)
   largefiles to upload (3 entities):
   b
       13f9ed0898e315bf59dc2973fec52037b6f441a2
@@ -690,6 +697,10 @@  and #5 refer it.
   3:7983dce246cc
   4:233f12ada4ae
   5:036794ea641c
+  finding outgoing largefiles: 0/4 revision (0.00%)
+  finding outgoing largefiles: 1/4 revision (25.00%)
+  finding outgoing largefiles: 2/4 revision (50.00%)
+  finding outgoing largefiles: 3/4 revision (75.00%)
   largefiles to upload (2 entities):
   b
       13f9ed0898e315bf59dc2973fec52037b6f441a2