mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-25 16:22:42 +01:00
Expand ArcanistDiffParser to accept awkward Diffusion + SVN workflows.
This commit is contained in:
parent
11e25f5840
commit
4bce8732e5
1 changed files with 15 additions and 0 deletions
|
@ -30,6 +30,7 @@ class ArcanistDiffParser {
|
||||||
protected $detectBinaryFiles = false;
|
protected $detectBinaryFiles = false;
|
||||||
|
|
||||||
protected $changes = array();
|
protected $changes = array();
|
||||||
|
private $forcePath;
|
||||||
|
|
||||||
protected function setRepositoryAPI(ArcanistRepositoryAPI $api) {
|
protected function setRepositoryAPI(ArcanistRepositoryAPI $api) {
|
||||||
$this->api = $api;
|
$this->api = $api;
|
||||||
|
@ -45,6 +46,16 @@ class ArcanistDiffParser {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function forcePath($path) {
|
||||||
|
$this->forcePath = $path;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setChanges(array $changes) {
|
||||||
|
$this->changes = mpull($changes, null, 'getCurrentPath');
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
public function parseSubversionDiff(ArcanistSubversionAPI $api, $paths) {
|
public function parseSubversionDiff(ArcanistSubversionAPI $api, $paths) {
|
||||||
$this->setRepositoryAPI($api);
|
$this->setRepositoryAPI($api);
|
||||||
|
|
||||||
|
@ -732,6 +743,10 @@ class ArcanistDiffParser {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->forcePath) {
|
||||||
|
return $this->changes[$this->forcePath];
|
||||||
|
}
|
||||||
|
|
||||||
$change = new ArcanistDiffChange();
|
$change = new ArcanistDiffChange();
|
||||||
if ($path !== null) {
|
if ($path !== null) {
|
||||||
$change->setCurrentPath($path);
|
$change->setCurrentPath($path);
|
||||||
|
|
Loading…
Reference in a new issue