[PATCH 4 of 4 V2] largefiles: don't print largefile changes in updaterepo() without regular stats

Mads Kiilerich mads at kiilerich.com
Thu Jan 10 08:26:34 CST 2013


On 01/06/2013 11:16 PM, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1357504524 18000
> # Node ID e0a36600a4b62df52004337736409469a4700d3b
> # Parent  3e9e34fd72948c311e032778c75a9fab2bb5d399
> largefiles: don't print largefile changes in updaterepo() without regular stats
>
> This eliminates standalone "getting largefiles" messages when the corresponding
> updated/merged/removed/unresolved line has been explicitly suppressed.

Getting largefiles often takes some time. Both because they are big and 
because they might have to be fetched somewhere else. The "getting 
largefiles" message is thus usually useful and should usually be shown 
to inform the user what is going on.

The statistics afterwards is less useful, but also serve the purpose of 
informing the user that it is done getting largefiles ... and perhaps 
justify the time it took by showing how much it did.

So I think I'm -1 on this one.

... but what I said only applies to getting largefiles. I think it would 
make sense if updatelfiles stayed quiet on removed largefiles.

> Only hg.clean() has the capability to suppress these messages.

Just to be clear: That is behaviour that is introduced here, right?

>   Arguably the
> updated..resolved line should be present in the two test cases changed here,
> but at least the output is consistent for now.
>
> Note that this also affects (the apparently largefiles untested) bisect and
> backput commands, as well as hgsubrepo.remove().
>
> diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
> --- a/hgext/largefiles/overrides.py
> +++ b/hgext/largefiles/overrides.py
> @@ -659,7 +659,8 @@
>           newstandins = lfutil.getstandinsstate(repo)
>           filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
>   
> -    lfcommands.updatelfiles(repo.ui, repo, filelist=filelist, printmessage=True)
> +    lfcommands.updatelfiles(repo.ui, repo, filelist=filelist,
> +                            printmessage=showstats)
>   
>       return result
>   
> diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
> --- a/tests/test-largefiles.t
> +++ b/tests/test-largefiles.t
> @@ -1708,8 +1708,6 @@
>     $ hg clone . ../update_on_clone
>     updating to branch default
>     cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
> -  getting changed largefiles
> -  1 largefiles updated, 0 removed
>     5 files updated, 0 files merged, 0 files removed, 0 files unresolved
>     getting changed largefiles
>     1 largefiles updated, 0 removed
> @@ -1723,8 +1721,6 @@
>     $ hg -R ../update_on_clone status -S
>     M subrepo/large.txt
>     $ hg -R ../update_on_clone update -C
> -  getting changed largefiles
> -  1 largefiles updated, 0 removed
>     1 files updated, 0 files merged, 0 files removed, 0 files unresolved
>     getting changed largefiles
>     0 largefiles updated, 0 removed

These examples shows that the information is almost useless when using 
subrepos. It should show which subrepo it is visiting ... or in this 
case: inherit the quietness to the subrepo.

/Mads


More information about the Mercurial-devel mailing list