Mercurial > public > mercurial-scm > hg
comparison mercurial/upgrade.py @ 35343:06987c6971be
upgrade: more standard creation of the temporary repository
By using the standard path to create a repository we fill some hole in the
current initialization process. The one who triggered this changeset was the
lack of extensions initialization.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Thu, 07 Dec 2017 18:56:10 +0100 |
parents | 75520786ad2f |
children | 8f3f8b8dbab7 |
comparison
equal
deleted
inserted
replaced
35342:75520786ad2f | 35343:06987c6971be |
---|---|
12 | 12 |
13 from .i18n import _ | 13 from .i18n import _ |
14 from . import ( | 14 from . import ( |
15 changelog, | 15 changelog, |
16 error, | 16 error, |
17 hg, | |
17 localrepo, | 18 localrepo, |
18 manifest, | 19 manifest, |
19 revlog, | 20 revlog, |
20 scmutil, | 21 scmutil, |
21 util, | 22 util, |
839 # | 840 # |
840 # We have to work around the protection. | 841 # We have to work around the protection. |
841 oldcopy = repo.ui.copy | 842 oldcopy = repo.ui.copy |
842 try: | 843 try: |
843 repo.ui.__dict__.pop('copy', None) | 844 repo.ui.__dict__.pop('copy', None) |
844 dstrepo = localrepo.localrepository(repo.ui, | 845 dstrepo = hg.repository(repo.ui, path=tmppath, create=True) |
845 path=tmppath, | |
846 create=True) | |
847 finally: | 846 finally: |
848 repo.ui.copy = oldcopy | 847 repo.ui.copy = oldcopy |
849 | 848 |
850 with dstrepo.wlock(), dstrepo.lock(): | 849 with dstrepo.wlock(), dstrepo.lock(): |
851 backuppath = _upgraderepo(ui, repo, dstrepo, newreqs, | 850 backuppath = _upgraderepo(ui, repo, dstrepo, newreqs, |