Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistWorkflow.php
Show First 20 Lines • Show All 926 Lines • ▼ Show 20 Lines | if ($untracked || $unstaged || $uncommitted) { | ||||
$uncommitted_list = " ".implode("\n ", $uncommitted); | $uncommitted_list = " ".implode("\n ", $uncommitted); | ||||
$lists[] = pht( | $lists[] = pht( | ||||
" Uncommitted changes in working copy:\n%s", | " Uncommitted changes in working copy:\n%s", | ||||
$uncommitted_list); | $uncommitted_list); | ||||
} | } | ||||
echo implode("\n\n", $lists)."\n"; | echo implode("\n\n", $lists)."\n"; | ||||
$all_uncommitted = array_merge($unstaged, $uncommitted); | $all_uncommitted = array_merge($untracked, $unstaged, $uncommitted); | ||||
if ($this->askForAdd($all_uncommitted)) { | if ($this->askForAdd($all_uncommitted)) { | ||||
if ($untracked) { | |||||
$api->addToCommit($untracked); | |||||
} | |||||
if ($unstaged) { | if ($unstaged) { | ||||
$api->addToCommit($unstaged); | $api->addToCommit($unstaged); | ||||
} | } | ||||
$should_commit = true; | $should_commit = true; | ||||
} else { | } else { | ||||
$permit_autostash = $this->getConfigFromAnySource( | $permit_autostash = $this->getConfigFromAnySource( | ||||
'arc.autostash', | 'arc.autostash', | ||||
false); | false); | ||||
Show All 26 Lines | if ($should_commit) { | ||||
$commit = head($api->getLocalCommitInformation()); | $commit = head($api->getLocalCommitInformation()); | ||||
$api->amendCommit($commit['message']); | $api->amendCommit($commit['message']); | ||||
} else if ($api->supportsLocalCommits()) { | } else if ($api->supportsLocalCommits()) { | ||||
$template = | $template = | ||||
"\n\n". | "\n\n". | ||||
"# ".pht('Enter a commit message.')."\n#\n". | "# ".pht('Enter a commit message.')."\n#\n". | ||||
"# ".pht('Changes:')."\n#\n"; | "# ".pht('Changes:')."\n#\n"; | ||||
foreach ($untracked as $untracked_path) { | |||||
$template .= "# ".$untracked_path." (".pht('Added').")\n"; | |||||
} | |||||
$paths = array_merge($uncommitted, $unstaged); | $paths = array_merge($uncommitted, $unstaged); | ||||
$paths = array_unique($paths); | $paths = array_unique($paths); | ||||
sort($paths); | sort($paths); | ||||
foreach ($paths as $path) { | foreach ($paths as $path) { | ||||
$template .= "# ".$path."\n"; | $template .= "# ".$path."\n"; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 964 Lines • Show Last 20 Lines |