@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Link revision from blame

Summary: I need this much more than commit but it can be useful too.

Test Plan: Displayed blame, clicked on the link.

Reviewers: epriestley

Reviewed By: epriestley

CC: john, aran, Korvin, phunt

Differential Revision: https://secure.phabricator.com/D2820

vrana a7a978d1 d6ec905f

+50
+50
src/applications/diffusion/controller/DiffusionBrowseFileController.php
··· 388 388 $commits = mpull($commits, null, 'getCommitIdentifier'); 389 389 } 390 390 391 + $revision_ids = array(); 392 + $revisions = array(); 393 + if ($commits) { 394 + $revision_ids = queryfx_all( 395 + id(new DifferentialRevision())->establishConnection('r'), 396 + 'SELECT * FROM %T WHERE commitPHID IN (%Ls)', 397 + DifferentialRevision::TABLE_COMMIT, 398 + mpull($commits, 'getPHID')); 399 + if ($revision_ids) { 400 + $revision_ids = ipull($revision_ids, 'revisionID', 'commitPHID'); 401 + $revisions = id(new DifferentialRevision())->loadAllWhere( 402 + 'id IN (%Ld)', 403 + $revision_ids); 404 + } 405 + } 406 + 391 407 $request = $this->getRequest(); 392 408 $user = $request->getUser(); 393 409 ··· 411 427 412 428 $before_link = null; 413 429 $commit_link = null; 430 + $revision_link = null; 414 431 if (idx($line, 'commit')) { 415 432 $commit = $line['commit']; 416 433 ··· 443 460 ), 444 461 phutil_escape_html(phutil_utf8_shorten($line['commit'], 9, ''))); 445 462 463 + $revision_id = idx($revision_ids, $commits[$commit]->getPHID()); 464 + if ($revision_id) { 465 + $revision = idx($revisions, $revision_id); 466 + if (!$revision) { 467 + $tooltip = '(Invalid revision)'; 468 + } else { 469 + $tooltip = 470 + phabricator_date($revision->getDateModified(), $user). 471 + " \xC2\xB7 ". 472 + $revision->getTitle(); 473 + } 474 + $revision_link = javelin_render_tag( 475 + 'a', 476 + array( 477 + 'href' => '/D'.$revision_id, 478 + 'sigil' => 'has-tooltip', 479 + 'meta' => array( 480 + 'tip' => $tooltip, 481 + 'align' => 'E', 482 + 'size' => 600, 483 + ), 484 + ), 485 + 'D'.$revision_id); 486 + } 487 + 446 488 $before_link = javelin_render_tag( 447 489 'a', 448 490 array( ··· 472 514 'style' => 'background: '.$color, 473 515 ), 474 516 $commit_link); 517 + 518 + $blame[] = phutil_render_tag( 519 + 'th', 520 + array( 521 + 'class' => 'diffusion-rev-link', 522 + 'style' => 'background: '.$color, 523 + ), 524 + $revision_link); 475 525 476 526 $blame[] = phutil_render_tag( 477 527 'th',