Ported RevisionInternal changes.
Ported RevisionInternal changes.