Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15414908
D8478.id20401.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D8478.id20401.diff
View Options
diff --git a/src/applications/diffusion/conduit/ConduitAPI_diffusion_diffquery_Method.php b/src/applications/diffusion/conduit/ConduitAPI_diffusion_diffquery_Method.php
--- a/src/applications/diffusion/conduit/ConduitAPI_diffusion_diffquery_Method.php
+++ b/src/applications/diffusion/conduit/ConduitAPI_diffusion_diffquery_Method.php
@@ -118,46 +118,26 @@
break;
}
- $proplistFutures = array(
- 'old' => $this->buildSVNFuture($old, 'proplist'),
- 'new' => $this->buildSVNFuture($new, 'proplist'),
+ $futures = array(
+ 'old' => $this->buildSVNContentFuture($old),
+ 'new' => $this->buildSVNContentFuture($new),
);
- $proplistFutures = array_filter($proplistFutures);
- $proplistFutures = $this->execFutures($proplistFutures, $path);
-
- $proplistFutures['old'] = explode("\n", idx($proplistFutures, 'old', ''));
- $proplistFutures['old'] = array_slice($proplistFutures['old'], 1);
- $proplistFutures['old'] = array_map('trim', $proplistFutures['old']);
- $proplistFutures['old'] = array_filter($proplistFutures['old']);
- $proplistFutures['new'] = explode("\n", idx($proplistFutures, 'new', ''));
- $proplistFutures['new'] = array_slice($proplistFutures['new'], 1);
- $proplistFutures['new'] = array_map('trim', $proplistFutures['new']);
- $proplistFutures['new'] = array_filter($proplistFutures['new']);
-
- $contentFutures = array(
- 'old' => $this->buildSVNFuture($old, 'cat'),
- 'new' => $this->buildSVNFuture($new, 'cat'),
- );
- $contentFutures = array_filter($contentFutures);
- $contentFutures = $this->execFutures($contentFutures, $path);
+ $futures = array_filter($futures);
- $propgetFutures = array(
- 'old' => array(),
- 'new' => array(),
- );
- foreach ($proplistFutures['old'] as $p) {
- $propgetFutures['old'][$p] = $this->buildSVNFuture($old, 'propget '.$p);
- }
- foreach ($proplistFutures['new'] as $p) {
- $propgetFutures['new'][$p] = $this->buildSVNFuture($new, 'propget '.$p);
+ foreach (Futures($futures) as $key => $future) {
+ $stdout = '';
+ try {
+ list($stdout) = $future->resolvex();
+ } catch (CommandException $e) {
+ if ($path->getFileType() != DifferentialChangeType::FILE_DIRECTORY) {
+ throw $e;
+ }
+ }
+ $futures[$key] = $stdout;
}
- $propgetFutures['old'] = array_filter($propgetFutures['old']);
- $propgetFutures['old'] = $this->execFutures($propgetFutures['old'], $path);
- $propgetFutures['new'] = array_filter($propgetFutures['new']);
- $propgetFutures['new'] = $this->execFutures($propgetFutures['new'], $path);
- $old_data = idx($contentFutures, 'old', '');
- $new_data = idx($contentFutures, 'new', '');
+ $old_data = idx($futures, 'old', '');
+ $new_data = idx($futures, 'new', '');
$engine = new PhabricatorDifferenceEngine();
$engine->setOldName($old_name);
@@ -174,32 +154,9 @@
$change = $changes[$path->getPath()];
- foreach ($propgetFutures['old'] as $key => $value) {
- $change->setOldProperty($key, $value);
- }
- foreach ($propgetFutures['new'] as $key => $value) {
- $change->setNewProperty($key, $value);
- }
-
return array($change);
}
- private function execFutures($futures, $path) {
- foreach (Futures($futures) as $key => $future) {
- $stdout = '';
- try {
- list($stdout) = $future->resolvex();
- } catch (CommandException $e) {
- if ($path->getFileType() != DifferentialChangeType::FILE_DIRECTORY) {
- throw $e;
- }
- }
- $futures[$key] = $stdout;
- }
-
- return $futures;
- }
-
private function getEffectiveCommit(ConduitAPIRequest $request) {
if ($this->effectiveCommit === null) {
$drequest = $this->getDiffusionRequest();
@@ -226,7 +183,7 @@
return $this->effectiveCommit;
}
- private function buildSVNFuture($spec, $command) {
+ private function buildSVNContentFuture($spec) {
if (!$spec) {
return null;
}
@@ -236,7 +193,7 @@
list($ref, $rev) = $spec;
return $repository->getRemoteCommandFuture(
- $command.' %s',
+ 'cat %s',
$repository->getSubversionPathURI($ref, $rev));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 21, 3:04 AM (1 w, 12 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7714853
Default Alt Text
D8478.id20401.diff (4 KB)
Attached To
Mode
D8478: Fetch SVN property changes for Diffusion
Attached
Detach File
Event Timeline
Log In to Comment