[PATCH 1 of 1] bundlerepo: use less intrusive util.posixfile to open bundle

Adrian Buehlmann adrian at cadifra.com
Fri Jan 7 04:02:23 CST 2011


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1294393710 -3600
# Node ID 8d052d71ad44e05e0eca5d4dae7166a8dc4fcdb2
# Parent  e5060aa220437f57b9ebc2f4dbb2f9d0803d27fc
bundlerepo: use less intrusive util.posixfile to open bundle

diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -174,7 +174,7 @@ class bundlerepository(localrepo.localre
             self._url = 'bundle:' + bundlename
 
         self.tempfile = None
-        f = open(bundlename, "rb")
+        f = util.posixfile(bundlename, "rb")
         self.bundle = changegroup.readbundle(f, bundlename)
         if self.bundle.compressed():
             fdtemp, temp = tempfile.mkstemp(prefix="hg-bundle-",
@@ -192,7 +192,7 @@ class bundlerepository(localrepo.localre
             finally:
                 fptemp.close()
 
-            f = open(self.tempfile, "rb")
+            f = util.posixfile(self.tempfile, "rb")
             self.bundle = changegroup.readbundle(f, bundlename)
 
         # dict with the mapping 'filename' -> position in the bundle


More information about the Mercurial-devel mailing list