Differential D21677 Diff 51604 src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php
Show First 20 Lines • Show All 160 Lines • ▼ Show 20 Lines | protected function getMercurialResult(ConduitAPIRequest $request) { | ||||
$lines = explode("\n", trim($stdout)); | $lines = explode("\n", trim($stdout)); | ||||
$lines = array_slice($lines, $offset); | $lines = array_slice($lines, $offset); | ||||
$hash_list = array(); | $hash_list = array(); | ||||
$parent_map = array(); | $parent_map = array(); | ||||
$last = null; | $last = null; | ||||
foreach (array_reverse($lines) as $line) { | foreach (array_reverse($lines) as $line) { | ||||
// In the event additional log output is included in future mercurial | |||||
// updates, if the line does not contain any semi-colon then log it and | |||||
// ignore it. | |||||
if (strpos($line, ';') === false) { | |||||
phlog(pht( | |||||
'Unexpected output from mercurial "log --debug" command: %s', | |||||
$line)); | |||||
continue; | |||||
} | |||||
list($hash, $parents) = explode(';', $line); | list($hash, $parents) = explode(';', $line); | ||||
$parents = trim($parents); | $parents = trim($parents); | ||||
if (!$parents) { | if (!$parents) { | ||||
if ($last === null) { | if ($last === null) { | ||||
$parent_map[$hash] = array('...'); | $parent_map[$hash] = array('...'); | ||||
} else { | } else { | ||||
$parent_map[$hash] = array($last); | $parent_map[$hash] = array($last); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 124 Lines • Show Last 20 Lines |