Fossil

Check-in [c4003e7b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:c4003e7b9365bf8f26b8e1a1a22cf431279d6d7c
User & Date: aku 2007-12-05 02:22:52
Context
2007-12-05
02:24
Fixed log progress use in last breaker pass. Disabled the check regarding revision order. It still triggers and I can't see anything wrong. Pressing forward for now, i.e. get the remaining passes done, then revisit this issue. check-in: 22905072 user: aku tags: trunk
02:22
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. check-in: c4003e7b user: aku tags: trunk
02:21
Removed lots of now dead code. Added a note to the last remaining user of the changeset method 'nextmap'. check-in: 3c0ef2c3 user: aku tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tools/cvs2fossil/lib/c2f_file.tcl.

767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
...
812
813
814
815
816
817
818

819
820
821



822
823
824
825
826
827
828
....
1015
1016
1017
1018
1019
1020
1021
1022





1023
1024





1025
1026
1027
1028
1029
1030
1031
	    # revision on each branch becomes a new and disconnected
	    # root.

	    foreach branch [$root branches] {
		$branch cutbranchparent
		if {![$branch haschild]} continue
		set first [$branch child]
		$first cutfromparentbranch
		$first cutfromparent
		$branch cutchild
		lappend myroots $first
	    }
	    $root removeallbranches

	    # Tagging a dead revision doesn't do anything, so remove
	    # any tags that were set on it.

................................................................................
	    set branch [$root parentbranch]
	    set parent [$root parent]
	    set child  [$root child]

	    ldelete myroots $root
	    lappend myroots $child


	    $branch cutchild
	    $child  cutfromparent




	    $parent removebranch        $branch
	    $parent removechildonbranch $root
	}
	return
    }

    method LinesOfDevelopment {} {
................................................................................
	set symbols   {}

	foreach root [$self LinesOfDevelopment] {
	    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 }





		set lod [$root lod]
		if {![$lod istrunk]} { lappend symbols $lod }





		set root [$root child]
	    }
	}

	return [list [lsort -unique -dict $revisions] [lsort -unique -dict $symbols]]
    }








<

<







 







>



>
>
>







 







|
>
>
>
>
>

|
>
>
>
>
>







767
768
769
770
771
772
773

774

775
776
777
778
779
780
781
...
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
....
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
	    # revision on each branch becomes a new and disconnected
	    # root.

	    foreach branch [$root branches] {
		$branch cutbranchparent
		if {![$branch haschild]} continue
		set first [$branch child]

		$first cutfromparent

		lappend myroots $first
	    }
	    $root removeallbranches

	    # Tagging a dead revision doesn't do anything, so remove
	    # any tags that were set on it.

................................................................................
	    set branch [$root parentbranch]
	    set parent [$root parent]
	    set child  [$root child]

	    ldelete myroots $root
	    lappend myroots $child

	    $branch cutbranchparent
	    $branch cutchild
	    $child  cutfromparent

	    $branch setchild        $child
	    $child  setparentbranch $branch

	    $parent removebranch        $branch
	    $parent removechildonbranch $root
	}
	return
    }

    method LinesOfDevelopment {} {
................................................................................
	set symbols   {}

	foreach root [$self LinesOfDevelopment] {
	    if {[$root hasparentbranch]} { lappend symbols [$root parentbranch] }
	    while {$root ne ""} {
		lappend revisions $root
		foreach tag    [$root tags]     { lappend symbols $tag    }
		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]} {
		    integrity assert {
			[$lod haschild]
		    } {Branch is LOD symbol without revisions}
		    lappend symbols $lod
		}
		set root [$root child]
	    }
	}

	return [list [lsort -unique -dict $revisions] [lsort -unique -dict $symbols]]
    }

Changes to tools/cvs2fossil/lib/c2f_fsym.tcl.

76
77
78
79
80
81
82



83
84
85
86
87
88
89
    }

    method BranchParents {} {
	# The "obvious" parent of a branch is the branch holding the
	# revision spawning the branch. Any other branches that are
	# rooted at the same revision and were committed earlier than
	# the branch are also possible parents.




	$mysymbol possibleparent [[$mybranchparent lod] symbol]

	foreach branch [$mybranchparent branches] {
	    # A branch cannot be its own parent. Nor can a branch
	    # created after this one be its parent. This means that we
	    # can abort the loop when we have reached ourselves in the







>
>
>







76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
    }

    method BranchParents {} {
	# The "obvious" parent of a branch is the branch holding the
	# revision spawning the branch. Any other branches that are
	# rooted at the same revision and were committed earlier than
	# the branch are also possible parents.

	# Ignore this if the branch symbol is detached.
	if {$mybranchparent eq ""} return

	$mysymbol possibleparent [[$mybranchparent lod] symbol]

	foreach branch [$mybranchparent branches] {
	    # A branch cannot be its own parent. Nor can a branch
	    # created after this one be its parent. This means that we
	    # can abort the loop when we have reached ourselves in the

Changes to tools/cvs2fossil/lib/c2f_integrity.tcl.

176
177
178
179
180
181
182
183
184
185
186
187
188
189



190
191
192
193
194
195
196
		AND   R.parent = P.rid
		AND   P.child != R.rid
		;
	    }
	# Find all revisions with a branch parent symbol which do not
	# have a parent.
	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
		WHERE R.fid = F.fid
		AND   R.bparent IS NOT NULL
		AND   R.parent IS NULL



		;
	    }
	# Find all revisions with a branch parent symbol whose parent
	# has them as primary child.
	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} {







|
|

|


|
>
>
>







176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
		AND   R.parent = P.rid
		AND   P.child != R.rid
		;
	    }
	# Find all revisions with a branch parent symbol which do not
	# have a parent.
	CheckRev \
	    {Branch starting revisions have to have a parent, if not detached} \
	    {at the beginning of its branch has no parent, but its branch has} {
		SELECT F.name, R.rev
		FROM revision R, file F, branch B
		WHERE R.fid = F.fid
		AND   R.bparent IS NOT NULL
		AND   R.parent  IS NULL
		AND   B.sid = R.bparent
		AND   B.fid = R.fid
		AND   B.root    IS NOT NULL
		;
	    }
	# Find all revisions with a branch parent symbol whose parent
	# has them as primary child.
	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} {