ui.prompt: Show prompt and selection in non-interactive mode
authorMads Kiilerich <mads@kiilerich.com>
Sun, 21 Jun 2009 03:13:38 +0200
changeset 8940 01ada7b1861d
parent 8939 bc9ac7a29a73
child 8941 37a9d551346c
ui.prompt: Show prompt and selection in non-interactive mode ui.prompt was completely silent in non-interactive mode, unless in verbose mode. It is fine that it chooses the default automatically, but it is confusing that the message and prompt shown interactively can't be found in scripted tests. The prompt and selection is now .write'ed instead of .note'ed.
mercurial/ui.py
tests/test-merge-prompt.out
tests/test-merge-tools.out
--- a/mercurial/ui.py	Thu Jun 25 09:53:47 2009 +0200
+++ b/mercurial/ui.py	Sun Jun 21 03:13:38 2009 +0200
@@ -277,7 +277,7 @@
         insensitive. If ui is not interactive, the default is returned.
         """
         if not self.interactive():
-            self.note(msg, ' ', default, "\n")
+            self.write(msg, ' ', default, "\n")
             return default
         while True:
             try:
--- a/tests/test-merge-prompt.out	Thu Jun 25 09:53:47 2009 +0200
+++ b/tests/test-merge-prompt.out	Sun Jun 21 03:13:38 2009 +0200
@@ -4,6 +4,10 @@
 created new head
 
 # non-interactive merge
+ local changed file1 which remote deleted
+use (c)hanged version or (d)elete? c
+remote changed file2 which local deleted
+use (c)hanged version or leave (d)eleted? c
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 status:
--- a/tests/test-merge-tools.out	Thu Jun 25 09:53:47 2009 +0200
+++ b/tests/test-merge-tools.out	Sun Jun 21 03:13:38 2009 +0200
@@ -304,6 +304,8 @@
 true.executable=cat
 # hg update -C 1
 # hg merge -r 2 --config ui.merge=internal:prompt
+ no tool found to merge f
+keep (l)ocal or take (o)ther? l
 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 # cat f
@@ -512,6 +514,8 @@
 revision 2
 space
 merging f
+ output file f appears unchanged
+was merge successful (yn)? n
 merging f failed!
 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
 use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon