Patchwork [3,of,6] upgrade: more standard creation of the temporary repository

login
register
mail settings
Submitter Boris Feld
Date Dec. 8, 2017, 11:19 a.m.
Message ID <0711e3f3c5915d976f72.1512731957@FB>
Download mbox | patch
Permalink /patch/26096/
State Accepted
Headers show

Comments

Boris Feld - Dec. 8, 2017, 11:19 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1512669370 -3600
#      Thu Dec 07 18:56:10 2017 +0100
# Node ID 0711e3f3c5915d976f72ce22d138437d84c42701
# Parent  2c12e70358f6754054becbf4c016ef5ca2bedddb
# EXP-Topic upgrade.config
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 0711e3f3c591
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.

Patch

diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -14,6 +14,7 @@  from .i18n import _
 from . import (
     changelog,
     error,
+    hg,
     localrepo,
     manifest,
     revlog,
@@ -841,9 +842,7 @@  def upgraderepo(ui, repo, run=False, opt
             oldcopy = repo.ui.copy
             try:
                 repo.ui.__dict__.pop('copy', None)
-                dstrepo = localrepo.localrepository(repo.ui,
-                                                    path=tmppath,
-                                                    create=True)
+                dstrepo = hg.repository(repo.ui, path=tmppath, create=True)
             finally:
                 repo.ui.copy = oldcopy