Differential D18769 Diff 45040 src/applications/diffusion/conduit/DiffusionMergedCommitsQueryConduitAPIMethod.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/conduit/DiffusionMergedCommitsQueryConduitAPIMethod.php
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | protected function getMercurialResult(ConduitAPIRequest $request) { | ||||
$drequest = $this->getDiffusionRequest(); | $drequest = $this->getDiffusionRequest(); | ||||
$repository = $drequest->getRepository(); | $repository = $drequest->getRepository(); | ||||
$commit = $request->getValue('commit'); | $commit = $request->getValue('commit'); | ||||
$limit = $this->getLimit($request); | $limit = $this->getLimit($request); | ||||
list($parents) = $repository->execxLocalCommand( | list($parents) = $repository->execxLocalCommand( | ||||
'parents --template=%s --rev %s', | 'parents --template=%s --rev %s', | ||||
'{node}\\n', | '{node}\\n', | ||||
$commit); | hgsprintf('%s', $commit)); | ||||
$parents = explode("\n", trim($parents)); | $parents = explode("\n", trim($parents)); | ||||
if (count($parents) < 2) { | if (count($parents) < 2) { | ||||
// Not a merge commit. | // Not a merge commit. | ||||
return array(); | return array(); | ||||
} | } | ||||
// NOTE: In Git, the first parent is the "mainline". In Mercurial, the | // NOTE: In Git, the first parent is the "mainline". In Mercurial, the | ||||
Show All 23 Lines |