##// END OF EJS Templates
tests: add test for updating to null revision...
Martin von Zweigbergk -
r30900:23eed7d4 default
parent child Browse files
Show More
@@ -1,392 +1,414 b''
1 # Construct the following history tree:
1 # Construct the following history tree:
2 #
2 #
3 # @ 5:e1bb631146ca b1
3 # @ 5:e1bb631146ca b1
4 # |
4 # |
5 # o 4:a4fdb3b883c4 0:b608b9236435 b1
5 # o 4:a4fdb3b883c4 0:b608b9236435 b1
6 # |
6 # |
7 # | o 3:4b57d2520816 1:44592833ba9f
7 # | o 3:4b57d2520816 1:44592833ba9f
8 # | |
8 # | |
9 # | | o 2:063f31070f65
9 # | | o 2:063f31070f65
10 # | |/
10 # | |/
11 # | o 1:44592833ba9f
11 # | o 1:44592833ba9f
12 # |/
12 # |/
13 # o 0:b608b9236435
13 # o 0:b608b9236435
14
14
15 $ mkdir b1
15 $ mkdir b1
16 $ cd b1
16 $ cd b1
17 $ hg init
17 $ hg init
18 $ echo foo > foo
18 $ echo foo > foo
19 $ echo zero > a
19 $ echo zero > a
20 $ hg init sub
20 $ hg init sub
21 $ echo suba > sub/suba
21 $ echo suba > sub/suba
22 $ hg --cwd sub ci -Am addsuba
22 $ hg --cwd sub ci -Am addsuba
23 adding suba
23 adding suba
24 $ echo 'sub = sub' > .hgsub
24 $ echo 'sub = sub' > .hgsub
25 $ hg ci -qAm0
25 $ hg ci -qAm0
26 $ echo one > a ; hg ci -m1
26 $ echo one > a ; hg ci -m1
27 $ echo two > a ; hg ci -m2
27 $ echo two > a ; hg ci -m2
28 $ hg up -q 1
28 $ hg up -q 1
29 $ echo three > a ; hg ci -qm3
29 $ echo three > a ; hg ci -qm3
30 $ hg up -q 0
30 $ hg up -q 0
31 $ hg branch -q b1
31 $ hg branch -q b1
32 $ echo four > a ; hg ci -qm4
32 $ echo four > a ; hg ci -qm4
33 $ echo five > a ; hg ci -qm5
33 $ echo five > a ; hg ci -qm5
34
34
35 Initial repo state:
35 Initial repo state:
36
36
37 $ hg log -G --template '{rev}:{node|short} {parents} {branches}\n'
37 $ hg log -G --template '{rev}:{node|short} {parents} {branches}\n'
38 @ 5:ff252e8273df b1
38 @ 5:ff252e8273df b1
39 |
39 |
40 o 4:d047485b3896 0:60829823a42a b1
40 o 4:d047485b3896 0:60829823a42a b1
41 |
41 |
42 | o 3:6efa171f091b 1:0786582aa4b1
42 | o 3:6efa171f091b 1:0786582aa4b1
43 | |
43 | |
44 | | o 2:bd10386d478c
44 | | o 2:bd10386d478c
45 | |/
45 | |/
46 | o 1:0786582aa4b1
46 | o 1:0786582aa4b1
47 |/
47 |/
48 o 0:60829823a42a
48 o 0:60829823a42a
49
49
50
50
51 Make sure update doesn't assume b1 is a repository if invoked from outside:
51 Make sure update doesn't assume b1 is a repository if invoked from outside:
52
52
53 $ cd ..
53 $ cd ..
54 $ hg update b1
54 $ hg update b1
55 abort: no repository found in '$TESTTMP' (.hg not found)!
55 abort: no repository found in '$TESTTMP' (.hg not found)!
56 [255]
56 [255]
57 $ cd b1
57 $ cd b1
58
58
59 Test helper functions:
59 Test helper functions:
60
60
61 $ revtest () {
61 $ revtest () {
62 > msg=$1
62 > msg=$1
63 > dirtyflag=$2 # 'clean', 'dirty' or 'dirtysub'
63 > dirtyflag=$2 # 'clean', 'dirty' or 'dirtysub'
64 > startrev=$3
64 > startrev=$3
65 > targetrev=$4
65 > targetrev=$4
66 > opt=$5
66 > opt=$5
67 > hg up -qC $startrev
67 > hg up -qC $startrev
68 > test $dirtyflag = dirty && echo dirty > foo
68 > test $dirtyflag = dirty && echo dirty > foo
69 > test $dirtyflag = dirtysub && echo dirty > sub/suba
69 > test $dirtyflag = dirtysub && echo dirty > sub/suba
70 > hg up $opt $targetrev
70 > hg up $opt $targetrev
71 > hg parent --template 'parent={rev}\n'
71 > hg parent --template 'parent={rev}\n'
72 > hg stat -S
72 > hg stat -S
73 > }
73 > }
74
74
75 $ norevtest () {
75 $ norevtest () {
76 > msg=$1
76 > msg=$1
77 > dirtyflag=$2 # 'clean', 'dirty' or 'dirtysub'
77 > dirtyflag=$2 # 'clean', 'dirty' or 'dirtysub'
78 > startrev=$3
78 > startrev=$3
79 > opt=$4
79 > opt=$4
80 > hg up -qC $startrev
80 > hg up -qC $startrev
81 > test $dirtyflag = dirty && echo dirty > foo
81 > test $dirtyflag = dirty && echo dirty > foo
82 > test $dirtyflag = dirtysub && echo dirty > sub/suba
82 > test $dirtyflag = dirtysub && echo dirty > sub/suba
83 > hg up $opt
83 > hg up $opt
84 > hg parent --template 'parent={rev}\n'
84 > hg parent --template 'parent={rev}\n'
85 > hg stat -S
85 > hg stat -S
86 > }
86 > }
87
87
88 Test cases are documented in a table in the update function of merge.py.
88 Test cases are documented in a table in the update function of merge.py.
89 Cases are run as shown in that table, row by row.
89 Cases are run as shown in that table, row by row.
90
90
91 $ norevtest 'none clean linear' clean 4
91 $ norevtest 'none clean linear' clean 4
92 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
92 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
93 parent=5
93 parent=5
94
94
95 $ norevtest 'none clean same' clean 2
95 $ norevtest 'none clean same' clean 2
96 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
96 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
97 1 other heads for branch "default"
97 1 other heads for branch "default"
98 parent=2
98 parent=2
99
99
100
100
101 $ revtest 'none clean linear' clean 1 2
101 $ revtest 'none clean linear' clean 1 2
102 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
102 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
103 parent=2
103 parent=2
104
104
105 $ revtest 'none clean same' clean 2 3
105 $ revtest 'none clean same' clean 2 3
106 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
106 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
107 parent=3
107 parent=3
108
108
109 $ revtest 'none clean cross' clean 3 4
109 $ revtest 'none clean cross' clean 3 4
110 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
110 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
111 parent=4
111 parent=4
112
112
113
113
114 $ revtest 'none dirty linear' dirty 1 2
114 $ revtest 'none dirty linear' dirty 1 2
115 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
115 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
116 parent=2
116 parent=2
117 M foo
117 M foo
118
118
119 $ revtest 'none dirtysub linear' dirtysub 1 2
119 $ revtest 'none dirtysub linear' dirtysub 1 2
120 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
120 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
121 parent=2
121 parent=2
122 M sub/suba
122 M sub/suba
123
123
124 $ revtest 'none dirty same' dirty 2 3
124 $ revtest 'none dirty same' dirty 2 3
125 abort: uncommitted changes
125 abort: uncommitted changes
126 (commit or update --clean to discard changes)
126 (commit or update --clean to discard changes)
127 parent=2
127 parent=2
128 M foo
128 M foo
129
129
130 $ revtest 'none dirtysub same' dirtysub 2 3
130 $ revtest 'none dirtysub same' dirtysub 2 3
131 abort: uncommitted changes
131 abort: uncommitted changes
132 (commit or update --clean to discard changes)
132 (commit or update --clean to discard changes)
133 parent=2
133 parent=2
134 M sub/suba
134 M sub/suba
135
135
136 $ revtest 'none dirty cross' dirty 3 4
136 $ revtest 'none dirty cross' dirty 3 4
137 abort: uncommitted changes
137 abort: uncommitted changes
138 (commit or update --clean to discard changes)
138 (commit or update --clean to discard changes)
139 parent=3
139 parent=3
140 M foo
140 M foo
141
141
142 $ norevtest 'none dirty cross' dirty 2
142 $ norevtest 'none dirty cross' dirty 2
143 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
143 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
144 1 other heads for branch "default"
144 1 other heads for branch "default"
145 parent=2
145 parent=2
146 M foo
146 M foo
147
147
148 $ revtest 'none dirtysub cross' dirtysub 3 4
148 $ revtest 'none dirtysub cross' dirtysub 3 4
149 abort: uncommitted changes
149 abort: uncommitted changes
150 (commit or update --clean to discard changes)
150 (commit or update --clean to discard changes)
151 parent=3
151 parent=3
152 M sub/suba
152 M sub/suba
153
153
154 $ revtest '-C dirty linear' dirty 1 2 -C
154 $ revtest '-C dirty linear' dirty 1 2 -C
155 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
155 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
156 parent=2
156 parent=2
157
157
158 $ revtest '-c dirty linear' dirty 1 2 -c
158 $ revtest '-c dirty linear' dirty 1 2 -c
159 abort: uncommitted changes
159 abort: uncommitted changes
160 parent=1
160 parent=1
161 M foo
161 M foo
162
162
163 $ revtest '-c dirtysub linear' dirtysub 1 2 -c
163 $ revtest '-c dirtysub linear' dirtysub 1 2 -c
164 abort: uncommitted changes in subrepository 'sub'
164 abort: uncommitted changes in subrepository 'sub'
165 parent=1
165 parent=1
166 M sub/suba
166 M sub/suba
167
167
168 $ norevtest '-c clean same' clean 2 -c
168 $ norevtest '-c clean same' clean 2 -c
169 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
169 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
170 1 other heads for branch "default"
170 1 other heads for branch "default"
171 parent=2
171 parent=2
172
172
173 $ revtest '-cC dirty linear' dirty 1 2 -cC
173 $ revtest '-cC dirty linear' dirty 1 2 -cC
174 abort: cannot specify both -c/--check and -C/--clean
174 abort: cannot specify both -c/--check and -C/--clean
175 parent=1
175 parent=1
176 M foo
176 M foo
177
177
178 $ cd ..
178 $ cd ..
179
179
180 Test updating to null revision
181
182 $ hg init null-repo
183 $ cd null-repo
184 $ echo a > a
185 $ hg add a
186 $ hg ci -m a
187 $ hg up -qC 0
188 $ echo b > b
189 $ hg add b
190 $ hg up null
191 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
192 $ hg st
193 A b
194 $ hg up -q 0
195 $ hg st
196 A b
197 $ hg up -qC null
198 $ hg st
199 ? b
200 $ cd ..
201
180 Test updating with closed head
202 Test updating with closed head
181 ---------------------------------------------------------------------
203 ---------------------------------------------------------------------
182
204
183 $ hg clone -U -q b1 closed-heads
205 $ hg clone -U -q b1 closed-heads
184 $ cd closed-heads
206 $ cd closed-heads
185
207
186 Test updating if at least one non-closed branch head exists
208 Test updating if at least one non-closed branch head exists
187
209
188 if on the closed branch head:
210 if on the closed branch head:
189 - update to "."
211 - update to "."
190 - "updated to a closed branch head ...." message is displayed
212 - "updated to a closed branch head ...." message is displayed
191 - "N other heads for ...." message is displayed
213 - "N other heads for ...." message is displayed
192
214
193 $ hg update -q -C 3
215 $ hg update -q -C 3
194 $ hg commit --close-branch -m 6
216 $ hg commit --close-branch -m 6
195 $ norevtest "on closed branch head" clean 6
217 $ norevtest "on closed branch head" clean 6
196 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
218 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
197 no open descendant heads on branch "default", updating to a closed head
219 no open descendant heads on branch "default", updating to a closed head
198 (committing will reopen the head, use 'hg heads .' to see 1 other heads)
220 (committing will reopen the head, use 'hg heads .' to see 1 other heads)
199 parent=6
221 parent=6
200
222
201 if descendant non-closed branch head exists, and it is only one branch head:
223 if descendant non-closed branch head exists, and it is only one branch head:
202 - update to it, even if its revision is less than closed one
224 - update to it, even if its revision is less than closed one
203 - "N other heads for ...." message isn't displayed
225 - "N other heads for ...." message isn't displayed
204
226
205 $ norevtest "non-closed 2 should be chosen" clean 1
227 $ norevtest "non-closed 2 should be chosen" clean 1
206 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
228 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
207 parent=2
229 parent=2
208
230
209 if all descendant branch heads are closed, but there is another branch head:
231 if all descendant branch heads are closed, but there is another branch head:
210 - update to the tipmost descendant head
232 - update to the tipmost descendant head
211 - "updated to a closed branch head ...." message is displayed
233 - "updated to a closed branch head ...." message is displayed
212 - "N other heads for ...." message is displayed
234 - "N other heads for ...." message is displayed
213
235
214 $ norevtest "all descendant branch heads are closed" clean 3
236 $ norevtest "all descendant branch heads are closed" clean 3
215 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
237 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
216 no open descendant heads on branch "default", updating to a closed head
238 no open descendant heads on branch "default", updating to a closed head
217 (committing will reopen the head, use 'hg heads .' to see 1 other heads)
239 (committing will reopen the head, use 'hg heads .' to see 1 other heads)
218 parent=6
240 parent=6
219
241
220 Test updating if all branch heads are closed
242 Test updating if all branch heads are closed
221
243
222 if on the closed branch head:
244 if on the closed branch head:
223 - update to "."
245 - update to "."
224 - "updated to a closed branch head ...." message is displayed
246 - "updated to a closed branch head ...." message is displayed
225 - "all heads of branch ...." message is displayed
247 - "all heads of branch ...." message is displayed
226
248
227 $ hg update -q -C 2
249 $ hg update -q -C 2
228 $ hg commit --close-branch -m 7
250 $ hg commit --close-branch -m 7
229 $ norevtest "all heads of branch default are closed" clean 6
251 $ norevtest "all heads of branch default are closed" clean 6
230 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
252 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
231 no open descendant heads on branch "default", updating to a closed head
253 no open descendant heads on branch "default", updating to a closed head
232 (committing will reopen branch "default")
254 (committing will reopen branch "default")
233 parent=6
255 parent=6
234
256
235 if not on the closed branch head:
257 if not on the closed branch head:
236 - update to the tipmost descendant (closed) head
258 - update to the tipmost descendant (closed) head
237 - "updated to a closed branch head ...." message is displayed
259 - "updated to a closed branch head ...." message is displayed
238 - "all heads of branch ...." message is displayed
260 - "all heads of branch ...." message is displayed
239
261
240 $ norevtest "all heads of branch default are closed" clean 1
262 $ norevtest "all heads of branch default are closed" clean 1
241 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
263 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
242 no open descendant heads on branch "default", updating to a closed head
264 no open descendant heads on branch "default", updating to a closed head
243 (committing will reopen branch "default")
265 (committing will reopen branch "default")
244 parent=7
266 parent=7
245
267
246 $ cd ..
268 $ cd ..
247
269
248 Test updating if "default" branch doesn't exist and no revision is
270 Test updating if "default" branch doesn't exist and no revision is
249 checked out (= "default" is used as current branch)
271 checked out (= "default" is used as current branch)
250
272
251 $ hg init no-default-branch
273 $ hg init no-default-branch
252 $ cd no-default-branch
274 $ cd no-default-branch
253
275
254 $ hg branch foobar
276 $ hg branch foobar
255 marked working directory as branch foobar
277 marked working directory as branch foobar
256 (branches are permanent and global, did you want a bookmark?)
278 (branches are permanent and global, did you want a bookmark?)
257 $ echo a > a
279 $ echo a > a
258 $ hg commit -m "#0" -A
280 $ hg commit -m "#0" -A
259 adding a
281 adding a
260 $ echo 1 >> a
282 $ echo 1 >> a
261 $ hg commit -m "#1"
283 $ hg commit -m "#1"
262 $ hg update -q 0
284 $ hg update -q 0
263 $ echo 3 >> a
285 $ echo 3 >> a
264 $ hg commit -m "#2"
286 $ hg commit -m "#2"
265 created new head
287 created new head
266 $ hg commit --close-branch -m "#3"
288 $ hg commit --close-branch -m "#3"
267
289
268 if there is at least one non-closed branch head:
290 if there is at least one non-closed branch head:
269 - update to the tipmost branch head
291 - update to the tipmost branch head
270
292
271 $ norevtest "non-closed 1 should be chosen" clean null
293 $ norevtest "non-closed 1 should be chosen" clean null
272 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
294 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
273 parent=1
295 parent=1
274
296
275 if all branch heads are closed
297 if all branch heads are closed
276 - update to "tip"
298 - update to "tip"
277 - "updated to a closed branch head ...." message is displayed
299 - "updated to a closed branch head ...." message is displayed
278 - "all heads for branch "XXXX" are closed" message is displayed
300 - "all heads for branch "XXXX" are closed" message is displayed
279
301
280 $ hg update -q -C 1
302 $ hg update -q -C 1
281 $ hg commit --close-branch -m "#4"
303 $ hg commit --close-branch -m "#4"
282
304
283 $ norevtest "all branches are closed" clean null
305 $ norevtest "all branches are closed" clean null
284 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
306 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
285 no open descendant heads on branch "foobar", updating to a closed head
307 no open descendant heads on branch "foobar", updating to a closed head
286 (committing will reopen branch "foobar")
308 (committing will reopen branch "foobar")
287 parent=4
309 parent=4
288
310
289 $ cd ../b1
311 $ cd ../b1
290
312
291 Test obsolescence behavior
313 Test obsolescence behavior
292 ---------------------------------------------------------------------
314 ---------------------------------------------------------------------
293
315
294 successors should be taken in account when checking head destination
316 successors should be taken in account when checking head destination
295
317
296 $ cat << EOF >> $HGRCPATH
318 $ cat << EOF >> $HGRCPATH
297 > [ui]
319 > [ui]
298 > logtemplate={rev}:{node|short} {desc|firstline}
320 > logtemplate={rev}:{node|short} {desc|firstline}
299 > [experimental]
321 > [experimental]
300 > evolution=createmarkers
322 > evolution=createmarkers
301 > EOF
323 > EOF
302
324
303 Test no-argument update to a successor of an obsoleted changeset
325 Test no-argument update to a successor of an obsoleted changeset
304
326
305 $ hg log -G
327 $ hg log -G
306 o 5:ff252e8273df 5
328 o 5:ff252e8273df 5
307 |
329 |
308 o 4:d047485b3896 4
330 o 4:d047485b3896 4
309 |
331 |
310 | o 3:6efa171f091b 3
332 | o 3:6efa171f091b 3
311 | |
333 | |
312 | | o 2:bd10386d478c 2
334 | | o 2:bd10386d478c 2
313 | |/
335 | |/
314 | @ 1:0786582aa4b1 1
336 | @ 1:0786582aa4b1 1
315 |/
337 |/
316 o 0:60829823a42a 0
338 o 0:60829823a42a 0
317
339
318 $ hg book bm -r 3
340 $ hg book bm -r 3
319 $ hg status
341 $ hg status
320 M foo
342 M foo
321
343
322 We add simple obsolescence marker between 3 and 4 (indirect successors)
344 We add simple obsolescence marker between 3 and 4 (indirect successors)
323
345
324 $ hg id --debug -i -r 3
346 $ hg id --debug -i -r 3
325 6efa171f091b00a3c35edc15d48c52a498929953
347 6efa171f091b00a3c35edc15d48c52a498929953
326 $ hg id --debug -i -r 4
348 $ hg id --debug -i -r 4
327 d047485b3896813b2a624e86201983520f003206
349 d047485b3896813b2a624e86201983520f003206
328 $ hg debugobsolete 6efa171f091b00a3c35edc15d48c52a498929953 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
350 $ hg debugobsolete 6efa171f091b00a3c35edc15d48c52a498929953 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
329 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa d047485b3896813b2a624e86201983520f003206
351 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa d047485b3896813b2a624e86201983520f003206
330
352
331 Test that 5 is detected as a valid destination from 3 and also accepts moving
353 Test that 5 is detected as a valid destination from 3 and also accepts moving
332 the bookmark (issue4015)
354 the bookmark (issue4015)
333
355
334 $ hg up --quiet --hidden 3
356 $ hg up --quiet --hidden 3
335 $ hg up 5
357 $ hg up 5
336 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
358 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
337 $ hg book bm
359 $ hg book bm
338 moving bookmark 'bm' forward from 6efa171f091b
360 moving bookmark 'bm' forward from 6efa171f091b
339 $ hg bookmarks
361 $ hg bookmarks
340 * bm 5:ff252e8273df
362 * bm 5:ff252e8273df
341
363
342 Test that 4 is detected as the no-argument destination from 3 and also moves
364 Test that 4 is detected as the no-argument destination from 3 and also moves
343 the bookmark with it
365 the bookmark with it
344 $ hg up --quiet 0 # we should be able to update to 3 directly
366 $ hg up --quiet 0 # we should be able to update to 3 directly
345 $ hg up --quiet --hidden 3 # but not implemented yet.
367 $ hg up --quiet --hidden 3 # but not implemented yet.
346 $ hg book -f bm
368 $ hg book -f bm
347 $ hg up
369 $ hg up
348 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
370 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
349 updating bookmark bm
371 updating bookmark bm
350 $ hg book
372 $ hg book
351 * bm 4:d047485b3896
373 * bm 4:d047485b3896
352
374
353 Test that 5 is detected as a valid destination from 1
375 Test that 5 is detected as a valid destination from 1
354 $ hg up --quiet 0 # we should be able to update to 3 directly
376 $ hg up --quiet 0 # we should be able to update to 3 directly
355 $ hg up --quiet --hidden 3 # but not implemented yet.
377 $ hg up --quiet --hidden 3 # but not implemented yet.
356 $ hg up 5
378 $ hg up 5
357 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
379 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
358
380
359 Test that 5 is not detected as a valid destination from 2
381 Test that 5 is not detected as a valid destination from 2
360 $ hg up --quiet 0
382 $ hg up --quiet 0
361 $ hg up --quiet 2
383 $ hg up --quiet 2
362 $ hg up 5
384 $ hg up 5
363 abort: uncommitted changes
385 abort: uncommitted changes
364 (commit or update --clean to discard changes)
386 (commit or update --clean to discard changes)
365 [255]
387 [255]
366
388
367 Test that we don't crash when updating from a pruned changeset (i.e. has no
389 Test that we don't crash when updating from a pruned changeset (i.e. has no
368 successors). Behavior should probably be that we update to the first
390 successors). Behavior should probably be that we update to the first
369 non-obsolete parent but that will be decided later.
391 non-obsolete parent but that will be decided later.
370 $ hg id --debug -r 2
392 $ hg id --debug -r 2
371 bd10386d478cd5a9faf2e604114c8e6da62d3889
393 bd10386d478cd5a9faf2e604114c8e6da62d3889
372 $ hg up --quiet 0
394 $ hg up --quiet 0
373 $ hg up --quiet 2
395 $ hg up --quiet 2
374 $ hg debugobsolete bd10386d478cd5a9faf2e604114c8e6da62d3889
396 $ hg debugobsolete bd10386d478cd5a9faf2e604114c8e6da62d3889
375 $ hg up
397 $ hg up
376 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
398 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
377
399
378 Test experimental revset support
400 Test experimental revset support
379
401
380 $ hg log -r '_destupdate()'
402 $ hg log -r '_destupdate()'
381 2:bd10386d478c 2 (no-eol)
403 2:bd10386d478c 2 (no-eol)
382
404
383 Test that boolean flags allow --no-flag specification to override [defaults]
405 Test that boolean flags allow --no-flag specification to override [defaults]
384 $ cat >> $HGRCPATH <<EOF
406 $ cat >> $HGRCPATH <<EOF
385 > [defaults]
407 > [defaults]
386 > update = --check
408 > update = --check
387 > EOF
409 > EOF
388 $ hg co 2
410 $ hg co 2
389 abort: uncommitted changes
411 abort: uncommitted changes
390 [255]
412 [255]
391 $ hg co --no-check 2
413 $ hg co --no-check 2
392 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
414 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
General Comments 0
You need to be logged in to leave comments. Login now