Fixed: Don't restore if the current revision is the target revision
Made code compatible with python3