[Commented On] D10797: revlog: move `revisioninfo` in `revlogutils`

baymax (Baymax, Your Personal Patch-care Companion) phabricator at mercurial-scm.org
Wed Jun 2 03:19:21 UTC 2021


baymax added a comment.
baymax updated this revision to Diff 28407.


  ✅ refresh by Heptapod after a successful CI run (🐙 💚)

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D10797?vs=28325&id=28407

BRANCH
  default

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

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

AFFECTED FILES
  mercurial/revlog.py
  mercurial/revlogutils/__init__.py
  mercurial/revlogutils/deltas.py

CHANGE DETAILS

diff --git a/mercurial/revlogutils/deltas.py b/mercurial/revlogutils/deltas.py
--- a/mercurial/revlogutils/deltas.py
+++ b/mercurial/revlogutils/deltas.py
@@ -932,7 +932,7 @@
     def buildtext(self, revinfo, fh):
         """Builds a fulltext version of a revision
 
-        revinfo: _revisioninfo instance that contains all needed info
+        revinfo: revisioninfo instance that contains all needed info
         fh:      file handle to either the .i or the .d revlog file,
                  depending on whether it is inlined or not
         """
diff --git a/mercurial/revlogutils/__init__.py b/mercurial/revlogutils/__init__.py
--- a/mercurial/revlogutils/__init__.py
+++ b/mercurial/revlogutils/__init__.py
@@ -7,6 +7,7 @@
 
 from __future__ import absolute_import
 
+from ..thirdparty import attr
 from ..interfaces import repository
 
 # See mercurial.revlogutils.constants for doc
@@ -56,3 +57,24 @@
         data_compression_mode,
         sidedata_compression_mode,
     )
+
+
+ at attr.s(slots=True, frozen=True)
+class revisioninfo(object):
+    """Information about a revision that allows building its fulltext
+    node:       expected hash of the revision
+    p1, p2:     parent revs of the revision
+    btext:      built text cache consisting of a one-element list
+    cachedelta: (baserev, uncompressed_delta) or None
+    flags:      flags associated to the revision storage
+
+    One of btext[0] or cachedelta must be set.
+    """
+
+    node = attr.ib()
+    p1 = attr.ib()
+    p2 = attr.ib()
+    btext = attr.ib()
+    textlen = attr.ib()
+    cachedelta = attr.ib()
+    flags = attr.ib()
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -167,27 +167,6 @@
 )
 
 
- at attr.s(slots=True, frozen=True)
-class _revisioninfo(object):
-    """Information about a revision that allows building its fulltext
-    node:       expected hash of the revision
-    p1, p2:     parent revs of the revision
-    btext:      built text cache consisting of a one-element list
-    cachedelta: (baserev, uncompressed_delta) or None
-    flags:      flags associated to the revision storage
-
-    One of btext[0] or cachedelta must be set.
-    """
-
-    node = attr.ib()
-    p1 = attr.ib()
-    p2 = attr.ib()
-    btext = attr.ib()
-    textlen = attr.ib()
-    cachedelta = attr.ib()
-    flags = attr.ib()
-
-
 @interfaceutil.implementer(repository.irevisiondelta)
 @attr.s(slots=True)
 class revlogrevisiondelta(object):
@@ -2533,7 +2512,15 @@
         if deltacomputer is None:
             deltacomputer = deltautil.deltacomputer(self)
 
-        revinfo = _revisioninfo(node, p1, p2, btext, textlen, cachedelta, flags)
+        revinfo = revlogutils.revisioninfo(
+            node,
+            p1,
+            p2,
+            btext,
+            textlen,
+            cachedelta,
+            flags,
+        )
 
         deltainfo = deltacomputer.finddeltainfo(revinfo, fh)
 



To: marmoute, indygreg, #hg-reviewers, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20210602/3566e859/attachment-0001.html>


More information about the Mercurial-patches mailing list