Changeset View
Changeset View
Standalone View
Standalone View
src/repository/graph/query/ArcanistMercurialCommitGraphQuery.php
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | if ($tail_hashes !== null) { | ||||
'descendants(%s)', | 'descendants(%s)', | ||||
$tail_hash); | $tail_hash); | ||||
} | } | ||||
$revsets[] = $this->joinOrRevsets($revs); | $revsets[] = $this->joinOrRevsets($revs); | ||||
} | } | ||||
if ($revsets) { | if ($revsets) { | ||||
$revsets = array( | $revsets = array( | ||||
$this->joinAndRevsets($revs), | $this->joinAndRevsets($revsets), | ||||
); | ); | ||||
} | } | ||||
if ($exact_hashes !== null) { | if ($exact_hashes !== null) { | ||||
$revs = array(); | $revs = array(); | ||||
foreach ($exact_hashes as $exact_hash) { | foreach ($exact_hashes as $exact_hash) { | ||||
$revs[] = hgsprintf( | $revs[] = hgsprintf( | ||||
'%s', | '%s', | ||||
$exact_hash); | $exact_hash); | ||||
} | } | ||||
$revsets[] = array( | $revsets[] = $this->joinOrRevsets($revs); | ||||
$this->joinOrRevsets($revs), | |||||
); | |||||
} | } | ||||
$revsets = $this->joinOrRevsets($revs); | $revsets = $this->joinOrRevsets($revsets); | ||||
$fields = array( | $fields = array( | ||||
'', // Placeholder for "encoding". | '', // Placeholder for "encoding". | ||||
'{node}', | '{node}', | ||||
'{parents}', | '{parents}', | ||||
'{date|rfc822date}', | '{date|rfc822date}', | ||||
'{description|utf8}', | '{description|utf8}', | ||||
); | ); | ||||
$template = implode("\2", $fields)."\1"; | $template = implode("\2", $fields)."\1"; | ||||
$flags = array(); | |||||
$min_epoch = $this->getMinimumEpoch(); | |||||
$max_epoch = $this->getMaximumEpoch(); | |||||
if ($min_epoch !== null || $max_epoch !== null) { | |||||
$flags[] = '--date'; | |||||
if ($min_epoch !== null) { | |||||
$min_epoch = date('c', $min_epoch); | |||||
} | |||||
if ($max_epoch !== null) { | |||||
$max_epoch = date('c', $max_epoch); | |||||
} | |||||
if ($min_epoch !== null && $max_epoch !== null) { | |||||
$flags[] = sprintf( | |||||
'%s to %s', | |||||
$min_epoch, | |||||
$max_epoch); | |||||
} else if ($min_epoch) { | |||||
$flags[] = sprintf( | |||||
'>%s', | |||||
$min_epoch); | |||||
} else { | |||||
$flags[] = sprintf( | |||||
'<%s', | |||||
$max_epoch); | |||||
} | |||||
} | |||||
$future = $api->newFuture( | $future = $api->newFuture( | ||||
'log --rev %s --template %s --', | 'log --rev %s --template %s %Ls --', | ||||
$revsets, | $revsets, | ||||
$template); | $template, | ||||
$flags); | |||||
$future->setResolveOnError(true); | $future->setResolveOnError(true); | ||||
$future->start(); | $future->start(); | ||||
$lines = id(new LinesOfALargeExecFuture($future)) | $lines = id(new LinesOfALargeExecFuture($future)) | ||||
->setDelimiter("\1"); | ->setDelimiter("\1"); | ||||
$lines->rewind(); | $lines->rewind(); | ||||
$this->queryFuture = $lines; | $this->queryFuture = $lines; | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |