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.
--- a/mercurial/ui.py Tue Sep 30 18:22:58 2014 -0500
+++ b/mercurial/ui.py Wed Oct 01 01:04:18 2014 +0200
@@ -681,7 +681,11 @@
try:
r = self._readline(self.label(msg, 'ui.prompt'))
if not r:
- return default
+ r = default
+ # sometimes self.interactive disagrees with isatty,
+ # show default response
+ if not util.isatty(self.fin):
+ self.write(r, "\n")
return r
except EOFError:
raise util.Abort(_('response expected'))
--- a/tests/test-diff-color.t Tue Sep 30 18:22:58 2014 -0500
+++ b/tests/test-diff-color.t Wed Oct 01 01:04:18 2014 +0200
@@ -85,7 +85,8 @@
\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 @@
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 @@
\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 @@
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
--- a/tests/test-issue3084.t Tue Sep 30 18:22:58 2014 -0500
+++ b/tests/test-issue3084.t Wed Oct 01 01:04:18 2014 +0200
@@ -29,7 +29,8 @@
$ 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 @@
$ 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 @@
$ 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 @@
$ 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 @@
$ 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 @@
$ 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 @@
$ 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 @@
$ 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 @@
$ 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 @@
$ 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
--- a/tests/test-keyword.t Tue Sep 30 18:22:58 2014 -0500
+++ b/tests/test-keyword.t Wed Oct 01 01:04:18 2014 +0200
@@ -343,18 +343,21 @@
> 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 @@
> 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 @@
> 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 @@
> 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
--- a/tests/test-largefiles-update.t Tue Sep 30 18:22:58 2014 -0500
+++ b/tests/test-largefiles-update.t Wed Oct 01 01:04:18 2014 +0200
@@ -64,7 +64,8 @@
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 @@
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 @@
> 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 @@
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)
--- a/tests/test-merge-prompt.t Tue Sep 30 18:22:58 2014 -0500
+++ b/tests/test-merge-prompt.t Wed Oct 01 01:04:18 2014 +0200
@@ -71,8 +71,10 @@
> 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 @@
> 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 @@
> 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]
--- a/tests/test-mq-qrefresh-interactive.t Tue Sep 30 18:22:58 2014 -0500
+++ b/tests/test-mq-qrefresh-interactive.t Wed Oct 01 01:04:18 2014 +0200
@@ -181,22 +181,26 @@
> 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 @@
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 @@
> 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 @@
-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'
--- a/tests/test-mq-subrepo.t Tue Sep 30 18:22:58 2014 -0500
+++ b/tests/test-mq-subrepo.t Wed Oct 01 01:04:18 2014 +0200
@@ -291,7 +291,8 @@
% 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 @@
% 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 @@
% 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 @@
% 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 @@
% 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 @@
% 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 ..
--- a/tests/test-patchbomb.t Tue Sep 30 18:22:58 2014 -0500
+++ b/tests/test-patchbomb.t Wed Oct 01 01:04:18 2014 +0200
@@ -82,7 +82,8 @@
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
--- a/tests/test-qrecord.t Tue Sep 30 18:22:58 2014 -0500
+++ b/tests/test-qrecord.t Wed Oct 01 01:04:18 2014 +0200
@@ -246,22 +246,26 @@
> 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 @@
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 @@
> 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 @@
-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'
--- a/tests/test-record.t Tue Sep 30 18:22:58 2014 -0500
+++ b/tests/test-record.t Wed Oct 01 01:04:18 2014 +0200
@@ -18,7 +18,8 @@
> 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 @@
> 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 @@
> 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 @@
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 @@
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 @@
> 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 @@
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 @@
> 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 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 @@
> 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 @@
> 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 @@
> 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 @@
> 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 @@
-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 @@
> 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 @@
> 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 @@
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 @@
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 @@
> 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 @@
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 @@
> 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 @@
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 @@
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 @@
> 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 @@
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 @@
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 @@
> 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 @@
> 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 @@
> 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 @@
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 @@
> 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 @@
> 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 @@
> 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 @@
> 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 @@
> 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 @@
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 @@
> 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 @@
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 @@
> 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 @@
> 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 @@
> 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 @@
+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 @@
> 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 @@
+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 @@
> 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 @@
+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 @@
> 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 @@
+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 @@
> 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 @@
> 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"
--- a/tests/test-transplant.t Tue Sep 30 18:22:58 2014 -0500
+++ b/tests/test-transplant.t Wed Oct 01 01:04:18 2014 +0200
@@ -508,15 +508,20 @@
> 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 @@
> 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