revert to the orginal value the last patch modified.
Raise ValueError if no such original value exists.
def revert(namespace, name):
origin:<UNKNOWN>
where:
exceptions that might appear during execution:
function source:
def revert(namespace, name):
""" revert to the orginal value the last patch modified.
Raise ValueError if no such original value exists.
"""
nref = (namespace, name)
if nref not in patched or not patched[nref]:
raise ValueError, "No original value stored for %s.%s" % nref
current = getattr(namespace, name)
orig = patched[nref].pop()
setattr(namespace, name, orig)
return current
called in /home/johnny/projects/merlinux/py/dist/py/magic/assertion.py
called in /home/johnny/projects/merlinux/py/dist/py/magic/assertion.py
called in /home/johnny/projects/merlinux/py/dist/py/magic/assertion.py
called in /home/johnny/projects/merlinux/py/dist/py/magic/invoke.py
called in /home/johnny/projects/merlinux/py/dist/py/magic/testing/test_patch.py
called in /home/johnny/projects/merlinux/py/dist/py/magic/assertion.py
called in /home/johnny/projects/merlinux/py/dist/py/magic/assertion.py
called in /home/johnny/projects/merlinux/py/dist/py/magic/testing/test_patch.py
called in /home/johnny/projects/merlinux/py/dist/py/magic/assertion.py
called in /home/johnny/projects/merlinux/py/dist/py/magic/assertion.py
called in /home/johnny/projects/merlinux/py/dist/py/magic/assertion.py
called in /home/johnny/projects/merlinux/py/dist/py/test/deprecate.py
called in /home/johnny/projects/merlinux/py/dist/py/magic/assertion.py
called in /home/johnny/projects/merlinux/py/dist/py/magic/assertion.py
called in /home/johnny/projects/merlinux/py/dist/py/magic/assertion.py
called in /home/johnny/projects/merlinux/py/dist/py/magic/assertion.py
called in /home/johnny/projects/merlinux/py/dist/py/magic/testing/test_patch.py
called in /home/johnny/projects/merlinux/py/dist/py/magic/assertion.py
called in /home/johnny/projects/merlinux/py/dist/py/magic/assertion.py
called in None</home/johnny/projects/merlinux/py/dist/py/test/raises.py:20>
called in /home/johnny/projects/merlinux/py/dist/py/test/deprecate.py