Patchwork D5560: revlog: rename v to versionflags

login
register
mail settings
Submitter phabricator
Date Jan. 13, 2019, 3:27 a.m.
Message ID <306843d1e169578dbeb34c70b8aeade3@localhost.localdomain>
Download mbox | patch
Permalink /patch/37696/
State Not Applicable
Headers show

Comments

phabricator - Jan. 13, 2019, 3:27 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG6439cefaeb64: revlog: rename v to versionflags (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5560?vs=13156&id=13192

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

AFFECTED FILES
  mercurial/revlog.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -388,13 +388,13 @@ 
 
         if 'revlogv2' in opts:
             # version 2 revlogs always use generaldelta.
-            v = REVLOGV2 | FLAG_GENERALDELTA | FLAG_INLINE_DATA
+            versionflags = REVLOGV2 | FLAG_GENERALDELTA | FLAG_INLINE_DATA
         elif 'revlogv1' in opts:
-            v = REVLOGV1 | FLAG_INLINE_DATA
+            versionflags = REVLOGV1 | FLAG_INLINE_DATA
             if 'generaldelta' in opts:
-                v |= FLAG_GENERALDELTA
+                versionflags |= FLAG_GENERALDELTA
         else:
-            v = REVLOG_DEFAULT_VERSION
+            versionflags = REVLOG_DEFAULT_VERSION
 
         if 'chunkcachesize' in opts:
             self._chunkcachesize = opts['chunkcachesize']
@@ -431,9 +431,9 @@ 
             raise error.RevlogError(_('revlog chunk cache size %r is not a '
                                       'power of 2') % self._chunkcachesize)
 
-        self._loadindex(v, mmapindexthreshold)
-
-    def _loadindex(self, v, mmapindexthreshold):
+        self._loadindex(versionflags, mmapindexthreshold)
+
+    def _loadindex(self, versionflags, mmapindexthreshold):
         indexdata = ''
         self._initempty = True
         try:
@@ -444,17 +444,17 @@ 
                 else:
                     indexdata = f.read()
             if len(indexdata) > 0:
-                v = versionformat_unpack(indexdata[:4])[0]
+                versionflags = versionformat_unpack(indexdata[:4])[0]
                 self._initempty = False
         except IOError as inst:
             if inst.errno != errno.ENOENT:
                 raise
 
-        self.version = v
-        self._inline = v & FLAG_INLINE_DATA
-        self._generaldelta = v & FLAG_GENERALDELTA
-        flags = v & ~0xFFFF
-        fmt = v & 0xFFFF
+        self.version = versionflags
+        self._inline = versionflags & FLAG_INLINE_DATA
+        self._generaldelta = versionflags & FLAG_GENERALDELTA
+        flags = versionflags & ~0xFFFF
+        fmt = versionflags & 0xFFFF
         if fmt == REVLOGV0:
             if flags:
                 raise error.RevlogError(_('unknown flags (%#04x) in version %d '