Commit 81184b5f authored by Jérome Perrin's avatar Jérome Perrin Committed by Arnaud Fontaine

patches: modernize OFSHistory patch

parent 46966cdb
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
############################################################################## ##############################################################################
from OFS.History import HystoryJar, historicalRevision from OFS.History import HystoryJar
""" """
Rationale for this patch: Rationale for this patch:
...@@ -24,22 +24,10 @@ Zope (ex: 2.12 reading 2.8 PythonScript). ...@@ -24,22 +24,10 @@ Zope (ex: 2.12 reading 2.8 PythonScript).
Launchpad bug opened, patch submitted: Launchpad bug opened, patch submitted:
https://bugs.launchpad.net/zope2/+bug/735999 https://bugs.launchpad.net/zope2/+bug/735999
"""
# Original function lines removed by this patch are present but commented-out. Updated version at
def patched_historicalRevision(self, serial): https://github.com/zopefoundation/Zope/pull/1086
state=self._p_jar.oldstate(self, serial)
rev=self.__class__.__basicnew__()
# rev._p_jar=HystoryJar(self._p_jar)
rev._p_oid=self._p_oid
# rev._p_serial=serial
rev.__setstate__(state)
# rev._p_changed=0
# PATCH ADDITION BEGIN
rev._p_serial=serial
rev._p_jar=HystoryJar(self._p_jar)
# PATCH ADDITION END
return rev
historicalRevision.__code__ = patched_historicalRevision.__code__ """
HystoryJar.register = HystoryJar.abort
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment