Patchwork D6893: sidedata: register the flag processors if the repository allows for it

login
register
mail settings
Submitter phabricator
Date Oct. 1, 2019, 6:23 p.m.
Message ID <4b6c058957c75486fe462a1fc47fca3a@localhost.localdomain>
Download mbox | patch
Permalink /patch/41917/
State Not Applicable
Headers show

Comments

phabricator - Oct. 1, 2019, 6:23 p.m.
Closed by commit rHG142deb539ccf: sidedata: register the flag processors if the repository allows for it (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6893?vs=16738&id=16765

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

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

AFFECTED FILES
  mercurial/revlog.py
  mercurial/revlogutils/flagutil.py
  mercurial/revlogutils/sidedata.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/revlogutils/sidedata.py b/mercurial/revlogutils/sidedata.py
--- a/mercurial/revlogutils/sidedata.py
+++ b/mercurial/revlogutils/sidedata.py
@@ -77,3 +77,9 @@ 
 def sidedatarawprocessor(rl, text):
     # side data modifies rawtext and prevent rawtext hash validation
     return False
+
+processors = (
+    sidedatareadprocessor,
+    sidedatawriteprocessor,
+    sidedatarawprocessor,
+)
diff --git a/mercurial/revlogutils/flagutil.py b/mercurial/revlogutils/flagutil.py
--- a/mercurial/revlogutils/flagutil.py
+++ b/mercurial/revlogutils/flagutil.py
@@ -17,6 +17,7 @@ 
     REVIDX_FLAGS_ORDER,
     REVIDX_ISCENSORED,
     REVIDX_RAWTEXT_CHANGING_FLAGS,
+    REVIDX_SIDEDATA,
 )
 
 from .. import (
@@ -29,6 +30,7 @@ 
 REVIDX_ISCENSORED
 REVIDX_ELLIPSIS
 REVIDX_EXTSTORED
+REVIDX_SIDEDATA
 REVIDX_DEFAULT_FLAGS
 REVIDX_FLAGS_ORDER
 REVIDX_RAWTEXT_CHANGING_FLAGS
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -54,6 +54,7 @@ 
     REVIDX_FLAGS_ORDER,
     REVIDX_ISCENSORED,
     REVIDX_RAWTEXT_CHANGING_FLAGS,
+    REVIDX_SIDEDATA,
 )
 from .thirdparty import (
     attr,
@@ -75,6 +76,7 @@ 
 from .revlogutils import (
     deltas as deltautil,
     flagutil,
+    sidedata as sidedatautil,
 )
 from .utils import (
     storageutil,
@@ -95,6 +97,7 @@ 
 REVLOGV2_FLAGS
 REVIDX_ISCENSORED
 REVIDX_ELLIPSIS
+REVIDX_SIDEDATA
 REVIDX_EXTSTORED
 REVIDX_DEFAULT_FLAGS
 REVIDX_FLAGS_ORDER
@@ -389,6 +392,8 @@ 
         if self._mmaplargeindex and 'mmapindexthreshold' in opts:
             mmapindexthreshold = opts['mmapindexthreshold']
         self.hassidedata = bool(opts.get('side-data', False))
+        if self.hassidedata:
+            self._flagprocessors[REVIDX_SIDEDATA] = sidedatautil.processors
         self._sparserevlog = bool(opts.get('sparse-revlog', False))
         withsparseread = bool(opts.get('with-sparse-read', False))
         # sparse-revlog forces sparse-read