Mercurial > hg-stable
comparison tests/test-qrecord.t @ 12075:f585c9bb85c1
tests: unify test-qrecord
author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
---|---|
date | Fri, 27 Aug 2010 16:25:47 +0200 |
parents | tests/test-qrecord@6c82beaaa11a |
children | 4134686b83e1 |
comparison
equal
deleted
inserted
replaced
12074:35c143e85b1b | 12075:f585c9bb85c1 |
---|---|
1 Create configuration | |
2 | |
3 $ echo "[ui]" >> $HGRCPATH | |
4 $ echo "interactive=true" >> $HGRCPATH | |
5 $ echo "[extensions]" >> $HGRCPATH | |
6 $ echo "record=" >> $HGRCPATH | |
7 | |
8 help (no mq, so no qrecord) | |
9 | |
10 $ hg help qrecord | |
11 hg: unknown command 'qrecord' | |
12 Mercurial Distributed SCM | |
13 | |
14 basic commands: | |
15 | |
16 add add the specified files on the next commit | |
17 annotate show changeset information by line for each file | |
18 clone make a copy of an existing repository | |
19 commit commit the specified files or all outstanding changes | |
20 diff diff repository (or selected files) | |
21 export dump the header and diffs for one or more changesets | |
22 forget forget the specified files on the next commit | |
23 init create a new repository in the given directory | |
24 log show revision history of entire repository or files | |
25 merge merge working directory with another revision | |
26 pull pull changes from the specified source | |
27 push push changes to the specified destination | |
28 remove remove the specified files on the next commit | |
29 serve start stand-alone webserver | |
30 status show changed files in the working directory | |
31 summary summarize working directory state | |
32 update update working directory (or switch revisions) | |
33 | |
34 use "hg help" for the full list of commands or "hg -v" for details | |
35 | |
36 help (mq present) | |
37 | |
38 $ echo "mq=" >> $HGRCPATH | |
39 $ hg help qrecord | |
40 hg qrecord [OPTION]... PATCH [FILE]... | |
41 | |
42 interactively record a new patch | |
43 | |
44 See "hg help qnew" & "hg help record" for more information and usage. | |
45 | |
46 options: | |
47 | |
48 -e --edit edit commit message | |
49 -g --git use git extended diff format | |
50 -U --currentuser add "From: <current user>" to patch | |
51 -u --user USER add "From: <USER>" to patch | |
52 -D --currentdate add "Date: <current date>" to patch | |
53 -d --date DATE add "Date: <DATE>" to patch | |
54 -I --include PATTERN [+] include names matching the given patterns | |
55 -X --exclude PATTERN [+] exclude names matching the given patterns | |
56 -m --message TEXT use text as commit message | |
57 -l --logfile FILE read commit message from file | |
58 | |
59 [+] marked option can be specified multiple times | |
60 | |
61 use "hg -v help qrecord" to show global options | |
62 | |
63 $ hg init a | |
64 $ cd a | |
65 | |
66 Base commit | |
67 | |
68 $ cat > 1.txt <<EOF | |
69 > 1 | |
70 > 2 | |
71 > 3 | |
72 > 4 | |
73 > 5 | |
74 > EOF | |
75 $ cat > 2.txt <<EOF | |
76 > a | |
77 > b | |
78 > c | |
79 > d | |
80 > e | |
81 > f | |
82 > EOF | |
83 | |
84 $ mkdir dir | |
85 $ cat > dir/a.txt <<EOF | |
86 > hello world | |
87 > | |
88 > someone | |
89 > up | |
90 > there | |
91 > loves | |
92 > me | |
93 > EOF | |
94 | |
95 $ hg add 1.txt 2.txt dir/a.txt | |
96 $ hg commit -m 'initial checkin' | |
97 | |
98 Changing files | |
99 | |
100 $ sed -e 's/2/2 2/;s/4/4 4/' 1.txt > 1.txt.new | |
101 $ sed -e 's/b/b b/' 2.txt > 2.txt.new | |
102 $ sed -e 's/hello world/hello world!/' dir/a.txt > dir/a.txt.new | |
103 | |
104 $ mv -f 1.txt.new 1.txt | |
105 $ mv -f 2.txt.new 2.txt | |
106 $ mv -f dir/a.txt.new dir/a.txt | |
107 | |
108 Whole diff | |
109 | |
110 $ hg diff --nodates | |
111 diff -r 1057167b20ef 1.txt | |
112 --- a/1.txt | |
113 +++ b/1.txt | |
114 @@ -1,5 +1,5 @@ | |
115 1 | |
116 -2 | |
117 +2 2 | |
118 3 | |
119 -4 | |
120 +4 4 | |
121 5 | |
122 diff -r 1057167b20ef 2.txt | |
123 --- a/2.txt | |
124 +++ b/2.txt | |
125 @@ -1,5 +1,5 @@ | |
126 a | |
127 -b | |
128 +b b | |
129 c | |
130 d | |
131 e | |
132 diff -r 1057167b20ef dir/a.txt | |
133 --- a/dir/a.txt | |
134 +++ b/dir/a.txt | |
135 @@ -1,4 +1,4 @@ | |
136 -hello world | |
137 +hello world! | |
138 | |
139 someone | |
140 up | |
141 | |
142 qrecord a.patch | |
143 | |
144 $ hg qrecord -d '0 0' -m aaa a.patch <<EOF | |
145 > y | |
146 > y | |
147 > n | |
148 > y | |
149 > y | |
150 > n | |
151 > EOF | |
152 diff --git a/1.txt b/1.txt | |
153 2 hunks, 2 lines changed | |
154 examine changes to '1.txt'? [Ynsfdaq?] | |
155 @@ -1,3 +1,3 @@ | |
156 1 | |
157 -2 | |
158 +2 2 | |
159 3 | |
160 record change 1/6 to '1.txt'? [Ynsfdaq?] | |
161 @@ -3,3 +3,3 @@ | |
162 3 | |
163 -4 | |
164 +4 4 | |
165 5 | |
166 record change 2/6 to '1.txt'? [Ynsfdaq?] | |
167 diff --git a/2.txt b/2.txt | |
168 1 hunks, 1 lines changed | |
169 examine changes to '2.txt'? [Ynsfdaq?] | |
170 @@ -1,5 +1,5 @@ | |
171 a | |
172 -b | |
173 +b b | |
174 c | |
175 d | |
176 e | |
177 record change 4/6 to '2.txt'? [Ynsfdaq?] | |
178 diff --git a/dir/a.txt b/dir/a.txt | |
179 1 hunks, 1 lines changed | |
180 examine changes to 'dir/a.txt'? [Ynsfdaq?] | |
181 | |
182 After qrecord a.patch 'tip'" | |
183 | |
184 $ hg tip -p | |
185 changeset: 1:5d1ca63427ee | |
186 tag: a.patch | |
187 tag: qbase | |
188 tag: qtip | |
189 tag: tip | |
190 user: test | |
191 date: Thu Jan 01 00:00:00 1970 +0000 | |
192 summary: aaa | |
193 | |
194 diff -r 1057167b20ef -r 5d1ca63427ee 1.txt | |
195 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000 | |
196 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000 | |
197 @@ -1,5 +1,5 @@ | |
198 1 | |
199 -2 | |
200 +2 2 | |
201 3 | |
202 4 | |
203 5 | |
204 diff -r 1057167b20ef -r 5d1ca63427ee 2.txt | |
205 --- a/2.txt Thu Jan 01 00:00:00 1970 +0000 | |
206 +++ b/2.txt Thu Jan 01 00:00:00 1970 +0000 | |
207 @@ -1,5 +1,5 @@ | |
208 a | |
209 -b | |
210 +b b | |
211 c | |
212 d | |
213 e | |
214 | |
215 | |
216 After qrecord a.patch 'diff'" | |
217 | |
218 $ hg diff --nodates | |
219 diff -r 5d1ca63427ee 1.txt | |
220 --- a/1.txt | |
221 +++ b/1.txt | |
222 @@ -1,5 +1,5 @@ | |
223 1 | |
224 2 2 | |
225 3 | |
226 -4 | |
227 +4 4 | |
228 5 | |
229 diff -r 5d1ca63427ee dir/a.txt | |
230 --- a/dir/a.txt | |
231 +++ b/dir/a.txt | |
232 @@ -1,4 +1,4 @@ | |
233 -hello world | |
234 +hello world! | |
235 | |
236 someone | |
237 up | |
238 | |
239 qrecord b.patch | |
240 | |
241 $ hg qrecord -d '0 0' -m bbb b.patch <<EOF | |
242 > y | |
243 > y | |
244 > y | |
245 > y | |
246 > EOF | |
247 diff --git a/1.txt b/1.txt | |
248 1 hunks, 1 lines changed | |
249 examine changes to '1.txt'? [Ynsfdaq?] | |
250 @@ -1,5 +1,5 @@ | |
251 1 | |
252 2 2 | |
253 3 | |
254 -4 | |
255 +4 4 | |
256 5 | |
257 record change 1/3 to '1.txt'? [Ynsfdaq?] | |
258 diff --git a/dir/a.txt b/dir/a.txt | |
259 1 hunks, 1 lines changed | |
260 examine changes to 'dir/a.txt'? [Ynsfdaq?] | |
261 @@ -1,4 +1,4 @@ | |
262 -hello world | |
263 +hello world! | |
264 | |
265 someone | |
266 up | |
267 record change 3/3 to 'dir/a.txt'? [Ynsfdaq?] | |
268 | |
269 After qrecord b.patch 'tip' | |
270 | |
271 $ hg tip -p | |
272 changeset: 2:b056198bf878 | |
273 tag: b.patch | |
274 tag: qtip | |
275 tag: tip | |
276 user: test | |
277 date: Thu Jan 01 00:00:00 1970 +0000 | |
278 summary: bbb | |
279 | |
280 diff -r 5d1ca63427ee -r b056198bf878 1.txt | |
281 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000 | |
282 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000 | |
283 @@ -1,5 +1,5 @@ | |
284 1 | |
285 2 2 | |
286 3 | |
287 -4 | |
288 +4 4 | |
289 5 | |
290 diff -r 5d1ca63427ee -r b056198bf878 dir/a.txt | |
291 --- a/dir/a.txt Thu Jan 01 00:00:00 1970 +0000 | |
292 +++ b/dir/a.txt Thu Jan 01 00:00:00 1970 +0000 | |
293 @@ -1,4 +1,4 @@ | |
294 -hello world | |
295 +hello world! | |
296 | |
297 someone | |
298 up | |
299 | |
300 | |
301 After qrecord b.patch 'diff' | |
302 | |
303 $ hg diff --nodates | |
304 | |
305 End |