Fossil SCM

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.

aku 2008-02-13 04:57 trunk
Commit 6d5de5f1c19ddfad21a4d3e29cb123e69dc19f2f
--- cvs2fossil.txt
+++ cvs2fossil.txt
@@ -8,14 +8,10 @@
88
multiple sub-projects in one go.
99
1010
* We have to look into the pass 'InitCsets' and hunt for the
1111
cause of the large amount of memory it is gobbling up.
1212
13
-* Multi vendor branch on different symbol - Remember the first
14
- vendor branch so that we can force others on it.
15
- ristate -> Allow definition of workspace aliases (:vendor:)
16
-
1713
* Look at the dependencies on external packages and consider
1814
which of them can be moved into the importer, either as a
1915
simple utility command, or wholesale.
2016
2117
struct::list
2218
--- cvs2fossil.txt
+++ cvs2fossil.txt
@@ -8,14 +8,10 @@
8 multiple sub-projects in one go.
9
10 * We have to look into the pass 'InitCsets' and hunt for the
11 cause of the large amount of memory it is gobbling up.
12
13 * Multi vendor branch on different symbol - Remember the first
14 vendor branch so that we can force others on it.
15 ristate -> Allow definition of workspace aliases (:vendor:)
16
17 * Look at the dependencies on external packages and consider
18 which of them can be moved into the importer, either as a
19 simple utility command, or wholesale.
20
21 struct::list
22
--- cvs2fossil.txt
+++ cvs2fossil.txt
@@ -8,14 +8,10 @@
8 multiple sub-projects in one go.
9
10 * We have to look into the pass 'InitCsets' and hunt for the
11 cause of the large amount of memory it is gobbling up.
12
 
 
 
 
13 * Look at the dependencies on external packages and consider
14 which of them can be moved into the importer, either as a
15 simple utility command, or wholesale.
16
17 struct::list
18
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -497,20 +497,36 @@
497497
# (a) root of a vendor branch,
498498
# (b) root of the trunk LOD, or
499499
# (c) the first changeset in a new LOD which was spawned from
500500
# an existing LOD.
501501
502
- if {$isdefault || ($lodname eq ":trunk:")} {
503
- # For both (a) and (b) we have to create a new workspace
504
- # for the lod, and it doesn't inherit from anything.
505
-
506
- # Note that case (b) may never occur. See the variable
507
- # 'lastdefaultontrunk' in the caller (method pushto). This
508
- # flag can the generation of the workspace for the :trunk:
509
- # LOD as well, making it inherit the state of the last
510
- # trunk-changeset on the vendor-branch.
511
-
502
+ # For both (a) and (b) we have to create a new workspace for
503
+ # the lod, and it doesn't inherit from anything.
504
+
505
+ # One exception for (a). If we already have a :vendor: branch
506
+ # then multiple symbols were used for the vendor branch by
507
+ # different files. In that case the 'new' branch is made an
508
+ # alias of the :vendor:, effectively merging the symbols
509
+ # together.
510
+
511
+ # Note that case (b) may never occur. See the variable
512
+ # 'lastdefaultontrunk' in the caller (method pushto). This
513
+ # flag can the generation of the workspace for the :trunk: LOD
514
+ # as well, making it inherit the state of the last
515
+ # trunk-changeset on the vendor-branch.
516
+
517
+ if {$isdefault} {
518
+ if {![$rstate has ":vendor:"]} {
519
+ # Create the vendor branch if not present already.
520
+ $rstate new :vendor:
521
+ }
522
+ # Merge the new symbol to the vendor branch
523
+ $rstate dup $lodname <-- :vendor:
524
+ return [$rstate get $lodname]
525
+ }
526
+
527
+ if {$lodname eq ":trunk:"} {
512528
return [$rstate new $lodname]
513529
}
514530
515531
# Case (c). We find the parent LOD of our LOD and let the new
516532
# workspace inherit from the parent's workspace.
517533
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -497,20 +497,36 @@
497 # (a) root of a vendor branch,
498 # (b) root of the trunk LOD, or
499 # (c) the first changeset in a new LOD which was spawned from
500 # an existing LOD.
501
502 if {$isdefault || ($lodname eq ":trunk:")} {
503 # For both (a) and (b) we have to create a new workspace
504 # for the lod, and it doesn't inherit from anything.
505
506 # Note that case (b) may never occur. See the variable
507 # 'lastdefaultontrunk' in the caller (method pushto). This
508 # flag can the generation of the workspace for the :trunk:
509 # LOD as well, making it inherit the state of the last
510 # trunk-changeset on the vendor-branch.
511
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
512 return [$rstate new $lodname]
513 }
514
515 # Case (c). We find the parent LOD of our LOD and let the new
516 # workspace inherit from the parent's workspace.
517
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -497,20 +497,36 @@
497 # (a) root of a vendor branch,
498 # (b) root of the trunk LOD, or
499 # (c) the first changeset in a new LOD which was spawned from
500 # an existing LOD.
501
502 # For both (a) and (b) we have to create a new workspace for
503 # the lod, and it doesn't inherit from anything.
504
505 # One exception for (a). If we already have a :vendor: branch
506 # then multiple symbols were used for the vendor branch by
507 # different files. In that case the 'new' branch is made an
508 # alias of the :vendor:, effectively merging the symbols
509 # together.
510
511 # Note that case (b) may never occur. See the variable
512 # 'lastdefaultontrunk' in the caller (method pushto). This
513 # flag can the generation of the workspace for the :trunk: LOD
514 # as well, making it inherit the state of the last
515 # trunk-changeset on the vendor-branch.
516
517 if {$isdefault} {
518 if {![$rstate has ":vendor:"]} {
519 # Create the vendor branch if not present already.
520 $rstate new :vendor:
521 }
522 # Merge the new symbol to the vendor branch
523 $rstate dup $lodname <-- :vendor:
524 return [$rstate get $lodname]
525 }
526
527 if {$lodname eq ":trunk:"} {
528 return [$rstate new $lodname]
529 }
530
531 # Case (c). We find the parent LOD of our LOD and let the new
532 # workspace inherit from the parent's workspace.
533
--- tools/cvs2fossil/lib/c2f_ristate.tcl
+++ tools/cvs2fossil/lib/c2f_ristate.tcl
@@ -68,10 +68,16 @@
6868
6969
method get {lod} { return $mystate($lod) }
7070
method has {lod} { return [info exists mystate($lod)] }
7171
7272
method names {} { return [array names mystate] }
73
+
74
+ method dup {dst _from_ src} {
75
+ log write 8 ristate {Duplicate workspace state for LOD "$dst" from "$src"}
76
+ set mystate($dst) $mystate($src)
77
+ return
78
+ }
7379
7480
# # ## ### ##### ######## #############
7581
## State
7682
7783
variable mystate -array {} ; # Map from lines of development
7884
--- tools/cvs2fossil/lib/c2f_ristate.tcl
+++ tools/cvs2fossil/lib/c2f_ristate.tcl
@@ -68,10 +68,16 @@
68
69 method get {lod} { return $mystate($lod) }
70 method has {lod} { return [info exists mystate($lod)] }
71
72 method names {} { return [array names mystate] }
 
 
 
 
 
 
73
74 # # ## ### ##### ######## #############
75 ## State
76
77 variable mystate -array {} ; # Map from lines of development
78
--- tools/cvs2fossil/lib/c2f_ristate.tcl
+++ tools/cvs2fossil/lib/c2f_ristate.tcl
@@ -68,10 +68,16 @@
68
69 method get {lod} { return $mystate($lod) }
70 method has {lod} { return [info exists mystate($lod)] }
71
72 method names {} { return [array names mystate] }
73
74 method dup {dst _from_ src} {
75 log write 8 ristate {Duplicate workspace state for LOD "$dst" from "$src"}
76 set mystate($dst) $mystate($src)
77 return
78 }
79
80 # # ## ### ##### ######## #############
81 ## State
82
83 variable mystate -array {} ; # Map from lines of development
84

Keyboard Shortcuts

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