Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/c2f_pbreakacycle.tcl part of check-in [6b520e7d97] - Modified to break all backward symbols, not only branches, removed the other custom circle breaking code, should not be needed any longer (See comments for proof). by aku on 2007-11-27 09:07:37. [view]

To:

File tools/cvs2fossil/lib/c2f_pbreakacycle.tcl part of check-in [47d52d1efd] - Added convenience method for assertions and used it in place of the existing if/trouble internal constructions. Changed API of 'log write' so that we can defer substituation of the message to when the write actually happen, and converted all places which would be hit by double-substitution. The remaining 'log write' calls will be converted incrementally. by aku on 2007-11-28 05:39:49. [view]

@@ -175,11 +175,11 @@
 	    # backward, and iterate over the possibly still backward
 	    # second fragment.
 
 	    struct::list assign $replacements normal backward
-	    if {[IsBackward $graph $normal]} {
-		trouble internal "The normal fragment is unexpectedly backward"
-	    }
+	    integrity assert {
+		![IsBackward $graph $normal]
+	    } {The normal fragment is unexpectedly backward}
 
 	    set cset $backward
 	}
 	return
@@ -260,12 +260,11 @@
 
 	foreach revision [array names limits] {
 	    struct::list assign $limits($revision) maxp mins
 	    # Handle min successor position "" as representing infinity
-	    if {$mins eq ""} continue
-	    if {$maxp < $mins} continue
-
-	    trouble internal "Branch revision $revision is backward at file level ($maxp >= $mins)"
+	    integrity assert {
+		($mins eq "") || ($maxp < $mins)
+	    } {Branch revision $revision is backward at file level ($maxp >= $mins)}
 	}
 
 	# Save the limits for the splitter, and compute the border at
 	# which to split as the minimum of all minimal successor
@@ -300,10 +299,10 @@
 		lappend normalrevisions $rev
 	    }
 	}
 
-	if {![llength $normalrevisions]}   { trouble internal "Set of normal revisions is empty" }
-	if {![llength $backwardrevisions]} { trouble internal "Set of backward revisions is empty" }
+	integrity assert {[llength $normalrevisions]}   {Set of normal revisions is empty}
+	integrity assert {[llength $backwardrevisions]} {Set of backward revisions is empty}
 	return
     }
 
 
@@ -370,9 +369,9 @@
 		::variable mycset
 		set old [$mycset($mylastpos) str]@$mylastpos
 	    }
 
-	    trouble internal "Ordering of revision changesets violated, [$cset str]@$new is not immediately after $old"
+	    integrity assert 0 {Ordering of revision changesets violated, [$cset str]@$new is not immediately after $old}
 	}
 
 	set mylastpos $new
 	return