Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15395735
D21305.id50722.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D21305.id50722.diff
View Options
Index: src/workflow/ArcanistDiffWorkflow.php
===================================================================
--- src/workflow/ArcanistDiffWorkflow.php
+++ src/workflow/ArcanistDiffWorkflow.php
@@ -113,30 +113,12 @@
'before updating.'),
),
'raw' => array(
+ 'param' => 'source',
'help' => pht(
- 'Read diff from stdin, not from the working copy. This disables '.
- 'many Arcanist/Phabricator features which depend on having access '.
- 'to the working copy.'),
- 'conflicts' => array(
- 'create' => pht(
- '%s and %s both need stdin. Use %s.',
- '--raw',
- '--create',
- '--raw-command'),
- 'edit' => pht(
- '%s and %s both need stdin. Use %s.',
- '--raw',
- '--edit',
- '--raw-command'),
- 'raw-command' => null,
- ),
- ),
- 'raw-command' => array(
- 'param' => 'command',
- 'help' => pht(
- 'Generate diff by executing a specified command, not from the '.
- 'working copy. This disables many Arcanist/Phabricator features '.
- 'which depend on having access to the working copy.'),
+ 'Read diff from specified source, not from the working copy. '.
+ 'Use "-" to read from stdin. '.
+ 'This disables many features which depend on having access to '.
+ 'the working copy.'),
),
'create' => array(
'help' => pht('Always create a new revision.'),
@@ -218,7 +200,6 @@
'update' => true,
'only' => true,
'raw' => true,
- 'raw-command' => true,
'message-file' => true,
),
),
@@ -290,7 +271,7 @@
}
public function isRawDiffSource() {
- return $this->getArgument('raw') || $this->getArgument('raw-command');
+ return $this->getArgument('raw');
}
public function run() {
@@ -754,13 +735,11 @@
$is_raw = $this->isRawDiffSource();
if ($is_raw) {
- if ($this->getArgument('raw')) {
- fwrite(STDERR, pht('Reading diff from stdin...')."\n");
- $raw_diff = file_get_contents('php://stdin');
- } else if ($this->getArgument('raw-command')) {
- list($raw_diff) = execx('%C', $this->getArgument('raw-command'));
+ $raw_path = $this->getArgument('raw');
+ if ($raw_path === '-') {
+ $raw_diff = $this->readStdin();
} else {
- throw new Exception(pht('Unknown raw diff source.'));
+ $raw_diff = Filesystem::readFile($raw_path);
}
$changes = $parser->parseDiff($raw_diff);
@@ -1054,8 +1033,7 @@
return false;
}
- // Run this last: with --raw or --raw-command, we won't have a repository
- // API.
+ // Run this last: with "--raw", we won't have a repository API.
if ($this->isHistoryImmutable()) {
return false;
}
@@ -1431,7 +1409,7 @@
$template = ArcanistCommentRemover::removeComments($new_template);
- // With --raw-command, we may not have a repository API.
+ // With "--raw", we may not have a repository API.
if ($this->hasRepositoryAPI()) {
$repository_api = $this->getRepositoryAPI();
// special check for whether to amend here. optimizes a common git
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 17, 9:24 AM (5 d, 12 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7385274
Default Alt Text
D21305.id50722.diff (3 KB)
Attached To
Mode
D21305: Merge the "--raw" and "--raw-command" flags to "arc diff" into "--raw <path>"
Attached
Detach File
Event Timeline
Log In to Comment