Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/c2f_file.tcl part of check-in [79c227a9c0] - Bugfix. Handle free-floating branches (their root revision was removed as unnecessary). by aku on 2007-12-01 18:36:26. [view]

To:

File tools/cvs2fossil/lib/c2f_file.tcl part of check-in [c4003e7b93] - The handling of detached lines of development (floating branches) still had some bugs regarding the linkage to their revisions, especially the first revision on such branches. Fixed the relevant places, added early integrity checks and updated the main checks to handle the situation. by aku on 2007-12-05 02:22:52. [view]

@@ -770,11 +770,9 @@
 	    foreach branch [$root branches] {
 		$branch cutbranchparent
 		if {![$branch haschild]} continue
 		set first [$branch child]
-		$first cutfromparentbranch
-		$first cutfromparent
-		$branch cutchild
+		$first cutfromparent
 		lappend myroots $first
 	    }
 	    $root removeallbranches
 
@@ -815,10 +813,14 @@
 
 	    ldelete myroots $root
 	    lappend myroots $child
 
+	    $branch cutbranchparent
 	    $branch cutchild
 	    $child  cutfromparent
+
+	    $branch setchild        $child
+	    $child  setparentbranch $branch
 
 	    $parent removebranch        $branch
 	    $parent removechildonbranch $root
 	}
@@ -1018,11 +1020,21 @@
 	    if {[$root hasparentbranch]} { lappend symbols [$root parentbranch] }
 	    while {$root ne ""} {
 		lappend revisions $root
 		foreach tag    [$root tags]     { lappend symbols $tag    }
-		foreach branch [$root branches] { lappend symbols $branch }
+		foreach branch [$root branches] {
+		    integrity assert {
+			[$branch parent] eq $root
+		    } {Backreference branch to its root is missing or wrong}
+		    lappend symbols $branch
+		}
 		set lod [$root lod]
-		if {![$lod istrunk]} { lappend symbols $lod }
+		if {![$lod istrunk]} {
+		    integrity assert {
+			[$lod haschild]
+		    } {Branch is LOD symbol without revisions}
+		    lappend symbols $lod
+		}
 		set root [$root child]
 	    }
 	}