##// END OF EJS Templates
record: improve help test coverage
timeless -
r13935:6e6d1973 default
parent child Browse files
Show More
@@ -1,304 +1,359 b''
1 Create configuration
1 Create configuration
2
2
3 $ echo "[ui]" >> $HGRCPATH
3 $ echo "[ui]" >> $HGRCPATH
4 $ echo "interactive=true" >> $HGRCPATH
4 $ echo "interactive=true" >> $HGRCPATH
5
6 help record (no record)
7
8 $ hg help record
9 record extension - commands to interactively select changes for commit/qrefresh
10
11 use "hg help extensions" for information on enabling extensions
12
5 $ echo "[extensions]" >> $HGRCPATH
13 $ echo "[extensions]" >> $HGRCPATH
6 $ echo "record=" >> $HGRCPATH
14 $ echo "record=" >> $HGRCPATH
7
15
16 help record (record)
17
18 $ hg help record
19 hg record [OPTION]... [FILE]...
20
21 interactively select changes to commit
22
23 If a list of files is omitted, all changes reported by "hg status" will be
24 candidates for recording.
25
26 See "hg help dates" for a list of formats valid for -d/--date.
27
28 You will be prompted for whether to record changes to each modified file,
29 and for files with multiple changes, for each change to use. For each
30 query, the following responses are possible:
31
32 y - record this change
33 n - skip this change
34
35 s - skip remaining changes to this file
36 f - record remaining changes to this file
37
38 d - done, skip remaining changes and files
39 a - record all changes to all remaining files
40 q - quit, recording no changes
41
42 ? - display help
43
44 This command is not available when committing a merge.
45
46 options:
47
48 -A --addremove mark new/missing files as added/removed before
49 committing
50 --close-branch mark a branch as closed, hiding it from the branch
51 list
52 -I --include PATTERN [+] include names matching the given patterns
53 -X --exclude PATTERN [+] exclude names matching the given patterns
54 -m --message TEXT use text as commit message
55 -l --logfile FILE read commit message from file
56 -d --date DATE record datecode as commit date
57 -u --user USER record the specified user as committer
58
59 [+] marked option can be specified multiple times
60
61 use "hg -v help record" to show global options
62
8 help (no mq, so no qrecord)
63 help (no mq, so no qrecord)
9
64
10 $ hg help qrecord
65 $ hg help qrecord
11 hg: unknown command 'qrecord'
66 hg: unknown command 'qrecord'
12 Mercurial Distributed SCM
67 Mercurial Distributed SCM
13
68
14 basic commands:
69 basic commands:
15
70
16 add add the specified files on the next commit
71 add add the specified files on the next commit
17 annotate show changeset information by line for each file
72 annotate show changeset information by line for each file
18 clone make a copy of an existing repository
73 clone make a copy of an existing repository
19 commit commit the specified files or all outstanding changes
74 commit commit the specified files or all outstanding changes
20 diff diff repository (or selected files)
75 diff diff repository (or selected files)
21 export dump the header and diffs for one or more changesets
76 export dump the header and diffs for one or more changesets
22 forget forget the specified files on the next commit
77 forget forget the specified files on the next commit
23 init create a new repository in the given directory
78 init create a new repository in the given directory
24 log show revision history of entire repository or files
79 log show revision history of entire repository or files
25 merge merge working directory with another revision
80 merge merge working directory with another revision
26 pull pull changes from the specified source
81 pull pull changes from the specified source
27 push push changes to the specified destination
82 push push changes to the specified destination
28 remove remove the specified files on the next commit
83 remove remove the specified files on the next commit
29 serve start stand-alone webserver
84 serve start stand-alone webserver
30 status show changed files in the working directory
85 status show changed files in the working directory
31 summary summarize working directory state
86 summary summarize working directory state
32 update update working directory (or switch revisions)
87 update update working directory (or switch revisions)
33
88
34 use "hg help" for the full list of commands or "hg -v" for details
89 use "hg help" for the full list of commands or "hg -v" for details
35 [255]
90 [255]
36
91
37 help (mq present)
92 help (mq present)
38
93
39 $ echo "mq=" >> $HGRCPATH
94 $ echo "mq=" >> $HGRCPATH
40 $ hg help qrecord
95 $ hg help qrecord
41 hg qrecord [OPTION]... PATCH [FILE]...
96 hg qrecord [OPTION]... PATCH [FILE]...
42
97
43 interactively record a new patch
98 interactively record a new patch
44
99
45 See "hg help qnew" & "hg help record" for more information and usage.
100 See "hg help qnew" & "hg help record" for more information and usage.
46
101
47 options:
102 options:
48
103
49 -e --edit edit commit message
104 -e --edit edit commit message
50 -g --git use git extended diff format
105 -g --git use git extended diff format
51 -U --currentuser add "From: <current user>" to patch
106 -U --currentuser add "From: <current user>" to patch
52 -u --user USER add "From: <USER>" to patch
107 -u --user USER add "From: <USER>" to patch
53 -D --currentdate add "Date: <current date>" to patch
108 -D --currentdate add "Date: <current date>" to patch
54 -d --date DATE add "Date: <DATE>" to patch
109 -d --date DATE add "Date: <DATE>" to patch
55 -I --include PATTERN [+] include names matching the given patterns
110 -I --include PATTERN [+] include names matching the given patterns
56 -X --exclude PATTERN [+] exclude names matching the given patterns
111 -X --exclude PATTERN [+] exclude names matching the given patterns
57 -m --message TEXT use text as commit message
112 -m --message TEXT use text as commit message
58 -l --logfile FILE read commit message from file
113 -l --logfile FILE read commit message from file
59
114
60 [+] marked option can be specified multiple times
115 [+] marked option can be specified multiple times
61
116
62 use "hg -v help qrecord" to show global options
117 use "hg -v help qrecord" to show global options
63
118
64 $ hg init a
119 $ hg init a
65 $ cd a
120 $ cd a
66
121
67 Base commit
122 Base commit
68
123
69 $ cat > 1.txt <<EOF
124 $ cat > 1.txt <<EOF
70 > 1
125 > 1
71 > 2
126 > 2
72 > 3
127 > 3
73 > 4
128 > 4
74 > 5
129 > 5
75 > EOF
130 > EOF
76 $ cat > 2.txt <<EOF
131 $ cat > 2.txt <<EOF
77 > a
132 > a
78 > b
133 > b
79 > c
134 > c
80 > d
135 > d
81 > e
136 > e
82 > f
137 > f
83 > EOF
138 > EOF
84
139
85 $ mkdir dir
140 $ mkdir dir
86 $ cat > dir/a.txt <<EOF
141 $ cat > dir/a.txt <<EOF
87 > hello world
142 > hello world
88 >
143 >
89 > someone
144 > someone
90 > up
145 > up
91 > there
146 > there
92 > loves
147 > loves
93 > me
148 > me
94 > EOF
149 > EOF
95
150
96 $ hg add 1.txt 2.txt dir/a.txt
151 $ hg add 1.txt 2.txt dir/a.txt
97 $ hg commit -m 'initial checkin'
152 $ hg commit -m 'initial checkin'
98
153
99 Changing files
154 Changing files
100
155
101 $ sed -e 's/2/2 2/;s/4/4 4/' 1.txt > 1.txt.new
156 $ sed -e 's/2/2 2/;s/4/4 4/' 1.txt > 1.txt.new
102 $ sed -e 's/b/b b/' 2.txt > 2.txt.new
157 $ sed -e 's/b/b b/' 2.txt > 2.txt.new
103 $ sed -e 's/hello world/hello world!/' dir/a.txt > dir/a.txt.new
158 $ sed -e 's/hello world/hello world!/' dir/a.txt > dir/a.txt.new
104
159
105 $ mv -f 1.txt.new 1.txt
160 $ mv -f 1.txt.new 1.txt
106 $ mv -f 2.txt.new 2.txt
161 $ mv -f 2.txt.new 2.txt
107 $ mv -f dir/a.txt.new dir/a.txt
162 $ mv -f dir/a.txt.new dir/a.txt
108
163
109 Whole diff
164 Whole diff
110
165
111 $ hg diff --nodates
166 $ hg diff --nodates
112 diff -r 1057167b20ef 1.txt
167 diff -r 1057167b20ef 1.txt
113 --- a/1.txt
168 --- a/1.txt
114 +++ b/1.txt
169 +++ b/1.txt
115 @@ -1,5 +1,5 @@
170 @@ -1,5 +1,5 @@
116 1
171 1
117 -2
172 -2
118 +2 2
173 +2 2
119 3
174 3
120 -4
175 -4
121 +4 4
176 +4 4
122 5
177 5
123 diff -r 1057167b20ef 2.txt
178 diff -r 1057167b20ef 2.txt
124 --- a/2.txt
179 --- a/2.txt
125 +++ b/2.txt
180 +++ b/2.txt
126 @@ -1,5 +1,5 @@
181 @@ -1,5 +1,5 @@
127 a
182 a
128 -b
183 -b
129 +b b
184 +b b
130 c
185 c
131 d
186 d
132 e
187 e
133 diff -r 1057167b20ef dir/a.txt
188 diff -r 1057167b20ef dir/a.txt
134 --- a/dir/a.txt
189 --- a/dir/a.txt
135 +++ b/dir/a.txt
190 +++ b/dir/a.txt
136 @@ -1,4 +1,4 @@
191 @@ -1,4 +1,4 @@
137 -hello world
192 -hello world
138 +hello world!
193 +hello world!
139
194
140 someone
195 someone
141 up
196 up
142
197
143 qrecord a.patch
198 qrecord a.patch
144
199
145 $ hg qrecord -d '0 0' -m aaa a.patch <<EOF
200 $ hg qrecord -d '0 0' -m aaa a.patch <<EOF
146 > y
201 > y
147 > y
202 > y
148 > n
203 > n
149 > y
204 > y
150 > y
205 > y
151 > n
206 > n
152 > EOF
207 > EOF
153 diff --git a/1.txt b/1.txt
208 diff --git a/1.txt b/1.txt
154 2 hunks, 2 lines changed
209 2 hunks, 2 lines changed
155 examine changes to '1.txt'? [Ynsfdaq?]
210 examine changes to '1.txt'? [Ynsfdaq?]
156 @@ -1,3 +1,3 @@
211 @@ -1,3 +1,3 @@
157 1
212 1
158 -2
213 -2
159 +2 2
214 +2 2
160 3
215 3
161 record change 1/4 to '1.txt'? [Ynsfdaq?]
216 record change 1/4 to '1.txt'? [Ynsfdaq?]
162 @@ -3,3 +3,3 @@
217 @@ -3,3 +3,3 @@
163 3
218 3
164 -4
219 -4
165 +4 4
220 +4 4
166 5
221 5
167 record change 2/4 to '1.txt'? [Ynsfdaq?]
222 record change 2/4 to '1.txt'? [Ynsfdaq?]
168 diff --git a/2.txt b/2.txt
223 diff --git a/2.txt b/2.txt
169 1 hunks, 1 lines changed
224 1 hunks, 1 lines changed
170 examine changes to '2.txt'? [Ynsfdaq?]
225 examine changes to '2.txt'? [Ynsfdaq?]
171 @@ -1,5 +1,5 @@
226 @@ -1,5 +1,5 @@
172 a
227 a
173 -b
228 -b
174 +b b
229 +b b
175 c
230 c
176 d
231 d
177 e
232 e
178 record change 3/4 to '2.txt'? [Ynsfdaq?]
233 record change 3/4 to '2.txt'? [Ynsfdaq?]
179 diff --git a/dir/a.txt b/dir/a.txt
234 diff --git a/dir/a.txt b/dir/a.txt
180 1 hunks, 1 lines changed
235 1 hunks, 1 lines changed
181 examine changes to 'dir/a.txt'? [Ynsfdaq?]
236 examine changes to 'dir/a.txt'? [Ynsfdaq?]
182
237
183 After qrecord a.patch 'tip'"
238 After qrecord a.patch 'tip'"
184
239
185 $ hg tip -p
240 $ hg tip -p
186 changeset: 1:5d1ca63427ee
241 changeset: 1:5d1ca63427ee
187 tag: a.patch
242 tag: a.patch
188 tag: qbase
243 tag: qbase
189 tag: qtip
244 tag: qtip
190 tag: tip
245 tag: tip
191 user: test
246 user: test
192 date: Thu Jan 01 00:00:00 1970 +0000
247 date: Thu Jan 01 00:00:00 1970 +0000
193 summary: aaa
248 summary: aaa
194
249
195 diff -r 1057167b20ef -r 5d1ca63427ee 1.txt
250 diff -r 1057167b20ef -r 5d1ca63427ee 1.txt
196 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
251 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
197 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
252 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
198 @@ -1,5 +1,5 @@
253 @@ -1,5 +1,5 @@
199 1
254 1
200 -2
255 -2
201 +2 2
256 +2 2
202 3
257 3
203 4
258 4
204 5
259 5
205 diff -r 1057167b20ef -r 5d1ca63427ee 2.txt
260 diff -r 1057167b20ef -r 5d1ca63427ee 2.txt
206 --- a/2.txt Thu Jan 01 00:00:00 1970 +0000
261 --- a/2.txt Thu Jan 01 00:00:00 1970 +0000
207 +++ b/2.txt Thu Jan 01 00:00:00 1970 +0000
262 +++ b/2.txt Thu Jan 01 00:00:00 1970 +0000
208 @@ -1,5 +1,5 @@
263 @@ -1,5 +1,5 @@
209 a
264 a
210 -b
265 -b
211 +b b
266 +b b
212 c
267 c
213 d
268 d
214 e
269 e
215
270
216
271
217 After qrecord a.patch 'diff'"
272 After qrecord a.patch 'diff'"
218
273
219 $ hg diff --nodates
274 $ hg diff --nodates
220 diff -r 5d1ca63427ee 1.txt
275 diff -r 5d1ca63427ee 1.txt
221 --- a/1.txt
276 --- a/1.txt
222 +++ b/1.txt
277 +++ b/1.txt
223 @@ -1,5 +1,5 @@
278 @@ -1,5 +1,5 @@
224 1
279 1
225 2 2
280 2 2
226 3
281 3
227 -4
282 -4
228 +4 4
283 +4 4
229 5
284 5
230 diff -r 5d1ca63427ee dir/a.txt
285 diff -r 5d1ca63427ee dir/a.txt
231 --- a/dir/a.txt
286 --- a/dir/a.txt
232 +++ b/dir/a.txt
287 +++ b/dir/a.txt
233 @@ -1,4 +1,4 @@
288 @@ -1,4 +1,4 @@
234 -hello world
289 -hello world
235 +hello world!
290 +hello world!
236
291
237 someone
292 someone
238 up
293 up
239
294
240 qrecord b.patch
295 qrecord b.patch
241
296
242 $ hg qrecord -d '0 0' -m bbb b.patch <<EOF
297 $ hg qrecord -d '0 0' -m bbb b.patch <<EOF
243 > y
298 > y
244 > y
299 > y
245 > y
300 > y
246 > y
301 > y
247 > EOF
302 > EOF
248 diff --git a/1.txt b/1.txt
303 diff --git a/1.txt b/1.txt
249 1 hunks, 1 lines changed
304 1 hunks, 1 lines changed
250 examine changes to '1.txt'? [Ynsfdaq?]
305 examine changes to '1.txt'? [Ynsfdaq?]
251 @@ -1,5 +1,5 @@
306 @@ -1,5 +1,5 @@
252 1
307 1
253 2 2
308 2 2
254 3
309 3
255 -4
310 -4
256 +4 4
311 +4 4
257 5
312 5
258 record change 1/2 to '1.txt'? [Ynsfdaq?]
313 record change 1/2 to '1.txt'? [Ynsfdaq?]
259 diff --git a/dir/a.txt b/dir/a.txt
314 diff --git a/dir/a.txt b/dir/a.txt
260 1 hunks, 1 lines changed
315 1 hunks, 1 lines changed
261 examine changes to 'dir/a.txt'? [Ynsfdaq?]
316 examine changes to 'dir/a.txt'? [Ynsfdaq?]
262 @@ -1,4 +1,4 @@
317 @@ -1,4 +1,4 @@
263 -hello world
318 -hello world
264 +hello world!
319 +hello world!
265
320
266 someone
321 someone
267 up
322 up
268 record change 2/2 to 'dir/a.txt'? [Ynsfdaq?]
323 record change 2/2 to 'dir/a.txt'? [Ynsfdaq?]
269
324
270 After qrecord b.patch 'tip'
325 After qrecord b.patch 'tip'
271
326
272 $ hg tip -p
327 $ hg tip -p
273 changeset: 2:b056198bf878
328 changeset: 2:b056198bf878
274 tag: b.patch
329 tag: b.patch
275 tag: qtip
330 tag: qtip
276 tag: tip
331 tag: tip
277 user: test
332 user: test
278 date: Thu Jan 01 00:00:00 1970 +0000
333 date: Thu Jan 01 00:00:00 1970 +0000
279 summary: bbb
334 summary: bbb
280
335
281 diff -r 5d1ca63427ee -r b056198bf878 1.txt
336 diff -r 5d1ca63427ee -r b056198bf878 1.txt
282 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
337 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
283 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
338 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
284 @@ -1,5 +1,5 @@
339 @@ -1,5 +1,5 @@
285 1
340 1
286 2 2
341 2 2
287 3
342 3
288 -4
343 -4
289 +4 4
344 +4 4
290 5
345 5
291 diff -r 5d1ca63427ee -r b056198bf878 dir/a.txt
346 diff -r 5d1ca63427ee -r b056198bf878 dir/a.txt
292 --- a/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
347 --- a/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
293 +++ b/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
348 +++ b/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
294 @@ -1,4 +1,4 @@
349 @@ -1,4 +1,4 @@
295 -hello world
350 -hello world
296 +hello world!
351 +hello world!
297
352
298 someone
353 someone
299 up
354 up
300
355
301
356
302 After qrecord b.patch 'diff'
357 After qrecord b.patch 'diff'
303
358
304 $ hg diff --nodates
359 $ hg diff --nodates
General Comments 0
You need to be logged in to leave comments. Login now