##// END OF EJS Templates
Tests for b5605d88dc27 and 840e2b315c1f (interactive prompts during merge)
Thomas Arendsen Hein -
r5672:8a65ea98 default
parent child Browse files
Show More
@@ -0,0 +1,69 b''
1 #!/bin/sh
2 #
3 # Test for b5605d88dc27
4 # Make ui.prompt repeat on "unrecognized response" again (issue897)
5 # and for 840e2b315c1f
6 # Fix misleading error and prompts during update/merge (issue556)
7
8 status() {
9 [ $? -ne 0 ] && echo "failed."
10 echo "status:"
11 hg st -A file1 file2
12 for file in file1 file2; do
13 if [ -f $file ]; then
14 echo "$file:"
15 cat $file
16 else
17 echo "$file does not exist"
18 fi
19 done
20 }
21
22 hg init repo
23 cd repo
24 echo 1 > file1
25 echo 2 > file2
26 hg ci -Am 'added file1 and file2' # rev 0
27
28 hg rm file1
29 echo changed >> file2
30 hg ci -m 'removed file1, changed file2' # rev 1
31
32 hg co 0
33 echo changed >> file1
34 hg rm file2
35 hg ci -m 'changed file1, removed file2' # rev 2
36
37 echo
38 echo "# non-interactive merge"
39 hg merge -y || echo "failed"
40 status
41
42 echo
43 echo "# interactive merge"
44 hg co -C
45 hg merge --config ui.interactive=true <<EOF || echo "failed"
46 c
47 d
48 EOF
49 status
50
51 echo
52 echo "# interactive merge with bad input"
53 hg co -C
54 hg merge --config ui.interactive=true <<EOF || echo "failed"
55 foo
56 bar
57 d
58 baz
59 c
60 EOF
61 status
62
63 echo
64 echo "# interactive merge with not enough input"
65 hg co -C
66 hg merge --config ui.interactive=true <<EOF || echo "failed"
67 d
68 EOF
69 status
@@ -0,0 +1,64 b''
1 adding file1
2 adding file2
3 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
4
5 # non-interactive merge
6 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
7 (branch merge, don't forget to commit)
8 status:
9 M file2
10 C file1
11 file1:
12 1
13 changed
14 file2:
15 2
16 changed
17
18 # interactive merge
19 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
20 local changed file1 which remote deleted
21 use (c)hanged version or (d)elete? remote changed file2 which local deleted
22 use (c)hanged version or leave (d)eleted? 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
23 (branch merge, don't forget to commit)
24 status:
25 file2: No such file or directory
26 C file1
27 file1:
28 1
29 changed
30 file2 does not exist
31
32 # interactive merge with bad input
33 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
34 local changed file1 which remote deleted
35 use (c)hanged version or (d)elete? unrecognized response
36 local changed file1 which remote deleted
37 use (c)hanged version or (d)elete? unrecognized response
38 local changed file1 which remote deleted
39 use (c)hanged version or (d)elete? remote changed file2 which local deleted
40 use (c)hanged version or leave (d)eleted? unrecognized response
41 remote changed file2 which local deleted
42 use (c)hanged version or leave (d)eleted? 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
43 (branch merge, don't forget to commit)
44 status:
45 M file2
46 R file1
47 file1 does not exist
48 file2:
49 2
50 changed
51
52 # interactive merge with not enough input
53 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
54 local changed file1 which remote deleted
55 use (c)hanged version or (d)elete? remote changed file2 which local deleted
56 use (c)hanged version or leave (d)eleted? abort: response expected
57 failed
58 status:
59 file2: No such file or directory
60 C file1
61 file1:
62 1
63 changed
64 file2 does not exist
General Comments 0
You need to be logged in to leave comments. Login now