Creates new revision.

@return ComArticlesDomainEntityRevision
973489
public function addNewRevision()
    {
        return $this->revisions->addNew(array(
            'component' => $this->component,
            'author' => get_viewer(),
            'owner' => $this->owner,
            'title' => $this->title,
            'description' => $this->description,
            'excerpt' => $this->excerpt,
            'revisionNum' => (int) $this->revisions->fetchValue('MAX(@col(revisionNum))') + 1,
        ));
    }
459463
private Revision uncachedHeadRevision() {
        try (RevWalk revWalk = new RevWalk(jGitRepository)) {
            final ObjectId headRevisionId = jGitRepository.resolve(R_HEADS_MASTER);
            if (headRevisionId != null) {
                final RevCommit revCommit = revWalk.parseCommit(headRevisionId);
                return CommitUtil.extractRevision(revCommit.getFullMessage());
            }
        } catch (CentralDogmaException e) {
            throw e;
        } catch (Exception e) {
            throw new StorageException("failed to get the current revision", e);
        }

        throw new StorageException("failed to determine the HEAD: " + jGitRepository.getDirectory());
    }
821472
public function setRevision($revision)
    {
        if (!in_array((int) $revision, self::REVISION)) {
            throw new InvalidArgumentException(sprintf(
                'The value "%s" is not a recognized revision number. Allowed revisions are: %s',
                $revision,
                implode(', ', self::REVISION)
            ));
        }
        $this->revision = (int) $revision;

        return $this;
    }
794992
protected function makeNewContainer()
    {
        $container = new Container();
        $container->classSet($this->entityClass);
        $container->setPropertyMapper( PropertyMapperEntityData::class );
        return $container;
    }
601288
public function createCredit()
    {
        $copy = $this->copy();
        $detailsCopy = new $this->details;
        foreach ($copy->details as $detail) {
            $detail->setData(array(
                'amount' => $detail->amount * -1
            ));
            $detailsCopy->append($detail);
        }
        $copy->setData(array(
            'details' => $detailsCopy
        ));
        return $copy;
    }
1030599
public function isObjRevisionable()
    {
        if ($this->isObjRevisionable === null) {
            // Overridden by permissions
            if (!$this->checkPermission('revision') || !$this->form()) {
                $this->isObjRevisionable = false;
            } else {
                $obj = $this->form()->obj();
                if (!$obj->id()) {
                    $this->isObjRevisionable = false;
                    return $this->isObjRevisionable;
                }

                if ($obj instanceof RevisionableInterface && $obj->revisionEnabled()) {
                    $this->isObjRevisionable = !!count($obj->allRevisions());
                }
            }
        }

        return $this->isObjRevisionable;
    }
413714
public static function create()
    {
        $ob = new stdClass;
        $ob->value = self::DEFAULT_CONTENT_TYPE;

        return new self(null, $ob);
    }
798076
function createTemporaryVersion()
    {
        $db = eZDB::instance();
        $db->begin();

        $newRole = eZRole::createNew();
        $this->copyPolicies( $newRole->attribute( 'id' ) );
        $newRole->setAttribute( 'name', $this->attribute( 'name' ) );
        $newRole->setAttribute( 'version', $this->attribute( 'id' ) );
        $newRole->store();

        $db->commit();
        return $newRole;
    }
1087379
public function create()
    {
        $model = $this->repository->createModel();
        $model->permissions = [];
        $model->roles = [];

        return view('users::admin.create')
            ->with(compact('model'));
    }
673196
protected function createRelsFolderAndFile()
    {
        $this->relsFolder = $this->createFolder($this->rootFolder, self::RELS_FOLDER_NAME);

        $this->createRelsFile();

        return $this;
    }
1003231
def create_revision!
      revision_options = self.class.acts_as_revisionable_options
      revision = revision_record_class.new(self, revision_options[:encoding])
      if revision_options[:meta].is_a?(Hash)
        revision_options[:meta].each do |attribute, value|
          set_revision_meta_attribute(revision, attribute, value)
        end
      elsif revision_options[:meta].is_a?(Array)
        revision_options[:meta].each do |attribute|
          set_revision_meta_attribute(revision, attribute, attribute.to_sym)
        end
      elsif revision_options[:meta]
        set_revision_meta_attribute(revision, revision_options[:meta], revision_options[:meta].to_sym)
      end
      revision.save!
      return revision
    end
1172336
def _get_revision(self):
        
        assert self._revisions, "no migration revision exist"
        revision = self._rev or self._revisions[-1]
        # revision count must be less or equal since revisions are ordered
        assert revision in self._revisions, "invalid revision specified"
        return revision
537922
public function viewRevisionAction($rev)
    {
        $revision = $this->getAuditReader()->findRevision($rev);
        if (!$revision) {
            throw $this->createNotFoundException(sprintf('Revision %s not found', $rev));
        }

        $changedEntities = $this->getAuditReader()->findEntitiesChangedAtRevision($rev);

        return $this->render('SimpleThingsEntityAuditBundle:Audit:view_revision.html.twig', array(
            'revision' => $revision,
            'changedEntities' => $changedEntities,
        ));
    }
1068213
public function getReleasedRevisions()
    {
        if ($this->releasedRevisions === null) {
            $this->setReleasedRevisions($this->revisionRepository->getAllReleasedByEnvironment($this));
        }
        return $this->releasedRevisions;
    }
1183424
public function save( Revision $revision, EditInfo $editInfo = null ) {
		if( !$revision->getContent()->getData() instanceof EntityDocument ) {
			throw new RuntimeException( 'Can only save Content of EntityDocuments' );
		}

		/** @var Item|Property $entity */
		$entity = $revision->getContent()->getData();
		$serialized = $this->entitySerializer->serialize( $entity );

		$params = array(
			'data' => json_encode( $serialized )
		);

		$revId = $revision->getId();
		if( !is_null( $revId ) ) {
			$params['baserevid'] = $revId;
		}

		$entityId = $entity->getId();
		if( !is_null( $entityId ) ) {
			$params['id'] = $entityId->getSerialization();

			// Always clear so that removing elements is possible
			$params['clear'] = 'true';
			// Add more detail to the default "Cleared an entity" summary
			// Note: this is later overridden if a summary is provided in the EditInfo
			$params['summary'] = 'Edited a ' . $entity->getType();

		} else {
			$params['new'] = $entity->getType();
		}

		// If no editInfo is explicitly passed call back to the one in the revision?
		if( $editInfo === null ) {
			$editInfo = $revision->getEditInfo();
		}

		if( $editInfo->getBot() ) {
			$params['bot'] = true;
		}
		if( $editInfo->getMinor() ) {
			$params['minor'] = true;
		}
		$summary = $editInfo->getSummary();
		if( !empty( $summary ) ) {
			$params['summary'] = $summary;
		}

		$result = $this->api->postRequest( 'wbeditentity', $params, $editInfo );
		return $this->entityDeserializer->deserialize( $result['entity'] );
	}
735745
public String getRevision()
        throws MojoExecutionException
    {

        if ( format != null && !useScm )
        {
            return revision;
        }
        useScm = false;

        try
        {
            return this.getScmRevision();
        }
        catch ( ScmException e )
        {
            if ( !StringUtils.isEmpty( revisionOnScmFailure ) )
            {
                getLog().warn( "Cannot get the revision information from the scm repository, proceeding with "
                    + "revision of " + revisionOnScmFailure + " : \n" + e.getLocalizedMessage() );

                setDoCheck( false );
                setDoUpdate( false );

                return revisionOnScmFailure;
            }

            throw new MojoExecutionException( "Cannot get the revision information from the scm repository : \n"
                + e.getLocalizedMessage(), e );

        }

    }
1141454
public function createNewVersionNode(NodeInterface $originalNode, $versionName = '')
    {
        $status = $this->statusRepository->findOneByInitial();

        /** @var NodeInterface $newNode */
        $newNode = clone $originalNode;
        $newNode->setStatus($status);
        $newNode->setVersion($this->uniqueIdGenerator->generateUniqueId());
        $this->duplicateArea($originalNode, $newNode);

        $newNode->setVersionName($versionName);
        if (empty($versionName)) {
            $newNode = $this->setVersionName($newNode);
        }


        return $newNode;
    }