def oldstate(obj, tid):
    """Return copy of 'obj' that was written by transaction 'tid'.

        The returned object does not have the typical metadata (_p_jar, _p_oid,
        _p_serial) set. I'm not sure how references to other peristent objects
        are handled.

        Parameters
        obj: a persistent object from this Connection.
        tid: id of a transaction that wrote an earlier revision.

        Raises KeyError if tid does not exist or if tid deleted a revision of
        obj.
        """
