Check-in [6d5de5f1c1]
Not logged in
Overview

SHA1 Hash:6d5de5f1c19ddfad21a4d3e29cb123e69dc19f2f
Date: 2008-02-13 04:57:43
User: aku
Comment:Tuned the handling of the vendor branch in case we have multiple different symbols representing it. The import pass now effectively merges these symbols into a single line of development.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified cvs2fossil.txt from [127838a9ad] to [7755e1a714].

@@ -7,14 +7,10 @@
 	tcllib, or a single subproject of tcllib, like tklib, but not
 	multiple sub-projects in one go.
 
 *	We have to look into the pass 'InitCsets' and hunt for the
 	cause of the large amount of memory it is gobbling up.
-
-*	Multi vendor branch on different symbol - Remember the first
-	vendor branch so that we can force others on it.
-	ristate -> Allow definition of workspace aliases (:vendor:)
 
 *	Look at the dependencies on external packages and consider
 	which of them can be moved into the importer, either as a
 	simple utility command, or wholesale.
 

Modified tools/cvs2fossil/lib/c2f_prev.tcl from [c1187b458c] to [d233796d95].

@@ -497,20 +497,36 @@
 	# (a) root of a vendor branch,
 	# (b) root of the trunk LOD, or
 	# (c) the first changeset in a new LOD which was spawned from
 	#     an existing LOD.
 
-	if {$isdefault || ($lodname eq ":trunk:")} {
-	    # For both (a) and (b) we have to create a new workspace
-	    # for the lod, and it doesn't inherit from anything.
-
-	    # Note that case (b) may never occur. See the variable
-	    # 'lastdefaultontrunk' in the caller (method pushto). This
-	    # flag can the generation of the workspace for the :trunk:
-	    # LOD as well, making it inherit the state of the last
-	    # trunk-changeset on the vendor-branch.
-
+	# For both (a) and (b) we have to create a new workspace for
+	# the lod, and it doesn't inherit from anything.
+
+	# One exception for (a). If we already have a :vendor: branch
+	# then multiple symbols were used for the vendor branch by
+	# different files. In that case the 'new' branch is made an
+	# alias of the :vendor:, effectively merging the symbols
+	# together.
+
+	# Note that case (b) may never occur. See the variable
+	# 'lastdefaultontrunk' in the caller (method pushto). This
+	# flag can the generation of the workspace for the :trunk: LOD
+	# as well, making it inherit the state of the last
+	# trunk-changeset on the vendor-branch.
+
+	if {$isdefault} {
+	    if {![$rstate has ":vendor:"]} {
+		# Create the vendor branch if not present already.
+		$rstate new :vendor:
+	    }
+	    # Merge the new symbol to the vendor branch
+	    $rstate dup $lodname <-- :vendor:
+	    return [$rstate get $lodname]
+	}
+
+	if {$lodname eq ":trunk:"} {
 	    return [$rstate new $lodname]
 	}
 
 	# Case (c). We find the parent LOD of our LOD and let the new
 	# workspace inherit from the parent's workspace.

Modified tools/cvs2fossil/lib/c2f_ristate.tcl from [9cab4d3dc8] to [a43e38672d].

@@ -68,10 +68,16 @@
 
     method get {lod} { return $mystate($lod) }
     method has {lod} { return [info exists mystate($lod)] }
 
     method names {} { return [array names mystate] }
+
+    method dup {dst _from_ src} {
+	log write 8 ristate {Duplicate workspace state for LOD "$dst" from "$src"}
+	set mystate($dst) $mystate($src)
+	return
+    }
 
     # # ## ### ##### ######## #############
     ## State
 
     variable mystate -array {} ; # Map from lines of development