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

Dominik Psenner dpsenner at gmail.com
Sat Oct 29 04:25:06 CDT 2011


On 10/29/2011 01:05 AM, Matt Mackall wrote:
> but this doesn't work at all on repos that aren't "dot-encoded":
> 
>   File "/home/mpm/hg/hgext/largefiles/reposetup.py", line 405, in checkrequireslfiles
>     in f[0] for f in repo.store._walk('data', False))):
>   File "/home/mpm/hg/hgext/largefiles/reposetup.py", line 405, in <genexpr>
>     in f[0] for f in repo.store._walk('data', False))):
> AttributeError: 'encodedstore' object has no attribute 'encode'
> 
> Ironic error message, I know.

Unfortunate. *hm* I have none of those old repositories around to test
this. Would this rather simple addition make this improvement work?

# HG changeset patch
diff -r b26315ae7f18 mercurial/store.py
--- a/mercurial/store.py	Thu Oct 27 18:35:07 2011 -0500
+++ b/mercurial/store.py	Sat Oct 29 11:23:09 2011 +0200
@@ -269,6 +269,9 @@
     def datafiles(self):
         return self._walk('data', True)

+    def encode(self, f):
+        return encodedir(f)
+
     def walk(self):
         '''yields (unencoded, encoded, size)'''
         # yield data files first
@@ -300,6 +303,9 @@
                 a = None
             yield a, b, size

+    def encode(self, f):
+        return encodefilename(f)
+
     def join(self, f):
         return self.path + '/' + encodefilename(f)

-- 
Dominik Psenner
## OpenPGP Key Signature #################################
# Key ID: B469318C                                       #
# Fingerprint: 558641995F7EC2D251354C3A49C7E3D1B469318C  #
##########################################################

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20111029/66c398d9/attachment.pgp>


More information about the Mercurial-devel mailing list