private function getRawDiff(PhabricatorRepository $repository, $commit, $use_log, $try_harder)
 {
     $flags = array('-n1', '-M', '-C', '-B', '--raw', '-t', '--abbrev=40');
     if ($try_harder) {
         $flags[] = '--find-copies-harder';
     }
     if ($use_log) {
         // This is the first commit so we need to use "log". We know it's not a
         // merge commit because it couldn't be merging anything, so this is safe.
         // NOTE: "--pretty=format: " is to disable diff output, we only want the
         // part we get from "--raw".
         $future = $repository->getLocalCommandFuture('log %Ls --pretty=format: %s', $flags, $commit);
     } else {
         // Otherwise, we can use "diff", which will give us output for merges.
         // We diff against the first parent, as this is generally the expectation
         // and results in sensible behavior.
         $future = $repository->getLocalCommandFuture('diff %Ls %s^1 %s', $flags, $commit, $commit);
     }
     // Don't spend more than 30 seconds generating the slower output.
     if ($try_harder) {
         $future->setTimeout(30);
     }
     list($raw) = $future->resolvex();
     return $raw;
 }
 public function __construct(PhabricatorRepository $repository, $start_commit = null)
 {
     $this->repository = $repository;
     $this->startCommit = $start_commit;
     if ($start_commit !== null) {
         $future = $repository->getLocalCommandFuture('log --format=%s %s --', '%H%x01%P%x01%ct', $start_commit);
     } else {
         $future = $repository->getLocalCommandFuture('log --format=%s --all --', '%H%x01%P%x01%ct');
     }
     $this->iterator = new LinesOfALargeExecFuture($future);
     $this->iterator->setDelimiter("\n");
     $this->iterator->rewind();
 }
 public function __construct(PhabricatorRepository $repository, $commit)
 {
     $this->repository = $repository;
     $future = $repository->getLocalCommandFuture('log --template %s --rev %s', '{rev}\\1{node}\\1{date}\\1{parents}\\2', hgsprintf('reverse(ancestors(%s))', $commit));
     $this->iterator = new LinesOfALargeExecFuture($future);
     $this->iterator->setDelimiter("");
     $this->iterator->rewind();
 }
 public function __construct(PhabricatorRepository $repository, $start_commit)
 {
     $this->repository = $repository;
     $future = $repository->getLocalCommandFuture("log --format=%s %s --", '%H%x01%P%x01%ct', $start_commit);
     $this->iterator = new LinesOfALargeExecFuture($future);
     $this->iterator->setDelimiter("\n");
     $this->iterator->rewind();
 }
 public function __construct(PhabricatorRepository $repository)
 {
     $this->repository = $repository;
     $future = $repository->getLocalCommandFuture("log --template '{rev}{node}{date}{parents}'");
     $this->iterator = new LinesOfALargeExecFuture($future);
     $this->iterator->setDelimiter("");
     $this->iterator->rewind();
 }