diff -r c2092612c424 -r 79b2c98ab7b4 mercurial/merge.py --- a/mercurial/merge.py Sat Jun 11 00:26:25 2022 +0200 +++ b/mercurial/merge.py Thu Jun 16 15:20:48 2022 +0200 @@ -2436,6 +2436,7 @@ status = repo.status(match=matcher, ignored=ignored, unknown=unknown) if confirm: + msg = None nb_ignored = len(status.ignored) nb_unknown = len(status.unknown) if nb_unknown and nb_ignored: @@ -2457,12 +2458,12 @@ b"permanently delete at least %d empty directories?" ) msg %= dir_count - else: - # XXX we might be missing directory there - return res - msg += b" (yN)$$ &Yes $$ &No" - if repo.ui.promptchoice(msg, default=1) == 1: - raise error.CanceledError(_(b'removal cancelled')) + if msg is None: + return res + else: + msg += b" (yN)$$ &Yes $$ &No" + if repo.ui.promptchoice(msg, default=1) == 1: + raise error.CanceledError(_(b'removal cancelled')) if removefiles: for f in sorted(status.unknown + status.ignored):