Patchwork [4,of,6] upgrade: use actual filelog to convert filelog

login
register
mail settings
Submitter Boris Feld
Date Dec. 8, 2017, 11:19 a.m.
Message ID <5ac3ff23878f3a58a885.1512731958@FB>
Download mbox | patch
Permalink /patch/26099/
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 1512682638 -3600
#      Thu Dec 07 22:37:18 2017 +0100
# Node ID 5ac3ff23878f3a58a88540e776f9aa845ebbdd62
# Parent  0711e3f3c5915d976f72ce22d138437d84c42701
# EXP-Topic upgrade.config
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 5ac3ff23878f
upgrade: use actual filelog to convert filelog

Extensions can add extra logic related to the config, so we must use the actual
class. The path used needs minimal transformation for this to work.

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,
+    filelog,
     hg,
     localrepo,
     manifest,
@@ -413,9 +414,8 @@  def _revlogfrompath(repo, path):
         mandir = path[:-len('00manifest.i')]
         return manifest.manifestrevlog(repo.svfs, dir=mandir)
     else:
-        # Filelogs don't do anything special with settings. So we can use a
-        # vanilla revlog.
-        return revlog.revlog(repo.svfs, path)
+        #reverse of "/".join(("data", path + ".i"))
+        return filelog.filelog(repo.svfs, path[5:-2])
 
 def _copyrevlogs(ui, srcrepo, dstrepo, tr, deltareuse, aggressivemergedeltas):
     """Copy revlogs between 2 repos."""