largefiles: use util.readfile in lfconvert
authorBryan O'Sullivan <bryano@fb.com>
Tue, 12 Jan 2016 14:31:02 -0800
changeset 27774 8ceaaf63ca80
parent 27773 bf45edfa9d90
child 27775 3ea35a0769fe
largefiles: use util.readfile in lfconvert
hgext/largefiles/lfcommands.py
--- a/hgext/largefiles/lfcommands.py	Tue Jan 12 14:29:57 2016 -0800
+++ b/hgext/largefiles/lfcommands.py	Tue Jan 12 14:31:02 2016 -0800
@@ -141,12 +141,7 @@
                     if path is None:
                         raise error.Abort(_("missing largefile for '%s' in %s")
                                           % (realname, realrev))
-                    fp = open(path, 'rb')
-
-                    try:
-                        return (fp.read(), f[1])
-                    finally:
-                        fp.close()
+                    return util.readfile(path), f[1]
 
             class converter(convcmd.converter):
                 def __init__(self, ui, source, dest, revmapfile, opts):