Fossil SCM

API tweak rcs parser, definition of symbols, call through the callback once per symbol instead of once for the whole set.

aku 2007-10-10 04:23 trunk
Commit 338854a61ad1f3b9e69d722b3d487cd07461bd0f
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -42,21 +42,21 @@
4242
method admindone {} {}
4343
4444
method sethead {h} {}
4545
method setprincipalbranch {b} {}
4646
47
- method setsymbols {dict} {}
48
- method setcomment {c} {}
49
- method setdesc {d} {}
47
+ method deftag {s r} {}
48
+ method setcomment {c} {}
49
+ method setdesc {d} {}
5050
5151
method def {rev date author state next branches} {}
5252
method extend {rev commitmsg deltarange} {}
5353
5454
#method begin {} {puts begin}
5555
#method sethead {h} {puts head=$h}
5656
#method setprincipalbranch {b} {puts pb=$b}
57
- #method setsymbols {dict} {puts symbols=$dict}
57
+ #method deftag {s r} {puts $s=$r }
5858
#method setcomment {c} {puts comment=$c}
5959
#method admindone {} {puts admindone}
6060
#method def {rev date author state next branches} {puts "def $rev $date $author $state $next $branches"}
6161
#method setdesc {d} {puts desc=$d}
6262
#method extend {rev commitmsg deltarange} {puts "extend $commitmsg $deltarange"}
@@ -83,14 +83,12 @@
8383
method setprincipalbranch {b} {
8484
set myprincipal $b
8585
return
8686
}
8787
88
- method setsymbols {dict} {
88
+ method deftag {symbol rev} {
8989
# Slice symbols into branches and tags, canonical numbers ...
90
-array set _ $dict
91
-parray _
9290
}
9391
9492
method setcomment {c} {# ignore}
9593
method setdesc {d} {# ignore}
9694
9795
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -42,21 +42,21 @@
42 method admindone {} {}
43
44 method sethead {h} {}
45 method setprincipalbranch {b} {}
46
47 method setsymbols {dict} {}
48 method setcomment {c} {}
49 method setdesc {d} {}
50
51 method def {rev date author state next branches} {}
52 method extend {rev commitmsg deltarange} {}
53
54 #method begin {} {puts begin}
55 #method sethead {h} {puts head=$h}
56 #method setprincipalbranch {b} {puts pb=$b}
57 #method setsymbols {dict} {puts symbols=$dict}
58 #method setcomment {c} {puts comment=$c}
59 #method admindone {} {puts admindone}
60 #method def {rev date author state next branches} {puts "def $rev $date $author $state $next $branches"}
61 #method setdesc {d} {puts desc=$d}
62 #method extend {rev commitmsg deltarange} {puts "extend $commitmsg $deltarange"}
@@ -83,14 +83,12 @@
83 method setprincipalbranch {b} {
84 set myprincipal $b
85 return
86 }
87
88 method setsymbols {dict} {
89 # Slice symbols into branches and tags, canonical numbers ...
90 array set _ $dict
91 parray _
92 }
93
94 method setcomment {c} {# ignore}
95 method setdesc {d} {# ignore}
96
97
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -42,21 +42,21 @@
42 method admindone {} {}
43
44 method sethead {h} {}
45 method setprincipalbranch {b} {}
46
47 method deftag {s r} {}
48 method setcomment {c} {}
49 method setdesc {d} {}
50
51 method def {rev date author state next branches} {}
52 method extend {rev commitmsg deltarange} {}
53
54 #method begin {} {puts begin}
55 #method sethead {h} {puts head=$h}
56 #method setprincipalbranch {b} {puts pb=$b}
57 #method deftag {s r} {puts $s=$r }
58 #method setcomment {c} {puts comment=$c}
59 #method admindone {} {puts admindone}
60 #method def {rev date author state next branches} {puts "def $rev $date $author $state $next $branches"}
61 #method setdesc {d} {puts desc=$d}
62 #method extend {rev commitmsg deltarange} {puts "extend $commitmsg $deltarange"}
@@ -83,14 +83,12 @@
83 method setprincipalbranch {b} {
84 set myprincipal $b
85 return
86 }
87
88 method deftag {symbol rev} {
89 # Slice symbols into branches and tags, canonical numbers ...
 
 
90 }
91
92 method setcomment {c} {# ignore}
93 method setdesc {d} {# ignore}
94
95
--- tools/cvs2fossil/lib/rcsparser.tcl
+++ tools/cvs2fossil/lib/rcsparser.tcl
@@ -74,20 +74,16 @@
7474
Semicolon
7575
return
7676
}
7777
7878
proc Symbols {} {
79
- set d {}
8079
RequiredLiteral symbols
8180
while {[Ident -> symbol]} {
8281
RequiredNumber -> rev
83
- # TODO: distinguish branch/tag symbols, transform revision
84
- # numbers into canonical form.
85
- lappend d $symbol $rev
82
+ Call deftag $symbol $rev
8683
}
8784
Semicolon
88
- Call setsymbols $d
8985
return
9086
}
9187
9288
proc Locks {} {
9389
# Not saving locks.
9490
--- tools/cvs2fossil/lib/rcsparser.tcl
+++ tools/cvs2fossil/lib/rcsparser.tcl
@@ -74,20 +74,16 @@
74 Semicolon
75 return
76 }
77
78 proc Symbols {} {
79 set d {}
80 RequiredLiteral symbols
81 while {[Ident -> symbol]} {
82 RequiredNumber -> rev
83 # TODO: distinguish branch/tag symbols, transform revision
84 # numbers into canonical form.
85 lappend d $symbol $rev
86 }
87 Semicolon
88 Call setsymbols $d
89 return
90 }
91
92 proc Locks {} {
93 # Not saving locks.
94
--- tools/cvs2fossil/lib/rcsparser.tcl
+++ tools/cvs2fossil/lib/rcsparser.tcl
@@ -74,20 +74,16 @@
74 Semicolon
75 return
76 }
77
78 proc Symbols {} {
 
79 RequiredLiteral symbols
80 while {[Ident -> symbol]} {
81 RequiredNumber -> rev
82 Call deftag $symbol $rev
 
 
83 }
84 Semicolon
 
85 return
86 }
87
88 proc Locks {} {
89 # Not saving locks.
90

Keyboard Shortcuts

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