Show the detail for a specific revision entity
183265
public function revisionEntityAction()
    {
        $this->mapAllAuditedClasses();

        $page = (int)$this->getEvent()->getRouteMatch()->getParam('page');
        $revisionEntityId = (int) $this->getEvent()->getRouteMatch()->getParam('revisionEntityId');

        $revisionEntity = \SoliantEntityAudit\Module::getModuleOptions()->getEntityManager()
            ->getRepository('SoliantEntityAudit\\Entity\\RevisionEntity')->find($revisionEntityId);

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

        $repository = \SoliantEntityAudit\Module::getModuleOptions()->getEntityManager()
            ->getRepository('SoliantEntityAudit\\Entity\\RevisionEntity');

        return array(
            'page' => $page,
            'revisionEntity' => $revisionEntity,
            'auditService' => $this->getServiceLocator()->get('auditService'),
        );
    }
1249094
def get_document_revision(id)
    login! unless logged_in?
    json = <<-EOF
      {
        "session": "#{@sugar_session_id}",
        "id": "#{id}"
      }
    EOF
    json.gsub!(/^\s{6}/,'')
    SugarCRM::Response.handle(send!(:get_document_revision, json), @session)
  end
325450
public function getRevision() : ?string 
    {
        if ( ! $this->hasRevision()) {
            $this->setRevision($this->getDefaultRevision());
        }
        return $this->revision;
    }
858861
def _show_details(self):
        """"""
        if self.details.isVisible():
            self.details.hide()
            self.details_btn.setText(_('Show details'))
        else:
            self.resize(570, 700)
            self.details.document().setPlainText('')
            self.details.append_text_to_shell(self.error_traceback,
                                              error=True,
                                              prompt=False)
            self.details.show()
            self.details_btn.setText(_('Hide details'))
321881
public function getFromRevision( Revision $revision, array $extraParams = [] ) {
		$result =
			$this->api->getRequest(
				new SimpleRequest(
					'query',
					$this->getQuery( [ 'revids' => $revision->getId() ], $extraParams )
				)
			);
		$revisions = $this->getRevisionsFromResult( array_shift( $result['query']['pages'] ) );
		$revisions->addRevision( $revision );

		return new Page(
			new PageIdentifier(
				new Title(
					$result['title'],
					$result['ns']
				),
				$result['pageid']
			),
			$revisions
		);
	}
959687
public static void logVersionInfo(Detail detail){

        List<VersionInfo> info = getVersionInfos();

        for(VersionInfo grp : info){
            switch (detail){
                case GAV:
                    log.info("{} : {} : {}", grp.getGroupId(), grp.getArtifactId(), grp.getBuildVersion());
                    break;
                case GAVC:
                    log.info("{} : {} : {} - {}", grp.getGroupId(), grp.getArtifactId(), grp.getBuildVersion(),
                            grp.getCommitIdAbbrev());
                    break;
                case FULL:
                    log.info("{} : {} : {} - {}, buildTime={}, buildHost={} branch={}, commitMsg={}", grp.getGroupId(), grp.getArtifactId(),
                            grp.getBuildVersion(), grp.getCommitId(), grp.getBuildTime(), grp.getBuildHost(),
                            grp.getBranch(), grp.getCommitMessageShort());
                    break;
            }
        }
    }
438148
def _add_details(self, info):
        """"""
        for (key, val) in six.iteritems(info):
            if key == "nodes":
                val = [Node(parent=self, **nd) for nd in val]
            elif key == "sessionPersistence":
                val = val['persistenceType']
            elif key == "cluster":
                val = val['name']
            elif key == "virtualIps":
                key = "virtual_ips"
                val = [VirtualIP(parent=self, **vip) for vip in val]
            setattr(self, key, val)
724860
public List<Timestamp> getRevisionTimestampsBeforeRevision(final int revisionId)
        throws WikiApiException
    {
        List<Timestamp> timestamps = new LinkedList<Timestamp>();

        int articleID = getPageIdForRevisionId(revisionId); // TODO do this in the SQL query
        Timestamp ts = getRevision(revisionId).getTimeStamp(); // TODO do this in the SQL query

        try {
            PreparedStatement statement = null;
            ResultSet result = null;

            try {
                // Check if necessary index exists
                if (!indexExists("revisions")) {
                    throw new WikiInitializationException(
                            "Please create an index on revisions(ArticleID) in order to make this query feasible.");
                }

                statement = connection
                        .prepareStatement("SELECT Timestamp FROM revisions WHERE ArticleID=? AND Timestamp < ?");
                statement.setInt(1, articleID);
                statement.setLong(2, ts.getTime());
                result = statement.executeQuery();

                // Make the query
                if (result == null) {
                    throw new WikiPageNotFoundException("The article with the ID " + articleID
                            + " was not found.");
                }
                while (result.next()) {
                    timestamps.add(new Timestamp(result.getLong(1)));
                }
            }
            finally {
                if (statement != null) {
                    statement.close();
                }
                if (result != null) {
                    result.close();
                }
            }

            return timestamps;

        }
        catch (WikiApiException e) {
            throw e;
        }
        catch (Exception e) {
            throw new WikiApiException(e);
        }
    }
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,
        );
    }
212750
def get_detailed_update(self, uid, uuid):
		""""""
		
		r = requests.get(api_url+'users/'+str(uid)+'/update/'+str(uuid)+'/', headers=self.headers)
		print(request_status(r))
		r.raise_for_status()
		return Update(r.json())
895974
private function getEditParams( Revision $revision, EditInfo $editInfo = null ) {
		if ( !$revision->getPageIdentifier()->identifiesPage() ) {
			throw new RuntimeException( '$revision PageIdentifier does not identify a page' );
		}

		$params = [];

		$content = $revision->getContent();
		$data = $content->getData();
		if ( !is_string( $data ) ) {
			throw new RuntimeException( 'Dont know how to save content of this model.' );
		}
		$params['text'] = $content->getData();
		$params['md5'] = md5( $content->getData() );

		$timestamp = $revision->getTimestamp();
		if ( !is_null( $timestamp ) ) {
			$params['basetimestamp'] = $timestamp;
		}

		if ( !is_null( $revision->getPageIdentifier()->getId() ) ) {
			$params['pageid'] = $revision->getPageIdentifier()->getId();
		} else {
			$params['title'] = $revision->getPageIdentifier()->getTitle()->getTitle();
		}

		$params['token'] = $this->api->getToken();

		if ( $this->api->isLoggedin() ) {
			$params['assert'] = 'user';
		}

		$this->addEditInfoParams( $editInfo, $params );

		return $params;
	}
649838
def show_item(name, id_):
    '''
    
    '''
    status, result = _query(action=name, command=id_)
    return result
587975
def __summary(self):
        """"""
        text = "Time: %s\n" % self.when
        text += "Comitter: %s\n" % self.editor

        inst = self.timemachine.presently

        if self.action_type == "dl":
            text += "Deleted %s\n" % inst._object_type_text()
        elif self.action_type == "cr":
            text += "Created %s\n" % inst._object_type_text()
        else:
            text += "Modified %s\n" % inst._object_type_text()
        text += self._details(nohtml=True)
        return text
685686
public function revisionShow($openy_upgrade_log_revision) {
    $openy_upgrade_log = $this->entityManager()->getStorage('openy_upgrade_log')->loadRevision($openy_upgrade_log_revision);
    $view_builder = $this->entityManager()->getViewBuilder('openy_upgrade_log');

    return $view_builder->view($openy_upgrade_log);
  }
734608
def ver(self, revision):
        """"""

        c = self.clone()

        c.version = self._parse_version(self.version)

        return c
1135717
@InterfaceAudience.Private
    public void pullRemoteRevision(final RevisionInternal rev) {

        Log.d(TAG, "%s: pullRemoteRevision with rev: %s", this, rev);

        ++httpConnectionCount;

        // Construct a query. We want the revision history, and the bodies of attachments that have
        // been added since the latest revisions we have locally.
        // See: http://wiki.apache.org/couchdb/HTTP_Document_API#Getting_Attachments_With_a_Document
        StringBuilder path = new StringBuilder(encodeDocumentId(rev.getDocID()));
        path.append("?rev=").append(URIUtils.encode(rev.getRevID()));
        path.append("&revs=true");

        // TODO: CBL Java does not have implementation of _settings yet. Till then, attachments always true
        boolean attachments = true;
        if (attachments)
            path.append("&attachments=true");

        // Include atts_since with a list of possible ancestor revisions of rev. If getting attachments,
        // this allows the server to skip the bodies of attachments that have not changed since the
        // local ancestor. The server can also trim the revision history it returns, to not extend past
        // the local ancestor (not implemented yet in SG but will be soon.)
        AtomicBoolean haveBodies = new AtomicBoolean(false);
        List<String> possibleAncestors = null;
        possibleAncestors = db.getPossibleAncestorRevisionIDs(rev,
                PullerInternal.MAX_NUMBER_OF_ATTS_SINCE, attachments ? haveBodies : null, true);
        if (possibleAncestors != null) {
            path.append(haveBodies.get() ? "&atts_since=" : "&revs_from=");
            path.append(joinQuotedEscaped(possibleAncestors));
        } else {
            int maxRevTreeDepth = getLocalDatabase().getMaxRevTreeDepth();
            if (rev.getGeneration() > maxRevTreeDepth) {
                path.append("&revs_limit=");
                path.append(maxRevTreeDepth);
            }
        }

        //create a final version of this variable for the log statement inside
        //FIXME find a way to avoid this
        final String pathInside = path.toString();
        CustomFuture future = sendAsyncMultipartDownloaderRequest("GET", pathInside,
                null, db, new RemoteRequestCompletion() {

                    @Override
                    public void onCompletion(RemoteRequest remoteRequest, Response httpResponse, Object result, Throwable e) {
                        if (e != null) {
                            Log.w(TAG, "Error pulling remote revision: %s", e, this);
                            if (Utils.isDocumentError(e)) {
                                // Revision is missing or not accessible:
                                revisionFailed(rev, e);
                            } else {
                                // Request failed:
                                setError(e);
                            }
                        } else {

                            Map<String, Object> properties = (Map<String, Object>) result;
                            long size = 0;
                            if (httpResponse != null && httpResponse.body() != null)
                                size = httpResponse.body().contentLength();
                            PulledRevision gotRev = new PulledRevision(properties, size);
                            gotRev.setSequence(rev.getSequence());

                            Log.d(TAG, "%s: pullRemoteRevision add rev: %s to batcher: %s",
                                    PullerInternal.this, gotRev, downloadsToInsert);

                            // NOTE: should not/not necessary to call Body.compact()
                            // new PulledRevision(Map<string, Object>) creates Body instance only
                            // with `object`. Serializing object to json causes two unnecessary
                            // JSON serializations.

                            if (gotRev.getBody() != null)
                                queuedMemorySize.addAndGet(gotRev.getBody().getSize());

                            // Add to batcher ... eventually it will be fed to -insertRevisions:.
                            downloadsToInsert.queueObject(gotRev);

                            // if queue memory size is more than maximum, force flush the queue.
                            if (queuedMemorySize.get() > MAX_QUEUE_MEMORY_SIZE) {
                                Log.d(TAG, "Flushing  queued memory size at: " + queuedMemorySize);
                                downloadsToInsert.flushAllAndWait();
                            }
                        }

                        // Note that we've finished this task:
                        --httpConnectionCount;

                        // Start another task if there are still revisions waiting to be pulled:
                        pullRemoteRevisions();
                    }
                });
        future.setQueue(pendingFutures);
        pendingFutures.add(future);
    }
302107
def action_display(self):
        ''''''
        action = self['action']
        annotations = []
        abbr = self.bill[settings.LEVEL_FIELD]
        if 'related_entities' in self:
            for entity in self['related_entities']:
                name = entity['name']
                _id = entity['id']

                # If the importer couldn't ID the entity,
                # skip.
                if _id is None:
                    continue
                url = mongoid_2_url(abbr, _id)
                link = '<a href="%s">%s</a>' % (url, name)
                if name in action:
                    action = action.replace(entity['name'], link)
                else:
                    annotations.append(link)
            if annotations:
                action += ' (%s)' % ', '.join(annotations)
        return action