##// END OF EJS Templates
tests: remove bundle2 activation from test-obsolete.t...
Pierre-Yves David -
r29657:dccbf976 default
parent child Browse files
Show More
@@ -1,1130 +1,1126
1 1 $ cat >> $HGRCPATH << EOF
2 2 > [phases]
3 3 > # public changeset are not obsolete
4 4 > publish=false
5 5 > [ui]
6 6 > logtemplate="{rev}:{node|short} ({phase}) [{tags} {bookmarks}] {desc|firstline}\n"
7 > [experimental]
8 > # drop me once bundle2 is the default,
9 > # added to get test change early.
10 > bundle2-exp = True
11 7 > EOF
12 8 $ mkcommit() {
13 9 > echo "$1" > "$1"
14 10 > hg add "$1"
15 11 > hg ci -m "add $1"
16 12 > }
17 13 $ getid() {
18 14 > hg log -T "{node}\n" --hidden -r "desc('$1')"
19 15 > }
20 16
21 17 $ cat > debugkeys.py <<EOF
22 18 > def reposetup(ui, repo):
23 19 > class debugkeysrepo(repo.__class__):
24 20 > def listkeys(self, namespace):
25 21 > ui.write('listkeys %s\n' % (namespace,))
26 22 > return super(debugkeysrepo, self).listkeys(namespace)
27 23 >
28 24 > if repo.local():
29 25 > repo.__class__ = debugkeysrepo
30 26 > EOF
31 27
32 28 $ hg init tmpa
33 29 $ cd tmpa
34 30 $ mkcommit kill_me
35 31
36 32 Checking that the feature is properly disabled
37 33
38 34 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
39 35 abort: creating obsolete markers is not enabled on this repo
40 36 [255]
41 37
42 38 Enabling it
43 39
44 40 $ cat >> $HGRCPATH << EOF
45 41 > [experimental]
46 42 > evolution=createmarkers,exchange
47 43 > EOF
48 44
49 45 Killing a single changeset without replacement
50 46
51 47 $ hg debugobsolete 0
52 48 abort: changeset references must be full hexadecimal node identifiers
53 49 [255]
54 50 $ hg debugobsolete '00'
55 51 abort: changeset references must be full hexadecimal node identifiers
56 52 [255]
57 53 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
58 54 $ hg debugobsolete
59 55 97b7c2d76b1845ed3eb988cd612611e72406cef0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'babar'}
60 56
61 57 (test that mercurial is not confused)
62 58
63 59 $ hg up null --quiet # having 0 as parent prevents it to be hidden
64 60 $ hg tip
65 61 -1:000000000000 (public) [tip ]
66 62 $ hg up --hidden tip --quiet
67 63
68 64 Killing a single changeset with itself should fail
69 65 (simple local safeguard)
70 66
71 67 $ hg debugobsolete `getid kill_me` `getid kill_me`
72 68 abort: bad obsmarker input: in-marker cycle with 97b7c2d76b1845ed3eb988cd612611e72406cef0
73 69 [255]
74 70
75 71 $ cd ..
76 72
77 73 Killing a single changeset with replacement
78 74 (and testing the format option)
79 75
80 76 $ hg init tmpb
81 77 $ cd tmpb
82 78 $ mkcommit a
83 79 $ mkcommit b
84 80 $ mkcommit original_c
85 81 $ hg up "desc('b')"
86 82 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
87 83 $ mkcommit new_c
88 84 created new head
89 85 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
90 86 $ hg debugobsolete --config format.obsstore-version=0 --flag 12 `getid original_c` `getid new_c` -d '121 120'
91 87 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
92 88 2:245bde4270cd add original_c
93 89 $ hg debugrevlog -cd
94 90 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
95 91 0 -1 -1 0 59 0 0 0 0 58 58 0 1 0
96 92 1 0 -1 59 118 59 59 0 0 58 116 0 1 0
97 93 2 1 -1 118 193 118 118 59 0 76 192 0 1 0
98 94 3 1 -1 193 260 193 193 59 0 66 258 0 2 0
99 95 $ hg debugobsolete
100 96 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
101 97
102 98 (check for version number of the obsstore)
103 99
104 100 $ dd bs=1 count=1 if=.hg/store/obsstore 2>/dev/null
105 101 \x00 (no-eol) (esc)
106 102
107 103 do it again (it read the obsstore before adding new changeset)
108 104
109 105 $ hg up '.^'
110 106 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
111 107 $ mkcommit new_2_c
112 108 created new head
113 109 $ hg debugobsolete -d '1337 0' `getid new_c` `getid new_2_c`
114 110 $ hg debugobsolete
115 111 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
116 112 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
117 113
118 114 Register two markers with a missing node
119 115
120 116 $ hg up '.^'
121 117 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
122 118 $ mkcommit new_3_c
123 119 created new head
124 120 $ hg debugobsolete -d '1338 0' `getid new_2_c` 1337133713371337133713371337133713371337
125 121 $ hg debugobsolete -d '1339 0' 1337133713371337133713371337133713371337 `getid new_3_c`
126 122 $ hg debugobsolete
127 123 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
128 124 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
129 125 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
130 126 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
131 127
132 128 Test the --index option of debugobsolete command
133 129 $ hg debugobsolete --index
134 130 0 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
135 131 1 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
136 132 2 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
137 133 3 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
138 134
139 135 Refuse pathological nullid successors
140 136 $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000
141 137 transaction abort!
142 138 rollback completed
143 139 abort: bad obsolescence marker detected: invalid successors nullid
144 140 [255]
145 141
146 142 Check that graphlog detect that a changeset is obsolete:
147 143
148 144 $ hg log -G
149 145 @ 5:5601fb93a350 (draft) [tip ] add new_3_c
150 146 |
151 147 o 1:7c3bad9141dc (draft) [ ] add b
152 148 |
153 149 o 0:1f0dee641bb7 (draft) [ ] add a
154 150
155 151
156 152 check that heads does not report them
157 153
158 154 $ hg heads
159 155 5:5601fb93a350 (draft) [tip ] add new_3_c
160 156 $ hg heads --hidden
161 157 5:5601fb93a350 (draft) [tip ] add new_3_c
162 158 4:ca819180edb9 (draft) [ ] add new_2_c
163 159 3:cdbce2fbb163 (draft) [ ] add new_c
164 160 2:245bde4270cd (draft) [ ] add original_c
165 161
166 162
167 163 check that summary does not report them
168 164
169 165 $ hg init ../sink
170 166 $ echo '[paths]' >> .hg/hgrc
171 167 $ echo 'default=../sink' >> .hg/hgrc
172 168 $ hg summary --remote
173 169 parent: 5:5601fb93a350 tip
174 170 add new_3_c
175 171 branch: default
176 172 commit: (clean)
177 173 update: (current)
178 174 phases: 3 draft
179 175 remote: 3 outgoing
180 176
181 177 $ hg summary --remote --hidden
182 178 parent: 5:5601fb93a350 tip
183 179 add new_3_c
184 180 branch: default
185 181 commit: (clean)
186 182 update: 3 new changesets, 4 branch heads (merge)
187 183 phases: 6 draft
188 184 remote: 3 outgoing
189 185
190 186 check that various commands work well with filtering
191 187
192 188 $ hg tip
193 189 5:5601fb93a350 (draft) [tip ] add new_3_c
194 190 $ hg log -r 6
195 191 abort: unknown revision '6'!
196 192 [255]
197 193 $ hg log -r 4
198 194 abort: hidden revision '4'!
199 195 (use --hidden to access hidden revisions)
200 196 [255]
201 197 $ hg debugrevspec 'rev(6)'
202 198 $ hg debugrevspec 'rev(4)'
203 199 $ hg debugrevspec 'null'
204 200 -1
205 201
206 202 Check that public changeset are not accounted as obsolete:
207 203
208 204 $ hg --hidden phase --public 2
209 205 $ hg log -G
210 206 @ 5:5601fb93a350 (draft) [tip ] add new_3_c
211 207 |
212 208 | o 2:245bde4270cd (public) [ ] add original_c
213 209 |/
214 210 o 1:7c3bad9141dc (public) [ ] add b
215 211 |
216 212 o 0:1f0dee641bb7 (public) [ ] add a
217 213
218 214
219 215 And that bumped changeset are detected
220 216 --------------------------------------
221 217
222 218 If we didn't filtered obsolete changesets out, 3 and 4 would show up too. Also
223 219 note that the bumped changeset (5:5601fb93a350) is not a direct successor of
224 220 the public changeset
225 221
226 222 $ hg log --hidden -r 'bumped()'
227 223 5:5601fb93a350 (draft) [tip ] add new_3_c
228 224
229 225 And that we can't push bumped changeset
230 226
231 227 $ hg push ../tmpa -r 0 --force #(make repo related)
232 228 pushing to ../tmpa
233 229 searching for changes
234 230 warning: repository is unrelated
235 231 adding changesets
236 232 adding manifests
237 233 adding file changes
238 234 added 1 changesets with 1 changes to 1 files (+1 heads)
239 235 $ hg push ../tmpa
240 236 pushing to ../tmpa
241 237 searching for changes
242 238 abort: push includes bumped changeset: 5601fb93a350!
243 239 [255]
244 240
245 241 Fixing "bumped" situation
246 242 We need to create a clone of 5 and add a special marker with a flag
247 243
248 244 $ hg summary
249 245 parent: 5:5601fb93a350 tip
250 246 add new_3_c
251 247 branch: default
252 248 commit: (clean)
253 249 update: 1 new changesets, 2 branch heads (merge)
254 250 phases: 1 draft
255 251 bumped: 1 changesets
256 252 $ hg up '5^'
257 253 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
258 254 $ hg revert -ar 5
259 255 adding new_3_c
260 256 $ hg ci -m 'add n3w_3_c'
261 257 created new head
262 258 $ hg debugobsolete -d '1338 0' --flags 1 `getid new_3_c` `getid n3w_3_c`
263 259 $ hg log -r 'bumped()'
264 260 $ hg log -G
265 261 @ 6:6f9641995072 (draft) [tip ] add n3w_3_c
266 262 |
267 263 | o 2:245bde4270cd (public) [ ] add original_c
268 264 |/
269 265 o 1:7c3bad9141dc (public) [ ] add b
270 266 |
271 267 o 0:1f0dee641bb7 (public) [ ] add a
272 268
273 269
274 270 $ cd ..
275 271
276 272 Revision 0 is hidden
277 273 --------------------
278 274
279 275 $ hg init rev0hidden
280 276 $ cd rev0hidden
281 277
282 278 $ mkcommit kill0
283 279 $ hg up -q null
284 280 $ hg debugobsolete `getid kill0`
285 281 $ mkcommit a
286 282 $ mkcommit b
287 283
288 284 Should pick the first visible revision as "repo" node
289 285
290 286 $ hg archive ../archive-null
291 287 $ cat ../archive-null/.hg_archival.txt
292 288 repo: 1f0dee641bb7258c56bd60e93edfa2405381c41e
293 289 node: 7c3bad9141dcb46ff89abf5f61856facd56e476c
294 290 branch: default
295 291 latesttag: null
296 292 latesttagdistance: 2
297 293 changessincelatesttag: 2
298 294
299 295
300 296 $ cd ..
301 297
302 298 Exchange Test
303 299 ============================
304 300
305 301 Destination repo does not have any data
306 302 ---------------------------------------
307 303
308 304 Simple incoming test
309 305
310 306 $ hg init tmpc
311 307 $ cd tmpc
312 308 $ hg incoming ../tmpb
313 309 comparing with ../tmpb
314 310 0:1f0dee641bb7 (public) [ ] add a
315 311 1:7c3bad9141dc (public) [ ] add b
316 312 2:245bde4270cd (public) [ ] add original_c
317 313 6:6f9641995072 (draft) [tip ] add n3w_3_c
318 314
319 315 Try to pull markers
320 316 (extinct changeset are excluded but marker are pushed)
321 317
322 318 $ hg pull ../tmpb
323 319 pulling from ../tmpb
324 320 requesting all changes
325 321 adding changesets
326 322 adding manifests
327 323 adding file changes
328 324 added 4 changesets with 4 changes to 4 files (+1 heads)
329 325 5 new obsolescence markers
330 326 (run 'hg heads' to see heads, 'hg merge' to merge)
331 327 $ hg debugobsolete
332 328 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
333 329 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
334 330 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
335 331 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
336 332 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
337 333
338 334 Rollback//Transaction support
339 335
340 336 $ hg debugobsolete -d '1340 0' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
341 337 $ hg debugobsolete
342 338 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
343 339 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
344 340 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
345 341 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
346 342 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
347 343 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 (Thu Jan 01 00:22:20 1970 +0000) {'user': 'test'}
348 344 $ hg rollback -n
349 345 repository tip rolled back to revision 3 (undo debugobsolete)
350 346 $ hg rollback
351 347 repository tip rolled back to revision 3 (undo debugobsolete)
352 348 $ hg debugobsolete
353 349 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
354 350 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
355 351 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
356 352 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
357 353 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
358 354
359 355 $ cd ..
360 356
361 357 Try to push markers
362 358
363 359 $ hg init tmpd
364 360 $ hg -R tmpb push tmpd
365 361 pushing to tmpd
366 362 searching for changes
367 363 adding changesets
368 364 adding manifests
369 365 adding file changes
370 366 added 4 changesets with 4 changes to 4 files (+1 heads)
371 367 5 new obsolescence markers
372 368 $ hg -R tmpd debugobsolete | sort
373 369 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
374 370 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
375 371 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
376 372 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
377 373 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
378 374
379 375 Check obsolete keys are exchanged only if source has an obsolete store
380 376
381 377 $ hg init empty
382 378 $ hg --config extensions.debugkeys=debugkeys.py -R empty push tmpd
383 379 pushing to tmpd
384 380 listkeys phases
385 381 listkeys bookmarks
386 382 no changes found
387 383 listkeys phases
388 384 [1]
389 385
390 386 clone support
391 387 (markers are copied and extinct changesets are included to allow hardlinks)
392 388
393 389 $ hg clone tmpb clone-dest
394 390 updating to branch default
395 391 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
396 392 $ hg -R clone-dest log -G --hidden
397 393 @ 6:6f9641995072 (draft) [tip ] add n3w_3_c
398 394 |
399 395 | x 5:5601fb93a350 (draft) [ ] add new_3_c
400 396 |/
401 397 | x 4:ca819180edb9 (draft) [ ] add new_2_c
402 398 |/
403 399 | x 3:cdbce2fbb163 (draft) [ ] add new_c
404 400 |/
405 401 | o 2:245bde4270cd (public) [ ] add original_c
406 402 |/
407 403 o 1:7c3bad9141dc (public) [ ] add b
408 404 |
409 405 o 0:1f0dee641bb7 (public) [ ] add a
410 406
411 407 $ hg -R clone-dest debugobsolete
412 408 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
413 409 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
414 410 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
415 411 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
416 412 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
417 413
418 414
419 415 Destination repo have existing data
420 416 ---------------------------------------
421 417
422 418 On pull
423 419
424 420 $ hg init tmpe
425 421 $ cd tmpe
426 422 $ hg debugobsolete -d '1339 0' 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00
427 423 $ hg pull ../tmpb
428 424 pulling from ../tmpb
429 425 requesting all changes
430 426 adding changesets
431 427 adding manifests
432 428 adding file changes
433 429 added 4 changesets with 4 changes to 4 files (+1 heads)
434 430 5 new obsolescence markers
435 431 (run 'hg heads' to see heads, 'hg merge' to merge)
436 432 $ hg debugobsolete
437 433 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
438 434 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
439 435 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
440 436 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
441 437 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
442 438 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
443 439
444 440
445 441 On push
446 442
447 443 $ hg push ../tmpc
448 444 pushing to ../tmpc
449 445 searching for changes
450 446 no changes found
451 447 1 new obsolescence markers
452 448 [1]
453 449 $ hg -R ../tmpc debugobsolete
454 450 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
455 451 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
456 452 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
457 453 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
458 454 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
459 455 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
460 456
461 457 detect outgoing obsolete and unstable
462 458 ---------------------------------------
463 459
464 460
465 461 $ hg log -G
466 462 o 3:6f9641995072 (draft) [tip ] add n3w_3_c
467 463 |
468 464 | o 2:245bde4270cd (public) [ ] add original_c
469 465 |/
470 466 o 1:7c3bad9141dc (public) [ ] add b
471 467 |
472 468 o 0:1f0dee641bb7 (public) [ ] add a
473 469
474 470 $ hg up 'desc("n3w_3_c")'
475 471 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
476 472 $ mkcommit original_d
477 473 $ mkcommit original_e
478 474 $ hg debugobsolete --record-parents `getid original_d` -d '0 0'
479 475 $ hg debugobsolete | grep `getid original_d`
480 476 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
481 477 $ hg log -r 'obsolete()'
482 478 4:94b33453f93b (draft) [ ] add original_d
483 479 $ hg summary
484 480 parent: 5:cda648ca50f5 tip
485 481 add original_e
486 482 branch: default
487 483 commit: (clean)
488 484 update: 1 new changesets, 2 branch heads (merge)
489 485 phases: 3 draft
490 486 unstable: 1 changesets
491 487 $ hg log -G -r '::unstable()'
492 488 @ 5:cda648ca50f5 (draft) [tip ] add original_e
493 489 |
494 490 x 4:94b33453f93b (draft) [ ] add original_d
495 491 |
496 492 o 3:6f9641995072 (draft) [ ] add n3w_3_c
497 493 |
498 494 o 1:7c3bad9141dc (public) [ ] add b
499 495 |
500 496 o 0:1f0dee641bb7 (public) [ ] add a
501 497
502 498
503 499 refuse to push obsolete changeset
504 500
505 501 $ hg push ../tmpc/ -r 'desc("original_d")'
506 502 pushing to ../tmpc/
507 503 searching for changes
508 504 abort: push includes obsolete changeset: 94b33453f93b!
509 505 [255]
510 506
511 507 refuse to push unstable changeset
512 508
513 509 $ hg push ../tmpc/
514 510 pushing to ../tmpc/
515 511 searching for changes
516 512 abort: push includes unstable changeset: cda648ca50f5!
517 513 [255]
518 514
519 515 Test that extinct changeset are properly detected
520 516
521 517 $ hg log -r 'extinct()'
522 518
523 519 Don't try to push extinct changeset
524 520
525 521 $ hg init ../tmpf
526 522 $ hg out ../tmpf
527 523 comparing with ../tmpf
528 524 searching for changes
529 525 0:1f0dee641bb7 (public) [ ] add a
530 526 1:7c3bad9141dc (public) [ ] add b
531 527 2:245bde4270cd (public) [ ] add original_c
532 528 3:6f9641995072 (draft) [ ] add n3w_3_c
533 529 4:94b33453f93b (draft) [ ] add original_d
534 530 5:cda648ca50f5 (draft) [tip ] add original_e
535 531 $ hg push ../tmpf -f # -f because be push unstable too
536 532 pushing to ../tmpf
537 533 searching for changes
538 534 adding changesets
539 535 adding manifests
540 536 adding file changes
541 537 added 6 changesets with 6 changes to 6 files (+1 heads)
542 538 7 new obsolescence markers
543 539
544 540 no warning displayed
545 541
546 542 $ hg push ../tmpf
547 543 pushing to ../tmpf
548 544 searching for changes
549 545 no changes found
550 546 [1]
551 547
552 548 Do not warn about new head when the new head is a successors of a remote one
553 549
554 550 $ hg log -G
555 551 @ 5:cda648ca50f5 (draft) [tip ] add original_e
556 552 |
557 553 x 4:94b33453f93b (draft) [ ] add original_d
558 554 |
559 555 o 3:6f9641995072 (draft) [ ] add n3w_3_c
560 556 |
561 557 | o 2:245bde4270cd (public) [ ] add original_c
562 558 |/
563 559 o 1:7c3bad9141dc (public) [ ] add b
564 560 |
565 561 o 0:1f0dee641bb7 (public) [ ] add a
566 562
567 563 $ hg up -q 'desc(n3w_3_c)'
568 564 $ mkcommit obsolete_e
569 565 created new head
570 566 $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'`
571 567 $ hg outgoing ../tmpf # parasite hg outgoing testin
572 568 comparing with ../tmpf
573 569 searching for changes
574 570 6:3de5eca88c00 (draft) [tip ] add obsolete_e
575 571 $ hg push ../tmpf
576 572 pushing to ../tmpf
577 573 searching for changes
578 574 adding changesets
579 575 adding manifests
580 576 adding file changes
581 577 added 1 changesets with 1 changes to 1 files (+1 heads)
582 578 1 new obsolescence markers
583 579
584 580 test relevance computation
585 581 ---------------------------------------
586 582
587 583 Checking simple case of "marker relevance".
588 584
589 585
590 586 Reminder of the repo situation
591 587
592 588 $ hg log --hidden --graph
593 589 @ 6:3de5eca88c00 (draft) [tip ] add obsolete_e
594 590 |
595 591 | x 5:cda648ca50f5 (draft) [ ] add original_e
596 592 | |
597 593 | x 4:94b33453f93b (draft) [ ] add original_d
598 594 |/
599 595 o 3:6f9641995072 (draft) [ ] add n3w_3_c
600 596 |
601 597 | o 2:245bde4270cd (public) [ ] add original_c
602 598 |/
603 599 o 1:7c3bad9141dc (public) [ ] add b
604 600 |
605 601 o 0:1f0dee641bb7 (public) [ ] add a
606 602
607 603
608 604 List of all markers
609 605
610 606 $ hg debugobsolete
611 607 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
612 608 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
613 609 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
614 610 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
615 611 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
616 612 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
617 613 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
618 614 cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob)
619 615
620 616 List of changesets with no chain
621 617
622 618 $ hg debugobsolete --hidden --rev ::2
623 619
624 620 List of changesets that are included on marker chain
625 621
626 622 $ hg debugobsolete --hidden --rev 6
627 623 cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob)
628 624
629 625 List of changesets with a longer chain, (including a pruned children)
630 626
631 627 $ hg debugobsolete --hidden --rev 3
632 628 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
633 629 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
634 630 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
635 631 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
636 632 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
637 633 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
638 634 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
639 635
640 636 List of both
641 637
642 638 $ hg debugobsolete --hidden --rev 3::6
643 639 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
644 640 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
645 641 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
646 642 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
647 643 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
648 644 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
649 645 cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob)
650 646 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
651 647
652 648 #if serve
653 649
654 650 Test the debug output for exchange
655 651 ----------------------------------
656 652
657 653 $ hg pull ../tmpb --config 'experimental.obsmarkers-exchange-debug=True' --config 'experimental.bundle2-exp=True'
658 654 pulling from ../tmpb
659 655 searching for changes
660 656 no changes found
661 657 obsmarker-exchange: 346 bytes received
662 658
663 659 check hgweb does not explode
664 660 ====================================
665 661
666 662 $ hg unbundle $TESTDIR/bundles/hgweb+obs.hg
667 663 adding changesets
668 664 adding manifests
669 665 adding file changes
670 666 added 62 changesets with 63 changes to 9 files (+60 heads)
671 667 (run 'hg heads .' to see heads, 'hg merge' to merge)
672 668 $ for node in `hg log -r 'desc(babar_)' --template '{node}\n'`;
673 669 > do
674 670 > hg debugobsolete $node
675 671 > done
676 672 $ hg up tip
677 673 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
678 674
679 675 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
680 676 $ cat hg.pid >> $DAEMON_PIDS
681 677
682 678 check changelog view
683 679
684 680 $ get-with-headers.py --headeronly localhost:$HGPORT 'shortlog/'
685 681 200 Script output follows
686 682
687 683 check graph view
688 684
689 685 $ get-with-headers.py --headeronly localhost:$HGPORT 'graph'
690 686 200 Script output follows
691 687
692 688 check filelog view
693 689
694 690 $ get-with-headers.py --headeronly localhost:$HGPORT 'log/'`hg log -r . -T "{node}"`/'babar'
695 691 200 Script output follows
696 692
697 693 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/68'
698 694 200 Script output follows
699 695 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/67'
700 696 404 Not Found
701 697 [1]
702 698
703 699 check that web.view config option:
704 700
705 701 $ killdaemons.py hg.pid
706 702 $ cat >> .hg/hgrc << EOF
707 703 > [web]
708 704 > view=all
709 705 > EOF
710 706 $ wait
711 707 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
712 708 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/67'
713 709 200 Script output follows
714 710 $ killdaemons.py hg.pid
715 711
716 712 Checking _enable=False warning if obsolete marker exists
717 713
718 714 $ echo '[experimental]' >> $HGRCPATH
719 715 $ echo "evolution=" >> $HGRCPATH
720 716 $ hg log -r tip
721 717 obsolete feature not enabled but 68 markers found!
722 718 68:c15e9edfca13 (draft) [tip ] add celestine
723 719
724 720 reenable for later test
725 721
726 722 $ echo '[experimental]' >> $HGRCPATH
727 723 $ echo "evolution=createmarkers,exchange" >> $HGRCPATH
728 724
729 725 #endif
730 726
731 727 Test incoming/outcoming with changesets obsoleted remotely, known locally
732 728 ===============================================================================
733 729
734 730 This test issue 3805
735 731
736 732 $ hg init repo-issue3805
737 733 $ cd repo-issue3805
738 734 $ echo "base" > base
739 735 $ hg ci -Am "base"
740 736 adding base
741 737 $ echo "foo" > foo
742 738 $ hg ci -Am "A"
743 739 adding foo
744 740 $ hg clone . ../other-issue3805
745 741 updating to branch default
746 742 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
747 743 $ echo "bar" >> foo
748 744 $ hg ci --amend
749 745 $ cd ../other-issue3805
750 746 $ hg log -G
751 747 @ 1:29f0c6921ddd (draft) [tip ] A
752 748 |
753 749 o 0:d20a80d4def3 (draft) [ ] base
754 750
755 751 $ hg log -G -R ../repo-issue3805
756 752 @ 3:323a9c3ddd91 (draft) [tip ] A
757 753 |
758 754 o 0:d20a80d4def3 (draft) [ ] base
759 755
760 756 $ hg incoming
761 757 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
762 758 searching for changes
763 759 3:323a9c3ddd91 (draft) [tip ] A
764 760 $ hg incoming --bundle ../issue3805.hg
765 761 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
766 762 searching for changes
767 763 3:323a9c3ddd91 (draft) [tip ] A
768 764 $ hg outgoing
769 765 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
770 766 searching for changes
771 767 1:29f0c6921ddd (draft) [tip ] A
772 768
773 769 #if serve
774 770
775 771 $ hg serve -R ../repo-issue3805 -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
776 772 $ cat hg.pid >> $DAEMON_PIDS
777 773
778 774 $ hg incoming http://localhost:$HGPORT
779 775 comparing with http://localhost:$HGPORT/
780 776 searching for changes
781 777 2:323a9c3ddd91 (draft) [tip ] A
782 778 $ hg outgoing http://localhost:$HGPORT
783 779 comparing with http://localhost:$HGPORT/
784 780 searching for changes
785 781 1:29f0c6921ddd (draft) [tip ] A
786 782
787 783 $ killdaemons.py
788 784
789 785 #endif
790 786
791 787 This test issue 3814
792 788
793 789 (nothing to push but locally hidden changeset)
794 790
795 791 $ cd ..
796 792 $ hg init repo-issue3814
797 793 $ cd repo-issue3805
798 794 $ hg push -r 323a9c3ddd91 ../repo-issue3814
799 795 pushing to ../repo-issue3814
800 796 searching for changes
801 797 adding changesets
802 798 adding manifests
803 799 adding file changes
804 800 added 2 changesets with 2 changes to 2 files
805 801 2 new obsolescence markers
806 802 $ hg out ../repo-issue3814
807 803 comparing with ../repo-issue3814
808 804 searching for changes
809 805 no changes found
810 806 [1]
811 807
812 808 Test that a local tag blocks a changeset from being hidden
813 809
814 810 $ hg tag -l visible -r 1 --hidden
815 811 $ hg log -G
816 812 @ 3:323a9c3ddd91 (draft) [tip ] A
817 813 |
818 814 | x 1:29f0c6921ddd (draft) [visible ] A
819 815 |/
820 816 o 0:d20a80d4def3 (draft) [ ] base
821 817
822 818 Test that removing a local tag does not cause some commands to fail
823 819
824 820 $ hg tag -l -r tip tiptag
825 821 $ hg tags
826 822 tiptag 3:323a9c3ddd91
827 823 tip 3:323a9c3ddd91
828 824 visible 1:29f0c6921ddd
829 825 $ hg --config extensions.strip= strip -r tip --no-backup
830 826 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
831 827 $ hg tags
832 828 visible 1:29f0c6921ddd
833 829 tip 1:29f0c6921ddd
834 830
835 831 Test bundle overlay onto hidden revision
836 832
837 833 $ cd ..
838 834 $ hg init repo-bundleoverlay
839 835 $ cd repo-bundleoverlay
840 836 $ echo "A" > foo
841 837 $ hg ci -Am "A"
842 838 adding foo
843 839 $ echo "B" >> foo
844 840 $ hg ci -m "B"
845 841 $ hg up 0
846 842 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
847 843 $ echo "C" >> foo
848 844 $ hg ci -m "C"
849 845 created new head
850 846 $ hg log -G
851 847 @ 2:c186d7714947 (draft) [tip ] C
852 848 |
853 849 | o 1:44526ebb0f98 (draft) [ ] B
854 850 |/
855 851 o 0:4b34ecfb0d56 (draft) [ ] A
856 852
857 853
858 854 $ hg clone -r1 . ../other-bundleoverlay
859 855 adding changesets
860 856 adding manifests
861 857 adding file changes
862 858 added 2 changesets with 2 changes to 1 files
863 859 updating to branch default
864 860 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
865 861 $ cd ../other-bundleoverlay
866 862 $ echo "B+" >> foo
867 863 $ hg ci --amend -m "B+"
868 864 $ hg log -G --hidden
869 865 @ 3:b7d587542d40 (draft) [tip ] B+
870 866 |
871 867 | x 2:eb95e9297e18 (draft) [ ] temporary amend commit for 44526ebb0f98
872 868 | |
873 869 | x 1:44526ebb0f98 (draft) [ ] B
874 870 |/
875 871 o 0:4b34ecfb0d56 (draft) [ ] A
876 872
877 873
878 874 $ hg incoming ../repo-bundleoverlay --bundle ../bundleoverlay.hg
879 875 comparing with ../repo-bundleoverlay
880 876 searching for changes
881 877 1:44526ebb0f98 (draft) [ ] B
882 878 2:c186d7714947 (draft) [tip ] C
883 879 $ hg log -G -R ../bundleoverlay.hg
884 880 o 4:c186d7714947 (draft) [tip ] C
885 881 |
886 882 | @ 3:b7d587542d40 (draft) [ ] B+
887 883 |/
888 884 o 0:4b34ecfb0d56 (draft) [ ] A
889 885
890 886
891 887 #if serve
892 888
893 889 Test issue 4506
894 890
895 891 $ cd ..
896 892 $ hg init repo-issue4506
897 893 $ cd repo-issue4506
898 894 $ echo "0" > foo
899 895 $ hg add foo
900 896 $ hg ci -m "content-0"
901 897
902 898 $ hg up null
903 899 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
904 900 $ echo "1" > bar
905 901 $ hg add bar
906 902 $ hg ci -m "content-1"
907 903 created new head
908 904 $ hg up 0
909 905 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
910 906 $ hg graft 1
911 907 grafting 1:1c9eddb02162 "content-1" (tip)
912 908
913 909 $ hg debugobsolete `hg log -r1 -T'{node}'` `hg log -r2 -T'{node}'`
914 910
915 911 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
916 912 $ cat hg.pid >> $DAEMON_PIDS
917 913
918 914 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/1'
919 915 404 Not Found
920 916 [1]
921 917 $ get-with-headers.py --headeronly localhost:$HGPORT 'file/tip/bar'
922 918 200 Script output follows
923 919 $ get-with-headers.py --headeronly localhost:$HGPORT 'annotate/tip/bar'
924 920 200 Script output follows
925 921
926 922 $ killdaemons.py
927 923
928 924 #endif
929 925
930 926 Test heads computation on pending index changes with obsolescence markers
931 927 $ cd ..
932 928 $ cat >$TESTTMP/test_extension.py << EOF
933 929 > from mercurial import cmdutil
934 930 > from mercurial.i18n import _
935 931 >
936 932 > cmdtable = {}
937 933 > command = cmdutil.command(cmdtable)
938 934 > @command("amendtransient",[], _('hg amendtransient [rev]'))
939 935 > def amend(ui, repo, *pats, **opts):
940 936 > def commitfunc(ui, repo, message, match, opts):
941 937 > return repo.commit(message, repo['.'].user(), repo['.'].date(), match)
942 938 > opts['message'] = 'Test'
943 939 > opts['logfile'] = None
944 940 > cmdutil.amend(ui, repo, commitfunc, repo['.'], {}, pats, opts)
945 941 > ui.write('%s\n' % repo.changelog.headrevs())
946 942 > EOF
947 943 $ cat >> $HGRCPATH << EOF
948 944 > [extensions]
949 945 > testextension=$TESTTMP/test_extension.py
950 946 > EOF
951 947 $ hg init repo-issue-nativerevs-pending-changes
952 948 $ cd repo-issue-nativerevs-pending-changes
953 949 $ mkcommit a
954 950 $ mkcommit b
955 951 $ hg up ".^"
956 952 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
957 953 $ echo aa > a
958 954 $ hg amendtransient
959 955 [1, 3]
960 956
961 957 Check that corrupted hidden cache does not crash
962 958
963 959 $ printf "" > .hg/cache/hidden
964 960 $ hg log -r . -T '{node}' --debug
965 961 corrupted hidden cache
966 962 8fd96dfc63e51ed5a8af1bec18eb4b19dbf83812 (no-eol)
967 963 $ hg log -r . -T '{node}' --debug
968 964 8fd96dfc63e51ed5a8af1bec18eb4b19dbf83812 (no-eol)
969 965
970 966 #if unix-permissions
971 967 Check that wrong hidden cache permission does not crash
972 968
973 969 $ chmod 000 .hg/cache/hidden
974 970 $ hg log -r . -T '{node}' --debug
975 971 cannot read hidden cache
976 972 error writing hidden changesets cache
977 973 8fd96dfc63e51ed5a8af1bec18eb4b19dbf83812 (no-eol)
978 974 #endif
979 975
980 976 Test cache consistency for the visible filter
981 977 1) We want to make sure that the cached filtered revs are invalidated when
982 978 bookmarks change
983 979 $ cd ..
984 980 $ cat >$TESTTMP/test_extension.py << EOF
985 981 > import weakref
986 982 > from mercurial import cmdutil, extensions, bookmarks, repoview
987 983 > def _bookmarkchanged(orig, bkmstoreinst, *args, **kwargs):
988 984 > reporef = weakref.ref(bkmstoreinst._repo)
989 985 > def trhook(tr):
990 986 > repo = reporef()
991 987 > hidden1 = repoview.computehidden(repo)
992 988 > hidden = repoview.filterrevs(repo, 'visible')
993 989 > if sorted(hidden1) != sorted(hidden):
994 990 > print "cache inconsistency"
995 991 > bkmstoreinst._repo.currenttransaction().addpostclose('test_extension', trhook)
996 992 > orig(bkmstoreinst, *args, **kwargs)
997 993 > def extsetup(ui):
998 994 > extensions.wrapfunction(bookmarks.bmstore, 'recordchange',
999 995 > _bookmarkchanged)
1000 996 > EOF
1001 997
1002 998 $ hg init repo-cache-inconsistency
1003 999 $ cd repo-issue-nativerevs-pending-changes
1004 1000 $ mkcommit a
1005 1001 a already tracked!
1006 1002 $ mkcommit b
1007 1003 $ hg id
1008 1004 13bedc178fce tip
1009 1005 $ echo "hello" > b
1010 1006 $ hg commit --amend -m "message"
1011 1007 $ hg book bookb -r 13bedc178fce --hidden
1012 1008 $ hg log -r 13bedc178fce
1013 1009 5:13bedc178fce (draft) [ bookb] add b
1014 1010 $ hg book -d bookb
1015 1011 $ hg log -r 13bedc178fce
1016 1012 abort: hidden revision '13bedc178fce'!
1017 1013 (use --hidden to access hidden revisions)
1018 1014 [255]
1019 1015
1020 1016 Empty out the test extension, as it isn't compatible with later parts
1021 1017 of the test.
1022 1018 $ echo > $TESTTMP/test_extension.py
1023 1019
1024 1020 Test ability to pull changeset with locally applying obsolescence markers
1025 1021 (issue4945)
1026 1022
1027 1023 $ cd ..
1028 1024 $ hg init issue4845
1029 1025 $ cd issue4845
1030 1026
1031 1027 $ echo foo > f0
1032 1028 $ hg add f0
1033 1029 $ hg ci -m '0'
1034 1030 $ echo foo > f1
1035 1031 $ hg add f1
1036 1032 $ hg ci -m '1'
1037 1033 $ echo foo > f2
1038 1034 $ hg add f2
1039 1035 $ hg ci -m '2'
1040 1036
1041 1037 $ echo bar > f2
1042 1038 $ hg commit --amend --config experimetnal.evolution=createmarkers
1043 1039 $ hg log -G
1044 1040 @ 4:b0551702f918 (draft) [tip ] 2
1045 1041 |
1046 1042 o 1:e016b03fd86f (draft) [ ] 1
1047 1043 |
1048 1044 o 0:a78f55e5508c (draft) [ ] 0
1049 1045
1050 1046 $ hg log -G --hidden
1051 1047 @ 4:b0551702f918 (draft) [tip ] 2
1052 1048 |
1053 1049 | x 3:f27abbcc1f77 (draft) [ ] temporary amend commit for e008cf283490
1054 1050 | |
1055 1051 | x 2:e008cf283490 (draft) [ ] 2
1056 1052 |/
1057 1053 o 1:e016b03fd86f (draft) [ ] 1
1058 1054 |
1059 1055 o 0:a78f55e5508c (draft) [ ] 0
1060 1056
1061 1057
1062 1058 $ hg strip -r 1 --config extensions.strip=
1063 1059 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1064 1060 saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e016b03fd86f-c41c6bcc-backup.hg (glob)
1065 1061 $ hg log -G
1066 1062 @ 0:a78f55e5508c (draft) [tip ] 0
1067 1063
1068 1064 $ hg log -G --hidden
1069 1065 @ 0:a78f55e5508c (draft) [tip ] 0
1070 1066
1071 1067
1072 1068 $ hg pull .hg/strip-backup/*
1073 1069 pulling from .hg/strip-backup/e016b03fd86f-c41c6bcc-backup.hg
1074 1070 searching for changes
1075 1071 adding changesets
1076 1072 adding manifests
1077 1073 adding file changes
1078 1074 added 2 changesets with 2 changes to 2 files
1079 1075 (run 'hg update' to get a working copy)
1080 1076 $ hg log -G
1081 1077 o 2:b0551702f918 (draft) [tip ] 2
1082 1078 |
1083 1079 o 1:e016b03fd86f (draft) [ ] 1
1084 1080 |
1085 1081 @ 0:a78f55e5508c (draft) [ ] 0
1086 1082
1087 1083 $ hg log -G --hidden
1088 1084 o 2:b0551702f918 (draft) [tip ] 2
1089 1085 |
1090 1086 o 1:e016b03fd86f (draft) [ ] 1
1091 1087 |
1092 1088 @ 0:a78f55e5508c (draft) [ ] 0
1093 1089
1094 1090 Test that 'hg debugobsolete --index --rev' can show indices of obsmarkers when
1095 1091 only a subset of those are displayed (because of --rev option)
1096 1092 $ hg init doindexrev
1097 1093 $ cd doindexrev
1098 1094 $ echo a > a
1099 1095 $ hg ci -Am a
1100 1096 adding a
1101 1097 $ hg ci --amend -m aa
1102 1098 $ echo b > b
1103 1099 $ hg ci -Am b
1104 1100 adding b
1105 1101 $ hg ci --amend -m bb
1106 1102 $ echo c > c
1107 1103 $ hg ci -Am c
1108 1104 adding c
1109 1105 $ hg ci --amend -m cc
1110 1106 $ echo d > d
1111 1107 $ hg ci -Am d
1112 1108 adding d
1113 1109 $ hg ci --amend -m dd
1114 1110 $ hg debugobsolete --index --rev "3+7"
1115 1111 1 6fdef60fcbabbd3d50e9b9cbc2a240724b91a5e1 d27fb9b066076fd921277a4b9e8b9cb48c95bc6a 0 \(.*\) {'user': 'test'} (re)
1116 1112 3 4715cf767440ed891755448016c2b8cf70760c30 7ae79c5d60f049c7b0dd02f5f25b9d60aaf7b36d 0 \(.*\) {'user': 'test'} (re)
1117 1113
1118 1114 Test the --delete option of debugobsolete command
1119 1115 $ hg debugobsolete --index
1120 1116 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b f9bd49731b0b175e42992a3c8fa6c678b2bc11f1 0 \(.*\) {'user': 'test'} (re)
1121 1117 1 6fdef60fcbabbd3d50e9b9cbc2a240724b91a5e1 d27fb9b066076fd921277a4b9e8b9cb48c95bc6a 0 \(.*\) {'user': 'test'} (re)
1122 1118 2 1ab51af8f9b41ef8c7f6f3312d4706d870b1fb74 29346082e4a9e27042b62d2da0e2de211c027621 0 \(.*\) {'user': 'test'} (re)
1123 1119 3 4715cf767440ed891755448016c2b8cf70760c30 7ae79c5d60f049c7b0dd02f5f25b9d60aaf7b36d 0 \(.*\) {'user': 'test'} (re)
1124 1120 $ hg debugobsolete --delete 1 --delete 3
1125 1121 deleted 2 obsolescense markers
1126 1122 $ hg debugobsolete
1127 1123 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b f9bd49731b0b175e42992a3c8fa6c678b2bc11f1 0 \(.*\) {'user': 'test'} (re)
1128 1124 1ab51af8f9b41ef8c7f6f3312d4706d870b1fb74 29346082e4a9e27042b62d2da0e2de211c027621 0 \(.*\) {'user': 'test'} (re)
1129 1125 $ cd ..
1130 1126
General Comments 0
You need to be logged in to leave comments. Login now