Check-in [25bc721076]
Not logged in
Overview

SHA1 Hash:25bc72107635a464fcfba9ea98c38a2f82b1c7fd
Date: 2007-09-20 07:37:36
User: aku
Comment:Entered the general structure planned for processing of branches. Incomplete. This code right now exits when it finds branch csets. Some debug output to see detailed internals from which to pull the pieces together.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified tools/lib/cvs.tcl from [1e095fdc74] to [e947a38eb8].

@@ -282,12 +282,15 @@
     variable importable
 
     write 0 cvs "Organizing the changesets into branches"
 
     set remainder [ProcessTrunk]
-    # TODO: Processing non-trunk branches
-
+    while {[llength $remainder]} {
+	set remainder [ProcessBranch $remainder]
+	# return -code break may be signaled to give up with non-empty
+	# set of unprocessed changesets.
+    }
 
     # Status information ...
     set nr  [llength $remainder]
     set ni  [llength $importable]
     set fmt %[string length [csets::num]]s
@@ -319,10 +322,67 @@
     }
 
     write 0 cvs "Found [NSIPL $t {trunk changeset}], [NSIPL [llength $remainder] {branch changeset}]"
     return $remainder
 }
+
+proc ::vc::cvs::ws::ProcessBranch {cslist} {
+    write 0 cvs "Processing the remaining changesets"
+
+    set base   [lindex $cslist 0]
+    set cslist [lrange $cslist 1 end]
+
+    set remainder {}
+    set t         0
+
+    ### ### ### ######### ######### #########
+    ## Dump data of the unprocessing changeset
+
+    puts /${base}/_________________
+    array set cs [csets::get $base]
+    parray    cs
+
+    # Which branch does base belong to?
+    # - It has to be the base of an unprocessed branch!
+    #   Otherwise it would have been on either the trunk
+    #   or an already processed branch.
+    # Where is its root changeset ?
+    # - The root has to come before the base, it has already
+    #   been processed => Smaller id, older in time.
+    # - Based on the files changed/removed by the base, and their
+    #   versions we know the root versions of these files, and we
+    #   can determine the changesets they are in => Intersection
+    #   plus cap from previous contraint gives us the possible
+    #   candidates.
+
+    # ### ### ### ######### ######### #########
+    exit
+
+    set tag  [FindBranch $base ..]
+    set root [FindRoot   $tag ...]
+
+    csets::setParentOf $base $root
+
+    foreach c $cslist {
+	if {[csets::sameBranch $c $base]} {
+	    csets::setParentOf $c $base
+	    set base $c
+	    incr t
+	    lappend importable $c
+	} else {
+	    lappend remainder $c
+	}
+    }
+
+    #write 0 cvs "Found [NSIPL $t {trunk changeset}], [NSIPL [llength $remainder] {branch changeset}]"
+    return $remainder
+}
+
+#TBD
+#... FindBranch
+#... FindRoot
+#... SameBranch
 
 proc ::vc::cvs::ws::Checkout {f r} {
     variable base
     variable project