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

Dominik Psenner dpsenner at gmail.com
Fri Oct 28 07:01:03 CDT 2011


# 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()
 


More information about the Mercurial-devel mailing list