Differential D18769 Diff 45041 src/applications/diffusion/query/rawdiff/DiffusionMercurialRawDiffQuery.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/query/rawdiff/DiffusionMercurialRawDiffQuery.php
Show All 10 Lines | protected function newQueryFuture() { | ||||
// If there's no path, get the entire raw diff. | // If there's no path, get the entire raw diff. | ||||
$path = nonempty($drequest->getPath(), '.'); | $path = nonempty($drequest->getPath(), '.'); | ||||
$against = $this->getAgainstCommit(); | $against = $this->getAgainstCommit(); | ||||
if ($against === null) { | if ($against === null) { | ||||
// If `$commit` has no parents (usually because it's the first commit | // If `$commit` has no parents (usually because it's the first commit | ||||
// in the repository), we want to diff against `null`. This revset will | // in the repository), we want to diff against `null`. This revset will | ||||
// do that for us automatically. | // do that for us automatically. | ||||
$against = '('.$commit.'^ or null)'; | $against = hgsprintf('(%s^ or null)', $commit); | ||||
} | } | ||||
$future = $repository->getLocalCommandFuture( | $future = $repository->getLocalCommandFuture( | ||||
'diff -U %d --git --rev %s --rev %s -- %s', | 'diff -U %d --git --rev %s --rev %s -- %s', | ||||
$this->getLinesOfContext(), | $this->getLinesOfContext(), | ||||
$against, | $against, | ||||
$commit, | hgsprintf('%s', $commit), | ||||
$path); | $path); | ||||
return $future; | return $future; | ||||
} | } | ||||
} | } |