equal
deleted
inserted
replaced
49 def getlfile(repo, proto, sha): |
49 def getlfile(repo, proto, sha): |
50 '''Retrieve a largefile from the repository-local cache or system |
50 '''Retrieve a largefile from the repository-local cache or system |
51 cache.''' |
51 cache.''' |
52 filename = lfutil.findfile(repo, sha) |
52 filename = lfutil.findfile(repo, sha) |
53 if not filename: |
53 if not filename: |
54 raise util.Abort(_('requested largefile %s not present in cache') % sha) |
54 raise error.Abort(_('requested largefile %s not present in cache') |
|
55 % sha) |
55 f = open(filename, 'rb') |
56 f = open(filename, 'rb') |
56 length = os.fstat(f.fileno())[6] |
57 length = os.fstat(f.fileno())[6] |
57 |
58 |
58 # Since we can't set an HTTP content-length header here, and |
59 # Since we can't set an HTTP content-length header here, and |
59 # Mercurial core provides no way to give the length of a streamres |
60 # Mercurial core provides no way to give the length of a streamres |