Fossil SCM

Continued work on the integrity checks for changesets. Moved callers out of transactions. Two checks are already tripping on bad changesets made by InitCSets (pass 5).

aku 2007-11-27 04:26 trunk
Commit 8c6488ded2d656ba8e025c0abf9ed9bfaeab5007
--- tools/cvs2fossil/lib/c2f_integrity.tcl
+++ tools/cvs2fossil/lib/c2f_integrity.tcl
@@ -28,25 +28,31 @@
2828
snit::type ::vc::fossil::import::cvs::integrity {
2929
# # ## ### ##### ######## #############
3030
## Public API
3131
3232
typemethod strict {} {
33
+ log write 4 integrity {Check database consistency}
34
+
3335
set n 0
3436
AllButMeta
3537
Meta
3638
return
3739
}
3840
3941
typemethod metarelaxed {} {
42
+ log write 4 integrity {Check database consistency}
43
+
4044
set n 0
4145
AllButMeta
4246
return
4347
}
4448
4549
typemethod changesets {} {
50
+ log write 4 integrity {Check database consistency}
51
+
4652
set n 0
47
- RevisionCSetLinkage
53
+ AllChangesets
4854
RevisionChangesets
4955
SymbolChangesets
5056
return
5157
}
5258
@@ -54,11 +60,10 @@
5460
## Internal methods
5561
5662
proc AllButMeta {} {
5763
# This code performs a number of paranoid checks of the
5864
# database, searching for inconsistent cross-references.
59
- log write 4 integrity {Check database consistency}
6065
6166
upvar 1 n n ; # Counter for the checks (we print an id before
6267
# the main label).
6368
6469
# Find all revisions which disagree with their line of
@@ -269,11 +274,10 @@
269274
}
270275
271276
proc Meta {} {
272277
# This code performs a number of paranoid checks of the
273278
# database, searching for inconsistent cross-references.
274
- log write 4 integrity {Check database consistency}
275279
276280
upvar 1 n n ; # Counter for the checks (we print an id before
277281
# the main label).
278282
279283
# Find all revisions which disgree with their meta data about
@@ -289,26 +293,254 @@
289293
;
290294
}
291295
return
292296
}
293297
294
- proc RevisionCSetLinkage {} {
298
+ proc AllChangesets {} {
299
+ # This code performs a number of paranoid checks of the
300
+ # database, searching for inconsistent changeset/revision
301
+ # information.
302
+
303
+ upvar 1 n n ; # Counter for the checks (we print an id before
304
+ # the main label).
305
+
306
+ # Find all revisions which are not used by at least one
307
+ # revision changeset.
308
+ Check \
309
+ {All revisions have to be used by least one revision changeset} \
310
+ {is not used by a revision changeset} {
311
+ -- Unused revisions = All revisions
312
+ -- - revisions used by revision changesets.
313
+ --
314
+ -- Both sets can be computed easily, and subtracted
315
+ -- from each other. Then we can get the associated
316
+ -- file (name) for display.
317
+
318
+ SELECT F.name, R.rev
319
+ FROM revision R, file F
320
+ WHERE R.rid IN (SELECT rid FROM revision -- All revisions
321
+ EXCEPT -- subtract
322
+ SELECT CR.rid FROM csrevision CR, changeset C -- revisions used
323
+ WHERE C.cid = CR.cid -- by any revision
324
+ AND C.type = 0) -- changeset
325
+ AND R.fid = F.fid -- get file of unused revision
326
+ }
327
+ # Find all revisions which are used by more than one revision
328
+ # changeset.
329
+ Check \
330
+ {All revisions have to be used by at most one revision changeset} \
331
+ {is used by multiple revision changesets} {
332
+ -- Principle of operation: Get all revision/changeset
333
+ -- pairs for all revision changesets, group by
334
+ -- revision to aggregate the changeset, counting
335
+ -- them. From the resulting revision/count table
336
+ -- select those with more than one user, and get their
337
+ -- associated file (name) for display.
338
+
339
+ SELECT F.name, R.rev
340
+ FROM revision R, file F,
341
+ (SELECT CR.rid AS rid, count(CR.cid) AS count
342
+ FROM csrevision CR, changeset C
343
+ WHERE C.type = 0
344
+ AND C.cid = CR.cid
345
+ GROUP BY CR.rid ) AS U
346
+ WHERE U.count > 1
347
+ AND R.rid = U.rid
348
+ AND R.fid = F.fid
349
+ }
350
+ # All revisions in all changesets have to agree on the LOD
351
+ # their changeset belongs to. In other words, all revisions in
352
+ # a changeset have to refer to the same line of development.
353
+ #
354
+ # Instead of looking at all pairs of revisions in all
355
+ # changesets we generate the distinct set of all LODs
356
+ # referenced by the revisions of a changeset, look for those
357
+ # with cardinality > 1, and get the identifying information
358
+ # for the changesets found thusly.
359
+ CheckCS \
360
+ {All revisions in a changeset have to belong to the same LOD} \
361
+ {: Its revisions disagree about the LOD they belong to} {
362
+ SELECT T.name, C.cid
363
+ FROM changeset C, cstype T
364
+ WHERE C.cid IN (SELECT U.cid
365
+ FROM (SELECT DISTINCT CR.cid AS cid, R.lod AS lod
366
+ FROM csrevision CR, revision R
367
+ WHERE CR.rid = R.rid) AS U
368
+ GROUP BY U.cid HAVING COUNT(U.lod) > 1)
369
+ AND T.tid = C.type
370
+ }
371
+ # All revisions in all changesets have to agree on the project
372
+ # their changeset belongs to. In other words, all revisions in
373
+ # a changeset have to refer to the same project.
374
+ #
375
+ # Instead of looking at all pairs of revisions in all
376
+ # changesets we generate the distinct set of all projects
377
+ # referenced by the revisions of a changeset, look for those
378
+ # with cardinality > 1, and get the identifying information
379
+ # for the changesets found thusly.
380
+ CheckCS \
381
+ {All revisions in a changeset have to belong to the same project} \
382
+ {: Its revisions disagree about the project they belong to} {
383
+ SELECT T.name, C.cid
384
+ FROM changeset C, cstype T
385
+ WHERE C.cid IN (SELECT U.cid
386
+ FROM (SELECT DISTINCT CR.cid AS cid, F.pid AS pid
387
+ FROM csrevision CR, revision R, file F
388
+ WHERE CR.rid = R.rid
389
+ AND F.fid = R.fid) AS U
390
+ GROUP BY U.cid HAVING COUNT(U.pid) > 1)
391
+ AND T.tid = C.type
392
+ }
393
+ # All revisions in a single changeset have to belong to
394
+ # different files. Conversely: No two revisions of a single
395
+ # file are allowed to be in the same changeset.
396
+ #
397
+ # Instead of looking at all pairs of revisions in all
398
+ # changesets we generate the distinct set of all files
399
+ # referenced by the revisions of a changeset, and look for
400
+ # those with cardinality < the cardinality of the set of
401
+ # revisions, and get the identifying information for the
402
+ # changesets found thusly.
403
+ CheckCS \
404
+ {All revisions in a changeset have to belong to different files} \
405
+ {: Its revisions share files} {
406
+ SELECT T.name, C.cid
407
+ FROM changeset C, cstype T
408
+ WHERE C.cid IN (SELECT VV.cid
409
+ FROM (SELECT U.cid as cid, COUNT (U.fid) AS fcount
410
+ FROM (SELECT DISTINCT CR.cid AS cid, R.fid AS fid
411
+ FROM csrevision CR, revision R
412
+ WHERE CR.rid = R.rid) AS U
413
+ GROUP BY U.cid) AS UU,
414
+ (SELECT V.cid AS cid, COUNT (V.rid) AS rcount
415
+ FROM csrevision V
416
+ GROUP BY V.cid) AS VV
417
+ WHERE VV.cid = UU.cid
418
+ AND UU.fcount < VV.rcount)
419
+ AND T.tid = C.type
420
+ }
421
+ return
295422
}
296423
297424
proc RevisionChangesets {} {
425
+ # This code performs a number of paranoid checks of the
426
+ # database, searching for inconsistent changeset/revision
427
+ # information.
428
+
429
+ upvar 1 n n ; # Counter for the checks (we print an id before
430
+ # the main label).
431
+
432
+ # All revisions used by revision changesets have to refer to
433
+ # the same meta information as their changeset.
434
+ CheckInCS \
435
+ {All revisions have to agree with their revision changeset about the used meta information} \
436
+ {disagrees with its revision changeset @ about the meta information} {
437
+ SELECT CT.name, C.cid, F.name, R.rev
438
+ FROM changeset C, cstype CT, revision R, file F, csrevision CR
439
+ WHERE C.type = 0 -- revision changesets only
440
+ AND C.cid = CR.cid -- changeset --> its revisions
441
+ AND R.rid = CR.rid -- look at them
442
+ AND R.mid != C.src -- Only those which disagree with changeset about the meta
443
+ AND R.fid = F.fid -- get file of the revision
444
+ AND CT.tid = C.type -- get changeset type, for labeling
445
+ }
446
+ return
298447
}
299448
300449
proc SymbolChangesets {} {
450
+ # This code performs a number of paranoid checks of the
451
+ # database, searching for inconsistent changeset/revision
452
+ # information.
453
+
454
+ return ; # Disabled for now, bottlenecks ...
455
+
456
+ upvar 1 n n ; # Counter for the checks (we print an id before
457
+ # the main label).
458
+
459
+ # The next two checks are BOTTLENECKS. In essence we are
460
+ # checking each symbol changeset one by one.
461
+
462
+ # TODO: Try to rephrase the checks to make more use of
463
+ # indices, set and stream operations.
464
+
465
+ # All revisions used by tag symbol changesets have to have the
466
+ # changeset's tag associated with them.
467
+ CheckInCS \
468
+ {All revisions used by tag symbol changesets have to have the changeset's tag attached to them} \
469
+ {does not have the tag of its symbol changeset @ attached to it} {
470
+ SELECT CT.name, C.cid, F.name, R.rev
471
+ FROM changeset C, cstype CT, revision R, file F, csrevision CR, tag T
472
+ WHERE C.type = 1 -- symbol changesets only
473
+ AND C.src = T.sid -- tag only, linked by symbol id
474
+ AND C.cid = CR.cid -- changeset --> its revisions
475
+ AND R.rid = CR.rid -- look at the revisions
476
+ -- and look for the tag among the attached ones.
477
+ AND T.sid NOT IN (SELECT TB.sid
478
+ FROM tag TB
479
+ WHERE TB.rev = R.rid)
480
+ AND R.fid = F.fid -- get file of revision
481
+ }
482
+
483
+ # All revisions used by branch symbol changesets have to have
484
+ # the changeset's branch associated with them.
485
+
486
+ CheckInCS \
487
+ {All revisions used by branch symbol changesets have to have the changeset's branch attached to them} \
488
+ {does not have the branch of its symbol changeset @ attached to it} {
489
+ SELECT CT.name, C.cid, F.name, R.rev, C.cid
490
+ FROM changeset C, cstype CT, revision R, file F, csrevision CR, branch B
491
+ WHERE C.type = 1 -- symbol changesets only
492
+ AND C.src = B.sid -- branches only
493
+ AND C.cid = CR.cid -- changeset --> its revisions
494
+ AND R.rid = CR.rid -- look at the revisions
495
+ -- and look for the branch among the attached ones.
496
+ AND B.sid NOT IN (SELECT BB.sid
497
+ FROM branch BB
498
+ WHERE BB.root = R.rid)
499
+ AND R.fid = F.fid -- get file of revision
500
+ }
501
+
502
+ # TODO
503
+ # The state has to contain at least one tag symbol changeset
504
+ # for all known tags.
505
+
506
+ # TODO
507
+ # The state has to contain at least one branch symbol changeset
508
+ # for all known branches.
509
+ return
301510
}
302511
303512
304513
proc Check {header label sql} {
305514
upvar 1 n n
306515
set ok 1
307516
foreach {fname revnr} [state run $sql] {
308517
set ok 0
309518
trouble fatal "$fname <$revnr> $label"
519
+ }
520
+ log write 5 integrity "\[[format %02d [incr n]]\] [expr {$ok ? "Ok " : "Failed"}] ... $header"
521
+ return
522
+ }
523
+
524
+ proc CheckCS {header label sql} {
525
+ upvar 1 n n
526
+ set ok 1
527
+ foreach {ctype cid} [state run $sql] {
528
+ set ok 0
529
+ trouble fatal "<$ctype $cid> $label"
530
+ }
531
+ log write 5 integrity "\[[format %02d [incr n]]\] [expr {$ok ? "Ok " : "Failed"}] ... $header"
532
+ return
533
+ }
534
+
535
+ proc CheckInCS {header label sql} {
536
+ upvar 1 n n
537
+ set ok 1
538
+ foreach {cstype csid fname revnr} [state run $sql] {
539
+ set ok 0
540
+ set b "<$cstype $csid>"
541
+ trouble fatal "$fname <$revnr> [string map [list @ $b] $label]"
310542
}
311543
log write 5 integrity "\[[format %02d [incr n]]\] [expr {$ok ? "Ok " : "Failed"}] ... $header"
312544
return
313545
}
314546
315547
--- tools/cvs2fossil/lib/c2f_integrity.tcl
+++ tools/cvs2fossil/lib/c2f_integrity.tcl
@@ -28,25 +28,31 @@
28 snit::type ::vc::fossil::import::cvs::integrity {
29 # # ## ### ##### ######## #############
30 ## Public API
31
32 typemethod strict {} {
 
 
33 set n 0
34 AllButMeta
35 Meta
36 return
37 }
38
39 typemethod metarelaxed {} {
 
 
40 set n 0
41 AllButMeta
42 return
43 }
44
45 typemethod changesets {} {
 
 
46 set n 0
47 RevisionCSetLinkage
48 RevisionChangesets
49 SymbolChangesets
50 return
51 }
52
@@ -54,11 +60,10 @@
54 ## Internal methods
55
56 proc AllButMeta {} {
57 # This code performs a number of paranoid checks of the
58 # database, searching for inconsistent cross-references.
59 log write 4 integrity {Check database consistency}
60
61 upvar 1 n n ; # Counter for the checks (we print an id before
62 # the main label).
63
64 # Find all revisions which disagree with their line of
@@ -269,11 +274,10 @@
269 }
270
271 proc Meta {} {
272 # This code performs a number of paranoid checks of the
273 # database, searching for inconsistent cross-references.
274 log write 4 integrity {Check database consistency}
275
276 upvar 1 n n ; # Counter for the checks (we print an id before
277 # the main label).
278
279 # Find all revisions which disgree with their meta data about
@@ -289,26 +293,254 @@
289 ;
290 }
291 return
292 }
293
294 proc RevisionCSetLinkage {} {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295 }
296
297 proc RevisionChangesets {} {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298 }
299
300 proc SymbolChangesets {} {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
301 }
302
303
304 proc Check {header label sql} {
305 upvar 1 n n
306 set ok 1
307 foreach {fname revnr} [state run $sql] {
308 set ok 0
309 trouble fatal "$fname <$revnr> $label"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310 }
311 log write 5 integrity "\[[format %02d [incr n]]\] [expr {$ok ? "Ok " : "Failed"}] ... $header"
312 return
313 }
314
315
--- tools/cvs2fossil/lib/c2f_integrity.tcl
+++ tools/cvs2fossil/lib/c2f_integrity.tcl
@@ -28,25 +28,31 @@
28 snit::type ::vc::fossil::import::cvs::integrity {
29 # # ## ### ##### ######## #############
30 ## Public API
31
32 typemethod strict {} {
33 log write 4 integrity {Check database consistency}
34
35 set n 0
36 AllButMeta
37 Meta
38 return
39 }
40
41 typemethod metarelaxed {} {
42 log write 4 integrity {Check database consistency}
43
44 set n 0
45 AllButMeta
46 return
47 }
48
49 typemethod changesets {} {
50 log write 4 integrity {Check database consistency}
51
52 set n 0
53 AllChangesets
54 RevisionChangesets
55 SymbolChangesets
56 return
57 }
58
@@ -54,11 +60,10 @@
60 ## Internal methods
61
62 proc AllButMeta {} {
63 # This code performs a number of paranoid checks of the
64 # database, searching for inconsistent cross-references.
 
65
66 upvar 1 n n ; # Counter for the checks (we print an id before
67 # the main label).
68
69 # Find all revisions which disagree with their line of
@@ -269,11 +274,10 @@
274 }
275
276 proc Meta {} {
277 # This code performs a number of paranoid checks of the
278 # database, searching for inconsistent cross-references.
 
279
280 upvar 1 n n ; # Counter for the checks (we print an id before
281 # the main label).
282
283 # Find all revisions which disgree with their meta data about
@@ -289,26 +293,254 @@
293 ;
294 }
295 return
296 }
297
298 proc AllChangesets {} {
299 # This code performs a number of paranoid checks of the
300 # database, searching for inconsistent changeset/revision
301 # information.
302
303 upvar 1 n n ; # Counter for the checks (we print an id before
304 # the main label).
305
306 # Find all revisions which are not used by at least one
307 # revision changeset.
308 Check \
309 {All revisions have to be used by least one revision changeset} \
310 {is not used by a revision changeset} {
311 -- Unused revisions = All revisions
312 -- - revisions used by revision changesets.
313 --
314 -- Both sets can be computed easily, and subtracted
315 -- from each other. Then we can get the associated
316 -- file (name) for display.
317
318 SELECT F.name, R.rev
319 FROM revision R, file F
320 WHERE R.rid IN (SELECT rid FROM revision -- All revisions
321 EXCEPT -- subtract
322 SELECT CR.rid FROM csrevision CR, changeset C -- revisions used
323 WHERE C.cid = CR.cid -- by any revision
324 AND C.type = 0) -- changeset
325 AND R.fid = F.fid -- get file of unused revision
326 }
327 # Find all revisions which are used by more than one revision
328 # changeset.
329 Check \
330 {All revisions have to be used by at most one revision changeset} \
331 {is used by multiple revision changesets} {
332 -- Principle of operation: Get all revision/changeset
333 -- pairs for all revision changesets, group by
334 -- revision to aggregate the changeset, counting
335 -- them. From the resulting revision/count table
336 -- select those with more than one user, and get their
337 -- associated file (name) for display.
338
339 SELECT F.name, R.rev
340 FROM revision R, file F,
341 (SELECT CR.rid AS rid, count(CR.cid) AS count
342 FROM csrevision CR, changeset C
343 WHERE C.type = 0
344 AND C.cid = CR.cid
345 GROUP BY CR.rid ) AS U
346 WHERE U.count > 1
347 AND R.rid = U.rid
348 AND R.fid = F.fid
349 }
350 # All revisions in all changesets have to agree on the LOD
351 # their changeset belongs to. In other words, all revisions in
352 # a changeset have to refer to the same line of development.
353 #
354 # Instead of looking at all pairs of revisions in all
355 # changesets we generate the distinct set of all LODs
356 # referenced by the revisions of a changeset, look for those
357 # with cardinality > 1, and get the identifying information
358 # for the changesets found thusly.
359 CheckCS \
360 {All revisions in a changeset have to belong to the same LOD} \
361 {: Its revisions disagree about the LOD they belong to} {
362 SELECT T.name, C.cid
363 FROM changeset C, cstype T
364 WHERE C.cid IN (SELECT U.cid
365 FROM (SELECT DISTINCT CR.cid AS cid, R.lod AS lod
366 FROM csrevision CR, revision R
367 WHERE CR.rid = R.rid) AS U
368 GROUP BY U.cid HAVING COUNT(U.lod) > 1)
369 AND T.tid = C.type
370 }
371 # All revisions in all changesets have to agree on the project
372 # their changeset belongs to. In other words, all revisions in
373 # a changeset have to refer to the same project.
374 #
375 # Instead of looking at all pairs of revisions in all
376 # changesets we generate the distinct set of all projects
377 # referenced by the revisions of a changeset, look for those
378 # with cardinality > 1, and get the identifying information
379 # for the changesets found thusly.
380 CheckCS \
381 {All revisions in a changeset have to belong to the same project} \
382 {: Its revisions disagree about the project they belong to} {
383 SELECT T.name, C.cid
384 FROM changeset C, cstype T
385 WHERE C.cid IN (SELECT U.cid
386 FROM (SELECT DISTINCT CR.cid AS cid, F.pid AS pid
387 FROM csrevision CR, revision R, file F
388 WHERE CR.rid = R.rid
389 AND F.fid = R.fid) AS U
390 GROUP BY U.cid HAVING COUNT(U.pid) > 1)
391 AND T.tid = C.type
392 }
393 # All revisions in a single changeset have to belong to
394 # different files. Conversely: No two revisions of a single
395 # file are allowed to be in the same changeset.
396 #
397 # Instead of looking at all pairs of revisions in all
398 # changesets we generate the distinct set of all files
399 # referenced by the revisions of a changeset, and look for
400 # those with cardinality < the cardinality of the set of
401 # revisions, and get the identifying information for the
402 # changesets found thusly.
403 CheckCS \
404 {All revisions in a changeset have to belong to different files} \
405 {: Its revisions share files} {
406 SELECT T.name, C.cid
407 FROM changeset C, cstype T
408 WHERE C.cid IN (SELECT VV.cid
409 FROM (SELECT U.cid as cid, COUNT (U.fid) AS fcount
410 FROM (SELECT DISTINCT CR.cid AS cid, R.fid AS fid
411 FROM csrevision CR, revision R
412 WHERE CR.rid = R.rid) AS U
413 GROUP BY U.cid) AS UU,
414 (SELECT V.cid AS cid, COUNT (V.rid) AS rcount
415 FROM csrevision V
416 GROUP BY V.cid) AS VV
417 WHERE VV.cid = UU.cid
418 AND UU.fcount < VV.rcount)
419 AND T.tid = C.type
420 }
421 return
422 }
423
424 proc RevisionChangesets {} {
425 # This code performs a number of paranoid checks of the
426 # database, searching for inconsistent changeset/revision
427 # information.
428
429 upvar 1 n n ; # Counter for the checks (we print an id before
430 # the main label).
431
432 # All revisions used by revision changesets have to refer to
433 # the same meta information as their changeset.
434 CheckInCS \
435 {All revisions have to agree with their revision changeset about the used meta information} \
436 {disagrees with its revision changeset @ about the meta information} {
437 SELECT CT.name, C.cid, F.name, R.rev
438 FROM changeset C, cstype CT, revision R, file F, csrevision CR
439 WHERE C.type = 0 -- revision changesets only
440 AND C.cid = CR.cid -- changeset --> its revisions
441 AND R.rid = CR.rid -- look at them
442 AND R.mid != C.src -- Only those which disagree with changeset about the meta
443 AND R.fid = F.fid -- get file of the revision
444 AND CT.tid = C.type -- get changeset type, for labeling
445 }
446 return
447 }
448
449 proc SymbolChangesets {} {
450 # This code performs a number of paranoid checks of the
451 # database, searching for inconsistent changeset/revision
452 # information.
453
454 return ; # Disabled for now, bottlenecks ...
455
456 upvar 1 n n ; # Counter for the checks (we print an id before
457 # the main label).
458
459 # The next two checks are BOTTLENECKS. In essence we are
460 # checking each symbol changeset one by one.
461
462 # TODO: Try to rephrase the checks to make more use of
463 # indices, set and stream operations.
464
465 # All revisions used by tag symbol changesets have to have the
466 # changeset's tag associated with them.
467 CheckInCS \
468 {All revisions used by tag symbol changesets have to have the changeset's tag attached to them} \
469 {does not have the tag of its symbol changeset @ attached to it} {
470 SELECT CT.name, C.cid, F.name, R.rev
471 FROM changeset C, cstype CT, revision R, file F, csrevision CR, tag T
472 WHERE C.type = 1 -- symbol changesets only
473 AND C.src = T.sid -- tag only, linked by symbol id
474 AND C.cid = CR.cid -- changeset --> its revisions
475 AND R.rid = CR.rid -- look at the revisions
476 -- and look for the tag among the attached ones.
477 AND T.sid NOT IN (SELECT TB.sid
478 FROM tag TB
479 WHERE TB.rev = R.rid)
480 AND R.fid = F.fid -- get file of revision
481 }
482
483 # All revisions used by branch symbol changesets have to have
484 # the changeset's branch associated with them.
485
486 CheckInCS \
487 {All revisions used by branch symbol changesets have to have the changeset's branch attached to them} \
488 {does not have the branch of its symbol changeset @ attached to it} {
489 SELECT CT.name, C.cid, F.name, R.rev, C.cid
490 FROM changeset C, cstype CT, revision R, file F, csrevision CR, branch B
491 WHERE C.type = 1 -- symbol changesets only
492 AND C.src = B.sid -- branches only
493 AND C.cid = CR.cid -- changeset --> its revisions
494 AND R.rid = CR.rid -- look at the revisions
495 -- and look for the branch among the attached ones.
496 AND B.sid NOT IN (SELECT BB.sid
497 FROM branch BB
498 WHERE BB.root = R.rid)
499 AND R.fid = F.fid -- get file of revision
500 }
501
502 # TODO
503 # The state has to contain at least one tag symbol changeset
504 # for all known tags.
505
506 # TODO
507 # The state has to contain at least one branch symbol changeset
508 # for all known branches.
509 return
510 }
511
512
513 proc Check {header label sql} {
514 upvar 1 n n
515 set ok 1
516 foreach {fname revnr} [state run $sql] {
517 set ok 0
518 trouble fatal "$fname <$revnr> $label"
519 }
520 log write 5 integrity "\[[format %02d [incr n]]\] [expr {$ok ? "Ok " : "Failed"}] ... $header"
521 return
522 }
523
524 proc CheckCS {header label sql} {
525 upvar 1 n n
526 set ok 1
527 foreach {ctype cid} [state run $sql] {
528 set ok 0
529 trouble fatal "<$ctype $cid> $label"
530 }
531 log write 5 integrity "\[[format %02d [incr n]]\] [expr {$ok ? "Ok " : "Failed"}] ... $header"
532 return
533 }
534
535 proc CheckInCS {header label sql} {
536 upvar 1 n n
537 set ok 1
538 foreach {cstype csid fname revnr} [state run $sql] {
539 set ok 0
540 set b "<$cstype $csid>"
541 trouble fatal "$fname <$revnr> [string map [list @ $b] $label]"
542 }
543 log write 5 integrity "\[[format %02d [incr n]]\] [expr {$ok ? "Ok " : "Failed"}] ... $header"
544 return
545 }
546
547
--- tools/cvs2fossil/lib/c2f_pbreakacycle.tcl
+++ tools/cvs2fossil/lib/c2f_pbreakacycle.tcl
@@ -76,14 +76,14 @@
7676
cyclebreaker breakcmd [myproc BreakCycle]
7777
7878
state transaction {
7979
LoadCommitOrder
8080
cyclebreaker run break-all [myproc Changesets]
81
-
82
- repository printcsetstatistics
83
- integrity changesets
8481
}
82
+
83
+ repository printcsetstatistics
84
+ integrity changesets
8585
return
8686
}
8787
8888
typemethod discard {} {
8989
# Pass manager interface. Executed for all passes after the
9090
--- tools/cvs2fossil/lib/c2f_pbreakacycle.tcl
+++ tools/cvs2fossil/lib/c2f_pbreakacycle.tcl
@@ -76,14 +76,14 @@
76 cyclebreaker breakcmd [myproc BreakCycle]
77
78 state transaction {
79 LoadCommitOrder
80 cyclebreaker run break-all [myproc Changesets]
81
82 repository printcsetstatistics
83 integrity changesets
84 }
 
 
 
85 return
86 }
87
88 typemethod discard {} {
89 # Pass manager interface. Executed for all passes after the
90
--- tools/cvs2fossil/lib/c2f_pbreakacycle.tcl
+++ tools/cvs2fossil/lib/c2f_pbreakacycle.tcl
@@ -76,14 +76,14 @@
76 cyclebreaker breakcmd [myproc BreakCycle]
77
78 state transaction {
79 LoadCommitOrder
80 cyclebreaker run break-all [myproc Changesets]
 
 
 
81 }
82
83 repository printcsetstatistics
84 integrity changesets
85 return
86 }
87
88 typemethod discard {} {
89 # Pass manager interface. Executed for all passes after the
90
--- tools/cvs2fossil/lib/c2f_pbreakrcycle.tcl
+++ tools/cvs2fossil/lib/c2f_pbreakrcycle.tcl
@@ -66,14 +66,14 @@
6666
6767
cyclebreaker breakcmd {::vc::fossil::import::cvs::cyclebreaker break}
6868
6969
state transaction {
7070
cyclebreaker run break-rev [myproc Changesets]
71
-
72
- repository printcsetstatistics
73
- integrity changesets
7471
}
72
+
73
+ repository printcsetstatistics
74
+ integrity changesets
7575
return
7676
}
7777
7878
typemethod discard {} {
7979
# Pass manager interface. Executed for all passes after the
8080
--- tools/cvs2fossil/lib/c2f_pbreakrcycle.tcl
+++ tools/cvs2fossil/lib/c2f_pbreakrcycle.tcl
@@ -66,14 +66,14 @@
66
67 cyclebreaker breakcmd {::vc::fossil::import::cvs::cyclebreaker break}
68
69 state transaction {
70 cyclebreaker run break-rev [myproc Changesets]
71
72 repository printcsetstatistics
73 integrity changesets
74 }
 
 
 
75 return
76 }
77
78 typemethod discard {} {
79 # Pass manager interface. Executed for all passes after the
80
--- tools/cvs2fossil/lib/c2f_pbreakrcycle.tcl
+++ tools/cvs2fossil/lib/c2f_pbreakrcycle.tcl
@@ -66,14 +66,14 @@
66
67 cyclebreaker breakcmd {::vc::fossil::import::cvs::cyclebreaker break}
68
69 state transaction {
70 cyclebreaker run break-rev [myproc Changesets]
 
 
 
71 }
72
73 repository printcsetstatistics
74 integrity changesets
75 return
76 }
77
78 typemethod discard {} {
79 # Pass manager interface. Executed for all passes after the
80
--- tools/cvs2fossil/lib/c2f_pbreakscycle.tcl
+++ tools/cvs2fossil/lib/c2f_pbreakscycle.tcl
@@ -65,14 +65,14 @@
6565
6666
cyclebreaker breakcmd {::vc::fossil::import::cvs::cyclebreaker break}
6767
6868
state transaction {
6969
cyclebreaker run break-sym [myproc Changesets]
70
-
71
- repository printcsetstatistics
72
- integrity changesets
7370
}
71
+
72
+ repository printcsetstatistics
73
+ integrity changesets
7474
return
7575
}
7676
7777
typemethod discard {} {
7878
# Pass manager interface. Executed for all passes after the
7979
--- tools/cvs2fossil/lib/c2f_pbreakscycle.tcl
+++ tools/cvs2fossil/lib/c2f_pbreakscycle.tcl
@@ -65,14 +65,14 @@
65
66 cyclebreaker breakcmd {::vc::fossil::import::cvs::cyclebreaker break}
67
68 state transaction {
69 cyclebreaker run break-sym [myproc Changesets]
70
71 repository printcsetstatistics
72 integrity changesets
73 }
 
 
 
74 return
75 }
76
77 typemethod discard {} {
78 # Pass manager interface. Executed for all passes after the
79
--- tools/cvs2fossil/lib/c2f_pbreakscycle.tcl
+++ tools/cvs2fossil/lib/c2f_pbreakscycle.tcl
@@ -65,14 +65,14 @@
65
66 cyclebreaker breakcmd {::vc::fossil::import::cvs::cyclebreaker break}
67
68 state transaction {
69 cyclebreaker run break-sym [myproc Changesets]
 
 
 
70 }
71
72 repository printcsetstatistics
73 integrity changesets
74 return
75 }
76
77 typemethod discard {} {
78 # Pass manager interface. Executed for all passes after the
79
--- tools/cvs2fossil/lib/c2f_pinitcsets.tcl
+++ tools/cvs2fossil/lib/c2f_pinitcsets.tcl
@@ -132,14 +132,14 @@
132132
state transaction {
133133
CreateRevisionChangesets ; # Group file revisions into csets.
134134
BreakInternalDependencies ; # Split the csets based on internal conflicts.
135135
CreateSymbolChangesets ; # Create csets for tags and branches.
136136
PersistTheChangesets
137
-
138
- repository printcsetstatistics
139
- integrity changesets
140137
}
138
+
139
+ repository printcsetstatistics
140
+ integrity changesets
141141
return
142142
}
143143
144144
typemethod discard {} {
145145
# Pass manager interface. Executed for all passes after the
146146
--- tools/cvs2fossil/lib/c2f_pinitcsets.tcl
+++ tools/cvs2fossil/lib/c2f_pinitcsets.tcl
@@ -132,14 +132,14 @@
132 state transaction {
133 CreateRevisionChangesets ; # Group file revisions into csets.
134 BreakInternalDependencies ; # Split the csets based on internal conflicts.
135 CreateSymbolChangesets ; # Create csets for tags and branches.
136 PersistTheChangesets
137
138 repository printcsetstatistics
139 integrity changesets
140 }
 
 
 
141 return
142 }
143
144 typemethod discard {} {
145 # Pass manager interface. Executed for all passes after the
146
--- tools/cvs2fossil/lib/c2f_pinitcsets.tcl
+++ tools/cvs2fossil/lib/c2f_pinitcsets.tcl
@@ -132,14 +132,14 @@
132 state transaction {
133 CreateRevisionChangesets ; # Group file revisions into csets.
134 BreakInternalDependencies ; # Split the csets based on internal conflicts.
135 CreateSymbolChangesets ; # Create csets for tags and branches.
136 PersistTheChangesets
 
 
 
137 }
138
139 repository printcsetstatistics
140 integrity changesets
141 return
142 }
143
144 typemethod discard {} {
145 # Pass manager interface. Executed for all passes after the
146

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button