Save blame info to lint messages
Test Plan: Applied the patch. Looked at blame and plain blame of SVN and Git file. Ran the lint saver. Looked at lint messages list. /diffusion/lint/ Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5218
This commit is contained in:
@@ -169,29 +169,30 @@ final class DiffusionLintController extends DiffusionController {
|
||||
}
|
||||
|
||||
if ($owner_phids) {
|
||||
$or = array();
|
||||
$or[] = qsprintf($conn, 'authorPHID IN (%Ls)', $owner_phids);
|
||||
|
||||
$paths = array();
|
||||
$packages = id(new PhabricatorOwnersOwner())
|
||||
->loadAllWhere('userPHID IN (%Ls)', $owner_phids);
|
||||
if (!$packages) {
|
||||
return array();
|
||||
if ($packages) {
|
||||
$paths = id(new PhabricatorOwnersPath())->loadAllWhere(
|
||||
'packageID IN (%Ld)',
|
||||
mpull($packages, 'getPackageID'));
|
||||
}
|
||||
|
||||
$paths = id(new PhabricatorOwnersPath())
|
||||
->loadAllWhere('packageID IN (%Ld)', array_keys($packages));
|
||||
if (!$paths) {
|
||||
return array();
|
||||
if ($paths) {
|
||||
$repositories = id(new PhabricatorRepository())->loadAllWhere(
|
||||
'phid IN (%Ls)',
|
||||
array_unique(mpull($paths, 'getRepositoryPHID')));
|
||||
$repositories = mpull($repositories, 'getID', 'getPHID');
|
||||
|
||||
$branches = id(new PhabricatorRepositoryBranch())->loadAllWhere(
|
||||
'repositoryID IN (%Ld)',
|
||||
$repositories);
|
||||
$branches = mgroup($branches, 'getRepositoryID');
|
||||
}
|
||||
|
||||
$repositories = id(new PhabricatorRepository())->loadAllWhere(
|
||||
'phid IN (%Ls)',
|
||||
array_unique(mpull($paths, 'getRepositoryPHID')));
|
||||
$repositories = mpull($repositories, 'getID', 'getPHID');
|
||||
|
||||
$branches = id(new PhabricatorRepositoryBranch())->loadAllWhere(
|
||||
'repositoryID IN (%Ld)',
|
||||
$repositories);
|
||||
$branches = mgroup($branches, 'getRepositoryID');
|
||||
|
||||
$or = array();
|
||||
foreach ($paths as $path) {
|
||||
$branch = idx($branches, $repositories[$path->getRepositoryPHID()]);
|
||||
if ($branch) {
|
||||
@@ -207,9 +208,6 @@ final class DiffusionLintController extends DiffusionController {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$or) {
|
||||
return array();
|
||||
}
|
||||
$where[] = '('.implode(' OR ', $or).')';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user