@@ -56,11 +56,11 @@
typemethod changesets {} {
log write 4 integrity {Check database consistency}
set n 0
- AllChangesets
RevisionChangesets
- SymbolChangesets
+ TagChangesets
+ BranchChangesets
return
}
# # ## ### ##### ######## #############
@@ -74,9 +74,9 @@
# the main label).
# Find all revisions which disagree with their line of
# development about the project they are owned by.
- Check \
+ CheckRev \
{Revisions and their LODs have to be in the same project} \
{disagrees with its LOD about owning project} {
SELECT F.name, R.rev
FROM revision R, file F, symbol S
@@ -86,9 +86,9 @@
;
}
# Find all revisions which disgree with their meta data about
# the project they are owned by.
- Check \
+ CheckRev \
{Revisions and their meta data have to be in the same project} \
{disagrees with its meta data about owning project} {
SELECT F.name, R.rev
FROM revision R, file F, meta M
@@ -98,9 +98,9 @@
;
}
# Find all revisions with a primary child which disagrees
# about the file they belong to.
- Check \
+ CheckRev \
{Revisions and their primary children have to be in the same file} \
{disagrees with its primary child about the owning file} {
SELECT F.name, R.rev
FROM revision R, revision C, file F
@@ -112,9 +112,9 @@
}
# Find all revisions with a branch parent symbol whose parent
# disagrees about the file they belong to.
- Check \
+ CheckRev \
{Revisions and their branch children have to be in the same file} \
{at the beginning of its branch and its parent disagree about the owning file} {
SELECT F.name, R.rev
FROM revision R, revision P, file F
@@ -125,9 +125,9 @@
;
}
# Find all revisions with a non-NTDB child which disagrees
# about the file they belong to.
- Check \
+ CheckRev \
{Revisions and their non-NTDB children have to be in the same file} \
{disagrees with its non-NTDB child about the owning file} {
SELECT F.name, R.rev
FROM revision R, revision C, file F
@@ -138,9 +138,9 @@
;
}
# Find all revisions which have a primary child, but the child
# does not have them as parent.
- Check \
+ CheckRev \
{Revisions have to be parents of their primary children} \
{is not the parent of its primary child} {
SELECT F.name, R.rev
FROM revision R, revision C, file F
@@ -151,9 +151,9 @@
;
}
# Find all revisions which have a primrary child, but the
# child has a branch parent symbol making them brach starters.
- Check \
+ CheckRev \
{Primary children of revisions must not start branches} \
{is parent of a primary child which is the beginning of a branch} {
SELECT F.name, R.rev
FROM revision R, revision C, file F
@@ -164,9 +164,9 @@
;
}
# Find all revisions without branch parent symbol which have a
# parent, but the parent does not have them as primary child.
- Check \
+ CheckRev \
{Revisions have to be primary children of their parents, if any} \
{is not the child of its parent} {
SELECT F.name, R.rev
FROM revision R, revision P, file F
@@ -178,9 +178,9 @@
;
}
# Find all revisions with a branch parent symbol which do not
# have a parent.
- Check \
+ CheckRev \
{Branch starting revisions have to have a parent} \
{at the beginning of its branch has no parent} {
SELECT F.name, R.rev
FROM revision R, file F
@@ -190,9 +190,9 @@
;
}
# Find all revisions with a branch parent symbol whose parent
# has them as primary child.
- Check \
+ CheckRev \
{Branch starting revisions must not be primary children of their parents} \
{at the beginning of its branch is the primary child of its parent} {
SELECT F.name, R.rev
FROM revision R, revision P, file F
@@ -204,9 +204,9 @@
;
}
# Find all revisions with a non-NTDB child which are not on
# the NTDB.
- Check \
+ CheckRev \
{NTDB to trunk transition has to begin on NTDB} \
{has a non-NTDB child, yet is not on the NTDB} {
SELECT F.name, R.rev
FROM revision R, file F
@@ -215,9 +215,9 @@
AND NOT R.isdefault
;
}
# Find all revisions with a NTDB parent which are on the NTDB.
- Check \
+ CheckRev \
{NTDB to trunk transition has to end on non-NTDB} \
{has a NTDB parent, yet is on the NTDB} {
SELECT F.name, R.rev
FROM revision R, file F
@@ -227,9 +227,9 @@
;
}
# Find all revisions with a child which disagrees about the
# line of development they belong to.
- Check \
+ CheckRev \
{Revisions and their primary children have to be in the same LOD} \
{and its primary child disagree about their LOD} {
SELECT F.name, R.rev
FROM revision R, revision C, file F
@@ -240,9 +240,9 @@
;
}
# Find all revisions with a non-NTDB child which agrees about
# the line of development they belong to.
- Check \
+ CheckRev \
{NTDB and trunk revisions have to be in different LODs} \
{on NTDB and its non-NTDB child wrongly agree about their LOD} {
SELECT F.name, R.rev
FROM revision R, revision C, file F
@@ -253,9 +253,9 @@
;
}
# Find all revisions with a branch parent symbol which is not
# their LOD.
- Check \
+ CheckRev \
{Branch starting revisions have to have their LOD as branch parent symbol} \
{at the beginning of its branch does not have the branch symbol as its LOD} {
SELECT F.name, R.rev
FROM revision R, file F
@@ -265,9 +265,9 @@
;
}
# Find all revisions with a branch parent symbol whose parent
# is in the same line of development.
- Check \
+ CheckRev \
{Revisions and their branch children have to be in different LODs} \
{at the beginning of its branch and its parent wrongly agree about their LOD} {
SELECT F.name, R.rev
FROM revision R, revision P, file F
@@ -288,9 +288,9 @@
# the main label).
# Find all revisions which disgree with their meta data about
# the branch/line of development they belong to.
- Check \
+ CheckRev \
{Revisions and their meta data have to be in the same LOD} \
{disagrees with its meta data about owning LOD} {
SELECT F.name, R.rev
FROM revision R, meta M, file F
@@ -311,9 +311,9 @@
# the main label).
# Find all revisions which are not used by at least one
# revision changeset.
- Check \
+ CheckRev \
{All revisions have to be used by least one revision changeset} \
{is not used by a revision changeset} {
-- Unused revisions = All revisions
-- - revisions used by revision changesets.
@@ -332,9 +332,9 @@
AND R.fid = F.fid -- get file of unused revision
}
# Find all revisions which are used by more than one revision
# changeset.
- Check \
+ CheckRev \
{All revisions have to be used by at most one revision changeset} \
{is used by multiple revision changesets} {
-- Principle of operation: Get all revision/changeset
-- pairs for all revision changesets, group by
@@ -452,8 +452,30 @@
}
return
}
+ proc TagChangesets {} {
+ # This code performs a number of paranoid checks of the
+ # database, searching for inconsistent changeset/revision
+ # information.
+
+ return ; # Disabled for now, bottlenecks ...
+
+ upvar 1 n n ; # Counter for the checks (we print an id before
+ # the main label).
+ }
+
+ proc BranchChangesets {} {
+ # This code performs a number of paranoid checks of the
+ # database, searching for inconsistent changeset/revision
+ # information.
+
+ return ; # Disabled for now, bottlenecks ...
+
+ upvar 1 n n ; # Counter for the checks (we print an id before
+ # the main label).
+ }
+
proc SymbolChangesets {} {
# This code performs a number of paranoid checks of the
# database, searching for inconsistent changeset/revision
# information.
@@ -516,14 +538,36 @@
return
}
- proc Check {header label sql} {
+ proc CheckRev {header label sql} {
upvar 1 n n
set ok 1
foreach {fname revnr} [state run $sql] {
set ok 0
trouble fatal "$fname <$revnr> $label"
+ }
+ log write 5 integrity {\[[format %02d [incr n]]\] [expr {$ok ? "Ok " : "Failed"}] ... $header}
+ return
+ }
+
+ proc CheckTag {header label sql} {
+ upvar 1 n n
+ set ok 1
+ foreach {pname sname} [state run $sql] {
+ set ok 0
+ trouble fatal "<$pname tag '$sname'> $label"
+ }
+ log write 5 integrity {\[[format %02d [incr n]]\] [expr {$ok ? "Ok " : "Failed"}] ... $header}
+ return
+ }
+
+ proc CheckBranch {header label sql} {
+ upvar 1 n n
+ set ok 1
+ foreach {pname sname} [state run $sql] {
+ set ok 0
+ trouble fatal "<$pname branch '$sname'> $label"
}
log write 5 integrity {\[[format %02d [incr n]]\] [expr {$ok ? "Ok " : "Failed"}] ... $header}
return
}