##// END OF EJS Templates
bundlerepo: treat temporarily extracted bundle file via vfs
FUJIWARA Katsunori -
r20981:4fdd1172 default
parent child Browse files
Show More
@@ -204,8 +204,8 b' class bundlerepository(localrepo.localre'
204 f = util.posixfile(bundlename, "rb")
204 f = util.posixfile(bundlename, "rb")
205 self.bundle = changegroup.readbundle(f, bundlename)
205 self.bundle = changegroup.readbundle(f, bundlename)
206 if self.bundle.compressed():
206 if self.bundle.compressed():
207 fdtemp, temp = tempfile.mkstemp(prefix="hg-bundle-",
207 fdtemp, temp = self.vfs.mkstemp(prefix="hg-bundle-",
208 suffix=".hg10un", dir=self.path)
208 suffix=".hg10un")
209 self.tempfile = temp
209 self.tempfile = temp
210 fptemp = os.fdopen(fdtemp, 'wb')
210 fptemp = os.fdopen(fdtemp, 'wb')
211
211
@@ -219,8 +219,8 b' class bundlerepository(localrepo.localre'
219 finally:
219 finally:
220 fptemp.close()
220 fptemp.close()
221
221
222 f = util.posixfile(self.tempfile, "rb")
222 f = self.vfs.open(self.tempfile, mode="rb")
223 self.bundle = changegroup.readbundle(f, bundlename)
223 self.bundle = changegroup.readbundle(f, bundlename, self.vfs)
224
224
225 # dict with the mapping 'filename' -> position in the bundle
225 # dict with the mapping 'filename' -> position in the bundle
226 self.bundlefilespos = {}
226 self.bundlefilespos = {}
@@ -280,7 +280,7 b' class bundlerepository(localrepo.localre'
280 """Close assigned bundle file immediately."""
280 """Close assigned bundle file immediately."""
281 self.bundle.close()
281 self.bundle.close()
282 if self.tempfile is not None:
282 if self.tempfile is not None:
283 os.unlink(self.tempfile)
283 self.vfs.unlink(self.tempfile)
284 if self._tempparent:
284 if self._tempparent:
285 shutil.rmtree(self._tempparent, True)
285 shutil.rmtree(self._tempparent, True)
286
286
General Comments 0
You need to be logged in to leave comments. Login now