Show More
@@ -2386,9 +2386,19 b' def purge(' | |||||
2386 | elif nb_ignored: |
|
2386 | elif nb_ignored: | |
2387 | msg = _(b"permanently delete %d ignored files?") |
|
2387 | msg = _(b"permanently delete %d ignored files?") | |
2388 | msg %= nb_ignored |
|
2388 | msg %= nb_ignored | |
2389 |
el |
|
2389 | elif removeemptydirs: | |
2390 | # XXX we might be missing directory there |
|
2390 | dir_count = 0 | |
2391 |
r |
|
2391 | for f in directories: | |
|
2392 | if matcher(f) and not repo.wvfs.listdir(f): | |||
|
2393 | dir_count += 1 | |||
|
2394 | if dir_count: | |||
|
2395 | msg = _( | |||
|
2396 | b"permanently delete at least %d empty directories?" | |||
|
2397 | ) | |||
|
2398 | msg %= dir_count | |||
|
2399 | else: | |||
|
2400 | # XXX we might be missing directory there | |||
|
2401 | return res | |||
2392 | msg += b" (yN)$$ &Yes $$ &No" |
|
2402 | msg += b" (yN)$$ &Yes $$ &No" | |
2393 | if repo.ui.promptchoice(msg, default=1) == 1: |
|
2403 | if repo.ui.promptchoice(msg, default=1) == 1: | |
2394 | raise error.CanceledError(_(b'removal cancelled')) |
|
2404 | raise error.CanceledError(_(b'removal cancelled')) |
@@ -23,6 +23,10 b' delete an empty directory' | |||||
23 | $ mkdir empty_dir |
|
23 | $ mkdir empty_dir | |
24 | $ hg purge -p -v |
|
24 | $ hg purge -p -v | |
25 | empty_dir |
|
25 | empty_dir | |
|
26 | $ hg purge --confirm | |||
|
27 | permanently delete at least 1 empty directories? (yN) n | |||
|
28 | abort: removal cancelled | |||
|
29 | [250] | |||
26 | $ hg purge -v |
|
30 | $ hg purge -v | |
27 | removing directory empty_dir |
|
31 | removing directory empty_dir | |
28 | $ ls -A |
|
32 | $ ls -A |
General Comments 0
You need to be logged in to leave comments.
Login now