Fossil SCM

Fixed saving of authors, log messages, meta data. This was wrong since revision [99e165d5c4], when the id databases were introduced. Simplified meta saving due to changed trunk coding (no NULL).

aku 2007-10-25 05:16 trunk
Commit 89e9b357edc1bcbc6eac3a3cf17385782fae070e
--- tools/cvs2fossil/lib/c2f_repository.tcl
+++ tools/cvs2fossil/lib/c2f_repository.tcl
@@ -268,11 +268,11 @@
268268
return $res
269269
}
270270
271271
proc SaveAuthors {} {
272272
::variable myauthor
273
- foreach {name aid} [array get myauthor] {
273
+ foreach {name aid} [$myauthor get] {
274274
state run {
275275
INSERT INTO author ( aid, name)
276276
VALUES ($aid, $name);
277277
}
278278
}
@@ -279,11 +279,11 @@
279279
return
280280
}
281281
282282
proc SaveCommitMessages {} {
283283
::variable mycmsg
284
- foreach {text cid} [array get mycmsg] {
284
+ foreach {text cid} [$mycmsg get] {
285285
state run {
286286
INSERT INTO cmessage ( cid, text)
287287
VALUES ($cid, $text);
288288
}
289289
}
@@ -290,23 +290,15 @@
290290
return
291291
}
292292
293293
proc SaveMeta {} {
294294
::variable mymeta
295
- foreach {key mid} [array get mymeta] {
295
+ foreach {key mid} [$mymeta get] {
296296
struct::list assign $key pid bid aid cid
297
- if {$bid eq ""} {
298
- # Trunk. Encoded as NULL.
299
- state run {
300
- INSERT INTO meta ( mid, pid, bid, aid, cid)
301
- VALUES ($mid, $pid, NULL, $aid, $cid);
302
- }
303
- } else {
304
- state run {
305
- INSERT INTO meta ( mid, pid, bid, aid, cid)
306
- VALUES ($mid, $pid, $bid, $aid, $cid);
307
- }
297
+ state run {
298
+ INSERT INTO meta ( mid, pid, bid, aid, cid)
299
+ VALUES ($mid, $pid, $bid, $aid, $cid);
308300
}
309301
}
310302
return
311303
}
312304
313305
--- tools/cvs2fossil/lib/c2f_repository.tcl
+++ tools/cvs2fossil/lib/c2f_repository.tcl
@@ -268,11 +268,11 @@
268 return $res
269 }
270
271 proc SaveAuthors {} {
272 ::variable myauthor
273 foreach {name aid} [array get myauthor] {
274 state run {
275 INSERT INTO author ( aid, name)
276 VALUES ($aid, $name);
277 }
278 }
@@ -279,11 +279,11 @@
279 return
280 }
281
282 proc SaveCommitMessages {} {
283 ::variable mycmsg
284 foreach {text cid} [array get mycmsg] {
285 state run {
286 INSERT INTO cmessage ( cid, text)
287 VALUES ($cid, $text);
288 }
289 }
@@ -290,23 +290,15 @@
290 return
291 }
292
293 proc SaveMeta {} {
294 ::variable mymeta
295 foreach {key mid} [array get mymeta] {
296 struct::list assign $key pid bid aid cid
297 if {$bid eq ""} {
298 # Trunk. Encoded as NULL.
299 state run {
300 INSERT INTO meta ( mid, pid, bid, aid, cid)
301 VALUES ($mid, $pid, NULL, $aid, $cid);
302 }
303 } else {
304 state run {
305 INSERT INTO meta ( mid, pid, bid, aid, cid)
306 VALUES ($mid, $pid, $bid, $aid, $cid);
307 }
308 }
309 }
310 return
311 }
312
313
--- tools/cvs2fossil/lib/c2f_repository.tcl
+++ tools/cvs2fossil/lib/c2f_repository.tcl
@@ -268,11 +268,11 @@
268 return $res
269 }
270
271 proc SaveAuthors {} {
272 ::variable myauthor
273 foreach {name aid} [$myauthor get] {
274 state run {
275 INSERT INTO author ( aid, name)
276 VALUES ($aid, $name);
277 }
278 }
@@ -279,11 +279,11 @@
279 return
280 }
281
282 proc SaveCommitMessages {} {
283 ::variable mycmsg
284 foreach {text cid} [$mycmsg get] {
285 state run {
286 INSERT INTO cmessage ( cid, text)
287 VALUES ($cid, $text);
288 }
289 }
@@ -290,23 +290,15 @@
290 return
291 }
292
293 proc SaveMeta {} {
294 ::variable mymeta
295 foreach {key mid} [$mymeta get] {
296 struct::list assign $key pid bid aid cid
297 state run {
298 INSERT INTO meta ( mid, pid, bid, aid, cid)
299 VALUES ($mid, $pid, $bid, $aid, $cid);
 
 
 
 
 
 
 
 
300 }
301 }
302 return
303 }
304
305
--- tools/cvs2fossil/lib/id.tcl
+++ tools/cvs2fossil/lib/id.tcl
@@ -34,10 +34,11 @@
3434
3535
return $mycounter
3636
}
3737
3838
method keyof {id} { return $myinvert($id) }
39
+ method get {} { return [array get mydata] }
3940
4041
# # ## ### ##### ######## #############
4142
## Internal. State.
4243
4344
variable mydata -array {} ; # Map data -> id
4445
--- tools/cvs2fossil/lib/id.tcl
+++ tools/cvs2fossil/lib/id.tcl
@@ -34,10 +34,11 @@
34
35 return $mycounter
36 }
37
38 method keyof {id} { return $myinvert($id) }
 
39
40 # # ## ### ##### ######## #############
41 ## Internal. State.
42
43 variable mydata -array {} ; # Map data -> id
44
--- tools/cvs2fossil/lib/id.tcl
+++ tools/cvs2fossil/lib/id.tcl
@@ -34,10 +34,11 @@
34
35 return $mycounter
36 }
37
38 method keyof {id} { return $myinvert($id) }
39 method get {} { return [array get mydata] }
40
41 # # ## ### ##### ######## #############
42 ## Internal. State.
43
44 variable mydata -array {} ; # Map data -> id
45

Keyboard Shortcuts

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