Remove specified revision.
If it's the current revision, another current revision should be recreate from last released revision.

@param RevisionInterface $revision
@throws \Zend\Db\Exception\ExceptionInterface
@return RevisionService
182140
public function remove(RevisionInterface $revision)
    {
        $connection = $this->revisionRepository->getDbAdapter()->getDriver()->getConnection()->beginTransaction();
        try {
            $this->revisionRepository->remove($revision);
            if ($revision->getReleasedAt() == null) {
                $lastReleasedRevision = $revision->getEnvironment()->getLastReleasedRevision();
                $this->revisionRepository->add(clone $lastReleasedRevision);
            }
        } catch (ExceptionInterface $e) {
            $connection->rollback();
            throw $e;
        }
        $connection->commit();
        return $this;
    }
1214032
public function postDelete()
    {
        RevisionRepository::create([
            'revisionable_type' => get_class($this),
            'revisionable_id'   => $this->getKey(),
            'key'               => 'deleted_at',
            'old_value'         => null,
            'new_value'         => new DateTime(),
            'user_id'           => $this->getUserId(),
        ]);
    }
422673
public function setRevisionType(\ZF\Doctrine\Audit\Entity\RevisionType $revisionType)
    {
        $this->revisionType = $revisionType;

        return $this;
    }
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'];
	}
134576
public function writeRevision()
    {
        if ($this->syncCommit) {
            $localRevision = $this->syncCommit;
        } else {
            $localRevision = $this->git->localRevision()[0];
        }

        try {
            $this->bridge->put($localRevision, $this->revisionFile);
        }
        catch (Exception $e) {
            throw new Exception("Could not update the revision file on server: {$e->getMessage()}");
        }
    }
164583
public function delete($id = null)
    {
        if ($this->read_only) {
            throw new Exception(['Model is read-only and cannot be deleted']);
        }

        if ($id == $this->id) {
            $id = null;
        }

        return $this->atomic(function () use ($id) {
            if ($id) {
                $c = clone $this;
                $c->load($id)->delete();

                return $this;
            } elseif ($this->loaded()) {
                if ($this->hook('beforeDelete', [$this->id]) === false) {
                    return $this;
                }
                $this->persistence->delete($this, $this->id);
                $this->hook('afterDelete', [$this->id]);
                $this->unload();

                return $this;
            } else {
                throw new Exception(['No active record is set, unable to delete.']);
            }
        });
    }
1314704
public function removeAdjustment(AdjustmentInterface $adjustment)
    {
        if ($this->hasAdjustment($adjustment)) {
            $this->adjustmentsTotal = null;
            $adjustment->setAdjustable(null);
            $this->adjustments->removeElement($adjustment);
        }

        return $this;
    }
1248490
public function getUserId($revision = null)
	{
		// Without revision, use current info
		if (!isset($revision)) {
			return (int)$this->info['userid'];
		}

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

		return (int)$info['userid'];
	}
373044
public function rollback( Revision $revision, Title $title = null ) {
		$this->api->postRequest(
			new SimpleRequest( 'rollback', $this->getRollbackParams( $revision, $title ) )
		);

		return true;
	}
427138
public function removeVersion($documentVersion)
    {
        $oid = spl_object_hash($documentVersion);
        $history = $this->documentHistory[$oid];
        $version = $this->documentVersion[$oid];

        $history->removeVersion($version->getName());

        unset($this->documentVersion[$oid], $this->documentHistory[$oid]);
    }
772216
public function getMetadata($revision = null)
	{
		// Without revision, use current info
		if (!isset($revision)) {
			return $this->info['metadata'];
		}

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

		return $info['metadata'];
	}
398058
public function getAction(Revision $revision)
    {
        $this->granted('VIEW', $revision->getContent());

        $response = $this->createJsonResponse();
        $response->setData($revision->jsonSerialize(Revision::JSON_REVISION_FORMAT));

        return $response;
    }
1094135
public function deleteFromRevision( Revision $revision, array $extraParams = [] ) {
		$this->api->postRequest( new SimpleRequest(
			'delete',
			$this->getDeleteParams( $revision->getPageIdentifier(), $extraParams )
		) );
		return true;
	}
902325
public Response remove() {
        assertNotEmpty(replicatorDoc.getId(), "Doc id");
        assertNotEmpty(replicatorDoc.getRevision(), "Doc rev");
        final URI uri = new DatabaseURIHelper(dbURI).path(replicatorDoc.getId())
                .query("rev", replicatorDoc.getRevision()).build();
        return client.delete(uri);
    }
735710
public function delete($documentId, $rev)
    {
        $context = array('http' => array());
        $context['http']['method'] = 'DELETE';

        list($status, $response) = $this->sendRequest($documentId . '?rev=' . $rev, $context);
        unset($response);

        if ($status != 200) {
            throw new Exception\Response('DELETE - Unknown response status.');
        }

        if ($this->getCache($documentId)) {
            unset($this->cache[$documentId]);
        }

        return true;
    }
663693
private function _commitObject($id, $revision)
    {
        $update = '';
        //if version tracking is disabled, delete previous revisions of the object
        if (!$this->_options->versionTracking) {
            $update .= Statement::get(
                'DELETE_OBJECT_EXCEPT_REVISION',
                [
                    '@collection' => $this->_name,
                    '@id' => $this->_connector->quote($id),
                    '@revision' => $this->_connector->quote($revision)
                ]
            );
        }
        $update .= Statement::get(
            'UPDATE_OBJECT_TO_COMMITTED',
            [
                '@collection' => $this->_name,
                '@id' => $this->_connector->quote($id),
                '@revision' => $this->_connector->quote($revision)
            ]
        );

        $this->_connector->exec($update);
    }
509748
def remove_revision(index)
            if index < 0 or index > @revisions.size
                raise IndexError, "Not a valid revision index"
            end

            if @revisions.size == 1
                raise InvalidPDFError, "Cannot remove last revision"
            end

            @revisions.delete_at(index)
            self
        end