1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-02-16 16:58:38 +01:00

Correctly implement getFileDataAtRevision()

Summary: Apparently I just never tested this or something. Make it work
correctly.

Test Plan: Ran "arc diff" in a Mercurial working copy with a binary file in
outgoing.

Reviewers: Makinde

Reviewed By: Makinde

CC: aran, Makinde

Differential Revision: 1074
This commit is contained in:
epriestley 2011-11-01 17:21:39 -07:00
parent c53a43f54d
commit 59cd94d8eb

View file

@ -269,11 +269,17 @@ class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
} }
private function getFileDataAtRevision($path, $revision) { private function getFileDataAtRevision($path, $revision) {
list($stdout) = execx( list($err, $stdout) = exec_manual(
'(cd %s && hg cat --rev %s -- %s)', '(cd %s && hg cat --rev %s -- %s)',
$this->getPath(), $this->getPath(),
$revision,
$path); $path);
return $stdout; if ($err) {
// Assume this is "no file at revision", i.e. a deleted or added file.
return null;
} else {
return $stdout;
}
} }
private function getWorkingCopyRevision() { private function getWorkingCopyRevision() {