hgext/largefiles/proto.py
branchstable
changeset 18488 a977b42df8b3
parent 18298 3598c585e464
child 18922 d2c4d37f7db5
--- a/hgext/largefiles/proto.py	Mon Jan 28 15:19:44 2013 +0100
+++ b/hgext/largefiles/proto.py	Mon Jan 28 15:19:44 2013 +0100
@@ -63,18 +63,16 @@
     return wireproto.streamres(generator())
 
 def statlfile(repo, proto, sha):
-    '''Return '2\n' if the largefile is missing, '1\n' if it has a
-    mismatched checksum, or '0\n' if it is in good condition'''
+    '''Return '2\n' if the largefile is missing, '0\n' if it seems to be in
+    good condition.
+
+    The value 1 is reserved for mismatched checksum, but that is too expensive
+    to be verified on every stat and must be caught be running 'hg verify'
+    server side.'''
     filename = lfutil.findfile(repo, sha)
     if not filename:
         return '2\n'
-    fd = None
-    try:
-        fd = open(filename, 'rb')
-        return lfutil.hexsha1(fd) == sha and '0\n' or '1\n'
-    finally:
-        if fd:
-            fd.close()
+    return '0\n'
 
 def wirereposetup(ui, repo):
     class lfileswirerepository(repo.__class__):