# HG changeset patch
# User Boris Feld <boris.f...@octobus.net>
# Date 1517850280 -3600
#      Mon Feb 05 18:04:40 2018 +0100
# Node ID 70bf9e3148bf504164f1e5c3a40c92ced158e921
# Parent  6e3ed0354bf4f160bb7e1402ca1548282ba8b772
# EXP-Topic revlog-fp
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
70bf9e3148bf
revlog: rename 'self.checkinlinesize' into '_enforceinlinesize'

The name change has two motivations:

1) The function has no external caller, so we move it to protected space.
2) the function does more than checking it also split the data if we have more
   data than 'inline' supports.

diff --git a/mercurial/changelog.py b/mercurial/changelog.py
--- a/mercurial/changelog.py
+++ b/mercurial/changelog.py
@@ -432,7 +432,7 @@ class changelog(revlog.revlog):
             self._delaybuf = None
         self._divert = False
         # split when we're done
-        self.checkinlinesize(tr)
+        self._enforceinlinesize(tr)
 
     def _writepending(self, tr):
         "create a file containing the unfinalized state for pretxnchangegroup"
@@ -458,9 +458,9 @@ class changelog(revlog.revlog):
 
         return False
 
-    def checkinlinesize(self, tr, fp=None):
+    def _enforceinlinesize(self, tr, fp=None):
         if not self._delayed:
-            revlog.revlog.checkinlinesize(self, tr, fp)
+            revlog.revlog._enforceinlinesize(self, tr, fp)
 
     def read(self, node):
         """Obtain data from a parsed changelog revision.
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1834,7 +1834,7 @@ class revlog(object):
             raise RevlogError(_("integrity check failed on %s:%s")
                 % (self.indexfile, pycompat.bytestr(revornode)))
 
-    def checkinlinesize(self, tr, fp=None):
+    def _enforceinlinesize(self, tr, fp=None):
         """Check if the revlog is too big for inline and convert if so.
 
         This should be called after revisions are added to the revlog. If the
@@ -2145,7 +2145,7 @@ class revlog(object):
             ifh.write(entry)
             ifh.write(data[0])
             ifh.write(data[1])
-            self.checkinlinesize(transaction, ifh)
+            self._enforceinlinesize(transaction, ifh)
 
     def addgroup(self, deltas, linkmapper, transaction, addrevisioncb=None):
         """
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to