getRequest(); $repository = $drequest->getRepository(); $options = array( '-M', '-C', '--no-ext-diff', '--no-color', '--src-prefix=a/', '--dst-prefix=b/', '-U65535', ); $options = implode(' ', $options); list($raw_diff) = execx( "(cd %s && git diff {$options} %s^ %s -- %s)", $repository->getDetail('local-path'), $drequest->getCommit(), $drequest->getCommit(), $drequest->getPath()); $parser = new ArcanistDiffParser(); $parser->setDetectBinaryFiles(true); $changes = $parser->parseDiff($raw_diff); $diff = DifferentialDiff::newFromRawChanges($changes); $changesets = $diff->getChangesets(); $changeset = reset($changesets); $id = $drequest->getBranchURIComponent($drequest->getBranch()). $drequest->getPath().';'. $drequest->getCommit(); $changeset->setID($id); return $changeset; } }