[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/diffusion/query/rawdiff/ -> DiffusionMercurialRawDiffQuery.php (source)

   1  <?php
   2  
   3  final class DiffusionMercurialRawDiffQuery extends DiffusionRawDiffQuery {
   4  
   5    protected function executeQuery() {
   6      return $this->executeRawDiffCommand();
   7    }
   8  
   9    protected function executeRawDiffCommand() {
  10      $drequest = $this->getRequest();
  11      $repository = $drequest->getRepository();
  12  
  13      $commit = $this->getAnchorCommit();
  14  
  15      // If there's no path, get the entire raw diff.
  16      $path = nonempty($drequest->getPath(), '.');
  17  
  18      $against = $this->getAgainstCommit();
  19      if ($against === null) {
  20        // If `$commit` has no parents (usually because it's the first commit
  21        // in the repository), we want to diff against `null`. This revset will
  22        // do that for us automatically.
  23        $against = '('.$commit.'^ or null)';
  24      }
  25  
  26      $future = $repository->getLocalCommandFuture(
  27        'diff -U %d --git --rev %s --rev %s -- %s',
  28        $this->getLinesOfContext(),
  29        $against,
  30        $commit,
  31        $path);
  32  
  33      $this->configureFuture($future);
  34  
  35      list($raw_diff) = $future->resolvex();
  36  
  37      return $raw_diff;
  38    }
  39  
  40  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1