Hydrate revision with the provided puppet modules data.

@param  PuppetModule[]    $puppetModules
@param  RevisionInterface $revision
@return RevisionInterface
4375
public function hydrate($puppetModules, $revision)
    {
        if ($revision->hasGroups()) {
            foreach ($revision->getGroups() as $group) {
                $this->groupHydrator->hydrate($puppetModules, $group);
            }
        }
    }
719382
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $service = new GroupClass();

        /** @var EnvironmentInterface $environmentService */
        $environmentService = $serviceLocator->get('KmbPuppet\Service\Environment');
        $service->setEnvironmentService($environmentService);

        /** @var PuppetModuleInterface $moduleService */
        $moduleService = $serviceLocator->get('pmProxyPuppetModuleService');
        $service->setPuppetModuleService($moduleService);

        /** @var RevisionHydratorInterface $revisionHydrator */
        $revisionHydrator = $serviceLocator->get('pmProxyRevisionHydrator');
        $service->setRevisionHydrator($revisionHydrator);

        return $service;
    }
345768
public function restore( Revision $revision ) {
		$params = [
			'type' => 'revision',
			'show' => 'content',
			// Note: pre 1.24 this is a delete token, post it is csrf
			'token' => $this->api->getToken( 'delete' ),
			'ids' => $revision->getId(),
		];

		$this->api->postRequest( new SimpleRequest(
			'revisiondelete',
			$params
		) );

		return true;
	}
422673
public function setRevisionType(\ZF\Doctrine\Audit\Entity\RevisionType $revisionType)
    {
        $this->revisionType = $revisionType;

        return $this;
    }
858692
private function getTokenForRevision( Revision $revision ) {
		$result = $this->api->postRequest(
			new SimpleRequest(
				'query', [
				'prop' => 'revisions',
				'revids' => $revision->getId(),
				'rvtoken' => 'rollback',
			]
			)
		);
		$result = array_shift( $result['query']['pages'] );

		return $result['revisions'][0]['rollbacktoken'];
	}
1044671
public function restore($revision)
    {
        $revision = $this->revisions->find(array('revisionNum' => $revision->revisionNum));

        if ($revision) {
            $this->__restored = true;
            $this->setData(array(
                'name' => $revision->title,
                'body' => $revision->description,
                'exceprt' => $revision->excerpt,
            ), AnDomain::ACCESS_PROTECTED);
        }
    }
202014
private function createEntityCacheKey(ClassMetadata $classMetadata, array $data, $revision)
    {
        $keyParts = array();

        foreach ($classMetadata->getIdentifierFieldNames() as $name) {
            if ($classMetadata->hasAssociation($name)) {
                if ($classMetadata->isSingleValuedAssociation($name)) {
                    $name = $classMetadata->getSingleAssociationJoinColumnName($name);
                } else {
                    // Doctrine should throw a mapping exception if an identifier
                    // that is an association is not single valued, but just in case.
                    throw new \RuntimeException('Multiple valued association identifiers not supported');
                }
            }
            $keyParts[] = $data[$name];
        }

        return $classMetadata->name . '_' . implode('_', $keyParts) . '_' . $revision;
    }
896644
public function restore($file, $revision)
    {
        $call = 'restore/' . $this->root . '/' . $this->encodePath($file);
        $params = array('rev' => $revision);
        $response = $this->fetch('POST', self::API_URL, $call, $params);
        return $response;
    }
1079601
def merge(config, revisions, **kwargs):
    
    with alembic_lock(
        config.registry["sqlalchemy.engine"], config.alembic_config()
    ) as alembic_config:
        alembic.command.merge(alembic_config, revisions, **kwargs)
641252
public function historyRevertAction($revision)
    {
        /** @var AbstractAdmin $admin */
        $admin = $this->getAdmin();

        $admin->checkAccess('edit');

        $request = $this->getRequest();

        $id = $request->get($admin->getIdParameter());

        $object = $admin->getObject($id);

        if (!$object) {
            throw new NotFoundHttpException(sprintf('unable to find the object with id : %s', $id));
        }

        if ('POST' === $request->getMethod()) {
            // check the csrf token
            $this->validateCsrfToken('sonata.history.revert');

            $entityClass = $admin->getClass();

            $translator = $this->get('translator');

            try {
                $manager = $this->get('sonata.admin.audit.manager');

                if (!$manager->hasReader($entityClass)) {
                    throw new NotFoundHttpException(sprintf('unable to find the audit reader for class : %s', $entityClass));
                }

                $reader = $manager->getReader($entityClass);

                $reader->revert($object, $revision);

                if ($this->isXmlHttpRequest()) {
                    return $this->renderJson(['result' => 'ok']);
                }

                $this->addFlash('sonata_flash_info', $translator->trans('flash_history_revert_successfull', []));
            } catch (\Exception $e) {
                if ($this->isXmlHttpRequest()) {
                    return $this->renderJson(['result' => 'error']);
                }

                $this->addFlash('sonata_flash_info', $translator->trans('flash_history_revert_error', []));
            }

            return new RedirectResponse($admin->generateUrl('list'));
        }

        return $this->renderWithExtraParams('@CompoSonataAdmin/CRUD/history_revert.html.twig', [
            'object' => $object,
            'revision' => $revision,
            'action' => 'revert',
            'csrf_token' => $this->getCsrfToken('sonata.history.revert'),
        ]);
    }
69298
public function setRevisions(array $revisions)
    {
        $this->revisions = new ArrayCollection();

        /** @var \Rcm\Entity\Revision $revision */
        foreach ($revisions as $revision) {
            if (!$revision instanceof Revision) {
                throw new InvalidArgumentException(
                    "Invalid Revision passed in.  Unable to set array"
                );
            }

            $this->revisions->set($revision->getRevisionId(), $revision);
        }
    }
818973
def query_revisions_by_revids(session, revids, **params):
    
    doc = session.get(action='query', prop='revisions',
                      revids=revids, **params)

    for page_doc in doc['query'].get('pages', {}).values():
        revisions = page_doc.get('revisions', [])
        if 'revisions' in page_doc:
            del page_doc['revisions']

        for revision_doc in revisions:
            revision_doc['page'] = page_doc
            yield revision_doc
841003
@Get("/projects/{projectName}/repos/{repoName}/merge")
    public <T> CompletableFuture<?> mergeFiles(
            @Param("revision") @Default("-1") String revision, Repository repository,
            @RequestConverter(MergeQueryRequestConverter.class) MergeQuery<T> query) {
        return repository.mergeFiles(new Revision(revision), query).thenApply(DtoConverter::convert);
    }
969872
public function deleteRevision($contentId, $revisionId)
    {
        $this->loadModel('Content.ContentRevisions');
        $revision = $this->ContentRevisions->find()
            ->where(['id' => $revisionId, 'content_id' => $contentId])
            ->first();

        if ($this->ContentRevisions->delete($revision, ['atomic' => true])) {
            $this->Flash->success(__d('content', 'Revision was successfully removed!'));
        } else {
            $this->Flash->danger(__d('content', 'Unable to remove this revision, please try again.'));
        }

        $this->title(__d('content', 'Editing Content Revision'));
        $this->redirect($this->referer());
    }
981079
public function getExtendedMetadata($revision = null)
	{
		// Without revision, use current info
		if (!isset($revision)) {
			return $this->info['extmetadata'];
		}

		// Obtain the properties of the revision
		if (($info = $this->getRevision($revision)) === null) {
			return null;
		}

		return $info['extmetadata'];
	}
199972
public function revisionAction()
    {
        $revisionId = (int)$this->getEvent()->getRouteMatch()->getParam('revisionId');

        $revision = \SoliantEntityAudit\Module::getModuleOptions()->getEntityManager()
            ->getRepository('SoliantEntityAudit\\Entity\\Revision')
            ->find($revisionId);

        if (!$revision)
            return $this->plugin('redirect')->toRoute('audit');

        return array(
            'revision' => $revision,
        );
    }
1094135
public function deleteFromRevision( Revision $revision, array $extraParams = [] ) {
		$this->api->postRequest( new SimpleRequest(
			'delete',
			$this->getDeleteParams( $revision->getPageIdentifier(), $extraParams )
		) );
		return true;
	}