Patchwork D6732: localrepo: push manifestlog and changelog construction code into store

login
register
mail settings
Submitter phabricator
Date Sept. 5, 2019, 7:21 p.m.
Message ID <6c8b61a930208e0714e62dd53874de26@localhost.localdomain>
Download mbox | patch
Permalink /patch/41489/
State Not Applicable
Headers show

Comments

phabricator - Sept. 5, 2019, 7:21 p.m.
durin42 updated this revision to Diff 16386.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6732?vs=16226&id=16386

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6732/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6732

AFFECTED FILES
  mercurial/localrepo.py
  mercurial/store.py

CHANGE DETAILS




To: durin42, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel

Patch

diff --git a/mercurial/store.py b/mercurial/store.py
--- a/mercurial/store.py
+++ b/mercurial/store.py
@@ -15,7 +15,9 @@ 
 
 from .i18n import _
 from . import (
+    changelog,
     error,
+    manifest,
     node,
     policy,
     pycompat,
@@ -379,6 +381,14 @@ 
         l.sort()
         return l
 
+    def changelog(self, trypending):
+        return changelog.changelog(self.vfs, trypending=trypending)
+
+    def manifestlog(self, repo, storenarrowmatch):
+        rootstore = manifest.manifestrevlog(self.vfs)
+        return manifest.manifestlog(
+            self.vfs, repo, rootstore, storenarrowmatch)
+
     def datafiles(self, matcher=None):
         return self._walk('data', True) + self._walk('meta', True)
 
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -28,7 +28,6 @@ 
     branchmap,
     bundle2,
     changegroup,
-    changelog,
     color,
     context,
     dirstate,
@@ -41,7 +40,6 @@ 
     filelog,
     hook,
     lock as lockmod,
-    manifest,
     match as matchmod,
     merge as mergemod,
     mergeutil,
@@ -1304,14 +1302,11 @@ 
 
     @storecache('00changelog.i')
     def changelog(self):
-        return changelog.changelog(self.svfs,
-                                   trypending=txnutil.mayhavepending(self.root))
+        return self.store.changelog(txnutil.mayhavepending(self.root))
 
     @storecache('00manifest.i')
     def manifestlog(self):
-        rootstore = manifest.manifestrevlog(self.svfs)
-        return manifest.manifestlog(self.svfs, self, rootstore,
-                                    self._storenarrowmatch)
+        return self.store.manifestlog(self, self._storenarrowmatch)
 
     @repofilecache('dirstate')
     def dirstate(self):