Fossil SCM

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.

aku 2007-09-20 07:37 trunk
Commit 25bc72107635a464fcfba9ea98c38a2f82b1c7fd
1 file changed +62 -2
--- tools/lib/cvs.tcl
+++ tools/lib/cvs.tcl
@@ -282,12 +282,15 @@
282282
variable importable
283283
284284
write 0 cvs "Organizing the changesets into branches"
285285
286286
set remainder [ProcessTrunk]
287
- # TODO: Processing non-trunk branches
288
-
287
+ while {[llength $remainder]} {
288
+ set remainder [ProcessBranch $remainder]
289
+ # return -code break may be signaled to give up with non-empty
290
+ # set of unprocessed changesets.
291
+ }
289292
290293
# Status information ...
291294
set nr [llength $remainder]
292295
set ni [llength $importable]
293296
set fmt %[string length [csets::num]]s
@@ -319,10 +322,67 @@
319322
}
320323
321324
write 0 cvs "Found [NSIPL $t {trunk changeset}], [NSIPL [llength $remainder] {branch changeset}]"
322325
return $remainder
323326
}
327
+
328
+proc ::vc::cvs::ws::ProcessBranch {cslist} {
329
+ write 0 cvs "Processing the remaining changesets"
330
+
331
+ set base [lindex $cslist 0]
332
+ set cslist [lrange $cslist 1 end]
333
+
334
+ set remainder {}
335
+ set t 0
336
+
337
+ ### ### ### ######### ######### #########
338
+ ## Dump data of the unprocessing changeset
339
+
340
+ puts /${base}/_________________
341
+ array set cs [csets::get $base]
342
+ parray cs
343
+
344
+ # Which branch does base belong to?
345
+ # - It has to be the base of an unprocessed branch!
346
+ # Otherwise it would have been on either the trunk
347
+ # or an already processed branch.
348
+ # Where is its root changeset ?
349
+ # - The root has to come before the base, it has already
350
+ # been processed => Smaller id, older in time.
351
+ # - Based on the files changed/removed by the base, and their
352
+ # versions we know the root versions of these files, and we
353
+ # can determine the changesets they are in => Intersection
354
+ # plus cap from previous contraint gives us the possible
355
+ # candidates.
356
+
357
+ # ### ### ### ######### ######### #########
358
+ exit
359
+
360
+ set tag [FindBranch $base ..]
361
+ set root [FindRoot $tag ...]
362
+
363
+ csets::setParentOf $base $root
364
+
365
+ foreach c $cslist {
366
+ if {[csets::sameBranch $c $base]} {
367
+ csets::setParentOf $c $base
368
+ set base $c
369
+ incr t
370
+ lappend importable $c
371
+ } else {
372
+ lappend remainder $c
373
+ }
374
+ }
375
+
376
+ #write 0 cvs "Found [NSIPL $t {trunk changeset}], [NSIPL [llength $remainder] {branch changeset}]"
377
+ return $remainder
378
+}
379
+
380
+#TBD
381
+#... FindBranch
382
+#... FindRoot
383
+#... SameBranch
324384
325385
proc ::vc::cvs::ws::Checkout {f r} {
326386
variable base
327387
variable project
328388
329389
--- tools/lib/cvs.tcl
+++ tools/lib/cvs.tcl
@@ -282,12 +282,15 @@
282 variable importable
283
284 write 0 cvs "Organizing the changesets into branches"
285
286 set remainder [ProcessTrunk]
287 # TODO: Processing non-trunk branches
288
 
 
 
289
290 # Status information ...
291 set nr [llength $remainder]
292 set ni [llength $importable]
293 set fmt %[string length [csets::num]]s
@@ -319,10 +322,67 @@
319 }
320
321 write 0 cvs "Found [NSIPL $t {trunk changeset}], [NSIPL [llength $remainder] {branch changeset}]"
322 return $remainder
323 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
325 proc ::vc::cvs::ws::Checkout {f r} {
326 variable base
327 variable project
328
329
--- tools/lib/cvs.tcl
+++ tools/lib/cvs.tcl
@@ -282,12 +282,15 @@
282 variable importable
283
284 write 0 cvs "Organizing the changesets into branches"
285
286 set remainder [ProcessTrunk]
287 while {[llength $remainder]} {
288 set remainder [ProcessBranch $remainder]
289 # return -code break may be signaled to give up with non-empty
290 # set of unprocessed changesets.
291 }
292
293 # Status information ...
294 set nr [llength $remainder]
295 set ni [llength $importable]
296 set fmt %[string length [csets::num]]s
@@ -319,10 +322,67 @@
322 }
323
324 write 0 cvs "Found [NSIPL $t {trunk changeset}], [NSIPL [llength $remainder] {branch changeset}]"
325 return $remainder
326 }
327
328 proc ::vc::cvs::ws::ProcessBranch {cslist} {
329 write 0 cvs "Processing the remaining changesets"
330
331 set base [lindex $cslist 0]
332 set cslist [lrange $cslist 1 end]
333
334 set remainder {}
335 set t 0
336
337 ### ### ### ######### ######### #########
338 ## Dump data of the unprocessing changeset
339
340 puts /${base}/_________________
341 array set cs [csets::get $base]
342 parray cs
343
344 # Which branch does base belong to?
345 # - It has to be the base of an unprocessed branch!
346 # Otherwise it would have been on either the trunk
347 # or an already processed branch.
348 # Where is its root changeset ?
349 # - The root has to come before the base, it has already
350 # been processed => Smaller id, older in time.
351 # - Based on the files changed/removed by the base, and their
352 # versions we know the root versions of these files, and we
353 # can determine the changesets they are in => Intersection
354 # plus cap from previous contraint gives us the possible
355 # candidates.
356
357 # ### ### ### ######### ######### #########
358 exit
359
360 set tag [FindBranch $base ..]
361 set root [FindRoot $tag ...]
362
363 csets::setParentOf $base $root
364
365 foreach c $cslist {
366 if {[csets::sameBranch $c $base]} {
367 csets::setParentOf $c $base
368 set base $c
369 incr t
370 lappend importable $c
371 } else {
372 lappend remainder $c
373 }
374 }
375
376 #write 0 cvs "Found [NSIPL $t {trunk changeset}], [NSIPL [llength $remainder] {branch changeset}]"
377 return $remainder
378 }
379
380 #TBD
381 #... FindBranch
382 #... FindRoot
383 #... SameBranch
384
385 proc ::vc::cvs::ws::Checkout {f r} {
386 variable base
387 variable project
388
389

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button