Fossil SCM

Shuffled and updated the existing checks of revision changesets.

aku 2007-11-29 06:40 trunk
Commit de10b2301e874f9edb4cb1b9249b540a157a10b9
--- tools/cvs2fossil/lib/c2f_integrity.tcl
+++ tools/cvs2fossil/lib/c2f_integrity.tcl
@@ -300,44 +300,46 @@
300300
;
301301
}
302302
return
303303
}
304304
305
- proc AllChangesets {} {
305
+ proc RevisionChangesets {} {
306306
# This code performs a number of paranoid checks of the
307307
# database, searching for inconsistent changeset/revision
308308
# information.
309309
310310
upvar 1 n n ; # Counter for the checks (we print an id before
311311
# the main label).
312312
313313
# Find all revisions which are not used by at least one
314
- # revision changeset.
314
+ # changeset.
315315
CheckRev \
316
- {All revisions have to be used by least one revision changeset} \
317
- {is not used by a revision changeset} {
316
+ {All revisions have to be used by least one changeset} \
317
+ {is not used by a changeset} {
318318
-- Unused revisions = All revisions
319319
-- - revisions used by revision changesets.
320320
--
321321
-- Both sets can be computed easily, and subtracted
322322
-- from each other. Then we can get the associated
323323
-- file (name) for display.
324324
325325
SELECT F.name, R.rev
326326
FROM revision R, file F
327
- WHERE R.rid IN (SELECT rid FROM revision -- All revisions
328
- EXCEPT -- subtract
329
- SELECT CR.rid FROM csrevision CR, changeset C -- revisions used
330
- WHERE C.cid = CR.cid -- by any revision
331
- AND C.type = 0) -- changeset
327
+ WHERE R.rid IN (SELECT rid
328
+ FROM revision -- All revisions
329
+ EXCEPT -- subtract
330
+ SELECT CR.rid
331
+ FROM csrevision CR, changeset C -- revisions used
332
+ WHERE C.cid = CR.cid -- by any revision
333
+ AND C.type = 0) -- changeset
332334
AND R.fid = F.fid -- get file of unused revision
333335
}
334
- # Find all revisions which are used by more than one revision
336
+ # Find all revisions which are used by more than one
335337
# changeset.
336338
CheckRev \
337
- {All revisions have to be used by at most one revision changeset} \
338
- {is used by multiple revision changesets} {
339
+ {All revisions have to be used by at most one changeset} \
340
+ {is used by multiple changesets} {
339341
-- Principle of operation: Get all revision/changeset
340342
-- pairs for all revision changesets, group by
341343
-- revision to aggregate the changeset, counting
342344
-- them. From the resulting revision/count table
343345
-- select those with more than one user, and get their
@@ -347,18 +349,32 @@
347349
FROM revision R, file F,
348350
(SELECT CR.rid AS rid, count(CR.cid) AS count
349351
FROM csrevision CR, changeset C
350352
WHERE C.type = 0
351353
AND C.cid = CR.cid
352
- GROUP BY CR.rid ) AS U
354
+ GROUP BY CR.rid) AS U
353355
WHERE U.count > 1
354356
AND R.rid = U.rid
355357
AND R.fid = F.fid
356358
}
357
- # All revisions in all changesets have to agree on the LOD
358
- # their changeset belongs to. In other words, all revisions in
359
- # a changeset have to refer to the same line of development.
359
+ # All revisions have to refer to the same meta information as
360
+ # their changeset.
361
+ CheckRevCS \
362
+ {All revisions have to agree with their changeset about the used meta information} \
363
+ {disagrees with its changeset @ about the meta information} {
364
+ SELECT CT.name, C.cid, F.name, R.rev
365
+ FROM changeset C, cstype CT, revision R, file F, csrevision CR
366
+ WHERE C.type = 0 -- revision changesets only
367
+ AND C.cid = CR.cid -- changeset --> its revisions
368
+ AND R.rid = CR.rid -- look at them
369
+ AND R.mid != C.src -- Only those which disagree with changeset about the meta
370
+ AND R.fid = F.fid -- get file of the revision
371
+ AND CT.tid = C.type -- get changeset type, for labeling
372
+ }
373
+ # All revisions have to agree on the LOD their changeset
374
+ # belongs to. In other words, all revisions in a changeset
375
+ # have to refer to the same line of development.
360376
#
361377
# Instead of looking at all pairs of revisions in all
362378
# changesets we generate the distinct set of all LODs
363379
# referenced by the revisions of a changeset, look for those
364380
# with cardinality > 1, and get the identifying information
@@ -368,18 +384,20 @@
368384
{: Its revisions disagree about the LOD they belong to} {
369385
SELECT T.name, C.cid
370386
FROM changeset C, cstype T
371387
WHERE C.cid IN (SELECT U.cid
372388
FROM (SELECT DISTINCT CR.cid AS cid, R.lod AS lod
373
- FROM csrevision CR, revision R
374
- WHERE CR.rid = R.rid) AS U
389
+ FROM csrevision CR, changeset C, revision R
390
+ WHERE CR.rid = R.rid
391
+ AND C.cid = CR.cid
392
+ AND C.type = 0) AS U
375393
GROUP BY U.cid HAVING COUNT(U.lod) > 1)
376394
AND T.tid = C.type
377395
}
378
- # All revisions in all changesets have to agree on the project
379
- # their changeset belongs to. In other words, all revisions in
380
- # a changeset have to refer to the same project.
396
+ # All revisions have to agree on the project their changeset
397
+ # belongs to. In other words, all revisions in a changeset
398
+ # have to refer to the same project.
381399
#
382400
# Instead of looking at all pairs of revisions in all
383401
# changesets we generate the distinct set of all projects
384402
# referenced by the revisions of a changeset, look for those
385403
# with cardinality > 1, and get the identifying information
@@ -389,12 +407,14 @@
389407
{: Its revisions disagree about the project they belong to} {
390408
SELECT T.name, C.cid
391409
FROM changeset C, cstype T
392410
WHERE C.cid IN (SELECT U.cid
393411
FROM (SELECT DISTINCT CR.cid AS cid, F.pid AS pid
394
- FROM csrevision CR, revision R, file F
412
+ FROM csrevision CR, changeset C, revision R, file F
395413
WHERE CR.rid = R.rid
414
+ AND C.cid = CR.cid
415
+ AND C.type = 0
396416
AND F.fid = R.fid) AS U
397417
GROUP BY U.cid HAVING COUNT(U.pid) > 1)
398418
AND T.tid = C.type
399419
}
400420
# All revisions in a single changeset have to belong to
@@ -413,71 +433,47 @@
413433
SELECT T.name, C.cid
414434
FROM changeset C, cstype T
415435
WHERE C.cid IN (SELECT VV.cid
416436
FROM (SELECT U.cid as cid, COUNT (U.fid) AS fcount
417437
FROM (SELECT DISTINCT CR.cid AS cid, R.fid AS fid
418
- FROM csrevision CR, revision R
419
- WHERE CR.rid = R.rid) AS U
438
+ FROM csrevision CR, changeset C, revision R
439
+ WHERE CR.rid = R.rid
440
+ AND C.cid = CR.cid
441
+ AND C.type = 0
442
+ ) AS U
420443
GROUP BY U.cid) AS UU,
421444
(SELECT V.cid AS cid, COUNT (V.rid) AS rcount
422
- FROM csrevision V
445
+ FROM csrevision V, changeset X
446
+ WHERE X.cid = V.cid
447
+ AND X.type = 0
423448
GROUP BY V.cid) AS VV
424449
WHERE VV.cid = UU.cid
425450
AND UU.fcount < VV.rcount)
426451
AND T.tid = C.type
427452
}
428453
return
429454
}
430455
431
- proc RevisionChangesets {} {
432
- # This code performs a number of paranoid checks of the
433
- # database, searching for inconsistent changeset/revision
434
- # information.
435
-
436
- upvar 1 n n ; # Counter for the checks (we print an id before
437
- # the main label).
438
-
439
- # All revisions used by revision changesets have to refer to
440
- # the same meta information as their changeset.
441
- CheckInCS \
442
- {All revisions have to agree with their revision changeset about the used meta information} \
443
- {disagrees with its revision changeset @ about the meta information} {
444
- SELECT CT.name, C.cid, F.name, R.rev
445
- FROM changeset C, cstype CT, revision R, file F, csrevision CR
446
- WHERE C.type = 0 -- revision changesets only
447
- AND C.cid = CR.cid -- changeset --> its revisions
448
- AND R.rid = CR.rid -- look at them
449
- AND R.mid != C.src -- Only those which disagree with changeset about the meta
450
- AND R.fid = F.fid -- get file of the revision
451
- AND CT.tid = C.type -- get changeset type, for labeling
452
- }
453
- return
454
- }
455
-
456456
proc TagChangesets {} {
457457
# This code performs a number of paranoid checks of the
458458
# database, searching for inconsistent changeset/revision
459459
# information.
460460
461
- return ; # Disabled for now, bottlenecks ...
462
-
463461
upvar 1 n n ; # Counter for the checks (we print an id before
464462
# the main label).
465463
}
466464
467465
proc BranchChangesets {} {
468466
# This code performs a number of paranoid checks of the
469467
# database, searching for inconsistent changeset/revision
470468
# information.
471469
472
- return ; # Disabled for now, bottlenecks ...
473
-
474470
upvar 1 n n ; # Counter for the checks (we print an id before
475471
# the main label).
476472
}
477473
478
- proc SymbolChangesets {} {
474
+ proc ___UnusedChangesetChecks___ {} {
479475
# This code performs a number of paranoid checks of the
480476
# database, searching for inconsistent changeset/revision
481477
# information.
482478
483479
return ; # Disabled for now, bottlenecks ...
@@ -491,11 +487,11 @@
491487
# TODO: Try to rephrase the checks to make more use of
492488
# indices, set and stream operations.
493489
494490
# All revisions used by tag symbol changesets have to have the
495491
# changeset's tag associated with them.
496
- CheckInCS \
492
+ CheckRevCS \
497493
{All revisions used by tag symbol changesets have to have the changeset's tag attached to them} \
498494
{does not have the tag of its symbol changeset @ attached to it} {
499495
SELECT CT.name, C.cid, F.name, R.rev
500496
FROM changeset C, cstype CT, revision R, file F, csrevision CR, tag T
501497
WHERE C.type = 1 -- symbol changesets only
@@ -510,11 +506,11 @@
510506
}
511507
512508
# All revisions used by branch symbol changesets have to have
513509
# the changeset's branch associated with them.
514510
515
- CheckInCS \
511
+ CheckRevCS \
516512
{All revisions used by branch symbol changesets have to have the changeset's branch attached to them} \
517513
{does not have the branch of its symbol changeset @ attached to it} {
518514
SELECT CT.name, C.cid, F.name, R.rev, C.cid
519515
FROM changeset C, cstype CT, revision R, file F, csrevision CR, branch B
520516
WHERE C.type = 1 -- symbol changesets only
@@ -542,11 +538,11 @@
542538
proc CheckRev {header label sql} {
543539
upvar 1 n n
544540
set ok 1
545541
foreach {fname revnr} [state run $sql] {
546542
set ok 0
547
- trouble fatal "$fname <$revnr> $label"
543
+ trouble fatal "${revnr}::$fname $label"
548544
}
549545
log write 5 integrity {\[[format %02d [incr n]]\] [expr {$ok ? "Ok " : "Failed"}] ... $header}
550546
return
551547
}
552548
@@ -581,11 +577,11 @@
581577
}
582578
log write 5 integrity {\[[format %02d [incr n]]\] [expr {$ok ? "Ok " : "Failed"}] ... $header}
583579
return
584580
}
585581
586
- proc CheckInCS {header label sql} {
582
+ proc CheckRevCS {header label sql} {
587583
upvar 1 n n
588584
set ok 1
589585
foreach {cstype csid fname revnr} [state run $sql] {
590586
set ok 0
591587
set b "<$cstype $csid>"
592588
--- tools/cvs2fossil/lib/c2f_integrity.tcl
+++ tools/cvs2fossil/lib/c2f_integrity.tcl
@@ -300,44 +300,46 @@
300 ;
301 }
302 return
303 }
304
305 proc AllChangesets {} {
306 # This code performs a number of paranoid checks of the
307 # database, searching for inconsistent changeset/revision
308 # information.
309
310 upvar 1 n n ; # Counter for the checks (we print an id before
311 # the main label).
312
313 # Find all revisions which are not used by at least one
314 # revision changeset.
315 CheckRev \
316 {All revisions have to be used by least one revision changeset} \
317 {is not used by a revision changeset} {
318 -- Unused revisions = All revisions
319 -- - revisions used by revision changesets.
320 --
321 -- Both sets can be computed easily, and subtracted
322 -- from each other. Then we can get the associated
323 -- file (name) for display.
324
325 SELECT F.name, R.rev
326 FROM revision R, file F
327 WHERE R.rid IN (SELECT rid FROM revision -- All revisions
328 EXCEPT -- subtract
329 SELECT CR.rid FROM csrevision CR, changeset C -- revisions used
330 WHERE C.cid = CR.cid -- by any revision
331 AND C.type = 0) -- changeset
 
 
332 AND R.fid = F.fid -- get file of unused revision
333 }
334 # Find all revisions which are used by more than one revision
335 # changeset.
336 CheckRev \
337 {All revisions have to be used by at most one revision changeset} \
338 {is used by multiple revision changesets} {
339 -- Principle of operation: Get all revision/changeset
340 -- pairs for all revision changesets, group by
341 -- revision to aggregate the changeset, counting
342 -- them. From the resulting revision/count table
343 -- select those with more than one user, and get their
@@ -347,18 +349,32 @@
347 FROM revision R, file F,
348 (SELECT CR.rid AS rid, count(CR.cid) AS count
349 FROM csrevision CR, changeset C
350 WHERE C.type = 0
351 AND C.cid = CR.cid
352 GROUP BY CR.rid ) AS U
353 WHERE U.count > 1
354 AND R.rid = U.rid
355 AND R.fid = F.fid
356 }
357 # All revisions in all changesets have to agree on the LOD
358 # their changeset belongs to. In other words, all revisions in
359 # a changeset have to refer to the same line of development.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
360 #
361 # Instead of looking at all pairs of revisions in all
362 # changesets we generate the distinct set of all LODs
363 # referenced by the revisions of a changeset, look for those
364 # with cardinality > 1, and get the identifying information
@@ -368,18 +384,20 @@
368 {: Its revisions disagree about the LOD they belong to} {
369 SELECT T.name, C.cid
370 FROM changeset C, cstype T
371 WHERE C.cid IN (SELECT U.cid
372 FROM (SELECT DISTINCT CR.cid AS cid, R.lod AS lod
373 FROM csrevision CR, revision R
374 WHERE CR.rid = R.rid) AS U
 
 
375 GROUP BY U.cid HAVING COUNT(U.lod) > 1)
376 AND T.tid = C.type
377 }
378 # All revisions in all changesets have to agree on the project
379 # their changeset belongs to. In other words, all revisions in
380 # a changeset have to refer to the same project.
381 #
382 # Instead of looking at all pairs of revisions in all
383 # changesets we generate the distinct set of all projects
384 # referenced by the revisions of a changeset, look for those
385 # with cardinality > 1, and get the identifying information
@@ -389,12 +407,14 @@
389 {: Its revisions disagree about the project they belong to} {
390 SELECT T.name, C.cid
391 FROM changeset C, cstype T
392 WHERE C.cid IN (SELECT U.cid
393 FROM (SELECT DISTINCT CR.cid AS cid, F.pid AS pid
394 FROM csrevision CR, revision R, file F
395 WHERE CR.rid = R.rid
 
 
396 AND F.fid = R.fid) AS U
397 GROUP BY U.cid HAVING COUNT(U.pid) > 1)
398 AND T.tid = C.type
399 }
400 # All revisions in a single changeset have to belong to
@@ -413,71 +433,47 @@
413 SELECT T.name, C.cid
414 FROM changeset C, cstype T
415 WHERE C.cid IN (SELECT VV.cid
416 FROM (SELECT U.cid as cid, COUNT (U.fid) AS fcount
417 FROM (SELECT DISTINCT CR.cid AS cid, R.fid AS fid
418 FROM csrevision CR, revision R
419 WHERE CR.rid = R.rid) AS U
 
 
 
420 GROUP BY U.cid) AS UU,
421 (SELECT V.cid AS cid, COUNT (V.rid) AS rcount
422 FROM csrevision V
 
 
423 GROUP BY V.cid) AS VV
424 WHERE VV.cid = UU.cid
425 AND UU.fcount < VV.rcount)
426 AND T.tid = C.type
427 }
428 return
429 }
430
431 proc RevisionChangesets {} {
432 # This code performs a number of paranoid checks of the
433 # database, searching for inconsistent changeset/revision
434 # information.
435
436 upvar 1 n n ; # Counter for the checks (we print an id before
437 # the main label).
438
439 # All revisions used by revision changesets have to refer to
440 # the same meta information as their changeset.
441 CheckInCS \
442 {All revisions have to agree with their revision changeset about the used meta information} \
443 {disagrees with its revision changeset @ about the meta information} {
444 SELECT CT.name, C.cid, F.name, R.rev
445 FROM changeset C, cstype CT, revision R, file F, csrevision CR
446 WHERE C.type = 0 -- revision changesets only
447 AND C.cid = CR.cid -- changeset --> its revisions
448 AND R.rid = CR.rid -- look at them
449 AND R.mid != C.src -- Only those which disagree with changeset about the meta
450 AND R.fid = F.fid -- get file of the revision
451 AND CT.tid = C.type -- get changeset type, for labeling
452 }
453 return
454 }
455
456 proc TagChangesets {} {
457 # This code performs a number of paranoid checks of the
458 # database, searching for inconsistent changeset/revision
459 # information.
460
461 return ; # Disabled for now, bottlenecks ...
462
463 upvar 1 n n ; # Counter for the checks (we print an id before
464 # the main label).
465 }
466
467 proc BranchChangesets {} {
468 # This code performs a number of paranoid checks of the
469 # database, searching for inconsistent changeset/revision
470 # information.
471
472 return ; # Disabled for now, bottlenecks ...
473
474 upvar 1 n n ; # Counter for the checks (we print an id before
475 # the main label).
476 }
477
478 proc SymbolChangesets {} {
479 # This code performs a number of paranoid checks of the
480 # database, searching for inconsistent changeset/revision
481 # information.
482
483 return ; # Disabled for now, bottlenecks ...
@@ -491,11 +487,11 @@
491 # TODO: Try to rephrase the checks to make more use of
492 # indices, set and stream operations.
493
494 # All revisions used by tag symbol changesets have to have the
495 # changeset's tag associated with them.
496 CheckInCS \
497 {All revisions used by tag symbol changesets have to have the changeset's tag attached to them} \
498 {does not have the tag of its symbol changeset @ attached to it} {
499 SELECT CT.name, C.cid, F.name, R.rev
500 FROM changeset C, cstype CT, revision R, file F, csrevision CR, tag T
501 WHERE C.type = 1 -- symbol changesets only
@@ -510,11 +506,11 @@
510 }
511
512 # All revisions used by branch symbol changesets have to have
513 # the changeset's branch associated with them.
514
515 CheckInCS \
516 {All revisions used by branch symbol changesets have to have the changeset's branch attached to them} \
517 {does not have the branch of its symbol changeset @ attached to it} {
518 SELECT CT.name, C.cid, F.name, R.rev, C.cid
519 FROM changeset C, cstype CT, revision R, file F, csrevision CR, branch B
520 WHERE C.type = 1 -- symbol changesets only
@@ -542,11 +538,11 @@
542 proc CheckRev {header label sql} {
543 upvar 1 n n
544 set ok 1
545 foreach {fname revnr} [state run $sql] {
546 set ok 0
547 trouble fatal "$fname <$revnr> $label"
548 }
549 log write 5 integrity {\[[format %02d [incr n]]\] [expr {$ok ? "Ok " : "Failed"}] ... $header}
550 return
551 }
552
@@ -581,11 +577,11 @@
581 }
582 log write 5 integrity {\[[format %02d [incr n]]\] [expr {$ok ? "Ok " : "Failed"}] ... $header}
583 return
584 }
585
586 proc CheckInCS {header label sql} {
587 upvar 1 n n
588 set ok 1
589 foreach {cstype csid fname revnr} [state run $sql] {
590 set ok 0
591 set b "<$cstype $csid>"
592
--- tools/cvs2fossil/lib/c2f_integrity.tcl
+++ tools/cvs2fossil/lib/c2f_integrity.tcl
@@ -300,44 +300,46 @@
300 ;
301 }
302 return
303 }
304
305 proc RevisionChangesets {} {
306 # This code performs a number of paranoid checks of the
307 # database, searching for inconsistent changeset/revision
308 # information.
309
310 upvar 1 n n ; # Counter for the checks (we print an id before
311 # the main label).
312
313 # Find all revisions which are not used by at least one
314 # changeset.
315 CheckRev \
316 {All revisions have to be used by least one changeset} \
317 {is not used by a changeset} {
318 -- Unused revisions = All revisions
319 -- - revisions used by revision changesets.
320 --
321 -- Both sets can be computed easily, and subtracted
322 -- from each other. Then we can get the associated
323 -- file (name) for display.
324
325 SELECT F.name, R.rev
326 FROM revision R, file F
327 WHERE R.rid IN (SELECT rid
328 FROM revision -- All revisions
329 EXCEPT -- subtract
330 SELECT CR.rid
331 FROM csrevision CR, changeset C -- revisions used
332 WHERE C.cid = CR.cid -- by any revision
333 AND C.type = 0) -- changeset
334 AND R.fid = F.fid -- get file of unused revision
335 }
336 # Find all revisions which are used by more than one
337 # changeset.
338 CheckRev \
339 {All revisions have to be used by at most one changeset} \
340 {is used by multiple changesets} {
341 -- Principle of operation: Get all revision/changeset
342 -- pairs for all revision changesets, group by
343 -- revision to aggregate the changeset, counting
344 -- them. From the resulting revision/count table
345 -- select those with more than one user, and get their
@@ -347,18 +349,32 @@
349 FROM revision R, file F,
350 (SELECT CR.rid AS rid, count(CR.cid) AS count
351 FROM csrevision CR, changeset C
352 WHERE C.type = 0
353 AND C.cid = CR.cid
354 GROUP BY CR.rid) AS U
355 WHERE U.count > 1
356 AND R.rid = U.rid
357 AND R.fid = F.fid
358 }
359 # All revisions have to refer to the same meta information as
360 # their changeset.
361 CheckRevCS \
362 {All revisions have to agree with their changeset about the used meta information} \
363 {disagrees with its changeset @ about the meta information} {
364 SELECT CT.name, C.cid, F.name, R.rev
365 FROM changeset C, cstype CT, revision R, file F, csrevision CR
366 WHERE C.type = 0 -- revision changesets only
367 AND C.cid = CR.cid -- changeset --> its revisions
368 AND R.rid = CR.rid -- look at them
369 AND R.mid != C.src -- Only those which disagree with changeset about the meta
370 AND R.fid = F.fid -- get file of the revision
371 AND CT.tid = C.type -- get changeset type, for labeling
372 }
373 # All revisions have to agree on the LOD their changeset
374 # belongs to. In other words, all revisions in a changeset
375 # have to refer to the same line of development.
376 #
377 # Instead of looking at all pairs of revisions in all
378 # changesets we generate the distinct set of all LODs
379 # referenced by the revisions of a changeset, look for those
380 # with cardinality > 1, and get the identifying information
@@ -368,18 +384,20 @@
384 {: Its revisions disagree about the LOD they belong to} {
385 SELECT T.name, C.cid
386 FROM changeset C, cstype T
387 WHERE C.cid IN (SELECT U.cid
388 FROM (SELECT DISTINCT CR.cid AS cid, R.lod AS lod
389 FROM csrevision CR, changeset C, revision R
390 WHERE CR.rid = R.rid
391 AND C.cid = CR.cid
392 AND C.type = 0) AS U
393 GROUP BY U.cid HAVING COUNT(U.lod) > 1)
394 AND T.tid = C.type
395 }
396 # All revisions have to agree on the project their changeset
397 # belongs to. In other words, all revisions in a changeset
398 # have to refer to the same project.
399 #
400 # Instead of looking at all pairs of revisions in all
401 # changesets we generate the distinct set of all projects
402 # referenced by the revisions of a changeset, look for those
403 # with cardinality > 1, and get the identifying information
@@ -389,12 +407,14 @@
407 {: Its revisions disagree about the project they belong to} {
408 SELECT T.name, C.cid
409 FROM changeset C, cstype T
410 WHERE C.cid IN (SELECT U.cid
411 FROM (SELECT DISTINCT CR.cid AS cid, F.pid AS pid
412 FROM csrevision CR, changeset C, revision R, file F
413 WHERE CR.rid = R.rid
414 AND C.cid = CR.cid
415 AND C.type = 0
416 AND F.fid = R.fid) AS U
417 GROUP BY U.cid HAVING COUNT(U.pid) > 1)
418 AND T.tid = C.type
419 }
420 # All revisions in a single changeset have to belong to
@@ -413,71 +433,47 @@
433 SELECT T.name, C.cid
434 FROM changeset C, cstype T
435 WHERE C.cid IN (SELECT VV.cid
436 FROM (SELECT U.cid as cid, COUNT (U.fid) AS fcount
437 FROM (SELECT DISTINCT CR.cid AS cid, R.fid AS fid
438 FROM csrevision CR, changeset C, revision R
439 WHERE CR.rid = R.rid
440 AND C.cid = CR.cid
441 AND C.type = 0
442 ) AS U
443 GROUP BY U.cid) AS UU,
444 (SELECT V.cid AS cid, COUNT (V.rid) AS rcount
445 FROM csrevision V, changeset X
446 WHERE X.cid = V.cid
447 AND X.type = 0
448 GROUP BY V.cid) AS VV
449 WHERE VV.cid = UU.cid
450 AND UU.fcount < VV.rcount)
451 AND T.tid = C.type
452 }
453 return
454 }
455
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
456 proc TagChangesets {} {
457 # This code performs a number of paranoid checks of the
458 # database, searching for inconsistent changeset/revision
459 # information.
460
 
 
461 upvar 1 n n ; # Counter for the checks (we print an id before
462 # the main label).
463 }
464
465 proc BranchChangesets {} {
466 # This code performs a number of paranoid checks of the
467 # database, searching for inconsistent changeset/revision
468 # information.
469
 
 
470 upvar 1 n n ; # Counter for the checks (we print an id before
471 # the main label).
472 }
473
474 proc ___UnusedChangesetChecks___ {} {
475 # This code performs a number of paranoid checks of the
476 # database, searching for inconsistent changeset/revision
477 # information.
478
479 return ; # Disabled for now, bottlenecks ...
@@ -491,11 +487,11 @@
487 # TODO: Try to rephrase the checks to make more use of
488 # indices, set and stream operations.
489
490 # All revisions used by tag symbol changesets have to have the
491 # changeset's tag associated with them.
492 CheckRevCS \
493 {All revisions used by tag symbol changesets have to have the changeset's tag attached to them} \
494 {does not have the tag of its symbol changeset @ attached to it} {
495 SELECT CT.name, C.cid, F.name, R.rev
496 FROM changeset C, cstype CT, revision R, file F, csrevision CR, tag T
497 WHERE C.type = 1 -- symbol changesets only
@@ -510,11 +506,11 @@
506 }
507
508 # All revisions used by branch symbol changesets have to have
509 # the changeset's branch associated with them.
510
511 CheckRevCS \
512 {All revisions used by branch symbol changesets have to have the changeset's branch attached to them} \
513 {does not have the branch of its symbol changeset @ attached to it} {
514 SELECT CT.name, C.cid, F.name, R.rev, C.cid
515 FROM changeset C, cstype CT, revision R, file F, csrevision CR, branch B
516 WHERE C.type = 1 -- symbol changesets only
@@ -542,11 +538,11 @@
538 proc CheckRev {header label sql} {
539 upvar 1 n n
540 set ok 1
541 foreach {fname revnr} [state run $sql] {
542 set ok 0
543 trouble fatal "${revnr}::$fname $label"
544 }
545 log write 5 integrity {\[[format %02d [incr n]]\] [expr {$ok ? "Ok " : "Failed"}] ... $header}
546 return
547 }
548
@@ -581,11 +577,11 @@
577 }
578 log write 5 integrity {\[[format %02d [incr n]]\] [expr {$ok ? "Ok " : "Failed"}] ... $header}
579 return
580 }
581
582 proc CheckRevCS {header label sql} {
583 upvar 1 n n
584 set ok 1
585 foreach {cstype csid fname revnr} [state run $sql] {
586 set ok 0
587 set b "<$cstype $csid>"
588

Keyboard Shortcuts

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