mercurial/merge.py
branchstable
changeset 49344 0cc5f74ff7f0
parent 48805 d4486810a179
child 49365 79b2c98ab7b4
--- a/mercurial/merge.py	Wed Jun 08 19:15:58 2022 +0200
+++ b/mercurial/merge.py	Tue Jun 14 11:26:18 2022 +0200
@@ -2442,6 +2442,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:
@@ -2463,12 +2464,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):