[PATCH 1 of 3] patchbomb: replace file I/O with util.readfile

Bryan O'Sullivan bos at serpentine.com
Wed Jan 13 00:21:01 UTC 2016


# HG changeset patch
# User Bryan O'Sullivan <bryano at fb.com>
# Date 1452643038 28800
#      Tue Jan 12 15:57:18 2016 -0800
# Node ID dc4b31f3489f5c7d574c8bf2e1f0d96a0564fd50
# Parent  69a304f8a51acd7c833a2be0d3aadc2c7935d42f
patchbomb: replace file I/O with util.readfile

diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -235,10 +235,7 @@ def _getbundle(repo, dest, **opts):
         opts['type'] = btype
     try:
         commands.bundle(ui, repo, tmpfn, dest, **opts)
-        fp = open(tmpfn, 'rb')
-        data = fp.read()
-        fp.close()
-        return data
+        return util.readfile(tmpfn)
     finally:
         try:
             os.unlink(tmpfn)


More information about the Mercurial-devel mailing list