Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / diffusion / query / rawdiff / DiffusionMercurialRawDiffQuery.php
blob9edcbb638023a1febf7b213f2a9b439be8bea4da
1 <?php
3 final class DiffusionMercurialRawDiffQuery extends DiffusionRawDiffQuery {
5 protected function newQueryFuture() {
6 $drequest = $this->getRequest();
7 $repository = $drequest->getRepository();
9 $commit = $this->getAnchorCommit();
11 // If there's no path, get the entire raw diff.
12 $path = nonempty($drequest->getPath(), '.');
14 $against = $this->getAgainstCommit();
15 if ($against === null) {
16 // If `$commit` has no parents (usually because it's the first commit
17 // in the repository), we want to diff against `null`. This revset will
18 // do that for us automatically.
19 $against = hgsprintf('(%s^ or null)', $commit);
22 $future = $repository->getLocalCommandFuture(
23 'diff -U %d --git --rev %s --rev %s -- %s',
24 $this->getLinesOfContext(),
25 $against,
26 hgsprintf('%s', $commit),
27 $path);
29 return $future;