##// END OF EJS Templates
test-merge-prompt.t: unset HGMERGE...
Siddharth Agarwal -
r26895:fc41f9ff default
parent child Browse files
Show More
@@ -1,172 +1,175 b''
1 Test for
1 Test for
2 b5605d88dc27: Make ui.prompt repeat on "unrecognized response" again
2 b5605d88dc27: Make ui.prompt repeat on "unrecognized response" again
3 (issue897)
3 (issue897)
4
4
5 840e2b315c1f: Fix misleading error and prompts during update/merge
5 840e2b315c1f: Fix misleading error and prompts during update/merge
6 (issue556)
6 (issue556)
7
7
8 Make sure HGMERGE doesn't interfere with the test
9 $ unset HGMERGE
10
8 $ status() {
11 $ status() {
9 > echo "--- status ---"
12 > echo "--- status ---"
10 > hg st -A file1 file2
13 > hg st -A file1 file2
11 > for file in file1 file2; do
14 > for file in file1 file2; do
12 > if [ -f $file ]; then
15 > if [ -f $file ]; then
13 > echo "--- $file ---"
16 > echo "--- $file ---"
14 > cat $file
17 > cat $file
15 > else
18 > else
16 > echo "*** $file does not exist"
19 > echo "*** $file does not exist"
17 > fi
20 > fi
18 > done
21 > done
19 > }
22 > }
20
23
21 $ hg init
24 $ hg init
22
25
23 $ echo 1 > file1
26 $ echo 1 > file1
24 $ echo 2 > file2
27 $ echo 2 > file2
25 $ hg ci -Am 'added file1 and file2'
28 $ hg ci -Am 'added file1 and file2'
26 adding file1
29 adding file1
27 adding file2
30 adding file2
28
31
29 $ hg rm file1
32 $ hg rm file1
30 $ echo changed >> file2
33 $ echo changed >> file2
31 $ hg ci -m 'removed file1, changed file2'
34 $ hg ci -m 'removed file1, changed file2'
32
35
33 $ hg co 0
36 $ hg co 0
34 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
37 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
35
38
36 $ echo changed >> file1
39 $ echo changed >> file1
37 $ hg rm file2
40 $ hg rm file2
38 $ hg ci -m 'changed file1, removed file2'
41 $ hg ci -m 'changed file1, removed file2'
39 created new head
42 created new head
40
43
41
44
42 Non-interactive merge:
45 Non-interactive merge:
43
46
44 $ hg merge -y
47 $ hg merge -y
45 local changed file1 which remote deleted
48 local changed file1 which remote deleted
46 use (c)hanged version or (d)elete? c
49 use (c)hanged version or (d)elete? c
47 remote changed file2 which local deleted
50 remote changed file2 which local deleted
48 use (c)hanged version or leave (d)eleted? c
51 use (c)hanged version or leave (d)eleted? c
49 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
52 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
50 (branch merge, don't forget to commit)
53 (branch merge, don't forget to commit)
51
54
52 $ status
55 $ status
53 --- status ---
56 --- status ---
54 M file2
57 M file2
55 C file1
58 C file1
56 --- file1 ---
59 --- file1 ---
57 1
60 1
58 changed
61 changed
59 --- file2 ---
62 --- file2 ---
60 2
63 2
61 changed
64 changed
62
65
63
66
64 Interactive merge:
67 Interactive merge:
65
68
66 $ hg co -C
69 $ hg co -C
67 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
70 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
68
71
69 $ hg merge --config ui.interactive=true <<EOF
72 $ hg merge --config ui.interactive=true <<EOF
70 > c
73 > c
71 > d
74 > d
72 > EOF
75 > EOF
73 local changed file1 which remote deleted
76 local changed file1 which remote deleted
74 use (c)hanged version or (d)elete? c
77 use (c)hanged version or (d)elete? c
75 remote changed file2 which local deleted
78 remote changed file2 which local deleted
76 use (c)hanged version or leave (d)eleted? d
79 use (c)hanged version or leave (d)eleted? d
77 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
80 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
78 (branch merge, don't forget to commit)
81 (branch merge, don't forget to commit)
79
82
80 $ status
83 $ status
81 --- status ---
84 --- status ---
82 file2: * (glob)
85 file2: * (glob)
83 C file1
86 C file1
84 --- file1 ---
87 --- file1 ---
85 1
88 1
86 changed
89 changed
87 *** file2 does not exist
90 *** file2 does not exist
88
91
89
92
90 Interactive merge with bad input:
93 Interactive merge with bad input:
91
94
92 $ hg co -C
95 $ hg co -C
93 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
96 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
94
97
95 $ hg merge --config ui.interactive=true <<EOF
98 $ hg merge --config ui.interactive=true <<EOF
96 > foo
99 > foo
97 > bar
100 > bar
98 > d
101 > d
99 > baz
102 > baz
100 > c
103 > c
101 > EOF
104 > EOF
102 local changed file1 which remote deleted
105 local changed file1 which remote deleted
103 use (c)hanged version or (d)elete? foo
106 use (c)hanged version or (d)elete? foo
104 unrecognized response
107 unrecognized response
105 local changed file1 which remote deleted
108 local changed file1 which remote deleted
106 use (c)hanged version or (d)elete? bar
109 use (c)hanged version or (d)elete? bar
107 unrecognized response
110 unrecognized response
108 local changed file1 which remote deleted
111 local changed file1 which remote deleted
109 use (c)hanged version or (d)elete? d
112 use (c)hanged version or (d)elete? d
110 remote changed file2 which local deleted
113 remote changed file2 which local deleted
111 use (c)hanged version or leave (d)eleted? baz
114 use (c)hanged version or leave (d)eleted? baz
112 unrecognized response
115 unrecognized response
113 remote changed file2 which local deleted
116 remote changed file2 which local deleted
114 use (c)hanged version or leave (d)eleted? c
117 use (c)hanged version or leave (d)eleted? c
115 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
118 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
116 (branch merge, don't forget to commit)
119 (branch merge, don't forget to commit)
117
120
118 $ status
121 $ status
119 --- status ---
122 --- status ---
120 M file2
123 M file2
121 R file1
124 R file1
122 *** file1 does not exist
125 *** file1 does not exist
123 --- file2 ---
126 --- file2 ---
124 2
127 2
125 changed
128 changed
126
129
127
130
128 Interactive merge with not enough input:
131 Interactive merge with not enough input:
129
132
130 $ hg co -C
133 $ hg co -C
131 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
134 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
132
135
133 $ hg merge --config ui.interactive=true <<EOF
136 $ hg merge --config ui.interactive=true <<EOF
134 > d
137 > d
135 > EOF
138 > EOF
136 local changed file1 which remote deleted
139 local changed file1 which remote deleted
137 use (c)hanged version or (d)elete? d
140 use (c)hanged version or (d)elete? d
138 remote changed file2 which local deleted
141 remote changed file2 which local deleted
139 use (c)hanged version or leave (d)eleted? abort: response expected
142 use (c)hanged version or leave (d)eleted? abort: response expected
140 [255]
143 [255]
141
144
142 $ status
145 $ status
143 --- status ---
146 --- status ---
144 file2: * (glob)
147 file2: * (glob)
145 C file1
148 C file1
146 --- file1 ---
149 --- file1 ---
147 1
150 1
148 changed
151 changed
149 *** file2 does not exist
152 *** file2 does not exist
150
153
151 Non-interactive linear update
154 Non-interactive linear update
152
155
153 $ hg co -C 0
156 $ hg co -C 0
154 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
157 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
155 $ echo changed >> file1
158 $ echo changed >> file1
156 $ hg rm file2
159 $ hg rm file2
157 $ hg update 1 -y
160 $ hg update 1 -y
158 local changed file1 which remote deleted
161 local changed file1 which remote deleted
159 use (c)hanged version or (d)elete? c
162 use (c)hanged version or (d)elete? c
160 remote changed file2 which local deleted
163 remote changed file2 which local deleted
161 use (c)hanged version or leave (d)eleted? c
164 use (c)hanged version or leave (d)eleted? c
162 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
165 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
163 $ status
166 $ status
164 --- status ---
167 --- status ---
165 A file1
168 A file1
166 C file2
169 C file2
167 --- file1 ---
170 --- file1 ---
168 1
171 1
169 changed
172 changed
170 --- file2 ---
173 --- file2 ---
171 2
174 2
172 changed
175 changed
General Comments 0
You need to be logged in to leave comments. Login now