Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14773228
D18858.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D18858.diff
View Options
diff --git a/src/workflow/ArcanistWorkflow.php b/src/workflow/ArcanistWorkflow.php
--- a/src/workflow/ArcanistWorkflow.php
+++ b/src/workflow/ArcanistWorkflow.php
@@ -814,6 +814,31 @@
return empty($this->arguments['allow-untracked']);
}
+ final protected function promptForUntracked($api, $untracked) {
+ $prompt = pht(' y - Ignore %d untracked path(s) and continue',
+ phutil_count($untracked))."\n".
+ pht(' ! - Delete %d untracked path(s) and continue',
+ phutil_count($untracked))."\n".
+ pht(' N - Abort')."\n".
+ "[y/!/N] ?";
+
+ do {
+ $response = phutil_console_prompt($prompt);
+ $c = trim(strtolower($response));
+ } while ($c != 'y' && $c != 'n' && $c != '!' && $c != '');
+ echo "\n";
+
+ if ($c == '' || $c == 'n') {
+ throw new ArcanistUserAbortException();
+ }
+
+ if ($c == '!') {
+ foreach ($untracked as $path) {
+ Filesystem::remove($path);
+ }
+ }
+ }
+
final public function setCommitMode($mode) {
$this->commitMode = $mode;
return $this;
@@ -931,7 +956,7 @@
if ($untracked) {
echo sprintf(
"%s\n\n%s",
- pht('You have untracked files in this working copy.'),
+ pht('You have untracked paths in this working copy.'),
$working_copy_desc);
if ($api instanceof ArcanistGitAPI) {
@@ -958,13 +983,7 @@
$hint,
$untracked_list);
- $prompt = pht(
- 'Ignore these %s untracked file(s) and continue?',
- phutil_count($untracked));
-
- if (!phutil_console_confirm($prompt)) {
- throw new ArcanistUserAbortException();
- }
+ $this->promptForUntracked($api, $untracked);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 25, 12:27 AM (5 h, 27 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7045194
Default Alt Text
D18858.diff (1 KB)
Attached To
Mode
D18858: Offer to remove untracked files, so they don't crop up again
Attached
Detach File
Event Timeline
Log In to Comment