Mercurial > hg
comparison hgext/largefiles/proto.py @ 26587:56b2bcea2529
error: get Abort from 'error' instead of 'util'
The home of 'Abort' is 'error' not 'util' however, a lot of code seems to be
confused about that and gives all the credit to 'util' instead of the
hardworking 'error'. In a spirit of equity, we break the cycle of injustice and
give back to 'error' the respect it deserves. And screw that 'util' poser.
For great justice.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 08 Oct 2015 12:55:45 -0700 |
parents | 328739ea70c3 |
children | 78539633acf3 |
comparison
equal
deleted
inserted
replaced
26586:d51c658d3f04 | 26587:56b2bcea2529 |
---|---|
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 |