Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14006902
D11118.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D11118.diff
View Options
diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php
--- a/src/workflow/ArcanistDiffWorkflow.php
+++ b/src/workflow/ArcanistDiffWorkflow.php
@@ -2504,47 +2504,35 @@
echo pht('Uploading %d files...', count($need_upload))."\n";
- // Now we're ready to upload the actual file data. If possible, we'll just
- // transmit a hash of the file instead of the actual file data. If the data
- // already exists, Phabricator can share storage. Check if we can use
- // "file.uploadhash" yet (i.e., if the server is up to date enough).
- // TODO: Drop this check once we bump the protocol version.
- $conduit_methods = $this->getConduit()->callMethodSynchronous(
- 'conduit.query',
- array());
- $can_use_hash_upload = isset($conduit_methods['file.uploadhash']);
-
- if ($can_use_hash_upload) {
- $hash_futures = array();
- foreach ($need_upload as $key => $spec) {
- $hash_futures[$key] = $this->getConduit()->callMethod(
- 'file.uploadhash',
- array(
- 'name' => $spec['name'],
- 'hash' => sha1($spec['data']),
- ));
- }
+ $hash_futures = array();
+ foreach ($need_upload as $key => $spec) {
+ $hash_futures[$key] = $this->getConduit()->callMethod(
+ 'file.uploadhash',
+ array(
+ 'name' => $spec['name'],
+ 'hash' => sha1($spec['data']),
+ ));
+ }
- $futures = id(new FutureIterator($hash_futures))
- ->limit(8);
- foreach ($futures as $key => $future) {
- $type = $need_upload[$key]['type'];
- $change = $need_upload[$key]['change'];
- $name = $need_upload[$key]['name'];
+ $futures = id(new FutureIterator($hash_futures))
+ ->limit(8);
+ foreach ($futures as $key => $future) {
+ $type = $need_upload[$key]['type'];
+ $change = $need_upload[$key]['change'];
+ $name = $need_upload[$key]['name'];
- $phid = null;
- try {
- $phid = $future->resolve();
- } catch (Exception $e) {
- // Just try uploading normally if the hash upload failed.
- continue;
- }
+ $phid = null;
+ try {
+ $phid = $future->resolve();
+ } catch (Exception $e) {
+ // Just try uploading normally if the hash upload failed.
+ continue;
+ }
- if ($phid) {
- $change->setMetadata("{$type}:binary-phid", $phid);
- unset($need_upload[$key]);
- echo pht("Uploaded '%s' (%s).", $name, $type)."\n";
- }
+ if ($phid) {
+ $change->setMetadata("{$type}:binary-phid", $phid);
+ unset($need_upload[$key]);
+ echo pht("Uploaded '%s' (%s).", $name, $type)."\n";
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Oct 29, 8:38 PM (2 w, 6 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6730232
Default Alt Text
D11118.diff (2 KB)
Attached To
Mode
D11118: Remove some old code handling the absence of the `file.uploadhash` Conduit method
Attached
Detach File
Event Timeline
Log In to Comment