Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistLookWorkflow.php
Show All 35 Lines | public function runWorkflow() { | ||||
$argv = $this->getArgument('argv'); | $argv = $this->getArgument('argv'); | ||||
if ($argv) { | if ($argv) { | ||||
if ($argv === array('remotes')) { | if ($argv === array('remotes')) { | ||||
return $this->lookRemotes(); | return $this->lookRemotes(); | ||||
} | } | ||||
if ($argv === array('published')) { | |||||
return $this->lookPublished(); | |||||
} | |||||
echo tsprintf( | echo tsprintf( | ||||
"%s\n", | "%s\n", | ||||
pht( | pht( | ||||
'You do not see "%s" anywhere.', | 'You do not see "%s" anywhere.', | ||||
implode(' ', $argv))); | implode(' ', $argv))); | ||||
return 1; | return 1; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | foreach ($remotes as $remote) { | ||||
$view->appendLine( | $view->appendLine( | ||||
pht( | pht( | ||||
'Fetch Repository: %s', | 'Fetch Repository: %s', | ||||
$fetch_display)); | $fetch_display)); | ||||
echo tsprintf('%s', $view); | echo tsprintf('%s', $view); | ||||
} | } | ||||
echo tsprintf("\n"); | |||||
echo tsprintf( | |||||
pht( | |||||
"Across the grove, a stream flows north toward ". | |||||
"**published** commits.\n")); | |||||
} | |||||
private function lookPublished() { | |||||
echo tsprintf( | |||||
"%W\n\n", | |||||
pht( | |||||
'You walk along the narrow bank of the stream as it winds lazily '. | |||||
'downhill and turns east, gradually widening into a river.')); | |||||
$api = $this->getRepositoryAPI(); | |||||
$published = $api->getPublishedCommitHashes(); | |||||
if ($published) { | |||||
echo tsprintf( | |||||
"%W\n\n", | |||||
pht( | |||||
'Floating on the water, you see published commits:')); | |||||
foreach ($published as $hash) { | |||||
echo tsprintf( | |||||
"%s\n", | |||||
$hash); | |||||
} | |||||
echo tsprintf( | |||||
"\n%W\n", | |||||
pht( | |||||
'They river bubbles peacefully.')); | |||||
} else { | |||||
echo tsprintf( | |||||
"%W\n", | |||||
pht( | |||||
'The river bubbles quietly, but you do not see any published '. | |||||
'commits anywhere.')); | |||||
} | |||||
} | } | ||||
} | } |