Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistDiffWorkflow.php
Show First 20 Lines • Show All 391 Lines • ▼ Show 20 Lines | $arguments = array( | ||||
'help' => 'Always disable coverage information.', | 'help' => 'Always disable coverage information.', | ||||
'passthru' => array( | 'passthru' => array( | ||||
'unit' => true, | 'unit' => true, | ||||
), | ), | ||||
), | ), | ||||
'*' => 'paths', | '*' => 'paths', | ||||
'head' => array( | 'head' => array( | ||||
'param' => 'commit', | 'param' => 'commit', | ||||
'help' => "specify the head commit.\n". | 'help' => pht( | ||||
"This disables many Arcanist/Phabricator features which depend on ". | 'Specify the end of the commit range. This disables many '. | ||||
"having access to the working copy.", | 'Arcanist/Phabricator features which depend on having access to '. | ||||
'the working copy.'), | |||||
'supports' => array('git'), | 'supports' => array('git'), | ||||
'nosupport' => array( | |||||
'svn' => pht('Subversion does not support commit ranges.'), | |||||
'hg' => pht('Mercurial does not support --head yet.'), | |||||
), | |||||
'conflicts' => array( | 'conflicts' => array( | ||||
'lintall' => '--head suppresses lint.', | 'lintall' => '--head suppresses lint.', | ||||
'advice' => '--head suppresses lint.', | 'advice' => '--head suppresses lint.', | ||||
), | ), | ||||
) | ) | ||||
); | ); | ||||
if (phutil_is_windows()) { | if (phutil_is_windows()) { | ||||
unset($arguments['background']); | unset($arguments['background']); | ||||
} | } | ||||
return $arguments; | return $arguments; | ||||
Show All 25 Lines | public function run() { | ||||
if ($background) { | if ($background) { | ||||
$argv = $this->getPassedArguments(); | $argv = $this->getPassedArguments(); | ||||
if (!PhutilConsoleFormatter::getDisableANSI()) { | if (!PhutilConsoleFormatter::getDisableANSI()) { | ||||
array_unshift($argv, '--ansi'); | array_unshift($argv, '--ansi'); | ||||
} | } | ||||
$repo = $this->getRepositoryAPI(); | $repo = $this->getRepositoryAPI(); | ||||
$head_commit = $this->getArgument('head'); | $head_commit = $this->getArgument('head'); | ||||
$range_supported = $repo->supportsCommitRanges(); | if ($head_commit !== null) { | ||||
if ($head_commit) { | |||||
if (!$range_supported) { | |||||
throw new ArcanistUsageException('Ranged are not supported'); | |||||
} | |||||
$repo->setHeadCommit($head_commit); | $repo->setHeadCommit($head_commit); | ||||
} | } | ||||
if ($range_supported) { | if ($repo->supportsCommitRanges()) { | ||||
$repo->getBaseCommit(); | $repo->getBaseCommit(); | ||||
} | } | ||||
$script = phutil_get_library_root('arcanist').'/../scripts/arcanist.php'; | $script = phutil_get_library_root('arcanist').'/../scripts/arcanist.php'; | ||||
if ($argv) { | if ($argv) { | ||||
$lint_unit = new ExecFuture( | $lint_unit = new ExecFuture( | ||||
'php %s --recon diff --no-diff %Ls', | 'php %s --recon diff --no-diff %Ls', | ||||
$script, | $script, | ||||
▲ Show 20 Lines • Show All 2,158 Lines • Show Last 20 Lines |