diff --git a/src/parser/ArcanistDiffParser.php b/src/parser/ArcanistDiffParser.php index 54a40361..f4a0cc5c 100644 --- a/src/parser/ArcanistDiffParser.php +++ b/src/parser/ArcanistDiffParser.php @@ -1158,7 +1158,14 @@ final class ArcanistDiffParser { if ($change->getNeedsSyntheticGitHunks()) { $diff = $repository_api->getRawDiffText($path, $moves = false); + // NOTE: We're reusing the parser and it doesn't reset change state + // between parses because there's an oddball SVN workflow in Phabricator + // which relies on being able to inject changes. + // TODO: Fix this. + $this->setChanges(array()); + $raw_changes = $this->parseDiff($diff); + foreach ($raw_changes as $raw_change) { if ($raw_change->getCurrentPath() == $path) { $change->setFileType($raw_change->getFileType()); diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index 175a4a84..76437f31 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -588,6 +588,7 @@ EOTEXT try { $this->requireCleanWorkingCopy(); } catch (ArcanistUncommittedChangesException $ex) { + $repository_api = $this->getRepositoryAPI(); if ($repository_api instanceof ArcanistMercurialAPI) { // Some Mercurial users prefer to use it like SVN, where they don't