Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/bundlerepo.py @ 35072:4696938d40f9
bundlerepo: rename arguments to bundlerepository.__init__
To reflect what they actually are.
Differential Revision: https://phab.mercurial-scm.org/D1374
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 11 Nov 2017 18:05:02 -0800 |
parents | 80e9b85d96e5 |
children | d2458ba810c5 |
comparison
equal
deleted
inserted
replaced
35071:80e9b85d96e5 | 35072:4696938d40f9 |
---|---|
254 for chunk in iter(lambda: bundle.deltachunk(None), {}): | 254 for chunk in iter(lambda: bundle.deltachunk(None), {}): |
255 pass | 255 pass |
256 return bundlefilespos | 256 return bundlefilespos |
257 | 257 |
258 class bundlerepository(localrepo.localrepository): | 258 class bundlerepository(localrepo.localrepository): |
259 def __init__(self, ui, path, bundlename): | 259 def __init__(self, ui, repopath, bundlepath): |
260 self._tempparent = None | 260 self._tempparent = None |
261 try: | 261 try: |
262 localrepo.localrepository.__init__(self, ui, path) | 262 localrepo.localrepository.__init__(self, ui, repopath) |
263 except error.RepoError: | 263 except error.RepoError: |
264 self._tempparent = tempfile.mkdtemp() | 264 self._tempparent = tempfile.mkdtemp() |
265 localrepo.instance(ui, self._tempparent, 1) | 265 localrepo.instance(ui, self._tempparent, 1) |
266 localrepo.localrepository.__init__(self, ui, self._tempparent) | 266 localrepo.localrepository.__init__(self, ui, self._tempparent) |
267 self.ui.setconfig('phases', 'publish', False, 'bundlerepo') | 267 self.ui.setconfig('phases', 'publish', False, 'bundlerepo') |
268 | 268 |
269 if path: | 269 if repopath: |
270 self._url = 'bundle:' + util.expandpath(path) + '+' + bundlename | 270 self._url = 'bundle:' + util.expandpath(repopath) + '+' + bundlepath |
271 else: | 271 else: |
272 self._url = 'bundle:' + bundlename | 272 self._url = 'bundle:' + bundlepath |
273 | 273 |
274 self.tempfile = None | 274 self.tempfile = None |
275 f = util.posixfile(bundlename, "rb") | 275 f = util.posixfile(bundlepath, "rb") |
276 self.bundlefile = self.bundle = exchange.readbundle(ui, f, bundlename) | 276 self.bundlefile = self.bundle = exchange.readbundle(ui, f, bundlepath) |
277 | 277 |
278 if isinstance(self.bundle, bundle2.unbundle20): | 278 if isinstance(self.bundle, bundle2.unbundle20): |
279 hadchangegroup = False | 279 hadchangegroup = False |
280 for part in self.bundle.iterparts(): | 280 for part in self.bundle.iterparts(): |
281 if part.type == 'changegroup': | 281 if part.type == 'changegroup': |
291 | 291 |
292 elif self.bundle.compressed(): | 292 elif self.bundle.compressed(): |
293 f = self._writetempbundle(self.bundle.read, '.hg10un', | 293 f = self._writetempbundle(self.bundle.read, '.hg10un', |
294 header='HG10UN') | 294 header='HG10UN') |
295 self.bundlefile = self.bundle = exchange.readbundle(ui, f, | 295 self.bundlefile = self.bundle = exchange.readbundle(ui, f, |
296 bundlename, | 296 bundlepath, |
297 self.vfs) | 297 self.vfs) |
298 | 298 |
299 # dict with the mapping 'filename' -> position in the bundle | 299 # dict with the mapping 'filename' -> position in the bundle |
300 self.bundlefilespos = {} | 300 self.bundlefilespos = {} |
301 | 301 |