Fossil SCM

Changeset handling, extended logging of how parent is determined. Fossil access, fixed importrev call to use correct workspace/repository. Fixed handling of output, stripping unwanted text, checking of output syntax. Extended logging. Added final 'rebuild'. NOTE: formation of the changesets/manifests is buggy, is not tracking unchanged files across changesets. Further not yet tracking when files have been removed.

aku 2008-02-02 07:03 trunk
Commit 9214c1183140fdbfec9a57640ba1f6fa9bf7c415
--- tools/cvs2fossil/lib/c2f_fossil.tcl
+++ tools/cvs2fossil/lib/c2f_fossil.tcl
@@ -36,10 +36,13 @@
3636
::file mkdir $myworkspace
3737
3838
Do new [::file nativename $myrepository]
3939
$self InWorkspace ; Do open [::file nativename $myrepository]
4040
$self RestorePwd
41
+
42
+ log write 8 fossil {scratch repository $myrepository}
43
+ log write 8 fossil {scratch workspace $myworkspace}
4144
return
4245
}
4346
4447
# # ## ### ##### ######## #############
4548
##
@@ -113,17 +116,31 @@
113116
lappend cmd -f $frid $fpath
114117
log write 2 fossil {** <[format %5d $frid]> = <$flabel>}
115118
}
116119
117120
# run fossil test-command performing the import.
118
- set uuid [eval $cmd]
121
+ log write 8 fossil { [lreplace $cmd 3 3 @@]}
122
+
123
+ $self InWorkspace
124
+ set res [eval $cmd]
125
+ $self RestorePwd
126
+
127
+ integrity assert {
128
+ [regexp {^inserted as record \d+$} $res]
129
+ } {Unable to process unexpected fossil output '$res'}
130
+ set uuid [lindex $res 3]
119131
120132
log write 2 fossil {== $uuid}
133
+ log write 2 fossil { }
134
+ log write 2 fossil { }
135
+
121136
return $uuid
122137
}
123138
124139
method finalize {destination} {
140
+ Do rebuild [::file nativename $myrepository]
141
+
125142
::file rename -force $myrepository $destination
126143
::file delete -force $myworkspace
127144
$self destroy
128145
return
129146
}
130147
--- tools/cvs2fossil/lib/c2f_fossil.tcl
+++ tools/cvs2fossil/lib/c2f_fossil.tcl
@@ -36,10 +36,13 @@
36 ::file mkdir $myworkspace
37
38 Do new [::file nativename $myrepository]
39 $self InWorkspace ; Do open [::file nativename $myrepository]
40 $self RestorePwd
 
 
 
41 return
42 }
43
44 # # ## ### ##### ######## #############
45 ##
@@ -113,17 +116,31 @@
113 lappend cmd -f $frid $fpath
114 log write 2 fossil {** <[format %5d $frid]> = <$flabel>}
115 }
116
117 # run fossil test-command performing the import.
118 set uuid [eval $cmd]
 
 
 
 
 
 
 
 
 
119
120 log write 2 fossil {== $uuid}
 
 
 
121 return $uuid
122 }
123
124 method finalize {destination} {
 
 
125 ::file rename -force $myrepository $destination
126 ::file delete -force $myworkspace
127 $self destroy
128 return
129 }
130
--- tools/cvs2fossil/lib/c2f_fossil.tcl
+++ tools/cvs2fossil/lib/c2f_fossil.tcl
@@ -36,10 +36,13 @@
36 ::file mkdir $myworkspace
37
38 Do new [::file nativename $myrepository]
39 $self InWorkspace ; Do open [::file nativename $myrepository]
40 $self RestorePwd
41
42 log write 8 fossil {scratch repository $myrepository}
43 log write 8 fossil {scratch workspace $myworkspace}
44 return
45 }
46
47 # # ## ### ##### ######## #############
48 ##
@@ -113,17 +116,31 @@
116 lappend cmd -f $frid $fpath
117 log write 2 fossil {** <[format %5d $frid]> = <$flabel>}
118 }
119
120 # run fossil test-command performing the import.
121 log write 8 fossil { [lreplace $cmd 3 3 @@]}
122
123 $self InWorkspace
124 set res [eval $cmd]
125 $self RestorePwd
126
127 integrity assert {
128 [regexp {^inserted as record \d+$} $res]
129 } {Unable to process unexpected fossil output '$res'}
130 set uuid [lindex $res 3]
131
132 log write 2 fossil {== $uuid}
133 log write 2 fossil { }
134 log write 2 fossil { }
135
136 return $uuid
137 }
138
139 method finalize {destination} {
140 Do rebuild [::file nativename $myrepository]
141
142 ::file rename -force $myrepository $destination
143 ::file delete -force $myworkspace
144 $self destroy
145 return
146 }
147
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -446,10 +446,18 @@
446446
447447
proc Getparent {sv lodname project items} {
448448
upvar 1 $sv state
449449
450450
struct::list assign [Getisdefault $items] isdefault lastdefaultontrunk
451
+
452
+ log write 8 csets {LOD '$lodname'}
453
+ log write 8 csets { def? $isdefault}
454
+ log write 8 csets { last? $lastdefaultontrunk}
455
+
456
+ foreach k [lsort [array names state]] {
457
+ log write 8 csets { $k = $state($k)}
458
+ }
451459
452460
# See (a) below, we have to remember if the changeset is last
453461
# on vendor branch also belonging to trunk even if we find a
454462
# parent in the state. The caller will later (after import)
455463
# make us the first trunk changeset in the state (See (**)).
@@ -498,13 +506,16 @@
498506
499507
# Case (c). We find the parent LOD of our LOD and take the
500508
# last changeset committed to that as our parent. If that
501509
# doesn't exist we have an error on our hands.
502510
503
- set lodname [[[$project getsymbol $lodname] parent] name]
504
- if {[info exists state($lodname)]} {
505
- return $state($lodname)
511
+ set plodname [[[$project getsymbol $lodname] parent] name]
512
+
513
+ log write 8 csets {pLOD '$plodname'}
514
+
515
+ if {[info exists state($plodname)]} {
516
+ return $state($plodname)
506517
}
507518
508519
trouble internal {Unable to determine changeset parent}
509520
return
510521
}
511522
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -446,10 +446,18 @@
446
447 proc Getparent {sv lodname project items} {
448 upvar 1 $sv state
449
450 struct::list assign [Getisdefault $items] isdefault lastdefaultontrunk
 
 
 
 
 
 
 
 
451
452 # See (a) below, we have to remember if the changeset is last
453 # on vendor branch also belonging to trunk even if we find a
454 # parent in the state. The caller will later (after import)
455 # make us the first trunk changeset in the state (See (**)).
@@ -498,13 +506,16 @@
498
499 # Case (c). We find the parent LOD of our LOD and take the
500 # last changeset committed to that as our parent. If that
501 # doesn't exist we have an error on our hands.
502
503 set lodname [[[$project getsymbol $lodname] parent] name]
504 if {[info exists state($lodname)]} {
505 return $state($lodname)
 
 
 
506 }
507
508 trouble internal {Unable to determine changeset parent}
509 return
510 }
511
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -446,10 +446,18 @@
446
447 proc Getparent {sv lodname project items} {
448 upvar 1 $sv state
449
450 struct::list assign [Getisdefault $items] isdefault lastdefaultontrunk
451
452 log write 8 csets {LOD '$lodname'}
453 log write 8 csets { def? $isdefault}
454 log write 8 csets { last? $lastdefaultontrunk}
455
456 foreach k [lsort [array names state]] {
457 log write 8 csets { $k = $state($k)}
458 }
459
460 # See (a) below, we have to remember if the changeset is last
461 # on vendor branch also belonging to trunk even if we find a
462 # parent in the state. The caller will later (after import)
463 # make us the first trunk changeset in the state (See (**)).
@@ -498,13 +506,16 @@
506
507 # Case (c). We find the parent LOD of our LOD and take the
508 # last changeset committed to that as our parent. If that
509 # doesn't exist we have an error on our hands.
510
511 set plodname [[[$project getsymbol $lodname] parent] name]
512
513 log write 8 csets {pLOD '$plodname'}
514
515 if {[info exists state($plodname)]} {
516 return $state($plodname)
517 }
518
519 trouble internal {Unable to determine changeset parent}
520 return
521 }
522

Keyboard Shortcuts

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