[PATCH RESEND] largefiles: speed up the check if largefiles should be added to repo requirements

Na'Tosha Bard natosha at unity3d.com
Fri Oct 28 08:02:48 CDT 2011


2011/10/28 Dominik Psenner <dpsenner at gmail.com>

> # HG changeset patch
> # User Dominik Psenner <dpsenner at gmail.com>
> # Date 1319803210 -7200
> # Branch stable
> # Node ID d07955510f1e049047ea7e8b85f0e00c25a1f0bf
> # Parent  fa44d741c4d488556a113e007948658d5cfdfca2
> largefiles: speed up the check if largefiles should be added to repo
> requirements
>
> This patch speeds up things by not recursing into subfolders when searching
> for
> .hglf file in the store.
>
> diff -r fa44d741c4d4 -r d07955510f1e hgext/largefiles/reposetup.py
> --- a/hgext/largefiles/reposetup.py     Fri Oct 28 12:57:59 2011 +0200
> +++ b/hgext/largefiles/reposetup.py     Fri Oct 28 14:00:10 2011 +0200
> @@ -401,7 +401,7 @@
>
>     def checkrequireslfiles(ui, repo, **kwargs):
>          if 'largefiles' not in repo.requirements and util.any(
> -                lfutil.shortname+'/' in f[0] for f in
> repo.store.datafiles()):
> +                repo.store.encode('data/'+lfutil.shortname) in f[0] for f
> in repo.store._walk('data', False)):
>             repo.requirements.add('largefiles')
>             repo._writerequirements()
>
>
Wouldn't it also be logical to first just check for a ".hglf" in the repo
directory, and only if it doesn't exist, walk the repo.store?  Surely this
is much faster?

Cheers,
Na'Tosha



-- 
*Na'Tosha Bard*
Build & Infrastructure Developer | Unity Technologies

*E-Mail:* natosha at unity3d.com
*Skype:* natosha.bard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20111028/34b685d5/attachment.html>


More information about the Mercurial-devel mailing list