equal
deleted
inserted
replaced
2434 matcher.traversedir = directories.append |
2434 matcher.traversedir = directories.append |
2435 |
2435 |
2436 status = repo.status(match=matcher, ignored=ignored, unknown=unknown) |
2436 status = repo.status(match=matcher, ignored=ignored, unknown=unknown) |
2437 |
2437 |
2438 if confirm: |
2438 if confirm: |
|
2439 msg = None |
2439 nb_ignored = len(status.ignored) |
2440 nb_ignored = len(status.ignored) |
2440 nb_unknown = len(status.unknown) |
2441 nb_unknown = len(status.unknown) |
2441 if nb_unknown and nb_ignored: |
2442 if nb_unknown and nb_ignored: |
2442 msg = _(b"permanently delete %d unknown and %d ignored files?") |
2443 msg = _(b"permanently delete %d unknown and %d ignored files?") |
2443 msg %= (nb_unknown, nb_ignored) |
2444 msg %= (nb_unknown, nb_ignored) |
2455 if dir_count: |
2456 if dir_count: |
2456 msg = _( |
2457 msg = _( |
2457 b"permanently delete at least %d empty directories?" |
2458 b"permanently delete at least %d empty directories?" |
2458 ) |
2459 ) |
2459 msg %= dir_count |
2460 msg %= dir_count |
2460 else: |
2461 if msg is None: |
2461 # XXX we might be missing directory there |
2462 return res |
2462 return res |
2463 else: |
2463 msg += b" (yN)$$ &Yes $$ &No" |
2464 msg += b" (yN)$$ &Yes $$ &No" |
2464 if repo.ui.promptchoice(msg, default=1) == 1: |
2465 if repo.ui.promptchoice(msg, default=1) == 1: |
2465 raise error.CanceledError(_(b'removal cancelled')) |
2466 raise error.CanceledError(_(b'removal cancelled')) |
2466 |
2467 |
2467 if removefiles: |
2468 if removefiles: |
2468 for f in sorted(status.unknown + status.ignored): |
2469 for f in sorted(status.unknown + status.ignored): |
2469 if not noop: |
2470 if not noop: |
2470 repo.ui.note(_(b'removing file %s\n') % f) |
2471 repo.ui.note(_(b'removing file %s\n') % f) |