1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-26 00:32:41 +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,12 +269,18 @@ class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
}
private function getFileDataAtRevision($path, $revision) {
list($stdout) = execx(
list($err, $stdout) = exec_manual(
'(cd %s && hg cat --rev %s -- %s)',
$this->getPath(),
$revision,
$path);
if ($err) {
// Assume this is "no file at revision", i.e. a deleted or added file.
return null;
} else {
return $stdout;
}
}
private function getWorkingCopyRevision() {
// In Mercurial, "tip" means the tip of the current branch, not what's in