Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistWhichWorkflow.php
| Show All 38 Lines | EOTEXT | ||||
| public function requiresAuthentication() { | public function requiresAuthentication() { | ||||
| return true; | return true; | ||||
| } | } | ||||
| public function getArguments() { | public function getArguments() { | ||||
| return array( | return array( | ||||
| 'any-status' => array( | 'any-status' => array( | ||||
| 'help' => "Show committed and abandoned revisions.", | 'help' => 'Show committed and abandoned revisions.', | ||||
| ), | ), | ||||
| 'base' => array( | 'base' => array( | ||||
| 'param' => 'rules', | 'param' => 'rules', | ||||
| 'help' => 'Additional rules for determining base revision.', | 'help' => 'Additional rules for determining base revision.', | ||||
| 'nosupport' => array( | 'nosupport' => array( | ||||
| 'svn' => 'Subversion does not use base commits.', | 'svn' => 'Subversion does not use base commits.', | ||||
| ), | ), | ||||
| 'supports' => array('git', 'hg'), | 'supports' => array('git', 'hg'), | ||||
| ▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | if ($repository_api->supportsCommitRanges()) { | ||||
| $relative_summary = $repository_api->getCommitSummary($relative); | $relative_summary = $repository_api->getCommitSummary($relative); | ||||
| $relative = substr($relative, 0, 16); | $relative = substr($relative, 0, 16); | ||||
| if ($repository_api instanceof ArcanistGitAPI) { | if ($repository_api instanceof ArcanistGitAPI) { | ||||
| $command = "git diff {$relative}..HEAD"; | $command = "git diff {$relative}..HEAD"; | ||||
| } else if ($repository_api instanceof ArcanistMercurialAPI) { | } else if ($repository_api instanceof ArcanistMercurialAPI) { | ||||
| $command = "hg diff --rev {$relative}"; | $command = "hg diff --rev {$relative}"; | ||||
| } else { | } else { | ||||
| throw new Exception("Unknown VCS!"); | throw new Exception('Unknown VCS!'); | ||||
| } | } | ||||
| echo phutil_console_wrap( | echo phutil_console_wrap( | ||||
| phutil_console_format( | phutil_console_format( | ||||
| "**RELATIVE COMMIT**\n". | "**RELATIVE COMMIT**\n". | ||||
| "If you run 'arc diff{$arg}', changes between the commit:\n\n")); | "If you run 'arc diff{$arg}', changes between the commit:\n\n")); | ||||
| echo " {$relative} {$relative_summary}\n\n"; | echo " {$relative} {$relative_summary}\n\n"; | ||||
| ▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines | |||||