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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

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

martinvonz (Martin von Zweigbergk)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This feels substantially more appropriate, as the store is actually
  the layer with knowledge of how to handle this storage. I didn't move
  the caching decorators for now because that's going to require some
  more involved work, and this unblocks my current experimentation.

REPOSITORY
  rHG Mercurial

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

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

CHANGE DETAILS

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,
@@ -1300,14 +1298,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):



To: durin42, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

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

martinvonz (Martin von Zweigbergk)
This revision is now accepted and ready to land.
indygreg added a comment.
indygreg accepted this revision.


  The boundary between `localrepository` and `store` is a bit murky and definitely needs some work. When I last had things paged into my brain last year, I think I was trending towards breaking up the store into discrete classes and making the code that dynamically resolves repository types cherry pick the classes depending on the opener options. But we could easily have the store handle this logic as well. This is all very complicated and I don't prescribe to have a single correct answer.

REPOSITORY
  rHG Mercurial

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

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

To: durin42, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

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

martinvonz (Martin von Zweigbergk)
In reply to this post by martinvonz (Martin von Zweigbergk)
durin42 added a comment.


  I think pushing it down into the store makes a reasonable amount of sense, since it's going to be pretty heavily tied to the revision storage mechanism...

REPOSITORY
  rHG Mercurial

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

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

To: durin42, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

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

martinvonz (Martin von Zweigbergk)
In reply to this post by martinvonz (Martin von Zweigbergk)
durin42 added a comment.


  Ping on this - can we get this landed to unblock my experimentation?

REPOSITORY
  rHG Mercurial

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

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

To: durin42, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

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

martinvonz (Martin von Zweigbergk)
In reply to this post by martinvonz (Martin von Zweigbergk)
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

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):



To: durin42, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

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

martinvonz (Martin von Zweigbergk)
In reply to this post by martinvonz (Martin von Zweigbergk)
Closed by commit rHG3df3b139a43d: localrepo: push manifestlog and changelog construction code into store (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

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

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

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):



To: durin42, #hg-reviewers, indygreg, pulkit
Cc: indygreg, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel