Fossil SCM

Moved the functionality for splitting a changeset based on the sets of revisions for the fragments to be into a separate command, and into the changeset class, for use outside of changeset links.

aku 2007-11-22 02:58 trunk
Commit 59207428e2f5aa5c25925ba14275bb0853a6b0c3
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -62,10 +62,11 @@
6262
}
6363
}
6464
return [lsort -unique $csets]
6565
}
6666
67
+ # revision -> list (revision)
6768
method nextmap {} {
6869
if {[llength $mynextmap]} { return $mynextmap }
6970
PullSuccessorRevisions tmp $myrevisions
7071
set mynextmap [array get tmp]
7172
return $mynextmap
@@ -252,10 +253,30 @@
252253
foreach r $myrevisions { unset myrevmap($r) }
253254
set pos [lsearch -exact $mychangesets $self]
254255
set mychangesets [lreplace $mychangesets $pos $pos]
255256
return
256257
}
258
+
259
+ typemethod split {cset args} {
260
+ # As part of the creation of the new changesets specified in
261
+ # ARGS as sets of revisions, all subsets of CSET's revision
262
+ # set, CSET will be dropped from all databases, in and out of
263
+ # memory, and then destroyed.
264
+
265
+ struct::list assign [$cset data] project cstype cssrc
266
+
267
+ $cset drop
268
+ $cset destroy
269
+
270
+ set newcsets {}
271
+ foreach fragmentrevisions $args {
272
+ lappend newcsets [$type %AUTO% $project $cstype $cssrc $fragmentrevisions]
273
+ }
274
+
275
+ foreach c $newcsets { $c persist }
276
+ return $newcsets
277
+ }
257278
258279
# # ## ### ##### ######## #############
259280
## State
260281
261282
variable myid {} ; # Id of the cset for the persistent
@@ -567,13 +588,11 @@
567588
# # ## ### ##### ######## #############
568589
569590
typevariable mychangesets {} ; # List of all known changesets.
570591
typevariable myrevmap -array {} ; # Map from revisions to their changeset.
571592
572
- typemethod all {} {
573
- return $mychangesets
574
- }
593
+ typemethod all {} { return $mychangesets }
575594
576595
# # ## ### ##### ######## #############
577596
## Configuration
578597
579598
pragma -hastypeinfo no ; # no type introspection
580599
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -62,10 +62,11 @@
62 }
63 }
64 return [lsort -unique $csets]
65 }
66
 
67 method nextmap {} {
68 if {[llength $mynextmap]} { return $mynextmap }
69 PullSuccessorRevisions tmp $myrevisions
70 set mynextmap [array get tmp]
71 return $mynextmap
@@ -252,10 +253,30 @@
252 foreach r $myrevisions { unset myrevmap($r) }
253 set pos [lsearch -exact $mychangesets $self]
254 set mychangesets [lreplace $mychangesets $pos $pos]
255 return
256 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
257
258 # # ## ### ##### ######## #############
259 ## State
260
261 variable myid {} ; # Id of the cset for the persistent
@@ -567,13 +588,11 @@
567 # # ## ### ##### ######## #############
568
569 typevariable mychangesets {} ; # List of all known changesets.
570 typevariable myrevmap -array {} ; # Map from revisions to their changeset.
571
572 typemethod all {} {
573 return $mychangesets
574 }
575
576 # # ## ### ##### ######## #############
577 ## Configuration
578
579 pragma -hastypeinfo no ; # no type introspection
580
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -62,10 +62,11 @@
62 }
63 }
64 return [lsort -unique $csets]
65 }
66
67 # revision -> list (revision)
68 method nextmap {} {
69 if {[llength $mynextmap]} { return $mynextmap }
70 PullSuccessorRevisions tmp $myrevisions
71 set mynextmap [array get tmp]
72 return $mynextmap
@@ -252,10 +253,30 @@
253 foreach r $myrevisions { unset myrevmap($r) }
254 set pos [lsearch -exact $mychangesets $self]
255 set mychangesets [lreplace $mychangesets $pos $pos]
256 return
257 }
258
259 typemethod split {cset args} {
260 # As part of the creation of the new changesets specified in
261 # ARGS as sets of revisions, all subsets of CSET's revision
262 # set, CSET will be dropped from all databases, in and out of
263 # memory, and then destroyed.
264
265 struct::list assign [$cset data] project cstype cssrc
266
267 $cset drop
268 $cset destroy
269
270 set newcsets {}
271 foreach fragmentrevisions $args {
272 lappend newcsets [$type %AUTO% $project $cstype $cssrc $fragmentrevisions]
273 }
274
275 foreach c $newcsets { $c persist }
276 return $newcsets
277 }
278
279 # # ## ### ##### ######## #############
280 ## State
281
282 variable myid {} ; # Id of the cset for the persistent
@@ -567,13 +588,11 @@
588 # # ## ### ##### ######## #############
589
590 typevariable mychangesets {} ; # List of all known changesets.
591 typevariable myrevmap -array {} ; # Map from revisions to their changeset.
592
593 typemethod all {} { return $mychangesets }
 
 
594
595 # # ## ### ##### ######## #############
596 ## Configuration
597
598 pragma -hastypeinfo no ; # no type introspection
599
--- tools/cvs2fossil/lib/c2f_prevlink.tcl
+++ tools/cvs2fossil/lib/c2f_prevlink.tcl
@@ -148,26 +148,14 @@
148148
# predecessors.
149149
set mycategory(next) [concat $mycategory(next) $mycategory(none) \
150150
$mycategory(pass)]
151151
}
152152
153
- # We now have the split in the mycategory(prev|next)
154
- # elements. As part of the creation of the new changesets the
155
- # old one is dropped from all databases, in and out of memory,
156
- # and then destroyed.
157
-
158
- struct::list assign [$mycset data] project cstype cssrc
159
- $mycset drop
160
- $mycset destroy
161
-
162
- set newcsets {}
163
- lappend newcsets [project::rev %AUTO% $project $cstype $cssrc $mycategory(prev)]
164
- lappend newcsets [project::rev %AUTO% $project $cstype $cssrc $mycategory(next)]
165
-
166
- foreach c $newcsets { $c persist }
167
-
168
- return $newcsets
153
+ # We now have the revisions for the two fragments to be in the
154
+ # (prev|next) elements of mycategory.
155
+
156
+ return [project::rev split $mycset $mycategory(prev) $mycategory(next)]
169157
}
170158
171159
# # ## ### ##### ######## #############
172160
## State
173161
174162
--- tools/cvs2fossil/lib/c2f_prevlink.tcl
+++ tools/cvs2fossil/lib/c2f_prevlink.tcl
@@ -148,26 +148,14 @@
148 # predecessors.
149 set mycategory(next) [concat $mycategory(next) $mycategory(none) \
150 $mycategory(pass)]
151 }
152
153 # We now have the split in the mycategory(prev|next)
154 # elements. As part of the creation of the new changesets the
155 # old one is dropped from all databases, in and out of memory,
156 # and then destroyed.
157
158 struct::list assign [$mycset data] project cstype cssrc
159 $mycset drop
160 $mycset destroy
161
162 set newcsets {}
163 lappend newcsets [project::rev %AUTO% $project $cstype $cssrc $mycategory(prev)]
164 lappend newcsets [project::rev %AUTO% $project $cstype $cssrc $mycategory(next)]
165
166 foreach c $newcsets { $c persist }
167
168 return $newcsets
169 }
170
171 # # ## ### ##### ######## #############
172 ## State
173
174
--- tools/cvs2fossil/lib/c2f_prevlink.tcl
+++ tools/cvs2fossil/lib/c2f_prevlink.tcl
@@ -148,26 +148,14 @@
148 # predecessors.
149 set mycategory(next) [concat $mycategory(next) $mycategory(none) \
150 $mycategory(pass)]
151 }
152
153 # We now have the revisions for the two fragments to be in the
154 # (prev|next) elements of mycategory.
155
156 return [project::rev split $mycset $mycategory(prev) $mycategory(next)]
 
 
 
 
 
 
 
 
 
 
 
 
157 }
158
159 # # ## ### ##### ######## #############
160 ## State
161
162

Keyboard Shortcuts

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