Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/c2f_cyclebreaker.tcl part of check-in [b42cff97e3] - Replaced the checks for self-referential changesets in the cycle breaker with a scheme in the changeset class doing checks when splitting a changeset, which is also called by the general changeset integrity code, after each pass. Extended log output at high verbosity levels. Thorough checking of the fragments a changeset is to be split into. by aku on 2007-11-30 03:57:19. [view]

To:

File tools/cvs2fossil/lib/c2f_cyclebreaker.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]

@@ -25,8 +25,9 @@
 package require vc::tools::trouble                        ; # Error reporting.
 package require vc::tools::misc                           ; # Text formatting.
 package require vc::fossil::import::cvs::project::rev     ; # Project level changesets
 package require vc::fossil::import::cvs::project::revlink ; # Cycle links.
+package require vc::fossil::import::cvs::integrity        ; # State integrity checks.
 
 # # ## ### ##### ######## ############# #####################
 ##
 
@@ -198,8 +199,12 @@
 		# Changesets may have dependencies outside of the
 		# chosen set. These are ignored
 		if {![$dg node exists $succ]} continue
 		$dg arc insert $cset $succ
+		if {$succ eq $cset} {
+		    $cset loopcheck
+		    trouble fatal "[$cset str] depends on itself"
+		}
 	    }
 	}
 
 	if {$log} {
@@ -417,8 +422,12 @@
 		# The new changesets may have dependencies outside of
 		# the chosen set. These are ignored
 		if {![$dg node exists $succ]} continue
 		$dg arc insert $cset $succ
+		if {$succ eq $cset} {
+		    $cset loopcheck
+		    trouble fatal "[$cset str] depends on itself"
+		}
 	    }
 	}
 	foreach cset $pre {
 	    foreach succ [$cset successors] {
@@ -540,8 +549,9 @@
 namespace eval ::vc::fossil::import::cvs {
     namespace export cyclebreaker
     namespace eval cyclebreaker {
 	namespace eval project {
+	    namespace import ::vc::fossil::import::cvs::integrity
 	    namespace import ::vc::fossil::import::cvs::project::rev
 	    namespace import ::vc::fossil::import::cvs::project::revlink
 	}
 	namespace import ::vc::tools::misc::*