Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/c2f_prev.tcl part of check-in [0af7a3c8ac] - Easier name for self-referential changesets, loopcheck. Made conditional on option --loopcheck, default off, and avoided if the general checks on changesets report trouble. Reinstated the loop check in the cycle breaker core in simpler form, reusing the new command in the changeset class. by aku on 2007-11-30 06:57:19. [view]

To:

File tools/cvs2fossil/lib/c2f_prev.tcl part of check-in [fbfb531868] - Bugfix in ValidateFragments, tweaked comment a bit, bugfix in SQL, reordered tables in the successor/predecessor queries a bit to show the actual progression of their use. by aku on 2007-12-02 03:46:33. [view]

@@ -470,9 +470,9 @@
 	# * The fragment must not overlap, i.e. their pairwise
 	#   intersections have to be empty.
 
 	set cover {}
-	foreach fragmentitems $args {
+	foreach fragmentitems $fragments {
 	    log write 8 csets {NEW: [lsort $fragmentitems]}
 
 	    integrity assert {
 		![struct::set empty $fragmentitems]
@@ -488,10 +488,10 @@
 	    [struct::set equal $cover [$cset items]]
 	 } {The fragments do not cover the original changeset}
 
 	set i 1
-	foreach fia $args {
-	    foreach fib [lrange $args $i end] {
+	foreach fia $fragments {
+	    foreach fib [lrange $fragments $i end] {
 		integrity assert {
 		    [struct::set empty [struct::set intersect $fia $fib]]
 		} {The fragments <$fia> and <$fib> overlap}
 	    }
@@ -892,13 +892,16 @@
 	# will greatly reduces the risk of getting far separated
 	# revisions of the same file into one changeset.
 
 	# We allow revisions to be far apart in time in the same
-	# changeset, but need the pseudo-dependencies for this.
+	# changeset, but in turn need the pseudo-dependencies to
+	# handle this.
 
 	array set fids {}
 	foreach {rid fid} [state run "
-	    SELECT R.rid, R.fid FROM revision R WHERE R.rid IN $theset
+	    SELECT R.rid, R.fid
+            FROM   revision R
+            WHERE  R.rid IN $theset
 	"] { lappend fids($fid) $rid }
 
 	foreach {fid rids} [array get fids] {
 	    if {[llength $rids] < 2} continue
@@ -1043,9 +1046,9 @@
 	# of revisions. This complements that they have no successors
 	# (See sym::tag/successors).
 
 	foreach {rid parent} [state run "
-	    SELECT R.rid B.bid
+	    SELECT R.rid, B.bid
 	    FROM   revision R, branch B
 	    WHERE  R.rid IN $theset
 	    AND    B.first = R.rid
 	"] {
@@ -1083,11 +1086,11 @@
 
 	set theset ('[join $tags {','}]')
 	return [state run "
 	    SELECT MIN(R.date), MAX(R.date)
-	    FROM revision R, tag T
-	    WHERE T.tid IN $theset
-            AND   R.rid = T.rev
+	    FROM   tag T, revision R
+	    WHERE  T.tid IN $theset
+            AND    R.rid = T.rev
 	"]
     }
 
     # var(dv) = dict (item -> list (item)), item  = list (type id)
@@ -1104,9 +1107,9 @@
 
 	set theset ('[join $tags {','}]')
 	foreach {tid parent} [state run "
 	    SELECT T.tid, R.rid
-	    FROM   revision R, tag T
+	    FROM   tag T, revision R
 	    WHERE  T.tid IN $theset
 	    AND    T.rev = R.rid
 	"] {
 	    lappend dependencies([list sym::tag $tid]) [list rev $parent]
@@ -1113,9 +1116,9 @@
 	}
 
 	foreach {tid parent} [state run "
 	    SELECT T.tid, B.bid
-	    FROM   tag T, branch B, preferedparent P
+	    FROM   tag T, preferedparent P, branch B
 	    WHERE  T.tid IN $theset
 	    AND    T.sid = P.sid
 	    AND    P.pid = B.sid
 	"] {
@@ -1123,9 +1126,9 @@
 	}
 
 	foreach {tid parent} [state run "
 	    SELECT T.tid, TX.tid
-	    FROM   tag T, tag TX, preferedparent P
+	    FROM   tag T, preferedparent P, tag TX
 	    WHERE  T.tid IN $theset
 	    AND    T.sid = P.sid
 	    AND    P.pid = TX.sid
 	"] {
@@ -1167,9 +1170,9 @@
 
 	set theset ('[join $branches {','}]')
 	return [state run "
 	    SELECT IFNULL(MIN(R.date),0), IFNULL(MAX(R.date),0)
-	    FROM revision R, branch B
+	    FROM  branch B, revision R
 	    WHERE B.bid IN $theset
             AND   R.rid = B.root
 	"]
     }
@@ -1182,17 +1185,17 @@
 
 	set theset ('[join $branches {','}]')
 	foreach {bid child} [state run "
 	    SELECT B.bid, R.rid
-	    FROM   revision R, branch B
+	    FROM   branch B, revision R
 	    WHERE  B.bid IN $theset
 	    AND    B.first = R.rid
 	"] {
 	    lappend dependencies([list sym::tag $bid]) [list rev $child]
 	}
 	foreach {bid child} [state run "
 	    SELECT B.bid, BX.bid
-	    FROM   branch B, branch BX, preferedparent P
+	    FROM   branch B, preferedparent P, branch BX
 	    WHERE  B.bid IN $theset
 	    AND    B.sid = P.pid
 	    AND    BX.sid = P.sid
 	"] {
@@ -1199,9 +1202,9 @@
 	    lappend dependencies([list sym::tag $bid]) [list sym::branch $child]
 	}
 	foreach {bid child} [state run "
 	    SELECT B.bid, T.tid
-	    FROM   branch B, tag T, preferedparent P
+	    FROM   branch B, preferedparent P, tag T
 	    WHERE  B.bid IN $theset
 	    AND    B.sid = P.pid
 	    AND    T.sid = P.sid
 	"] {
@@ -1218,17 +1221,17 @@
 
 	set theset ('[join $tags {','}]')
 	foreach {bid parent} [state run "
 	    SELECT B.Bid, R.rid
-	    FROM   revision R, branch B
+	    FROM   branch B, revision R
 	    WHERE  B.bid IN $theset
 	    AND    B.root = R.rid
 	"] {
 	    lappend dependencies([list sym::branch $bid]) [list rev $parent]
 	}
 	foreach {bid parent} [state run "
 	    SELECT B.bid, BX.bid
-	    FROM   branch B, branch BX, preferedparent P
+	    FROM   branch B, preferedparent P, branch BX
 	    WHERE  B.bid IN $theset
 	    AND    B.sid = P.sid
 	    AND    P.pid = BX.sid
 	"] {
@@ -1235,10 +1238,10 @@
 	    lappend dependencies([list sym::branch $bid]) [list sym::branch $parent]
 	}
 	foreach {bid parent} [state run "
 	    SELECT B.bid, T.tid
-	    FROM   branch B, tag T, preferedparent P
-	    WHERE  B.tid IN $theset
+	    FROM   branch B, preferedparent P, tag T
+	    WHERE  B.bid IN $theset
 	    AND    B.sid = P.sid
 	    AND    P.pid = T.sid
 	"] {
 	    lappend dependencies([list sym::branch $bid]) [list sym::tag $parent]