##// END OF EJS Templates
tests: cleanup exit code handling in unified tests
Matt Mackall -
r12365:22f3353b default
parent child Browse files
Show More
@@ -1,99 +1,99 b''
1 1 $ hg init a
2 2 $ cd a
3 3 $ echo a > a
4 4 $ hg add -n
5 5 adding a
6 6 $ hg st
7 7 ? a
8 8 $ hg add
9 9 adding a
10 10 $ hg st
11 11 A a
12 12 $ hg forget a
13 13 $ hg add
14 14 adding a
15 15 $ hg st
16 16 A a
17 17
18 18 $ echo b > b
19 19 $ hg add -n b
20 20 $ hg st
21 21 A a
22 22 ? b
23 $ hg add b || echo "failed to add b"
23 $ hg add b
24 24 $ hg st
25 25 A a
26 26 A b
27 27
28 28 should fail
29 29
30 30 $ hg add b
31 31 b already tracked!
32 32 $ hg st
33 33 A a
34 34 A b
35 35
36 36 $ hg ci -m 0 --traceback
37 37
38 38 should fail
39 39
40 40 $ hg add a
41 41 a already tracked!
42 42
43 43 $ echo aa > a
44 44 $ hg ci -m 1
45 45 $ hg up 0
46 46 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
47 47 $ echo aaa > a
48 48 $ hg ci -m 2
49 49 created new head
50 50
51 51 $ hg merge
52 52 merging a
53 53 warning: conflicts during merge.
54 54 merging a failed!
55 55 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
56 56 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
57 57 [1]
58 58 $ hg st
59 59 M a
60 60 ? a.orig
61 61
62 62 should fail
63 63
64 64 $ hg add a
65 65 a already tracked!
66 66 $ hg st
67 67 M a
68 68 ? a.orig
69 69 $ hg resolve -m a
70 70 $ hg ci -m merge
71 71
72 72 issue683
73 73
74 74 $ hg forget a
75 75 $ hg add a
76 76 $ hg st
77 77 ? a.orig
78 78 $ hg rm a
79 79 $ hg st
80 80 R a
81 81 ? a.orig
82 82 $ echo a > a
83 83 $ hg add a
84 84 $ hg st
85 85 M a
86 86 ? a.orig
87 87
88 88 $ hg add c && echo "unexpected addition of missing file"
89 89 c: No such file or directory
90 90 [1]
91 91 $ echo c > c
92 92 $ hg add d c && echo "unexpected addition of missing file"
93 93 d: No such file or directory
94 94 [1]
95 95 $ hg st
96 96 M a
97 97 A c
98 98 ? a.orig
99 99
@@ -1,36 +1,30 b''
1 1 $ hg clone http://localhost:$HGPORT/ copy
2 2 abort: error: Connection refused
3 3 [255]
4 4
5 $ echo $?
6 0
7
8 5 $ test -d copy || echo copy: No such file or directory
9 6 copy: No such file or directory
10 7
11 8 $ cat > dumb.py <<EOF
12 9 > import BaseHTTPServer, SimpleHTTPServer, os, signal
13 10 > def run(server_class=BaseHTTPServer.HTTPServer,
14 11 > handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler):
15 12 > server_address = ('localhost', int(os.environ['HGPORT']))
16 13 > httpd = server_class(server_address, handler_class)
17 14 > httpd.serve_forever()
18 15 > signal.signal(signal.SIGTERM, lambda x: sys.exit(0))
19 16 > run()
20 17 > EOF
21 18
22 19 $ python dumb.py 2>/dev/null &
23 20 $ echo $! >> $DAEMON_PIDS
24 21
25 22 give the server some time to start running
26 23
27 24 $ sleep 1
28 25
29 26 $ hg clone http://localhost:$HGPORT/foo copy2 2>&1
30 27 abort: HTTP Error 404: .*
31 28 [255]
32 29
33 $ echo $?
34 0
35
36 30 $ kill $!
@@ -1,379 +1,367 b''
1 1 $ heads()
2 2 > {
3 3 > hg heads --template '{rev}: {desc|firstline|strip} ({branches})\n' "$@"
4 4 > }
5 5
6 6 $ hg init a
7 7 $ cd a
8 8 $ echo 'root' >root
9 9 $ hg add root
10 10 $ hg commit -m "Adding root node"
11 11 $ heads
12 12 0: Adding root node ()
13 13 -------
14 14 $ heads .
15 15 0: Adding root node ()
16 16
17 17 =======
18 18
19 19 $ echo 'a' >a
20 20 $ hg add a
21 21 $ hg branch a
22 22 marked working directory as branch a
23 23 $ hg commit -m "Adding a branch"
24 24 $ heads
25 25 1: Adding a branch (a)
26 26 0: Adding root node ()
27 27 -------
28 28 $ heads .
29 29 1: Adding a branch (a)
30 30
31 31 =======
32 32
33 33 $ hg update -C 0
34 34 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
35 35 $ echo 'b' >b
36 36 $ hg add b
37 37 $ hg branch b
38 38 marked working directory as branch b
39 39 $ hg commit -m "Adding b branch"
40 40 $ heads
41 41 2: Adding b branch (b)
42 42 1: Adding a branch (a)
43 43 0: Adding root node ()
44 44 -------
45 45 $ heads .
46 46 2: Adding b branch (b)
47 47
48 48 =======
49 49
50 50 $ echo 'bh1' >bh1
51 51 $ hg add bh1
52 52 $ hg commit -m "Adding b branch head 1"
53 53 $ heads
54 54 3: Adding b branch head 1 (b)
55 55 1: Adding a branch (a)
56 56 0: Adding root node ()
57 57 -------
58 58 $ heads .
59 59 3: Adding b branch head 1 (b)
60 60
61 61 =======
62 62
63 63 $ hg update -C 2
64 64 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
65 65 $ echo 'bh2' >bh2
66 66 $ hg add bh2
67 67 $ hg commit -m "Adding b branch head 2"
68 68 created new head
69 69 $ heads
70 70 4: Adding b branch head 2 (b)
71 71 3: Adding b branch head 1 (b)
72 72 1: Adding a branch (a)
73 73 0: Adding root node ()
74 74 $ heads .
75 75 4: Adding b branch head 2 (b)
76 76 3: Adding b branch head 1 (b)
77 77
78 78 =======
79 79
80 80 $ hg update -C 2
81 81 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
82 82 $ echo 'bh3' >bh3
83 83 $ hg add bh3
84 84 $ hg commit -m "Adding b branch head 3"
85 85 created new head
86 86 $ heads
87 87 5: Adding b branch head 3 (b)
88 88 4: Adding b branch head 2 (b)
89 89 3: Adding b branch head 1 (b)
90 90 1: Adding a branch (a)
91 91 0: Adding root node ()
92 92 -------
93 93 $ heads .
94 94 5: Adding b branch head 3 (b)
95 95 4: Adding b branch head 2 (b)
96 96 3: Adding b branch head 1 (b)
97 97
98 98 =======
99 99
100 100 $ hg merge 4
101 101 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
102 102 (branch merge, don't forget to commit)
103 103 $ hg commit -m "Merging b branch head 2 and b branch head 3"
104 104 $ heads
105 105 6: Merging b branch head 2 and b branch head 3 (b)
106 106 3: Adding b branch head 1 (b)
107 107 1: Adding a branch (a)
108 108 0: Adding root node ()
109 109 -------
110 110 $ heads .
111 111 6: Merging b branch head 2 and b branch head 3 (b)
112 112 3: Adding b branch head 1 (b)
113 113
114 114 =======
115 115
116 116 $ echo 'c' >c
117 117 $ hg add c
118 118 $ hg branch c
119 119 marked working directory as branch c
120 120 $ hg commit -m "Adding c branch"
121 121 $ heads
122 122 7: Adding c branch (c)
123 123 6: Merging b branch head 2 and b branch head 3 (b)
124 124 3: Adding b branch head 1 (b)
125 125 1: Adding a branch (a)
126 126 0: Adding root node ()
127 127 -------
128 128 $ heads .
129 129 7: Adding c branch (c)
130 130
131 131 =======
132 132
133 133 $ heads -r 3 .
134 134 no open branch heads found on branches c (started at 3)
135 135 [1]
136 $ echo $?
137 0
138 136 $ heads -r 2 .
139 137 7: Adding c branch (c)
140 $ echo $?
141 0
142 138 -------
143 139 $ hg update -C 4
144 140 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
145 $ echo $?
146 0
147 141 -------
148 142 $ heads -r 3 .
149 143 3: Adding b branch head 1 (b)
150 $ echo $?
151 0
152 144 -------
153 145 $ heads -r 2 .
154 146 6: Merging b branch head 2 and b branch head 3 (b)
155 147 3: Adding b branch head 1 (b)
156 $ echo $?
157 0
158 148 -------
159 149 $ heads -r 7 .
160 150 no open branch heads found on branches b (started at 7)
161 151 [1]
162 $ echo $?
163 0
164 152
165 153 =======
166 154
167 155 $ for i in 0 1 2 3 4 5 6 7; do
168 156 > hg update -C "$i"
169 157 > heads
170 158 > echo '-------'
171 159 > heads .
172 160 > echo '-------'
173 161 > done
174 162 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
175 163 7: Adding c branch (c)
176 164 6: Merging b branch head 2 and b branch head 3 (b)
177 165 3: Adding b branch head 1 (b)
178 166 1: Adding a branch (a)
179 167 0: Adding root node ()
180 168 -------
181 169 0: Adding root node ()
182 170 -------
183 171 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
184 172 7: Adding c branch (c)
185 173 6: Merging b branch head 2 and b branch head 3 (b)
186 174 3: Adding b branch head 1 (b)
187 175 1: Adding a branch (a)
188 176 0: Adding root node ()
189 177 -------
190 178 1: Adding a branch (a)
191 179 -------
192 180 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
193 181 7: Adding c branch (c)
194 182 6: Merging b branch head 2 and b branch head 3 (b)
195 183 3: Adding b branch head 1 (b)
196 184 1: Adding a branch (a)
197 185 0: Adding root node ()
198 186 -------
199 187 6: Merging b branch head 2 and b branch head 3 (b)
200 188 3: Adding b branch head 1 (b)
201 189 -------
202 190 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
203 191 7: Adding c branch (c)
204 192 6: Merging b branch head 2 and b branch head 3 (b)
205 193 3: Adding b branch head 1 (b)
206 194 1: Adding a branch (a)
207 195 0: Adding root node ()
208 196 -------
209 197 6: Merging b branch head 2 and b branch head 3 (b)
210 198 3: Adding b branch head 1 (b)
211 199 -------
212 200 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
213 201 7: Adding c branch (c)
214 202 6: Merging b branch head 2 and b branch head 3 (b)
215 203 3: Adding b branch head 1 (b)
216 204 1: Adding a branch (a)
217 205 0: Adding root node ()
218 206 -------
219 207 6: Merging b branch head 2 and b branch head 3 (b)
220 208 3: Adding b branch head 1 (b)
221 209 -------
222 210 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
223 211 7: Adding c branch (c)
224 212 6: Merging b branch head 2 and b branch head 3 (b)
225 213 3: Adding b branch head 1 (b)
226 214 1: Adding a branch (a)
227 215 0: Adding root node ()
228 216 -------
229 217 6: Merging b branch head 2 and b branch head 3 (b)
230 218 3: Adding b branch head 1 (b)
231 219 -------
232 220 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
233 221 7: Adding c branch (c)
234 222 6: Merging b branch head 2 and b branch head 3 (b)
235 223 3: Adding b branch head 1 (b)
236 224 1: Adding a branch (a)
237 225 0: Adding root node ()
238 226 -------
239 227 6: Merging b branch head 2 and b branch head 3 (b)
240 228 3: Adding b branch head 1 (b)
241 229 -------
242 230 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
243 231 7: Adding c branch (c)
244 232 6: Merging b branch head 2 and b branch head 3 (b)
245 233 3: Adding b branch head 1 (b)
246 234 1: Adding a branch (a)
247 235 0: Adding root node ()
248 236 -------
249 237 7: Adding c branch (c)
250 238 -------
251 239
252 240 =======
253 241
254 242 $ for i in a b c z; do
255 243 > heads "$i"
256 244 > echo '-------'
257 245 > done
258 246 1: Adding a branch (a)
259 247 -------
260 248 6: Merging b branch head 2 and b branch head 3 (b)
261 249 3: Adding b branch head 1 (b)
262 250 -------
263 251 7: Adding c branch (c)
264 252 -------
265 253 abort: unknown revision 'z'!
266 254 -------
267 255
268 256 =======
269 257
270 258 $ heads 0 1 2 3 4 5 6 7
271 259 7: Adding c branch (c)
272 260 6: Merging b branch head 2 and b branch head 3 (b)
273 261 3: Adding b branch head 1 (b)
274 262 1: Adding a branch (a)
275 263 0: Adding root node ()
276 264
277 265 Topological heads:
278 266
279 267 $ heads -t
280 268 7: Adding c branch (c)
281 269 3: Adding b branch head 1 (b)
282 270 1: Adding a branch (a)
283 271
284 272 $ cd ..
285 273 ______________
286 274
287 275 "created new head" message tests
288 276
289 277 $ hg init newheadmsg
290 278 $ cd newheadmsg
291 279
292 280 Init: no msg
293 281
294 282 $ echo 1 > a
295 283 $ hg ci -Am "a0: Initial root"
296 284 adding a
297 285 $ echo 2 >> a
298 286 $ hg ci -m "a1 (HN)"
299 287
300 288 $ hg branch b
301 289 marked working directory as branch b
302 290 $ echo 1 > b
303 291 $ hg ci -Am "b2: Initial root for branch b"
304 292 adding b
305 293 $ echo 2 >> b
306 294 $ hg ci -m "b3 (HN)"
307 295
308 296 Case NN: msg
309 297
310 298 $ hg up -q null
311 299 $ hg branch -f b
312 300 marked working directory as branch b
313 301 $ echo 1 > bb
314 302 $ hg ci -Am "b4 (NN): new topo root for branch b"
315 303 adding bb
316 304 created new head
317 305
318 306 Case HN: no msg
319 307
320 308 $ echo 2 >> bb
321 309 $ hg ci -m "b5 (HN)"
322 310
323 311 Case BN: msg
324 312
325 313 $ hg branch -f default
326 314 marked working directory as branch default
327 315 $ echo 1 > aa
328 316 $ hg ci -Am "a6 (BN): new branch root"
329 317 adding aa
330 318 created new head
331 319
332 320 Case CN: msg
333 321
334 322 $ hg up -q 4
335 323 $ echo 3 >> bbb
336 324 $ hg ci -Am "b7 (CN): regular new head"
337 325 adding bbb
338 326 created new head
339 327
340 328 Case BB: msg
341 329
342 330 $ hg up -q 4
343 331 $ hg merge -q 3
344 332 $ hg branch -f default
345 333 marked working directory as branch default
346 334 $ hg ci -m "a8 (BB): weird new branch root"
347 335 created new head
348 336
349 337 Case CB: msg
350 338
351 339 $ hg up -q 4
352 340 $ hg merge -q 1
353 341 $ hg ci -m "b9 (CB): new head from branch merge"
354 342 created new head
355 343
356 344 Case HB: no msg
357 345
358 346 $ hg up -q 7
359 347 $ hg merge -q 6
360 348 $ hg ci -m "b10 (HB): continuing head from branch merge"
361 349
362 350 Case CC: msg
363 351
364 352 $ hg up -q 4
365 353 $ hg merge -q 2
366 354 $ hg ci -m "b11 (CC): new head from merge"
367 355 created new head
368 356
369 357 Case CH: no msg
370 358
371 359 $ hg up -q 2
372 360 $ hg merge -q 10
373 361 $ hg ci -m "b12 (CH): continuing head from merge"
374 362
375 363 Case HH: no msg
376 364
377 365 $ hg merge -q 3
378 366 $ hg ci -m "b12 (HH): merging two heads"
379 367
@@ -1,419 +1,419 b''
1 $ set -e
2 1 $ hg init
3 2
4 3
5 4 committing changes
6 5
7 6 $ count=0
8 7 $ echo > a
9 8 $ while test $count -lt 32 ; do
10 9 > echo 'a' >> a
11 10 > test $count -eq 0 && hg add
12 11 > hg ci -m "msg $count" -d "$count 0"
13 12 > count=`expr $count + 1`
14 13 > done
15 14 adding a
16 15
17 16
18 17 $ hg log
19 18 changeset: 31:58c80a7c8a40
20 19 tag: tip
21 20 user: test
22 21 date: Thu Jan 01 00:00:31 1970 +0000
23 22 summary: msg 31
24 23
25 24 changeset: 30:ed2d2f24b11c
26 25 user: test
27 26 date: Thu Jan 01 00:00:30 1970 +0000
28 27 summary: msg 30
29 28
30 29 changeset: 29:b5bd63375ab9
31 30 user: test
32 31 date: Thu Jan 01 00:00:29 1970 +0000
33 32 summary: msg 29
34 33
35 34 changeset: 28:8e0c2264c8af
36 35 user: test
37 36 date: Thu Jan 01 00:00:28 1970 +0000
38 37 summary: msg 28
39 38
40 39 changeset: 27:288867a866e9
41 40 user: test
42 41 date: Thu Jan 01 00:00:27 1970 +0000
43 42 summary: msg 27
44 43
45 44 changeset: 26:3efc6fd51aeb
46 45 user: test
47 46 date: Thu Jan 01 00:00:26 1970 +0000
48 47 summary: msg 26
49 48
50 49 changeset: 25:02a84173a97a
51 50 user: test
52 51 date: Thu Jan 01 00:00:25 1970 +0000
53 52 summary: msg 25
54 53
55 54 changeset: 24:10e0acd3809e
56 55 user: test
57 56 date: Thu Jan 01 00:00:24 1970 +0000
58 57 summary: msg 24
59 58
60 59 changeset: 23:5ec79163bff4
61 60 user: test
62 61 date: Thu Jan 01 00:00:23 1970 +0000
63 62 summary: msg 23
64 63
65 64 changeset: 22:06c7993750ce
66 65 user: test
67 66 date: Thu Jan 01 00:00:22 1970 +0000
68 67 summary: msg 22
69 68
70 69 changeset: 21:e5db6aa3fe2a
71 70 user: test
72 71 date: Thu Jan 01 00:00:21 1970 +0000
73 72 summary: msg 21
74 73
75 74 changeset: 20:7128fb4fdbc9
76 75 user: test
77 76 date: Thu Jan 01 00:00:20 1970 +0000
78 77 summary: msg 20
79 78
80 79 changeset: 19:52798545b482
81 80 user: test
82 81 date: Thu Jan 01 00:00:19 1970 +0000
83 82 summary: msg 19
84 83
85 84 changeset: 18:86977a90077e
86 85 user: test
87 86 date: Thu Jan 01 00:00:18 1970 +0000
88 87 summary: msg 18
89 88
90 89 changeset: 17:03515f4a9080
91 90 user: test
92 91 date: Thu Jan 01 00:00:17 1970 +0000
93 92 summary: msg 17
94 93
95 94 changeset: 16:a2e6ea4973e9
96 95 user: test
97 96 date: Thu Jan 01 00:00:16 1970 +0000
98 97 summary: msg 16
99 98
100 99 changeset: 15:e7fa0811edb0
101 100 user: test
102 101 date: Thu Jan 01 00:00:15 1970 +0000
103 102 summary: msg 15
104 103
105 104 changeset: 14:ce8f0998e922
106 105 user: test
107 106 date: Thu Jan 01 00:00:14 1970 +0000
108 107 summary: msg 14
109 108
110 109 changeset: 13:9d7d07bc967c
111 110 user: test
112 111 date: Thu Jan 01 00:00:13 1970 +0000
113 112 summary: msg 13
114 113
115 114 changeset: 12:1941b52820a5
116 115 user: test
117 116 date: Thu Jan 01 00:00:12 1970 +0000
118 117 summary: msg 12
119 118
120 119 changeset: 11:7b4cd9578619
121 120 user: test
122 121 date: Thu Jan 01 00:00:11 1970 +0000
123 122 summary: msg 11
124 123
125 124 changeset: 10:7c5eff49a6b6
126 125 user: test
127 126 date: Thu Jan 01 00:00:10 1970 +0000
128 127 summary: msg 10
129 128
130 129 changeset: 9:eb44510ef29a
131 130 user: test
132 131 date: Thu Jan 01 00:00:09 1970 +0000
133 132 summary: msg 9
134 133
135 134 changeset: 8:453eb4dba229
136 135 user: test
137 136 date: Thu Jan 01 00:00:08 1970 +0000
138 137 summary: msg 8
139 138
140 139 changeset: 7:03750880c6b5
141 140 user: test
142 141 date: Thu Jan 01 00:00:07 1970 +0000
143 142 summary: msg 7
144 143
145 144 changeset: 6:a3d5c6fdf0d3
146 145 user: test
147 146 date: Thu Jan 01 00:00:06 1970 +0000
148 147 summary: msg 6
149 148
150 149 changeset: 5:7874a09ea728
151 150 user: test
152 151 date: Thu Jan 01 00:00:05 1970 +0000
153 152 summary: msg 5
154 153
155 154 changeset: 4:9b2ba8336a65
156 155 user: test
157 156 date: Thu Jan 01 00:00:04 1970 +0000
158 157 summary: msg 4
159 158
160 159 changeset: 3:b53bea5e2fcb
161 160 user: test
162 161 date: Thu Jan 01 00:00:03 1970 +0000
163 162 summary: msg 3
164 163
165 164 changeset: 2:db07c04beaca
166 165 user: test
167 166 date: Thu Jan 01 00:00:02 1970 +0000
168 167 summary: msg 2
169 168
170 169 changeset: 1:5cd978ea5149
171 170 user: test
172 171 date: Thu Jan 01 00:00:01 1970 +0000
173 172 summary: msg 1
174 173
175 174 changeset: 0:b99c7b9c8e11
176 175 user: test
177 176 date: Thu Jan 01 00:00:00 1970 +0000
178 177 summary: msg 0
179 178
180 179
181 180 $ hg up -C
182 181 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
183 182
184 183 bisect test
185 184
186 185 $ hg bisect -r
187 186 $ hg bisect -b
188 187 $ hg bisect -g 1
189 188 Testing changeset 16:a2e6ea4973e9 (30 changesets remaining, ~4 tests)
190 189 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
191 190 $ hg bisect -g
192 191 Testing changeset 23:5ec79163bff4 (15 changesets remaining, ~3 tests)
193 192 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
194 193
195 194 skip
196 195
197 196 $ hg bisect -s
198 197 Testing changeset 24:10e0acd3809e (15 changesets remaining, ~3 tests)
199 198 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
200 199 $ hg bisect -g
201 200 Testing changeset 27:288867a866e9 (7 changesets remaining, ~2 tests)
202 201 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
203 202 $ hg bisect -g
204 203 Testing changeset 29:b5bd63375ab9 (4 changesets remaining, ~2 tests)
205 204 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
206 205 $ hg bisect -b
207 206 Testing changeset 28:8e0c2264c8af (2 changesets remaining, ~1 tests)
208 207 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
209 208 $ hg bisect -g
210 209 The first bad revision is:
211 210 changeset: 29:b5bd63375ab9
212 211 user: test
213 212 date: Thu Jan 01 00:00:29 1970 +0000
214 213 summary: msg 29
215 214
216 215
217 216 mark revsets instead of single revs
218 217
219 218 $ hg bisect -r
220 219 $ hg bisect -b "0::3"
221 220 $ hg bisect -s "13::16"
222 221 $ hg bisect -g "26::tip"
223 222 Testing changeset 12:1941b52820a5 (23 changesets remaining, ~4 tests)
224 223 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
225 224 $ cat .hg/bisect.state
226 225 skip 9d7d07bc967ca98ad0600c24953fd289ad5fa991
227 226 skip ce8f0998e922c179e80819d5066fbe46e2998784
228 227 skip e7fa0811edb063f6319531f0d0a865882138e180
229 228 skip a2e6ea4973e9196ddd3386493b0c214b41fd97d3
230 229 bad b99c7b9c8e11558adef3fad9af211c58d46f325b
231 230 bad 5cd978ea51499179507ee7b6f340d2dbaa401185
232 231 bad db07c04beaca44cf24832541e7f4a2346a95275b
233 232 bad b53bea5e2fcb30d3e00bd3409507a5659ce0fd8b
234 233 good 3efc6fd51aeb8594398044c6c846ca59ae021203
235 234 good 288867a866e9adb7a29880b66936c874b80f4651
236 235 good 8e0c2264c8af790daf3585ada0669d93dee09c83
237 236 good b5bd63375ab9a290419f2024b7f4ee9ea7ce90a8
238 237 good ed2d2f24b11c368fa8aa0da9f4e1db580abade59
239 238 good 58c80a7c8a4025a94cedaf7b4a4e3124e8909a96
240 239
241 240 bisect reverse test
242 241
243 242 $ hg bisect -r
244 243 $ hg bisect -b null
245 244 $ hg bisect -g tip
246 245 Testing changeset 15:e7fa0811edb0 (32 changesets remaining, ~5 tests)
247 246 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
248 247 $ hg bisect -g
249 248 Testing changeset 7:03750880c6b5 (16 changesets remaining, ~4 tests)
250 249 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
251 250
252 251 skip
253 252
254 253 $ hg bisect -s
255 254 Testing changeset 6:a3d5c6fdf0d3 (16 changesets remaining, ~4 tests)
256 255 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
257 256 $ hg bisect -g
258 257 Testing changeset 2:db07c04beaca (7 changesets remaining, ~2 tests)
259 258 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
260 259 $ hg bisect -g
261 260 Testing changeset 0:b99c7b9c8e11 (3 changesets remaining, ~1 tests)
262 261 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
263 262 $ hg bisect -b
264 263 Testing changeset 1:5cd978ea5149 (2 changesets remaining, ~1 tests)
265 264 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
266 265 $ hg bisect -g
267 266 The first good revision is:
268 267 changeset: 1:5cd978ea5149
269 268 user: test
270 269 date: Thu Jan 01 00:00:01 1970 +0000
271 270 summary: msg 1
272 271
272 $ false
273 [1]
274
273 275
274 276 $ hg bisect -r
275 277 $ hg bisect -g tip
276 $ hg bisect -b tip || echo error
278 $ hg bisect -b tip
277 279 abort: starting revisions are not directly related
278 error
279 280
280 281 $ hg bisect -r
281 282 $ hg bisect -g null
282 283 $ hg bisect -bU tip
283 284 Testing changeset 15:e7fa0811edb0 (32 changesets remaining, ~5 tests)
284 285 $ hg id
285 286 5cd978ea5149
286 287
287 288
288 289 reproduce AssertionError, issue1228 and issue1182
289 290
290 291 $ hg bisect -r
291 292 $ hg bisect -b 4
292 293 $ hg bisect -g 0
293 294 Testing changeset 2:db07c04beaca (4 changesets remaining, ~2 tests)
294 295 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
295 296 $ hg bisect -s
296 297 Testing changeset 1:5cd978ea5149 (4 changesets remaining, ~2 tests)
297 298 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
298 299 $ hg bisect -s
299 300 Testing changeset 3:b53bea5e2fcb (4 changesets remaining, ~2 tests)
300 301 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
301 302 $ hg bisect -s
302 303 Due to skipped revisions, the first bad revision could be any of:
303 304 changeset: 1:5cd978ea5149
304 305 user: test
305 306 date: Thu Jan 01 00:00:01 1970 +0000
306 307 summary: msg 1
307 308
308 309 changeset: 2:db07c04beaca
309 310 user: test
310 311 date: Thu Jan 01 00:00:02 1970 +0000
311 312 summary: msg 2
312 313
313 314 changeset: 3:b53bea5e2fcb
314 315 user: test
315 316 date: Thu Jan 01 00:00:03 1970 +0000
316 317 summary: msg 3
317 318
318 319 changeset: 4:9b2ba8336a65
319 320 user: test
320 321 date: Thu Jan 01 00:00:04 1970 +0000
321 322 summary: msg 4
322 323
323 324
324 325
325 326 reproduce non converging bisect, issue1182
326 327
327 328 $ hg bisect -r
328 329 $ hg bisect -g 0
329 330 $ hg bisect -b 2
330 331 Testing changeset 1:5cd978ea5149 (2 changesets remaining, ~1 tests)
331 332 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
332 333 $ hg bisect -s
333 334 Due to skipped revisions, the first bad revision could be any of:
334 335 changeset: 1:5cd978ea5149
335 336 user: test
336 337 date: Thu Jan 01 00:00:01 1970 +0000
337 338 summary: msg 1
338 339
339 340 changeset: 2:db07c04beaca
340 341 user: test
341 342 date: Thu Jan 01 00:00:02 1970 +0000
342 343 summary: msg 2
343 344
344 345
345 346
346 347 test no action
347 348
348 349 $ hg bisect -r
349 $ hg bisect || echo failure
350 $ hg bisect
350 351 abort: cannot bisect (no known good revisions)
351 failure
352 352
353 353
354 354 reproduce AssertionError, issue1445
355 355
356 356 $ hg bisect -r
357 357 $ hg bisect -b 6
358 358 $ hg bisect -g 0
359 359 Testing changeset 3:b53bea5e2fcb (6 changesets remaining, ~2 tests)
360 360 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
361 361 $ hg bisect -s
362 362 Testing changeset 2:db07c04beaca (6 changesets remaining, ~2 tests)
363 363 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
364 364 $ hg bisect -s
365 365 Testing changeset 4:9b2ba8336a65 (6 changesets remaining, ~2 tests)
366 366 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
367 367 $ hg bisect -s
368 368 Testing changeset 1:5cd978ea5149 (6 changesets remaining, ~2 tests)
369 369 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
370 370 $ hg bisect -s
371 371 Testing changeset 5:7874a09ea728 (6 changesets remaining, ~2 tests)
372 372 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
373 373 $ hg bisect -g
374 374 The first bad revision is:
375 375 changeset: 6:a3d5c6fdf0d3
376 376 user: test
377 377 date: Thu Jan 01 00:00:06 1970 +0000
378 378 summary: msg 6
379 379
380 380
381 381 $ set +e
382 382
383 383 test invalid command
384 384 assuming that the shell returns 127 if command not found ...
385 385
386 386 $ hg bisect -r
387 387 $ hg bisect --command 'exit 127'
388 388 abort: failed to execute exit 127
389 389 [255]
390 390
391 391
392 392 test bisecting command
393 393
394 394 $ cat > script.py <<EOF
395 395 > #!/usr/bin/env python
396 396 > import sys
397 397 > from mercurial import ui, hg
398 398 > repo = hg.repository(ui.ui(), '.')
399 399 > if repo['.'].rev() < 6:
400 400 > sys.exit(1)
401 401 > EOF
402 402 $ chmod +x script.py
403 403 $ hg bisect -r
404 404 $ hg bisect --good tip
405 405 $ hg bisect --bad 0
406 406 Testing changeset 15:e7fa0811edb0 (31 changesets remaining, ~4 tests)
407 407 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
408 408 $ hg bisect --command "'`pwd`/script.py' and some parameters"
409 409 Changeset 15:e7fa0811edb0: good
410 410 Changeset 7:03750880c6b5: good
411 411 Changeset 3:b53bea5e2fcb: bad
412 412 Changeset 5:7874a09ea728: bad
413 413 Changeset 6:a3d5c6fdf0d3: good
414 414 The first good revision is:
415 415 changeset: 6:a3d5c6fdf0d3
416 416 user: test
417 417 date: Thu Jan 01 00:00:06 1970 +0000
418 418 summary: msg 6
419 419
@@ -1,147 +1,145 b''
1 1 this structure seems to tickle a bug in bundle's search for
2 2 changesets, so first we have to recreate it
3 3
4 4 o 8
5 5 |
6 6 | o 7
7 7 | |
8 8 | o 6
9 9 |/|
10 10 o | 5
11 11 | |
12 12 o | 4
13 13 | |
14 14 | o 3
15 15 | |
16 16 | o 2
17 17 |/
18 18 o 1
19 19 |
20 20 o 0
21 21
22 22 $ mkrev()
23 23 > {
24 24 > revno=$1
25 25 > echo "rev $revno"
26 26 > echo "rev $revno" > foo.txt
27 27 > hg -q ci -m"rev $revno"
28 28 > }
29 29
30 $ set -e
31
32 30 setup test repo1
33 31
34 32 $ hg init repo1
35 33 $ cd repo1
36 34 $ echo "rev 0" > foo.txt
37 35 $ hg ci -Am"rev 0"
38 36 adding foo.txt
39 37 $ mkrev 1
40 38 rev 1
41 39
42 40 first branch
43 41
44 42 $ mkrev 2
45 43 rev 2
46 44 $ mkrev 3
47 45 rev 3
48 46
49 47 back to rev 1 to create second branch
50 48
51 49 $ hg up -r1
52 50 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
53 51 $ mkrev 4
54 52 rev 4
55 53 $ mkrev 5
56 54 rev 5
57 55
58 56 merge first branch to second branch
59 57
60 58 $ hg up -C -r5
61 59 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 60 $ HGMERGE=internal:local hg merge
63 61 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
64 62 (branch merge, don't forget to commit)
65 63 $ echo "merge rev 5, rev 3" > foo.txt
66 64 $ hg ci -m"merge first branch to second branch"
67 65
68 66 one more commit following the merge
69 67
70 68 $ mkrev 7
71 69 rev 7
72 70
73 71 back to "second branch" to make another head
74 72
75 73 $ hg up -r5
76 74 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
77 75 $ mkrev 8
78 76 rev 8
79 77
80 78 $ echo "[extensions]" >> $HGRCPATH
81 79 $ echo "graphlog=" >> $HGRCPATH
82 80
83 81 the story so far
84 82
85 83 $ hg glog --template "{rev}\n"
86 84 @ 8
87 85 |
88 86 | o 7
89 87 | |
90 88 | o 6
91 89 |/|
92 90 o | 5
93 91 | |
94 92 o | 4
95 93 | |
96 94 | o 3
97 95 | |
98 96 | o 2
99 97 |/
100 98 o 1
101 99 |
102 100 o 0
103 101
104 102
105 103 check that "hg outgoing" really does the right thing
106 104
107 105 sanity check of outgoing: expect revs 4 5 6 7 8
108 106
109 107 $ hg clone -r3 . ../repo2
110 108 requesting all changes
111 109 adding changesets
112 110 adding manifests
113 111 adding file changes
114 112 added 4 changesets with 4 changes to 1 files
115 113 updating to branch default
116 114 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
117 115
118 116 this should (and does) report 5 outgoing revisions: 4 5 6 7 8
119 117
120 118 $ hg outgoing --template "{rev}\n" ../repo2
121 119 comparing with ../repo2
122 120 searching for changes
123 121 4
124 122 5
125 123 6
126 124 7
127 125 8
128 126
129 127 test bundle (destination repo): expect 5 revisions
130 128
131 129 this should bundle the same 5 revisions that outgoing reported, but it
132 130
133 131 actually bundles 7
134 132
135 133 $ hg bundle foo.bundle ../repo2
136 134 searching for changes
137 135 5 changesets found
138 136
139 137 test bundle (base revision): expect 5 revisions
140 138
141 139 this should (and does) give exactly the same result as bundle
142 140
143 141 with a destination repo... i.e. it's wrong too
144 142
145 143 $ hg bundle --base 3 foo.bundle
146 144 5 changesets found
147 145
@@ -1,336 +1,337 b''
1 1
2 2 $ hg init
3 3
4 4 New file:
5 5
6 6 $ hg import -d "1000000 0" -mnew - <<EOF
7 7 > diff --git a/new b/new
8 8 > new file mode 100644
9 9 > index 0000000..7898192
10 10 > --- /dev/null
11 11 > +++ b/new
12 12 > @@ -0,0 +1 @@
13 13 > +a
14 14 > EOF
15 15 applying patch from stdin
16 16
17 17 $ hg tip -q
18 18 0:ae3ee40d2079
19 19
20 20 New empty file:
21 21
22 22 $ hg import -d "1000000 0" -mempty - <<EOF
23 23 > diff --git a/empty b/empty
24 24 > new file mode 100644
25 25 > EOF
26 26 applying patch from stdin
27 27
28 28 $ hg tip -q
29 29 1:ab199dc869b5
30 30
31 31 $ hg locate empty
32 32 empty
33 33
34 34 chmod +x:
35 35
36 36 $ hg import -d "1000000 0" -msetx - <<EOF
37 37 > diff --git a/new b/new
38 38 > old mode 100644
39 39 > new mode 100755
40 40 > EOF
41 41 applying patch from stdin
42 42
43 43 $ hg tip -q
44 44 2:3a34410f282e
45 45
46 $ test -x new || echo failed
46 $ test -x new
47 47
48 48 Copy:
49 49
50 50 $ hg import -d "1000000 0" -mcopy - <<EOF
51 51 > diff --git a/new b/copy
52 52 > old mode 100755
53 53 > new mode 100644
54 54 > similarity index 100%
55 55 > copy from new
56 56 > copy to copy
57 57 > diff --git a/new b/copyx
58 58 > similarity index 100%
59 59 > copy from new
60 60 > copy to copyx
61 61 > EOF
62 62 applying patch from stdin
63 63
64 64 $ hg tip -q
65 65 3:37bacb7ca14d
66 66
67 67 $ if "$TESTDIR/hghave" -q execbit; then
68 > test -f copy -a ! -x copy || echo failed
69 > test -x copyx || echo failed
68 > test -f copy -a ! -x copy || echo bad
69 > test -x copyx || echo bad
70 70 > else
71 > test -f copy || echo failed
71 > test -f copy || echo bad
72 72 > fi
73 73
74 74 $ cat copy
75 75 a
76 76
77 77 $ hg cat copy
78 78 a
79 79
80 80 Rename:
81 81
82 82 $ hg import -d "1000000 0" -mrename - <<EOF
83 83 > diff --git a/copy b/rename
84 84 > similarity index 100%
85 85 > rename from copy
86 86 > rename to rename
87 87 > EOF
88 88 applying patch from stdin
89 89
90 90 $ hg tip -q
91 91 4:47b81a94361d
92 92
93 93 $ hg locate
94 94 copyx
95 95 empty
96 96 new
97 97 rename
98 98
99 99 Delete:
100 100
101 101 $ hg import -d "1000000 0" -mdelete - <<EOF
102 102 > diff --git a/copyx b/copyx
103 103 > deleted file mode 100755
104 104 > index 7898192..0000000
105 105 > --- a/copyx
106 106 > +++ /dev/null
107 107 > @@ -1 +0,0 @@
108 108 > -a
109 109 > EOF
110 110 applying patch from stdin
111 111
112 112 $ hg tip -q
113 113 5:d9b001d98336
114 114
115 115 $ hg locate
116 116 empty
117 117 new
118 118 rename
119 119
120 $ test -f copyx && echo failed || true
120 $ test -f copyx
121 [1]
121 122
122 123 Regular diff:
123 124
124 125 $ hg import -d "1000000 0" -mregular - <<EOF
125 126 > diff --git a/rename b/rename
126 127 > index 7898192..72e1fe3 100644
127 128 > --- a/rename
128 129 > +++ b/rename
129 130 > @@ -1 +1,5 @@
130 131 > a
131 132 > +a
132 133 > +a
133 134 > +a
134 135 > +a
135 136 > EOF
136 137 applying patch from stdin
137 138
138 139 $ hg tip -q
139 140 6:ebe901e7576b
140 141
141 142 Copy and modify:
142 143
143 144 $ hg import -d "1000000 0" -mcopymod - <<EOF
144 145 > diff --git a/rename b/copy2
145 146 > similarity index 80%
146 147 > copy from rename
147 148 > copy to copy2
148 149 > index 72e1fe3..b53c148 100644
149 150 > --- a/rename
150 151 > +++ b/copy2
151 152 > @@ -1,5 +1,5 @@
152 153 > a
153 154 > a
154 155 > -a
155 156 > +b
156 157 > a
157 158 > a
158 159 > EOF
159 160 applying patch from stdin
160 161
161 162 $ hg tip -q
162 163 7:18f368958ecd
163 164
164 165 $ hg cat copy2
165 166 a
166 167 a
167 168 b
168 169 a
169 170 a
170 171
171 172 Rename and modify:
172 173
173 174 $ hg import -d "1000000 0" -mrenamemod - <<EOF
174 175 > diff --git a/copy2 b/rename2
175 176 > similarity index 80%
176 177 > rename from copy2
177 178 > rename to rename2
178 179 > index b53c148..8f81e29 100644
179 180 > --- a/copy2
180 181 > +++ b/rename2
181 182 > @@ -1,5 +1,5 @@
182 183 > a
183 184 > a
184 185 > b
185 186 > -a
186 187 > +c
187 188 > a
188 189 > EOF
189 190 applying patch from stdin
190 191
191 192 $ hg tip -q
192 193 8:c32b0d7e6f44
193 194
194 195 $ hg locate copy2
195 196 [1]
196 197 $ hg cat rename2
197 198 a
198 199 a
199 200 b
200 201 c
201 202 a
202 203
203 204 One file renamed multiple times:
204 205
205 206 $ hg import -d "1000000 0" -mmultirenames - <<EOF
206 207 > diff --git a/rename2 b/rename3
207 208 > rename from rename2
208 209 > rename to rename3
209 210 > diff --git a/rename2 b/rename3-2
210 211 > rename from rename2
211 212 > rename to rename3-2
212 213 > EOF
213 214 applying patch from stdin
214 215
215 216 $ hg tip -q
216 217 9:034a6bf95330
217 218
218 219 $ hg log -vr. --template '{rev} {files} / {file_copies}\n'
219 220 9 rename2 rename3 rename3-2 / rename3 (rename2)rename3-2 (rename2)
220 221
221 222 $ hg locate rename2 rename3 rename3-2
222 223 rename3
223 224 rename3-2
224 225
225 226 $ hg cat rename3
226 227 a
227 228 a
228 229 b
229 230 c
230 231 a
231 232
232 233 $ hg cat rename3-2
233 234 a
234 235 a
235 236 b
236 237 c
237 238 a
238 239
239 240 $ echo foo > foo
240 241 $ hg add foo
241 242 $ hg ci -m 'add foo'
242 243
243 244 Binary files and regular patch hunks:
244 245
245 246 $ hg import -d "1000000 0" -m binaryregular - <<EOF
246 247 > diff --git a/binary b/binary
247 248 > new file mode 100644
248 249 > index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4
249 250 > GIT binary patch
250 251 > literal 4
251 252 > Lc\${NkU|;|M00aO5
252 253 >
253 254 > diff --git a/foo b/foo2
254 255 > rename from foo
255 256 > rename to foo2
256 257 > EOF
257 258 applying patch from stdin
258 259
259 260 $ hg tip -q
260 261 11:c39bce63e786
261 262
262 263 $ cat foo2
263 264 foo
264 265
265 266 $ hg manifest --debug | grep binary
266 267 045c85ba38952325e126c70962cc0f9d9077bc67 644 binary
267 268
268 269 Multiple binary files:
269 270
270 271 $ hg import -d "1000000 0" -m multibinary - <<EOF
271 272 > diff --git a/mbinary1 b/mbinary1
272 273 > new file mode 100644
273 274 > index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4
274 275 > GIT binary patch
275 276 > literal 4
276 277 > Lc\${NkU|;|M00aO5
277 278 >
278 279 > diff --git a/mbinary2 b/mbinary2
279 280 > new file mode 100644
280 281 > index 0000000000000000000000000000000000000000..112363ac1917b417ffbd7f376ca786a1e5fa7490
281 282 > GIT binary patch
282 283 > literal 5
283 284 > Mc\${NkU|\`?^000jF3jhEB
284 285 >
285 286 > EOF
286 287 applying patch from stdin
287 288
288 289 $ hg tip -q
289 290 12:30b530085242
290 291
291 292 $ hg manifest --debug | grep mbinary
292 293 045c85ba38952325e126c70962cc0f9d9077bc67 644 mbinary1
293 294 a874b471193996e7cb034bb301cac7bdaf3e3f46 644 mbinary2
294 295
295 296 Filenames with spaces:
296 297
297 298 $ hg import -d "1000000 0" -m spaces - <<EOF
298 299 > diff --git a/foo bar b/foo bar
299 300 > new file mode 100644
300 301 > index 0000000..257cc56
301 302 > --- /dev/null
302 303 > +++ b/foo bar
303 304 > @@ -0,0 +1 @@
304 305 > +foo
305 306 > EOF
306 307 applying patch from stdin
307 308
308 309 $ hg tip -q
309 310 13:04750ef42fb3
310 311
311 312 $ cat "foo bar"
312 313 foo
313 314
314 315 Copy then modify the original file:
315 316
316 317 $ hg import -d "1000000 0" -m copy-mod-orig - <<EOF
317 318 > diff --git a/foo2 b/foo2
318 319 > index 257cc56..fe08ec6 100644
319 320 > --- a/foo2
320 321 > +++ b/foo2
321 322 > @@ -1 +1,2 @@
322 323 > foo
323 324 > +new line
324 325 > diff --git a/foo2 b/foo3
325 326 > similarity index 100%
326 327 > copy from foo2
327 328 > copy to foo3
328 329 > EOF
329 330 applying patch from stdin
330 331
331 332 $ hg tip -q
332 333 14:c4cd9cdeaa74
333 334
334 335 $ cat foo3
335 336 foo
336 337
@@ -1,881 +1,879 b''
1 1 @ (34) head
2 2 |
3 3 | o (33) head
4 4 | |
5 5 o | (32) expand
6 6 |\ \
7 7 | o \ (31) expand
8 8 | |\ \
9 9 | | o \ (30) expand
10 10 | | |\ \
11 11 | | | o | (29) regular commit
12 12 | | | | |
13 13 | | o | | (28) merge zero known
14 14 | | |\ \ \
15 15 o | | | | | (27) collapse
16 16 |/ / / / /
17 17 | | o---+ (26) merge one known; far right
18 18 | | | | |
19 19 +---o | | (25) merge one known; far left
20 20 | | | | |
21 21 | | o | | (24) merge one known; immediate right
22 22 | | |\| |
23 23 | | o | | (23) merge one known; immediate left
24 24 | |/| | |
25 25 +---o---+ (22) merge two known; one far left, one far right
26 26 | | / /
27 27 o | | | (21) expand
28 28 |\ \ \ \
29 29 | o---+-+ (20) merge two known; two far right
30 30 | / / /
31 31 o | | | (19) expand
32 32 |\ \ \ \
33 33 +---+---o (18) merge two known; two far left
34 34 | | | |
35 35 | o | | (17) expand
36 36 | |\ \ \
37 37 | | o---+ (16) merge two known; one immediate right, one near right
38 38 | | |/ /
39 39 o | | | (15) expand
40 40 |\ \ \ \
41 41 | o-----+ (14) merge two known; one immediate right, one far right
42 42 | |/ / /
43 43 o | | | (13) expand
44 44 |\ \ \ \
45 45 +---o | | (12) merge two known; one immediate right, one far left
46 46 | | |/ /
47 47 | o | | (11) expand
48 48 | |\ \ \
49 49 | | o---+ (10) merge two known; one immediate left, one near right
50 50 | |/ / /
51 51 o | | | (9) expand
52 52 |\ \ \ \
53 53 | o-----+ (8) merge two known; one immediate left, one far right
54 54 |/ / / /
55 55 o | | | (7) expand
56 56 |\ \ \ \
57 57 +---o | | (6) merge two known; one immediate left, one far left
58 58 | |/ / /
59 59 | o | | (5) expand
60 60 | |\ \ \
61 61 | | o | | (4) merge two known; one immediate left, one immediate right
62 62 | |/|/ /
63 63 | o / / (3) collapse
64 64 |/ / /
65 65 o / / (2) collapse
66 66 |/ /
67 67 o / (1) collapse
68 68 |/
69 69 o (0) root
70 70
71 71
72 72 $ "$TESTDIR/hghave" no-outer-repo || exit 80
73 73
74 $ set -e
75
76 74 $ commit()
77 75 > {
78 76 > rev=$1
79 77 > msg=$2
80 78 > shift 2
81 79 > if [ "$#" -gt 0 ]; then
82 80 > hg debugsetparents "$@"
83 81 > fi
84 82 > echo $rev > a
85 83 > hg commit -Aqd "$rev 0" -m "($rev) $msg"
86 84 > }
87 85
88 86 $ echo "[extensions]" >> $HGRCPATH
89 87 $ echo "graphlog=" >> $HGRCPATH
90 88
91 89 $ hg init repo
92 90 $ cd repo
93 91
94 92 Empty repo:
95 93
96 94 $ hg glog
97 95
98 96
99 97 Building DAG:
100 98
101 99 $ commit 0 "root"
102 100 $ commit 1 "collapse" 0
103 101 $ commit 2 "collapse" 1
104 102 $ commit 3 "collapse" 2
105 103 $ commit 4 "merge two known; one immediate left, one immediate right" 1 3
106 104 $ commit 5 "expand" 3 4
107 105 $ commit 6 "merge two known; one immediate left, one far left" 2 5
108 106 $ commit 7 "expand" 2 5
109 107 $ commit 8 "merge two known; one immediate left, one far right" 0 7
110 108 $ commit 9 "expand" 7 8
111 109 $ commit 10 "merge two known; one immediate left, one near right" 0 6
112 110 $ commit 11 "expand" 6 10
113 111 $ commit 12 "merge two known; one immediate right, one far left" 1 9
114 112 $ commit 13 "expand" 9 11
115 113 $ commit 14 "merge two known; one immediate right, one far right" 0 12
116 114 $ commit 15 "expand" 13 14
117 115 $ commit 16 "merge two known; one immediate right, one near right" 0 1
118 116 $ commit 17 "expand" 12 16
119 117 $ commit 18 "merge two known; two far left" 1 15
120 118 $ commit 19 "expand" 15 17
121 119 $ commit 20 "merge two known; two far right" 0 18
122 120 $ commit 21 "expand" 19 20
123 121 $ commit 22 "merge two known; one far left, one far right" 18 21
124 122 $ commit 23 "merge one known; immediate left" 1 22
125 123 $ commit 24 "merge one known; immediate right" 0 23
126 124 $ commit 25 "merge one known; far left" 21 24
127 125 $ commit 26 "merge one known; far right" 18 25
128 126 $ commit 27 "collapse" 21
129 127 $ commit 28 "merge zero known" 1 26
130 128 $ commit 29 "regular commit" 0
131 129 $ commit 30 "expand" 28 29
132 130 $ commit 31 "expand" 21 30
133 131 $ commit 32 "expand" 27 31
134 132 $ commit 33 "head" 18
135 133 $ commit 34 "head" 32
136 134
137 135
138 136 $ hg glog -q
139 137 @ 34:fea3ac5810e0
140 138 |
141 139 | o 33:68608f5145f9
142 140 | |
143 141 o | 32:d06dffa21a31
144 142 |\ \
145 143 | o \ 31:621d83e11f67
146 144 | |\ \
147 145 | | o \ 30:6e11cd4b648f
148 146 | | |\ \
149 147 | | | o | 29:cd9bb2be7593
150 148 | | | | |
151 149 | | o | | 28:44ecd0b9ae99
152 150 | | |\ \ \
153 151 o | | | | | 27:886ed638191b
154 152 |/ / / / /
155 153 | | o---+ 26:7f25b6c2f0b9
156 154 | | | | |
157 155 +---o | | 25:91da8ed57247
158 156 | | | | |
159 157 | | o | | 24:a9c19a3d96b7
160 158 | | |\| |
161 159 | | o | | 23:a01cddf0766d
162 160 | |/| | |
163 161 +---o---+ 22:e0d9cccacb5d
164 162 | | / /
165 163 o | | | 21:d42a756af44d
166 164 |\ \ \ \
167 165 | o---+-+ 20:d30ed6450e32
168 166 | / / /
169 167 o | | | 19:31ddc2c1573b
170 168 |\ \ \ \
171 169 +---+---o 18:1aa84d96232a
172 170 | | | |
173 171 | o | | 17:44765d7c06e0
174 172 | |\ \ \
175 173 | | o---+ 16:3677d192927d
176 174 | | |/ /
177 175 o | | | 15:1dda3f72782d
178 176 |\ \ \ \
179 177 | o-----+ 14:8eac370358ef
180 178 | |/ / /
181 179 o | | | 13:22d8966a97e3
182 180 |\ \ \ \
183 181 +---o | | 12:86b91144a6e9
184 182 | | |/ /
185 183 | o | | 11:832d76e6bdf2
186 184 | |\ \ \
187 185 | | o---+ 10:74c64d036d72
188 186 | |/ / /
189 187 o | | | 9:7010c0af0a35
190 188 |\ \ \ \
191 189 | o-----+ 8:7a0b11f71937
192 190 |/ / / /
193 191 o | | | 7:b632bb1b1224
194 192 |\ \ \ \
195 193 +---o | | 6:b105a072e251
196 194 | |/ / /
197 195 | o | | 5:4409d547b708
198 196 | |\ \ \
199 197 | | o | | 4:26a8bac39d9f
200 198 | |/|/ /
201 199 | o / / 3:27eef8ed80b4
202 200 |/ / /
203 201 o / / 2:3d9a33b8d1e1
204 202 |/ /
205 203 o / 1:6db2ef61d156
206 204 |/
207 205 o 0:e6eb3150255d
208 206
209 207
210 208 $ hg glog
211 209 @ changeset: 34:fea3ac5810e0
212 210 | tag: tip
213 211 | parent: 32:d06dffa21a31
214 212 | user: test
215 213 | date: Thu Jan 01 00:00:34 1970 +0000
216 214 | summary: (34) head
217 215 |
218 216 | o changeset: 33:68608f5145f9
219 217 | | parent: 18:1aa84d96232a
220 218 | | user: test
221 219 | | date: Thu Jan 01 00:00:33 1970 +0000
222 220 | | summary: (33) head
223 221 | |
224 222 o | changeset: 32:d06dffa21a31
225 223 |\ \ parent: 27:886ed638191b
226 224 | | | parent: 31:621d83e11f67
227 225 | | | user: test
228 226 | | | date: Thu Jan 01 00:00:32 1970 +0000
229 227 | | | summary: (32) expand
230 228 | | |
231 229 | o | changeset: 31:621d83e11f67
232 230 | |\ \ parent: 21:d42a756af44d
233 231 | | | | parent: 30:6e11cd4b648f
234 232 | | | | user: test
235 233 | | | | date: Thu Jan 01 00:00:31 1970 +0000
236 234 | | | | summary: (31) expand
237 235 | | | |
238 236 | | o | changeset: 30:6e11cd4b648f
239 237 | | |\ \ parent: 28:44ecd0b9ae99
240 238 | | | | | parent: 29:cd9bb2be7593
241 239 | | | | | user: test
242 240 | | | | | date: Thu Jan 01 00:00:30 1970 +0000
243 241 | | | | | summary: (30) expand
244 242 | | | | |
245 243 | | | o | changeset: 29:cd9bb2be7593
246 244 | | | | | parent: 0:e6eb3150255d
247 245 | | | | | user: test
248 246 | | | | | date: Thu Jan 01 00:00:29 1970 +0000
249 247 | | | | | summary: (29) regular commit
250 248 | | | | |
251 249 | | o | | changeset: 28:44ecd0b9ae99
252 250 | | |\ \ \ parent: 1:6db2ef61d156
253 251 | | | | | | parent: 26:7f25b6c2f0b9
254 252 | | | | | | user: test
255 253 | | | | | | date: Thu Jan 01 00:00:28 1970 +0000
256 254 | | | | | | summary: (28) merge zero known
257 255 | | | | | |
258 256 o | | | | | changeset: 27:886ed638191b
259 257 |/ / / / / parent: 21:d42a756af44d
260 258 | | | | | user: test
261 259 | | | | | date: Thu Jan 01 00:00:27 1970 +0000
262 260 | | | | | summary: (27) collapse
263 261 | | | | |
264 262 | | o---+ changeset: 26:7f25b6c2f0b9
265 263 | | | | | parent: 18:1aa84d96232a
266 264 | | | | | parent: 25:91da8ed57247
267 265 | | | | | user: test
268 266 | | | | | date: Thu Jan 01 00:00:26 1970 +0000
269 267 | | | | | summary: (26) merge one known; far right
270 268 | | | | |
271 269 +---o | | changeset: 25:91da8ed57247
272 270 | | | | | parent: 21:d42a756af44d
273 271 | | | | | parent: 24:a9c19a3d96b7
274 272 | | | | | user: test
275 273 | | | | | date: Thu Jan 01 00:00:25 1970 +0000
276 274 | | | | | summary: (25) merge one known; far left
277 275 | | | | |
278 276 | | o | | changeset: 24:a9c19a3d96b7
279 277 | | |\| | parent: 0:e6eb3150255d
280 278 | | | | | parent: 23:a01cddf0766d
281 279 | | | | | user: test
282 280 | | | | | date: Thu Jan 01 00:00:24 1970 +0000
283 281 | | | | | summary: (24) merge one known; immediate right
284 282 | | | | |
285 283 | | o | | changeset: 23:a01cddf0766d
286 284 | |/| | | parent: 1:6db2ef61d156
287 285 | | | | | parent: 22:e0d9cccacb5d
288 286 | | | | | user: test
289 287 | | | | | date: Thu Jan 01 00:00:23 1970 +0000
290 288 | | | | | summary: (23) merge one known; immediate left
291 289 | | | | |
292 290 +---o---+ changeset: 22:e0d9cccacb5d
293 291 | | | | parent: 18:1aa84d96232a
294 292 | | / / parent: 21:d42a756af44d
295 293 | | | | user: test
296 294 | | | | date: Thu Jan 01 00:00:22 1970 +0000
297 295 | | | | summary: (22) merge two known; one far left, one far right
298 296 | | | |
299 297 o | | | changeset: 21:d42a756af44d
300 298 |\ \ \ \ parent: 19:31ddc2c1573b
301 299 | | | | | parent: 20:d30ed6450e32
302 300 | | | | | user: test
303 301 | | | | | date: Thu Jan 01 00:00:21 1970 +0000
304 302 | | | | | summary: (21) expand
305 303 | | | | |
306 304 | o---+-+ changeset: 20:d30ed6450e32
307 305 | | | | parent: 0:e6eb3150255d
308 306 | / / / parent: 18:1aa84d96232a
309 307 | | | | user: test
310 308 | | | | date: Thu Jan 01 00:00:20 1970 +0000
311 309 | | | | summary: (20) merge two known; two far right
312 310 | | | |
313 311 o | | | changeset: 19:31ddc2c1573b
314 312 |\ \ \ \ parent: 15:1dda3f72782d
315 313 | | | | | parent: 17:44765d7c06e0
316 314 | | | | | user: test
317 315 | | | | | date: Thu Jan 01 00:00:19 1970 +0000
318 316 | | | | | summary: (19) expand
319 317 | | | | |
320 318 +---+---o changeset: 18:1aa84d96232a
321 319 | | | | parent: 1:6db2ef61d156
322 320 | | | | parent: 15:1dda3f72782d
323 321 | | | | user: test
324 322 | | | | date: Thu Jan 01 00:00:18 1970 +0000
325 323 | | | | summary: (18) merge two known; two far left
326 324 | | | |
327 325 | o | | changeset: 17:44765d7c06e0
328 326 | |\ \ \ parent: 12:86b91144a6e9
329 327 | | | | | parent: 16:3677d192927d
330 328 | | | | | user: test
331 329 | | | | | date: Thu Jan 01 00:00:17 1970 +0000
332 330 | | | | | summary: (17) expand
333 331 | | | | |
334 332 | | o---+ changeset: 16:3677d192927d
335 333 | | | | | parent: 0:e6eb3150255d
336 334 | | |/ / parent: 1:6db2ef61d156
337 335 | | | | user: test
338 336 | | | | date: Thu Jan 01 00:00:16 1970 +0000
339 337 | | | | summary: (16) merge two known; one immediate right, one near right
340 338 | | | |
341 339 o | | | changeset: 15:1dda3f72782d
342 340 |\ \ \ \ parent: 13:22d8966a97e3
343 341 | | | | | parent: 14:8eac370358ef
344 342 | | | | | user: test
345 343 | | | | | date: Thu Jan 01 00:00:15 1970 +0000
346 344 | | | | | summary: (15) expand
347 345 | | | | |
348 346 | o-----+ changeset: 14:8eac370358ef
349 347 | | | | | parent: 0:e6eb3150255d
350 348 | |/ / / parent: 12:86b91144a6e9
351 349 | | | | user: test
352 350 | | | | date: Thu Jan 01 00:00:14 1970 +0000
353 351 | | | | summary: (14) merge two known; one immediate right, one far right
354 352 | | | |
355 353 o | | | changeset: 13:22d8966a97e3
356 354 |\ \ \ \ parent: 9:7010c0af0a35
357 355 | | | | | parent: 11:832d76e6bdf2
358 356 | | | | | user: test
359 357 | | | | | date: Thu Jan 01 00:00:13 1970 +0000
360 358 | | | | | summary: (13) expand
361 359 | | | | |
362 360 +---o | | changeset: 12:86b91144a6e9
363 361 | | |/ / parent: 1:6db2ef61d156
364 362 | | | | parent: 9:7010c0af0a35
365 363 | | | | user: test
366 364 | | | | date: Thu Jan 01 00:00:12 1970 +0000
367 365 | | | | summary: (12) merge two known; one immediate right, one far left
368 366 | | | |
369 367 | o | | changeset: 11:832d76e6bdf2
370 368 | |\ \ \ parent: 6:b105a072e251
371 369 | | | | | parent: 10:74c64d036d72
372 370 | | | | | user: test
373 371 | | | | | date: Thu Jan 01 00:00:11 1970 +0000
374 372 | | | | | summary: (11) expand
375 373 | | | | |
376 374 | | o---+ changeset: 10:74c64d036d72
377 375 | | | | | parent: 0:e6eb3150255d
378 376 | |/ / / parent: 6:b105a072e251
379 377 | | | | user: test
380 378 | | | | date: Thu Jan 01 00:00:10 1970 +0000
381 379 | | | | summary: (10) merge two known; one immediate left, one near right
382 380 | | | |
383 381 o | | | changeset: 9:7010c0af0a35
384 382 |\ \ \ \ parent: 7:b632bb1b1224
385 383 | | | | | parent: 8:7a0b11f71937
386 384 | | | | | user: test
387 385 | | | | | date: Thu Jan 01 00:00:09 1970 +0000
388 386 | | | | | summary: (9) expand
389 387 | | | | |
390 388 | o-----+ changeset: 8:7a0b11f71937
391 389 | | | | | parent: 0:e6eb3150255d
392 390 |/ / / / parent: 7:b632bb1b1224
393 391 | | | | user: test
394 392 | | | | date: Thu Jan 01 00:00:08 1970 +0000
395 393 | | | | summary: (8) merge two known; one immediate left, one far right
396 394 | | | |
397 395 o | | | changeset: 7:b632bb1b1224
398 396 |\ \ \ \ parent: 2:3d9a33b8d1e1
399 397 | | | | | parent: 5:4409d547b708
400 398 | | | | | user: test
401 399 | | | | | date: Thu Jan 01 00:00:07 1970 +0000
402 400 | | | | | summary: (7) expand
403 401 | | | | |
404 402 +---o | | changeset: 6:b105a072e251
405 403 | |/ / / parent: 2:3d9a33b8d1e1
406 404 | | | | parent: 5:4409d547b708
407 405 | | | | user: test
408 406 | | | | date: Thu Jan 01 00:00:06 1970 +0000
409 407 | | | | summary: (6) merge two known; one immediate left, one far left
410 408 | | | |
411 409 | o | | changeset: 5:4409d547b708
412 410 | |\ \ \ parent: 3:27eef8ed80b4
413 411 | | | | | parent: 4:26a8bac39d9f
414 412 | | | | | user: test
415 413 | | | | | date: Thu Jan 01 00:00:05 1970 +0000
416 414 | | | | | summary: (5) expand
417 415 | | | | |
418 416 | | o | | changeset: 4:26a8bac39d9f
419 417 | |/|/ / parent: 1:6db2ef61d156
420 418 | | | | parent: 3:27eef8ed80b4
421 419 | | | | user: test
422 420 | | | | date: Thu Jan 01 00:00:04 1970 +0000
423 421 | | | | summary: (4) merge two known; one immediate left, one immediate right
424 422 | | | |
425 423 | o | | changeset: 3:27eef8ed80b4
426 424 |/ / / user: test
427 425 | | | date: Thu Jan 01 00:00:03 1970 +0000
428 426 | | | summary: (3) collapse
429 427 | | |
430 428 o | | changeset: 2:3d9a33b8d1e1
431 429 |/ / user: test
432 430 | | date: Thu Jan 01 00:00:02 1970 +0000
433 431 | | summary: (2) collapse
434 432 | |
435 433 o | changeset: 1:6db2ef61d156
436 434 |/ user: test
437 435 | date: Thu Jan 01 00:00:01 1970 +0000
438 436 | summary: (1) collapse
439 437 |
440 438 o changeset: 0:e6eb3150255d
441 439 user: test
442 440 date: Thu Jan 01 00:00:00 1970 +0000
443 441 summary: (0) root
444 442
445 443
446 444 File glog:
447 445 $ hg glog a
448 446 @ changeset: 34:fea3ac5810e0
449 447 | tag: tip
450 448 | parent: 32:d06dffa21a31
451 449 | user: test
452 450 | date: Thu Jan 01 00:00:34 1970 +0000
453 451 | summary: (34) head
454 452 |
455 453 | o changeset: 33:68608f5145f9
456 454 | | parent: 18:1aa84d96232a
457 455 | | user: test
458 456 | | date: Thu Jan 01 00:00:33 1970 +0000
459 457 | | summary: (33) head
460 458 | |
461 459 o | changeset: 32:d06dffa21a31
462 460 |\ \ parent: 27:886ed638191b
463 461 | | | parent: 31:621d83e11f67
464 462 | | | user: test
465 463 | | | date: Thu Jan 01 00:00:32 1970 +0000
466 464 | | | summary: (32) expand
467 465 | | |
468 466 | o | changeset: 31:621d83e11f67
469 467 | | | parent: 21:d42a756af44d
470 468 | | | parent: 30:6e11cd4b648f
471 469 | | | user: test
472 470 | | | date: Thu Jan 01 00:00:31 1970 +0000
473 471 | | | summary: (31) expand
474 472 | | |
475 473 | o | changeset: 30:6e11cd4b648f
476 474 | |\ \ parent: 28:44ecd0b9ae99
477 475 | | | | parent: 29:cd9bb2be7593
478 476 | | | | user: test
479 477 | | | | date: Thu Jan 01 00:00:30 1970 +0000
480 478 | | | | summary: (30) expand
481 479 | | | |
482 480 | | o | changeset: 29:cd9bb2be7593
483 481 | | | | parent: 0:e6eb3150255d
484 482 | | | | user: test
485 483 | | | | date: Thu Jan 01 00:00:29 1970 +0000
486 484 | | | | summary: (29) regular commit
487 485 | | | |
488 486 | o | | changeset: 28:44ecd0b9ae99
489 487 | | | | parent: 1:6db2ef61d156
490 488 | | | | parent: 26:7f25b6c2f0b9
491 489 | | | | user: test
492 490 | | | | date: Thu Jan 01 00:00:28 1970 +0000
493 491 | | | | summary: (28) merge zero known
494 492 | | | |
495 493 o | | | changeset: 27:886ed638191b
496 494 | | | | parent: 21:d42a756af44d
497 495 | | | | user: test
498 496 | | | | date: Thu Jan 01 00:00:27 1970 +0000
499 497 | | | | summary: (27) collapse
500 498 | | | |
501 499 | o | | changeset: 26:7f25b6c2f0b9
502 500 | | | | parent: 18:1aa84d96232a
503 501 | | | | parent: 25:91da8ed57247
504 502 | | | | user: test
505 503 | | | | date: Thu Jan 01 00:00:26 1970 +0000
506 504 | | | | summary: (26) merge one known; far right
507 505 | | | |
508 506 | o | | changeset: 25:91da8ed57247
509 507 | | | | parent: 21:d42a756af44d
510 508 | | | | parent: 24:a9c19a3d96b7
511 509 | | | | user: test
512 510 | | | | date: Thu Jan 01 00:00:25 1970 +0000
513 511 | | | | summary: (25) merge one known; far left
514 512 | | | |
515 513 | o | | changeset: 24:a9c19a3d96b7
516 514 | | | | parent: 0:e6eb3150255d
517 515 | | | | parent: 23:a01cddf0766d
518 516 | | | | user: test
519 517 | | | | date: Thu Jan 01 00:00:24 1970 +0000
520 518 | | | | summary: (24) merge one known; immediate right
521 519 | | | |
522 520 | o | | changeset: 23:a01cddf0766d
523 521 | | | | parent: 1:6db2ef61d156
524 522 | | | | parent: 22:e0d9cccacb5d
525 523 | | | | user: test
526 524 | | | | date: Thu Jan 01 00:00:23 1970 +0000
527 525 | | | | summary: (23) merge one known; immediate left
528 526 | | | |
529 527 | o | | changeset: 22:e0d9cccacb5d
530 528 |/ / / parent: 18:1aa84d96232a
531 529 | | | parent: 21:d42a756af44d
532 530 | | | user: test
533 531 | | | date: Thu Jan 01 00:00:22 1970 +0000
534 532 | | | summary: (22) merge two known; one far left, one far right
535 533 | | |
536 534 o | | changeset: 21:d42a756af44d
537 535 |\ \ \ parent: 19:31ddc2c1573b
538 536 | | | | parent: 20:d30ed6450e32
539 537 | | | | user: test
540 538 | | | | date: Thu Jan 01 00:00:21 1970 +0000
541 539 | | | | summary: (21) expand
542 540 | | | |
543 541 | o---+ changeset: 20:d30ed6450e32
544 542 | | | parent: 0:e6eb3150255d
545 543 | / / parent: 18:1aa84d96232a
546 544 | | | user: test
547 545 | | | date: Thu Jan 01 00:00:20 1970 +0000
548 546 | | | summary: (20) merge two known; two far right
549 547 | | |
550 548 o | | changeset: 19:31ddc2c1573b
551 549 |\ \ \ parent: 15:1dda3f72782d
552 550 | | | | parent: 17:44765d7c06e0
553 551 | | | | user: test
554 552 | | | | date: Thu Jan 01 00:00:19 1970 +0000
555 553 | | | | summary: (19) expand
556 554 | | | |
557 555 +-----o changeset: 18:1aa84d96232a
558 556 | | | parent: 1:6db2ef61d156
559 557 | | | parent: 15:1dda3f72782d
560 558 | | | user: test
561 559 | | | date: Thu Jan 01 00:00:18 1970 +0000
562 560 | | | summary: (18) merge two known; two far left
563 561 | | |
564 562 | o | changeset: 17:44765d7c06e0
565 563 | |\ \ parent: 12:86b91144a6e9
566 564 | | | | parent: 16:3677d192927d
567 565 | | | | user: test
568 566 | | | | date: Thu Jan 01 00:00:17 1970 +0000
569 567 | | | | summary: (17) expand
570 568 | | | |
571 569 | | o | changeset: 16:3677d192927d
572 570 | | | | parent: 0:e6eb3150255d
573 571 | | | | parent: 1:6db2ef61d156
574 572 | | | | user: test
575 573 | | | | date: Thu Jan 01 00:00:16 1970 +0000
576 574 | | | | summary: (16) merge two known; one immediate right, one near right
577 575 | | | |
578 576 o | | | changeset: 15:1dda3f72782d
579 577 |\ \ \ \ parent: 13:22d8966a97e3
580 578 | | | | | parent: 14:8eac370358ef
581 579 | | | | | user: test
582 580 | | | | | date: Thu Jan 01 00:00:15 1970 +0000
583 581 | | | | | summary: (15) expand
584 582 | | | | |
585 583 | o | | | changeset: 14:8eac370358ef
586 584 | |/ / / parent: 0:e6eb3150255d
587 585 | | | | parent: 12:86b91144a6e9
588 586 | | | | user: test
589 587 | | | | date: Thu Jan 01 00:00:14 1970 +0000
590 588 | | | | summary: (14) merge two known; one immediate right, one far right
591 589 | | | |
592 590 o | | | changeset: 13:22d8966a97e3
593 591 |\ \ \ \ parent: 9:7010c0af0a35
594 592 | | | | | parent: 11:832d76e6bdf2
595 593 | | | | | user: test
596 594 | | | | | date: Thu Jan 01 00:00:13 1970 +0000
597 595 | | | | | summary: (13) expand
598 596 | | | | |
599 597 +---o | | changeset: 12:86b91144a6e9
600 598 | | / / parent: 1:6db2ef61d156
601 599 | | | | parent: 9:7010c0af0a35
602 600 | | | | user: test
603 601 | | | | date: Thu Jan 01 00:00:12 1970 +0000
604 602 | | | | summary: (12) merge two known; one immediate right, one far left
605 603 | | | |
606 604 | o | | changeset: 11:832d76e6bdf2
607 605 | | | | parent: 6:b105a072e251
608 606 | | | | parent: 10:74c64d036d72
609 607 | | | | user: test
610 608 | | | | date: Thu Jan 01 00:00:11 1970 +0000
611 609 | | | | summary: (11) expand
612 610 | | | |
613 611 | o | | changeset: 10:74c64d036d72
614 612 | | | | parent: 0:e6eb3150255d
615 613 | | | | parent: 6:b105a072e251
616 614 | | | | user: test
617 615 | | | | date: Thu Jan 01 00:00:10 1970 +0000
618 616 | | | | summary: (10) merge two known; one immediate left, one near right
619 617 | | | |
620 618 o | | | changeset: 9:7010c0af0a35
621 619 | | | | parent: 7:b632bb1b1224
622 620 | | | | parent: 8:7a0b11f71937
623 621 | | | | user: test
624 622 | | | | date: Thu Jan 01 00:00:09 1970 +0000
625 623 | | | | summary: (9) expand
626 624 | | | |
627 625 o | | | changeset: 8:7a0b11f71937
628 626 | | | | parent: 0:e6eb3150255d
629 627 | | | | parent: 7:b632bb1b1224
630 628 | | | | user: test
631 629 | | | | date: Thu Jan 01 00:00:08 1970 +0000
632 630 | | | | summary: (8) merge two known; one immediate left, one far right
633 631 | | | |
634 632 o | | | changeset: 7:b632bb1b1224
635 633 | | | | parent: 2:3d9a33b8d1e1
636 634 | | | | parent: 5:4409d547b708
637 635 | | | | user: test
638 636 | | | | date: Thu Jan 01 00:00:07 1970 +0000
639 637 | | | | summary: (7) expand
640 638 | | | |
641 639 | o | | changeset: 6:b105a072e251
642 640 |/ / / parent: 2:3d9a33b8d1e1
643 641 | | | parent: 5:4409d547b708
644 642 | | | user: test
645 643 | | | date: Thu Jan 01 00:00:06 1970 +0000
646 644 | | | summary: (6) merge two known; one immediate left, one far left
647 645 | | |
648 646 o | | changeset: 5:4409d547b708
649 647 | | | parent: 3:27eef8ed80b4
650 648 | | | parent: 4:26a8bac39d9f
651 649 | | | user: test
652 650 | | | date: Thu Jan 01 00:00:05 1970 +0000
653 651 | | | summary: (5) expand
654 652 | | |
655 653 o | | changeset: 4:26a8bac39d9f
656 654 | | | parent: 1:6db2ef61d156
657 655 | | | parent: 3:27eef8ed80b4
658 656 | | | user: test
659 657 | | | date: Thu Jan 01 00:00:04 1970 +0000
660 658 | | | summary: (4) merge two known; one immediate left, one immediate right
661 659 | | |
662 660 o | | changeset: 3:27eef8ed80b4
663 661 | | | user: test
664 662 | | | date: Thu Jan 01 00:00:03 1970 +0000
665 663 | | | summary: (3) collapse
666 664 | | |
667 665 o | | changeset: 2:3d9a33b8d1e1
668 666 |/ / user: test
669 667 | | date: Thu Jan 01 00:00:02 1970 +0000
670 668 | | summary: (2) collapse
671 669 | |
672 670 o | changeset: 1:6db2ef61d156
673 671 |/ user: test
674 672 | date: Thu Jan 01 00:00:01 1970 +0000
675 673 | summary: (1) collapse
676 674 |
677 675 o changeset: 0:e6eb3150255d
678 676 user: test
679 677 date: Thu Jan 01 00:00:00 1970 +0000
680 678 summary: (0) root
681 679
682 680
683 681 Unused arguments:
684 $ hg glog -q foo bar || echo failed
682 $ hg glog -q foo bar
685 683 hg glog: invalid arguments
686 684 hg glog [OPTION]... [FILE]
687 685
688 686 show revision history alongside an ASCII revision graph
689 failed
687 [255]
690 688
691 689 Empty revision range - display nothing:
692 690 $ hg glog -r 1..0
693 691
694 692 From outer space:
695 693 $ cd ..
696 694 $ hg glog -l1 repo
697 695 @ changeset: 34:fea3ac5810e0
698 696 | tag: tip
699 697 | parent: 32:d06dffa21a31
700 698 | user: test
701 699 | date: Thu Jan 01 00:00:34 1970 +0000
702 700 | summary: (34) head
703 701 |
704 702 $ hg glog -l1 repo/a
705 703 @ changeset: 34:fea3ac5810e0
706 704 | tag: tip
707 705 | parent: 32:d06dffa21a31
708 706 | user: test
709 707 | date: Thu Jan 01 00:00:34 1970 +0000
710 708 | summary: (34) head
711 709 |
712 710 $ hg glog -l1 repo/missing
713 711
714 712 File log with revs != cset revs:
715 713 $ hg init flog
716 714 $ cd flog
717 715 $ echo one >one
718 716 $ hg add one
719 717 $ hg commit -mone
720 718 $ echo two >two
721 719 $ hg add two
722 720 $ hg commit -mtwo
723 721 $ echo more >two
724 722 $ hg commit -mmore
725 723 $ hg glog two
726 724 @ changeset: 2:12c28321755b
727 725 | tag: tip
728 726 | user: test
729 727 | date: Thu Jan 01 00:00:00 1970 +0000
730 728 | summary: more
731 729 |
732 730 o changeset: 1:5ac72c0599bf
733 731 user: test
734 732 date: Thu Jan 01 00:00:00 1970 +0000
735 733 summary: two
736 734
737 735
738 736 File log with explicit style (issue 1896):
739 737 $ hg glog --style=default one
740 738 o changeset: 0:3d578b4a1f53
741 739 user: test
742 740 date: Thu Jan 01 00:00:00 1970 +0000
743 741 summary: one
744 742
745 743 $ cd ..
746 744
747 745 Incoming and outgoing:
748 746
749 747 $ hg clone -U -r31 repo repo2
750 748 requesting all changes
751 749 adding changesets
752 750 adding manifests
753 751 adding file changes
754 752 added 31 changesets with 31 changes to 1 files
755 753 $ cd repo2
756 754
757 755 $ hg incoming --graph ../repo
758 756 comparing with ../repo
759 757 searching for changes
760 758 o changeset: 34:fea3ac5810e0
761 759 | tag: tip
762 760 | parent: 32:d06dffa21a31
763 761 | user: test
764 762 | date: Thu Jan 01 00:00:34 1970 +0000
765 763 | summary: (34) head
766 764 |
767 765 | o changeset: 33:68608f5145f9
768 766 | parent: 18:1aa84d96232a
769 767 | user: test
770 768 | date: Thu Jan 01 00:00:33 1970 +0000
771 769 | summary: (33) head
772 770 |
773 771 o changeset: 32:d06dffa21a31
774 772 | parent: 27:886ed638191b
775 773 | parent: 31:621d83e11f67
776 774 | user: test
777 775 | date: Thu Jan 01 00:00:32 1970 +0000
778 776 | summary: (32) expand
779 777 |
780 778 o changeset: 27:886ed638191b
781 779 parent: 21:d42a756af44d
782 780 user: test
783 781 date: Thu Jan 01 00:00:27 1970 +0000
784 782 summary: (27) collapse
785 783
786 784 $ cd ..
787 785
788 786 $ hg -R repo outgoing --graph repo2
789 787 comparing with repo2
790 788 searching for changes
791 789 @ changeset: 34:fea3ac5810e0
792 790 | tag: tip
793 791 | parent: 32:d06dffa21a31
794 792 | user: test
795 793 | date: Thu Jan 01 00:00:34 1970 +0000
796 794 | summary: (34) head
797 795 |
798 796 | o changeset: 33:68608f5145f9
799 797 | parent: 18:1aa84d96232a
800 798 | user: test
801 799 | date: Thu Jan 01 00:00:33 1970 +0000
802 800 | summary: (33) head
803 801 |
804 802 o changeset: 32:d06dffa21a31
805 803 | parent: 27:886ed638191b
806 804 | parent: 31:621d83e11f67
807 805 | user: test
808 806 | date: Thu Jan 01 00:00:32 1970 +0000
809 807 | summary: (32) expand
810 808 |
811 809 o changeset: 27:886ed638191b
812 810 parent: 21:d42a756af44d
813 811 user: test
814 812 date: Thu Jan 01 00:00:27 1970 +0000
815 813 summary: (27) collapse
816 814
817 815
818 816 File + limit with revs != cset revs:
819 817 $ cd repo
820 818 $ touch b
821 819 $ hg ci -Aqm0
822 820 $ hg glog -l2 a
823 821 o changeset: 34:fea3ac5810e0
824 822 | parent: 32:d06dffa21a31
825 823 | user: test
826 824 | date: Thu Jan 01 00:00:34 1970 +0000
827 825 | summary: (34) head
828 826 |
829 827 | o changeset: 33:68608f5145f9
830 828 | | parent: 18:1aa84d96232a
831 829 | | user: test
832 830 | | date: Thu Jan 01 00:00:33 1970 +0000
833 831 | | summary: (33) head
834 832 | |
835 833
836 834 File + limit + -ra:b, (b - a) < limit:
837 835 $ hg glog -l3000 -r32:tip a
838 836 o changeset: 34:fea3ac5810e0
839 837 | parent: 32:d06dffa21a31
840 838 | user: test
841 839 | date: Thu Jan 01 00:00:34 1970 +0000
842 840 | summary: (34) head
843 841 |
844 842 | o changeset: 33:68608f5145f9
845 843 | | parent: 18:1aa84d96232a
846 844 | | user: test
847 845 | | date: Thu Jan 01 00:00:33 1970 +0000
848 846 | | summary: (33) head
849 847 | |
850 848 o | changeset: 32:d06dffa21a31
851 849 |\ \ parent: 27:886ed638191b
852 850 | | | parent: 31:621d83e11f67
853 851 | | | user: test
854 852 | | | date: Thu Jan 01 00:00:32 1970 +0000
855 853 | | | summary: (32) expand
856 854 | | |
857 855
858 856 File + limit + -ra:b, b < tip:
859 857 $ hg glog -l1 -r32:34 a
860 858 o changeset: 34:fea3ac5810e0
861 859 | parent: 32:d06dffa21a31
862 860 | user: test
863 861 | date: Thu Jan 01 00:00:34 1970 +0000
864 862 | summary: (34) head
865 863 |
866 864
867 865 File + limit + -ra:b, b < tip, (b - a) < limit:
868 866 $ hg glog -l10 -r33:34 a
869 867 o changeset: 34:fea3ac5810e0
870 868 | parent: 32:d06dffa21a31
871 869 | user: test
872 870 | date: Thu Jan 01 00:00:34 1970 +0000
873 871 | summary: (34) head
874 872 |
875 873 | o changeset: 33:68608f5145f9
876 874 | | parent: 18:1aa84d96232a
877 875 | | user: test
878 876 | | date: Thu Jan 01 00:00:33 1970 +0000
879 877 | | summary: (33) head
880 878 | |
881 879
@@ -1,122 +1,121 b''
1 1 $ mkdir t
2 2 $ cd t
3 3 $ hg init
4 4 $ echo 0 > a
5 5 $ echo 0 > b
6 6 $ echo 0 > t.h
7 7 $ mkdir t
8 8 $ echo 0 > t/x
9 9 $ echo 0 > t/b
10 10 $ echo 0 > t/e.h
11 11 $ mkdir dir.h
12 12 $ echo 0 > dir.h/foo
13 13
14 14 $ hg ci -A -m m
15 15 adding a
16 16 adding b
17 17 adding dir.h/foo
18 18 adding t.h
19 19 adding t/b
20 20 adding t/e.h
21 21 adding t/x
22 22
23 23 $ touch nottracked
24 24
25 $ hg locate a && echo locate succeeded || echo locate failed
25 $ hg locate a
26 26 a
27 locate succeeded
28 27
29 $ hg locate NONEXISTENT && echo locate succeeded || echo locate failed
30 locate failed
28 $ hg locate NONEXISTENT
29 [1]
31 30
32 31 $ hg locate
33 32 a
34 33 b
35 34 dir.h/foo
36 35 t.h
37 36 t/b
38 37 t/e.h
39 38 t/x
40 39
41 40 $ hg rm a
42 41 $ hg ci -m m
43 42
44 43 $ hg locate a
45 44 [1]
46 45 $ hg locate NONEXISTENT
47 46 [1]
48 47 $ hg locate relpath:NONEXISTENT
49 48 [1]
50 49 $ hg locate
51 50 b
52 51 dir.h/foo
53 52 t.h
54 53 t/b
55 54 t/e.h
56 55 t/x
57 56 $ hg locate -r 0 a
58 57 a
59 58 $ hg locate -r 0 NONEXISTENT
60 59 [1]
61 60 $ hg locate -r 0 relpath:NONEXISTENT
62 61 [1]
63 62 $ hg locate -r 0
64 63 a
65 64 b
66 65 dir.h/foo
67 66 t.h
68 67 t/b
69 68 t/e.h
70 69 t/x
71 70
72 71 -I/-X with relative path should work:
73 72
74 73 $ cd t
75 74 $ hg locate
76 75 b
77 76 dir.h/foo
78 77 t.h
79 78 t/b
80 79 t/e.h
81 80 t/x
82 81 $ hg locate -I ../t
83 82 t/b
84 83 t/e.h
85 84 t/x
86 85
87 86 Test issue294:
88 87
89 88 $ cd ..
90 89 $ rm -r t
91 90
92 91 $ hg locate 't/**'
93 92 t/b
94 93 t/e.h
95 94 t/x
96 95
97 96 $ mkdir otherdir
98 97 $ cd otherdir
99 98
100 99 $ hg locate b
101 100 ../b
102 101 ../t/b
103 102 $ hg locate '*.h'
104 103 ../t.h
105 104 ../t/e.h
106 105 $ hg locate path:t/x
107 106 ../t/x
108 107 $ hg locate 're:.*\.h$'
109 108 ../t.h
110 109 ../t/e.h
111 110 $ hg locate -r 0 b
112 111 ../b
113 112 ../t/b
114 113 $ hg locate -r 0 '*.h'
115 114 ../t.h
116 115 ../t/e.h
117 116 $ hg locate -r 0 path:t/x
118 117 ../t/x
119 118 $ hg locate -r 0 're:.*\.h$'
120 119 ../t.h
121 120 ../t/e.h
122 121
@@ -1,143 +1,142 b''
1 1 Test for
2 2 b5605d88dc27: Make ui.prompt repeat on "unrecognized response" again
3 3 (issue897)
4 4
5 5 840e2b315c1f: Fix misleading error and prompts during update/merge
6 6 (issue556)
7 7
8 8 $ status() {
9 > [ $? -ne 0 ] && echo "failed."
10 9 > echo "--- status ---"
11 10 > hg st -A file1 file2
12 11 > for file in file1 file2; do
13 12 > if [ -f $file ]; then
14 13 > echo "--- $file ---"
15 14 > cat $file
16 15 > else
17 16 > echo "*** $file does not exist"
18 17 > fi
19 18 > done
20 19 > }
21 20
22 21 $ hg init
23 22
24 23 $ echo 1 > file1
25 24 $ echo 2 > file2
26 25 $ hg ci -Am 'added file1 and file2'
27 26 adding file1
28 27 adding file2
29 28
30 29 $ hg rm file1
31 30 $ echo changed >> file2
32 31 $ hg ci -m 'removed file1, changed file2'
33 32
34 33 $ hg co 0
35 34 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
36 35
37 36 $ echo changed >> file1
38 37 $ hg rm file2
39 38 $ hg ci -m 'changed file1, removed file2'
40 39 created new head
41 40
42 41
43 42 Non-interactive merge:
44 43
45 $ hg merge -y || echo "failed"
44 $ hg merge -y
46 45 local changed file1 which remote deleted
47 46 use (c)hanged version or (d)elete? c
48 47 remote changed file2 which local deleted
49 48 use (c)hanged version or leave (d)eleted? c
50 49 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
51 50 (branch merge, don't forget to commit)
52 51
53 52 $ status
54 53 --- status ---
55 54 M file2
56 55 C file1
57 56 --- file1 ---
58 57 1
59 58 changed
60 59 --- file2 ---
61 60 2
62 61 changed
63 62
64 63
65 64 Interactive merge:
66 65
67 66 $ hg co -C
68 67 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
69 68
70 $ hg merge --config ui.interactive=true <<EOF || echo "failed"
69 $ hg merge --config ui.interactive=true <<EOF
71 70 > c
72 71 > d
73 72 > EOF
74 73 local changed file1 which remote deleted
75 74 use (c)hanged version or (d)elete? remote changed file2 which local deleted
76 75 use (c)hanged version or leave (d)eleted? 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
77 76 (branch merge, don't forget to commit)
78 77
79 78 $ status
80 79 --- status ---
81 80 file2: No such file or directory
82 81 C file1
83 82 --- file1 ---
84 83 1
85 84 changed
86 85 *** file2 does not exist
87 86
88 87
89 88 Interactive merge with bad input:
90 89
91 90 $ hg co -C
92 91 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
93 92
94 $ hg merge --config ui.interactive=true <<EOF || echo "failed"
93 $ hg merge --config ui.interactive=true <<EOF
95 94 > foo
96 95 > bar
97 96 > d
98 97 > baz
99 98 > c
100 99 > EOF
101 100 local changed file1 which remote deleted
102 101 use (c)hanged version or (d)elete? unrecognized response
103 102 local changed file1 which remote deleted
104 103 use (c)hanged version or (d)elete? unrecognized response
105 104 local changed file1 which remote deleted
106 105 use (c)hanged version or (d)elete? remote changed file2 which local deleted
107 106 use (c)hanged version or leave (d)eleted? unrecognized response
108 107 remote changed file2 which local deleted
109 108 use (c)hanged version or leave (d)eleted? 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
110 109 (branch merge, don't forget to commit)
111 110
112 111 $ status
113 112 --- status ---
114 113 M file2
115 114 R file1
116 115 *** file1 does not exist
117 116 --- file2 ---
118 117 2
119 118 changed
120 119
121 120
122 121 Interactive merge with not enough input:
123 122
124 123 $ hg co -C
125 124 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
126 125
127 $ hg merge --config ui.interactive=true <<EOF || echo "failed"
126 $ hg merge --config ui.interactive=true <<EOF
128 127 > d
129 128 > EOF
130 129 local changed file1 which remote deleted
131 130 use (c)hanged version or (d)elete? remote changed file2 which local deleted
132 131 use (c)hanged version or leave (d)eleted? abort: response expected
133 failed
132 [255]
134 133
135 134 $ status
136 135 --- status ---
137 136 file2: No such file or directory
138 137 C file1
139 138 --- file1 ---
140 139 1
141 140 changed
142 141 *** file2 does not exist
143 142
@@ -1,1390 +1,1368 b''
1 1 $ checkundo()
2 2 > {
3 3 > if [ -f .hg/store/undo ]; then
4 4 > echo ".hg/store/undo still exists after $1"
5 5 > fi
6 6 > }
7 7
8 8 $ echo "[extensions]" >> $HGRCPATH
9 9 $ echo "mq=" >> $HGRCPATH
10 10
11 11 $ echo "[mq]" >> $HGRCPATH
12 12 $ echo "plain=true" >> $HGRCPATH
13 13
14 14
15 15 help
16 16
17 17 $ hg help mq
18 18 mq extension - manage a stack of patches
19 19
20 20 This extension lets you work with a stack of patches in a Mercurial
21 21 repository. It manages two stacks of patches - all known patches, and applied
22 22 patches (subset of known patches).
23 23
24 24 Known patches are represented as patch files in the .hg/patches directory.
25 25 Applied patches are both patch files and changesets.
26 26
27 27 Common tasks (use "hg help command" for more details):
28 28
29 29 create new patch qnew
30 30 import existing patch qimport
31 31
32 32 print patch series qseries
33 33 print applied patches qapplied
34 34
35 35 add known patch to applied stack qpush
36 36 remove patch from applied stack qpop
37 37 refresh contents of top applied patch qrefresh
38 38
39 39 By default, mq will automatically use git patches when required to avoid
40 40 losing file mode changes, copy records, binary files or empty files creations
41 41 or deletions. This behaviour can be configured with:
42 42
43 43 [mq]
44 44 git = auto/keep/yes/no
45 45
46 46 If set to 'keep', mq will obey the [diff] section configuration while
47 47 preserving existing git patches upon qrefresh. If set to 'yes' or 'no', mq
48 48 will override the [diff] section and always generate git or regular patches,
49 49 possibly losing data in the second case.
50 50
51 51 You will by default be managing a patch queue named "patches". You can create
52 52 other, independent patch queues with the "hg qqueue" command.
53 53
54 54 list of commands:
55 55
56 56 qapplied print the patches already applied
57 57 qclone clone main and patch repository at same time
58 58 qdelete remove patches from queue
59 59 qdiff diff of the current patch and subsequent modifications
60 60 qfinish move applied patches into repository history
61 61 qfold fold the named patches into the current patch
62 62 qgoto push or pop patches until named patch is at top of stack
63 63 qguard set or print guards for a patch
64 64 qheader print the header of the topmost or specified patch
65 65 qimport import a patch
66 66 qnew create a new patch
67 67 qnext print the name of the next patch
68 68 qpop pop the current patch off the stack
69 69 qprev print the name of the previous patch
70 70 qpush push the next patch onto the stack
71 71 qqueue manage multiple patch queues
72 72 qrefresh update the current patch
73 73 qrename rename a patch
74 74 qselect set or print guarded patches to push
75 75 qseries print the entire series file
76 76 qtop print the name of the current patch
77 77 qunapplied print the patches not yet applied
78 78 strip strip changesets and all their descendants from the repository
79 79
80 80 use "hg -v help mq" to show aliases and global options
81 81
82 82 $ hg init a
83 83 $ cd a
84 84 $ echo a > a
85 85 $ hg ci -Ama
86 86 adding a
87 87
88 88 $ hg clone . ../k
89 89 updating to branch default
90 90 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
91 91
92 92 $ mkdir b
93 93 $ echo z > b/z
94 94 $ hg ci -Ama
95 95 adding b/z
96 96
97 97
98 98 qinit
99 99
100 100 $ hg qinit
101 101
102 102 $ cd ..
103 103 $ hg init b
104 104
105 105
106 106 -R qinit
107 107
108 108 $ hg -R b qinit
109 109
110 110 $ hg init c
111 111
112 112
113 113 qinit -c
114 114
115 115 $ hg --cwd c qinit -c
116 116 $ hg -R c/.hg/patches st
117 117 A .hgignore
118 118 A series
119 119
120 120
121 121 qinit; qinit -c
122 122
123 123 $ hg init d
124 124 $ cd d
125 125 $ hg qinit
126 126 $ hg qinit -c
127 127
128 128 qinit -c should create both files if they don't exist
129 129
130 130 $ cat .hg/patches/.hgignore
131 131 ^\.hg
132 132 ^\.mq
133 133 syntax: glob
134 134 status
135 135 guards
136 136 $ cat .hg/patches/series
137 137 $ hg qinit -c
138 138 abort: repository .* already exists!
139 139 [255]
140 140 $ cd ..
141 141
142 142 $ echo '% qinit; <stuff>; qinit -c'
143 143 % qinit; <stuff>; qinit -c
144 144 $ hg init e
145 145 $ cd e
146 146 $ hg qnew A
147 147 $ checkundo qnew
148 148 $ echo foo > foo
149 149 $ hg add foo
150 150 $ hg qrefresh
151 151 $ hg qnew B
152 152 $ echo >> foo
153 153 $ hg qrefresh
154 154 $ echo status >> .hg/patches/.hgignore
155 155 $ echo bleh >> .hg/patches/.hgignore
156 156 $ hg qinit -c
157 157 adding .hg/patches/A
158 158 adding .hg/patches/B
159 159 $ hg -R .hg/patches status
160 160 A .hgignore
161 161 A A
162 162 A B
163 163 A series
164 164
165 165 qinit -c shouldn't touch these files if they already exist
166 166
167 167 $ cat .hg/patches/.hgignore
168 168 status
169 169 bleh
170 170 $ cat .hg/patches/series
171 171 A
172 172 B
173 173
174 174 add an untracked file
175 175
176 176 $ echo >> .hg/patches/flaf
177 177
178 178 status --mq with color (issue2096)
179 179
180 180 $ hg status --mq --config extensions.color= --color=always
181 181 A .hgignore
182 182 A A
183 183 A B
184 184 A series
185 185 ? flaf
186 186
187 187 try the --mq option on a command provided by an extension
188 188
189 189 $ hg purge --mq --verbose --config extensions.purge=
190 190 Removing file flaf
191 191
192 192 $ cd ..
193 193
194 194 init --mq without repo
195 195
196 196 $ mkdir f
197 197 $ cd f
198 198 $ hg init --mq
199 199 abort: there is no Mercurial repository here (.hg not found)
200 200 [255]
201 201 $ cd ..
202 202
203 203 init --mq with repo path
204 204
205 205 $ hg init g
206 206 $ hg init --mq g
207 $ test -d g/.hg/patches/.hg && echo "ok" || echo "failed"
208 ok
207 $ test -d g/.hg/patches/.hg
209 208
210 209 init --mq with nonexistent directory
211 210
212 211 $ hg init --mq nonexistentdir
213 212 abort: repository nonexistentdir not found!
214 213 [255]
215 214
216 215
217 216 init --mq with bundle (non "local")
218 217
219 218 $ hg -R a bundle --all a.bundle >/dev/null
220 219 $ hg init --mq a.bundle
221 220 abort: only a local queue repository may be initialized
222 221 [255]
223 222
224 223 $ cd a
225 224
226 225 $ hg qnew -m 'foo bar' test.patch
227 226
228 227 $ echo '# comment' > .hg/patches/series.tmp
229 228 $ echo >> .hg/patches/series.tmp # empty line
230 229 $ cat .hg/patches/series >> .hg/patches/series.tmp
231 230 $ mv .hg/patches/series.tmp .hg/patches/series
232 231
233 232
234 233 qrefresh
235 234
236 235 $ echo a >> a
237 236 $ hg qrefresh
238 237 $ cat .hg/patches/test.patch
239 238 foo bar
240 239
241 240 diff -r [a-f0-9]* a
242 241 --- a/a\t(?P<date>.*)
243 242 \+\+\+ b/a\t(?P<date2>.*)
244 243 @@ -1,1 +1,2 @@
245 244 a
246 245 +a
247 246
248 247 empty qrefresh
249 248
250 249 $ hg qrefresh -X a
251 250
252 251 revision:
253 252
254 253 $ hg diff -r -2 -r -1
255 254
256 255 patch:
257 256
258 257 $ cat .hg/patches/test.patch
259 258 foo bar
260 259
261 260
262 261 working dir diff:
263 262
264 263 $ hg diff --nodates -q
265 264 --- a/a
266 265 +++ b/a
267 266 @@ -1,1 +1,2 @@
268 267 a
269 268 +a
270 269
271 270 restore things
272 271
273 272 $ hg qrefresh
274 273 $ checkundo qrefresh
275 274
276 275
277 276 qpop
278 277
279 278 $ hg qpop
280 279 popping test.patch
281 280 patch queue now empty
282 281 $ checkundo qpop
283 282
284 283
285 284 qpush with dump of tag cache
286 285 Dump the tag cache to ensure that it has exactly one head after qpush.
287 286
288 287 $ rm -f .hg/tags.cache
289 288 $ hg tags > /dev/null
290 289
291 290 .hg/tags.cache (pre qpush):
292 291
293 292 $ cat .hg/tags.cache
294 293 1 [\da-f]{40}
295 294
296 295 $ hg qpush
297 296 applying test.patch
298 297 now at: test.patch
299 298 $ hg tags > /dev/null
300 299
301 300 .hg/tags.cache (post qpush):
302 301
303 302 $ cat .hg/tags.cache
304 303 2 [\da-f]{40}
305 304
306 305 $ checkundo qpush
307 306 $ cd ..
308 307
309 308
310 309 pop/push outside repo
311 310 $ hg -R a qpop
312 311 popping test.patch
313 312 patch queue now empty
314 313 $ hg -R a qpush
315 314 applying test.patch
316 315 now at: test.patch
317 316
318 317 $ cd a
319 318 $ hg qnew test2.patch
320 319
321 320 qrefresh in subdir
322 321
323 322 $ cd b
324 323 $ echo a > a
325 324 $ hg add a
326 325 $ hg qrefresh
327 326
328 327 pop/push -a in subdir
329 328
330 329 $ hg qpop -a
331 330 popping test2.patch
332 331 popping test.patch
333 332 patch queue now empty
334 333 $ hg --traceback qpush -a
335 334 applying test.patch
336 335 applying test2.patch
337 336 now at: test2.patch
338 337
339 338
340 339 setting columns & formatted tests truncating (issue1912)
341 340
342 341 $ COLUMNS=4 hg qseries --config ui.formatted=true
343 342 test.patch
344 343 test2.patch
345 344 $ COLUMNS=20 hg qseries --config ui.formatted=true -vs
346 345 0 A test.patch: f...
347 346 1 A test2.patch:
348 347 $ hg qpop
349 348 popping test2.patch
350 349 now at: test.patch
351 350 $ hg qseries -vs
352 351 0 A test.patch: foo bar
353 352 1 U test2.patch:
354 353 $ hg sum | grep mq
355 354 mq: 1 applied, 1 unapplied
356 355 $ hg qpush
357 356 applying test2.patch
358 357 now at: test2.patch
359 358 $ hg sum | grep mq
360 359 mq: 2 applied
361 360 $ hg qapplied
362 361 test.patch
363 362 test2.patch
364 363 $ hg qtop
365 364 test2.patch
366 365
367 366
368 367 prev
369 368
370 369 $ hg qapp -1
371 370 test.patch
372 371
373 372 next
374 373
375 374 $ hg qunapp -1
376 375 all patches applied
377 376 [1]
378 377
379 378 $ hg qpop
380 379 popping test2.patch
381 380 now at: test.patch
382 381
383 382 commit should fail
384 383
385 384 $ hg commit
386 385 abort: cannot commit over an applied mq patch
387 386 [255]
388 387
389 388 push should fail
390 389
391 390 $ hg push ../../k
392 391 pushing to ../../k
393 392 abort: source has mq patches applied
394 393 [255]
395 394
396 395
397 396 import should fail
398 397
399 398 $ hg st .
400 399 $ echo foo >> ../a
401 400 $ hg diff > ../../import.diff
402 401 $ hg revert --no-backup ../a
403 402 $ hg import ../../import.diff
404 403 abort: cannot import over an applied patch
405 404 [255]
406 405 $ hg st
407 406
408 407 import --no-commit should succeed
409 408
410 409 $ hg import --no-commit ../../import.diff
411 410 applying ../../import.diff
412 411 $ hg st
413 412 M a
414 413 $ hg revert --no-backup ../a
415 414
416 415
417 416 qunapplied
418 417
419 418 $ hg qunapplied
420 419 test2.patch
421 420
422 421
423 422 qpush/qpop with index
424 423
425 424 $ hg qnew test1b.patch
426 425 $ echo 1b > 1b
427 426 $ hg add 1b
428 427 $ hg qrefresh
429 428 $ hg qpush 2
430 429 applying test2.patch
431 430 now at: test2.patch
432 431 $ hg qpop 0
433 432 popping test2.patch
434 433 popping test1b.patch
435 434 now at: test.patch
436 435 $ hg qpush test.patch+1
437 436 applying test1b.patch
438 437 now at: test1b.patch
439 438 $ hg qpush test.patch+2
440 439 applying test2.patch
441 440 now at: test2.patch
442 441 $ hg qpop test2.patch-1
443 442 popping test2.patch
444 443 now at: test1b.patch
445 444 $ hg qpop test2.patch-2
446 445 popping test1b.patch
447 446 now at: test.patch
448 447 $ hg qpush test1b.patch+1
449 448 applying test1b.patch
450 449 applying test2.patch
451 450 now at: test2.patch
452 451
453 452
454 453 qpush --move
455 454
456 455 $ hg qpop -a
457 456 popping test2.patch
458 457 popping test1b.patch
459 458 popping test.patch
460 459 patch queue now empty
461 460 $ hg qguard test1b.patch -- -negguard
462 461 $ hg qguard test2.patch -- +posguard
463 462 $ hg qpush --move test2.patch # can't move guarded patch
464 463 cannot push 'test2.patch' - guarded by ['+posguard']
465 464 [1]
466 465 $ hg qselect posguard
467 466 number of unguarded, unapplied patches has changed from 2 to 3
468 467 $ hg qpush --move test2.patch # move to front
469 468 applying test2.patch
470 469 now at: test2.patch
471 470 $ hg qpush --move test1b.patch # negative guard unselected
472 471 applying test1b.patch
473 472 now at: test1b.patch
474 473 $ hg qpush --move test.patch # noop move
475 474 applying test.patch
476 475 now at: test.patch
477 476 $ hg qseries -v
478 477 0 A test2.patch
479 478 1 A test1b.patch
480 479 2 A test.patch
481 480 $ hg qpop -a
482 481 popping test.patch
483 482 popping test1b.patch
484 483 popping test2.patch
485 484 patch queue now empty
486 485
487 486 cleaning up
488 487
489 488 $ hg qselect --none
490 489 guards deactivated
491 490 number of unguarded, unapplied patches has changed from 3 to 2
492 491 $ hg qguard --none test1b.patch
493 492 $ hg qguard --none test2.patch
494 493 $ hg qpush --move test.patch
495 494 applying test.patch
496 495 now at: test.patch
497 496 $ hg qpush --move test1b.patch
498 497 applying test1b.patch
499 498 now at: test1b.patch
500 499 $ hg qpush --move bogus # nonexistent patch
501 500 abort: patch bogus not in series
502 501 [255]
503 502 $ hg qpush --move # no patch
504 503 abort: please specify the patch to move
505 504 [255]
506 505 $ hg qpush --move test.patch # already applied
507 506 abort: cannot push to a previous patch: test.patch
508 507 [255]
509 508 $ hg qpush
510 509 applying test2.patch
511 510 now at: test2.patch
512 511
513 512
514 513 series after move
515 514
516 515 $ cat `hg root`/.hg/patches/series
517 516 test.patch
518 517 test1b.patch
519 518 test2.patch
520 519 # comment
521 520
522 521
523 522
524 523 pop, qapplied, qunapplied
525 524
526 525 $ hg qseries -v
527 526 0 A test.patch
528 527 1 A test1b.patch
529 528 2 A test2.patch
530 529
531 530 qapplied -1 test.patch
532 531
533 532 $ hg qapplied -1 test.patch
534 533 only one patch applied
535 534 [1]
536 535
537 536 qapplied -1 test1b.patch
538 537
539 538 $ hg qapplied -1 test1b.patch
540 539 test.patch
541 540
542 541 qapplied -1 test2.patch
543 542
544 543 $ hg qapplied -1 test2.patch
545 544 test1b.patch
546 545
547 546 qapplied -1
548 547
549 548 $ hg qapplied -1
550 549 test1b.patch
551 550
552 551 qapplied
553 552
554 553 $ hg qapplied
555 554 test.patch
556 555 test1b.patch
557 556 test2.patch
558 557
559 558 qapplied test1b.patch
560 559
561 560 $ hg qapplied test1b.patch
562 561 test.patch
563 562 test1b.patch
564 563
565 564 qunapplied -1
566 565
567 566 $ hg qunapplied -1
568 567 all patches applied
569 568 [1]
570 569
571 570 qunapplied
572 571
573 572 $ hg qunapplied
574 573
575 574 popping
576 575
577 576 $ hg qpop
578 577 popping test2.patch
579 578 now at: test1b.patch
580 579
581 580 qunapplied -1
582 581
583 582 $ hg qunapplied -1
584 583 test2.patch
585 584
586 585 qunapplied
587 586
588 587 $ hg qunapplied
589 588 test2.patch
590 589
591 590 qunapplied test2.patch
592 591
593 592 $ hg qunapplied test2.patch
594 593
595 594 qunapplied -1 test2.patch
596 595
597 596 $ hg qunapplied -1 test2.patch
598 597 all patches applied
599 598 [1]
600 599
601 600 popping -a
602 601
603 602 $ hg qpop -a
604 603 popping test1b.patch
605 604 popping test.patch
606 605 patch queue now empty
607 606
608 607 qapplied
609 608
610 609 $ hg qapplied
611 610
612 611 qapplied -1
613 612
614 613 $ hg qapplied -1
615 614 no patches applied
616 615 [1]
617 616 $ hg qpush
618 617 applying test.patch
619 618 now at: test.patch
620 619
621 620
622 621 push should succeed
623 622
624 623 $ hg qpop -a
625 624 popping test.patch
626 625 patch queue now empty
627 626 $ hg push ../../k
628 627 pushing to ../../k
629 628 searching for changes
630 629 adding changesets
631 630 adding manifests
632 631 adding file changes
633 632 added 1 changesets with 1 changes to 1 files
634 633
635 634
636 qpush/qpop error codes
637
638 $ errorcode()
639 > {
640 > hg "$@" && echo " $@ succeeds" || echo " $@ fails"
641 > }
642
643
644 635 we want to start with some patches applied
645 636
646 637 $ hg qpush -a
647 638 applying test.patch
648 639 applying test1b.patch
649 640 applying test2.patch
650 641 now at: test2.patch
651 642
652 643 % pops all patches and succeeds
653 644
654 $ errorcode qpop -a
645 $ hg qpop -a
655 646 popping test2.patch
656 647 popping test1b.patch
657 648 popping test.patch
658 649 patch queue now empty
659 qpop -a succeeds
660 650
661 651 % does nothing and succeeds
662 652
663 $ errorcode qpop -a
653 $ hg qpop -a
664 654 no patches applied
665 qpop -a succeeds
666 655
667 656 % fails - nothing else to pop
668 657
669 $ errorcode qpop
658 $ hg qpop
670 659 no patches applied
671 qpop fails
660 [1]
672 661
673 662 % pushes a patch and succeeds
674 663
675 $ errorcode qpush
664 $ hg qpush
676 665 applying test.patch
677 666 now at: test.patch
678 qpush succeeds
679 667
680 668 % pops a patch and succeeds
681 669
682 $ errorcode qpop
670 $ hg qpop
683 671 popping test.patch
684 672 patch queue now empty
685 qpop succeeds
686 673
687 674 % pushes up to test1b.patch and succeeds
688 675
689 $ errorcode qpush test1b.patch
676 $ hg qpush test1b.patch
690 677 applying test.patch
691 678 applying test1b.patch
692 679 now at: test1b.patch
693 qpush test1b.patch succeeds
694 680
695 681 % does nothing and succeeds
696 682
697 $ errorcode qpush test1b.patch
683 $ hg qpush test1b.patch
698 684 qpush: test1b.patch is already at the top
699 qpush test1b.patch succeeds
700 685
701 686 % does nothing and succeeds
702 687
703 $ errorcode qpop test1b.patch
688 $ hg qpop test1b.patch
704 689 qpop: test1b.patch is already at the top
705 qpop test1b.patch succeeds
706 690
707 691 % fails - can't push to this patch
708 692
709 $ errorcode qpush test.patch
693 $ hg qpush test.patch
710 694 abort: cannot push to a previous patch: test.patch
711 qpush test.patch fails
695 [255]
712 696
713 697 % fails - can't pop to this patch
714 698
715 $ errorcode qpop test2.patch
699 $ hg qpop test2.patch
716 700 abort: patch test2.patch is not applied
717 qpop test2.patch fails
701 [255]
718 702
719 703 % pops up to test.patch and succeeds
720 704
721 $ errorcode qpop test.patch
705 $ hg qpop test.patch
722 706 popping test1b.patch
723 707 now at: test.patch
724 qpop test.patch succeeds
725 708
726 709 % pushes all patches and succeeds
727 710
728 $ errorcode qpush -a
711 $ hg qpush -a
729 712 applying test1b.patch
730 713 applying test2.patch
731 714 now at: test2.patch
732 qpush -a succeeds
733 715
734 716 % does nothing and succeeds
735 717
736 $ errorcode qpush -a
718 $ hg qpush -a
737 719 all patches are currently applied
738 qpush -a succeeds
739 720
740 721 % fails - nothing else to push
741 722
742 $ errorcode qpush
723 $ hg qpush
743 724 patch series already fully applied
744 qpush fails
725 [1]
745 726
746 727 % does nothing and succeeds
747 728
748 $ errorcode qpush test2.patch
729 $ hg qpush test2.patch
749 730 qpush: test2.patch is already at the top
750 qpush test2.patch succeeds
751
752
753 731
754 732 strip
755 733
756 734 $ cd ../../b
757 735 $ echo x>x
758 736 $ hg ci -Ama
759 737 adding x
760 738 $ hg strip tip
761 739 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
762 740 saved backup bundle to .*
763 741 $ hg unbundle .hg/strip-backup/*
764 742 adding changesets
765 743 adding manifests
766 744 adding file changes
767 745 added 1 changesets with 1 changes to 1 files
768 746 (run 'hg update' to get a working copy)
769 747
770 748
771 749 strip with local changes, should complain
772 750
773 751 $ hg up
774 752 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
775 753 $ echo y>y
776 754 $ hg add y
777 755 $ hg strip tip
778 756 abort: local changes found
779 757 [255]
780 758
781 759 --force strip with local changes
782 760
783 761 $ hg strip -f tip
784 762 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
785 763 saved backup bundle to .*
786 764
787 765
788 766 cd b; hg qrefresh
789 767
790 768 $ hg init refresh
791 769 $ cd refresh
792 770 $ echo a > a
793 771 $ hg ci -Ama
794 772 adding a
795 773 $ hg qnew -mfoo foo
796 774 $ echo a >> a
797 775 $ hg qrefresh
798 776 $ mkdir b
799 777 $ cd b
800 778 $ echo f > f
801 779 $ hg add f
802 780 $ hg qrefresh
803 781 $ cat ../.hg/patches/foo
804 782 foo
805 783
806 784 diff -r cb9a9f314b8b a
807 785 --- a/a\t(?P<date>.*)
808 786 \+\+\+ b/a\t(?P<date>.*)
809 787 @@ -1,1 +1,2 @@
810 788 a
811 789 +a
812 790 diff -r cb9a9f314b8b b/f
813 791 --- /dev/null\t(?P<date>.*)
814 792 \+\+\+ b/b/f\t(?P<date>.*)
815 793 @@ -0,0 +1,1 @@
816 794 +f
817 795
818 796 hg qrefresh .
819 797
820 798 $ hg qrefresh .
821 799 $ cat ../.hg/patches/foo
822 800 foo
823 801
824 802 diff -r cb9a9f314b8b b/f
825 803 --- /dev/null\t(?P<date>.*)
826 804 \+\+\+ b/b/f\t(?P<date>.*)
827 805 @@ -0,0 +1,1 @@
828 806 +f
829 807 $ hg status
830 808 M a
831 809
832 810
833 811 qpush failure
834 812
835 813 $ cd ..
836 814 $ hg qrefresh
837 815 $ hg qnew -mbar bar
838 816 $ echo foo > foo
839 817 $ echo bar > bar
840 818 $ hg add foo bar
841 819 $ hg qrefresh
842 820 $ hg qpop -a
843 821 popping bar
844 822 popping foo
845 823 patch queue now empty
846 824 $ echo bar > foo
847 825 $ hg qpush -a
848 826 applying foo
849 827 applying bar
850 828 file foo already exists
851 829 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
852 830 patch failed, unable to continue (try -v)
853 831 patch failed, rejects left in working dir
854 832 errors during apply, please fix and refresh bar
855 833 [2]
856 834 $ hg st
857 835 ? foo
858 836 ? foo.rej
859 837
860 838
861 839 mq tags
862 840
863 841 $ hg log --template '{rev} {tags}\n' -r qparent:qtip
864 842 0 qparent
865 843 1 foo qbase
866 844 2 bar qtip tip
867 845
868 846
869 847 bad node in status
870 848
871 849 $ hg qpop
872 850 popping bar
873 851 now at: foo
874 852 $ hg strip -qn tip
875 853 $ hg tip
876 854 changeset: 0:cb9a9f314b8b
877 855 tag: tip
878 856 user: test
879 857 date: Thu Jan 01 00:00:00 1970 +0000
880 858 summary: a
881 859
882 860 $ hg branches
883 861 default 0:cb9a9f314b8b
884 862 $ hg qpop
885 863 no patches applied
886 864 [1]
887 865
888 866 $ cat >>$HGRCPATH <<EOF
889 867 > [diff]
890 868 > git = True
891 869 > EOF
892 870 $ cd ..
893 871 $ hg init git
894 872 $ cd git
895 873 $ hg qinit
896 874
897 875 $ hg qnew -m'new file' new
898 876 $ echo foo > new
899 877 $ chmod +x new
900 878 $ hg add new
901 879 $ hg qrefresh
902 880 $ cat .hg/patches/new
903 881 new file
904 882
905 883 diff --git a/new b/new
906 884 new file mode 100755
907 885 --- /dev/null
908 886 +++ b/new
909 887 @@ -0,0 +1,1 @@
910 888 +foo
911 889
912 890 $ hg qnew -m'copy file' copy
913 891 $ hg cp new copy
914 892 $ hg qrefresh
915 893 $ cat .hg/patches/copy
916 894 copy file
917 895
918 896 diff --git a/new b/copy
919 897 copy from new
920 898 copy to copy
921 899
922 900 $ hg qpop
923 901 popping copy
924 902 now at: new
925 903 $ hg qpush
926 904 applying copy
927 905 now at: copy
928 906 $ hg qdiff
929 907 diff --git a/new b/copy
930 908 copy from new
931 909 copy to copy
932 910 $ cat >>$HGRCPATH <<EOF
933 911 > [diff]
934 912 > git = False
935 913 > EOF
936 914 $ hg qdiff --git
937 915 diff --git a/new b/copy
938 916 copy from new
939 917 copy to copy
940 918 $ cd ..
941 919
942 920
943 921 test file addition in slow path
944 922
945 923 $ hg init slow
946 924 $ cd slow
947 925 $ hg qinit
948 926 $ echo foo > foo
949 927 $ hg add foo
950 928 $ hg ci -m 'add foo'
951 929 $ hg qnew bar
952 930 $ echo bar > bar
953 931 $ hg add bar
954 932 $ hg mv foo baz
955 933 $ hg qrefresh --git
956 934 $ hg up -C 0
957 935 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
958 936 $ echo >> foo
959 937 $ hg ci -m 'change foo'
960 938 created new head
961 939 $ hg up -C 1
962 940 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
963 941 $ hg qrefresh --git
964 942 $ cat .hg/patches/bar
965 943 diff --git a/bar b/bar
966 944 new file mode 100644
967 945 --- /dev/null
968 946 +++ b/bar
969 947 @@ -0,0 +1,1 @@
970 948 +bar
971 949 diff --git a/foo b/baz
972 950 rename from foo
973 951 rename to baz
974 952 $ hg log -v --template '{rev} {file_copies}\n' -r .
975 953 2 baz (foo)
976 954 $ hg qrefresh --git
977 955 $ cat .hg/patches/bar
978 956 diff --git a/bar b/bar
979 957 new file mode 100644
980 958 --- /dev/null
981 959 +++ b/bar
982 960 @@ -0,0 +1,1 @@
983 961 +bar
984 962 diff --git a/foo b/baz
985 963 rename from foo
986 964 rename to baz
987 965 $ hg log -v --template '{rev} {file_copies}\n' -r .
988 966 2 baz (foo)
989 967 $ hg qrefresh
990 968 $ grep 'diff --git' .hg/patches/bar
991 969 diff --git a/bar b/bar
992 970 diff --git a/foo b/baz
993 971
994 972
995 973 test file move chains in the slow path
996 974
997 975 $ hg up -C 1
998 976 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
999 977 $ echo >> foo
1000 978 $ hg ci -m 'change foo again'
1001 979 $ hg up -C 2
1002 980 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1003 981 $ hg mv bar quux
1004 982 $ hg mv baz bleh
1005 983 $ hg qrefresh --git
1006 984 $ cat .hg/patches/bar
1007 985 diff --git a/foo b/bleh
1008 986 rename from foo
1009 987 rename to bleh
1010 988 diff --git a/quux b/quux
1011 989 new file mode 100644
1012 990 --- /dev/null
1013 991 +++ b/quux
1014 992 @@ -0,0 +1,1 @@
1015 993 +bar
1016 994 $ hg log -v --template '{rev} {file_copies}\n' -r .
1017 995 3 bleh (foo)
1018 996 $ hg mv quux fred
1019 997 $ hg mv bleh barney
1020 998 $ hg qrefresh --git
1021 999 $ cat .hg/patches/bar
1022 1000 diff --git a/foo b/barney
1023 1001 rename from foo
1024 1002 rename to barney
1025 1003 diff --git a/fred b/fred
1026 1004 new file mode 100644
1027 1005 --- /dev/null
1028 1006 +++ b/fred
1029 1007 @@ -0,0 +1,1 @@
1030 1008 +bar
1031 1009 $ hg log -v --template '{rev} {file_copies}\n' -r .
1032 1010 3 barney (foo)
1033 1011
1034 1012
1035 1013 refresh omitting an added file
1036 1014
1037 1015 $ hg qnew baz
1038 1016 $ echo newfile > newfile
1039 1017 $ hg add newfile
1040 1018 $ hg qrefresh
1041 1019 $ hg st -A newfile
1042 1020 C newfile
1043 1021 $ hg qrefresh -X newfile
1044 1022 $ hg st -A newfile
1045 1023 A newfile
1046 1024 $ hg revert newfile
1047 1025 $ rm newfile
1048 1026 $ hg qpop
1049 1027 popping baz
1050 1028 now at: bar
1051 1029 $ hg qdel baz
1052 1030
1053 1031
1054 1032 create a git patch
1055 1033
1056 1034 $ echo a > alexander
1057 1035 $ hg add alexander
1058 1036 $ hg qnew -f --git addalexander
1059 1037 $ grep diff .hg/patches/addalexander
1060 1038 diff --git a/alexander b/alexander
1061 1039
1062 1040
1063 1041 create a git binary patch
1064 1042
1065 1043 $ cat > writebin.py <<EOF
1066 1044 > import sys
1067 1045 > path = sys.argv[1]
1068 1046 > open(path, 'wb').write('BIN\x00ARY')
1069 1047 > EOF
1070 1048 $ python writebin.py bucephalus
1071 1049
1072 1050 $ python "$TESTDIR/md5sum.py" bucephalus
1073 1051 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1074 1052 $ hg add bucephalus
1075 1053 $ hg qnew -f --git addbucephalus
1076 1054 $ grep diff .hg/patches/addbucephalus
1077 1055 diff --git a/bucephalus b/bucephalus
1078 1056
1079 1057
1080 1058 check binary patches can be popped and pushed
1081 1059
1082 1060 $ hg qpop
1083 1061 popping addbucephalus
1084 1062 now at: addalexander
1085 1063 $ test -f bucephalus && echo % bucephalus should not be there
1086 1064 [1]
1087 1065 $ hg qpush
1088 1066 applying addbucephalus
1089 1067 now at: addbucephalus
1090 $ test -f bucephalus || echo % bucephalus should be there
1068 $ test -f bucephalus
1091 1069 $ python "$TESTDIR/md5sum.py" bucephalus
1092 1070 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1093 1071
1094 1072
1095 1073
1096 1074 strip again
1097 1075
1098 1076 $ cd ..
1099 1077 $ hg init strip
1100 1078 $ cd strip
1101 1079 $ touch foo
1102 1080 $ hg add foo
1103 1081 $ hg ci -m 'add foo'
1104 1082 $ echo >> foo
1105 1083 $ hg ci -m 'change foo 1'
1106 1084 $ hg up -C 0
1107 1085 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1108 1086 $ echo 1 >> foo
1109 1087 $ hg ci -m 'change foo 2'
1110 1088 created new head
1111 1089 $ HGMERGE=true hg merge
1112 1090 merging foo
1113 1091 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1114 1092 (branch merge, don't forget to commit)
1115 1093 $ hg ci -m merge
1116 1094 $ hg log
1117 1095 changeset: 3:99615015637b
1118 1096 tag: tip
1119 1097 parent: 2:20cbbe65cff7
1120 1098 parent: 1:d2871fc282d4
1121 1099 user: test
1122 1100 date: Thu Jan 01 00:00:00 1970 +0000
1123 1101 summary: merge
1124 1102
1125 1103 changeset: 2:20cbbe65cff7
1126 1104 parent: 0:53245c60e682
1127 1105 user: test
1128 1106 date: Thu Jan 01 00:00:00 1970 +0000
1129 1107 summary: change foo 2
1130 1108
1131 1109 changeset: 1:d2871fc282d4
1132 1110 user: test
1133 1111 date: Thu Jan 01 00:00:00 1970 +0000
1134 1112 summary: change foo 1
1135 1113
1136 1114 changeset: 0:53245c60e682
1137 1115 user: test
1138 1116 date: Thu Jan 01 00:00:00 1970 +0000
1139 1117 summary: add foo
1140 1118
1141 1119 $ hg strip 1
1142 1120 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1143 1121 saved backup bundle to .*
1144 1122 $ checkundo strip
1145 1123 $ hg log
1146 1124 changeset: 1:20cbbe65cff7
1147 1125 tag: tip
1148 1126 user: test
1149 1127 date: Thu Jan 01 00:00:00 1970 +0000
1150 1128 summary: change foo 2
1151 1129
1152 1130 changeset: 0:53245c60e682
1153 1131 user: test
1154 1132 date: Thu Jan 01 00:00:00 1970 +0000
1155 1133 summary: add foo
1156 1134
1157 1135 $ cd ..
1158 1136
1159 1137
1160 1138 qclone
1161 1139
1162 1140 $ qlog()
1163 1141 > {
1164 1142 > echo 'main repo:'
1165 1143 > hg log --template ' rev {rev}: {desc}\n'
1166 1144 > echo 'patch repo:'
1167 1145 > hg -R .hg/patches log --template ' rev {rev}: {desc}\n'
1168 1146 > }
1169 1147 $ hg init qclonesource
1170 1148 $ cd qclonesource
1171 1149 $ echo foo > foo
1172 1150 $ hg add foo
1173 1151 $ hg ci -m 'add foo'
1174 1152 $ hg qinit
1175 1153 $ hg qnew patch1
1176 1154 $ echo bar >> foo
1177 1155 $ hg qrefresh -m 'change foo'
1178 1156 $ cd ..
1179 1157
1180 1158
1181 1159 repo with unversioned patch dir
1182 1160
1183 1161 $ hg qclone qclonesource failure
1184 1162 abort: versioned patch repository not found (see init --mq)
1185 1163 [255]
1186 1164
1187 1165 $ cd qclonesource
1188 1166 $ hg qinit -c
1189 1167 adding .hg/patches/patch1
1190 1168 $ hg qci -m checkpoint
1191 1169 $ qlog
1192 1170 main repo:
1193 1171 rev 1: change foo
1194 1172 rev 0: add foo
1195 1173 patch repo:
1196 1174 rev 0: checkpoint
1197 1175 $ cd ..
1198 1176
1199 1177
1200 1178 repo with patches applied
1201 1179
1202 1180 $ hg qclone qclonesource qclonedest
1203 1181 updating to branch default
1204 1182 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1205 1183 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1206 1184 $ cd qclonedest
1207 1185 $ qlog
1208 1186 main repo:
1209 1187 rev 0: add foo
1210 1188 patch repo:
1211 1189 rev 0: checkpoint
1212 1190 $ cd ..
1213 1191
1214 1192
1215 1193 repo with patches unapplied
1216 1194
1217 1195 $ cd qclonesource
1218 1196 $ hg qpop -a
1219 1197 popping patch1
1220 1198 patch queue now empty
1221 1199 $ qlog
1222 1200 main repo:
1223 1201 rev 0: add foo
1224 1202 patch repo:
1225 1203 rev 0: checkpoint
1226 1204 $ cd ..
1227 1205 $ hg qclone qclonesource qclonedest2
1228 1206 updating to branch default
1229 1207 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1230 1208 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1231 1209 $ cd qclonedest2
1232 1210 $ qlog
1233 1211 main repo:
1234 1212 rev 0: add foo
1235 1213 patch repo:
1236 1214 rev 0: checkpoint
1237 1215 $ cd ..
1238 1216
1239 1217
1240 1218 test applying on an empty file (issue 1033)
1241 1219
1242 1220 $ hg init empty
1243 1221 $ cd empty
1244 1222 $ touch a
1245 1223 $ hg ci -Am addempty
1246 1224 adding a
1247 1225 $ echo a > a
1248 1226 $ hg qnew -f -e changea
1249 1227 $ hg qpop
1250 1228 popping changea
1251 1229 patch queue now empty
1252 1230 $ hg qpush
1253 1231 applying changea
1254 1232 now at: changea
1255 1233 $ cd ..
1256 1234
1257 1235
1258 1236 test qpush with --force, issue1087
1259 1237
1260 1238 $ hg init forcepush
1261 1239 $ cd forcepush
1262 1240 $ echo hello > hello.txt
1263 1241 $ echo bye > bye.txt
1264 1242 $ hg ci -Ama
1265 1243 adding bye.txt
1266 1244 adding hello.txt
1267 1245 $ hg qnew -d '0 0' empty
1268 1246 $ hg qpop
1269 1247 popping empty
1270 1248 patch queue now empty
1271 1249 $ echo world >> hello.txt
1272 1250
1273 1251
1274 1252 qpush should fail, local changes
1275 1253
1276 1254 $ hg qpush
1277 1255 abort: local changes found, refresh first
1278 1256 [255]
1279 1257
1280 1258
1281 1259 apply force, should not discard changes with empty patch
1282 1260
1283 1261 $ hg qpush -f
1284 1262 applying empty
1285 1263 patch empty is empty
1286 1264 now at: empty
1287 1265 $ hg diff --config diff.nodates=True
1288 1266 diff -r bf5fc3f07a0a hello.txt
1289 1267 --- a/hello.txt
1290 1268 +++ b/hello.txt
1291 1269 @@ -1,1 +1,2 @@
1292 1270 hello
1293 1271 +world
1294 1272 $ hg qdiff --config diff.nodates=True
1295 1273 diff -r 9ecee4f634e3 hello.txt
1296 1274 --- a/hello.txt
1297 1275 +++ b/hello.txt
1298 1276 @@ -1,1 +1,2 @@
1299 1277 hello
1300 1278 +world
1301 1279 $ hg log -l1 -p
1302 1280 changeset: 1:bf5fc3f07a0a
1303 1281 tag: empty
1304 1282 tag: qbase
1305 1283 tag: qtip
1306 1284 tag: tip
1307 1285 user: test
1308 1286 date: Thu Jan 01 00:00:00 1970 +0000
1309 1287 summary: imported patch empty
1310 1288
1311 1289
1312 1290 $ hg qref -d '0 0'
1313 1291 $ hg qpop
1314 1292 popping empty
1315 1293 patch queue now empty
1316 1294 $ echo universe >> hello.txt
1317 1295 $ echo universe >> bye.txt
1318 1296
1319 1297
1320 1298 qpush should fail, local changes
1321 1299
1322 1300 $ hg qpush
1323 1301 abort: local changes found, refresh first
1324 1302 [255]
1325 1303
1326 1304
1327 1305 apply force, should discard changes in hello, but not bye
1328 1306
1329 1307 $ hg qpush -f
1330 1308 applying empty
1331 1309 now at: empty
1332 1310 $ hg st
1333 1311 M bye.txt
1334 1312 $ hg diff --config diff.nodates=True
1335 1313 diff -r ba252371dbc1 bye.txt
1336 1314 --- a/bye.txt
1337 1315 +++ b/bye.txt
1338 1316 @@ -1,1 +1,2 @@
1339 1317 bye
1340 1318 +universe
1341 1319 $ hg qdiff --config diff.nodates=True
1342 1320 diff -r 9ecee4f634e3 bye.txt
1343 1321 --- a/bye.txt
1344 1322 +++ b/bye.txt
1345 1323 @@ -1,1 +1,2 @@
1346 1324 bye
1347 1325 +universe
1348 1326 diff -r 9ecee4f634e3 hello.txt
1349 1327 --- a/hello.txt
1350 1328 +++ b/hello.txt
1351 1329 @@ -1,1 +1,3 @@
1352 1330 hello
1353 1331 +world
1354 1332 +universe
1355 1333
1356 1334
1357 1335 test popping revisions not in working dir ancestry
1358 1336
1359 1337 $ hg qseries -v
1360 1338 0 A empty
1361 1339 $ hg up qparent
1362 1340 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1363 1341 $ hg qpop
1364 1342 popping empty
1365 1343 patch queue now empty
1366 1344
1367 1345 $ cd ..
1368 1346 $ hg init deletion-order
1369 1347 $ cd deletion-order
1370 1348
1371 1349 $ touch a
1372 1350 $ hg ci -Aqm0
1373 1351
1374 1352 $ hg qnew rename-dir
1375 1353 $ hg rm a
1376 1354 $ hg qrefresh
1377 1355
1378 1356 $ mkdir a b
1379 1357 $ touch a/a b/b
1380 1358 $ hg add -q a b
1381 1359 $ hg qrefresh
1382 1360
1383 1361
1384 1362 test popping must remove files added in subdirectories first
1385 1363
1386 1364 $ hg qpop
1387 1365 popping rename-dir
1388 1366 patch queue now empty
1389 1367 $ cd ..
1390 1368
@@ -1,240 +1,240 b''
1 1 This runs with TZ="GMT"
2 2
3 3 $ hg init
4 4 $ echo "test-parse-date" > a
5 5 $ hg add a
6 6 $ hg ci -d "2006-02-01 13:00:30" -m "rev 0"
7 7 $ echo "hi!" >> a
8 8 $ hg ci -d "2006-02-01 13:00:30 -0500" -m "rev 1"
9 9 $ hg tag -d "2006-04-15 13:30" "Hi"
10 10 $ hg backout --merge -d "2006-04-15 13:30 +0200" -m "rev 3" 1
11 11 reverting a
12 12 created new head
13 13 changeset 3:107ce1ee2b43 backs out changeset 1:25a1420a55f8
14 14 merging with changeset 3:107ce1ee2b43
15 15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
16 16 (branch merge, don't forget to commit)
17 17 $ hg ci -d "1150000000 14400" -m "rev 4 (merge)"
18 18 $ echo "fail" >> a
19 19 $ hg ci -d "should fail" -m "fail"
20 20 abort: invalid date: 'should fail'
21 21 [255]
22 22 $ hg ci -d "100000000000000000 1400" -m "fail"
23 23 abort: date exceeds 32 bits: 100000000000000000
24 24 [255]
25 25 $ hg ci -d "100000 1400000" -m "fail"
26 26 abort: impossible time zone offset: 1400000
27 27 [255]
28 28
29 29 Check with local timezone other than GMT and with DST
30 30
31 31 $ TZ="PST+8PDT"
32 32 $ export TZ
33 33
34 34 PST=UTC-8 / PDT=UTC-7
35 35
36 36 $ hg debugrebuildstate
37 37 $ echo "a" > a
38 38 $ hg ci -d "2006-07-15 13:30" -m "summer@UTC-7"
39 39 $ hg debugrebuildstate
40 40 $ echo "b" > a
41 41 $ hg ci -d "2006-07-15 13:30 +0500" -m "summer@UTC+5"
42 42 $ hg debugrebuildstate
43 43 $ echo "c" > a
44 44 $ hg ci -d "2006-01-15 13:30" -m "winter@UTC-8"
45 45 $ hg debugrebuildstate
46 46 $ echo "d" > a
47 47 $ hg ci -d "2006-01-15 13:30 +0500" -m "winter@UTC+5"
48 48 $ hg log --template '{date|date}\n'
49 49 Sun Jan 15 13:30:00 2006 +0500
50 50 Sun Jan 15 13:30:00 2006 -0800
51 51 Sat Jul 15 13:30:00 2006 +0500
52 52 Sat Jul 15 13:30:00 2006 -0700
53 53 Sun Jun 11 00:26:40 2006 -0400
54 54 Sat Apr 15 13:30:00 2006 +0200
55 55 Sat Apr 15 13:30:00 2006 +0000
56 56 Wed Feb 01 13:00:30 2006 -0500
57 57 Wed Feb 01 13:00:30 2006 +0000
58 58
59 59 Test issue1014 (fractional timezones)
60 60
61 61 $ hg debugdate "1000000000 -16200" # 0430
62 62 internal: 1000000000 -16200
63 63 standard: Sun Sep 09 06:16:40 2001 +0430
64 64 $ hg debugdate "1000000000 -15300" # 0415
65 65 internal: 1000000000 -15300
66 66 standard: Sun Sep 09 06:01:40 2001 +0415
67 67 $ hg debugdate "1000000000 -14400" # 0400
68 68 internal: 1000000000 -14400
69 69 standard: Sun Sep 09 05:46:40 2001 +0400
70 70 $ hg debugdate "1000000000 0" # GMT
71 71 internal: 1000000000 0
72 72 standard: Sun Sep 09 01:46:40 2001 +0000
73 73 $ hg debugdate "1000000000 14400" # -0400
74 74 internal: 1000000000 14400
75 75 standard: Sat Sep 08 21:46:40 2001 -0400
76 76 $ hg debugdate "1000000000 15300" # -0415
77 77 internal: 1000000000 15300
78 78 standard: Sat Sep 08 21:31:40 2001 -0415
79 79 $ hg debugdate "1000000000 16200" # -0430
80 80 internal: 1000000000 16200
81 81 standard: Sat Sep 08 21:16:40 2001 -0430
82 82 $ hg debugdate "Sat Sep 08 21:16:40 2001 +0430"
83 83 internal: 999967600 -16200
84 84 standard: Sat Sep 08 21:16:40 2001 +0430
85 85 $ hg debugdate "Sat Sep 08 21:16:40 2001 -0430"
86 86 internal: 1000000000 16200
87 87 standard: Sat Sep 08 21:16:40 2001 -0430
88 88
89 89 Test 12-hours times
90 90
91 91 $ hg debugdate "2006-02-01 1:00:30PM +0000"
92 92 internal: 1138798830 0
93 93 standard: Wed Feb 01 13:00:30 2006 +0000
94 $ hg debugdate "1:00:30PM" > /dev/null || echo 'failed'
94 $ hg debugdate "1:00:30PM" > /dev/null
95 95
96 96 Test date formats with '>' or '<' accompanied by space characters
97 97
98 98 $ hg log -d '>' --template '{date|date}\n'
99 99 Sun Jan 15 13:30:00 2006 +0500
100 100 Sun Jan 15 13:30:00 2006 -0800
101 101 Sat Jul 15 13:30:00 2006 +0500
102 102 Sat Jul 15 13:30:00 2006 -0700
103 103 Sun Jun 11 00:26:40 2006 -0400
104 104 Sat Apr 15 13:30:00 2006 +0200
105 105 Sat Apr 15 13:30:00 2006 +0000
106 106 Wed Feb 01 13:00:30 2006 -0500
107 107 Wed Feb 01 13:00:30 2006 +0000
108 108 $ hg log -d '<' hg log -d '>' --template '{date|date}\n'
109 109
110 110 $ hg log -d ' >' --template '{date|date}\n'
111 111 Sun Jan 15 13:30:00 2006 +0500
112 112 Sun Jan 15 13:30:00 2006 -0800
113 113 Sat Jul 15 13:30:00 2006 +0500
114 114 Sat Jul 15 13:30:00 2006 -0700
115 115 Sun Jun 11 00:26:40 2006 -0400
116 116 Sat Apr 15 13:30:00 2006 +0200
117 117 Sat Apr 15 13:30:00 2006 +0000
118 118 Wed Feb 01 13:00:30 2006 -0500
119 119 Wed Feb 01 13:00:30 2006 +0000
120 120 $ hg log -d ' <' --template '{date|date}\n'
121 121
122 122 $ hg log -d '> ' --template '{date|date}\n'
123 123 Sun Jan 15 13:30:00 2006 +0500
124 124 Sun Jan 15 13:30:00 2006 -0800
125 125 Sat Jul 15 13:30:00 2006 +0500
126 126 Sat Jul 15 13:30:00 2006 -0700
127 127 Sun Jun 11 00:26:40 2006 -0400
128 128 Sat Apr 15 13:30:00 2006 +0200
129 129 Sat Apr 15 13:30:00 2006 +0000
130 130 Wed Feb 01 13:00:30 2006 -0500
131 131 Wed Feb 01 13:00:30 2006 +0000
132 132 $ hg log -d '< ' --template '{date|date}\n'
133 133
134 134 $ hg log -d ' > ' --template '{date|date}\n'
135 135 Sun Jan 15 13:30:00 2006 +0500
136 136 Sun Jan 15 13:30:00 2006 -0800
137 137 Sat Jul 15 13:30:00 2006 +0500
138 138 Sat Jul 15 13:30:00 2006 -0700
139 139 Sun Jun 11 00:26:40 2006 -0400
140 140 Sat Apr 15 13:30:00 2006 +0200
141 141 Sat Apr 15 13:30:00 2006 +0000
142 142 Wed Feb 01 13:00:30 2006 -0500
143 143 Wed Feb 01 13:00:30 2006 +0000
144 144 $ hg log -d ' < ' --template '{date|date}\n'
145 145
146 146 $ hg log -d '>02/01' --template '{date|date}\n'
147 147 $ hg log -d '<02/01' --template '{date|date}\n'
148 148 Sun Jan 15 13:30:00 2006 +0500
149 149 Sun Jan 15 13:30:00 2006 -0800
150 150 Sat Jul 15 13:30:00 2006 +0500
151 151 Sat Jul 15 13:30:00 2006 -0700
152 152 Sun Jun 11 00:26:40 2006 -0400
153 153 Sat Apr 15 13:30:00 2006 +0200
154 154 Sat Apr 15 13:30:00 2006 +0000
155 155 Wed Feb 01 13:00:30 2006 -0500
156 156 Wed Feb 01 13:00:30 2006 +0000
157 157
158 158 $ hg log -d ' >02/01' --template '{date|date}\n'
159 159 $ hg log -d ' <02/01' --template '{date|date}\n'
160 160 Sun Jan 15 13:30:00 2006 +0500
161 161 Sun Jan 15 13:30:00 2006 -0800
162 162 Sat Jul 15 13:30:00 2006 +0500
163 163 Sat Jul 15 13:30:00 2006 -0700
164 164 Sun Jun 11 00:26:40 2006 -0400
165 165 Sat Apr 15 13:30:00 2006 +0200
166 166 Sat Apr 15 13:30:00 2006 +0000
167 167 Wed Feb 01 13:00:30 2006 -0500
168 168 Wed Feb 01 13:00:30 2006 +0000
169 169
170 170 $ hg log -d '> 02/01' --template '{date|date}\n'
171 171 $ hg log -d '< 02/01' --template '{date|date}\n'
172 172 Sun Jan 15 13:30:00 2006 +0500
173 173 Sun Jan 15 13:30:00 2006 -0800
174 174 Sat Jul 15 13:30:00 2006 +0500
175 175 Sat Jul 15 13:30:00 2006 -0700
176 176 Sun Jun 11 00:26:40 2006 -0400
177 177 Sat Apr 15 13:30:00 2006 +0200
178 178 Sat Apr 15 13:30:00 2006 +0000
179 179 Wed Feb 01 13:00:30 2006 -0500
180 180 Wed Feb 01 13:00:30 2006 +0000
181 181
182 182 $ hg log -d ' > 02/01' --template '{date|date}\n'
183 183 $ hg log -d ' < 02/01' --template '{date|date}\n'
184 184 Sun Jan 15 13:30:00 2006 +0500
185 185 Sun Jan 15 13:30:00 2006 -0800
186 186 Sat Jul 15 13:30:00 2006 +0500
187 187 Sat Jul 15 13:30:00 2006 -0700
188 188 Sun Jun 11 00:26:40 2006 -0400
189 189 Sat Apr 15 13:30:00 2006 +0200
190 190 Sat Apr 15 13:30:00 2006 +0000
191 191 Wed Feb 01 13:00:30 2006 -0500
192 192 Wed Feb 01 13:00:30 2006 +0000
193 193
194 194 $ hg log -d '>02/01 ' --template '{date|date}\n'
195 195 $ hg log -d '<02/01 ' --template '{date|date}\n'
196 196 Sun Jan 15 13:30:00 2006 +0500
197 197 Sun Jan 15 13:30:00 2006 -0800
198 198 Sat Jul 15 13:30:00 2006 +0500
199 199 Sat Jul 15 13:30:00 2006 -0700
200 200 Sun Jun 11 00:26:40 2006 -0400
201 201 Sat Apr 15 13:30:00 2006 +0200
202 202 Sat Apr 15 13:30:00 2006 +0000
203 203 Wed Feb 01 13:00:30 2006 -0500
204 204 Wed Feb 01 13:00:30 2006 +0000
205 205
206 206 $ hg log -d ' >02/01 ' --template '{date|date}\n'
207 207 $ hg log -d ' <02/01 ' --template '{date|date}\n'
208 208 Sun Jan 15 13:30:00 2006 +0500
209 209 Sun Jan 15 13:30:00 2006 -0800
210 210 Sat Jul 15 13:30:00 2006 +0500
211 211 Sat Jul 15 13:30:00 2006 -0700
212 212 Sun Jun 11 00:26:40 2006 -0400
213 213 Sat Apr 15 13:30:00 2006 +0200
214 214 Sat Apr 15 13:30:00 2006 +0000
215 215 Wed Feb 01 13:00:30 2006 -0500
216 216 Wed Feb 01 13:00:30 2006 +0000
217 217
218 218 $ hg log -d '> 02/01 ' --template '{date|date}\n'
219 219 $ hg log -d '< 02/01 ' --template '{date|date}\n'
220 220 Sun Jan 15 13:30:00 2006 +0500
221 221 Sun Jan 15 13:30:00 2006 -0800
222 222 Sat Jul 15 13:30:00 2006 +0500
223 223 Sat Jul 15 13:30:00 2006 -0700
224 224 Sun Jun 11 00:26:40 2006 -0400
225 225 Sat Apr 15 13:30:00 2006 +0200
226 226 Sat Apr 15 13:30:00 2006 +0000
227 227 Wed Feb 01 13:00:30 2006 -0500
228 228 Wed Feb 01 13:00:30 2006 +0000
229 229
230 230 $ hg log -d ' > 02/01 ' --template '{date|date}\n'
231 231 $ hg log -d ' < 02/01 ' --template '{date|date}\n'
232 232 Sun Jan 15 13:30:00 2006 +0500
233 233 Sun Jan 15 13:30:00 2006 -0800
234 234 Sat Jul 15 13:30:00 2006 +0500
235 235 Sat Jul 15 13:30:00 2006 -0700
236 236 Sun Jun 11 00:26:40 2006 -0400
237 237 Sat Apr 15 13:30:00 2006 +0200
238 238 Sat Apr 15 13:30:00 2006 +0000
239 239 Wed Feb 01 13:00:30 2006 -0500
240 240 Wed Feb 01 13:00:30 2006 +0000
@@ -1,69 +1,69 b''
1 1 $ hg init t
2 2 $ cd t
3 3
4 4 $ echo foo > a
5 5 $ hg add a
6 6
7 7 $ hg commit -m "1"
8 8
9 9 $ hg verify
10 10 checking changesets
11 11 checking manifests
12 12 crosschecking files in changesets and manifests
13 13 checking files
14 14 1 files, 1 changesets, 1 total revisions
15 15
16 16 $ chmod -r .hg/store/data/a.i
17 17
18 $ hg verify || echo %%% verify failed
18 $ hg verify
19 19 checking changesets
20 20 checking manifests
21 21 crosschecking files in changesets and manifests
22 22 checking files
23 23 abort: Permission denied: .*
24 %%% verify failed
24 [255]
25 25
26 26 $ chmod +r .hg/store/data/a.i
27 27
28 $ hg verify || echo %%% verify failed
28 $ hg verify
29 29 checking changesets
30 30 checking manifests
31 31 crosschecking files in changesets and manifests
32 32 checking files
33 33 1 files, 1 changesets, 1 total revisions
34 34
35 35 $ chmod -w .hg/store/data/a.i
36 36
37 37 $ echo barber > a
38 $ hg commit -m "2" || echo %%% commit failed
38 $ hg commit -m "2"
39 39 trouble committing a!
40 40 abort: Permission denied: .*
41 %%% commit failed
41 [255]
42 42
43 43 $ chmod -w .
44 44
45 45 $ hg diff --nodates
46 46 diff -r 2a18120dc1c9 a
47 47 --- a/a
48 48 +++ b/a
49 49 @@ -1,1 +1,1 @@
50 50 -foo
51 51 +barber
52 52
53 53 $ chmod +w .
54 54
55 55 $ chmod +w .hg/store/data/a.i
56 56 $ mkdir dir
57 57 $ touch dir/a
58 58 $ hg status
59 59 M a
60 60 ? dir/a
61 61 $ chmod -rx dir
62 62 $ hg status
63 63 dir: Permission denied
64 64 M a
65 65
66 66 Reenable perm to allow deletion:
67 67
68 68 $ chmod +rx dir
69 69
@@ -1,709 +1,699 b''
1 1 $ echo "[extensions]" >> $HGRCPATH
2 2 $ echo "graphlog=" >> $HGRCPATH
3 3
4 4 $ mkdir a
5 5 $ cd a
6 6 $ hg init
7 7 $ echo foo > t1
8 8 $ hg add t1
9 9 $ hg commit -m "1"
10 10
11 11 $ cd ..
12 12 $ hg clone a b
13 13 updating to branch default
14 14 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
15 15
16 16 $ cd a
17 17 $ echo foo > t2
18 18 $ hg add t2
19 19 $ hg commit -m "2"
20 20
21 21 $ cd ../b
22 22 $ echo foo > t3
23 23 $ hg add t3
24 24 $ hg commit -m "3"
25 25
26 26 $ hg push ../a
27 27 pushing to ../a
28 28 searching for changes
29 29 abort: push creates new remote heads on branch 'default'!
30 30 (you should pull and merge or use push -f to force)
31 31 [255]
32 32
33 33 $ hg pull ../a
34 34 pulling from ../a
35 35 searching for changes
36 36 adding changesets
37 37 adding manifests
38 38 adding file changes
39 39 added 1 changesets with 1 changes to 1 files (+1 heads)
40 40 (run 'hg heads' to see heads, 'hg merge' to merge)
41 41
42 42 $ hg push ../a
43 43 pushing to ../a
44 44 searching for changes
45 45 abort: push creates new remote heads on branch 'default'!
46 46 (did you forget to merge? use push -f to force)
47 47 [255]
48 48
49 49 $ hg merge
50 50 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
51 51 (branch merge, don't forget to commit)
52 52
53 53 $ hg commit -m "4"
54 54 $ hg push ../a
55 55 pushing to ../a
56 56 searching for changes
57 57 adding changesets
58 58 adding manifests
59 59 adding file changes
60 60 added 2 changesets with 1 changes to 1 files
61 61
62 62 $ cd ..
63 63
64 64 $ hg init c
65 65 $ cd c
66 66 $ for i in 0 1 2; do
67 67 > echo $i >> foo
68 68 > hg ci -Am $i
69 69 > done
70 70 adding foo
71 71 $ cd ..
72 72
73 73 $ hg clone c d
74 74 updating to branch default
75 75 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
76 76
77 77 $ cd d
78 78 $ for i in 0 1; do
79 79 > hg co -C $i
80 80 > echo d-$i >> foo
81 81 > hg ci -m d-$i
82 82 > done
83 83 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
84 84 created new head
85 85 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
86 86 created new head
87 87
88 88 $ HGMERGE=true hg merge 3
89 89 merging foo
90 90 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
91 91 (branch merge, don't forget to commit)
92 92
93 93 $ hg ci -m c-d
94 94
95 $ hg push ../c; echo $?
95 $ hg push ../c
96 96 pushing to ../c
97 97 searching for changes
98 98 abort: push creates new remote heads on branch 'default'!
99 99 (did you forget to merge? use push -f to force)
100 255
100 [255]
101 101
102 $ hg push -r 2 ../c; echo $?
102 $ hg push -r 2 ../c
103 103 pushing to ../c
104 104 searching for changes
105 105 no changes found
106 0
107 106
108 $ hg push -r 3 ../c; echo $?
107 $ hg push -r 3 ../c
109 108 pushing to ../c
110 109 searching for changes
111 110 abort: push creates new remote heads on branch 'default'!
112 111 (did you forget to merge? use push -f to force)
113 255
112 [255]
114 113
115 $ hg push -r 3 -r 4 ../c; echo $?
114 $ hg push -r 3 -r 4 ../c
116 115 pushing to ../c
117 116 searching for changes
118 117 abort: push creates new remote heads on branch 'default'!
119 118 (did you forget to merge? use push -f to force)
120 255
119 [255]
121 120
122 $ hg push -f -r 3 -r 4 ../c; echo $?
121 $ hg push -f -r 3 -r 4 ../c
123 122 pushing to ../c
124 123 searching for changes
125 124 adding changesets
126 125 adding manifests
127 126 adding file changes
128 127 added 2 changesets with 2 changes to 1 files (+2 heads)
129 0
130 128
131 $ hg push -r 5 ../c; echo $?
129 $ hg push -r 5 ../c
132 130 pushing to ../c
133 131 searching for changes
134 132 adding changesets
135 133 adding manifests
136 134 adding file changes
137 135 added 1 changesets with 1 changes to 1 files (-1 heads)
138 0
139 136
140 137 $ hg in ../c
141 138 comparing with ../c
142 139 searching for changes
143 140 no changes found
144 141 [1]
145 142
146 143
147 144 Issue 450:
148 145
149 146 $ hg init ../e
150 $ hg push -r 0 ../e ; echo $?
147 $ hg push -r 0 ../e
151 148 pushing to ../e
152 149 searching for changes
153 150 adding changesets
154 151 adding manifests
155 152 adding file changes
156 153 added 1 changesets with 1 changes to 1 files
157 0
158 154
159 $ hg push -r 1 ../e ; echo $?
155 $ hg push -r 1 ../e
160 156 pushing to ../e
161 157 searching for changes
162 158 adding changesets
163 159 adding manifests
164 160 adding file changes
165 161 added 1 changesets with 1 changes to 1 files
166 0
167 162
168 163 $ cd ..
169 164
170 165
171 166 Issue 736:
172 167
173 168 $ hg init f
174 169 $ cd f
175 170 $ hg -q branch a
176 171 $ echo 0 > foo
177 172 $ hg -q ci -Am 0
178 173 $ echo 1 > foo
179 174 $ hg -q ci -m 1
180 175 $ hg -q up 0
181 176 $ echo 2 > foo
182 177 $ hg -q ci -m 2
183 178 $ hg -q up 0
184 179 $ hg -q branch b
185 180 $ echo 3 > foo
186 181 $ hg -q ci -m 3
187 182 $ cd ..
188 183
189 184 $ hg -q clone f g
190 185 $ cd g
191 186
192 187 Push on existing branch and new branch:
193 188
194 189 $ hg -q up 1
195 190 $ echo 4 > foo
196 191 $ hg -q ci -m 4
197 192 $ hg -q up 0
198 193 $ echo 5 > foo
199 194 $ hg -q branch c
200 195 $ hg -q ci -m 5
201 196
202 $ hg push ../f; echo $?
197 $ hg push ../f
203 198 pushing to ../f
204 199 searching for changes
205 200 abort: push creates new remote branches: c!
206 201 (use 'hg push --new-branch' to create new remote branches)
207 255
202 [255]
208 203
209 $ hg push -r 4 -r 5 ../f; echo $?
204 $ hg push -r 4 -r 5 ../f
210 205 pushing to ../f
211 206 searching for changes
212 207 abort: push creates new remote branches: c!
213 208 (use 'hg push --new-branch' to create new remote branches)
214 255
209 [255]
215 210
216 211
217 212 Multiple new branches:
218 213
219 214 $ hg -q branch d
220 215 $ echo 6 > foo
221 216 $ hg -q ci -m 6
222 217
223 $ hg push ../f; echo $?
218 $ hg push ../f
224 219 pushing to ../f
225 220 searching for changes
226 221 abort: push creates new remote branches: c, d!
227 222 (use 'hg push --new-branch' to create new remote branches)
228 255
223 [255]
229 224
230 $ hg push -r 4 -r 6 ../f; echo $?
225 $ hg push -r 4 -r 6 ../f
231 226 pushing to ../f
232 227 searching for changes
233 228 abort: push creates new remote branches: c, d!
234 229 (use 'hg push --new-branch' to create new remote branches)
235 255
230 [255]
236 231
237 232 $ cd ../g
238 233
239 234
240 235 Fail on multiple head push:
241 236
242 237 $ hg -q up 1
243 238 $ echo 7 > foo
244 239 $ hg -q ci -m 7
245 240
246 $ hg push -r 4 -r 7 ../f; echo $?
241 $ hg push -r 4 -r 7 ../f
247 242 pushing to ../f
248 243 searching for changes
249 244 abort: push creates new remote heads on branch 'a'!
250 245 (did you forget to merge? use push -f to force)
251 255
246 [255]
252 247
253 248 Push replacement head on existing branches:
254 249
255 250 $ hg -q up 3
256 251 $ echo 8 > foo
257 252 $ hg -q ci -m 8
258 253
259 $ hg push -r 7 -r 8 ../f; echo $?
254 $ hg push -r 7 -r 8 ../f
260 255 pushing to ../f
261 256 searching for changes
262 257 adding changesets
263 258 adding manifests
264 259 adding file changes
265 260 added 2 changesets with 2 changes to 1 files
266 0
267 261
268 262
269 263 Merge of branch a to other branch b followed by unrelated push
270 264 on branch a:
271 265
272 266 $ hg -q up 7
273 267 $ HGMERGE=true hg -q merge 8
274 268 $ hg -q ci -m 9
275 269 $ hg -q up 8
276 270 $ echo 10 > foo
277 271 $ hg -q ci -m 10
278 272
279 $ hg push -r 9 ../f; echo $?
273 $ hg push -r 9 ../f
280 274 pushing to ../f
281 275 searching for changes
282 276 adding changesets
283 277 adding manifests
284 278 adding file changes
285 279 added 1 changesets with 1 changes to 1 files (-1 heads)
286 0
287 280
288 $ hg push -r 10 ../f; echo $?
281 $ hg push -r 10 ../f
289 282 pushing to ../f
290 283 searching for changes
291 284 adding changesets
292 285 adding manifests
293 286 adding file changes
294 287 added 1 changesets with 1 changes to 1 files (+1 heads)
295 0
296 288
297 289
298 290 Cheating the counting algorithm:
299 291
300 292 $ hg -q up 9
301 293 $ HGMERGE=true hg -q merge 2
302 294 $ hg -q ci -m 11
303 295 $ hg -q up 1
304 296 $ echo 12 > foo
305 297 $ hg -q ci -m 12
306 298
307 $ hg push -r 11 -r 12 ../f; echo $?
299 $ hg push -r 11 -r 12 ../f
308 300 pushing to ../f
309 301 searching for changes
310 302 adding changesets
311 303 adding manifests
312 304 adding file changes
313 305 added 2 changesets with 2 changes to 1 files
314 0
315 306
316 307
317 308 Failed push of new named branch:
318 309
319 310 $ echo 12 > foo
320 311 $ hg -q ci -m 12a
321 312 [1]
322 313 $ hg -q up 11
323 314 $ echo 13 > foo
324 315 $ hg -q branch e
325 316 $ hg -q ci -m 13d
326 317
327 $ hg push -r 12 -r 13 ../f; echo $?
318 $ hg push -r 12 -r 13 ../f
328 319 pushing to ../f
329 320 searching for changes
330 321 abort: push creates new remote branches: e!
331 322 (use 'hg push --new-branch' to create new remote branches)
332 255
323 [255]
333 324
334 325
335 326 Using --new-branch to push new named branch:
336 327
337 $ hg push --new-branch -r 12 -r 13 ../f; echo $?
328 $ hg push --new-branch -r 12 -r 13 ../f
338 329 pushing to ../f
339 330 searching for changes
340 331 adding changesets
341 332 adding manifests
342 333 adding file changes
343 334 added 1 changesets with 1 changes to 1 files
344 0
345 335
346 336
347 337 Checking prepush logic does not allow silently pushing
348 338 multiple new heads:
349 339
350 340 $ cd ..
351 341 $ hg init h
352 342 $ echo init > h/init
353 343 $ hg -R h ci -Am init
354 344 adding init
355 345 $ echo a > h/a
356 346 $ hg -R h ci -Am a
357 347 adding a
358 348 $ hg clone h i
359 349 updating to branch default
360 350 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
361 351 $ hg -R h up 0
362 352 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
363 353 $ echo b > h/b
364 354 $ hg -R h ci -Am b
365 355 adding b
366 356 created new head
367 357 $ hg -R i up 0
368 358 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
369 359 $ echo c > i/c
370 360 $ hg -R i ci -Am c
371 361 adding c
372 362 created new head
373 363
374 364 $ hg -R i push h
375 365 pushing to h
376 366 searching for changes
377 367 abort: push creates new remote heads on branch 'default'!
378 368 (you should pull and merge or use push -f to force)
379 369 [255]
380 370
381 371
382 372 Check prepush logic with merged branches:
383 373
384 374 $ hg init j
385 375 $ hg -R j branch a
386 376 marked working directory as branch a
387 377 $ echo init > j/foo
388 378 $ hg -R j ci -Am init
389 379 adding foo
390 380 $ hg clone j k
391 381 updating to branch a
392 382 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
393 383 $ echo a1 > j/foo
394 384 $ hg -R j ci -m a1
395 385 $ hg -R k branch b
396 386 marked working directory as branch b
397 387 $ echo b > k/foo
398 388 $ hg -R k ci -m b
399 389 $ hg -R k up 0
400 390 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
401 391
402 392 $ hg -R k merge b
403 393 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
404 394 (branch merge, don't forget to commit)
405 395
406 396 $ hg -R k ci -m merge
407 397
408 398 $ hg -R k push -r a j
409 399 pushing to j
410 400 searching for changes
411 401 abort: push creates new remote branches: b!
412 402 (use 'hg push --new-branch' to create new remote branches)
413 403 [255]
414 404
415 405
416 406 Prepush -r should not allow you to sneak in new heads:
417 407
418 408 $ hg init l
419 409 $ cd l
420 410 $ echo a >> foo
421 411 $ hg -q add foo
422 412 $ hg -q branch a
423 413 $ hg -q ci -ma
424 414 $ hg -q up null
425 415 $ echo a >> foo
426 416 $ hg -q add foo
427 417 $ hg -q branch b
428 418 $ hg -q ci -mb
429 419 $ cd ..
430 420 $ hg -q clone l m -u a
431 421 $ cd m
432 422 $ hg -q merge b
433 423 $ hg -q ci -mmb
434 424 $ hg -q up 0
435 425 $ echo a >> foo
436 426 $ hg -q ci -ma2
437 427 $ hg -q up 2
438 428 $ echo a >> foo
439 429 $ hg -q branch -f b
440 430 $ hg -q ci -mb2
441 431 $ hg -q merge 3
442 432 $ hg -q ci -mma
443 433
444 434 $ hg push ../l -b b
445 435 pushing to ../l
446 436 searching for changes
447 437 abort: push creates new remote heads on branch 'a'!
448 438 (did you forget to merge? use push -f to force)
449 439 [255]
450 440
451 441 $ cd ..
452 442
453 443
454 444 Check prepush with new branch head on former topo non-head:
455 445
456 446 $ hg init n
457 447 $ cd n
458 448 $ hg branch A
459 449 marked working directory as branch A
460 450 $ echo a >a
461 451 $ hg ci -Ama
462 452 adding a
463 453 $ hg branch B
464 454 marked working directory as branch B
465 455 $ echo b >b
466 456 $ hg ci -Amb
467 457 adding b
468 458
469 459 b is now branch head of B, and a topological head
470 460 a is now branch head of A, but not a topological head
471 461
472 462 $ hg clone . inner
473 463 updating to branch B
474 464 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
475 465 $ cd inner
476 466 $ hg up B
477 467 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
478 468 $ echo b1 >b1
479 469 $ hg ci -Amb1
480 470 adding b1
481 471
482 472 in the clone b1 is now the head of B
483 473
484 474 $ cd ..
485 475 $ hg up 0
486 476 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
487 477 $ echo a2 >a2
488 478 $ hg ci -Ama2
489 479 adding a2
490 480
491 481 a2 is now the new branch head of A, and a new topological head
492 482 it replaces a former inner branch head, so it should at most warn about
493 483 A, not B
494 484
495 485 glog of local:
496 486
497 487 $ hg glog --template "{rev}: {branches} {desc}\n"
498 488 @ 2: A a2
499 489 |
500 490 | o 1: B b
501 491 |/
502 492 o 0: A a
503 493
504 494 glog of remote:
505 495
506 496 $ hg glog -R inner --template "{rev}: {branches} {desc}\n"
507 497 @ 2: B b1
508 498 |
509 499 o 1: B b
510 500 |
511 501 o 0: A a
512 502
513 503 outgoing:
514 504
515 505 $ hg out inner --template "{rev}: {branches} {desc}\n"
516 506 comparing with inner
517 507 searching for changes
518 508 2: A a2
519 509
520 510 $ hg push inner
521 511 pushing to inner
522 512 searching for changes
523 513 adding changesets
524 514 adding manifests
525 515 adding file changes
526 516 added 1 changesets with 1 changes to 1 files (+1 heads)
527 517
528 518 $ cd ..
529 519
530 520
531 521 Check prepush with new branch head on former topo head:
532 522
533 523 $ hg init o
534 524 $ cd o
535 525 $ hg branch A
536 526 marked working directory as branch A
537 527 $ echo a >a
538 528 $ hg ci -Ama
539 529 adding a
540 530 $ hg branch B
541 531 marked working directory as branch B
542 532 $ echo b >b
543 533 $ hg ci -Amb
544 534 adding b
545 535
546 536 b is now branch head of B, and a topological head
547 537
548 538 $ hg up 0
549 539 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
550 540 $ echo a1 >a1
551 541 $ hg ci -Ama1
552 542 adding a1
553 543
554 544 a1 is now branch head of A, and a topological head
555 545
556 546 $ hg clone . inner
557 547 updating to branch A
558 548 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
559 549 $ cd inner
560 550 $ hg up B
561 551 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
562 552 $ echo b1 >b1
563 553 $ hg ci -Amb1
564 554 adding b1
565 555
566 556 in the clone b1 is now the head of B
567 557
568 558 $ cd ..
569 559 $ echo a2 >a2
570 560 $ hg ci -Ama2
571 561 adding a2
572 562
573 563 a2 is now the new branch head of A, and a topological head
574 564 it replaces a former topological and branch head, so this should not warn
575 565
576 566 glog of local:
577 567
578 568 $ hg glog --template "{rev}: {branches} {desc}\n"
579 569 @ 3: A a2
580 570 |
581 571 o 2: A a1
582 572 |
583 573 | o 1: B b
584 574 |/
585 575 o 0: A a
586 576
587 577 glog of remote:
588 578
589 579 $ hg glog -R inner --template "{rev}: {branches} {desc}\n"
590 580 @ 3: B b1
591 581 |
592 582 | o 2: A a1
593 583 | |
594 584 o | 1: B b
595 585 |/
596 586 o 0: A a
597 587
598 588 outgoing:
599 589
600 590 $ hg out inner --template "{rev}: {branches} {desc}\n"
601 591 comparing with inner
602 592 searching for changes
603 593 3: A a2
604 594
605 595 $ hg push inner
606 596 pushing to inner
607 597 searching for changes
608 598 adding changesets
609 599 adding manifests
610 600 adding file changes
611 601 added 1 changesets with 1 changes to 1 files
612 602
613 603 $ cd ..
614 604
615 605
616 606 Check prepush with new branch head and new child of former branch head
617 607 but child is on different branch:
618 608
619 609 $ hg init p
620 610 $ cd p
621 611 $ hg branch A
622 612 marked working directory as branch A
623 613 $ echo a0 >a
624 614 $ hg ci -Ama0
625 615 adding a
626 616 $ echo a1 >a
627 617 $ hg ci -ma1
628 618 $ hg up null
629 619 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
630 620 $ hg branch B
631 621 marked working directory as branch B
632 622 $ echo b0 >b
633 623 $ hg ci -Amb0
634 624 adding b
635 625 $ echo b1 >b
636 626 $ hg ci -mb1
637 627
638 628 $ hg clone . inner
639 629 updating to branch B
640 630 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
641 631
642 632 $ hg up A
643 633 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
644 634 $ hg branch -f B
645 635 marked working directory as branch B
646 636 $ echo a3 >a
647 637 $ hg ci -ma3
648 638 created new head
649 639 $ hg up 3
650 640 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
651 641 $ hg branch -f A
652 642 marked working directory as branch A
653 643 $ echo b3 >b
654 644 $ hg ci -mb3
655 645 created new head
656 646
657 647 glog of local:
658 648
659 649 $ hg glog --template "{rev}: {branches} {desc}\n"
660 650 @ 5: A b3
661 651 |
662 652 | o 4: B a3
663 653 | |
664 654 o | 3: B b1
665 655 | |
666 656 o | 2: B b0
667 657 /
668 658 o 1: A a1
669 659 |
670 660 o 0: A a0
671 661
672 662 glog of remote:
673 663
674 664 $ hg glog -R inner --template "{rev}: {branches} {desc}\n"
675 665 @ 3: B b1
676 666 |
677 667 o 2: B b0
678 668
679 669 o 1: A a1
680 670 |
681 671 o 0: A a0
682 672
683 673 outgoing:
684 674
685 675 $ hg out inner --template "{rev}: {branches} {desc}\n"
686 676 comparing with inner
687 677 searching for changes
688 678 4: B a3
689 679 5: A b3
690 680
691 681 $ hg push inner
692 682 pushing to inner
693 683 searching for changes
694 684 abort: push creates new remote heads on branch 'A'!
695 685 (did you forget to merge? use push -f to force)
696 686 [255]
697 687
698 688 $ hg push inner -r4 -r5
699 689 pushing to inner
700 690 searching for changes
701 691 abort: push creates new remote heads on branch 'A'!
702 692 (did you forget to merge? use push -f to force)
703 693 [255]
704 694
705 695 $ hg in inner
706 696 comparing with inner
707 697 searching for changes
708 698 no changes found
709 699 [1]
@@ -1,256 +1,256 b''
1 1 $ remove() {
2 2 > hg rm $@
3 > echo "exit code: $?"
3 > echo "exit code: $?" # no-check-code
4 4 > hg st
5 5 > # do not use ls -R, which recurses in .hg subdirs on Mac OS X 10.5
6 6 > find . -name .hg -prune -o -type f -print | sort
7 7 > hg up -C
8 8 > }
9 9
10 10 $ hg init a
11 11 $ cd a
12 12 $ echo a > foo
13 13
14 14 file not managed
15 15
16 16 $ remove foo
17 17 not removing foo: file is untracked
18 18 exit code: 1
19 19 ? foo
20 20 ./foo
21 21 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
22 22
23 23 $ hg add foo
24 24 $ hg commit -m1
25 25
26 26 the table cases
27 27 00 state added, options none
28 28
29 29 $ echo b > bar
30 30 $ hg add bar
31 31 $ remove bar
32 32 not removing bar: file has been marked for add (use -f to force removal)
33 33 exit code: 1
34 34 A bar
35 35 ./bar
36 36 ./foo
37 37 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 38
39 39 01 state clean, options none
40 40
41 41 $ remove foo
42 42 exit code: 0
43 43 R foo
44 44 ? bar
45 45 ./bar
46 46 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
47 47
48 48 02 state modified, options none
49 49
50 50 $ echo b >> foo
51 51 $ remove foo
52 52 not removing foo: file is modified (use -f to force removal)
53 53 exit code: 1
54 54 M foo
55 55 ? bar
56 56 ./bar
57 57 ./foo
58 58 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
59 59
60 60 03 state missing, options none
61 61
62 62 $ rm foo
63 63 $ remove foo
64 64 exit code: 0
65 65 R foo
66 66 ? bar
67 67 ./bar
68 68 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
69 69
70 70 10 state added, options -f
71 71
72 72 $ echo b > bar
73 73 $ hg add bar
74 74 $ remove -f bar
75 75 exit code: 0
76 76 ? bar
77 77 ./bar
78 78 ./foo
79 79 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
80 80 $ rm bar
81 81
82 82 11 state clean, options -f
83 83
84 84 $ remove -f foo
85 85 exit code: 0
86 86 R foo
87 87 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
88 88
89 89 12 state modified, options -f
90 90
91 91 $ echo b >> foo
92 92 $ remove -f foo
93 93 exit code: 0
94 94 R foo
95 95 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
96 96
97 97 13 state missing, options -f
98 98
99 99 $ rm foo
100 100 $ remove -f foo
101 101 exit code: 0
102 102 R foo
103 103 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
104 104
105 105 20 state added, options -A
106 106
107 107 $ echo b > bar
108 108 $ hg add bar
109 109 $ remove -A bar
110 110 not removing bar: file still exists (use -f to force removal)
111 111 exit code: 1
112 112 A bar
113 113 ./bar
114 114 ./foo
115 115 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
116 116
117 117 21 state clean, options -A
118 118
119 119 $ remove -A foo
120 120 not removing foo: file still exists (use -f to force removal)
121 121 exit code: 1
122 122 ? bar
123 123 ./bar
124 124 ./foo
125 125 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
126 126
127 127 22 state modified, options -A
128 128
129 129 $ echo b >> foo
130 130 $ remove -A foo
131 131 not removing foo: file still exists (use -f to force removal)
132 132 exit code: 1
133 133 M foo
134 134 ? bar
135 135 ./bar
136 136 ./foo
137 137 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
138 138
139 139 23 state missing, options -A
140 140
141 141 $ rm foo
142 142 $ remove -A foo
143 143 exit code: 0
144 144 R foo
145 145 ? bar
146 146 ./bar
147 147 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
148 148
149 149 30 state added, options -Af
150 150
151 151 $ echo b > bar
152 152 $ hg add bar
153 153 $ remove -Af bar
154 154 exit code: 0
155 155 ? bar
156 156 ./bar
157 157 ./foo
158 158 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
159 159 $ rm bar
160 160
161 161 31 state clean, options -Af
162 162
163 163 $ remove -Af foo
164 164 exit code: 0
165 165 R foo
166 166 ./foo
167 167 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
168 168
169 169 32 state modified, options -Af
170 170
171 171 $ echo b >> foo
172 172 $ remove -Af foo
173 173 exit code: 0
174 174 R foo
175 175 ./foo
176 176 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
177 177
178 178 33 state missing, options -Af
179 179
180 180 $ rm foo
181 181 $ remove -Af foo
182 182 exit code: 0
183 183 R foo
184 184 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
185 185
186 186 test some directory stuff
187 187
188 188 $ mkdir test
189 189 $ echo a > test/foo
190 190 $ echo b > test/bar
191 191 $ hg ci -Am2
192 192 adding test/bar
193 193 adding test/foo
194 194
195 195 dir, options none
196 196
197 197 $ rm test/bar
198 198 $ remove test
199 199 removing test/bar
200 200 removing test/foo
201 201 exit code: 0
202 202 R test/bar
203 203 R test/foo
204 204 ./foo
205 205 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
206 206
207 207 dir, options -f
208 208
209 209 $ rm test/bar
210 210 $ remove -f test
211 211 removing test/bar
212 212 removing test/foo
213 213 exit code: 0
214 214 R test/bar
215 215 R test/foo
216 216 ./foo
217 217 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
218 218
219 219 dir, options -A
220 220
221 221 $ rm test/bar
222 222 $ remove -A test
223 223 not removing test/foo: file still exists (use -f to force removal)
224 224 removing test/bar
225 225 exit code: 1
226 226 R test/bar
227 227 ./foo
228 228 ./test/foo
229 229 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
230 230
231 231 dir, options -Af
232 232
233 233 $ rm test/bar
234 234 $ remove -Af test
235 235 removing test/bar
236 236 removing test/foo
237 237 exit code: 0
238 238 R test/bar
239 239 R test/foo
240 240 ./foo
241 241 ./test/foo
242 242 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
243 243
244 244 test remove dropping empty trees (issue1861)
245 245
246 246 $ mkdir -p issue1861/b/c
247 247 $ echo x > issue1861/x
248 248 $ echo y > issue1861/b/c/y
249 249 $ hg ci -Am add
250 250 adding issue1861/b/c/y
251 251 adding issue1861/x
252 252 $ hg rm issue1861/b
253 253 removing issue1861/b/c/y
254 254 $ hg ci -m remove
255 255 $ ls issue1861
256 256 x
@@ -1,54 +1,52 b''
1 $ set -e
2
3 1 $ mkdir test
4 2 $ cd test
5 3 $ echo foo>foo
6 4 $ hg init
7 5 $ hg addremove
8 6 adding foo
9 7 $ hg commit -m "1"
10 8
11 9 $ hg verify
12 10 checking changesets
13 11 checking manifests
14 12 crosschecking files in changesets and manifests
15 13 checking files
16 14 1 files, 1 changesets, 1 total revisions
17 15
18 16 $ hg clone . ../branch
19 17 updating to branch default
20 18 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
21 19 $ cd ../branch
22 20 $ hg co
23 21 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
24 22 $ echo bar>>foo
25 23 $ hg commit -m "2"
26 24
27 25 $ cd ../test
28 26
29 27 $ hg pull ../branch
30 28 pulling from ../branch
31 29 searching for changes
32 30 adding changesets
33 31 adding manifests
34 32 adding file changes
35 33 added 1 changesets with 1 changes to 1 files
36 34 (run 'hg update' to get a working copy)
37 35
38 36 $ hg verify
39 37 checking changesets
40 38 checking manifests
41 39 crosschecking files in changesets and manifests
42 40 checking files
43 41 1 files, 2 changesets, 2 total revisions
44 42
45 43 $ hg co
46 44 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
47 45
48 46 $ cat foo
49 47 foo
50 48 bar
51 49
52 50 $ hg manifest --debug
53 51 6f4310b00b9a147241b071a60c28a650827fb03d 644 foo
54 52
@@ -1,280 +1,279 b''
1 1 $ echo "[extensions]" >> $HGRCPATH
2 2 $ echo "color=" >> $HGRCPATH
3 3 $ echo "[color]" >> $HGRCPATH
4 4 $ echo "mode=ansi" >> $HGRCPATH
5 5
6 6 $ hg init repo1
7 7 $ cd repo1
8 8 $ mkdir a b a/1 b/1 b/2
9 9 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
10 10
11 11 hg status in repo root:
12 12
13 13 $ hg status --color=always
14 14 ? a/1/in_a_1
15 15 ? a/in_a
16 16 ? b/1/in_b_1
17 17 ? b/2/in_b_2
18 18 ? b/in_b
19 19 ? in_root
20 20
21 21 hg status . in repo root:
22 22
23 23 $ hg status --color=always .
24 24 ? a/1/in_a_1
25 25 ? a/in_a
26 26 ? b/1/in_b_1
27 27 ? b/2/in_b_2
28 28 ? b/in_b
29 29 ? in_root
30 30
31 31 $ hg status --color=always --cwd a
32 32 ? a/1/in_a_1
33 33 ? a/in_a
34 34 ? b/1/in_b_1
35 35 ? b/2/in_b_2
36 36 ? b/in_b
37 37 ? in_root
38 38 $ hg status --color=always --cwd a .
39 39 ? 1/in_a_1
40 40 ? in_a
41 41 $ hg status --color=always --cwd a ..
42 42 ? 1/in_a_1
43 43 ? in_a
44 44 ? ../b/1/in_b_1
45 45 ? ../b/2/in_b_2
46 46 ? ../b/in_b
47 47 ? ../in_root
48 48
49 49 $ hg status --color=always --cwd b
50 50 ? a/1/in_a_1
51 51 ? a/in_a
52 52 ? b/1/in_b_1
53 53 ? b/2/in_b_2
54 54 ? b/in_b
55 55 ? in_root
56 56 $ hg status --color=always --cwd b .
57 57 ? 1/in_b_1
58 58 ? 2/in_b_2
59 59 ? in_b
60 60 $ hg status --color=always --cwd b ..
61 61 ? ../a/1/in_a_1
62 62 ? ../a/in_a
63 63 ? 1/in_b_1
64 64 ? 2/in_b_2
65 65 ? in_b
66 66 ? ../in_root
67 67
68 68 $ hg status --color=always --cwd a/1
69 69 ? a/1/in_a_1
70 70 ? a/in_a
71 71 ? b/1/in_b_1
72 72 ? b/2/in_b_2
73 73 ? b/in_b
74 74 ? in_root
75 75 $ hg status --color=always --cwd a/1 .
76 76 ? in_a_1
77 77 $ hg status --color=always --cwd a/1 ..
78 78 ? in_a_1
79 79 ? ../in_a
80 80
81 81 $ hg status --color=always --cwd b/1
82 82 ? a/1/in_a_1
83 83 ? a/in_a
84 84 ? b/1/in_b_1
85 85 ? b/2/in_b_2
86 86 ? b/in_b
87 87 ? in_root
88 88 $ hg status --color=always --cwd b/1 .
89 89 ? in_b_1
90 90 $ hg status --color=always --cwd b/1 ..
91 91 ? in_b_1
92 92 ? ../2/in_b_2
93 93 ? ../in_b
94 94
95 95 $ hg status --color=always --cwd b/2
96 96 ? a/1/in_a_1
97 97 ? a/in_a
98 98 ? b/1/in_b_1
99 99 ? b/2/in_b_2
100 100 ? b/in_b
101 101 ? in_root
102 102 $ hg status --color=always --cwd b/2 .
103 103 ? in_b_2
104 104 $ hg status --color=always --cwd b/2 ..
105 105 ? ../1/in_b_1
106 106 ? in_b_2
107 107 ? ../in_b
108 108 $ cd ..
109 109
110 110 $ hg init repo2
111 111 $ cd repo2
112 112 $ touch modified removed deleted ignored
113 113 $ echo "^ignored$" > .hgignore
114 114 $ hg ci -A -m 'initial checkin'
115 115 adding .hgignore
116 116 adding deleted
117 117 adding modified
118 118 adding removed
119 119 $ touch modified added unknown ignored
120 120 $ hg add added
121 121 $ hg remove removed
122 122 $ rm deleted
123 123
124 124 hg status:
125 125
126 126 $ hg status --color=always
127 127 A added
128 128 R removed
129 129 ! deleted
130 130 ? unknown
131 131
132 132 hg status modified added removed deleted unknown never-existed ignored:
133 133
134 134 $ hg status --color=always modified added removed deleted unknown never-existed ignored
135 135 never-existed: No such file or directory
136 136 A added
137 137 R removed
138 138 ! deleted
139 139 ? unknown
140 140
141 141 $ hg copy modified copied
142 142
143 143 hg status -C:
144 144
145 145 $ hg status --color=always -C
146 146 A added
147 147 A copied
148 148  modified
149 149 R removed
150 150 ! deleted
151 151 ? unknown
152 152
153 153 hg status -A:
154 154
155 155 $ hg status --color=always -A
156 156 A added
157 157 A copied
158 158  modified
159 159 R removed
160 160 ! deleted
161 161 ? unknown
162 162 I ignored
163 163 C .hgignore
164 164 C modified
165 165
166 166
167 167 $ echo "^ignoreddir$" > .hgignore
168 168 $ mkdir ignoreddir
169 169 $ touch ignoreddir/file
170 170
171 171 hg status ignoreddir/file:
172 172
173 173 $ hg status --color=always ignoreddir/file
174 174
175 175 hg status -i ignoreddir/file:
176 176
177 177 $ hg status --color=always -i ignoreddir/file
178 178 I ignoreddir/file
179 179 $ cd ..
180 180
181 181 check 'status -q' and some combinations
182 182
183 183 $ hg init repo3
184 184 $ cd repo3
185 185 $ touch modified removed deleted ignored
186 186 $ echo "^ignored$" > .hgignore
187 187 $ hg commit -A -m 'initial checkin'
188 188 adding .hgignore
189 189 adding deleted
190 190 adding modified
191 191 adding removed
192 192 $ touch added unknown ignored
193 193 $ hg add added
194 194 $ echo "test" >> modified
195 195 $ hg remove removed
196 196 $ rm deleted
197 197 $ hg copy modified copied
198 198
199 199 test unknown color
200 200
201 201 $ hg --config color.status.modified=periwinkle status --color=always
202 202 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
203 203 M modified
204 204 A added
205 205 A copied
206 206 R removed
207 207 ! deleted
208 208 ? unknown
209 209
210 210 Run status with 2 different flags.
211 211 Check if result is the same or different.
212 212 If result is not as expected, raise error
213 213
214 214 $ assert() {
215 215 > hg status --color=always $1 > ../a
216 216 > hg status --color=always $2 > ../b
217 > out=`diff ../a ../b`
218 > if [ $? -ne 0 ]; then
217 > if diff ../a ../b > /dev/null; then
218 > out=0
219 > else
219 220 > out=1
220 > else
221 > out=0
222 221 > fi
223 222 > if [ $3 -eq 0 ]; then
224 223 > df="same"
225 224 > else
226 225 > df="different"
227 226 > fi
228 227 > if [ $out -ne $3 ]; then
229 228 > echo "Error on $1 and $2, should be $df."
230 229 > fi
231 230 > }
232 231
233 232 assert flag1 flag2 [0-same | 1-different]
234 233
235 234 $ assert "-q" "-mard" 0
236 235 $ assert "-A" "-marduicC" 0
237 236 $ assert "-qA" "-mardcC" 0
238 237 $ assert "-qAui" "-A" 0
239 238 $ assert "-qAu" "-marducC" 0
240 239 $ assert "-qAi" "-mardicC" 0
241 240 $ assert "-qu" "-u" 0
242 241 $ assert "-q" "-u" 1
243 242 $ assert "-m" "-a" 1
244 243 $ assert "-r" "-d" 1
245 244 $ cd ..
246 245
247 246 test 'resolve -l'
248 247
249 248 $ hg init repo4
250 249 $ cd repo4
251 250 $ echo "file a" > a
252 251 $ echo "file b" > b
253 252 $ hg add a b
254 253 $ hg commit -m "initial"
255 254 $ echo "file a change 1" > a
256 255 $ echo "file b change 1" > b
257 256 $ hg commit -m "head 1"
258 257 $ hg update 0
259 258 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
260 259 $ echo "file a change 2" > a
261 260 $ echo "file b change 2" > b
262 261 $ hg commit -m "head 2"
263 262 created new head
264 263 $ hg merge
265 264 merging a
266 265 warning: conflicts during merge.
267 266 merging a failed!
268 267 merging b
269 268 warning: conflicts during merge.
270 269 merging b failed!
271 270 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
272 271 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
273 272 [1]
274 273 $ hg resolve -m b
275 274
276 275 hg resolve with one unresolved, one resolved:
277 276
278 277 $ hg resolve --color=always -l
279 278 U a
280 279 R b
@@ -1,275 +1,274 b''
1 1 $ hg init repo1
2 2 $ cd repo1
3 3 $ mkdir a b a/1 b/1 b/2
4 4 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
5 5
6 6 hg status in repo root:
7 7
8 8 $ hg status
9 9 ? a/1/in_a_1
10 10 ? a/in_a
11 11 ? b/1/in_b_1
12 12 ? b/2/in_b_2
13 13 ? b/in_b
14 14 ? in_root
15 15
16 16 hg status . in repo root:
17 17
18 18 $ hg status .
19 19 ? a/1/in_a_1
20 20 ? a/in_a
21 21 ? b/1/in_b_1
22 22 ? b/2/in_b_2
23 23 ? b/in_b
24 24 ? in_root
25 25
26 26 $ hg status --cwd a
27 27 ? a/1/in_a_1
28 28 ? a/in_a
29 29 ? b/1/in_b_1
30 30 ? b/2/in_b_2
31 31 ? b/in_b
32 32 ? in_root
33 33 $ hg status --cwd a .
34 34 ? 1/in_a_1
35 35 ? in_a
36 36 $ hg status --cwd a ..
37 37 ? 1/in_a_1
38 38 ? in_a
39 39 ? ../b/1/in_b_1
40 40 ? ../b/2/in_b_2
41 41 ? ../b/in_b
42 42 ? ../in_root
43 43
44 44 $ hg status --cwd b
45 45 ? a/1/in_a_1
46 46 ? a/in_a
47 47 ? b/1/in_b_1
48 48 ? b/2/in_b_2
49 49 ? b/in_b
50 50 ? in_root
51 51 $ hg status --cwd b .
52 52 ? 1/in_b_1
53 53 ? 2/in_b_2
54 54 ? in_b
55 55 $ hg status --cwd b ..
56 56 ? ../a/1/in_a_1
57 57 ? ../a/in_a
58 58 ? 1/in_b_1
59 59 ? 2/in_b_2
60 60 ? in_b
61 61 ? ../in_root
62 62
63 63 $ hg status --cwd a/1
64 64 ? a/1/in_a_1
65 65 ? a/in_a
66 66 ? b/1/in_b_1
67 67 ? b/2/in_b_2
68 68 ? b/in_b
69 69 ? in_root
70 70 $ hg status --cwd a/1 .
71 71 ? in_a_1
72 72 $ hg status --cwd a/1 ..
73 73 ? in_a_1
74 74 ? ../in_a
75 75
76 76 $ hg status --cwd b/1
77 77 ? a/1/in_a_1
78 78 ? a/in_a
79 79 ? b/1/in_b_1
80 80 ? b/2/in_b_2
81 81 ? b/in_b
82 82 ? in_root
83 83 $ hg status --cwd b/1 .
84 84 ? in_b_1
85 85 $ hg status --cwd b/1 ..
86 86 ? in_b_1
87 87 ? ../2/in_b_2
88 88 ? ../in_b
89 89
90 90 $ hg status --cwd b/2
91 91 ? a/1/in_a_1
92 92 ? a/in_a
93 93 ? b/1/in_b_1
94 94 ? b/2/in_b_2
95 95 ? b/in_b
96 96 ? in_root
97 97 $ hg status --cwd b/2 .
98 98 ? in_b_2
99 99 $ hg status --cwd b/2 ..
100 100 ? ../1/in_b_1
101 101 ? in_b_2
102 102 ? ../in_b
103 103 $ cd ..
104 104
105 105 $ hg init repo2
106 106 $ cd repo2
107 107 $ touch modified removed deleted ignored
108 108 $ echo "^ignored$" > .hgignore
109 109 $ hg ci -A -m 'initial checkin'
110 110 adding .hgignore
111 111 adding deleted
112 112 adding modified
113 113 adding removed
114 114 $ touch modified added unknown ignored
115 115 $ hg add added
116 116 $ hg remove removed
117 117 $ rm deleted
118 118
119 119 hg status:
120 120
121 121 $ hg status
122 122 A added
123 123 R removed
124 124 ! deleted
125 125 ? unknown
126 126
127 127 hg status modified added removed deleted unknown never-existed ignored:
128 128
129 129 $ hg status modified added removed deleted unknown never-existed ignored
130 130 never-existed: No such file or directory
131 131 A added
132 132 R removed
133 133 ! deleted
134 134 ? unknown
135 135
136 136 $ hg copy modified copied
137 137
138 138 hg status -C:
139 139
140 140 $ hg status -C
141 141 A added
142 142 A copied
143 143 modified
144 144 R removed
145 145 ! deleted
146 146 ? unknown
147 147
148 148 hg status -A:
149 149
150 150 $ hg status -A
151 151 A added
152 152 A copied
153 153 modified
154 154 R removed
155 155 ! deleted
156 156 ? unknown
157 157 I ignored
158 158 C .hgignore
159 159 C modified
160 160
161 161
162 162 $ echo "^ignoreddir$" > .hgignore
163 163 $ mkdir ignoreddir
164 164 $ touch ignoreddir/file
165 165
166 166 hg status ignoreddir/file:
167 167
168 168 $ hg status ignoreddir/file
169 169
170 170 hg status -i ignoreddir/file:
171 171
172 172 $ hg status -i ignoreddir/file
173 173 I ignoreddir/file
174 174 $ cd ..
175 175
176 176 Check 'status -q' and some combinations
177 177
178 178 $ hg init repo3
179 179 $ cd repo3
180 180 $ touch modified removed deleted ignored
181 181 $ echo "^ignored$" > .hgignore
182 182 $ hg commit -A -m 'initial checkin'
183 183 adding .hgignore
184 184 adding deleted
185 185 adding modified
186 186 adding removed
187 187 $ touch added unknown ignored
188 188 $ hg add added
189 189 $ echo "test" >> modified
190 190 $ hg remove removed
191 191 $ rm deleted
192 192 $ hg copy modified copied
193 193
194 194 Run status with 2 different flags.
195 195 Check if result is the same or different.
196 196 If result is not as expected, raise error
197 197
198 198 $ assert() {
199 > hg status $1 > ../a
200 > hg status $2 > ../b
201 > out=`diff ../a ../b`
202 > if [ $? -ne 0 ]; then
199 > hg status $1 > ../a
200 > hg status $2 > ../b
201 > if diff ../a ../b > /dev/null; then
202 > out=0
203 > else
203 204 > out=1
204 > else
205 > out=0
206 205 > fi
207 206 > if [ $3 -eq 0 ]; then
208 207 > df="same"
209 208 > else
210 209 > df="different"
211 210 > fi
212 211 > if [ $out -ne $3 ]; then
213 212 > echo "Error on $1 and $2, should be $df."
214 213 > fi
215 214 > }
216 215
217 216 Assert flag1 flag2 [0-same | 1-different]
218 217
219 218 $ assert "-q" "-mard" 0
220 219 $ assert "-A" "-marduicC" 0
221 220 $ assert "-qA" "-mardcC" 0
222 221 $ assert "-qAui" "-A" 0
223 222 $ assert "-qAu" "-marducC" 0
224 223 $ assert "-qAi" "-mardicC" 0
225 224 $ assert "-qu" "-u" 0
226 225 $ assert "-q" "-u" 1
227 226 $ assert "-m" "-a" 1
228 227 $ assert "-r" "-d" 1
229 228 $ cd ..
230 229
231 230 $ hg init repo4
232 231 $ cd repo4
233 232 $ touch modified removed deleted
234 233 $ hg ci -q -A -m 'initial checkin'
235 234 $ touch added unknown
236 235 $ hg add added
237 236 $ hg remove removed
238 237 $ rm deleted
239 238 $ echo x > modified
240 239 $ hg copy modified copied
241 240 $ hg ci -m 'test checkin' -d "1000001 0"
242 241 $ rm *
243 242 $ touch unrelated
244 243 $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0"
245 244
246 245 hg status --change 1:
247 246
248 247 $ hg status --change 1
249 248 M modified
250 249 A added
251 250 A copied
252 251 R removed
253 252
254 253 hg status --change 1 unrelated:
255 254
256 255 $ hg status --change 1 unrelated
257 256
258 257 hg status -C --change 1 added modified copied removed deleted:
259 258
260 259 $ hg status -C --change 1 added modified copied removed deleted
261 260 M modified
262 261 A added
263 262 A copied
264 263 modified
265 264 R removed
266 265
267 266 hg status -A --change 1:
268 267
269 268 $ hg status -A --change 1
270 269 M modified
271 270 A added
272 271 A copied
273 272 modified
274 273 R removed
275 274 C deleted
@@ -1,345 +1,343 b''
1 1 Make status look into subrepositories by default:
2 2
3 3 $ echo '[defaults]' >> $HGRCPATH
4 4 $ echo 'status = -S' >> $HGRCPATH
5 5 $ echo 'diff = --nodates -S' >> $HGRCPATH
6 6
7 7 Create test repository:
8 8
9 9 $ hg init repo
10 10 $ cd repo
11 11 $ echo x1 > x.txt
12 12
13 13 $ hg init foo
14 14 $ cd foo
15 15 $ echo y1 > y.txt
16 16
17 17 $ hg init bar
18 18 $ cd bar
19 19 $ echo z1 > z.txt
20 20
21 21 $ cd ..
22 22 $ echo 'bar = bar' > .hgsub
23 23
24 24 $ cd ..
25 25 $ echo 'foo = foo' > .hgsub
26 26
27 27 Add files --- .hgsub files must go first to trigger subrepos:
28 28
29 29 $ hg add -S .hgsub
30 30 $ hg add -S foo/.hgsub
31 31 $ hg add -S foo/bar
32 32 adding foo/bar/z.txt
33 33 $ hg add -S
34 34 adding x.txt
35 35 adding foo/y.txt
36 36
37 37 Test recursive status without committing anything:
38 38
39 39 $ hg status
40 40 A .hgsub
41 41 A foo/.hgsub
42 42 A foo/bar/z.txt
43 43 A foo/y.txt
44 44 A x.txt
45 45
46 46 Test recursive diff without committing anything:
47 47
48 48 $ hg diff foo
49 49 diff -r 000000000000 foo/.hgsub
50 50 --- /dev/null
51 51 +++ b/foo/.hgsub
52 52 @@ -0,0 +1,1 @@
53 53 +bar = bar
54 54 diff -r 000000000000 foo/y.txt
55 55 --- /dev/null
56 56 +++ b/foo/y.txt
57 57 @@ -0,0 +1,1 @@
58 58 +y1
59 59 diff -r 000000000000 foo/bar/z.txt
60 60 --- /dev/null
61 61 +++ b/foo/bar/z.txt
62 62 @@ -0,0 +1,1 @@
63 63 +z1
64 64
65 65 Commits:
66 66
67 67 $ hg commit -m 0-0-0
68 68 committing subrepository foo
69 69 committing subrepository foo/bar
70 70
71 71 $ cd foo
72 72 $ echo y2 >> y.txt
73 73 $ hg commit -m 0-1-0
74 74
75 75 $ cd bar
76 76 $ echo z2 >> z.txt
77 77 $ hg commit -m 0-1-1
78 78
79 79 $ cd ..
80 80 $ hg commit -m 0-2-1
81 81 committing subrepository bar
82 82
83 83 $ cd ..
84 84 $ hg commit -m 1-2-1
85 85 committing subrepository foo
86 86
87 87 Change working directory:
88 88
89 89 $ echo y3 >> foo/y.txt
90 90 $ echo z3 >> foo/bar/z.txt
91 91 $ hg status
92 92 M foo/bar/z.txt
93 93 M foo/y.txt
94 94 $ hg diff
95 95 diff -r d254738c5f5e foo/y.txt
96 96 --- a/foo/y.txt
97 97 +++ b/foo/y.txt
98 98 @@ -1,2 +1,3 @@
99 99 y1
100 100 y2
101 101 +y3
102 102 diff -r 9647f22de499 foo/bar/z.txt
103 103 --- a/foo/bar/z.txt
104 104 +++ b/foo/bar/z.txt
105 105 @@ -1,2 +1,3 @@
106 106 z1
107 107 z2
108 108 +z3
109 109
110 110 Status call crossing repository boundaries:
111 111
112 112 $ hg status foo/bar/z.txt
113 113 M foo/bar/z.txt
114 114 $ hg status -I 'foo/?.txt'
115 115 M foo/y.txt
116 116 $ hg status -I '**/?.txt'
117 117 M foo/bar/z.txt
118 118 M foo/y.txt
119 119 $ hg diff -I '**/?.txt'
120 120 diff -r d254738c5f5e foo/y.txt
121 121 --- a/foo/y.txt
122 122 +++ b/foo/y.txt
123 123 @@ -1,2 +1,3 @@
124 124 y1
125 125 y2
126 126 +y3
127 127 diff -r 9647f22de499 foo/bar/z.txt
128 128 --- a/foo/bar/z.txt
129 129 +++ b/foo/bar/z.txt
130 130 @@ -1,2 +1,3 @@
131 131 z1
132 132 z2
133 133 +z3
134 134
135 135 Status from within a subdirectory:
136 136
137 137 $ mkdir dir
138 138 $ cd dir
139 139 $ echo a1 > a.txt
140 140 $ hg status
141 141 M foo/bar/z.txt
142 142 M foo/y.txt
143 143 ? dir/a.txt
144 144 $ hg diff
145 145 diff -r d254738c5f5e foo/y.txt
146 146 --- a/foo/y.txt
147 147 +++ b/foo/y.txt
148 148 @@ -1,2 +1,3 @@
149 149 y1
150 150 y2
151 151 +y3
152 152 diff -r 9647f22de499 foo/bar/z.txt
153 153 --- a/foo/bar/z.txt
154 154 +++ b/foo/bar/z.txt
155 155 @@ -1,2 +1,3 @@
156 156 z1
157 157 z2
158 158 +z3
159 159
160 160 Status with relative path:
161 161
162 162 $ hg status ..
163 163 M ../foo/bar/z.txt
164 164 M ../foo/y.txt
165 165 ? a.txt
166 166 $ hg diff ..
167 167 diff -r d254738c5f5e foo/y.txt
168 168 --- a/foo/y.txt
169 169 +++ b/foo/y.txt
170 170 @@ -1,2 +1,3 @@
171 171 y1
172 172 y2
173 173 +y3
174 174 diff -r 9647f22de499 foo/bar/z.txt
175 175 --- a/foo/bar/z.txt
176 176 +++ b/foo/bar/z.txt
177 177 @@ -1,2 +1,3 @@
178 178 z1
179 179 z2
180 180 +z3
181 181 $ cd ..
182 182
183 183 Cleanup and final commit:
184 184
185 185 $ rm -r dir
186 186 $ hg commit -m 2-3-2
187 187 committing subrepository foo
188 188 committing subrepository foo/bar
189 189
190 190 Log with the relationships between repo and its subrepo:
191 191
192 192 $ hg log --template '{rev}:{node|short} {desc}\n'
193 193 2:1326fa26d0c0 2-3-2
194 194 1:4b3c9ff4f66b 1-2-1
195 195 0:23376cbba0d8 0-0-0
196 196
197 197 $ hg -R foo log --template '{rev}:{node|short} {desc}\n'
198 198 3:65903cebad86 2-3-2
199 199 2:d254738c5f5e 0-2-1
200 200 1:8629ce7dcc39 0-1-0
201 201 0:af048e97ade2 0-0-0
202 202
203 203 $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n'
204 204 2:31ecbdafd357 2-3-2
205 205 1:9647f22de499 0-1-1
206 206 0:4904098473f9 0-0-0
207 207
208 208 Status between revisions:
209 209
210 210 $ hg status
211 211 $ hg status --rev 0:1
212 212 M .hgsubstate
213 213 M foo/.hgsubstate
214 214 M foo/bar/z.txt
215 215 M foo/y.txt
216 216 $ hg diff -I '**/?.txt' --rev 0:1
217 217 diff -r af048e97ade2 -r d254738c5f5e foo/y.txt
218 218 --- a/foo/y.txt
219 219 +++ b/foo/y.txt
220 220 @@ -1,1 +1,2 @@
221 221 y1
222 222 +y2
223 223 diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt
224 224 --- a/foo/bar/z.txt
225 225 +++ b/foo/bar/z.txt
226 226 @@ -1,1 +1,2 @@
227 227 z1
228 228 +z2
229 229
230 230 Test archiving to a directory tree:
231 231
232 232 $ hg archive --subrepos ../archive
233 233 $ find ../archive | sort
234 234 ../archive
235 235 ../archive/.hg_archival.txt
236 236 ../archive/.hgsub
237 237 ../archive/.hgsubstate
238 238 ../archive/foo
239 239 ../archive/foo/.hgsub
240 240 ../archive/foo/.hgsubstate
241 241 ../archive/foo/bar
242 242 ../archive/foo/bar/z.txt
243 243 ../archive/foo/y.txt
244 244 ../archive/x.txt
245 245
246 246 Test archiving to zip file (unzip output is unstable):
247 247
248 248 $ hg archive --subrepos ../archive.zip
249 249
250 250 Clone and test outgoing:
251 251
252 252 $ cd ..
253 253 $ hg clone repo repo2
254 254 updating to branch default
255 255 pulling subrepo foo from .*/test-subrepo-recursion.t/repo/foo
256 256 requesting all changes
257 257 adding changesets
258 258 adding manifests
259 259 adding file changes
260 260 added 4 changesets with 7 changes to 3 files
261 261 pulling subrepo foo/bar from .*/test-subrepo-recursion.t/repo/foo/bar
262 262 requesting all changes
263 263 adding changesets
264 264 adding manifests
265 265 adding file changes
266 266 added 3 changesets with 3 changes to 1 files
267 267 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
268 268 $ cd repo2
269 269 $ hg outgoing -S
270 270 comparing with .*/test-subrepo-recursion.t/repo
271 271 searching for changes
272 272 no changes found
273 273 comparing with .*/test-subrepo-recursion.t/repo/foo
274 274 searching for changes
275 275 no changes found
276 276 [1]
277 $ echo $?
278 0
279 277
280 278 Make nested change:
281 279
282 280 $ echo y4 >> foo/y.txt
283 281 $ hg diff
284 282 diff -r 65903cebad86 foo/y.txt
285 283 --- a/foo/y.txt
286 284 +++ b/foo/y.txt
287 285 @@ -1,3 +1,4 @@
288 286 y1
289 287 y2
290 288 y3
291 289 +y4
292 290 $ hg commit -m 3-4-2
293 291 committing subrepository foo
294 292 $ hg outgoing -S
295 293 comparing with .*/test-subrepo-recursion.t/repo
296 294 searching for changes
297 295 changeset: 3:2655b8ecc4ee
298 296 tag: tip
299 297 user: test
300 298 date: Thu Jan 01 00:00:00 1970 +0000
301 299 summary: 3-4-2
302 300
303 301 comparing with .*/test-subrepo-recursion.t/repo/foo
304 302 searching for changes
305 303 changeset: 4:e96193d6cb36
306 304 tag: tip
307 305 user: test
308 306 date: Thu Jan 01 00:00:00 1970 +0000
309 307 summary: 3-4-2
310 308
311 309
312 310 Switch to original repo and setup default path:
313 311
314 312 $ cd ../repo
315 313 $ echo '[paths]' >> .hg/hgrc
316 314 $ echo 'default = ../repo2' >> .hg/hgrc
317 315
318 316 Test incoming:
319 317
320 318 $ hg incoming -S
321 319 comparing with .*/test-subrepo-recursion.t/repo2
322 320 searching for changes
323 321 changeset: 3:2655b8ecc4ee
324 322 tag: tip
325 323 user: test
326 324 date: Thu Jan 01 00:00:00 1970 +0000
327 325 summary: 3-4-2
328 326
329 327 comparing with .*/test-subrepo-recursion.t/repo2/foo
330 328 searching for changes
331 329 changeset: 4:e96193d6cb36
332 330 tag: tip
333 331 user: test
334 332 date: Thu Jan 01 00:00:00 1970 +0000
335 333 summary: 3-4-2
336 334
337 335 $ hg incoming -S --bundle incoming.hg
338 336 abort: cannot combine --bundle and --subrepos
339 337 [255]
340 338
341 339 Test missing subrepo:
342 340
343 341 $ rm -r foo
344 342 $ hg status
345 343 warning: unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98' in foo
@@ -1,206 +1,203 b''
1 1 $ "$TESTDIR/hghave" svn || exit 80
2 2
3 3 $ fix_path()
4 4 > {
5 5 > tr '\\' /
6 6 > }
7 7
8 8 $ escapedwd=`pwd | fix_path`
9 9
10 10 SVN wants all paths to start with a slash. Unfortunately, Windows ones
11 11 don't. Handle that.
12 12
13 $ expr "$escapedwd" : "\/" > /dev/null
14 $ if [ $? -ne 0 ]; then
15 > escapedwd="/$escapedwd"
16 > fi
13 $ expr "$escapedwd" : / > /dev/null || escapedwd="/$escapedwd"
17 14 $ escapedwd=`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$escapedwd"`
18 15 $ filterpath="s|$escapedwd|/root|"
19 16 $ filteroutofdate='s/ in transaction.*/ is out of date/;s/Out of date: /File /'
20 17
21 18 create subversion repo
22 19
23 20 $ SVNREPO="file://$escapedwd/svn-repo"
24 21 $ WCROOT="`pwd`/svn-wc"
25 22 $ svnadmin create svn-repo
26 23 $ svn co "$SVNREPO" svn-wc
27 24 Checked out revision 0.
28 25 $ cd svn-wc
29 26 $ mkdir src
30 27 $ echo alpha > src/alpha
31 28 $ svn add src
32 29 A src
33 30 A src/alpha
34 31 $ mkdir externals
35 32 $ echo other > externals/other
36 33 $ svn add externals
37 34 A externals
38 35 A externals/other
39 36 $ svn ci -m 'Add alpha'
40 37 Adding externals
41 38 Adding externals/other
42 39 Adding src
43 40 Adding src/alpha
44 41 Transmitting file data ..
45 42 Committed revision 1.
46 43 $ svn up
47 44 At revision 1.
48 45 $ echo "externals -r1 $SVNREPO/externals" > extdef
49 46 $ svn propset -F extdef svn:externals src
50 47 property 'svn:externals' set on 'src'
51 48 $ svn ci -m 'Setting externals'
52 49 Sending src
53 50
54 51 Committed revision 2.
55 52 $ cd ..
56 53
57 54 create hg repo
58 55
59 56 $ mkdir sub
60 57 $ cd sub
61 58 $ hg init t
62 59 $ cd t
63 60
64 61 first revision, no sub
65 62
66 63 $ echo a > a
67 64 $ hg ci -Am0
68 65 adding a
69 66
70 67 add first svn sub with leading whitespaces
71 68
72 69 $ echo "s = [svn] $SVNREPO/src" >> .hgsub
73 70 $ svn co --quiet "$SVNREPO"/src s
74 71 $ hg add .hgsub
75 72 $ hg ci -m1
76 73 committing subrepository s
77 74
78 75 debugsub
79 76
80 77 $ hg debugsub | sed "$filterpath"
81 78 path s
82 79 source file:///root/svn-repo/src
83 80 revision 2
84 81
85 82 change file in svn and hg, commit
86 83
87 84 $ echo a >> a
88 85 $ echo alpha >> s/alpha
89 86 $ hg commit -m 'Message!' \
90 87 > | sed 's:Sending.*s/alpha:Sending s/alpha:g'
91 88 committing subrepository s
92 89 Sending s/alpha
93 90 Transmitting file data .
94 91 Committed revision 3.
95 92
96 93 Fetching external item into '.*/s/externals'
97 94 External at revision 1.
98 95
99 96 At revision 3.
100 97 $ hg debugsub | sed "$filterpath"
101 98 path s
102 99 source file:///root/svn-repo/src
103 100 revision 3
104 101
105 102 $ echo a > s/a
106 103
107 104 should be empty despite change to s/a
108 105
109 106 $ hg st
110 107
111 108 add a commit from svn
112 109
113 110 $ cd "$WCROOT"/src
114 111 $ svn up
115 112 U alpha
116 113
117 114 Fetching external item into 'externals'
118 115 A externals/other
119 116 Updated external to revision 1.
120 117
121 118 Updated to revision 3.
122 119 $ echo xyz >> alpha
123 120 $ svn propset svn:mime-type 'text/xml' alpha
124 121 property 'svn:mime-type' set on 'alpha'
125 122 $ svn ci -m 'amend a from svn'
126 123 Sending src/alpha
127 124 Transmitting file data .
128 125 Committed revision 4.
129 126 $ cd ../../sub/t
130 127
131 128 this commit from hg will fail
132 129
133 130 $ echo zzz >> s/alpha
134 131 $ hg ci -m 'amend alpha from hg' 2>&1 | sed "$filteroutofdate"
135 132 committing subrepository s
136 133 abort: svn: Commit failed (details follow):
137 134 svn: File '/src/alpha' is out of date
138 135 $ svn revert -q s/alpha
139 136
140 137 this commit fails because of meta changes
141 138
142 139 $ svn propset svn:mime-type 'text/html' s/alpha
143 140 property 'svn:mime-type' set on 's/alpha'
144 141 $ hg ci -m 'amend alpha from hg' 2>&1 | sed "$filteroutofdate"
145 142 committing subrepository s
146 143 abort: svn: Commit failed (details follow):
147 144 svn: File '/src/alpha' is out of date
148 145 $ svn revert -q s/alpha
149 146
150 147 this commit fails because of externals changes
151 148
152 149 $ echo zzz > s/externals/other
153 150 $ hg ci -m 'amend externals from hg'
154 151 committing subrepository s
155 152 abort: cannot commit svn externals
156 153 [255]
157 154 $ hg diff --subrepos -r 1:2 | grep -v diff
158 155 --- a/.hgsubstate Thu Jan 01 00:00:00 1970 +0000
159 156 +++ b/.hgsubstate Thu Jan 01 00:00:00 1970 +0000
160 157 @@ -1,1 +1,1 @@
161 158 -2 s
162 159 +3 s
163 160 --- a/a Thu Jan 01 00:00:00 1970 +0000
164 161 +++ b/a Thu Jan 01 00:00:00 1970 +0000
165 162 @@ -1,1 +1,2 @@
166 163 a
167 164 +a
168 165 $ svn revert -q s/externals/other
169 166
170 167 this commit fails because of externals meta changes
171 168
172 169 $ svn propset svn:mime-type 'text/html' s/externals/other
173 170 property 'svn:mime-type' set on 's/externals/other'
174 171 $ hg ci -m 'amend externals from hg'
175 172 committing subrepository s
176 173 abort: cannot commit svn externals
177 174 [255]
178 175 $ svn revert -q s/externals/other
179 176
180 177 clone
181 178
182 179 $ cd ..
183 180 $ hg clone t tc | fix_path
184 181 updating to branch default
185 182 A tc/s/alpha
186 183 U tc/s
187 184
188 185 Fetching external item into 'tc/s/externals'
189 186 A tc/s/externals/other
190 187 Checked out external at revision 1.
191 188
192 189 Checked out revision 3.
193 190 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
194 191 $ cd tc
195 192
196 193 debugsub in clone
197 194
198 195 $ hg debugsub | sed "$filterpath"
199 196 path s
200 197 source file:///root/svn-repo/src
201 198 revision 3
202 199
203 200 verify subrepo is contained within the repo directory
204 201
205 202 $ python -c "import os.path; print os.path.exists('s')"
206 203 True
@@ -1,197 +1,197 b''
1 1 $ hg init test
2 2 $ cd test
3 3
4 4 $ echo a > a
5 5 $ hg add a
6 6 $ hg commit -m "test"
7 7 $ hg history
8 8 changeset: 0:acb14030fe0a
9 9 tag: tip
10 10 user: test
11 11 date: Thu Jan 01 00:00:00 1970 +0000
12 12 summary: test
13 13
14 14
15 15 $ hg tag ' '
16 16 abort: tag names cannot consist entirely of whitespace
17 17 [255]
18 18
19 19 $ hg tag "bleah"
20 20 $ hg history
21 21 changeset: 1:d4f0d2909abc
22 22 tag: tip
23 23 user: test
24 24 date: Thu Jan 01 00:00:00 1970 +0000
25 25 summary: Added tag bleah for changeset acb14030fe0a
26 26
27 27 changeset: 0:acb14030fe0a
28 28 tag: bleah
29 29 user: test
30 30 date: Thu Jan 01 00:00:00 1970 +0000
31 31 summary: test
32 32
33 33
34 34 $ echo foo >> .hgtags
35 $ hg tag "bleah2" || echo "failed"
35 $ hg tag "bleah2"
36 36 abort: working copy of .hgtags is changed (please commit .hgtags manually)
37 failed
37 [255]
38 38
39 39 $ hg revert .hgtags
40 $ hg tag -r 0 x y z y y z || echo "failed"
40 $ hg tag -r 0 x y z y y z
41 41 abort: tag names must be unique
42 failed
43 $ hg tag tap nada dot tip null . || echo "failed"
42 [255]
43 $ hg tag tap nada dot tip null .
44 44 abort: the name 'tip' is reserved
45 failed
46 $ hg tag "bleah" || echo "failed"
45 [255]
46 $ hg tag "bleah"
47 47 abort: tag 'bleah' already exists (use -f to force)
48 failed
49 $ hg tag "blecch" "bleah" || echo "failed"
48 [255]
49 $ hg tag "blecch" "bleah"
50 50 abort: tag 'bleah' already exists (use -f to force)
51 failed
51 [255]
52 52
53 $ hg tag --remove "blecch" || echo "failed"
53 $ hg tag --remove "blecch"
54 54 abort: tag 'blecch' does not exist
55 failed
56 $ hg tag --remove "bleah" "blecch" "blough" || echo "failed"
55 [255]
56 $ hg tag --remove "bleah" "blecch" "blough"
57 57 abort: tag 'blecch' does not exist
58 failed
58 [255]
59 59
60 60 $ hg tag -r 0 "bleah0"
61 61 $ hg tag -l -r 1 "bleah1"
62 62 $ hg tag gack gawk gorp
63 63 $ hg tag -f gack
64 64 $ hg tag --remove gack gorp
65 65
66 66 $ cat .hgtags
67 67 acb14030fe0a21b60322c440ad2d20cf7685a376 bleah
68 68 acb14030fe0a21b60322c440ad2d20cf7685a376 bleah0
69 69 336fccc858a4eb69609a291105009e484a6b6b8d gack
70 70 336fccc858a4eb69609a291105009e484a6b6b8d gawk
71 71 336fccc858a4eb69609a291105009e484a6b6b8d gorp
72 72 336fccc858a4eb69609a291105009e484a6b6b8d gack
73 73 799667b6f2d9b957f73fa644a918c2df22bab58f gack
74 74 799667b6f2d9b957f73fa644a918c2df22bab58f gack
75 75 0000000000000000000000000000000000000000 gack
76 76 336fccc858a4eb69609a291105009e484a6b6b8d gorp
77 77 0000000000000000000000000000000000000000 gorp
78 78 $ cat .hg/localtags
79 79 d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1
80 80
81 81 $ hg update 0
82 82 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
83 83 $ hg tag "foobar"
84 84 $ cat .hgtags
85 85 acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
86 86 $ cat .hg/localtags
87 87 d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1
88 88
89 89 $ hg tag -l 'xx
90 90 > newline'
91 91 abort: '\n' cannot be used in a tag name
92 92 [255]
93 93 $ hg tag -l 'xx:xx'
94 94 abort: ':' cannot be used in a tag name
95 95 [255]
96 96
97 97 cloning local tags
98 98
99 99 $ cd ..
100 100 $ hg -R test log -r0:5
101 101 changeset: 0:acb14030fe0a
102 102 tag: bleah
103 103 tag: bleah0
104 104 tag: foobar
105 105 user: test
106 106 date: Thu Jan 01 00:00:00 1970 +0000
107 107 summary: test
108 108
109 109 changeset: 1:d4f0d2909abc
110 110 tag: bleah1
111 111 user: test
112 112 date: Thu Jan 01 00:00:00 1970 +0000
113 113 summary: Added tag bleah for changeset acb14030fe0a
114 114
115 115 changeset: 2:336fccc858a4
116 116 tag: gawk
117 117 user: test
118 118 date: Thu Jan 01 00:00:00 1970 +0000
119 119 summary: Added tag bleah0 for changeset acb14030fe0a
120 120
121 121 changeset: 3:799667b6f2d9
122 122 user: test
123 123 date: Thu Jan 01 00:00:00 1970 +0000
124 124 summary: Added tag gack, gawk, gorp for changeset 336fccc858a4
125 125
126 126 changeset: 4:154eeb7c0138
127 127 user: test
128 128 date: Thu Jan 01 00:00:00 1970 +0000
129 129 summary: Added tag gack for changeset 799667b6f2d9
130 130
131 131 changeset: 5:b4bb47aaff09
132 132 user: test
133 133 date: Thu Jan 01 00:00:00 1970 +0000
134 134 summary: Removed tag gack, gorp
135 135
136 136 $ hg clone -q -rbleah1 test test1
137 137 $ hg -R test1 parents --style=compact
138 138 1[tip] d4f0d2909abc 1970-01-01 00:00 +0000 test
139 139 Added tag bleah for changeset acb14030fe0a
140 140
141 141 $ hg clone -q -r5 test#bleah1 test2
142 142 $ hg -R test2 parents --style=compact
143 143 5[tip] b4bb47aaff09 1970-01-01 00:00 +0000 test
144 144 Removed tag gack, gorp
145 145
146 146 $ hg clone -q -U test#bleah1 test3
147 147 $ hg -R test3 parents --style=compact
148 148
149 149 $ cd test
150 150
151 151 issue 601
152 152
153 153 $ python << EOF
154 154 > f = file('.hg/localtags'); last = f.readlines()[-1][:-1]; f.close()
155 155 > f = file('.hg/localtags', 'w'); f.write(last); f.close()
156 156 > EOF
157 157 $ cat .hg/localtags; echo
158 158 d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1
159 159 $ hg tag -l localnewline
160 160 $ cat .hg/localtags; echo
161 161 d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1
162 162 c2899151f4e76890c602a2597a650a72666681bf localnewline
163 163
164 164
165 165 $ python << EOF
166 166 > f = file('.hgtags'); last = f.readlines()[-1][:-1]; f.close()
167 167 > f = file('.hgtags', 'w'); f.write(last); f.close()
168 168 > EOF
169 169 $ hg ci -m'broken manual edit of .hgtags'
170 170 $ cat .hgtags; echo
171 171 acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
172 172 $ hg tag newline
173 173 $ cat .hgtags; echo
174 174 acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
175 175 a0eea09de1eeec777b46f2085260a373b2fbc293 newline
176 176
177 177
178 178 tag and branch using same name
179 179
180 180 $ hg branch tag-and-branch-same-name
181 181 marked working directory as branch tag-and-branch-same-name
182 182 $ hg ci -m"discouraged"
183 183 $ hg tag tag-and-branch-same-name
184 184 warning: tag tag-and-branch-same-name conflicts with existing branch name
185 185
186 186 test custom commit messages
187 187
188 188 $ cat > $HGTMP/editor <<'__EOF__'
189 189 > #!/bin/sh
190 190 > echo "custom tag message" > "$1"
191 191 > echo "second line" >> "$1"
192 192 > __EOF__
193 193 $ chmod +x "$HGTMP"/editor
194 194 $ HGEDITOR="'$HGTMP'"/editor hg tag custom-tag -e
195 195 $ hg log -l1 --template "{desc}\n"
196 196 custom tag message
197 197 second line
@@ -1,235 +1,235 b''
1 1 $ HGMERGE=true; export HGMERGE
2 2
3 3 $ mkdir r1
4 4 $ cd r1
5 5 $ hg init
6 6 $ echo a > a
7 7 $ hg addremove
8 8 adding a
9 9 $ hg commit -m "1"
10 10
11 11 $ hg clone . ../r2
12 12 updating to branch default
13 13 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
14 14 $ cd ../r2
15 15 $ hg up
16 16 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
17 17 $ echo abc > a
18 18 $ hg diff --nodates
19 19 diff -r c19d34741b0a a
20 20 --- a/a
21 21 +++ b/a
22 22 @@ -1,1 +1,1 @@
23 23 -a
24 24 +abc
25 25
26 26 $ cd ../r1
27 27 $ echo b > b
28 28 $ echo a2 > a
29 29 $ hg addremove
30 30 adding b
31 31 $ hg commit -m "2"
32 32
33 33 $ cd ../r2
34 34 $ hg -q pull ../r1
35 35 $ hg status
36 36 M a
37 37 $ hg parents
38 38 changeset: 0:c19d34741b0a
39 39 user: test
40 40 date: Thu Jan 01 00:00:00 1970 +0000
41 41 summary: 1
42 42
43 43 $ hg --debug up
44 44 searching for copies back to rev 1
45 45 unmatched files in other:
46 46 b
47 47 resolving manifests
48 48 overwrite False partial False
49 49 ancestor c19d34741b0a local c19d34741b0a+ remote 1e71731e6fbb
50 50 a: versions differ -> m
51 51 b: remote created -> g
52 52 preserving a for resolve of a
53 53 updating: a 1/2 files (50.00%)
54 54 picked tool 'true' for a (binary False symlink False)
55 55 merging a
56 56 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
57 57 updating: b 2/2 files (100.00%)
58 58 getting b
59 59 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
60 60 $ hg parents
61 61 changeset: 1:1e71731e6fbb
62 62 tag: tip
63 63 user: test
64 64 date: Thu Jan 01 00:00:00 1970 +0000
65 65 summary: 2
66 66
67 67 $ hg --debug up 0
68 68 resolving manifests
69 69 overwrite False partial False
70 70 ancestor 1e71731e6fbb local 1e71731e6fbb+ remote c19d34741b0a
71 71 a: versions differ -> m
72 72 b: other deleted -> r
73 73 preserving a for resolve of a
74 74 updating: b 1/2 files (50.00%)
75 75 removing b
76 76 updating: a 2/2 files (100.00%)
77 77 picked tool 'true' for a (binary False symlink False)
78 78 merging a
79 79 my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb
80 80 0 files updated, 1 files merged, 1 files removed, 0 files unresolved
81 81 $ hg parents
82 82 changeset: 0:c19d34741b0a
83 83 user: test
84 84 date: Thu Jan 01 00:00:00 1970 +0000
85 85 summary: 1
86 86
87 $ hg --debug merge || echo failed
87 $ hg --debug merge
88 88 abort: there is nothing to merge - use "hg update" instead
89 failed
89 [255]
90 90 $ hg parents
91 91 changeset: 0:c19d34741b0a
92 92 user: test
93 93 date: Thu Jan 01 00:00:00 1970 +0000
94 94 summary: 1
95 95
96 96 $ hg --debug up
97 97 searching for copies back to rev 1
98 98 unmatched files in other:
99 99 b
100 100 resolving manifests
101 101 overwrite False partial False
102 102 ancestor c19d34741b0a local c19d34741b0a+ remote 1e71731e6fbb
103 103 a: versions differ -> m
104 104 b: remote created -> g
105 105 preserving a for resolve of a
106 106 updating: a 1/2 files (50.00%)
107 107 picked tool 'true' for a (binary False symlink False)
108 108 merging a
109 109 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
110 110 updating: b 2/2 files (100.00%)
111 111 getting b
112 112 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
113 113 $ hg parents
114 114 changeset: 1:1e71731e6fbb
115 115 tag: tip
116 116 user: test
117 117 date: Thu Jan 01 00:00:00 1970 +0000
118 118 summary: 2
119 119
120 120 $ hg -v history
121 121 changeset: 1:1e71731e6fbb
122 122 tag: tip
123 123 user: test
124 124 date: Thu Jan 01 00:00:00 1970 +0000
125 125 files: a b
126 126 description:
127 127 2
128 128
129 129
130 130 changeset: 0:c19d34741b0a
131 131 user: test
132 132 date: Thu Jan 01 00:00:00 1970 +0000
133 133 files: a
134 134 description:
135 135 1
136 136
137 137
138 138 $ hg diff --nodates
139 139 diff -r 1e71731e6fbb a
140 140 --- a/a
141 141 +++ b/a
142 142 @@ -1,1 +1,1 @@
143 143 -a2
144 144 +abc
145 145
146 146
147 147 create a second head
148 148
149 149 $ cd ../r1
150 150 $ hg up 0
151 151 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
152 152 $ echo b2 > b
153 153 $ echo a3 > a
154 154 $ hg addremove
155 155 adding b
156 156 $ hg commit -m "3"
157 157 created new head
158 158
159 159 $ cd ../r2
160 160 $ hg -q pull ../r1
161 161 $ hg status
162 162 M a
163 163 $ hg parents
164 164 changeset: 1:1e71731e6fbb
165 165 user: test
166 166 date: Thu Jan 01 00:00:00 1970 +0000
167 167 summary: 2
168 168
169 $ hg --debug up || echo failed
169 $ hg --debug up
170 170 abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)
171 failed
172 $ hg --debug merge || echo failed
171 [255]
172 $ hg --debug merge
173 173 abort: outstanding uncommitted changes (use 'hg status' to list changes)
174 failed
174 [255]
175 175 $ hg --debug merge -f
176 176 searching for copies back to rev 1
177 177 resolving manifests
178 178 overwrite False partial False
179 179 ancestor c19d34741b0a local 1e71731e6fbb+ remote 83c51d0caff4
180 180 a: versions differ -> m
181 181 b: versions differ -> m
182 182 preserving a for resolve of a
183 183 preserving b for resolve of b
184 184 updating: a 1/2 files (50.00%)
185 185 picked tool 'true' for a (binary False symlink False)
186 186 merging a
187 187 my a@1e71731e6fbb+ other a@83c51d0caff4 ancestor a@c19d34741b0a
188 188 updating: b 2/2 files (100.00%)
189 189 picked tool 'true' for b (binary False symlink False)
190 190 merging b
191 191 my b@1e71731e6fbb+ other b@83c51d0caff4 ancestor b@000000000000
192 192 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
193 193 (branch merge, don't forget to commit)
194 194 $ hg parents
195 195 changeset: 1:1e71731e6fbb
196 196 user: test
197 197 date: Thu Jan 01 00:00:00 1970 +0000
198 198 summary: 2
199 199
200 200 changeset: 2:83c51d0caff4
201 201 tag: tip
202 202 parent: 0:c19d34741b0a
203 203 user: test
204 204 date: Thu Jan 01 00:00:00 1970 +0000
205 205 summary: 3
206 206
207 207 $ hg diff --nodates
208 208 diff -r 1e71731e6fbb a
209 209 --- a/a
210 210 +++ b/a
211 211 @@ -1,1 +1,1 @@
212 212 -a2
213 213 +abc
214 214
215 215
216 216 test a local add
217 217
218 218 $ cd ..
219 219 $ hg init a
220 220 $ hg init b
221 221 $ echo a > a/a
222 222 $ echo a > b/a
223 223 $ hg --cwd a commit -A -m a
224 224 adding a
225 225 $ cd b
226 226 $ hg add a
227 227 $ hg pull -u ../a
228 228 pulling from ../a
229 229 requesting all changes
230 230 adding changesets
231 231 adding manifests
232 232 adding file changes
233 233 added 1 changesets with 1 changes to 1 files
234 234 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
235 235 $ hg st
General Comments 0
You need to be logged in to leave comments. Login now