--- a/hgext/transplant.py Mon Sep 20 16:00:15 2010 -0500
+++ b/hgext/transplant.py Mon Sep 20 16:14:05 2010 -0500
@@ -600,6 +600,7 @@
tp.apply(repo, source, revmap, merges, opts)
finally:
if bundle:
+ source.close()
os.unlink(bundle)
cmdtable = {
--- a/mercurial/bundlerepo.py Mon Sep 20 16:00:15 2010 -0500
+++ b/mercurial/bundlerepo.py Mon Sep 20 16:14:05 2010 -0500
@@ -177,7 +177,6 @@
f = open(bundlename, "rb")
self.bundle = changegroup.readbundle(f, bundlename)
if self.bundle.compressed():
- # we need a seekable, decompressed bundle
fdtemp, temp = tempfile.mkstemp(prefix="hg-bundle-",
suffix=".hg10un", dir=self.path)
self.tempfile = temp
@@ -247,6 +246,10 @@
else:
return filelog.filelog(self.sopener, f)
+ def close(self):
+ """Close assigned bundle file immediately."""
+ self.bundle.close()
+
def __del__(self):
del self.bundle
if tempfile is not None:
--- a/mercurial/changegroup.py Mon Sep 20 16:00:15 2010 -0500
+++ b/mercurial/changegroup.py Mon Sep 20 16:14:05 2010 -0500
@@ -143,6 +143,8 @@
return self._stream.seek(pos)
def tell(self):
return self._stream.tell()
+ def close(self):
+ return self._stream.close()
def chunklength(self):
d = self.read(4)