Fix commit policy stuff and anchor handling

Summary:
See discussion in D5121. Fixes T2615.

This might cause us more issues if anything is loading commit handles without passing a viewer, but I think I tested all of those cases.

Test Plan: Looked at feed, audit, maniphest, diffusion, differential, owners, repositories.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T2615

Differential Revision: https://secure.phabricator.com/D5139
This commit is contained in:
epriestley
2013-02-27 10:54:39 -08:00
parent 8d20e42c1c
commit ed00e37f47
4 changed files with 30 additions and 20 deletions
@@ -4,6 +4,7 @@ final class DiffusionCommitQuery
extends PhabricatorCursorPagedPolicyAwareQuery {
private $identifiers;
private $phids;
/**
* Load commits by partial or full identifiers, e.g. "rXab82393", "rX1234",
@@ -16,6 +17,11 @@ final class DiffusionCommitQuery
return $this;
}
public function withPHIDs(array $phids) {
$this->phids = $phids;
return $this;
}
public function loadPage() {
$table = new PhabricatorRepositoryCommit();
$conn_r = $table->establishConnection('r');
@@ -134,6 +140,13 @@ final class DiffusionCommitQuery
}
}
if ($this->phids) {
$where[] = qsprintf(
$conn_r,
'phid IN (%Ls)',
$this->phids);
}
return $this->formatWhereClause($where);
}