Mercurial > hg
comparison mercurial/bundlerepo.py @ 21064:4d9d490d7bbe
bundle2: add a ui argument to readbundle
The bundle2 unbundler needs a ui argument. We are now passing this information
to `readbundle`.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Mon, 14 Apr 2014 15:45:30 -0400 |
parents | 7ca4f2049d3b |
children | dbf292f65b09 |
comparison
equal
deleted
inserted
replaced
21063:7ca4f2049d3b | 21064:4d9d490d7bbe |
---|---|
200 else: | 200 else: |
201 self._url = 'bundle:' + bundlename | 201 self._url = 'bundle:' + bundlename |
202 | 202 |
203 self.tempfile = None | 203 self.tempfile = None |
204 f = util.posixfile(bundlename, "rb") | 204 f = util.posixfile(bundlename, "rb") |
205 self.bundle = exchange.readbundle(f, bundlename) | 205 self.bundle = exchange.readbundle(ui, f, bundlename) |
206 if self.bundle.compressed(): | 206 if self.bundle.compressed(): |
207 fdtemp, temp = self.vfs.mkstemp(prefix="hg-bundle-", | 207 fdtemp, temp = self.vfs.mkstemp(prefix="hg-bundle-", |
208 suffix=".hg10un") | 208 suffix=".hg10un") |
209 self.tempfile = temp | 209 self.tempfile = temp |
210 fptemp = os.fdopen(fdtemp, 'wb') | 210 fptemp = os.fdopen(fdtemp, 'wb') |
218 fptemp.write(chunk) | 218 fptemp.write(chunk) |
219 finally: | 219 finally: |
220 fptemp.close() | 220 fptemp.close() |
221 | 221 |
222 f = self.vfs.open(self.tempfile, mode="rb") | 222 f = self.vfs.open(self.tempfile, mode="rb") |
223 self.bundle = exchange.readbundle(f, bundlename, self.vfs) | 223 self.bundle = exchange.readbundle(ui, 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 = {} |
227 | 227 |
228 @localrepo.unfilteredpropertycache | 228 @localrepo.unfilteredpropertycache |