Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/merge.py @ 49431:79b2c98ab7b4
branching: merge stable into default
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Thu, 16 Jun 2022 15:20:48 +0200 |
parents | 2e726c934fcd 0cc5f74ff7f0 |
children | becd16690cbe |
comparison
equal
deleted
inserted
replaced
49364:c2092612c424 | 49431:79b2c98ab7b4 |
---|---|
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) |