mercurial/merge.py
changeset 49365 79b2c98ab7b4
parent 49306 2e726c934fcd
parent 49344 0cc5f74ff7f0
child 49883 becd16690cbe
--- 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):