Differences From:
File
tools/lib/cvs.tcl
part of check-in
[25bc721076]
- 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.
by
aku on
2007-09-20 07:37:36.
[view]
To:
File
tools/lib/cvs.tcl
part of check-in
[72dac950c3]
- Continued work on the import of branches. Main principle now is to handle the branches vertically. First the trunk, then the branch starting with the first unprocessed changeset, and so forth. Looks more promising than the previous approach. Currently handles just a bit over half of the test projects (11 of 21 in 6 repositories).
by
aku on
2007-09-26 05:06:18.
[view]
@@ -12,8 +12,10 @@
package require vc::cvs::cmd ; # Access to cvs application.
package require vc::cvs::ws::files ; # Scan CVS repository for relevant files.
package require vc::cvs::ws::timeline ; # Manage timeline of all changes.
package require vc::cvs::ws::csets ; # Manage the changesets found in the timeline
+package require vc::cvs::ws::branch ; # Branch database
+package require vc::cvs::ws::sig ; # Changeset file/rev signatures
namespace eval ::vc::cvs::ws {
vc::tools::log::system cvs
namespace import ::vc::tools::log::write
@@ -214,9 +216,12 @@
NoteDeadRoots $f $rev $operation
timeline::add $date($rev) $f $rev $operation $auth($rev) $cmsg($rev)
incr n
}
- #B Extend branch management
+
+ if {[info exists md(symbol)]} {
+ branch::def $f date $md(symbol)
+ }
unset md
unset date
unset auth
@@ -241,11 +246,12 @@
return
}
proc ::vc::cvs::ws::Operation {rev state} {
- if {$state eq "dead"} {return "R"} ; # Removed
- if {$rev eq "1.1"} {return "A"} ; # Added
- return "M" ; # Modified
+ if {$state eq "dead"} {return "R"} ; # Removed
+ if {$rev eq "1.1"} {return "A"} ; # Added
+ if {[string match *.1.1 $rev]} {return "A"} ; # Added on a branch
+ return "M" ; # Modified
}
proc ::vc::cvs::ws::MakeChangesets {} {
write 0 cvs "Generating changesets from timeline"
@@ -325,22 +331,14 @@
return $remainder
}
proc ::vc::cvs::ws::ProcessBranch {cslist} {
- write 0 cvs "Processing the remaining changesets"
+ write 0 cvs "Processing the remaining [SIPL [llength $cslist] changeset "[llength $cslist] 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
+ csets::DUMP $base
# 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
@@ -353,18 +351,28 @@
# 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 ...]
-
+ write 4 cvs "Branch base $base"
+
+ ::foreach {tag rootsig} [branch::find [csets::get $base]] break
+
+ write 4 cvs "Branch tag $tag"
+ write 4 cvs "Root sig $rootsig"
+
+ set root [sig::find $base $rootsig]
+
+ write 4 cvs "Branch root $root"
+
+ write 0 cvs "Changeset $base, starting branch \"$tag\", rooted at $root"
csets::setParentOf $base $root
- foreach c $cslist {
- if {[csets::sameBranch $c $base]} {
+ set remainder {}
+ set t 1
+
+ ::foreach c $cslist {
+ #csets::DUMP $c
+ if {[csets::sameBranch $c $base $tag]} {
csets::setParentOf $c $base
set base $c
incr t
lappend importable $c
@@ -372,16 +380,11 @@
lappend remainder $c
}
}
- #write 0 cvs "Found [NSIPL $t {trunk changeset}], [NSIPL [llength $remainder] {branch changeset}]"
+ write 0 cvs "Found [NSIPL $t "$tag changeset"], [NSIPL [llength $remainder] changeset] outside"
return $remainder
}
-
-#TBD
-#... FindBranch
-#... FindRoot
-#... SameBranch
proc ::vc::cvs::ws::Checkout {f r} {
variable base
variable project