Patchwork [12,of,18,"] revlog: add some documentation to the `checksize` method

login
register
mail settings
Submitter Pierre-Yves David
Date March 6, 2019, 4:29 p.m.
Message ID <2b4470cd927234cd0280.1551889768@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/39101/
State Accepted
Headers show

Comments

Pierre-Yves David - March 6, 2019, 4:29 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1551877647 -3600
#      Wed Mar 06 14:07:27 2019 +0100
# Node ID 2b4470cd927234cd028051e8ddee77dee82dccec
# Parent  a09dc0dcd48c837b278e3603d05fd1036222cff9
# EXP-Topic verify
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 2b4470cd9272
revlog: add some documentation to the `checksize` method

I had to look at it, so I figured I would leave some documentation for the next
person seeking information.

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -2272,6 +2272,14 @@  class revlog(object):
         self._nodepos = None
 
     def checksize(self):
+        """Check size of index and data files
+
+        return a (dd, di) tuple.
+        - dd: extra bytes for the "data" file
+        - di: extra bytes for the "index" file
+
+        A healthy revlog will return (0, 0).
+        """
         expected = 0
         if len(self):
             expected = max(0, self.end(len(self) - 1))