Check-in [0d13da3018]
Not logged in
Overview

SHA1 Hash:0d13da30180e3eb1353e902ac45ae4f572767ae9
Date: 2008-02-06 04:55:34
User: aku
Comment:Get the line of development for changesets directly from the items and their lod references. The in-memory data from the meta table is out-of-date since the adjustment of parents in pass 'FilterSymbols'. Print the LOD information when sorting the changesets.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified tools/cvs2fossil/lib/c2f_patopsort.tcl from [24672c709e] to [df888ac870].

@@ -120,11 +120,11 @@
 
 	set date [GetTime [lindex [$graph node get $cset timerange] 1] \
 		      [struct::set contains $mysymchangesets $cset] \
 		     message]
 
-	log write 4 atopsort "Changeset @ [format $myatfmt $at]: [format $mycsfmt [$cset str]]$message"
+	log write 4 atopsort "Changeset @ [format $myatfmt $at]: [format $mycsfmt [$cset str]] '[$cset lod]' $message"
 
 	state run {
 	    INSERT INTO cstimestamp (cid,  pos, date)
 	    VALUES                  ($cid, $at, $date)
 	}

Modified tools/cvs2fossil/lib/c2f_prev.tcl from [a49a0c1211] to [3b42fd437e].

@@ -76,10 +76,14 @@
 	}
 	append str "$mytype ${myid}${detail}>"
 	return $str
     }
 
+    method lod {} {
+	return [$mytypeobj cs_lod $myitems]
+    }
+
     method id    {} { return $myid }
     method items {} { return $mytitems }
     method data  {} { return [list $myproject $mytype $mysrcid] }
 
     delegate method bysymbol   to mytypeobj
@@ -403,12 +407,17 @@
 	# - The parent changeset, if any. If there is no parent fossil
 	#   will use the empty base revision as parent.
 	#
 	# - List of the file revisions in the changeset.
 
-	struct::list assign [$myproject getmeta $mysrcid] __ branch user message
-	struct::list assign $branch __ lodname
+	struct::list assign [$myproject getmeta $mysrcid] __ __ user message
+
+	# We derive the lod information directly from the revisions of
+	# the changeset, as the branch part of the meta data (s.a.) is
+	# outdated since pass FilterSymbols.
+
+	set lodname [$self lod]
 
 	log write 2 csets {Importing revision [$self str] on $lodname}
 
 	# Perform the import. As part of that we determine the parent
 	# we need, and convert the list of items in the changeset into
@@ -1283,10 +1292,25 @@
             AND    CI.iid = B.bid          -- Select all changesets
             AND    C.cid = CI.cid	   -- containing the branches
             AND    C.type = 2		   -- which are branch changesets
 	}]]
     }
+
+    # result = symbol name
+    typemethod cs_lod {revisions} {
+	# Determines the name of the symbol which is the line of
+	# development for the revisions in a changeset.
+
+	set theset ('[join $revisions {','}]')
+	return [state run [subst -nocommands -nobackslashes {
+	    SELECT
+	    DISTINCT L.name
+	    FROM   revision R, symbol L
+	    WHERE  R.rid in $theset        -- Restrict to revisions of interest
+	    AND    L.sid = R.lod           -- Get lod symbol of revision
+	}]]
+    }
 }
 
 # # ## ### ##### ######## ############# #####################
 ## Helper singleton. Commands for tag symbol changesets.
 
@@ -1336,10 +1360,25 @@
 
     # result = list (changeset-id)
     typemethod cs_successors {tags} {
 	# Tags have no successors.
 	return
+    }
+
+    # result = symbol name
+    typemethod cs_lod {tags} {
+	# Determines the name of the symbol which is the line of
+	# development for the tags in a changeset.
+
+	set theset ('[join $tags {','}]')
+	return [state run [subst -nocommands -nobackslashes {
+	    SELECT
+	    DISTINCT L.name
+	    FROM   tag T, symbol L
+	    WHERE  T.tid in $theset        -- Restrict to tags of interest
+	    AND    L.sid = T.lod           -- Get lod symbol of tag
+	}]]
     }
 }
 
 # # ## ### ##### ######## ############# #####################
 ## Helper singleton. Commands for branch symbol changesets.
@@ -1469,10 +1508,25 @@
             AND    CI.iid = T.tid       -- Select all changesets
             AND    C.cid = CI.cid	-- containing the subordinate tags
             AND    C.type = 1		-- which are tag changesets
 	}]]
 	return
+    }
+
+    # result = symbol name
+    typemethod cs_lod {branches} {
+	# Determines the name of the symbol which is the line of
+	# development for the branches in a changeset.
+
+	set theset ('[join $branches {','}]')
+	return [state run [subst -nocommands -nobackslashes {
+	    SELECT
+	    DISTINCT L.name
+	    FROM   branch B, symbol L
+	    WHERE  B.bid in $theset        -- Restrict to branches of interest
+	    AND    L.sid = B.lod           -- Get lod symbol of branch
+	}]]
     }
 
     typemethod limits {branches} {
 	# Notes. This method exists only for branches. It is needed to
 	# get detailed information about a backward branch. It does

Modified tools/cvs2fossil/lib/c2f_prtopsort.tcl from [bc1fe01638] to [dbb40b4225].

@@ -112,11 +112,11 @@
 	::variable myatfmt
 	::variable mycsfmt
 
 	set cid [$cset id]
 
-	log write 4 rtopsort "Changeset @ [format $myatfmt $at]: [format $mycsfmt [$cset str]] <<[FormatTR $graph $cset]>>"
+	log write 4 rtopsort "Changeset @ [format $myatfmt $at]: [format $mycsfmt [$cset str]] '[$cset lod]' <<[FormatTR $graph $cset]>>"
 	state run {
 	    INSERT INTO csorder (cid,  pos)
 	    VALUES              ($cid, $at)
 	}
 	return