Make differential.querydiffs more liberal about arguments
Summary: Fixes T12092. D17164 made `DiffQuery` more strict about arguments using modern conventions, but `differential.querydiffs` uses bizarre ancient conventions. Give it more modern conventions instead. Test Plan: Made a `querydiffs` call with only revision IDs. Reviewers: chad Reviewed By: chad Maniphest Tasks: T12092 Differential Revision: https://secure.phabricator.com/D17172
This commit is contained in:
@@ -26,16 +26,27 @@ final class DifferentialQueryDiffsConduitAPIMethod
|
|||||||
$ids = $request->getValue('ids', array());
|
$ids = $request->getValue('ids', array());
|
||||||
$revision_ids = $request->getValue('revisionIDs', array());
|
$revision_ids = $request->getValue('revisionIDs', array());
|
||||||
|
|
||||||
$diffs = array();
|
if (!$ids && !$revision_ids) {
|
||||||
if ($ids || $revision_ids) {
|
// This method just returns nothing if you pass no constraints because
|
||||||
$diffs = id(new DifferentialDiffQuery())
|
// pagination hadn't been invented yet in 2008 when this method was
|
||||||
->setViewer($request->getUser())
|
// written.
|
||||||
->withIDs($ids)
|
return array();
|
||||||
->withRevisionIDs($revision_ids)
|
|
||||||
->needChangesets(true)
|
|
||||||
->execute();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$query = id(new DifferentialDiffQuery())
|
||||||
|
->setViewer($request->getUser())
|
||||||
|
->needChangesets(true);
|
||||||
|
|
||||||
|
if ($ids) {
|
||||||
|
$query->withIDs($ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($revision_ids) {
|
||||||
|
$query->withRevisionIDs($revision_ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
$diffs = $query->execute();
|
||||||
|
|
||||||
return mpull($diffs, 'getDiffDict', 'getID');
|
return mpull($diffs, 'getDiffDict', 'getID');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user