Page MenuHomePhabricator

D21305.id50722.diff
No OneTemporary

D21305.id50722.diff

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

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)

Event Timeline