Patchwork largefiles: make caching largefiles message more explicit

login
register
mail settings
Submitter natosha@unity3d.com
Date Feb. 9, 2013, 3:10 p.m.
Message ID <42691426804311ace536.1360422643@s0-0.paconsult7.bbnplanet.net>
Download mbox | patch
Permalink /patch/881/
State Accepted
Commit 8ba520003ae08984cd689d72f924286edbb126bb
Headers show

Comments

natosha@unity3d.com - Feb. 9, 2013, 3:10 p.m.
# HG changeset patch
# User Na'Tosha Bard <natosha@unity3d.com>
# Date 1360422501 0
# Node ID 42691426804311ace53611264cb3ed5f7da176d3
# Parent  97761496c65ae836d6b0983a3f48959dd3112364
largefiles: make caching largefiles message more explicit

In some cases, caching largefiles may take a long time (if the user has
pulled a lot of new heads).  This patch makes it more clear what is happening,
by showing the number of heads we are caching largefiles for.
Bryan O'Sullivan - Feb. 9, 2013, 3:32 p.m.
On Sat, Feb 9, 2013 at 7:10 AM, <natosha@unity3d.com> wrote:

> largefiles: make caching largefiles message more explicit
>

Crewed, thanks.

Patch

diff -r 97761496c65a -r 426914268043 hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py	Fri Feb 08 22:42:07 2013 +0000
+++ b/hgext/largefiles/overrides.py	Sat Feb 09 15:08:21 2013 +0000
@@ -735,10 +735,11 @@ 
         # will run into a problem later if we try to merge or rebase with one of
         # these heads, so cache the largefiles now directly into the system
         # cache.
-        ui.status(_("caching new largefiles\n"))
         numcached = 0
         heads = lfutil.getcurrentheads(repo)
         newheads = set(heads).difference(set(oldheads))
+        if len(newheads) > 0:
+            ui.status(_("caching largefiles for %s heads\n" % len(newheads)))
         for head in newheads:
             (cached, missing) = lfcommands.cachelfiles(ui, repo, head)
             numcached += len(cached)
diff -r 97761496c65a -r 426914268043 tests/test-largefiles.t
--- a/tests/test-largefiles.t	Fri Feb 08 22:42:07 2013 +0000
+++ b/tests/test-largefiles.t	Sat Feb 09 15:08:21 2013 +0000
@@ -883,7 +883,7 @@ 
   adding file changes
   added 6 changesets with 16 changes to 8 files
   (run 'hg update' to get a working copy)
-  caching new largefiles
+  caching largefiles for 1 heads
   3 largefiles cached
   3 additional largefiles cached
   $ cd ..
@@ -974,7 +974,7 @@ 
   adding file changes
   added 1 changesets with 2 changes to 2 files (+1 heads)
   (run 'hg heads' to see heads, 'hg merge' to merge)
-  caching new largefiles
+  caching largefiles for 1 heads
   0 largefiles cached
   $ hg rebase
   Invoking status precommit hook
@@ -1273,7 +1273,7 @@ 
   adding file changes
   added 2 changesets with 4 changes to 4 files (+1 heads)
   (run 'hg heads' to see heads, 'hg merge' to merge)
-  caching new largefiles
+  caching largefiles for 1 heads
   2 largefiles cached
   $ hg merge
   merging sub/large4