##// END OF EJS Templates
tests: unify test-qrecord
Dan Villiom Podlaski Christiansen -
r12075:f585c9bb default
parent child Browse files
Show More
@@ -1,100 +1,305 b''
1 #!/bin/sh
1 Create configuration
2
2
3 echo "[ui]" >> $HGRCPATH
3 $ echo "[ui]" >> $HGRCPATH
4 echo "interactive=true" >> $HGRCPATH
4 $ echo "interactive=true" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
5 $ echo "[extensions]" >> $HGRCPATH
6 echo "record=" >> $HGRCPATH
6 $ echo "record=" >> $HGRCPATH
7
7
8 echo "% help (no mq, so no qrecord)"
8 help (no mq, so no qrecord)
9
10 hg help qrecord
11
9
12 echo "mq=" >> $HGRCPATH
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
13
35
14 echo "% help (mq present)"
36 help (mq present)
15
37
16 hg help qrecord
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
17
62
18 hg init a
63 $ hg init a
19 cd a
64 $ cd a
20
65
21 echo % base commit
66 Base commit
22
67
23 cat > 1.txt <<EOF
68 $ cat > 1.txt <<EOF
24 1
69 > 1
25 2
70 > 2
26 3
71 > 3
27 4
72 > 4
28 5
73 > 5
29 EOF
74 > EOF
30 cat > 2.txt <<EOF
75 $ cat > 2.txt <<EOF
31 a
76 > a
32 b
77 > b
33 c
78 > c
34 d
79 > d
35 e
80 > e
36 f
81 > f
37 EOF
82 > EOF
38 mkdir dir
83
39 cat > dir/a.txt <<EOF
84 $ mkdir dir
40 hello world
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
41
103
42 someone
104 $ mv -f 1.txt.new 1.txt
43 up
105 $ mv -f 2.txt.new 2.txt
44 there
106 $ mv -f dir/a.txt.new dir/a.txt
45 loves
107
46 me
108 Whole diff
47 EOF
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
48
143
49 hg add 1.txt 2.txt dir/a.txt
144 $ hg qrecord -d '0 0' -m aaa a.patch <<EOF
50 hg commit -m 'initial checkin'
145 > y
51
146 > y
52 echo % changing files
147 > n
53
148 > y
54 sed -e 's/2/2 2/;s/4/4 4/' 1.txt > 1.txt.new
149 > y
55 sed -e 's/b/b b/' 2.txt > 2.txt.new
150 > n
56 sed -e 's/hello world/hello world!/' dir/a.txt > dir/a.txt.new
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?]
57
181
58 mv -f 1.txt.new 1.txt
182 After qrecord a.patch 'tip'"
59 mv -f 2.txt.new 2.txt
60 mv -f dir/a.txt.new dir/a.txt
61
183
62 echo % whole diff
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
63
215
64 hg diff --nodates
216 After qrecord a.patch 'diff'"
65
66 echo % qrecord a.patch
67
217
68 hg qrecord -d '0 0' -m aaa a.patch <<EOF
218 $ hg diff --nodates
69 y
219 diff -r 5d1ca63427ee 1.txt
70 y
220 --- a/1.txt
71 n
221 +++ b/1.txt
72 y
222 @@ -1,5 +1,5 @@
73 y
223 1
74 n
224 2 2
75 EOF
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
76
238
77 echo
239 qrecord b.patch
78 echo % "after qrecord a.patch 'tip'"
79 hg tip -p
80 echo
81 echo % "after qrecord a.patch 'diff'"
82 hg diff --nodates
83
240
84 echo % qrecord b.patch
241 $ hg qrecord -d '0 0' -m bbb b.patch <<EOF
85 hg qrecord -d '0 0' -m bbb b.patch <<EOF
242 > y
86 y
243 > y
87 y
244 > y
88 y
245 > y
89 y
246 > EOF
90 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'
91
270
92 echo
271 $ hg tip -p
93 echo % "after qrecord b.patch 'tip'"
272 changeset: 2:b056198bf878
94 hg tip -p
273 tag: b.patch
95 echo
274 tag: qtip
96 echo % "after qrecord b.patch 'diff'"
275 tag: tip
97 hg diff --nodates
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
98
300
99 echo
301 After qrecord b.patch 'diff'
100 echo % --- end ---
302
303 $ hg diff --nodates
304
305 End No newline at end of file
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now