Fossil SCM

Get the line of development for changesets directly from the items and their lod references. The in-memory data from the meta table is out-of-date since the adjustment of parents in pass 'FilterSymbols'. Print the LOD information when sorting the changesets.

aku 2008-02-06 04:55 trunk
Commit 0d13da30180e3eb1353e902ac45ae4f572767ae9
--- tools/cvs2fossil/lib/c2f_patopsort.tcl
+++ tools/cvs2fossil/lib/c2f_patopsort.tcl
@@ -120,11 +120,11 @@
120120
121121
set date [GetTime [lindex [$graph node get $cset timerange] 1] \
122122
[struct::set contains $mysymchangesets $cset] \
123123
message]
124124
125
- log write 4 atopsort "Changeset @ [format $myatfmt $at]: [format $mycsfmt [$cset str]]$message"
125
+ log write 4 atopsort "Changeset @ [format $myatfmt $at]: [format $mycsfmt [$cset str]] '[$cset lod]' $message"
126126
127127
state run {
128128
INSERT INTO cstimestamp (cid, pos, date)
129129
VALUES ($cid, $at, $date)
130130
}
131131
--- tools/cvs2fossil/lib/c2f_patopsort.tcl
+++ tools/cvs2fossil/lib/c2f_patopsort.tcl
@@ -120,11 +120,11 @@
120
121 set date [GetTime [lindex [$graph node get $cset timerange] 1] \
122 [struct::set contains $mysymchangesets $cset] \
123 message]
124
125 log write 4 atopsort "Changeset @ [format $myatfmt $at]: [format $mycsfmt [$cset str]]$message"
126
127 state run {
128 INSERT INTO cstimestamp (cid, pos, date)
129 VALUES ($cid, $at, $date)
130 }
131
--- tools/cvs2fossil/lib/c2f_patopsort.tcl
+++ tools/cvs2fossil/lib/c2f_patopsort.tcl
@@ -120,11 +120,11 @@
120
121 set date [GetTime [lindex [$graph node get $cset timerange] 1] \
122 [struct::set contains $mysymchangesets $cset] \
123 message]
124
125 log write 4 atopsort "Changeset @ [format $myatfmt $at]: [format $mycsfmt [$cset str]] '[$cset lod]' $message"
126
127 state run {
128 INSERT INTO cstimestamp (cid, pos, date)
129 VALUES ($cid, $at, $date)
130 }
131
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -75,10 +75,14 @@
7575
}]'"
7676
}
7777
append str "$mytype ${myid}${detail}>"
7878
return $str
7979
}
80
+
81
+ method lod {} {
82
+ return [$mytypeobj cs_lod $myitems]
83
+ }
8084
8185
method id {} { return $myid }
8286
method items {} { return $mytitems }
8387
method data {} { return [list $myproject $mytype $mysrcid] }
8488
@@ -403,12 +407,17 @@
403407
# - The parent changeset, if any. If there is no parent fossil
404408
# will use the empty base revision as parent.
405409
#
406410
# - List of the file revisions in the changeset.
407411
408
- struct::list assign [$myproject getmeta $mysrcid] __ branch user message
409
- struct::list assign $branch __ lodname
412
+ struct::list assign [$myproject getmeta $mysrcid] __ __ user message
413
+
414
+ # We derive the lod information directly from the revisions of
415
+ # the changeset, as the branch part of the meta data (s.a.) is
416
+ # outdated since pass FilterSymbols.
417
+
418
+ set lodname [$self lod]
410419
411420
log write 2 csets {Importing revision [$self str] on $lodname}
412421
413422
# Perform the import. As part of that we determine the parent
414423
# we need, and convert the list of items in the changeset into
@@ -1283,10 +1292,25 @@
12831292
AND CI.iid = B.bid -- Select all changesets
12841293
AND C.cid = CI.cid -- containing the branches
12851294
AND C.type = 2 -- which are branch changesets
12861295
}]]
12871296
}
1297
+
1298
+ # result = symbol name
1299
+ typemethod cs_lod {revisions} {
1300
+ # Determines the name of the symbol which is the line of
1301
+ # development for the revisions in a changeset.
1302
+
1303
+ set theset ('[join $revisions {','}]')
1304
+ return [state run [subst -nocommands -nobackslashes {
1305
+ SELECT
1306
+ DISTINCT L.name
1307
+ FROM revision R, symbol L
1308
+ WHERE R.rid in $theset -- Restrict to revisions of interest
1309
+ AND L.sid = R.lod -- Get lod symbol of revision
1310
+ }]]
1311
+ }
12881312
}
12891313
12901314
# # ## ### ##### ######## ############# #####################
12911315
## Helper singleton. Commands for tag symbol changesets.
12921316
@@ -1337,10 +1361,25 @@
13371361
# result = list (changeset-id)
13381362
typemethod cs_successors {tags} {
13391363
# Tags have no successors.
13401364
return
13411365
}
1366
+
1367
+ # result = symbol name
1368
+ typemethod cs_lod {tags} {
1369
+ # Determines the name of the symbol which is the line of
1370
+ # development for the tags in a changeset.
1371
+
1372
+ set theset ('[join $tags {','}]')
1373
+ return [state run [subst -nocommands -nobackslashes {
1374
+ SELECT
1375
+ DISTINCT L.name
1376
+ FROM tag T, symbol L
1377
+ WHERE T.tid in $theset -- Restrict to tags of interest
1378
+ AND L.sid = T.lod -- Get lod symbol of tag
1379
+ }]]
1380
+ }
13421381
}
13431382
13441383
# # ## ### ##### ######## ############# #####################
13451384
## Helper singleton. Commands for branch symbol changesets.
13461385
@@ -1470,10 +1509,25 @@
14701509
AND C.cid = CI.cid -- containing the subordinate tags
14711510
AND C.type = 1 -- which are tag changesets
14721511
}]]
14731512
return
14741513
}
1514
+
1515
+ # result = symbol name
1516
+ typemethod cs_lod {branches} {
1517
+ # Determines the name of the symbol which is the line of
1518
+ # development for the branches in a changeset.
1519
+
1520
+ set theset ('[join $branches {','}]')
1521
+ return [state run [subst -nocommands -nobackslashes {
1522
+ SELECT
1523
+ DISTINCT L.name
1524
+ FROM branch B, symbol L
1525
+ WHERE B.bid in $theset -- Restrict to branches of interest
1526
+ AND L.sid = B.lod -- Get lod symbol of branch
1527
+ }]]
1528
+ }
14751529
14761530
typemethod limits {branches} {
14771531
# Notes. This method exists only for branches. It is needed to
14781532
# get detailed information about a backward branch. It does
14791533
# not apply to tags, nor revisions. The queries can also
14801534
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -75,10 +75,14 @@
75 }]'"
76 }
77 append str "$mytype ${myid}${detail}>"
78 return $str
79 }
 
 
 
 
80
81 method id {} { return $myid }
82 method items {} { return $mytitems }
83 method data {} { return [list $myproject $mytype $mysrcid] }
84
@@ -403,12 +407,17 @@
403 # - The parent changeset, if any. If there is no parent fossil
404 # will use the empty base revision as parent.
405 #
406 # - List of the file revisions in the changeset.
407
408 struct::list assign [$myproject getmeta $mysrcid] __ branch user message
409 struct::list assign $branch __ lodname
 
 
 
 
 
410
411 log write 2 csets {Importing revision [$self str] on $lodname}
412
413 # Perform the import. As part of that we determine the parent
414 # we need, and convert the list of items in the changeset into
@@ -1283,10 +1292,25 @@
1283 AND CI.iid = B.bid -- Select all changesets
1284 AND C.cid = CI.cid -- containing the branches
1285 AND C.type = 2 -- which are branch changesets
1286 }]]
1287 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1288 }
1289
1290 # # ## ### ##### ######## ############# #####################
1291 ## Helper singleton. Commands for tag symbol changesets.
1292
@@ -1337,10 +1361,25 @@
1337 # result = list (changeset-id)
1338 typemethod cs_successors {tags} {
1339 # Tags have no successors.
1340 return
1341 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1342 }
1343
1344 # # ## ### ##### ######## ############# #####################
1345 ## Helper singleton. Commands for branch symbol changesets.
1346
@@ -1470,10 +1509,25 @@
1470 AND C.cid = CI.cid -- containing the subordinate tags
1471 AND C.type = 1 -- which are tag changesets
1472 }]]
1473 return
1474 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1475
1476 typemethod limits {branches} {
1477 # Notes. This method exists only for branches. It is needed to
1478 # get detailed information about a backward branch. It does
1479 # not apply to tags, nor revisions. The queries can also
1480
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -75,10 +75,14 @@
75 }]'"
76 }
77 append str "$mytype ${myid}${detail}>"
78 return $str
79 }
80
81 method lod {} {
82 return [$mytypeobj cs_lod $myitems]
83 }
84
85 method id {} { return $myid }
86 method items {} { return $mytitems }
87 method data {} { return [list $myproject $mytype $mysrcid] }
88
@@ -403,12 +407,17 @@
407 # - The parent changeset, if any. If there is no parent fossil
408 # will use the empty base revision as parent.
409 #
410 # - List of the file revisions in the changeset.
411
412 struct::list assign [$myproject getmeta $mysrcid] __ __ user message
413
414 # We derive the lod information directly from the revisions of
415 # the changeset, as the branch part of the meta data (s.a.) is
416 # outdated since pass FilterSymbols.
417
418 set lodname [$self lod]
419
420 log write 2 csets {Importing revision [$self str] on $lodname}
421
422 # Perform the import. As part of that we determine the parent
423 # we need, and convert the list of items in the changeset into
@@ -1283,10 +1292,25 @@
1292 AND CI.iid = B.bid -- Select all changesets
1293 AND C.cid = CI.cid -- containing the branches
1294 AND C.type = 2 -- which are branch changesets
1295 }]]
1296 }
1297
1298 # result = symbol name
1299 typemethod cs_lod {revisions} {
1300 # Determines the name of the symbol which is the line of
1301 # development for the revisions in a changeset.
1302
1303 set theset ('[join $revisions {','}]')
1304 return [state run [subst -nocommands -nobackslashes {
1305 SELECT
1306 DISTINCT L.name
1307 FROM revision R, symbol L
1308 WHERE R.rid in $theset -- Restrict to revisions of interest
1309 AND L.sid = R.lod -- Get lod symbol of revision
1310 }]]
1311 }
1312 }
1313
1314 # # ## ### ##### ######## ############# #####################
1315 ## Helper singleton. Commands for tag symbol changesets.
1316
@@ -1337,10 +1361,25 @@
1361 # result = list (changeset-id)
1362 typemethod cs_successors {tags} {
1363 # Tags have no successors.
1364 return
1365 }
1366
1367 # result = symbol name
1368 typemethod cs_lod {tags} {
1369 # Determines the name of the symbol which is the line of
1370 # development for the tags in a changeset.
1371
1372 set theset ('[join $tags {','}]')
1373 return [state run [subst -nocommands -nobackslashes {
1374 SELECT
1375 DISTINCT L.name
1376 FROM tag T, symbol L
1377 WHERE T.tid in $theset -- Restrict to tags of interest
1378 AND L.sid = T.lod -- Get lod symbol of tag
1379 }]]
1380 }
1381 }
1382
1383 # # ## ### ##### ######## ############# #####################
1384 ## Helper singleton. Commands for branch symbol changesets.
1385
@@ -1470,10 +1509,25 @@
1509 AND C.cid = CI.cid -- containing the subordinate tags
1510 AND C.type = 1 -- which are tag changesets
1511 }]]
1512 return
1513 }
1514
1515 # result = symbol name
1516 typemethod cs_lod {branches} {
1517 # Determines the name of the symbol which is the line of
1518 # development for the branches in a changeset.
1519
1520 set theset ('[join $branches {','}]')
1521 return [state run [subst -nocommands -nobackslashes {
1522 SELECT
1523 DISTINCT L.name
1524 FROM branch B, symbol L
1525 WHERE B.bid in $theset -- Restrict to branches of interest
1526 AND L.sid = B.lod -- Get lod symbol of branch
1527 }]]
1528 }
1529
1530 typemethod limits {branches} {
1531 # Notes. This method exists only for branches. It is needed to
1532 # get detailed information about a backward branch. It does
1533 # not apply to tags, nor revisions. The queries can also
1534
--- tools/cvs2fossil/lib/c2f_prtopsort.tcl
+++ tools/cvs2fossil/lib/c2f_prtopsort.tcl
@@ -112,11 +112,11 @@
112112
::variable myatfmt
113113
::variable mycsfmt
114114
115115
set cid [$cset id]
116116
117
- log write 4 rtopsort "Changeset @ [format $myatfmt $at]: [format $mycsfmt [$cset str]] <<[FormatTR $graph $cset]>>"
117
+ log write 4 rtopsort "Changeset @ [format $myatfmt $at]: [format $mycsfmt [$cset str]] '[$cset lod]' <<[FormatTR $graph $cset]>>"
118118
state run {
119119
INSERT INTO csorder (cid, pos)
120120
VALUES ($cid, $at)
121121
}
122122
return
123123
--- tools/cvs2fossil/lib/c2f_prtopsort.tcl
+++ tools/cvs2fossil/lib/c2f_prtopsort.tcl
@@ -112,11 +112,11 @@
112 ::variable myatfmt
113 ::variable mycsfmt
114
115 set cid [$cset id]
116
117 log write 4 rtopsort "Changeset @ [format $myatfmt $at]: [format $mycsfmt [$cset str]] <<[FormatTR $graph $cset]>>"
118 state run {
119 INSERT INTO csorder (cid, pos)
120 VALUES ($cid, $at)
121 }
122 return
123
--- tools/cvs2fossil/lib/c2f_prtopsort.tcl
+++ tools/cvs2fossil/lib/c2f_prtopsort.tcl
@@ -112,11 +112,11 @@
112 ::variable myatfmt
113 ::variable mycsfmt
114
115 set cid [$cset id]
116
117 log write 4 rtopsort "Changeset @ [format $myatfmt $at]: [format $mycsfmt [$cset str]] '[$cset lod]' <<[FormatTR $graph $cset]>>"
118 state run {
119 INSERT INTO csorder (cid, pos)
120 VALUES ($cid, $at)
121 }
122 return
123

Keyboard Shortcuts

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