Patchwork [1,of,2] ui: show prompt choice if input is not a tty but is forced to be interactive

login
register
mail settings
Submitter Mads Kiilerich
Date Sept. 30, 2014, 11:13 p.m.
Message ID <9c2c63ed69f0b417f3f8.1412118798@ssl.google-analytics.com>
Download mbox | patch
Permalink /patch/6057/
State Accepted
Headers show

Comments

Mads Kiilerich - Sept. 30, 2014, 11:13 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1412118258 -7200
#      Wed Oct 01 01:04:18 2014 +0200
# Node ID 9c2c63ed69f0b417f3f8d3f9104cc4b02f6f6946
# Parent  3ccf9a9d3a6650914311d0e2b9b44a449614b5d5
ui: show prompt choice if input is not a tty but is forced to be interactive

The tests often set ui.interactive to control normally interactive prompts from
stdin. That gave an output where it was non-obvious what prompts got which
which response, and the output lacked the newline users would see after input.

Instead, if the input not is a tty, write the selection and a newline.

Patch

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -681,7 +681,9 @@  class ui(object):
         try:
             r = self._readline(self.label(msg, 'ui.prompt'))
             if not r:
-                return default
+                r = default
+            if not util.isatty(self.fin):
+                self.write(r, "\n")
             return r
         except EOFError:
             raise util.Abort(_('response expected'))
diff --git a/tests/test-diff-color.t b/tests/test-diff-color.t
--- a/tests/test-diff-color.t
+++ b/tests/test-diff-color.t
@@ -85,7 +85,8 @@  record
   \x1b[0;36;1mold mode 100644\x1b[0m (esc)
   \x1b[0;36;1mnew mode 100755\x1b[0m (esc)
   1 hunks, 1 lines changed
-  \x1b[0;33mexamine changes to 'a'? [Ynesfdaq?]\x1b[0m  (esc)
+  \x1b[0;33mexamine changes to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
+  
   \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
    c
    a
@@ -95,7 +96,8 @@  record
    a
    a
    c
-  \x1b[0;33mrecord this change to 'a'? [Ynesfdaq?]\x1b[0m  (esc)
+  \x1b[0;33mrecord this change to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
+  
 
   $ echo "[extensions]" >> $HGRCPATH
   $ echo "mq=" >> $HGRCPATH
@@ -113,7 +115,8 @@  qrecord
   \x1b[0;36;1mold mode 100644\x1b[0m (esc)
   \x1b[0;36;1mnew mode 100755\x1b[0m (esc)
   1 hunks, 1 lines changed
-  \x1b[0;33mexamine changes to 'a'? [Ynesfdaq?]\x1b[0m  (esc)
+  \x1b[0;33mexamine changes to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
+  
   \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
    c
    a
@@ -123,7 +126,8 @@  qrecord
    a
    a
    c
-  \x1b[0;33mrecord this change to 'a'? [Ynesfdaq?]\x1b[0m  (esc)
+  \x1b[0;33mrecord this change to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
+  
 
   $ hg qpop -a
   popping patch
diff --git a/tests/test-issue3084.t b/tests/test-issue3084.t
--- a/tests/test-issue3084.t
+++ b/tests/test-issue3084.t
@@ -29,7 +29,8 @@  Normal file in the working copy, keeping
 
   $ echo "n" | hg merge --config ui.interactive=Yes
   remote turned local normal file foo into a largefile
-  use (l)argefile or keep (n)ormal file? getting changed largefiles
+  use (l)argefile or keep (n)ormal file? n
+  getting changed largefiles
   0 largefiles updated, 0 removed
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -43,7 +44,8 @@  Normal file in the working copy, keeping
   $ hg update -q -C
   $ echo "l" | hg merge --config ui.interactive=Yes
   remote turned local normal file foo into a largefile
-  use (l)argefile or keep (n)ormal file? getting changed largefiles
+  use (l)argefile or keep (n)ormal file? l
+  getting changed largefiles
   1 largefiles updated, 0 removed
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -71,7 +73,8 @@  Largefile in the working copy, keeping t
   $ hg update -q -C -r 1
   $ echo "n" | hg merge --config ui.interactive=Yes
   remote turned local largefile foo into a normal file
-  keep (l)argefile or use (n)ormal file? getting changed largefiles
+  keep (l)argefile or use (n)ormal file? n
+  getting changed largefiles
   0 largefiles updated, 0 removed
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -99,7 +102,8 @@  Largefile in the working copy, keeping t
   $ hg update -q -C -r 1
   $ echo "l" | hg merge --config ui.interactive=Yes
   remote turned local largefile foo into a normal file
-  keep (l)argefile or use (n)ormal file? getting changed largefiles
+  keep (l)argefile or use (n)ormal file? l
+  getting changed largefiles
   1 largefiles updated, 0 removed
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -243,8 +247,10 @@  Ancestor: normal  Parent: normal2  Paren
   $ hg up -Cqr normal2
   $ ( echo c; echo n ) | hg merge -r large --config ui.interactive=Yes
   local changed f which remote deleted
-  use (c)hanged version or (d)elete? remote turned local normal file f into a largefile
-  use (l)argefile or keep (n)ormal file? getting changed largefiles
+  use (c)hanged version or (d)elete? c
+  remote turned local normal file f into a largefile
+  use (l)argefile or keep (n)ormal file? n
+  getting changed largefiles
   0 largefiles updated, 0 removed
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -254,7 +260,8 @@  Ancestor: normal  Parent: normal2  Paren
   $ hg up -Cqr normal2
   $ echo d | hg merge -r large --config ui.interactive=Yes
   local changed f which remote deleted
-  use (c)hanged version or (d)elete? getting changed largefiles
+  use (c)hanged version or (d)elete? d
+  getting changed largefiles
   1 largefiles updated, 0 removed
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -279,8 +286,10 @@  swap
   $ hg up -Cqr large
   $ ( echo c; echo n ) | hg merge -r normal2 --config ui.interactive=Yes
   remote changed f which local deleted
-  use (c)hanged version or leave (d)eleted? remote turned local largefile f into a normal file
-  keep (l)argefile or use (n)ormal file? getting changed largefiles
+  use (c)hanged version or leave (d)eleted? c
+  remote turned local largefile f into a normal file
+  keep (l)argefile or use (n)ormal file? n
+  getting changed largefiles
   0 largefiles updated, 0 removed
   2 files updated, 0 files merged, 1 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -290,7 +299,8 @@  swap
   $ hg up -Cqr large
   $ echo d | hg merge -r normal2 --config ui.interactive=Yes
   remote changed f which local deleted
-  use (c)hanged version or leave (d)eleted? getting changed largefiles
+  use (c)hanged version or leave (d)eleted? d
+  getting changed largefiles
   0 largefiles updated, 0 removed
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -336,7 +346,8 @@  Ancestor: large   Parent: large2   Paren
   $ hg up -Cqr large2
   $ echo d | hg merge -r normal --config ui.interactive=Yes
   local changed .hglf/f which remote deleted
-  use (c)hanged version or (d)elete? getting changed largefiles
+  use (c)hanged version or (d)elete? d
+  getting changed largefiles
   0 largefiles updated, 0 removed
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -361,7 +372,8 @@  swap
   $ hg up -Cqr normal
   $ echo d | hg merge -r large2 --config ui.interactive=Yes
   remote changed .hglf/f which local deleted
-  use (c)hanged version or leave (d)eleted? 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  use (c)hanged version or leave (d)eleted? d
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
   $ cat f
   normal
diff --git a/tests/test-keyword.t b/tests/test-keyword.t
--- a/tests/test-keyword.t
+++ b/tests/test-keyword.t
@@ -343,18 +343,21 @@  record chunk
   > EOF
   diff --git a/a b/a
   2 hunks, 2 lines changed
-  examine changes to 'a'? [Ynesfdaq?] 
+  examine changes to 'a'? [Ynesfdaq?] y
+  
   @@ -1,3 +1,4 @@
    expand $Id$
   +foo
    do not process $Id:
    xxx $
-  record change 1/2 to 'a'? [Ynesfdaq?] 
+  record change 1/2 to 'a'? [Ynesfdaq?] y
+  
   @@ -2,2 +3,3 @@
    do not process $Id:
    xxx $
   +bar
-  record change 2/2 to 'a'? [Ynesfdaq?] 
+  record change 2/2 to 'a'? [Ynesfdaq?] n
+  
 
   $ hg identify
   5f5eb23505c3+ tip
@@ -400,18 +403,21 @@  Record all chunks in file a
   > EOF
   diff --git a/a b/a
   2 hunks, 2 lines changed
-  examine changes to 'a'? [Ynesfdaq?] 
+  examine changes to 'a'? [Ynesfdaq?] y
+  
   @@ -1,3 +1,4 @@
    expand $Id$
   +foo
    do not process $Id:
    xxx $
-  record change 1/2 to 'a'? [Ynesfdaq?] 
+  record change 1/2 to 'a'? [Ynesfdaq?] y
+  
   @@ -2,2 +3,3 @@
    do not process $Id:
    xxx $
   +bar
-  record change 2/2 to 'a'? [Ynesfdaq?] 
+  record change 2/2 to 'a'? [Ynesfdaq?] y
+  
 
 File a should be clean
 
@@ -467,7 +473,8 @@  record added file alone
   > EOF
   diff --git a/r b/r
   new file mode 100644
-  examine changes to 'r'? [Ynesfdaq?] 
+  examine changes to 'r'? [Ynesfdaq?] y
+  
   r
   committed changeset 3:82a2f715724d
   overwriting r expanding keywords
@@ -491,7 +498,8 @@  record added keyword ignored file
   > EOF
   diff --git a/i b/i
   new file mode 100644
-  examine changes to 'i'? [Ynesfdaq?] 
+  examine changes to 'i'? [Ynesfdaq?] y
+  
   i
   committed changeset 3:9f40ceb5a072
   $ cat i
diff --git a/tests/test-largefiles-update.t b/tests/test-largefiles-update.t
--- a/tests/test-largefiles-update.t
+++ b/tests/test-largefiles-update.t
@@ -64,7 +64,8 @@  Test that "hg merge" updates largefiles 
   largefile large1 has a merge conflict
   ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
   keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
-  take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? merging normal1
+  take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
+  merging normal1
   warning: conflicts during merge.
   merging normal1 incomplete! (edit conflicts, then use 'hg resolve --mark')
   getting changed largefiles
@@ -249,7 +250,8 @@  Test that linear merge can detect modifi
   largefile large1 has a merge conflict
   ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
   keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
-  take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? getting changed largefiles
+  take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? o
+  getting changed largefiles
   1 largefiles updated, 0 removed
   1 files updated, 1 files merged, 0 files removed, 0 files unresolved
   $ hg status -A large1
@@ -432,14 +434,19 @@  Test that the internal linear merging wo
   > l
   > EOF
    subrepository sub diverged (local revision: f74e50bd9e55, remote revision: d65e59e952a9)
-  (M)erge, keep (l)ocal or keep (r)emote?  subrepository sources for sub differ (in checked out version)
+  (M)erge, keep (l)ocal or keep (r)emote? m
+   subrepository sources for sub differ (in checked out version)
   use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9)?
-   local changed .hglf/large2 which remote deleted
-  use (c)hanged version or (d)elete? remote turned local largefile large2 into a normal file
-  keep (l)argefile or use (n)ormal file? largefile large1 has a merge conflict
+   r
+  local changed .hglf/large2 which remote deleted
+  use (c)hanged version or (d)elete? c
+  remote turned local largefile large2 into a normal file
+  keep (l)argefile or use (n)ormal file? l
+  largefile large1 has a merge conflict
   ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
   keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
-  take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
+  2 files updated, 1 files merged, 0 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
   $ hg -R sub status -A sub/large1
@@ -472,7 +479,8 @@  it is aborted by conflict.
   largefile large1 has a merge conflict
   ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
   keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
-  take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? merging normal1
+  take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
+  merging normal1
   warning: conflicts during merge.
   merging normal1 incomplete! (edit conflicts, then use 'hg resolve --mark')
   unresolved conflicts (see hg resolve, then hg rebase --continue)
diff --git a/tests/test-merge-prompt.t b/tests/test-merge-prompt.t
--- a/tests/test-merge-prompt.t
+++ b/tests/test-merge-prompt.t
@@ -71,8 +71,10 @@  Interactive merge:
   > d
   > EOF
   local changed file1 which remote deleted
-  use (c)hanged version or (d)elete? remote changed file2 which local deleted
-  use (c)hanged version or leave (d)eleted? 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  use (c)hanged version or (d)elete? c
+  remote changed file2 which local deleted
+  use (c)hanged version or leave (d)eleted? d
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
 
   $ status
@@ -98,14 +100,19 @@  Interactive merge with bad input:
   > c
   > EOF
   local changed file1 which remote deleted
-  use (c)hanged version or (d)elete? unrecognized response
+  use (c)hanged version or (d)elete? foo
+  unrecognized response
   local changed file1 which remote deleted
-  use (c)hanged version or (d)elete? unrecognized response
+  use (c)hanged version or (d)elete? bar
+  unrecognized response
   local changed file1 which remote deleted
-  use (c)hanged version or (d)elete? remote changed file2 which local deleted
-  use (c)hanged version or leave (d)eleted? unrecognized response
+  use (c)hanged version or (d)elete? d
   remote changed file2 which local deleted
-  use (c)hanged version or leave (d)eleted? 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  use (c)hanged version or leave (d)eleted? baz
+  unrecognized response
+  remote changed file2 which local deleted
+  use (c)hanged version or leave (d)eleted? c
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
 
   $ status
@@ -127,7 +134,8 @@  Interactive merge with not enough input:
   > d
   > EOF
   local changed file1 which remote deleted
-  use (c)hanged version or (d)elete? remote changed file2 which local deleted
+  use (c)hanged version or (d)elete? d
+  remote changed file2 which local deleted
   use (c)hanged version or leave (d)eleted? abort: response expected
   [255]
 
diff --git a/tests/test-mq-qrefresh-interactive.t b/tests/test-mq-qrefresh-interactive.t
--- a/tests/test-mq-qrefresh-interactive.t
+++ b/tests/test-mq-qrefresh-interactive.t
@@ -181,22 +181,26 @@  partial qrefresh
   > EOF
   diff --git a/1.txt b/1.txt
   2 hunks, 2 lines changed
-  examine changes to '1.txt'? [Ynesfdaq?] 
+  examine changes to '1.txt'? [Ynesfdaq?] y
+  
   @@ -1,3 +1,3 @@
    1
   -2
   +2 2
    3
-  record change 1/4 to '1.txt'? [Ynesfdaq?] 
+  record change 1/4 to '1.txt'? [Ynesfdaq?] y
+  
   @@ -3,3 +3,3 @@
    3
   -4
   +4 4
    5
-  record change 2/4 to '1.txt'? [Ynesfdaq?] 
+  record change 2/4 to '1.txt'? [Ynesfdaq?] n
+  
   diff --git a/2.txt b/2.txt
   1 hunks, 1 lines changed
-  examine changes to '2.txt'? [Ynesfdaq?] 
+  examine changes to '2.txt'? [Ynesfdaq?] y
+  
   @@ -1,5 +1,5 @@
    a
   -b
@@ -204,10 +208,12 @@  partial qrefresh
    c
    d
    e
-  record change 3/4 to '2.txt'? [Ynesfdaq?] 
+  record change 3/4 to '2.txt'? [Ynesfdaq?] y
+  
   diff --git a/dir/a.txt b/dir/a.txt
   1 hunks, 1 lines changed
-  examine changes to 'dir/a.txt'? [Ynesfdaq?] 
+  examine changes to 'dir/a.txt'? [Ynesfdaq?] n
+  
 
 After partial qrefresh 'tip'
 
@@ -275,7 +281,8 @@  qrefresh interactively everything else
   > EOF
   diff --git a/1.txt b/1.txt
   1 hunks, 1 lines changed
-  examine changes to '1.txt'? [Ynesfdaq?] 
+  examine changes to '1.txt'? [Ynesfdaq?] y
+  
   @@ -1,5 +1,5 @@
    1
    2 2
@@ -283,17 +290,20 @@  qrefresh interactively everything else
   -4
   +4 4
    5
-  record change 1/2 to '1.txt'? [Ynesfdaq?] 
+  record change 1/2 to '1.txt'? [Ynesfdaq?] y
+  
   diff --git a/dir/a.txt b/dir/a.txt
   1 hunks, 1 lines changed
-  examine changes to 'dir/a.txt'? [Ynesfdaq?] 
+  examine changes to 'dir/a.txt'? [Ynesfdaq?] y
+  
   @@ -1,4 +1,4 @@
   -hello world
   +hello world!
    
    someone
    up
-  record change 2/2 to 'dir/a.txt'? [Ynesfdaq?] 
+  record change 2/2 to 'dir/a.txt'? [Ynesfdaq?] y
+  
 
 After final qrefresh 'tip'
 
diff --git a/tests/test-mq-subrepo.t b/tests/test-mq-subrepo.t
--- a/tests/test-mq-subrepo.t
+++ b/tests/test-mq-subrepo.t
@@ -291,7 +291,8 @@  handle subrepos safely on qrecord
   % qrecord --config ui.interactive=1 -m0 0.diff
   diff --git a/.hgsub b/.hgsub
   new file mode 100644
-  examine changes to '.hgsub'? [Ynesfdaq?] 
+  examine changes to '.hgsub'? [Ynesfdaq?] y
+  
   abort: uncommitted changes in subrepository sub
   [255]
   % update substate when adding .hgsub w/clean updated subrepo
@@ -299,7 +300,8 @@  handle subrepos safely on qrecord
   % qrecord --config ui.interactive=1 -m0 0.diff
   diff --git a/.hgsub b/.hgsub
   new file mode 100644
-  examine changes to '.hgsub'? [Ynesfdaq?] 
+  examine changes to '.hgsub'? [Ynesfdaq?] y
+  
   path sub
    source   sub
    revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
@@ -315,11 +317,13 @@  handle subrepos safely on qrecord
   % qrecord --config ui.interactive=1 -m1 1.diff
   diff --git a/.hgsub b/.hgsub
   1 hunks, 1 lines changed
-  examine changes to '.hgsub'? [Ynesfdaq?] 
+  examine changes to '.hgsub'? [Ynesfdaq?] y
+  
   @@ -1,1 +1,2 @@
    sub = sub
   +sub2 = sub2
-  record this change to '.hgsub'? [Ynesfdaq?] 
+  record this change to '.hgsub'? [Ynesfdaq?] y
+  
   abort: uncommitted changes in subrepository sub2
   [255]
   % update substate when modifying .hgsub w/clean updated subrepo
@@ -327,11 +331,13 @@  handle subrepos safely on qrecord
   % qrecord --config ui.interactive=1 -m1 1.diff
   diff --git a/.hgsub b/.hgsub
   1 hunks, 1 lines changed
-  examine changes to '.hgsub'? [Ynesfdaq?] 
+  examine changes to '.hgsub'? [Ynesfdaq?] y
+  
   @@ -1,1 +1,2 @@
    sub = sub
   +sub2 = sub2
-  record this change to '.hgsub'? [Ynesfdaq?] 
+  record this change to '.hgsub'? [Ynesfdaq?] y
+  
   path sub
    source   sub
    revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
@@ -352,7 +358,8 @@  handle subrepos safely on qrecord
   % qrecord --config ui.interactive=1 -m2 2.diff
   diff --git a/.hgsub b/.hgsub
   deleted file mode 100644
-  examine changes to '.hgsub'? [Ynesfdaq?] 
+  examine changes to '.hgsub'? [Ynesfdaq?] y
+  
   % debugsub should be empty
 
   $ hg qpop -qa
@@ -367,7 +374,8 @@  handle subrepos safely on qrecord
   % qrecord --config ui.interactive=1 -m3 3.diff
   diff --git a/.hgsub b/.hgsub
   deleted file mode 100644
-  examine changes to '.hgsub'? [Ynesfdaq?] 
+  examine changes to '.hgsub'? [Ynesfdaq?] y
+  
   % debugsub should be empty
 
   $ cd ..
diff --git a/tests/test-patchbomb.t b/tests/test-patchbomb.t
--- a/tests/test-patchbomb.t
+++ b/tests/test-patchbomb.t
@@ -82,7 +82,8 @@  Mercurial-patchbomb/.* -> Mercurial-patc
    a |  1 +
    1 files changed, 1 insertions(+), 0 deletions(-)
   
-  are you sure you want to send (yn)? abort: patchbomb canceled
+  are you sure you want to send (yn)? n
+  abort: patchbomb canceled
   [255]
 
   $ echo b > b
diff --git a/tests/test-qrecord.t b/tests/test-qrecord.t
--- a/tests/test-qrecord.t
+++ b/tests/test-qrecord.t
@@ -246,22 +246,26 @@  qrecord a.patch
   > EOF
   diff --git a/1.txt b/1.txt
   2 hunks, 2 lines changed
-  examine changes to '1.txt'? [Ynesfdaq?] 
+  examine changes to '1.txt'? [Ynesfdaq?] y
+  
   @@ -1,3 +1,3 @@
    1
   -2
   +2 2
    3
-  record change 1/4 to '1.txt'? [Ynesfdaq?] 
+  record change 1/4 to '1.txt'? [Ynesfdaq?] y
+  
   @@ -3,3 +3,3 @@
    3
   -4
   +4 4
    5
-  record change 2/4 to '1.txt'? [Ynesfdaq?] 
+  record change 2/4 to '1.txt'? [Ynesfdaq?] n
+  
   diff --git a/2.txt b/2.txt
   1 hunks, 1 lines changed
-  examine changes to '2.txt'? [Ynesfdaq?] 
+  examine changes to '2.txt'? [Ynesfdaq?] y
+  
   @@ -1,5 +1,5 @@
    a
   -b
@@ -269,10 +273,12 @@  qrecord a.patch
    c
    d
    e
-  record change 3/4 to '2.txt'? [Ynesfdaq?] 
+  record change 3/4 to '2.txt'? [Ynesfdaq?] y
+  
   diff --git a/dir/a.txt b/dir/a.txt
   1 hunks, 1 lines changed
-  examine changes to 'dir/a.txt'? [Ynesfdaq?] 
+  examine changes to 'dir/a.txt'? [Ynesfdaq?] n
+  
 
 After qrecord a.patch 'tip'"
 
@@ -341,7 +347,8 @@  qrecord b.patch
   > EOF
   diff --git a/1.txt b/1.txt
   1 hunks, 1 lines changed
-  examine changes to '1.txt'? [Ynesfdaq?] 
+  examine changes to '1.txt'? [Ynesfdaq?] y
+  
   @@ -1,5 +1,5 @@
    1
    2 2
@@ -349,17 +356,20 @@  qrecord b.patch
   -4
   +4 4
    5
-  record change 1/2 to '1.txt'? [Ynesfdaq?] 
+  record change 1/2 to '1.txt'? [Ynesfdaq?] y
+  
   diff --git a/dir/a.txt b/dir/a.txt
   1 hunks, 1 lines changed
-  examine changes to 'dir/a.txt'? [Ynesfdaq?] 
+  examine changes to 'dir/a.txt'? [Ynesfdaq?] y
+  
   @@ -1,4 +1,4 @@
   -hello world
   +hello world!
    
    someone
    up
-  record change 2/2 to 'dir/a.txt'? [Ynesfdaq?] 
+  record change 2/2 to 'dir/a.txt'? [Ynesfdaq?] y
+  
 
 After qrecord b.patch 'tip'
 
diff --git a/tests/test-record.t b/tests/test-record.t
--- a/tests/test-record.t
+++ b/tests/test-record.t
@@ -18,7 +18,8 @@  Select no files
   > EOF
   diff --git a/empty-rw b/empty-rw
   new file mode 100644
-  examine changes to 'empty-rw'? [Ynesfdaq?] 
+  examine changes to 'empty-rw'? [Ynesfdaq?] n
+  
   no changes to record
 
   $ hg tip -p
@@ -37,7 +38,8 @@  Select files but no hunks
   > EOF
   diff --git a/empty-rw b/empty-rw
   new file mode 100644
-  examine changes to 'empty-rw'? [Ynesfdaq?] 
+  examine changes to 'empty-rw'? [Ynesfdaq?] y
+  
   abort: empty commit message
   [255]
 
@@ -57,7 +59,8 @@  Record empty file
   > EOF
   diff --git a/empty-rw b/empty-rw
   new file mode 100644
-  examine changes to 'empty-rw'? [Ynesfdaq?] 
+  examine changes to 'empty-rw'? [Ynesfdaq?] y
+  
 
   $ hg tip -p
   changeset:   0:c0708cf4e46e
@@ -86,7 +89,8 @@  Rename empty file
   diff --git a/empty-rw b/empty-rename
   rename from empty-rw
   rename to empty-rename
-  examine changes to 'empty-rw' and 'empty-rename'? [Ynesfdaq?] 
+  examine changes to 'empty-rw' and 'empty-rename'? [Ynesfdaq?] y
+  
 
   $ hg tip -p
   changeset:   1:d695e8dcb197
@@ -106,7 +110,8 @@  Copy empty file
   diff --git a/empty-rename b/empty-copy
   copy from empty-rename
   copy to empty-copy
-  examine changes to 'empty-rename' and 'empty-copy'? [Ynesfdaq?] 
+  examine changes to 'empty-rename' and 'empty-copy'? [Ynesfdaq?] y
+  
 
   $ hg tip -p
   changeset:   2:1d4b90bea524
@@ -125,7 +130,8 @@  Delete empty file
   > EOF
   diff --git a/empty-copy b/empty-copy
   deleted file mode 100644
-  examine changes to 'empty-copy'? [Ynesfdaq?] 
+  examine changes to 'empty-copy'? [Ynesfdaq?] y
+  
 
   $ hg tip -p
   changeset:   3:b39a238f01a1
@@ -147,7 +153,8 @@  Add binary file
   diff --git a/tip.bundle b/tip.bundle
   new file mode 100644
   this is a binary file
-  examine changes to 'tip.bundle'? [Ynesfdaq?] 
+  examine changes to 'tip.bundle'? [Ynesfdaq?] y
+  
 
   $ hg tip -p
   changeset:   4:ad816da3711e
@@ -169,7 +176,8 @@  Change binary file
   > EOF
   diff --git a/tip.bundle b/tip.bundle
   this modifies a binary file (all or nothing)
-  examine changes to 'tip.bundle'? [Ynesfdaq?] 
+  examine changes to 'tip.bundle'? [Ynesfdaq?] y
+  
 
   $ hg tip -p
   changeset:   5:dccd6f3eb485
@@ -194,7 +202,8 @@  Rename and change binary file
   rename from tip.bundle
   rename to top.bundle
   this modifies a binary file (all or nothing)
-  examine changes to 'tip.bundle' and 'top.bundle'? [Ynesfdaq?] 
+  examine changes to 'tip.bundle' and 'top.bundle'? [Ynesfdaq?] y
+  
 
   $ hg tip -p
   changeset:   6:7fa44105f5b3
@@ -222,7 +231,8 @@  Add plain file
   > EOF
   diff --git a/plain b/plain
   new file mode 100644
-  examine changes to 'plain'? [Ynesfdaq?] 
+  examine changes to 'plain'? [Ynesfdaq?] y
+  
 
   $ hg tip -p
   changeset:   7:11fb457c1be4
@@ -266,13 +276,15 @@  Modify end of plain file, also test that
   > EOF
   diff --git a/plain b/plain
   1 hunks, 1 lines changed
-  examine changes to 'plain'? [Ynesfdaq?] 
+  examine changes to 'plain'? [Ynesfdaq?] y
+  
   @@ -8,3 +8,4 @@ 7
    8
    9
    10
   +11
-  record this change to 'plain'? [Ynesfdaq?] 
+  record this change to 'plain'? [Ynesfdaq?] y
+  
 
 Modify end of plain file, no EOL
 
@@ -283,14 +295,16 @@  Modify end of plain file, no EOL
   > EOF
   diff --git a/plain b/plain
   1 hunks, 1 lines changed
-  examine changes to 'plain'? [Ynesfdaq?] 
+  examine changes to 'plain'? [Ynesfdaq?] y
+  
   @@ -9,3 +9,4 @@
    9
    10
    11
   +7264f99c5f5ff3261504828afa4fb4d406c3af54
   \ No newline at end of file
-  record this change to 'plain'? [Ynesfdaq?] 
+  record this change to 'plain'? [Ynesfdaq?] y
+  
 
 Modify end of plain file, add EOL
 
@@ -304,7 +318,8 @@  Modify end of plain file, add EOL
   > EOF
   diff --git a/plain b/plain
   1 hunks, 1 lines changed
-  examine changes to 'plain'? [Ynesfdaq?] 
+  examine changes to 'plain'? [Ynesfdaq?] y
+  
   @@ -9,4 +9,4 @@
    9
    10
@@ -312,10 +327,12 @@  Modify end of plain file, add EOL
   -7264f99c5f5ff3261504828afa4fb4d406c3af54
   \ No newline at end of file
   +7264f99c5f5ff3261504828afa4fb4d406c3af54
-  record change 1/2 to 'plain'? [Ynesfdaq?] 
+  record change 1/2 to 'plain'? [Ynesfdaq?] y
+  
   diff --git a/plain2 b/plain2
   new file mode 100644
-  examine changes to 'plain2'? [Ynesfdaq?] 
+  examine changes to 'plain2'? [Ynesfdaq?] y
+  
 
 Modify beginning, trim end, record both, add another file to test
 changes numbering
@@ -335,28 +352,33 @@  changes numbering
   > EOF
   diff --git a/plain b/plain
   2 hunks, 3 lines changed
-  examine changes to 'plain'? [Ynesfdaq?] 
+  examine changes to 'plain'? [Ynesfdaq?] y
+  
   @@ -1,4 +1,4 @@
   -1
   +2
    2
    3
    4
-  record change 1/3 to 'plain'? [Ynesfdaq?] 
+  record change 1/3 to 'plain'? [Ynesfdaq?] y
+  
   @@ -8,5 +8,3 @@
    8
    9
    10
   -11
   -7264f99c5f5ff3261504828afa4fb4d406c3af54
-  record change 2/3 to 'plain'? [Ynesfdaq?] 
+  record change 2/3 to 'plain'? [Ynesfdaq?] y
+  
   diff --git a/plain2 b/plain2
   1 hunks, 1 lines changed
-  examine changes to 'plain2'? [Ynesfdaq?] 
+  examine changes to 'plain2'? [Ynesfdaq?] y
+  
   @@ -1,1 +1,2 @@
    1
   +2
-  record change 3/3 to 'plain2'? [Ynesfdaq?] 
+  record change 3/3 to 'plain2'? [Ynesfdaq?] y
+  
 
   $ hg tip -p
   changeset:   11:21df83db12b8
@@ -404,7 +426,8 @@  Record end
   > EOF
   diff --git a/plain b/plain
   2 hunks, 4 lines changed
-  examine changes to 'plain'? [Ynesfdaq?] 
+  examine changes to 'plain'? [Ynesfdaq?] y
+  
   @@ -1,9 +1,6 @@
   -2
   -2
@@ -415,7 +438,8 @@  Record end
    7
    8
    9
-  record change 1/2 to 'plain'? [Ynesfdaq?] 
+  record change 1/2 to 'plain'? [Ynesfdaq?] n
+  
   @@ -4,7 +1,7 @@
    4
    5
@@ -425,7 +449,8 @@  Record end
    9
   -10
   +10.new
-  record change 2/2 to 'plain'? [Ynesfdaq?] 
+  record change 2/2 to 'plain'? [Ynesfdaq?] y
+  
 
   $ hg tip -p
   changeset:   12:99337501826f
@@ -453,7 +478,8 @@  Record beginning
   > EOF
   diff --git a/plain b/plain
   1 hunks, 3 lines changed
-  examine changes to 'plain'? [Ynesfdaq?] 
+  examine changes to 'plain'? [Ynesfdaq?] y
+  
   @@ -1,6 +1,3 @@
   -2
   -2
@@ -461,7 +487,8 @@  Record beginning
    4
    5
    6
-  record this change to 'plain'? [Ynesfdaq?] 
+  record this change to 'plain'? [Ynesfdaq?] y
+  
 
   $ hg tip -p
   changeset:   13:bbd45465d540
@@ -498,7 +525,8 @@  Record end
   > EOF
   diff --git a/plain b/plain
   2 hunks, 4 lines changed
-  examine changes to 'plain'? [Ynesfdaq?] 
+  examine changes to 'plain'? [Ynesfdaq?] y
+  
   @@ -1,6 +1,9 @@
   +1
   +2
@@ -509,7 +537,8 @@  Record end
    7
    8
    9
-  record change 1/2 to 'plain'? [Ynesfdaq?] 
+  record change 1/2 to 'plain'? [Ynesfdaq?] n
+  
   @@ -1,7 +4,6 @@
    4
    5
@@ -518,7 +547,8 @@  Record end
    8
    9
   -10.new
-  record change 2/2 to 'plain'? [Ynesfdaq?] 
+  record change 2/2 to 'plain'? [Ynesfdaq?] y
+  
 
 Add to beginning, middle, end
 
@@ -537,14 +567,16 @@  Record beginning, middle
   > EOF
   diff --git a/plain b/plain
   3 hunks, 7 lines changed
-  examine changes to 'plain'? [Ynesfdaq?] 
+  examine changes to 'plain'? [Ynesfdaq?] y
+  
   @@ -1,2 +1,5 @@
   +1
   +2
   +3
    4
    5
-  record change 1/3 to 'plain'? [Ynesfdaq?] 
+  record change 1/3 to 'plain'? [Ynesfdaq?] y
+  
   @@ -1,6 +4,8 @@
    4
    5
@@ -554,7 +586,8 @@  Record beginning, middle
    7
    8
    9
-  record change 2/3 to 'plain'? [Ynesfdaq?] 
+  record change 2/3 to 'plain'? [Ynesfdaq?] y
+  
   @@ -3,4 +8,6 @@
    6
    7
@@ -562,7 +595,8 @@  Record beginning, middle
    9
   +10
   +11
-  record change 3/3 to 'plain'? [Ynesfdaq?] 
+  record change 3/3 to 'plain'? [Ynesfdaq?] n
+  
 
   $ hg tip -p
   changeset:   15:f34a7937ec33
@@ -595,14 +629,16 @@  Record end
   > EOF
   diff --git a/plain b/plain
   1 hunks, 2 lines changed
-  examine changes to 'plain'? [Ynesfdaq?] 
+  examine changes to 'plain'? [Ynesfdaq?] y
+  
   @@ -9,3 +9,5 @@
    7
    8
    9
   +10
   +11
-  record this change to 'plain'? [Ynesfdaq?] 
+  record this change to 'plain'? [Ynesfdaq?] y
+  
 
   $ hg tip -p
   changeset:   16:f9900b71a04c
@@ -635,11 +671,13 @@  Record end
   > EOF
   diff --git a/subdir/a b/subdir/a
   1 hunks, 1 lines changed
-  examine changes to 'subdir/a'? [Ynesfdaq?] 
+  examine changes to 'subdir/a'? [Ynesfdaq?] y
+  
   @@ -1,1 +1,2 @@
    a
   +a
-  record this change to 'subdir/a'? [Ynesfdaq?] 
+  record this change to 'subdir/a'? [Ynesfdaq?] y
+  
 
   $ hg tip -p
   changeset:   18:61be427a9deb
@@ -673,7 +711,8 @@  Help, quit
   > EOF
   diff --git a/subdir/f1 b/subdir/f1
   1 hunks, 1 lines changed
-  examine changes to 'subdir/f1'? [Ynesfdaq?] 
+  examine changes to 'subdir/f1'? [Ynesfdaq?] ?
+  
   y - yes, record this change
   n - no, skip this change
   e - edit this change manually
@@ -683,7 +722,8 @@  Help, quit
   a - record all changes to all remaining files
   q - quit, recording no changes
   ? - ? (display help)
-  examine changes to 'subdir/f1'? [Ynesfdaq?] 
+  examine changes to 'subdir/f1'? [Ynesfdaq?] q
+  
   abort: user quit
   [255]
 
@@ -694,7 +734,8 @@  Skip
   > EOF
   diff --git a/subdir/f1 b/subdir/f1
   1 hunks, 1 lines changed
-  examine changes to 'subdir/f1'? [Ynesfdaq?] 
+  examine changes to 'subdir/f1'? [Ynesfdaq?] s
+  
   diff --git a/subdir/f2 b/subdir/f2
   1 hunks, 1 lines changed
   examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected
@@ -707,7 +748,8 @@  No
   > EOF
   diff --git a/subdir/f1 b/subdir/f1
   1 hunks, 1 lines changed
-  examine changes to 'subdir/f1'? [Ynesfdaq?] 
+  examine changes to 'subdir/f1'? [Ynesfdaq?] n
+  
   diff --git a/subdir/f2 b/subdir/f2
   1 hunks, 1 lines changed
   examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected
@@ -721,10 +763,12 @@  f, quit
   > EOF
   diff --git a/subdir/f1 b/subdir/f1
   1 hunks, 1 lines changed
-  examine changes to 'subdir/f1'? [Ynesfdaq?] 
+  examine changes to 'subdir/f1'? [Ynesfdaq?] f
+  
   diff --git a/subdir/f2 b/subdir/f2
   1 hunks, 1 lines changed
-  examine changes to 'subdir/f2'? [Ynesfdaq?] 
+  examine changes to 'subdir/f2'? [Ynesfdaq?] q
+  
   abort: user quit
   [255]
 
@@ -736,10 +780,12 @@  s, all
   > EOF
   diff --git a/subdir/f1 b/subdir/f1
   1 hunks, 1 lines changed
-  examine changes to 'subdir/f1'? [Ynesfdaq?] 
+  examine changes to 'subdir/f1'? [Ynesfdaq?] s
+  
   diff --git a/subdir/f2 b/subdir/f2
   1 hunks, 1 lines changed
-  examine changes to 'subdir/f2'? [Ynesfdaq?] 
+  examine changes to 'subdir/f2'? [Ynesfdaq?] a
+  
 
   $ hg tip -p
   changeset:   20:b3df3dda369a
@@ -763,7 +809,8 @@  f
   > EOF
   diff --git a/subdir/f1 b/subdir/f1
   1 hunks, 1 lines changed
-  examine changes to 'subdir/f1'? [Ynesfdaq?] 
+  examine changes to 'subdir/f1'? [Ynesfdaq?] f
+  
 
   $ hg tip -p
   changeset:   21:38ec577f126b
@@ -795,12 +842,14 @@  Preserve chmod +x
   old mode 100644
   new mode 100755
   1 hunks, 1 lines changed
-  examine changes to 'subdir/f1'? [Ynesfdaq?] 
+  examine changes to 'subdir/f1'? [Ynesfdaq?] y
+  
   @@ -1,2 +1,3 @@
    a
    a
   +a
-  record this change to 'subdir/f1'? [Ynesfdaq?] 
+  record this change to 'subdir/f1'? [Ynesfdaq?] y
+  
 
   $ hg tip --config diff.git=True -p
   changeset:   22:3261adceb075
@@ -830,13 +879,15 @@  Preserve execute permission on original
   > EOF
   diff --git a/subdir/f1 b/subdir/f1
   1 hunks, 1 lines changed
-  examine changes to 'subdir/f1'? [Ynesfdaq?] 
+  examine changes to 'subdir/f1'? [Ynesfdaq?] y
+  
   @@ -1,3 +1,4 @@
    a
    a
    a
   +b
-  record this change to 'subdir/f1'? [Ynesfdaq?] 
+  record this change to 'subdir/f1'? [Ynesfdaq?] y
+  
 
   $ hg tip --config diff.git=True -p
   changeset:   23:b429867550db
@@ -868,13 +919,15 @@  Preserve chmod -x
   old mode 100755
   new mode 100644
   1 hunks, 1 lines changed
-  examine changes to 'subdir/f1'? [Ynesfdaq?] 
+  examine changes to 'subdir/f1'? [Ynesfdaq?] y
+  
   @@ -2,3 +2,4 @@
    a
    a
    b
   +c
-  record this change to 'subdir/f1'? [Ynesfdaq?] 
+  record this change to 'subdir/f1'? [Ynesfdaq?] y
+  
 
   $ hg tip --config diff.git=True -p
   changeset:   24:0b082130c20a
@@ -1062,14 +1115,16 @@  Editing patch (and ignoring trailing tex
   > EOF
   diff --git a/editedfile b/editedfile
   1 hunks, 2 lines changed
-  examine changes to 'editedfile'? [Ynesfdaq?] 
+  examine changes to 'editedfile'? [Ynesfdaq?] y
+  
   @@ -1,3 +1,3 @@
   -This is the first line
   -This is the second line
   +This line has changed
   +This change will be committed
    This is the third line
-  record this change to 'editedfile'? [Ynesfdaq?] 
+  record this change to 'editedfile'? [Ynesfdaq?] e
+  
   $ cat editedfile
   This line has changed
   This change will be committed
@@ -1089,9 +1144,11 @@  Trying to edit patch for whole file
   > EOF
   diff --git a/editedfile b/editedfile
   1 hunks, 1 lines changed
-  examine changes to 'editedfile'? [Ynesfdaq?] 
+  examine changes to 'editedfile'? [Ynesfdaq?] e
+  
   cannot edit patch for whole file
-  examine changes to 'editedfile'? [Ynesfdaq?] 
+  examine changes to 'editedfile'? [Ynesfdaq?] q
+  
   abort: user quit
   [255]
   $ hg revert editedfile
@@ -1111,7 +1168,8 @@  Removing changes from patch
   > EOF
   diff --git a/editedfile b/editedfile
   1 hunks, 3 lines changed
-  examine changes to 'editedfile'? [Ynesfdaq?] 
+  examine changes to 'editedfile'? [Ynesfdaq?] y
+  
   @@ -1,3 +1,3 @@
   -This is the first line
   -This change will be committed
@@ -1119,7 +1177,8 @@  Removing changes from patch
   +This change will not be committed
   +This is the second line
   +This line has been added
-  record this change to 'editedfile'? [Ynesfdaq?] 
+  record this change to 'editedfile'? [Ynesfdaq?] e
+  
   no changes to record
   $ cat editedfile
   This change will not be committed
@@ -1146,7 +1205,8 @@  Invalid patch
   > EOF
   diff --git a/editedfile b/editedfile
   1 hunks, 3 lines changed
-  examine changes to 'editedfile'? [Ynesfdaq?] 
+  examine changes to 'editedfile'? [Ynesfdaq?] y
+  
   @@ -1,3 +1,3 @@
   -This is the first line
   -This change will be committed
@@ -1154,7 +1214,8 @@  Invalid patch
   +This change will not be committed
   +This is the second line
   +This line has been added
-  record this change to 'editedfile'? [Ynesfdaq?] 
+  record this change to 'editedfile'? [Ynesfdaq?] e
+  
   patching file editedfile
   Hunk #1 FAILED at 0
   1 out of 1 hunks FAILED -- saving rejects to file editedfile.rej
@@ -1191,7 +1252,8 @@  Malformed patch - error handling
   > EOF
   diff --git a/editedfile b/editedfile
   1 hunks, 3 lines changed
-  examine changes to 'editedfile'? [Ynesfdaq?] 
+  examine changes to 'editedfile'? [Ynesfdaq?] y
+  
   @@ -1,3 +1,3 @@
   -This is the first line
   -This change will be committed
@@ -1199,7 +1261,8 @@  Malformed patch - error handling
   +This change will not be committed
   +This is the second line
   +This line has been added
-  record this change to 'editedfile'? [Ynesfdaq?] 
+  record this change to 'editedfile'? [Ynesfdaq?] e
+  
   abort: error parsing patch: unhandled transition: range -> range
   [255]
 
@@ -1216,7 +1279,8 @@  random text in random positions is still
   > EOF
   diff --git a/editedfile b/editedfile
   1 hunks, 3 lines changed
-  examine changes to 'editedfile'? [Ynesfdaq?] 
+  examine changes to 'editedfile'? [Ynesfdaq?] y
+  
   @@ -1,3 +1,3 @@
   -This is the first line
   -This change will be committed
@@ -1224,7 +1288,8 @@  random text in random positions is still
   +This change will not be committed
   +This is the second line
   +This line has been added
-  record this change to 'editedfile'? [Ynesfdaq?] 
+  record this change to 'editedfile'? [Ynesfdaq?] e
+  
   abort: error parsing patch: unhandled transition: file -> other
   [255]
 
@@ -1254,13 +1319,15 @@  Ignore win32text deprecation warning for
   > EOF
   diff --git a/subdir/f1 b/subdir/f1
   1 hunks, 1 lines changed
-  examine changes to 'subdir/f1'? [Ynesfdaq?] 
+  examine changes to 'subdir/f1'? [Ynesfdaq?] y
+  
   @@ -3,3 +3,4 @@
    a
    b
    c
   +d
-  record this change to 'subdir/f1'? [Ynesfdaq?] 
+  record this change to 'subdir/f1'? [Ynesfdaq?] y
+  
 
   $ hg tip -p
   changeset:   28:* (glob)
@@ -1287,13 +1354,15 @@  Test --user when ui.username not set
   > EOF
   diff --git a/subdir/f1 b/subdir/f1
   1 hunks, 1 lines changed
-  examine changes to 'subdir/f1'? [Ynesfdaq?] 
+  examine changes to 'subdir/f1'? [Ynesfdaq?] y
+  
   @@ -4,3 +4,4 @@
    b
    c
    d
   +e
-  record this change to 'subdir/f1'? [Ynesfdaq?] 
+  record this change to 'subdir/f1'? [Ynesfdaq?] y
+  
   $ hg log --template '{author}\n' -l 1
   xyz
   $ HGUSER="test"
diff --git a/tests/test-transplant.t b/tests/test-transplant.t
--- a/tests/test-transplant.t
+++ b/tests/test-transplant.t
@@ -508,15 +508,20 @@  test interactive transplant
   > c
   > EOF
   0:17ab29e464c6
-  apply changeset? [ynmpcq?]: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  apply changeset? [ynmpcq?]: p
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   +++ b/r1	Thu Jan 01 00:00:00 1970 +0000
   @@ -0,0 +1,1 @@
   +r1
-  apply changeset? [ynmpcq?]: 1:d11e3596cc1a
-  apply changeset? [ynmpcq?]: 2:37a1297eb21b
-  apply changeset? [ynmpcq?]: 3:722f4667af76
-  apply changeset? [ynmpcq?]: 4:a53251cdf717
-  apply changeset? [ynmpcq?]:  (no-eol)
+  apply changeset? [ynmpcq?]: y
+  1:d11e3596cc1a
+  apply changeset? [ynmpcq?]: n
+  2:37a1297eb21b
+  apply changeset? [ynmpcq?]: n
+  3:722f4667af76
+  apply changeset? [ynmpcq?]: m
+  4:a53251cdf717
+  apply changeset? [ynmpcq?]: c
   $ hg log -G --template "{node|short}"
   @    88be5dde5260
   |\
@@ -533,16 +538,19 @@  test interactive transplant
   > q
   > EOF
   1:d11e3596cc1a
-  apply changeset? [ynmpcq?]: unrecognized response
-  apply changeset? [ynmpcq?]: y: yes, transplant this changeset
+  apply changeset? [ynmpcq?]: x
+  unrecognized response
+  apply changeset? [ynmpcq?]: ?
+  y: yes, transplant this changeset
   n: no, skip this changeset
   m: merge at this changeset
   p: show patch
   c: commit selected changesets
   q: quit and cancel transplant
   ?: ? (show this help)
-  apply changeset? [ynmpcq?]: 4:a53251cdf717
-  apply changeset? [ynmpcq?]:  (no-eol)
+  apply changeset? [ynmpcq?]: y
+  4:a53251cdf717
+  apply changeset? [ynmpcq?]: q
   $ hg heads --template "{node|short}\n"
   88be5dde5260