Changeset View
Changeset View
Standalone View
Standalone View
src/parser/diff/ArcanistDiffChange.php
| Show First 20 Lines • Show All 286 Lines • ▼ Show 20 Lines | if (ArcanistDiffChangeType::isNewLocationChangeType($type)) { | ||||
| $summary[] = ' from: '.$this->getOldPath(); | $summary[] = ' from: '.$this->getOldPath(); | ||||
| } | } | ||||
| return implode("\n", $summary); | return implode("\n", $summary); | ||||
| } | } | ||||
| public function getSymlinkTarget() { | public function getSymlinkTarget() { | ||||
| if ($this->getFileType() != ArcanistDiffChangeType::FILE_SYMLINK) { | if ($this->getFileType() != ArcanistDiffChangeType::FILE_SYMLINK) { | ||||
| throw new Exception('Not a symlink!'); | throw new Exception(pht('Not a symlink!')); | ||||
| } | } | ||||
| $hunks = $this->getHunks(); | $hunks = $this->getHunks(); | ||||
| $hunk = reset($hunks); | $hunk = reset($hunks); | ||||
| $corpus = $hunk->getCorpus(); | $corpus = $hunk->getCorpus(); | ||||
| $match = null; | $match = null; | ||||
| if (!preg_match('/^\+(?:link )?(.*)$/m', $corpus, $match)) { | if (!preg_match('/^\+(?:link )?(.*)$/m', $corpus, $match)) { | ||||
| throw new Exception('Failed to extract link target!'); | throw new Exception(pht('Failed to extract link target!')); | ||||
| } | } | ||||
| return trim($match[1]); | return trim($match[1]); | ||||
| } | } | ||||
| public function setNeedsSyntheticGitHunks($needs_synthetic_git_hunks) { | public function setNeedsSyntheticGitHunks($needs_synthetic_git_hunks) { | ||||
| $this->needsSyntheticGitHunks = $needs_synthetic_git_hunks; | $this->needsSyntheticGitHunks = $needs_synthetic_git_hunks; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getNeedsSyntheticGitHunks() { | public function getNeedsSyntheticGitHunks() { | ||||
| return $this->needsSyntheticGitHunks; | return $this->needsSyntheticGitHunks; | ||||
| } | } | ||||
| } | } | ||||