comparison hgext/largefiles/lfcommands.py @ 27774:8ceaaf63ca80

largefiles: use util.readfile in lfconvert
author Bryan O'Sullivan <bryano@fb.com>
date Tue, 12 Jan 2016 14:31:02 -0800
parents 07fc2f2134ba
children d2e9cc9edc08
comparison
equal deleted inserted replaced
27773:bf45edfa9d90 27774:8ceaaf63ca80
139 path = lfutil.findfile(rsrc, hash) 139 path = lfutil.findfile(rsrc, hash)
140 140
141 if path is None: 141 if path is None:
142 raise error.Abort(_("missing largefile for '%s' in %s") 142 raise error.Abort(_("missing largefile for '%s' in %s")
143 % (realname, realrev)) 143 % (realname, realrev))
144 fp = open(path, 'rb') 144 return util.readfile(path), f[1]
145
146 try:
147 return (fp.read(), f[1])
148 finally:
149 fp.close()
150 145
151 class converter(convcmd.converter): 146 class converter(convcmd.converter):
152 def __init__(self, ui, source, dest, revmapfile, opts): 147 def __init__(self, ui, source, dest, revmapfile, opts):
153 src = lfsource(ui, source) 148 src = lfsource(ui, source)
154 149