Fossil SCM

Merge in changes from Andreas's branch.

drh 2008-02-08 21:52 trunk merge
Commit 6b78df386170d9bc7b06cf9897c6e7ecaa9e88a8
+1 -1
--- ci_cvs.txt
+++ ci_cvs.txt
@@ -1,10 +1,10 @@
11
===============================================================================
22
33
First experimental codes ...
44
5
-toosl/import-cvs.tcl
5
+tools/import-cvs.tcl
66
tools/lib/rcsparser.tcl
77
88
No actual import, right now only working on getting csets right. The
99
code uses CVSROOT/history as foundation, and augments that with data
1010
from the individual RCS files (commit messages).
1111
1212
ADDED cvs2fossil.txt
--- ci_cvs.txt
+++ ci_cvs.txt
@@ -1,10 +1,10 @@
1 ===============================================================================
2
3 First experimental codes ...
4
5 toosl/import-cvs.tcl
6 tools/lib/rcsparser.tcl
7
8 No actual import, right now only working on getting csets right. The
9 code uses CVSROOT/history as foundation, and augments that with data
10 from the individual RCS files (commit messages).
11
12 DDED cvs2fossil.txt
--- ci_cvs.txt
+++ ci_cvs.txt
@@ -1,10 +1,10 @@
1 ===============================================================================
2
3 First experimental codes ...
4
5 tools/import-cvs.tcl
6 tools/lib/rcsparser.tcl
7
8 No actual import, right now only working on getting csets right. The
9 code uses CVSROOT/history as foundation, and augments that with data
10 from the individual RCS files (commit messages).
11
12 DDED cvs2fossil.txt
--- a/cvs2fossil.txt
+++ b/cvs2fossil.txt
@@ -0,0 +1,3 @@
1
+Multi vendor branch on different symbol - Remember the first
2
+ vendor branch so that we can force others on it.
3
+ ristate -> Allow definition of w)8F@6W,LVsBZ;
--- a/cvs2fossil.txt
+++ b/cvs2fossil.txt
@@ -0,0 +1,3 @@
 
 
 
--- a/cvs2fossil.txt
+++ b/cvs2fossil.txt
@@ -0,0 +1,3 @@
1 Multi vendor branch on different symbol - Remember the first
2 vendor branch so that we can force others on it.
3 ristate -> Allow definition of w)8F@6W,LVsBZ;
--- todo-ak.txt
+++ todo-ak.txt
@@ -10,10 +10,11 @@
1010
fossil.
1111
1212
* Think about exposure of functionality as libraries, i.e. Tcl
1313
packages. Foundations like delta, etc. first, work up to
1414
higher-levels.
15
+ => Mark Janssen has started on this.
1516
1617
* Document the merge algorithm.
1718
1819
* Document the xfer protocol.
1920
2021
--- todo-ak.txt
+++ todo-ak.txt
@@ -10,10 +10,11 @@
10 fossil.
11
12 * Think about exposure of functionality as libraries, i.e. Tcl
13 packages. Foundations like delta, etc. first, work up to
14 higher-levels.
 
15
16 * Document the merge algorithm.
17
18 * Document the xfer protocol.
19
20
--- todo-ak.txt
+++ todo-ak.txt
@@ -10,10 +10,11 @@
10 fossil.
11
12 * Think about exposure of functionality as libraries, i.e. Tcl
13 packages. Foundations like delta, etc. first, work up to
14 higher-levels.
15 => Mark Janssen has started on this.
16
17 * Document the merge algorithm.
18
19 * Document the xfer protocol.
20
21
--- tools/cvs2fossil/lib/c2f_blobstore.tcl
+++ tools/cvs2fossil/lib/c2f_blobstore.tcl
@@ -1,8 +1,8 @@
11
## -*- tcl -*-
22
# # ## ### ##### ######## ############# #####################
3
-## Copyright (c) 2007 Andreas Kupries.
3
+## Copyright (c) 2008 Andreas Kupries.
44
#
55
# This software is licensed as described in the file LICENSE, which
66
# you should have received as part of this distribution.
77
#
88
# This software consists of voluntary contributions made by many
99
--- tools/cvs2fossil/lib/c2f_blobstore.tcl
+++ tools/cvs2fossil/lib/c2f_blobstore.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
--- tools/cvs2fossil/lib/c2f_blobstore.tcl
+++ tools/cvs2fossil/lib/c2f_blobstore.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -1,8 +1,8 @@
11
## -*- tcl -*-
22
# # ## ### ##### ######## ############# #####################
3
-## Copyright (c) 2007 Andreas Kupries.
3
+## Copyright (c) 2007-2008 Andreas Kupries.
44
#
55
# This software is licensed as described in the file LICENSE, which
66
# you should have received as part of this distribution.
77
#
88
# This software consists of voluntary contributions made by many
@@ -275,10 +275,12 @@
275275
276276
# # ## ### ##### ######## #############
277277
## Pass XII (Import).
278278
279279
method pushto {repository} {
280
+ log write 2 file {Importing file "$mypath"}
281
+
280282
set ws [$repository workspace]
281283
struct::list assign [$self Expand $ws] filemap revmap
282284
# filemap = dict (path -> uuid)
283285
# revmap = dict (path -> rid)
284286
285287
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
@@ -275,10 +275,12 @@
275
276 # # ## ### ##### ######## #############
277 ## Pass XII (Import).
278
279 method pushto {repository} {
 
 
280 set ws [$repository workspace]
281 struct::list assign [$self Expand $ws] filemap revmap
282 # filemap = dict (path -> uuid)
283 # revmap = dict (path -> rid)
284
285
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007-2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
@@ -275,10 +275,12 @@
275
276 # # ## ### ##### ######## #############
277 ## Pass XII (Import).
278
279 method pushto {repository} {
280 log write 2 file {Importing file "$mypath"}
281
282 set ws [$repository workspace]
283 struct::list assign [$self Expand $ws] filemap revmap
284 # filemap = dict (path -> uuid)
285 # revmap = dict (path -> rid)
286
287
--- tools/cvs2fossil/lib/c2f_fossil.tcl
+++ tools/cvs2fossil/lib/c2f_fossil.tcl
@@ -1,8 +1,8 @@
11
## -*- tcl -*-
22
# # ## ### ##### ######## ############# #####################
3
-## Copyright (c) 2007 Andreas Kupries.
3
+## Copyright (c) 2007-2008 Andreas Kupries.
44
#
55
# This software is licensed as described in the file LICENSE, which
66
# you should have received as part of this distribution.
77
#
88
# This software consists of voluntary contributions made by many
@@ -106,21 +106,21 @@
106106
107107
set message "By $user:\n$message"
108108
109109
log write 2 fossil {== $user @ [clock format $date]}
110110
log write 2 fossil {-> $parent}
111
- log write 2 fossil {%% [join [split $message \n] "\n%% "]}
111
+ log write 9 fossil {%% [join [split $message \n] "\n%% "]}
112112
113113
lappend cmd Do test-import-manifest $date $message
114114
if {$parent ne ""} { lappend cmd -p $parent }
115115
foreach {frid fpath flabel} $revisions {
116116
lappend cmd -f $frid $fpath
117
- log write 2 fossil {** <[format %5d $frid]> = <$flabel>}
117
+ log write 12 fossil {** <[format %5d $frid]> = <$flabel>}
118118
}
119119
120120
# run fossil test-command performing the import.
121
- log write 8 fossil { [lreplace $cmd 3 3 @@]}
121
+ log write 12 fossil { [lreplace $cmd 3 3 @@]}
122122
123123
$self InWorkspace
124124
set res [eval $cmd]
125125
$self RestorePwd
126126
127127
--- tools/cvs2fossil/lib/c2f_fossil.tcl
+++ tools/cvs2fossil/lib/c2f_fossil.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
@@ -106,21 +106,21 @@
106
107 set message "By $user:\n$message"
108
109 log write 2 fossil {== $user @ [clock format $date]}
110 log write 2 fossil {-> $parent}
111 log write 2 fossil {%% [join [split $message \n] "\n%% "]}
112
113 lappend cmd Do test-import-manifest $date $message
114 if {$parent ne ""} { lappend cmd -p $parent }
115 foreach {frid fpath flabel} $revisions {
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
--- tools/cvs2fossil/lib/c2f_fossil.tcl
+++ tools/cvs2fossil/lib/c2f_fossil.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007-2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
@@ -106,21 +106,21 @@
106
107 set message "By $user:\n$message"
108
109 log write 2 fossil {== $user @ [clock format $date]}
110 log write 2 fossil {-> $parent}
111 log write 9 fossil {%% [join [split $message \n] "\n%% "]}
112
113 lappend cmd Do test-import-manifest $date $message
114 if {$parent ne ""} { lappend cmd -p $parent }
115 foreach {frid fpath flabel} $revisions {
116 lappend cmd -f $frid $fpath
117 log write 12 fossil {** <[format %5d $frid]> = <$flabel>}
118 }
119
120 # run fossil test-command performing the import.
121 log write 12 fossil { [lreplace $cmd 3 3 @@]}
122
123 $self InWorkspace
124 set res [eval $cmd]
125 $self RestorePwd
126
127
--- tools/cvs2fossil/lib/c2f_frev.tcl
+++ tools/cvs2fossil/lib/c2f_frev.tcl
@@ -1,8 +1,8 @@
11
## -*- tcl -*-
22
# # ## ### ##### ######## ############# #####################
3
-## Copyright (c) 2007 Andreas Kupries.
3
+## Copyright (c) 2007-2008 Andreas Kupries.
44
#
55
# This software is licensed as described in the file LICENSE, which
66
# you should have received as part of this distribution.
77
#
88
# This software consists of voluntary contributions made by many
99
--- tools/cvs2fossil/lib/c2f_frev.tcl
+++ tools/cvs2fossil/lib/c2f_frev.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
--- tools/cvs2fossil/lib/c2f_frev.tcl
+++ tools/cvs2fossil/lib/c2f_frev.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007-2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
--- tools/cvs2fossil/lib/c2f_fsym.tcl
+++ tools/cvs2fossil/lib/c2f_fsym.tcl
@@ -1,8 +1,8 @@
11
## -*- tcl -*-
22
# # ## ### ##### ######## ############# #####################
3
-## Copyright (c) 2007 Andreas Kupries.
3
+## Copyright (c) 2007-2008 Andreas Kupries.
44
#
55
# This software is licensed as described in the file LICENSE, which
66
# you should have received as part of this distribution.
77
#
88
# This software consists of voluntary contributions made by many
99
--- tools/cvs2fossil/lib/c2f_fsym.tcl
+++ tools/cvs2fossil/lib/c2f_fsym.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
--- tools/cvs2fossil/lib/c2f_fsym.tcl
+++ tools/cvs2fossil/lib/c2f_fsym.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007-2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
--- tools/cvs2fossil/lib/c2f_integrity.tcl
+++ tools/cvs2fossil/lib/c2f_integrity.tcl
@@ -1,8 +1,8 @@
11
## -*- tcl -*-
22
# # ## ### ##### ######## ############# #####################
3
-## Copyright (c) 2007 Andreas Kupries.
3
+## Copyright (c) 2007-2008 Andreas Kupries.
44
#
55
# This software is licensed as described in the file LICENSE, which
66
# you should have received as part of this distribution.
77
#
88
# This software consists of voluntary contributions made by many
99
--- tools/cvs2fossil/lib/c2f_integrity.tcl
+++ tools/cvs2fossil/lib/c2f_integrity.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
--- tools/cvs2fossil/lib/c2f_integrity.tcl
+++ tools/cvs2fossil/lib/c2f_integrity.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007-2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
--- 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_pcollar.tcl
+++ tools/cvs2fossil/lib/c2f_pcollar.tcl
@@ -1,8 +1,8 @@
11
## -*- tcl -*-
22
# # ## ### ##### ######## ############# #####################
3
-## Copyright (c) 2007 Andreas Kupries.
3
+## Copyright (c) 2007-2008 Andreas Kupries.
44
#
55
# This software is licensed as described in the file LICENSE, which
66
# you should have received as part of this distribution.
77
#
88
# This software consists of voluntary contributions made by many
99
--- tools/cvs2fossil/lib/c2f_pcollar.tcl
+++ tools/cvs2fossil/lib/c2f_pcollar.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
--- tools/cvs2fossil/lib/c2f_pcollar.tcl
+++ tools/cvs2fossil/lib/c2f_pcollar.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007-2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
--- tools/cvs2fossil/lib/c2f_pcollrev.tcl
+++ tools/cvs2fossil/lib/c2f_pcollrev.tcl
@@ -1,8 +1,8 @@
11
## -*- tcl -*-
22
# # ## ### ##### ######## ############# #####################
3
-## Copyright (c) 2007 Andreas Kupries.
3
+## Copyright (c) 2007-2008 Andreas Kupries.
44
#
55
# This software is licensed as described in the file LICENSE, which
66
# you should have received as part of this distribution.
77
#
88
# This software consists of voluntary contributions made by many
99
--- tools/cvs2fossil/lib/c2f_pcollrev.tcl
+++ tools/cvs2fossil/lib/c2f_pcollrev.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
--- tools/cvs2fossil/lib/c2f_pcollrev.tcl
+++ tools/cvs2fossil/lib/c2f_pcollrev.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007-2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
--- tools/cvs2fossil/lib/c2f_pfiltersym.tcl
+++ tools/cvs2fossil/lib/c2f_pfiltersym.tcl
@@ -1,8 +1,8 @@
11
## -*- tcl -*-
22
# # ## ### ##### ######## ############# #####################
3
-## Copyright (c) 2007 Andreas Kupries.
3
+## Copyright (c) 2007-2008 Andreas Kupries.
44
#
55
# This software is licensed as described in the file LICENSE, which
66
# you should have received as part of this distribution.
77
#
88
# This software consists of voluntary contributions made by many
@@ -87,10 +87,11 @@
8787
FilterExcludedSymbols
8888
MutateSymbols
8989
AdjustParents
9090
RefineSymbols
9191
92
+ PrintSymbolTree
9293
repository printrevstatistics
9394
9495
# Strict integrity enforces that all meta entries are in
9596
# the same LOD as the revision using them. At this point
9697
# this may not be true any longer. If a NTDB was excluded
@@ -99,11 +100,11 @@
99100
# refer to the now gone LOD symbol. This is fine however,
100101
# it will not affect our ability to use the meta entries
101102
# to distinguish and group revisions into changesets. It
102103
# should be noted that we cannot simply switch the meta
103104
# entries over to the trunk either, as that may cause the
104
- # modified entries to violate the unique-ness constrain
105
+ # modified entries to violate the unique-ness constraint
105106
# set on that table.
106107
integrity metarelaxed
107108
}
108109
109110
log write 1 filtersym "Filtering completed"
@@ -511,10 +512,56 @@
511512
SELECT B.bid, 1
512513
FROM branch B, revision R
513514
WHERE B.root = R.rid
514515
AND R.op = 0 -- nothing
515516
}
517
+ return
518
+ }
519
+
520
+ proc maxlen {v str} {
521
+ upvar 1 $v n
522
+ set l [string length $str]
523
+ if {$l <= $n} return
524
+ set n $l
525
+ return
526
+ }
527
+
528
+ proc PrintSymbolTree {} {
529
+ if {![log visible? 9]} return
530
+
531
+ array set sym {}
532
+ set n 0
533
+ set t 0
534
+ set c 0
535
+
536
+ foreach {s stype cc p ptype} [state run {
537
+ SELECT S.name, A.name, S.commit_count, P.name, B.name
538
+ FROM tag T, symbol S, symbol P, symtype A, symtype B
539
+ WHERE S.sid = T.sid
540
+ AND P.sid = T.lod
541
+ AND A.tid = S.type
542
+ AND B.tid = P.type
543
+ UNION
544
+ SELECT S.name, A.name, S.commit_count, P.name, B.name
545
+ FROM branch B, symbol S, symbol P, symtype A, symtype B
546
+ WHERE S.sid = B.sid
547
+ AND P.sid = B.lod
548
+ AND A.tid = S.type
549
+ AND B.tid = P.type
550
+ }] {
551
+ lappend sym($s) $p $stype $ptype $cc
552
+ maxlen n $s
553
+ maxlen t $stype
554
+ maxlen t $ptype
555
+ maxlen c $cc
556
+ }
557
+
558
+ foreach s [lsort -dict [array names sym]] {
559
+ struct::list assign $sym($s) p stype ptype cc
560
+
561
+ log write 9 filtersym {Tree: [format %-${t}s $stype] ([format %-${c}d $cc]) [format %-${n}s $s] <-- [format %-${t}s $ptype] $p}
562
+ }
516563
return
517564
}
518565
519566
# # ## ### ##### ######## #############
520567
## Configuration
521568
--- tools/cvs2fossil/lib/c2f_pfiltersym.tcl
+++ tools/cvs2fossil/lib/c2f_pfiltersym.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
@@ -87,10 +87,11 @@
87 FilterExcludedSymbols
88 MutateSymbols
89 AdjustParents
90 RefineSymbols
91
 
92 repository printrevstatistics
93
94 # Strict integrity enforces that all meta entries are in
95 # the same LOD as the revision using them. At this point
96 # this may not be true any longer. If a NTDB was excluded
@@ -99,11 +100,11 @@
99 # refer to the now gone LOD symbol. This is fine however,
100 # it will not affect our ability to use the meta entries
101 # to distinguish and group revisions into changesets. It
102 # should be noted that we cannot simply switch the meta
103 # entries over to the trunk either, as that may cause the
104 # modified entries to violate the unique-ness constrain
105 # set on that table.
106 integrity metarelaxed
107 }
108
109 log write 1 filtersym "Filtering completed"
@@ -511,10 +512,56 @@
511 SELECT B.bid, 1
512 FROM branch B, revision R
513 WHERE B.root = R.rid
514 AND R.op = 0 -- nothing
515 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
516 return
517 }
518
519 # # ## ### ##### ######## #############
520 ## Configuration
521
--- tools/cvs2fossil/lib/c2f_pfiltersym.tcl
+++ tools/cvs2fossil/lib/c2f_pfiltersym.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007-2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
@@ -87,10 +87,11 @@
87 FilterExcludedSymbols
88 MutateSymbols
89 AdjustParents
90 RefineSymbols
91
92 PrintSymbolTree
93 repository printrevstatistics
94
95 # Strict integrity enforces that all meta entries are in
96 # the same LOD as the revision using them. At this point
97 # this may not be true any longer. If a NTDB was excluded
@@ -99,11 +100,11 @@
100 # refer to the now gone LOD symbol. This is fine however,
101 # it will not affect our ability to use the meta entries
102 # to distinguish and group revisions into changesets. It
103 # should be noted that we cannot simply switch the meta
104 # entries over to the trunk either, as that may cause the
105 # modified entries to violate the unique-ness constraint
106 # set on that table.
107 integrity metarelaxed
108 }
109
110 log write 1 filtersym "Filtering completed"
@@ -511,10 +512,56 @@
512 SELECT B.bid, 1
513 FROM branch B, revision R
514 WHERE B.root = R.rid
515 AND R.op = 0 -- nothing
516 }
517 return
518 }
519
520 proc maxlen {v str} {
521 upvar 1 $v n
522 set l [string length $str]
523 if {$l <= $n} return
524 set n $l
525 return
526 }
527
528 proc PrintSymbolTree {} {
529 if {![log visible? 9]} return
530
531 array set sym {}
532 set n 0
533 set t 0
534 set c 0
535
536 foreach {s stype cc p ptype} [state run {
537 SELECT S.name, A.name, S.commit_count, P.name, B.name
538 FROM tag T, symbol S, symbol P, symtype A, symtype B
539 WHERE S.sid = T.sid
540 AND P.sid = T.lod
541 AND A.tid = S.type
542 AND B.tid = P.type
543 UNION
544 SELECT S.name, A.name, S.commit_count, P.name, B.name
545 FROM branch B, symbol S, symbol P, symtype A, symtype B
546 WHERE S.sid = B.sid
547 AND P.sid = B.lod
548 AND A.tid = S.type
549 AND B.tid = P.type
550 }] {
551 lappend sym($s) $p $stype $ptype $cc
552 maxlen n $s
553 maxlen t $stype
554 maxlen t $ptype
555 maxlen c $cc
556 }
557
558 foreach s [lsort -dict [array names sym]] {
559 struct::list assign $sym($s) p stype ptype cc
560
561 log write 9 filtersym {Tree: [format %-${t}s $stype] ([format %-${c}d $cc]) [format %-${n}s $s] <-- [format %-${t}s $ptype] $p}
562 }
563 return
564 }
565
566 # # ## ### ##### ######## #############
567 ## Configuration
568
--- tools/cvs2fossil/lib/c2f_pimport.tcl
+++ tools/cvs2fossil/lib/c2f_pimport.tcl
@@ -1,8 +1,8 @@
11
## -*- tcl -*-
22
# # ## ### ##### ######## ############# #####################
3
-## Copyright (c) 2007 Andreas Kupries.
3
+## Copyright (c) 2007-2008 Andreas Kupries.
44
#
55
# This software is licensed as described in the file LICENSE, which
66
# you should have received as part of this distribution.
77
#
88
# This software consists of voluntary contributions made by many
@@ -22,10 +22,11 @@
2222
package require snit ; # OO system.
2323
package require vc::tools::log ; # User feedback.
2424
package require vc::fossil::import::cvs::repository ; # Repository management.
2525
package require vc::fossil::import::cvs::state ; # State storage.
2626
package require vc::fossil::import::cvs::fossil ; # Access to fossil repositories.
27
+package require vc::fossil::import::cvs::ristate ; # Import state (revisions)
2728
2829
# # ## ### ##### ######## ############# #####################
2930
## Register the pass with the management
3031
3132
vc::fossil::import::cvs::pass define \
@@ -84,26 +85,24 @@
8485
8586
foreach project [repository projects] {
8687
log write 1 import {Importing project "[$project base]"}
8788
8889
set fossil [fossil %AUTO%]
90
+ set rstate [ristate %AUTO%]
8991
9092
state transaction {
9193
# Layer I: Files and their revisions
9294
foreach file [$project files] {
93
- set path [$file path]
94
- log write 2 import {Importing file "$path"}
9595
$file pushto $fossil
9696
}
9797
# Layer II: Changesets
98
- array set rstate {}
9998
foreach {revision date} [$project revisionsinorder] {
100
- log write 2 import {Importing revision [$revision str]}
101
- $revision pushto rstate $fossil $date
99
+ $revision pushto $fossil $date $rstate
102100
}
103
- unset rstate
104101
}
102
+
103
+ $rstate destroy
105104
106105
# At last copy the temporary repository file to its final
107106
# destination and release the associated memory.
108107
109108
$fossil finalize [$project base].fsl
@@ -140,10 +139,11 @@
140139
namespace export import
141140
namespace eval import {
142141
namespace import ::vc::fossil::import::cvs::repository
143142
namespace import ::vc::fossil::import::cvs::state
144143
namespace import ::vc::fossil::import::cvs::fossil
144
+ namespace import ::vc::fossil::import::cvs::ristate
145145
namespace import ::vc::tools::log
146146
log register import
147147
}
148148
}
149149
150150
--- tools/cvs2fossil/lib/c2f_pimport.tcl
+++ tools/cvs2fossil/lib/c2f_pimport.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
@@ -22,10 +22,11 @@
22 package require snit ; # OO system.
23 package require vc::tools::log ; # User feedback.
24 package require vc::fossil::import::cvs::repository ; # Repository management.
25 package require vc::fossil::import::cvs::state ; # State storage.
26 package require vc::fossil::import::cvs::fossil ; # Access to fossil repositories.
 
27
28 # # ## ### ##### ######## ############# #####################
29 ## Register the pass with the management
30
31 vc::fossil::import::cvs::pass define \
@@ -84,26 +85,24 @@
84
85 foreach project [repository projects] {
86 log write 1 import {Importing project "[$project base]"}
87
88 set fossil [fossil %AUTO%]
 
89
90 state transaction {
91 # Layer I: Files and their revisions
92 foreach file [$project files] {
93 set path [$file path]
94 log write 2 import {Importing file "$path"}
95 $file pushto $fossil
96 }
97 # Layer II: Changesets
98 array set rstate {}
99 foreach {revision date} [$project revisionsinorder] {
100 log write 2 import {Importing revision [$revision str]}
101 $revision pushto rstate $fossil $date
102 }
103 unset rstate
104 }
 
 
105
106 # At last copy the temporary repository file to its final
107 # destination and release the associated memory.
108
109 $fossil finalize [$project base].fsl
@@ -140,10 +139,11 @@
140 namespace export import
141 namespace eval import {
142 namespace import ::vc::fossil::import::cvs::repository
143 namespace import ::vc::fossil::import::cvs::state
144 namespace import ::vc::fossil::import::cvs::fossil
 
145 namespace import ::vc::tools::log
146 log register import
147 }
148 }
149
150
--- tools/cvs2fossil/lib/c2f_pimport.tcl
+++ tools/cvs2fossil/lib/c2f_pimport.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007-2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
@@ -22,10 +22,11 @@
22 package require snit ; # OO system.
23 package require vc::tools::log ; # User feedback.
24 package require vc::fossil::import::cvs::repository ; # Repository management.
25 package require vc::fossil::import::cvs::state ; # State storage.
26 package require vc::fossil::import::cvs::fossil ; # Access to fossil repositories.
27 package require vc::fossil::import::cvs::ristate ; # Import state (revisions)
28
29 # # ## ### ##### ######## ############# #####################
30 ## Register the pass with the management
31
32 vc::fossil::import::cvs::pass define \
@@ -84,26 +85,24 @@
85
86 foreach project [repository projects] {
87 log write 1 import {Importing project "[$project base]"}
88
89 set fossil [fossil %AUTO%]
90 set rstate [ristate %AUTO%]
91
92 state transaction {
93 # Layer I: Files and their revisions
94 foreach file [$project files] {
 
 
95 $file pushto $fossil
96 }
97 # Layer II: Changesets
 
98 foreach {revision date} [$project revisionsinorder] {
99 $revision pushto $fossil $date $rstate
 
100 }
 
101 }
102
103 $rstate destroy
104
105 # At last copy the temporary repository file to its final
106 # destination and release the associated memory.
107
108 $fossil finalize [$project base].fsl
@@ -140,10 +139,11 @@
139 namespace export import
140 namespace eval import {
141 namespace import ::vc::fossil::import::cvs::repository
142 namespace import ::vc::fossil::import::cvs::state
143 namespace import ::vc::fossil::import::cvs::fossil
144 namespace import ::vc::fossil::import::cvs::ristate
145 namespace import ::vc::tools::log
146 log register import
147 }
148 }
149
150
--- tools/cvs2fossil/lib/c2f_pinitcsets.tcl
+++ tools/cvs2fossil/lib/c2f_pinitcsets.tcl
@@ -1,8 +1,8 @@
11
## -*- tcl -*-
22
# # ## ### ##### ######## ############# #####################
3
-## Copyright (c) 2007 Andreas Kupries.
3
+## Copyright (c) 2007-2008 Andreas Kupries.
44
#
55
# This software is licensed as described in the file LICENSE, which
66
# you should have received as part of this distribution.
77
#
88
# This software consists of voluntary contributions made by many
99
--- tools/cvs2fossil/lib/c2f_pinitcsets.tcl
+++ tools/cvs2fossil/lib/c2f_pinitcsets.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
--- tools/cvs2fossil/lib/c2f_pinitcsets.tcl
+++ tools/cvs2fossil/lib/c2f_pinitcsets.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007-2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -1,8 +1,8 @@
11
## -*- tcl -*-
22
# # ## ### ##### ######## ############# #####################
3
-## Copyright (c) 2007 Andreas Kupries.
3
+## Copyright (c) 2007-2008 Andreas Kupries.
44
#
55
# This software is licensed as described in the file LICENSE, which
66
# you should have received as part of this distribution.
77
#
88
# This software consists of voluntary contributions made by many
@@ -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
@@ -389,13 +393,11 @@
389393
if {!$kill} return
390394
trouble internal "[$self str] depends on itself"
391395
return
392396
}
393397
394
- method pushto {sv repository date} {
395
- upvar 1 $sv state
396
-
398
+ method pushto {repository date rstate} {
397399
# Generate and import the manifest for this changeset.
398400
#
399401
# Data needed:
400402
# - Commit message (-- mysrcid -> repository meta)
401403
# - User doing the commit (s.a.)
@@ -405,22 +407,53 @@
405407
# - The parent changeset, if any. If there is no parent fossil
406408
# will use the empty base revision as parent.
407409
#
408410
# - List of the file revisions in the changeset.
409411
410
- struct::list assign [$myproject getmeta $mysrcid] __ branch user message
411
- 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]
419
+
420
+ 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
415424
# uuids and printable data.
416425
417
- set uuid [Updatestate state $lodname \
418
- [$repository importrevision [$self str] \
419
- $user $message $date \
420
- [Getparent state $lodname $myproject $myitems] \
421
- [Getrevisioninfo $myitems]]]
426
+ struct::list assign [Getisdefault $myitems] isdefault lastdefaultontrunk
427
+
428
+ log write 8 csets {LOD '$lodname'}
429
+ log write 8 csets { def? $isdefault}
430
+ log write 8 csets { last? $lastdefaultontrunk}
431
+
432
+ set lws [Getworkspace $rstate $lodname $myproject $isdefault]
433
+ $lws add [Getrevisioninfo $myitems]
434
+
435
+ set uuid [$repository importrevision [$self str] \
436
+ $user $message $date \
437
+ [$lws getid] [$lws get]]
438
+
439
+ # Remember the imported changeset in the state, under our
440
+ # LOD. And if it is the last trunk changeset on the vendor
441
+ # branch then the revision is also the actual root of the
442
+ # :trunk:, so we remember it as such in the state. However if
443
+ # the trunk already exists then the changeset cannot be on it
444
+ # any more. This indicates weirdness in the setup of the
445
+ # vendor branch, but one we can work around.
446
+
447
+ $lws defid $uuid
448
+ if {$lastdefaultontrunk} {
449
+ if {[$rstate has :trunk:]} {
450
+ log write 2 csets {Multiple changesets declared to be the last trunk changeset on the vendor-branch}
451
+ } else {
452
+ $rstate new :trunk: [$lws name]
453
+ }
454
+ }
422455
423456
# Remember the whole changeset / uuid mapping, for the tags.
424457
425458
state run {
426459
INSERT INTO csuuid (cid, uuid)
@@ -430,92 +463,70 @@
430463
}
431464
432465
proc Getrevisioninfo {revisions} {
433466
set theset ('[join $revisions {','}]')
434467
set revisions {}
435
- foreach {frid path fname revnr} [state run [subst -nocommands -nobackslashes {
436
- SELECT U.uuid, F.visible, F.name, R.rev
468
+ foreach {frid path fname revnr rop} [state run [subst -nocommands -nobackslashes {
469
+ SELECT U.uuid, F.visible, F.name, R.rev, R.op
437470
FROM revision R, revuuid U, file F
438471
WHERE R.rid IN $theset -- All specified revisions
439472
AND U.rid = R.rid -- get fossil uuid of revision
440473
AND F.fid = R.fid -- get file of revision
441474
}]] {
442
- lappend revisions $frid $path $fname/$revnr
475
+ lappend revisions $frid $path $fname/$revnr $rop
443476
}
444477
return $revisions
445478
}
446479
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 (**)).
464
-
465
- if {$lastdefaultontrunk} {
466
- set state(:vendor:last:) .
467
- }
468
-
469
- # The state array holds for each line-of-development (LOD) the
470
- # last committed changeset belonging to that LOD.
480
+ proc Getworkspace {rstate lodname project isdefault} {
481
+
482
+ # The state object holds the workspace state of each known
483
+ # line-of-development (LOD), up to the last committed
484
+ # changeset belonging to that LOD.
471485
472486
# (*) Standard handling if in-LOD changesets. If the LOD of
473487
# the current changeset exists in the state (= has been
474
- # committed to) then the stored changeset is the parent we
475
- # are looking for.
488
+ # committed to) then this it has the workspace we are
489
+ # looking for.
476490
477
- if {[info exists state($lodname)]} {
478
- return $state($lodname)
491
+ if {[$rstate has $lodname]} {
492
+ return [$rstate get $lodname]
479493
}
480494
481
- # If the LOD is not yet known the current changeset can either
482
- # be
483
- # (a) the root of a vendor branch,
484
- # (b) the root of the trunk LOD, or
495
+ # If the LOD is however not yet known, then the current
496
+ # changeset can be either of
497
+ # (a) root of a vendor branch,
498
+ # (b) root of the trunk LOD, or
485499
# (c) the first changeset in a new LOD which was spawned from
486500
# an existing LOD.
487501
488
- if {$isdefault} {
489
- # In case of (a) the changeset has no parent, signaled by
490
- # the empty string. We do remember if the changeset is
491
- # last on the vendor branch still belonging to trunk, for
492
- # the trunk root.
493
- return {}
494
- }
495
-
496
- if {$lodname eq ":trunk:"} {
497
- # This is case (b), and we also can be sure that there is
498
- # no vendor branch changeset which could be our
499
- # parent. That was already dealt with through the
500
- # :vendor:last: signal and code in the caller (setting
501
- # such a changeset up as parent in the state, causing the
502
- # standard LOD handler at (*) to kick in. So, no parent
503
- # here at all.
504
- return {}
505
- }
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.
502
+ if {$isdefault || ($lodname eq ":trunk:")} {
503
+ # For both (a) and (b) we have to create a new workspace
504
+ # for the lod, and it doesn't inherit from anything.
505
+
506
+ # Note that case (b) may never occur. See the variable
507
+ # 'lastdefaultontrunk' in the caller (method pushto). This
508
+ # flag can the generation of the workspace for the :trunk:
509
+ # LOD as well, making it inherit the state of the last
510
+ # trunk-changeset on the vendor-branch.
511
+
512
+ return [$rstate new $lodname]
513
+ }
514
+
515
+ # Case (c). We find the parent LOD of our LOD and let the new
516
+ # workspace inherit from the parent's workspace.
510517
511518
set plodname [[[$project getsymbol $lodname] parent] name]
512519
513520
log write 8 csets {pLOD '$plodname'}
514521
515
- if {[info exists state($plodname)]} {
516
- return $state($plodname)
522
+ if {[$rstate has $plodname]} {
523
+ return [$rstate new $lodname $plodname]
524
+ }
525
+
526
+ foreach k [lsort [$rstate names]] {
527
+ log write 8 csets { $k = [[$rstate get $k] getid]}
517528
}
518529
519530
trouble internal {Unable to determine changeset parent}
520531
return
521532
}
@@ -534,27 +545,10 @@
534545
# ambigous.
535546
536547
return [list $def [expr {$last ne ""}]]
537548
}
538549
539
- proc Updatestate {sv lodname uuid} {
540
- upvar 1 $sv state
541
-
542
- # Remember the imported changeset in the state, under our
543
- # LOD. (**) And if the :vendor:last: signal is present then
544
- # the revision is also the actual root of the :trunk:, so
545
- # remember it as such.
546
-
547
- set state($lodname) $uuid
548
- if {[info exists state(:vendor:last:)]} {
549
- unset state(:vendor:last:)
550
- set state(:trunk:) $uuid
551
- }
552
-
553
- return $uuid
554
- }
555
-
556550
typemethod split {cset args} {
557551
# As part of the creation of the new changesets specified in
558552
# ARGS as sets of items, all subsets of CSET's item set, CSET
559553
# will be dropped from all databases, in and out of memory,
560554
# and then destroyed.
@@ -975,12 +969,18 @@
975969
976970
# # ## ### ##### ######## #############
977971
978972
typevariable mychangesets {} ; # List of all known
979973
# changesets.
980
- typevariable mytchangesets -array {} ; # List of all known
981
- # changesets of a type.
974
+
975
+ # List of all known changesets of a type.
976
+ typevariable mytchangesets -array {
977
+ sym::branch {}
978
+ sym::tag {}
979
+ rev {}
980
+ }
981
+
982982
typevariable myitemmap -array {} ; # Map from items (tagged)
983983
# to the list of changesets
984984
# containing it. Each item
985985
# can be used by only one
986986
# changeset.
@@ -1298,10 +1298,25 @@
12981298
AND CI.iid = B.bid -- Select all changesets
12991299
AND C.cid = CI.cid -- containing the branches
13001300
AND C.type = 2 -- which are branch changesets
13011301
}]]
13021302
}
1303
+
1304
+ # result = symbol name
1305
+ typemethod cs_lod {revisions} {
1306
+ # Determines the name of the symbol which is the line of
1307
+ # development for the revisions in a changeset.
1308
+
1309
+ set theset ('[join $revisions {','}]')
1310
+ return [state run [subst -nocommands -nobackslashes {
1311
+ SELECT
1312
+ DISTINCT L.name
1313
+ FROM revision R, symbol L
1314
+ WHERE R.rid in $theset -- Restrict to revisions of interest
1315
+ AND L.sid = R.lod -- Get lod symbol of revision
1316
+ }]]
1317
+ }
13031318
}
13041319
13051320
# # ## ### ##### ######## ############# #####################
13061321
## Helper singleton. Commands for tag symbol changesets.
13071322
@@ -1352,10 +1367,25 @@
13521367
# result = list (changeset-id)
13531368
typemethod cs_successors {tags} {
13541369
# Tags have no successors.
13551370
return
13561371
}
1372
+
1373
+ # result = symbol name
1374
+ typemethod cs_lod {tags} {
1375
+ # Determines the name of the symbol which is the line of
1376
+ # development for the tags in a changeset.
1377
+
1378
+ set theset ('[join $tags {','}]')
1379
+ return [state run [subst -nocommands -nobackslashes {
1380
+ SELECT
1381
+ DISTINCT L.name
1382
+ FROM tag T, symbol L
1383
+ WHERE T.tid in $theset -- Restrict to tags of interest
1384
+ AND L.sid = T.lod -- Get lod symbol of tag
1385
+ }]]
1386
+ }
13571387
}
13581388
13591389
# # ## ### ##### ######## ############# #####################
13601390
## Helper singleton. Commands for branch symbol changesets.
13611391
@@ -1485,10 +1515,25 @@
14851515
AND C.cid = CI.cid -- containing the subordinate tags
14861516
AND C.type = 1 -- which are tag changesets
14871517
}]]
14881518
return
14891519
}
1520
+
1521
+ # result = symbol name
1522
+ typemethod cs_lod {branches} {
1523
+ # Determines the name of the symbol which is the line of
1524
+ # development for the branches in a changeset.
1525
+
1526
+ set theset ('[join $branches {','}]')
1527
+ return [state run [subst -nocommands -nobackslashes {
1528
+ SELECT
1529
+ DISTINCT L.name
1530
+ FROM branch B, symbol L
1531
+ WHERE B.bid in $theset -- Restrict to branches of interest
1532
+ AND L.sid = B.lod -- Get lod symbol of branch
1533
+ }]]
1534
+ }
14901535
14911536
typemethod limits {branches} {
14921537
# Notes. This method exists only for branches. It is needed to
14931538
# get detailed information about a backward branch. It does
14941539
# not apply to tags, nor revisions. The queries can also
14951540
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
@@ -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
@@ -389,13 +393,11 @@
389 if {!$kill} return
390 trouble internal "[$self str] depends on itself"
391 return
392 }
393
394 method pushto {sv repository date} {
395 upvar 1 $sv state
396
397 # Generate and import the manifest for this changeset.
398 #
399 # Data needed:
400 # - Commit message (-- mysrcid -> repository meta)
401 # - User doing the commit (s.a.)
@@ -405,22 +407,53 @@
405 # - The parent changeset, if any. If there is no parent fossil
406 # will use the empty base revision as parent.
407 #
408 # - List of the file revisions in the changeset.
409
410 struct::list assign [$myproject getmeta $mysrcid] __ branch user message
411 struct::list assign $branch __ 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
415 # uuids and printable data.
416
417 set uuid [Updatestate state $lodname \
418 [$repository importrevision [$self str] \
419 $user $message $date \
420 [Getparent state $lodname $myproject $myitems] \
421 [Getrevisioninfo $myitems]]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
422
423 # Remember the whole changeset / uuid mapping, for the tags.
424
425 state run {
426 INSERT INTO csuuid (cid, uuid)
@@ -430,92 +463,70 @@
430 }
431
432 proc Getrevisioninfo {revisions} {
433 set theset ('[join $revisions {','}]')
434 set revisions {}
435 foreach {frid path fname revnr} [state run [subst -nocommands -nobackslashes {
436 SELECT U.uuid, F.visible, F.name, R.rev
437 FROM revision R, revuuid U, file F
438 WHERE R.rid IN $theset -- All specified revisions
439 AND U.rid = R.rid -- get fossil uuid of revision
440 AND F.fid = R.fid -- get file of revision
441 }]] {
442 lappend revisions $frid $path $fname/$revnr
443 }
444 return $revisions
445 }
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 (**)).
464
465 if {$lastdefaultontrunk} {
466 set state(:vendor:last:) .
467 }
468
469 # The state array holds for each line-of-development (LOD) the
470 # last committed changeset belonging to that LOD.
471
472 # (*) Standard handling if in-LOD changesets. If the LOD of
473 # the current changeset exists in the state (= has been
474 # committed to) then the stored changeset is the parent we
475 # are looking for.
476
477 if {[info exists state($lodname)]} {
478 return $state($lodname)
479 }
480
481 # If the LOD is not yet known the current changeset can either
482 # be
483 # (a) the root of a vendor branch,
484 # (b) the root of the trunk LOD, or
485 # (c) the first changeset in a new LOD which was spawned from
486 # an existing LOD.
487
488 if {$isdefault} {
489 # In case of (a) the changeset has no parent, signaled by
490 # the empty string. We do remember if the changeset is
491 # last on the vendor branch still belonging to trunk, for
492 # the trunk root.
493 return {}
494 }
495
496 if {$lodname eq ":trunk:"} {
497 # This is case (b), and we also can be sure that there is
498 # no vendor branch changeset which could be our
499 # parent. That was already dealt with through the
500 # :vendor:last: signal and code in the caller (setting
501 # such a changeset up as parent in the state, causing the
502 # standard LOD handler at (*) to kick in. So, no parent
503 # here at all.
504 return {}
505 }
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 }
@@ -534,27 +545,10 @@
534 # ambigous.
535
536 return [list $def [expr {$last ne ""}]]
537 }
538
539 proc Updatestate {sv lodname uuid} {
540 upvar 1 $sv state
541
542 # Remember the imported changeset in the state, under our
543 # LOD. (**) And if the :vendor:last: signal is present then
544 # the revision is also the actual root of the :trunk:, so
545 # remember it as such.
546
547 set state($lodname) $uuid
548 if {[info exists state(:vendor:last:)]} {
549 unset state(:vendor:last:)
550 set state(:trunk:) $uuid
551 }
552
553 return $uuid
554 }
555
556 typemethod split {cset args} {
557 # As part of the creation of the new changesets specified in
558 # ARGS as sets of items, all subsets of CSET's item set, CSET
559 # will be dropped from all databases, in and out of memory,
560 # and then destroyed.
@@ -975,12 +969,18 @@
975
976 # # ## ### ##### ######## #############
977
978 typevariable mychangesets {} ; # List of all known
979 # changesets.
980 typevariable mytchangesets -array {} ; # List of all known
981 # changesets of a type.
 
 
 
 
 
 
982 typevariable myitemmap -array {} ; # Map from items (tagged)
983 # to the list of changesets
984 # containing it. Each item
985 # can be used by only one
986 # changeset.
@@ -1298,10 +1298,25 @@
1298 AND CI.iid = B.bid -- Select all changesets
1299 AND C.cid = CI.cid -- containing the branches
1300 AND C.type = 2 -- which are branch changesets
1301 }]]
1302 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1303 }
1304
1305 # # ## ### ##### ######## ############# #####################
1306 ## Helper singleton. Commands for tag symbol changesets.
1307
@@ -1352,10 +1367,25 @@
1352 # result = list (changeset-id)
1353 typemethod cs_successors {tags} {
1354 # Tags have no successors.
1355 return
1356 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1357 }
1358
1359 # # ## ### ##### ######## ############# #####################
1360 ## Helper singleton. Commands for branch symbol changesets.
1361
@@ -1485,10 +1515,25 @@
1485 AND C.cid = CI.cid -- containing the subordinate tags
1486 AND C.type = 1 -- which are tag changesets
1487 }]]
1488 return
1489 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1490
1491 typemethod limits {branches} {
1492 # Notes. This method exists only for branches. It is needed to
1493 # get detailed information about a backward branch. It does
1494 # not apply to tags, nor revisions. The queries can also
1495
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007-2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
@@ -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
@@ -389,13 +393,11 @@
393 if {!$kill} return
394 trouble internal "[$self str] depends on itself"
395 return
396 }
397
398 method pushto {repository date rstate} {
 
 
399 # Generate and import the manifest for this changeset.
400 #
401 # Data needed:
402 # - Commit message (-- mysrcid -> repository meta)
403 # - User doing the commit (s.a.)
@@ -405,22 +407,53 @@
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
424 # uuids and printable data.
425
426 struct::list assign [Getisdefault $myitems] isdefault lastdefaultontrunk
427
428 log write 8 csets {LOD '$lodname'}
429 log write 8 csets { def? $isdefault}
430 log write 8 csets { last? $lastdefaultontrunk}
431
432 set lws [Getworkspace $rstate $lodname $myproject $isdefault]
433 $lws add [Getrevisioninfo $myitems]
434
435 set uuid [$repository importrevision [$self str] \
436 $user $message $date \
437 [$lws getid] [$lws get]]
438
439 # Remember the imported changeset in the state, under our
440 # LOD. And if it is the last trunk changeset on the vendor
441 # branch then the revision is also the actual root of the
442 # :trunk:, so we remember it as such in the state. However if
443 # the trunk already exists then the changeset cannot be on it
444 # any more. This indicates weirdness in the setup of the
445 # vendor branch, but one we can work around.
446
447 $lws defid $uuid
448 if {$lastdefaultontrunk} {
449 if {[$rstate has :trunk:]} {
450 log write 2 csets {Multiple changesets declared to be the last trunk changeset on the vendor-branch}
451 } else {
452 $rstate new :trunk: [$lws name]
453 }
454 }
455
456 # Remember the whole changeset / uuid mapping, for the tags.
457
458 state run {
459 INSERT INTO csuuid (cid, uuid)
@@ -430,92 +463,70 @@
463 }
464
465 proc Getrevisioninfo {revisions} {
466 set theset ('[join $revisions {','}]')
467 set revisions {}
468 foreach {frid path fname revnr rop} [state run [subst -nocommands -nobackslashes {
469 SELECT U.uuid, F.visible, F.name, R.rev, R.op
470 FROM revision R, revuuid U, file F
471 WHERE R.rid IN $theset -- All specified revisions
472 AND U.rid = R.rid -- get fossil uuid of revision
473 AND F.fid = R.fid -- get file of revision
474 }]] {
475 lappend revisions $frid $path $fname/$revnr $rop
476 }
477 return $revisions
478 }
479
480 proc Getworkspace {rstate lodname project isdefault} {
481
482 # The state object holds the workspace state of each known
483 # line-of-development (LOD), up to the last committed
484 # changeset belonging to that LOD.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
485
486 # (*) Standard handling if in-LOD changesets. If the LOD of
487 # the current changeset exists in the state (= has been
488 # committed to) then this it has the workspace we are
489 # looking for.
490
491 if {[$rstate has $lodname]} {
492 return [$rstate get $lodname]
493 }
494
495 # If the LOD is however not yet known, then the current
496 # changeset can be either of
497 # (a) root of a vendor branch,
498 # (b) root of the trunk LOD, or
499 # (c) the first changeset in a new LOD which was spawned from
500 # an existing LOD.
501
502 if {$isdefault || ($lodname eq ":trunk:")} {
503 # For both (a) and (b) we have to create a new workspace
504 # for the lod, and it doesn't inherit from anything.
505
506 # Note that case (b) may never occur. See the variable
507 # 'lastdefaultontrunk' in the caller (method pushto). This
508 # flag can the generation of the workspace for the :trunk:
509 # LOD as well, making it inherit the state of the last
510 # trunk-changeset on the vendor-branch.
511
512 return [$rstate new $lodname]
513 }
514
515 # Case (c). We find the parent LOD of our LOD and let the new
516 # workspace inherit from the parent's workspace.
 
 
 
 
 
 
 
517
518 set plodname [[[$project getsymbol $lodname] parent] name]
519
520 log write 8 csets {pLOD '$plodname'}
521
522 if {[$rstate has $plodname]} {
523 return [$rstate new $lodname $plodname]
524 }
525
526 foreach k [lsort [$rstate names]] {
527 log write 8 csets { $k = [[$rstate get $k] getid]}
528 }
529
530 trouble internal {Unable to determine changeset parent}
531 return
532 }
@@ -534,27 +545,10 @@
545 # ambigous.
546
547 return [list $def [expr {$last ne ""}]]
548 }
549
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
550 typemethod split {cset args} {
551 # As part of the creation of the new changesets specified in
552 # ARGS as sets of items, all subsets of CSET's item set, CSET
553 # will be dropped from all databases, in and out of memory,
554 # and then destroyed.
@@ -975,12 +969,18 @@
969
970 # # ## ### ##### ######## #############
971
972 typevariable mychangesets {} ; # List of all known
973 # changesets.
974
975 # List of all known changesets of a type.
976 typevariable mytchangesets -array {
977 sym::branch {}
978 sym::tag {}
979 rev {}
980 }
981
982 typevariable myitemmap -array {} ; # Map from items (tagged)
983 # to the list of changesets
984 # containing it. Each item
985 # can be used by only one
986 # changeset.
@@ -1298,10 +1298,25 @@
1298 AND CI.iid = B.bid -- Select all changesets
1299 AND C.cid = CI.cid -- containing the branches
1300 AND C.type = 2 -- which are branch changesets
1301 }]]
1302 }
1303
1304 # result = symbol name
1305 typemethod cs_lod {revisions} {
1306 # Determines the name of the symbol which is the line of
1307 # development for the revisions in a changeset.
1308
1309 set theset ('[join $revisions {','}]')
1310 return [state run [subst -nocommands -nobackslashes {
1311 SELECT
1312 DISTINCT L.name
1313 FROM revision R, symbol L
1314 WHERE R.rid in $theset -- Restrict to revisions of interest
1315 AND L.sid = R.lod -- Get lod symbol of revision
1316 }]]
1317 }
1318 }
1319
1320 # # ## ### ##### ######## ############# #####################
1321 ## Helper singleton. Commands for tag symbol changesets.
1322
@@ -1352,10 +1367,25 @@
1367 # result = list (changeset-id)
1368 typemethod cs_successors {tags} {
1369 # Tags have no successors.
1370 return
1371 }
1372
1373 # result = symbol name
1374 typemethod cs_lod {tags} {
1375 # Determines the name of the symbol which is the line of
1376 # development for the tags in a changeset.
1377
1378 set theset ('[join $tags {','}]')
1379 return [state run [subst -nocommands -nobackslashes {
1380 SELECT
1381 DISTINCT L.name
1382 FROM tag T, symbol L
1383 WHERE T.tid in $theset -- Restrict to tags of interest
1384 AND L.sid = T.lod -- Get lod symbol of tag
1385 }]]
1386 }
1387 }
1388
1389 # # ## ### ##### ######## ############# #####################
1390 ## Helper singleton. Commands for branch symbol changesets.
1391
@@ -1485,10 +1515,25 @@
1515 AND C.cid = CI.cid -- containing the subordinate tags
1516 AND C.type = 1 -- which are tag changesets
1517 }]]
1518 return
1519 }
1520
1521 # result = symbol name
1522 typemethod cs_lod {branches} {
1523 # Determines the name of the symbol which is the line of
1524 # development for the branches in a changeset.
1525
1526 set theset ('[join $branches {','}]')
1527 return [state run [subst -nocommands -nobackslashes {
1528 SELECT
1529 DISTINCT L.name
1530 FROM branch B, symbol L
1531 WHERE B.bid in $theset -- Restrict to branches of interest
1532 AND L.sid = B.lod -- Get lod symbol of branch
1533 }]]
1534 }
1535
1536 typemethod limits {branches} {
1537 # Notes. This method exists only for branches. It is needed to
1538 # get detailed information about a backward branch. It does
1539 # not apply to tags, nor revisions. The queries can also
1540
--- tools/cvs2fossil/lib/c2f_project.tcl
+++ tools/cvs2fossil/lib/c2f_project.tcl
@@ -1,8 +1,8 @@
11
## -*- tcl -*-
22
# # ## ### ##### ######## ############# #####################
3
-## Copyright (c) 2007 Andreas Kupries.
3
+## Copyright (c) 2007-2008 Andreas Kupries.
44
#
55
# This software is licensed as described in the file LICENSE, which
66
# you should have received as part of this distribution.
77
#
88
# This software consists of voluntary contributions made by many
99
--- tools/cvs2fossil/lib/c2f_project.tcl
+++ tools/cvs2fossil/lib/c2f_project.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
--- tools/cvs2fossil/lib/c2f_project.tcl
+++ tools/cvs2fossil/lib/c2f_project.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007-2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
--- 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
--- tools/cvs2fossil/lib/c2f_psym.tcl
+++ tools/cvs2fossil/lib/c2f_psym.tcl
@@ -1,8 +1,8 @@
11
## -*- tcl -*-
22
# # ## ### ##### ######## ############# #####################
3
-## Copyright (c) 2007 Andreas Kupries.
3
+## Copyright (c) 2007-2008 Andreas Kupries.
44
#
55
# This software is licensed as described in the file LICENSE, which
66
# you should have received as part of this distribution.
77
#
88
# This software consists of voluntary contributions made by many
@@ -46,13 +46,18 @@
4646
method istrunk {} { return 0 }
4747
4848
method parent {} {
4949
return [$myproject getsymbol [state one {
5050
SELECT S.name
51
- FROM preferedparent P, symbol S
52
- WHERE P.sid = $myid
53
- AND S.sid = P.pid
51
+ FROM tag T, symbol S
52
+ WHERE T.sid = $myid
53
+ AND S.sid = T.lod
54
+ UNION
55
+ SELECT S.name
56
+ FROM branch B, symbol S
57
+ WHERE B.sid = $myid
58
+ AND S.sid = B.lod
5459
}]]
5560
return
5661
}
5762
5863
# # ## ### ##### ######## #############
5964
--- tools/cvs2fossil/lib/c2f_psym.tcl
+++ tools/cvs2fossil/lib/c2f_psym.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
@@ -46,13 +46,18 @@
46 method istrunk {} { return 0 }
47
48 method parent {} {
49 return [$myproject getsymbol [state one {
50 SELECT S.name
51 FROM preferedparent P, symbol S
52 WHERE P.sid = $myid
53 AND S.sid = P.pid
 
 
 
 
 
54 }]]
55 return
56 }
57
58 # # ## ### ##### ######## #############
59
--- tools/cvs2fossil/lib/c2f_psym.tcl
+++ tools/cvs2fossil/lib/c2f_psym.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007-2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
@@ -46,13 +46,18 @@
46 method istrunk {} { return 0 }
47
48 method parent {} {
49 return [$myproject getsymbol [state one {
50 SELECT S.name
51 FROM tag T, symbol S
52 WHERE T.sid = $myid
53 AND S.sid = T.lod
54 UNION
55 SELECT S.name
56 FROM branch B, symbol S
57 WHERE B.sid = $myid
58 AND S.sid = B.lod
59 }]]
60 return
61 }
62
63 # # ## ### ##### ######## #############
64
--- tools/cvs2fossil/lib/c2f_ptrunk.tcl
+++ tools/cvs2fossil/lib/c2f_ptrunk.tcl
@@ -1,8 +1,8 @@
11
## -*- tcl -*-
22
# # ## ### ##### ######## ############# #####################
3
-## Copyright (c) 2007 Andreas Kupries.
3
+## Copyright (c) 2007-2008 Andreas Kupries.
44
#
55
# This software is licensed as described in the file LICENSE, which
66
# you should have received as part of this distribution.
77
#
88
# This software consists of voluntary contributions made by many
99
--- tools/cvs2fossil/lib/c2f_ptrunk.tcl
+++ tools/cvs2fossil/lib/c2f_ptrunk.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
--- tools/cvs2fossil/lib/c2f_ptrunk.tcl
+++ tools/cvs2fossil/lib/c2f_ptrunk.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007-2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
--- tools/cvs2fossil/lib/c2f_repository.tcl
+++ tools/cvs2fossil/lib/c2f_repository.tcl
@@ -1,8 +1,8 @@
11
## -*- tcl -*-
22
# # ## ### ##### ######## ############# #####################
3
-## Copyright (c) 2007 Andreas Kupries.
3
+## Copyright (c) 2007-2008 Andreas Kupries.
44
#
55
# This software is licensed as described in the file LICENSE, which
66
# you should have received as part of this distribution.
77
#
88
# This software consists of voluntary contributions made by many
99
1010
ADDED tools/cvs2fossil/lib/c2f_ristate.tcl
1111
ADDED tools/cvs2fossil/lib/c2f_wsstate.tcl
--- tools/cvs2fossil/lib/c2f_repository.tcl
+++ tools/cvs2fossil/lib/c2f_repository.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
10 DDED tools/cvs2fossil/lib/c2f_ristate.tcl
11 DDED tools/cvs2fossil/lib/c2f_wsstate.tcl
--- tools/cvs2fossil/lib/c2f_repository.tcl
+++ tools/cvs2fossil/lib/c2f_repository.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007-2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
10 DDED tools/cvs2fossil/lib/c2f_ristate.tcl
11 DDED tools/cvs2fossil/lib/c2f_wsstate.tcl
--- a/tools/cvs2fossil/lib/c2f_ristate.tcl
+++ b/tools/cvs2fossil/lib/c2f_ristate.tcl
@@ -0,0 +1,42 @@
1
+## -*- tcl -*-
2
+# # ## ### ##### ######## ############# #####################
3
+## Copyright (c) 2008 Andreas Kupries.
4
+#
5
+# This software is licensed as described in the file LICENSE, which
6
+# you should have received as part of this distribution.
7
+#
8
+# This software consists of voluntary contributions made by many
9
+# individuals. For exact contribution history, see the revision
10
+# history and logs, available at http://fossil-scm.hwaci.com/fossil
11
+# # ## ### ##### ######## ############# #####################
12
+
13
+## Track the state of revision import. Essentially maps lines of
14
+## developments to their workspace state.
15
+
16
+# # ## ### ##### ######## ############# #### # ## ### #truct::list ; # List assignment
17
+package require vc::fossil::import::cvs::wsstate ; # Workspace state
18
+package require vc::fossil::import::cvs::integrity ; # State integrity checks.
19
+package require vc::tools::log ; # User feedback.
20
+package require vc::tools::trouble ; # Error reporting.
21
+
22
+# # ## ### ##### ######## ############# #####################
23
+##
24
+
25
+snit::type ::vc::fossil::import::cvs::ristate {
26
+ # # ## ### ##### ######## #############
27
+ ## Public API
28
+
29
+ constructor {} {
30
+ # Start with an empty state
31
+ return
32
+ }
33
+
34
+ method new {lod {parentlod {}}} {
35
+ # Create the workspace stat{}}} {
36
+ # Create a workspac
37
+ # (LOD). If a parent LOstate
38
+ # inherit the current state of the parent.
39
+
40
+ log write 8 ristate {Open workspace state for LOD "$lod"}
41
+
42
+ integrity asse
--- a/tools/cvs2fossil/lib/c2f_ristate.tcl
+++ b/tools/cvs2fossil/lib/c2f_ristate.tcl
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/tools/cvs2fossil/lib/c2f_ristate.tcl
+++ b/tools/cvs2fossil/lib/c2f_ristate.tcl
@@ -0,0 +1,42 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9 # individuals. For exact contribution history, see the revision
10 # history and logs, available at http://fossil-scm.hwaci.com/fossil
11 # # ## ### ##### ######## ############# #####################
12
13 ## Track the state of revision import. Essentially maps lines of
14 ## developments to their workspace state.
15
16 # # ## ### ##### ######## ############# #### # ## ### #truct::list ; # List assignment
17 package require vc::fossil::import::cvs::wsstate ; # Workspace state
18 package require vc::fossil::import::cvs::integrity ; # State integrity checks.
19 package require vc::tools::log ; # User feedback.
20 package require vc::tools::trouble ; # Error reporting.
21
22 # # ## ### ##### ######## ############# #####################
23 ##
24
25 snit::type ::vc::fossil::import::cvs::ristate {
26 # # ## ### ##### ######## #############
27 ## Public API
28
29 constructor {} {
30 # Start with an empty state
31 return
32 }
33
34 method new {lod {parentlod {}}} {
35 # Create the workspace stat{}}} {
36 # Create a workspac
37 # (LOD). If a parent LOstate
38 # inherit the current state of the parent.
39
40 log write 8 ristate {Open workspace state for LOD "$lod"}
41
42 integrity asse
--- a/tools/cvs2fossil/lib/c2f_wsstate.tcl
+++ b/tools/cvs2fossil/lib/c2f_wsstate.tcl
@@ -0,0 +1,43 @@
1
+## -*- tcl -*-
2
+# # ## ### ##### ######## ############# #####################
3
+## Copyright (c) 2008 Andreas Kupries.
4
+#
5
+# This software is licensed as described in the file LICENSE, which
6
+# you should have received as part of this distribution.
7
+#
8
+# This software consists of voluntary contributions made by many
9
+# individuals. For exact contribution history, see the revision
10
+# history and logs, available at http://fossil-scm.hwaci.com/fossil
11
+# # ## ### ##### ######## ############# #####################
12
+
13
+## Track the state of a cvs workspace as changesets are committed to
14
+## it. Nothing actually happens in the filesystem, this is completely
15
+## virtual.
16
+
17
+# # ## ### ##### ######## ############# #####################
18
+## Requirements
19
+
20
+package require Tcl 8.4 ; # Required runtime.
21
+package require snit ; # OO system.
22
+package require struct::list ; # List assignment
23
+package require vc::tools::log ; # User feedback.
24
+
25
+# # ## ### ##### ######## ############# #####################
26
+##
27
+
28
+snit::type ::vc::fossil::import::cvs::wsstate {
29
+ # # ## ### ##### ######## #############
30
+ ## Public API
31
+
32
+ constructor {lod} {
33
+ # Start with $lodl]
34
+ }
35
+ }
36
+
37
+ incr myticksname {} { return $mynameticks {} { return $myticks }
38
+
39
+ method add {oprevisioninfo} {
40
+ # oprevisioninfo = list (rid path label op ...) /quadruples
41
+
42
+ # Overwrite all changed files (identified by path) with the
43
+ # new revisions. This
--- a/tools/cvs2fossil/lib/c2f_wsstate.tcl
+++ b/tools/cvs2fossil/lib/c2f_wsstate.tcl
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/tools/cvs2fossil/lib/c2f_wsstate.tcl
+++ b/tools/cvs2fossil/lib/c2f_wsstate.tcl
@@ -0,0 +1,43 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9 # individuals. For exact contribution history, see the revision
10 # history and logs, available at http://fossil-scm.hwaci.com/fossil
11 # # ## ### ##### ######## ############# #####################
12
13 ## Track the state of a cvs workspace as changesets are committed to
14 ## it. Nothing actually happens in the filesystem, this is completely
15 ## virtual.
16
17 # # ## ### ##### ######## ############# #####################
18 ## Requirements
19
20 package require Tcl 8.4 ; # Required runtime.
21 package require snit ; # OO system.
22 package require struct::list ; # List assignment
23 package require vc::tools::log ; # User feedback.
24
25 # # ## ### ##### ######## ############# #####################
26 ##
27
28 snit::type ::vc::fossil::import::cvs::wsstate {
29 # # ## ### ##### ######## #############
30 ## Public API
31
32 constructor {lod} {
33 # Start with $lodl]
34 }
35 }
36
37 incr myticksname {} { return $mynameticks {} { return $myticks }
38
39 method add {oprevisioninfo} {
40 # oprevisioninfo = list (rid path label op ...) /quadruples
41
42 # Overwrite all changed files (identified by path) with the
43 # new revisions. This
--- tools/cvs2fossil/lib/log.tcl
+++ tools/cvs2fossil/lib/log.tcl
@@ -1,8 +1,8 @@
11
## -*- tcl -*-
22
# # ## ### ##### ######## ############# #####################
3
-## Copyright (c) 2007 Andreas Kupries.
3
+## Copyright (c) 2007-2008 Andreas Kupries.
44
#
55
# This software is licensed as described in the file LICENSE, which
66
# you should have received as part of this distribution.
77
#
88
# This software consists of voluntary contributions made by many
99
--- tools/cvs2fossil/lib/log.tcl
+++ tools/cvs2fossil/lib/log.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
--- tools/cvs2fossil/lib/log.tcl
+++ tools/cvs2fossil/lib/log.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007-2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
--- tools/cvs2fossil/lib/misc.tcl
+++ tools/cvs2fossil/lib/misc.tcl
@@ -1,8 +1,8 @@
11
## -*- tcl -*-
22
# # ## ### ##### ######## ############# #####################
3
-## Copyright (c) 2007 Andreas Kupries.
3
+## Copyright (c) 2007-2008 Andreas Kupries.
44
#
55
# This software is licensed as described in the file LICENSE, which
66
# you should have received as part of this distribution.
77
#
88
# This software consists of voluntary contributions made by many
99
--- tools/cvs2fossil/lib/misc.tcl
+++ tools/cvs2fossil/lib/misc.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
--- tools/cvs2fossil/lib/misc.tcl
+++ tools/cvs2fossil/lib/misc.tcl
@@ -1,8 +1,8 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007-2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9
--- tools/cvs2fossil/lib/pkgIndex.tcl
+++ tools/cvs2fossil/lib/pkgIndex.tcl
@@ -31,11 +31,13 @@
3131
package ifneeded vc::fossil::import::cvs::project::rev 1.0 [list source [file join $dir c2f_prev.tcl]]
3232
package ifneeded vc::fossil::import::cvs::project::revlink 1.0 [list source [file join $dir c2f_prevlink.tcl]]
3333
package ifneeded vc::fossil::import::cvs::project::sym 1.0 [list source [file join $dir c2f_psym.tcl]]
3434
package ifneeded vc::fossil::import::cvs::project::trunk 1.0 [list source [file join $dir c2f_ptrunk.tcl]]
3535
package ifneeded vc::fossil::import::cvs::repository 1.0 [list source [file join $dir c2f_repository.tcl]]
36
+package ifneeded vc::fossil::import::cvs::ristate 1.0 [list source [file join $dir c2f_ristate.tcl]]
3637
package ifneeded vc::fossil::import::cvs::state 1.0 [list source [file join $dir c2f_state.tcl]]
38
+package ifneeded vc::fossil::import::cvs::wsstate 1.0 [list source [file join $dir c2f_wsstate.tcl]]
3739
package ifneeded vc::rcs::parser 1.0 [list source [file join $dir rcsparser.tcl]]
3840
package ifneeded vc::tools::dot 1.0 [list source [file join $dir dot.tcl]]
3941
package ifneeded vc::tools::id 1.0 [list source [file join $dir id.tcl]]
4042
package ifneeded vc::tools::log 1.0 [list source [file join $dir log.tcl]]
4143
package ifneeded vc::tools::misc 1.0 [list source [file join $dir misc.tcl]]
4244
--- tools/cvs2fossil/lib/pkgIndex.tcl
+++ tools/cvs2fossil/lib/pkgIndex.tcl
@@ -31,11 +31,13 @@
31 package ifneeded vc::fossil::import::cvs::project::rev 1.0 [list source [file join $dir c2f_prev.tcl]]
32 package ifneeded vc::fossil::import::cvs::project::revlink 1.0 [list source [file join $dir c2f_prevlink.tcl]]
33 package ifneeded vc::fossil::import::cvs::project::sym 1.0 [list source [file join $dir c2f_psym.tcl]]
34 package ifneeded vc::fossil::import::cvs::project::trunk 1.0 [list source [file join $dir c2f_ptrunk.tcl]]
35 package ifneeded vc::fossil::import::cvs::repository 1.0 [list source [file join $dir c2f_repository.tcl]]
 
36 package ifneeded vc::fossil::import::cvs::state 1.0 [list source [file join $dir c2f_state.tcl]]
 
37 package ifneeded vc::rcs::parser 1.0 [list source [file join $dir rcsparser.tcl]]
38 package ifneeded vc::tools::dot 1.0 [list source [file join $dir dot.tcl]]
39 package ifneeded vc::tools::id 1.0 [list source [file join $dir id.tcl]]
40 package ifneeded vc::tools::log 1.0 [list source [file join $dir log.tcl]]
41 package ifneeded vc::tools::misc 1.0 [list source [file join $dir misc.tcl]]
42
--- tools/cvs2fossil/lib/pkgIndex.tcl
+++ tools/cvs2fossil/lib/pkgIndex.tcl
@@ -31,11 +31,13 @@
31 package ifneeded vc::fossil::import::cvs::project::rev 1.0 [list source [file join $dir c2f_prev.tcl]]
32 package ifneeded vc::fossil::import::cvs::project::revlink 1.0 [list source [file join $dir c2f_prevlink.tcl]]
33 package ifneeded vc::fossil::import::cvs::project::sym 1.0 [list source [file join $dir c2f_psym.tcl]]
34 package ifneeded vc::fossil::import::cvs::project::trunk 1.0 [list source [file join $dir c2f_ptrunk.tcl]]
35 package ifneeded vc::fossil::import::cvs::repository 1.0 [list source [file join $dir c2f_repository.tcl]]
36 package ifneeded vc::fossil::import::cvs::ristate 1.0 [list source [file join $dir c2f_ristate.tcl]]
37 package ifneeded vc::fossil::import::cvs::state 1.0 [list source [file join $dir c2f_state.tcl]]
38 package ifneeded vc::fossil::import::cvs::wsstate 1.0 [list source [file join $dir c2f_wsstate.tcl]]
39 package ifneeded vc::rcs::parser 1.0 [list source [file join $dir rcsparser.tcl]]
40 package ifneeded vc::tools::dot 1.0 [list source [file join $dir dot.tcl]]
41 package ifneeded vc::tools::id 1.0 [list source [file join $dir id.tcl]]
42 package ifneeded vc::tools::log 1.0 [list source [file join $dir log.tcl]]
43 package ifneeded vc::tools::misc 1.0 [list source [file join $dir misc.tcl]]
44

Keyboard Shortcuts

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