Fossil SCM

Went to explicit var-substitution for the dynamic sql queries, makes formatting easier.

aku 2007-12-05 02:29 trunk
Commit 0ee9711e2e4cc2bf754951a1f4ab156f927be865
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -628,15 +628,15 @@
628628
629629
array set delta {}
630630
array set stamp {}
631631
632632
set theset ('[join $revisions {','}]')
633
- foreach {rid time} [state run "
633
+ foreach {rid time} [state run [subst -nocommands -nobackslashes {
634634
SELECT R.rid, R.date
635635
FROM revision R
636636
WHERE R.rid IN $theset
637
- "] {
637
+ }]] {
638638
set stamp($rid) $time
639639
}
640640
641641
set n 0
642642
foreach rid [lrange $revisions 0 end-1] rnext [lrange $revisions 1 end] {
@@ -829,15 +829,15 @@
829829
}
830830
831831
# result = list (mintime, maxtime)
832832
typemethod timerange {items} {
833833
set theset ('[join $items {','}]')
834
- return [state run "
834
+ return [state run [subst -nocommands -nobackslashes {
835835
SELECT MIN(R.date), MAX(R.date)
836836
FROM revision R
837837
WHERE R.rid IN $theset
838
- "]
838
+ }]]
839839
}
840840
841841
# var(dv) = dict (revision -> list (revision))
842842
typemethod internalsuccessors {dv revisions} {
843843
upvar 1 $dv dependencies
@@ -849,11 +849,11 @@
849849
# revisions we start from. Sensible as we are looking for
850850
# changeset internal dependencies.
851851
852852
array set dep {}
853853
854
- foreach {rid child} [state run "
854
+ foreach {rid child} [state run [subst -nocommands -nobackslashes {
855855
-- (1) Primary child
856856
SELECT R.rid, R.child
857857
FROM revision R
858858
WHERE R.rid IN $theset -- Restrict to revisions of interest
859859
AND R.child IS NOT NULL -- Has primary child
@@ -873,11 +873,11 @@
873873
AND R.isdefault -- Restrict to NTDB
874874
AND R.dbchild IS NOT NULL -- and last NTDB belonging to trunk
875875
AND RA.rid = R.dbchild -- Go directly to trunk root
876876
AND RA.child IS NOT NULL -- Has primary child.
877877
AND RA.child IN $theset -- Which is also of interest
878
- "] {
878
+ }]] {
879879
# Consider moving this to the integrity module.
880880
integrity assert {$rid != $child} {Revision $rid depends on itself.}
881881
lappend dependencies($rid) $child
882882
set dep($rid,$child) .
883883
}
@@ -903,15 +903,15 @@
903903
# We allow revisions to be far apart in time in the same
904904
# changeset, but in turn need the pseudo-dependencies to
905905
# handle this.
906906
907907
array set fids {}
908
- foreach {rid fid} [state run "
908
+ foreach {rid fid} [state run [subst -nocommands -nobackslashes {
909909
SELECT R.rid, R.fid
910910
FROM revision R
911911
WHERE R.rid IN $theset
912
- "] { lappend fids($fid) $rid }
912
+ }]] { lappend fids($fid) $rid }
913913
914914
foreach {fid rids} [array get fids] {
915915
if {[llength $rids] < 2} continue
916916
foreach a $rids {
917917
foreach b $rids {
@@ -993,11 +993,11 @@
993993
# '1.2' revision) is a successor, if it exists.
994994
995995
# Note that the branches spawned from the revisions, and the
996996
# tags associated with them are successors as well.
997997
998
- foreach {rid child} [state run "
998
+ foreach {rid child} [state run [subst -nocommands -nobackslashes {
999999
-- (1) Primary child
10001000
SELECT R.rid, R.child
10011001
FROM revision R
10021002
WHERE R.rid IN $theset -- Restrict to revisions of interest
10031003
AND R.child IS NOT NULL -- Has primary child
@@ -1014,29 +1014,29 @@
10141014
WHERE R.rid IN $theset -- Restrict to revisions of interest
10151015
AND R.isdefault -- Restrict to NTDB
10161016
AND R.dbchild IS NOT NULL -- and last NTDB belonging to trunk
10171017
AND RA.rid = R.dbchild -- Go directly to trunk root
10181018
AND RA.child IS NOT NULL -- Has primary child.
1019
- "] {
1019
+ }]] {
10201020
# Consider moving this to the integrity module.
10211021
integrity assert {$rid != $child} {Revision $rid depends on itself.}
10221022
lappend dependencies([list rev $rid]) [list rev $child]
10231023
}
1024
- foreach {rid child} [state run "
1024
+ foreach {rid child} [state run [subst -nocommands -nobackslashes {
10251025
SELECT R.rid, T.tid
10261026
FROM revision R, tag T
10271027
WHERE R.rid IN $theset
10281028
AND T.rev = R.rid
1029
- "] {
1029
+ }]] {
10301030
lappend dependencies([list rev $rid]) [list sym::tag $child]
10311031
}
1032
- foreach {rid child} [state run "
1032
+ foreach {rid child} [state run [subst -nocommands -nobackslashes {
10331033
SELECT R.rid, B.bid
10341034
FROM revision R, branch B
10351035
WHERE R.rid IN $theset
10361036
AND B.root = R.rid
1037
- "] {
1037
+ }]] {
10381038
lappend dependencies([list rev $rid]) [list sym::branch $child]
10391039
}
10401040
return
10411041
}
10421042
@@ -1047,11 +1047,11 @@
10471047
# millions of dependency pairs (in extreme cases (Example: Tcl
10481048
# CVS)) we return a very short and much more manageable list
10491049
# of changesets.
10501050
10511051
set theset ('[join $revisions {','}]')
1052
- return [state run "
1052
+ return [state run [subst -nocommands -nobackslashes {
10531053
SELECT C.cid
10541054
FROM revision R, csitem CI, changeset C
10551055
WHERE R.rid IN $theset -- Restrict to revisions of interest
10561056
AND R.child IS NOT NULL -- Has primary child
10571057
AND CI.iid = R.child
@@ -1090,11 +1090,11 @@
10901090
WHERE R.rid in $theset
10911091
AND B.root = R.rid
10921092
AND CI.iid = B.bid
10931093
AND C.cid = CI.cid
10941094
AND C.type = 2
1095
- "]
1095
+ }]]
10961096
}
10971097
}
10981098
10991099
# # ## ### ##### ######## ############# #####################
11001100
## Helper singleton. Commands for tag symbol changesets.
@@ -1121,16 +1121,16 @@
11211121
typemethod timerange {tags} {
11221122
# The range is defined as the range of the revisions the tags
11231123
# are attached to.
11241124
11251125
set theset ('[join $tags {','}]')
1126
- return [state run "
1126
+ return [state run [subst -nocommands -nobackslashes {
11271127
SELECT MIN(R.date), MAX(R.date)
11281128
FROM tag T, revision R
11291129
WHERE T.tid IN $theset
11301130
AND R.rid = T.rev
1131
- "]
1131
+ }]]
11321132
}
11331133
11341134
# var(dv) = dict (item -> list (item)), item = list (type id)
11351135
typemethod successors {dv tags} {
11361136
# Tags have no successors.
@@ -1179,16 +1179,16 @@
11791179
# spawning them, hence they have no real timerange any
11801180
# longer. By using 0 we put them in front of everything else,
11811181
# as they logically are.
11821182
11831183
set theset ('[join $branches {','}]')
1184
- return [state run "
1184
+ return [state run [subst -nocommands -nobackslashes {
11851185
SELECT IFNULL(MIN(R.date),0), IFNULL(MAX(R.date),0)
11861186
FROM branch B, revision R
11871187
WHERE B.bid IN $theset
11881188
AND R.rid = B.root
1189
- "]
1189
+ }]]
11901190
}
11911191
11921192
# result = 4-list (itemtype itemid nextitemtype nextitemid ...)
11931193
typemethod loops {branches} {
11941194
# Note: Revisions and tags cannot cause the loop. Being of a
@@ -1212,34 +1212,34 @@
12121212
# The first revision committed on a branch, and all branches
12131213
# and tags which have it as their prefered parent are the
12141214
# successors of a branch.
12151215
12161216
set theset ('[join $branches {','}]')
1217
- foreach {bid child} [state run "
1217
+ foreach {bid child} [state run [subst -nocommands -nobackslashes {
12181218
SELECT B.bid, R.rid
12191219
FROM branch B, revision R
12201220
WHERE B.bid IN $theset
12211221
AND B.first = R.rid
1222
- "] {
1222
+ }]] {
12231223
lappend dependencies([list sym::branch $bid]) [list rev $child]
12241224
}
1225
- foreach {bid child} [state run "
1225
+ foreach {bid child} [state run [subst -nocommands -nobackslashes {
12261226
SELECT B.bid, BX.bid
12271227
FROM branch B, preferedparent P, branch BX
12281228
WHERE B.bid IN $theset
12291229
AND B.sid = P.pid
12301230
AND BX.sid = P.sid
1231
- "] {
1231
+ }]] {
12321232
lappend dependencies([list sym::branch $bid]) [list sym::branch $child]
12331233
}
1234
- foreach {bid child} [state run "
1234
+ foreach {bid child} [state run [subst -nocommands -nobackslashes {
12351235
SELECT B.bid, T.tid
12361236
FROM branch B, preferedparent P, tag T
12371237
WHERE B.bid IN $theset
12381238
AND B.sid = P.pid
12391239
AND T.sid = P.sid
1240
- "] {
1240
+ }]] {
12411241
lappend dependencies([list sym::branch $bid]) [list sym::tag $child]
12421242
}
12431243
return
12441244
}
12451245
@@ -1250,11 +1250,11 @@
12501250
# millions of dependency pairs (in extreme cases (Example: Tcl
12511251
# CVS)) we return a very short and much more manageable list
12521252
# of changesets.
12531253
12541254
set theset ('[join $branches {','}]')
1255
- return [state run "
1255
+ return [state run [subst -nocommands -nobackslashes {
12561256
SELECT C.cid
12571257
FROM branch B, revision R, csitem CI, changeset C
12581258
WHERE B.bid IN $theset
12591259
AND B.first = R.rid
12601260
AND CI.iid = R.rid
@@ -1276,11 +1276,11 @@
12761276
AND B.sid = P.pid
12771277
AND T.sid = P.sid
12781278
AND CI.iid = T.tid
12791279
AND C.cid = CI.cid
12801280
AND C.type = 1
1281
- "]
1281
+ }]]
12821282
return
12831283
}
12841284
12851285
typemethod limits {branches} {
12861286
# Notes. This method exists only for branches. It is needed to
12871287
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -628,15 +628,15 @@
628
629 array set delta {}
630 array set stamp {}
631
632 set theset ('[join $revisions {','}]')
633 foreach {rid time} [state run "
634 SELECT R.rid, R.date
635 FROM revision R
636 WHERE R.rid IN $theset
637 "] {
638 set stamp($rid) $time
639 }
640
641 set n 0
642 foreach rid [lrange $revisions 0 end-1] rnext [lrange $revisions 1 end] {
@@ -829,15 +829,15 @@
829 }
830
831 # result = list (mintime, maxtime)
832 typemethod timerange {items} {
833 set theset ('[join $items {','}]')
834 return [state run "
835 SELECT MIN(R.date), MAX(R.date)
836 FROM revision R
837 WHERE R.rid IN $theset
838 "]
839 }
840
841 # var(dv) = dict (revision -> list (revision))
842 typemethod internalsuccessors {dv revisions} {
843 upvar 1 $dv dependencies
@@ -849,11 +849,11 @@
849 # revisions we start from. Sensible as we are looking for
850 # changeset internal dependencies.
851
852 array set dep {}
853
854 foreach {rid child} [state run "
855 -- (1) Primary child
856 SELECT R.rid, R.child
857 FROM revision R
858 WHERE R.rid IN $theset -- Restrict to revisions of interest
859 AND R.child IS NOT NULL -- Has primary child
@@ -873,11 +873,11 @@
873 AND R.isdefault -- Restrict to NTDB
874 AND R.dbchild IS NOT NULL -- and last NTDB belonging to trunk
875 AND RA.rid = R.dbchild -- Go directly to trunk root
876 AND RA.child IS NOT NULL -- Has primary child.
877 AND RA.child IN $theset -- Which is also of interest
878 "] {
879 # Consider moving this to the integrity module.
880 integrity assert {$rid != $child} {Revision $rid depends on itself.}
881 lappend dependencies($rid) $child
882 set dep($rid,$child) .
883 }
@@ -903,15 +903,15 @@
903 # We allow revisions to be far apart in time in the same
904 # changeset, but in turn need the pseudo-dependencies to
905 # handle this.
906
907 array set fids {}
908 foreach {rid fid} [state run "
909 SELECT R.rid, R.fid
910 FROM revision R
911 WHERE R.rid IN $theset
912 "] { lappend fids($fid) $rid }
913
914 foreach {fid rids} [array get fids] {
915 if {[llength $rids] < 2} continue
916 foreach a $rids {
917 foreach b $rids {
@@ -993,11 +993,11 @@
993 # '1.2' revision) is a successor, if it exists.
994
995 # Note that the branches spawned from the revisions, and the
996 # tags associated with them are successors as well.
997
998 foreach {rid child} [state run "
999 -- (1) Primary child
1000 SELECT R.rid, R.child
1001 FROM revision R
1002 WHERE R.rid IN $theset -- Restrict to revisions of interest
1003 AND R.child IS NOT NULL -- Has primary child
@@ -1014,29 +1014,29 @@
1014 WHERE R.rid IN $theset -- Restrict to revisions of interest
1015 AND R.isdefault -- Restrict to NTDB
1016 AND R.dbchild IS NOT NULL -- and last NTDB belonging to trunk
1017 AND RA.rid = R.dbchild -- Go directly to trunk root
1018 AND RA.child IS NOT NULL -- Has primary child.
1019 "] {
1020 # Consider moving this to the integrity module.
1021 integrity assert {$rid != $child} {Revision $rid depends on itself.}
1022 lappend dependencies([list rev $rid]) [list rev $child]
1023 }
1024 foreach {rid child} [state run "
1025 SELECT R.rid, T.tid
1026 FROM revision R, tag T
1027 WHERE R.rid IN $theset
1028 AND T.rev = R.rid
1029 "] {
1030 lappend dependencies([list rev $rid]) [list sym::tag $child]
1031 }
1032 foreach {rid child} [state run "
1033 SELECT R.rid, B.bid
1034 FROM revision R, branch B
1035 WHERE R.rid IN $theset
1036 AND B.root = R.rid
1037 "] {
1038 lappend dependencies([list rev $rid]) [list sym::branch $child]
1039 }
1040 return
1041 }
1042
@@ -1047,11 +1047,11 @@
1047 # millions of dependency pairs (in extreme cases (Example: Tcl
1048 # CVS)) we return a very short and much more manageable list
1049 # of changesets.
1050
1051 set theset ('[join $revisions {','}]')
1052 return [state run "
1053 SELECT C.cid
1054 FROM revision R, csitem CI, changeset C
1055 WHERE R.rid IN $theset -- Restrict to revisions of interest
1056 AND R.child IS NOT NULL -- Has primary child
1057 AND CI.iid = R.child
@@ -1090,11 +1090,11 @@
1090 WHERE R.rid in $theset
1091 AND B.root = R.rid
1092 AND CI.iid = B.bid
1093 AND C.cid = CI.cid
1094 AND C.type = 2
1095 "]
1096 }
1097 }
1098
1099 # # ## ### ##### ######## ############# #####################
1100 ## Helper singleton. Commands for tag symbol changesets.
@@ -1121,16 +1121,16 @@
1121 typemethod timerange {tags} {
1122 # The range is defined as the range of the revisions the tags
1123 # are attached to.
1124
1125 set theset ('[join $tags {','}]')
1126 return [state run "
1127 SELECT MIN(R.date), MAX(R.date)
1128 FROM tag T, revision R
1129 WHERE T.tid IN $theset
1130 AND R.rid = T.rev
1131 "]
1132 }
1133
1134 # var(dv) = dict (item -> list (item)), item = list (type id)
1135 typemethod successors {dv tags} {
1136 # Tags have no successors.
@@ -1179,16 +1179,16 @@
1179 # spawning them, hence they have no real timerange any
1180 # longer. By using 0 we put them in front of everything else,
1181 # as they logically are.
1182
1183 set theset ('[join $branches {','}]')
1184 return [state run "
1185 SELECT IFNULL(MIN(R.date),0), IFNULL(MAX(R.date),0)
1186 FROM branch B, revision R
1187 WHERE B.bid IN $theset
1188 AND R.rid = B.root
1189 "]
1190 }
1191
1192 # result = 4-list (itemtype itemid nextitemtype nextitemid ...)
1193 typemethod loops {branches} {
1194 # Note: Revisions and tags cannot cause the loop. Being of a
@@ -1212,34 +1212,34 @@
1212 # The first revision committed on a branch, and all branches
1213 # and tags which have it as their prefered parent are the
1214 # successors of a branch.
1215
1216 set theset ('[join $branches {','}]')
1217 foreach {bid child} [state run "
1218 SELECT B.bid, R.rid
1219 FROM branch B, revision R
1220 WHERE B.bid IN $theset
1221 AND B.first = R.rid
1222 "] {
1223 lappend dependencies([list sym::branch $bid]) [list rev $child]
1224 }
1225 foreach {bid child} [state run "
1226 SELECT B.bid, BX.bid
1227 FROM branch B, preferedparent P, branch BX
1228 WHERE B.bid IN $theset
1229 AND B.sid = P.pid
1230 AND BX.sid = P.sid
1231 "] {
1232 lappend dependencies([list sym::branch $bid]) [list sym::branch $child]
1233 }
1234 foreach {bid child} [state run "
1235 SELECT B.bid, T.tid
1236 FROM branch B, preferedparent P, tag T
1237 WHERE B.bid IN $theset
1238 AND B.sid = P.pid
1239 AND T.sid = P.sid
1240 "] {
1241 lappend dependencies([list sym::branch $bid]) [list sym::tag $child]
1242 }
1243 return
1244 }
1245
@@ -1250,11 +1250,11 @@
1250 # millions of dependency pairs (in extreme cases (Example: Tcl
1251 # CVS)) we return a very short and much more manageable list
1252 # of changesets.
1253
1254 set theset ('[join $branches {','}]')
1255 return [state run "
1256 SELECT C.cid
1257 FROM branch B, revision R, csitem CI, changeset C
1258 WHERE B.bid IN $theset
1259 AND B.first = R.rid
1260 AND CI.iid = R.rid
@@ -1276,11 +1276,11 @@
1276 AND B.sid = P.pid
1277 AND T.sid = P.sid
1278 AND CI.iid = T.tid
1279 AND C.cid = CI.cid
1280 AND C.type = 1
1281 "]
1282 return
1283 }
1284
1285 typemethod limits {branches} {
1286 # Notes. This method exists only for branches. It is needed to
1287
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -628,15 +628,15 @@
628
629 array set delta {}
630 array set stamp {}
631
632 set theset ('[join $revisions {','}]')
633 foreach {rid time} [state run [subst -nocommands -nobackslashes {
634 SELECT R.rid, R.date
635 FROM revision R
636 WHERE R.rid IN $theset
637 }]] {
638 set stamp($rid) $time
639 }
640
641 set n 0
642 foreach rid [lrange $revisions 0 end-1] rnext [lrange $revisions 1 end] {
@@ -829,15 +829,15 @@
829 }
830
831 # result = list (mintime, maxtime)
832 typemethod timerange {items} {
833 set theset ('[join $items {','}]')
834 return [state run [subst -nocommands -nobackslashes {
835 SELECT MIN(R.date), MAX(R.date)
836 FROM revision R
837 WHERE R.rid IN $theset
838 }]]
839 }
840
841 # var(dv) = dict (revision -> list (revision))
842 typemethod internalsuccessors {dv revisions} {
843 upvar 1 $dv dependencies
@@ -849,11 +849,11 @@
849 # revisions we start from. Sensible as we are looking for
850 # changeset internal dependencies.
851
852 array set dep {}
853
854 foreach {rid child} [state run [subst -nocommands -nobackslashes {
855 -- (1) Primary child
856 SELECT R.rid, R.child
857 FROM revision R
858 WHERE R.rid IN $theset -- Restrict to revisions of interest
859 AND R.child IS NOT NULL -- Has primary child
@@ -873,11 +873,11 @@
873 AND R.isdefault -- Restrict to NTDB
874 AND R.dbchild IS NOT NULL -- and last NTDB belonging to trunk
875 AND RA.rid = R.dbchild -- Go directly to trunk root
876 AND RA.child IS NOT NULL -- Has primary child.
877 AND RA.child IN $theset -- Which is also of interest
878 }]] {
879 # Consider moving this to the integrity module.
880 integrity assert {$rid != $child} {Revision $rid depends on itself.}
881 lappend dependencies($rid) $child
882 set dep($rid,$child) .
883 }
@@ -903,15 +903,15 @@
903 # We allow revisions to be far apart in time in the same
904 # changeset, but in turn need the pseudo-dependencies to
905 # handle this.
906
907 array set fids {}
908 foreach {rid fid} [state run [subst -nocommands -nobackslashes {
909 SELECT R.rid, R.fid
910 FROM revision R
911 WHERE R.rid IN $theset
912 }]] { lappend fids($fid) $rid }
913
914 foreach {fid rids} [array get fids] {
915 if {[llength $rids] < 2} continue
916 foreach a $rids {
917 foreach b $rids {
@@ -993,11 +993,11 @@
993 # '1.2' revision) is a successor, if it exists.
994
995 # Note that the branches spawned from the revisions, and the
996 # tags associated with them are successors as well.
997
998 foreach {rid child} [state run [subst -nocommands -nobackslashes {
999 -- (1) Primary child
1000 SELECT R.rid, R.child
1001 FROM revision R
1002 WHERE R.rid IN $theset -- Restrict to revisions of interest
1003 AND R.child IS NOT NULL -- Has primary child
@@ -1014,29 +1014,29 @@
1014 WHERE R.rid IN $theset -- Restrict to revisions of interest
1015 AND R.isdefault -- Restrict to NTDB
1016 AND R.dbchild IS NOT NULL -- and last NTDB belonging to trunk
1017 AND RA.rid = R.dbchild -- Go directly to trunk root
1018 AND RA.child IS NOT NULL -- Has primary child.
1019 }]] {
1020 # Consider moving this to the integrity module.
1021 integrity assert {$rid != $child} {Revision $rid depends on itself.}
1022 lappend dependencies([list rev $rid]) [list rev $child]
1023 }
1024 foreach {rid child} [state run [subst -nocommands -nobackslashes {
1025 SELECT R.rid, T.tid
1026 FROM revision R, tag T
1027 WHERE R.rid IN $theset
1028 AND T.rev = R.rid
1029 }]] {
1030 lappend dependencies([list rev $rid]) [list sym::tag $child]
1031 }
1032 foreach {rid child} [state run [subst -nocommands -nobackslashes {
1033 SELECT R.rid, B.bid
1034 FROM revision R, branch B
1035 WHERE R.rid IN $theset
1036 AND B.root = R.rid
1037 }]] {
1038 lappend dependencies([list rev $rid]) [list sym::branch $child]
1039 }
1040 return
1041 }
1042
@@ -1047,11 +1047,11 @@
1047 # millions of dependency pairs (in extreme cases (Example: Tcl
1048 # CVS)) we return a very short and much more manageable list
1049 # of changesets.
1050
1051 set theset ('[join $revisions {','}]')
1052 return [state run [subst -nocommands -nobackslashes {
1053 SELECT C.cid
1054 FROM revision R, csitem CI, changeset C
1055 WHERE R.rid IN $theset -- Restrict to revisions of interest
1056 AND R.child IS NOT NULL -- Has primary child
1057 AND CI.iid = R.child
@@ -1090,11 +1090,11 @@
1090 WHERE R.rid in $theset
1091 AND B.root = R.rid
1092 AND CI.iid = B.bid
1093 AND C.cid = CI.cid
1094 AND C.type = 2
1095 }]]
1096 }
1097 }
1098
1099 # # ## ### ##### ######## ############# #####################
1100 ## Helper singleton. Commands for tag symbol changesets.
@@ -1121,16 +1121,16 @@
1121 typemethod timerange {tags} {
1122 # The range is defined as the range of the revisions the tags
1123 # are attached to.
1124
1125 set theset ('[join $tags {','}]')
1126 return [state run [subst -nocommands -nobackslashes {
1127 SELECT MIN(R.date), MAX(R.date)
1128 FROM tag T, revision R
1129 WHERE T.tid IN $theset
1130 AND R.rid = T.rev
1131 }]]
1132 }
1133
1134 # var(dv) = dict (item -> list (item)), item = list (type id)
1135 typemethod successors {dv tags} {
1136 # Tags have no successors.
@@ -1179,16 +1179,16 @@
1179 # spawning them, hence they have no real timerange any
1180 # longer. By using 0 we put them in front of everything else,
1181 # as they logically are.
1182
1183 set theset ('[join $branches {','}]')
1184 return [state run [subst -nocommands -nobackslashes {
1185 SELECT IFNULL(MIN(R.date),0), IFNULL(MAX(R.date),0)
1186 FROM branch B, revision R
1187 WHERE B.bid IN $theset
1188 AND R.rid = B.root
1189 }]]
1190 }
1191
1192 # result = 4-list (itemtype itemid nextitemtype nextitemid ...)
1193 typemethod loops {branches} {
1194 # Note: Revisions and tags cannot cause the loop. Being of a
@@ -1212,34 +1212,34 @@
1212 # The first revision committed on a branch, and all branches
1213 # and tags which have it as their prefered parent are the
1214 # successors of a branch.
1215
1216 set theset ('[join $branches {','}]')
1217 foreach {bid child} [state run [subst -nocommands -nobackslashes {
1218 SELECT B.bid, R.rid
1219 FROM branch B, revision R
1220 WHERE B.bid IN $theset
1221 AND B.first = R.rid
1222 }]] {
1223 lappend dependencies([list sym::branch $bid]) [list rev $child]
1224 }
1225 foreach {bid child} [state run [subst -nocommands -nobackslashes {
1226 SELECT B.bid, BX.bid
1227 FROM branch B, preferedparent P, branch BX
1228 WHERE B.bid IN $theset
1229 AND B.sid = P.pid
1230 AND BX.sid = P.sid
1231 }]] {
1232 lappend dependencies([list sym::branch $bid]) [list sym::branch $child]
1233 }
1234 foreach {bid child} [state run [subst -nocommands -nobackslashes {
1235 SELECT B.bid, T.tid
1236 FROM branch B, preferedparent P, tag T
1237 WHERE B.bid IN $theset
1238 AND B.sid = P.pid
1239 AND T.sid = P.sid
1240 }]] {
1241 lappend dependencies([list sym::branch $bid]) [list sym::tag $child]
1242 }
1243 return
1244 }
1245
@@ -1250,11 +1250,11 @@
1250 # millions of dependency pairs (in extreme cases (Example: Tcl
1251 # CVS)) we return a very short and much more manageable list
1252 # of changesets.
1253
1254 set theset ('[join $branches {','}]')
1255 return [state run [subst -nocommands -nobackslashes {
1256 SELECT C.cid
1257 FROM branch B, revision R, csitem CI, changeset C
1258 WHERE B.bid IN $theset
1259 AND B.first = R.rid
1260 AND CI.iid = R.rid
@@ -1276,11 +1276,11 @@
1276 AND B.sid = P.pid
1277 AND T.sid = P.sid
1278 AND CI.iid = T.tid
1279 AND C.cid = CI.cid
1280 AND C.type = 1
1281 }]]
1282 return
1283 }
1284
1285 typemethod limits {branches} {
1286 # Notes. This method exists only for branches. It is needed to
1287

Keyboard Shortcuts

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