[Commented On] D10601: revlog: use "entry_point" phrasing for loading the revlog

baymax (Baymax, Your Personal Patch-care Companion) phabricator at mercurial-scm.org
Tue May 4 01:55:54 UTC 2021


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


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

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D10601?vs=27378&id=27516

BRANCH
  default

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

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

AFFECTED FILES
  mercurial/revlog.py

CHANGE DETAILS

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -469,21 +469,13 @@
         new_header, mmapindexthreshold, force_nodemap = self._init_opts()
 
         if self.postfix is None:
-            index_file = b'%s.i' % self.radix
-            data_file = b'%s.d' % self.radix
-        elif self.postfix == b'a':
-            index_file = b'%s.i.a' % self.radix
-            data_file = b'%s.d' % self.radix
+            entry_point = b'%s.i' % self.radix
         else:
-            index_file = b'%s.i.%s' % (self.radix, self.postfix)
-            data_file = b'%s.d.%s' % (self.radix, self.postfix)
-
-        self._indexfile = index_file
-        self._datafile = data_file
+            entry_point = b'%s.i.%s' % (self.radix, self.postfix)
 
         indexdata = b''
         self._initempty = True
-        indexdata = self._get_data(self._indexfile, mmapindexthreshold)
+        indexdata = self._get_data(entry_point, mmapindexthreshold)
         if len(indexdata) > 0:
             header = INDEX_HEADER.unpack(indexdata[:4])[0]
             self._initempty = False
@@ -533,6 +525,13 @@
             msg %= (self._format_version, self.display_id)
             raise error.RevlogError(msg)
 
+        self._indexfile = entry_point
+
+        if self.postfix is None or self.postfix == b'a':
+            self._datafile = b'%s.d' % self.radix
+        else:
+            self._datafile = b'%s.d.%s' % (self.radix, self.postfix)
+
         self.nodeconstants = sha1nodeconstants
         self.nullid = self.nodeconstants.nullid
 



To: marmoute, indygreg, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210504/e4630b56/attachment-0002.html>


More information about the Mercurial-patches mailing list