D6815: flagprocessors: add a `sidedata` parameters to _processflagswrite

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

D6815: flagprocessors: add a `sidedata` parameters to _processflagswrite

martinvonz (Martin von Zweigbergk)
marmoute created this revision.
marmoute added reviewers: yuja, durin42.
Herald added a reviewer: indygreg.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  To read sidedata using flagprocessors, we need flag processors to store them. So
  we pass this information to the flag processing layer.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/remotefilelog/remotefilelog.py
  mercurial/revlog.py
  mercurial/revlogutils/flagutil.py

CHANGE DETAILS

diff --git a/mercurial/revlogutils/flagutil.py b/mercurial/revlogutils/flagutil.py
--- a/mercurial/revlogutils/flagutil.py
+++ b/mercurial/revlogutils/flagutil.py
@@ -120,7 +120,7 @@
         """
         return self._processflagsfunc(text, flags, 'read')
 
-    def _processflagswrite(self, text, flags):
+    def _processflagswrite(self, text, flags, sidedata):
         """Inspect revision data flags and applies write transformations defined
         by registered flag processors.
 
@@ -136,6 +136,7 @@
         processed text and ``validatehash`` is a bool indicating whether the
         returned text should be checked for hash integrity.
         """
+        assert not sidedata # XXX until it is actually processed
         return self._processflagsfunc(text, flags, 'write')[:2]
 
     def _processflagsraw(self, text, flags):
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1836,7 +1836,8 @@
         if flags:
             node = node or self.hash(text, p1, p2)
 
-        rawtext, validatehash = self._processflagswrite(text, flags)
+        rawtext, validatehash = self._processflagswrite(text, flags,
+                                                        sidedata=sidedata)
 
         # If the flag processor modifies the revision data, ignore any provided
         # cachedelta.
diff --git a/hgext/remotefilelog/remotefilelog.py b/hgext/remotefilelog/remotefilelog.py
--- a/hgext/remotefilelog/remotefilelog.py
+++ b/hgext/remotefilelog/remotefilelog.py
@@ -136,7 +136,8 @@
             node = storageutil.hashrevisionsha1(text, p1, p2)
 
         meta, metaoffset = storageutil.parsemeta(text)
-        rawtext, validatehash = self._processflagswrite(text, flags)
+        rawtext, validatehash = self._processflagswrite(text, flags,
+                                                        sidedata=sidedata)
         return self.addrawrevision(rawtext, transaction, linknode, p1, p2,
                                    node, flags, cachedelta,
                                    _metatuple=(meta, metaoffset))



To: marmoute, yuja, durin42, indygreg, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D6815: flagprocessors: add a `sidedata` parameters to _processflagswrite

martinvonz (Martin von Zweigbergk)
marmoute updated this revision to Diff 16481.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6815?vs=16420&id=16481

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

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

AFFECTED FILES
  hgext/remotefilelog/remotefilelog.py
  mercurial/revlog.py
  mercurial/revlogutils/flagutil.py

CHANGE DETAILS

diff --git a/mercurial/revlogutils/flagutil.py b/mercurial/revlogutils/flagutil.py
--- a/mercurial/revlogutils/flagutil.py
+++ b/mercurial/revlogutils/flagutil.py
@@ -120,7 +120,7 @@
         """
         return self._processflagsfunc(text, flags, 'read')
 
-    def _processflagswrite(self, text, flags):
+    def _processflagswrite(self, text, flags, sidedata):
         """Inspect revision data flags and applies write transformations defined
         by registered flag processors.
 
@@ -136,6 +136,7 @@
         processed text and ``validatehash`` is a bool indicating whether the
         returned text should be checked for hash integrity.
         """
+        assert not sidedata # XXX until it is actually processed
         return self._processflagsfunc(text, flags, 'write')[:2]
 
     def _processflagsraw(self, text, flags):
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1843,7 +1843,8 @@
         if flags:
             node = node or self.hash(text, p1, p2)
 
-        rawtext, validatehash = self._processflagswrite(text, flags)
+        rawtext, validatehash = self._processflagswrite(text, flags,
+                                                        sidedata=sidedata)
 
         # If the flag processor modifies the revision data, ignore any provided
         # cachedelta.
diff --git a/hgext/remotefilelog/remotefilelog.py b/hgext/remotefilelog/remotefilelog.py
--- a/hgext/remotefilelog/remotefilelog.py
+++ b/hgext/remotefilelog/remotefilelog.py
@@ -135,7 +135,8 @@
             node = storageutil.hashrevisionsha1(text, p1, p2)
 
         meta, metaoffset = storageutil.parsemeta(text)
-        rawtext, validatehash = self._processflagswrite(text, flags)
+        rawtext, validatehash = self._processflagswrite(text, flags,
+                                                        sidedata=sidedata)
         return self.addrawrevision(rawtext, transaction, linknode, p1, p2,
                                    node, flags, cachedelta,
                                    _metatuple=(meta, metaoffset))



To: marmoute, yuja, durin42, indygreg, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D6815: flagprocessors: add a `sidedata` parameters to _processflagswrite

martinvonz (Martin von Zweigbergk)
In reply to this post by martinvonz (Martin von Zweigbergk)
marmoute updated this revision to Diff 16495.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6815?vs=16481&id=16495

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

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

AFFECTED FILES
  hgext/remotefilelog/remotefilelog.py
  mercurial/revlog.py
  mercurial/revlogutils/flagutil.py

CHANGE DETAILS

diff --git a/mercurial/revlogutils/flagutil.py b/mercurial/revlogutils/flagutil.py
--- a/mercurial/revlogutils/flagutil.py
+++ b/mercurial/revlogutils/flagutil.py
@@ -120,7 +120,7 @@
         """
         return self._processflagsfunc(text, flags, 'read')
 
-    def _processflagswrite(self, text, flags):
+    def _processflagswrite(self, text, flags, sidedata):
         """Inspect revision data flags and applies write transformations defined
         by registered flag processors.
 
@@ -136,6 +136,7 @@
         processed text and ``validatehash`` is a bool indicating whether the
         returned text should be checked for hash integrity.
         """
+        assert not sidedata # XXX until it is actually processed
         return self._processflagsfunc(text, flags, 'write')[:2]
 
     def _processflagsraw(self, text, flags):
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1842,7 +1842,8 @@
         if flags:
             node = node or self.hash(text, p1, p2)
 
-        rawtext, validatehash = self._processflagswrite(text, flags)
+        rawtext, validatehash = self._processflagswrite(text, flags,
+                                                        sidedata=sidedata)
 
         # If the flag processor modifies the revision data, ignore any provided
         # cachedelta.
diff --git a/hgext/remotefilelog/remotefilelog.py b/hgext/remotefilelog/remotefilelog.py
--- a/hgext/remotefilelog/remotefilelog.py
+++ b/hgext/remotefilelog/remotefilelog.py
@@ -135,7 +135,8 @@
             node = storageutil.hashrevisionsha1(text, p1, p2)
 
         meta, metaoffset = storageutil.parsemeta(text)
-        rawtext, validatehash = self._processflagswrite(text, flags)
+        rawtext, validatehash = self._processflagswrite(text, flags,
+                                                        sidedata=sidedata)
         return self.addrawrevision(rawtext, transaction, linknode, p1, p2,
                                    node, flags, cachedelta,
                                    _metatuple=(meta, metaoffset))



To: marmoute, yuja, durin42, indygreg, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D6815: flagprocessors: add a `sidedata` parameters to _processflagswrite

martinvonz (Martin von Zweigbergk)
In reply to this post by martinvonz (Martin von Zweigbergk)
Closed by commit rHG36a0a1951d64: flagprocessors: add a `sidedata` parameters to _processflagswrite (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D6815?vs=16495&id=16635#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6815?vs=16495&id=16635

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

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

AFFECTED FILES
  hgext/remotefilelog/remotefilelog.py
  mercurial/revlog.py
  mercurial/revlogutils/flagutil.py

CHANGE DETAILS

diff --git a/mercurial/revlogutils/flagutil.py b/mercurial/revlogutils/flagutil.py
--- a/mercurial/revlogutils/flagutil.py
+++ b/mercurial/revlogutils/flagutil.py
@@ -120,7 +120,7 @@
         """
         return self._processflagsfunc(text, flags, 'read')
 
-    def _processflagswrite(self, text, flags):
+    def _processflagswrite(self, text, flags, sidedata):
         """Inspect revision data flags and applies write transformations defined
         by registered flag processors.
 
@@ -136,6 +136,7 @@
         processed text and ``validatehash`` is a bool indicating whether the
         returned text should be checked for hash integrity.
         """
+        assert not sidedata # XXX until it is actually processed
         return self._processflagsfunc(text, flags, 'write')[:2]
 
     def _processflagsraw(self, text, flags):
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1842,7 +1842,8 @@
         if flags:
             node = node or self.hash(text, p1, p2)
 
-        rawtext, validatehash = self._processflagswrite(text, flags)
+        rawtext, validatehash = self._processflagswrite(text, flags,
+                                                        sidedata=sidedata)
 
         # If the flag processor modifies the revision data, ignore any provided
         # cachedelta.
diff --git a/hgext/remotefilelog/remotefilelog.py b/hgext/remotefilelog/remotefilelog.py
--- a/hgext/remotefilelog/remotefilelog.py
+++ b/hgext/remotefilelog/remotefilelog.py
@@ -138,7 +138,8 @@
             sidedata = {}
 
         meta, metaoffset = storageutil.parsemeta(text)
-        rawtext, validatehash = self._processflagswrite(text, flags)
+        rawtext, validatehash = self._processflagswrite(text, flags,
+                                                        sidedata=sidedata)
         return self.addrawrevision(rawtext, transaction, linknode, p1, p2,
                                    node, flags, cachedelta,
                                    _metatuple=(meta, metaoffset))



To: marmoute, yuja, durin42, indygreg, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel