changeset 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 bf45edfa9d90
children 3ea35a0769fe
files hgext/largefiles/lfcommands.py
diffstat 1 files changed, 1 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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):