Mercurial > public > mercurial-scm > hg
comparison mercurial/bundlerepo.py @ 39944:75b53b809e87
bundlerepo: remove a variable alias
"parentrepo" and "repo" were the same thing and I don't see much
reason for it (unionrepo has similar structure and a similar alias but
there are two repos there so at least it makes a little more sense
there).
Differential Revision: https://phab.mercurial-scm.org/D4830
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Sat, 15 Sep 2018 22:56:57 -0700 |
parents | 24e493ec2229 |
children | 55db747a21ad |
comparison
equal
deleted
inserted
replaced
39943:a6f8ab537908 | 39944:75b53b809e87 |
---|---|
496 # both it and our ``bundlerepository`` class which overrides some | 496 # both it and our ``bundlerepository`` class which overrides some |
497 # functionality. We then change the type of the constructed repository | 497 # functionality. We then change the type of the constructed repository |
498 # to this new type and initialize the bundle-specific bits of it. | 498 # to this new type and initialize the bundle-specific bits of it. |
499 | 499 |
500 try: | 500 try: |
501 parentrepo = localrepo.instance(ui, repopath, create=False) | 501 repo = localrepo.instance(ui, repopath, create=False) |
502 tempparent = None | 502 tempparent = None |
503 except error.RepoError: | 503 except error.RepoError: |
504 tempparent = pycompat.mkdtemp() | 504 tempparent = pycompat.mkdtemp() |
505 try: | 505 try: |
506 parentrepo = localrepo.instance(ui, tempparent, create=True) | 506 repo = localrepo.instance(ui, tempparent, create=True) |
507 except Exception: | 507 except Exception: |
508 shutil.rmtree(tempparent) | 508 shutil.rmtree(tempparent) |
509 raise | 509 raise |
510 | 510 |
511 class derivedbundlerepository(bundlerepository, parentrepo.__class__): | 511 class derivedbundlerepository(bundlerepository, repo.__class__): |
512 pass | 512 pass |
513 | 513 |
514 repo = parentrepo | |
515 repo.__class__ = derivedbundlerepository | 514 repo.__class__ = derivedbundlerepository |
516 bundlerepository.__init__(repo, bundlepath, url, tempparent) | 515 bundlerepository.__init__(repo, bundlepath, url, tempparent) |
517 | 516 |
518 return repo | 517 return repo |
519 | 518 |