Fossil SCM

Opcode synchronization reworked, optype table is master from which the in-memory array is loaded.

aku 2007-11-07 07:46 trunk
Commit e45f47ec4aa0f67092c90e80b3f701b2df601ef1
--- tools/cvs2fossil/lib/c2f_frev.tcl
+++ tools/cvs2fossil/lib/c2f_frev.tcl
@@ -482,17 +482,19 @@
482482
{0 0} change
483483
{0 1} delete
484484
{1 0} add
485485
{1 1} nothing
486486
}
487
- # Keep myopcode in sync with project::collrev.optype
488
- typevariable myopcode -array {
489
- change 2
490
- delete -1
491
- add 1
492
- nothing 0
487
+
488
+ typemethod getopcodes {} {
489
+ foreach {id name} [state run {
490
+ SELECT oid, name FROM optype;
491
+ }] { set myopcode($name) $id }
492
+ return
493493
}
494
+
495
+ typevariable myopcode -array {}
494496
495497
# # ## ### ##### ######## #############
496498
## Internal methods
497499
498500
# # ## ### ##### ######## #############
499501
--- tools/cvs2fossil/lib/c2f_frev.tcl
+++ tools/cvs2fossil/lib/c2f_frev.tcl
@@ -482,17 +482,19 @@
482 {0 0} change
483 {0 1} delete
484 {1 0} add
485 {1 1} nothing
486 }
487 # Keep myopcode in sync with project::collrev.optype
488 typevariable myopcode -array {
489 change 2
490 delete -1
491 add 1
492 nothing 0
493 }
 
 
494
495 # # ## ### ##### ######## #############
496 ## Internal methods
497
498 # # ## ### ##### ######## #############
499
--- tools/cvs2fossil/lib/c2f_frev.tcl
+++ tools/cvs2fossil/lib/c2f_frev.tcl
@@ -482,17 +482,19 @@
482 {0 0} change
483 {0 1} delete
484 {1 0} add
485 {1 1} nothing
486 }
487
488 typemethod getopcodes {} {
489 foreach {id name} [state run {
490 SELECT oid, name FROM optype;
491 }] { set myopcode($name) $id }
492 return
493 }
494
495 typevariable myopcode -array {}
496
497 # # ## ### ##### ######## #############
498 ## Internal methods
499
500 # # ## ### ##### ######## #############
501
--- tools/cvs2fossil/lib/c2f_pcollrev.tcl
+++ tools/cvs2fossil/lib/c2f_pcollrev.tcl
@@ -21,11 +21,12 @@
2121
package require vc::tools::trouble ; # Error reporting.
2222
package require vc::tools::log ; # User feedback.
2323
package require vc::fossil::import::cvs::pass ; # Pass management.
2424
package require vc::fossil::import::cvs::repository ; # Repository management.
2525
package require vc::fossil::import::cvs::state ; # State storage.
26
-package require vc::fossil::import::cvs::project::sym ; # Project level symbols
26
+package require vc::fossil::import::cvs::project::sym ; # Project level symbols.
27
+package require vc::fossil::import::cvs::file::rev ; # File level revisions.
2728
package require vc::rcs::parser ; # Rcs archive data extraction.
2829
2930
# # ## ### ##### ######## ############# #####################
3031
## Register the pass with the management
3132
@@ -144,18 +145,17 @@
144145
UNIQUE (fid, rev) -- The DTN is unique within the revision's file.
145146
}
146147
state writing optype {
147148
oid INTEGER NOT NULL PRIMARY KEY,
148149
name TEXT NOT NULL,
149
- UNIQUE(text)
150
+ UNIQUE(name)
150151
}
151
- # Keep optype in sync with file::rev.myopcode
152152
state run {
153
- INSERT INTO optype VALUES (-1,'delete');
154
- INSERT INTO optype VALUES ( 0,'nothing');
155
- INSERT INTO optype VALUES ( 1,'add');
156
- INSERT INTO optype VALUES ( 2,'change');
153
+ INSERT INTO optype VALUES (-1,'delete'); -- The opcode names are the
154
+ INSERT INTO optype VALUES ( 0,'nothing'); -- fixed pieces, see myopstate
155
+ INSERT INTO optype VALUES ( 1,'add'); -- in file::rev. myopcode is
156
+ INSERT INTO optype VALUES ( 2,'change'); -- loaded from this.
157157
}
158158
state writing tag {
159159
tid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
160160
fid INTEGER NOT NULL REFERENCES file, -- File the item belongs to
161161
lod INTEGER REFERENCES symbol, -- Line of development (NULL => Trunk)
@@ -269,18 +269,21 @@
269269
cid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
270270
text TEXT NOT NULL UNIQUE
271271
}
272272
273273
project::sym getsymtypes
274
+ file::rev getopcodes
274275
return
275276
}
276277
277278
typemethod load {} {
278279
state reading symbol
279280
state reading symtype
281
+ state reading optype
280282
281283
project::sym getsymtypes
284
+ file::rev getopcodes
282285
repository loadsymbols
283286
return
284287
}
285288
286289
typemethod run {} {
@@ -608,10 +611,13 @@
608611
namespace import ::vc::fossil::import::cvs::repository
609612
namespace import ::vc::fossil::import::cvs::state
610613
namespace eval project {
611614
namespace import ::vc::fossil::import::cvs::project::sym
612615
}
616
+ namespace eval file {
617
+ namespace import ::vc::fossil::import::cvs::file::rev
618
+ }
613619
namespace import ::vc::tools::trouble
614620
namespace import ::vc::tools::log
615621
log register collrev
616622
}
617623
}
618624
--- tools/cvs2fossil/lib/c2f_pcollrev.tcl
+++ tools/cvs2fossil/lib/c2f_pcollrev.tcl
@@ -21,11 +21,12 @@
21 package require vc::tools::trouble ; # Error reporting.
22 package require vc::tools::log ; # User feedback.
23 package require vc::fossil::import::cvs::pass ; # Pass management.
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::project::sym ; # Project level symbols
 
27 package require vc::rcs::parser ; # Rcs archive data extraction.
28
29 # # ## ### ##### ######## ############# #####################
30 ## Register the pass with the management
31
@@ -144,18 +145,17 @@
144 UNIQUE (fid, rev) -- The DTN is unique within the revision's file.
145 }
146 state writing optype {
147 oid INTEGER NOT NULL PRIMARY KEY,
148 name TEXT NOT NULL,
149 UNIQUE(text)
150 }
151 # Keep optype in sync with file::rev.myopcode
152 state run {
153 INSERT INTO optype VALUES (-1,'delete');
154 INSERT INTO optype VALUES ( 0,'nothing');
155 INSERT INTO optype VALUES ( 1,'add');
156 INSERT INTO optype VALUES ( 2,'change');
157 }
158 state writing tag {
159 tid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
160 fid INTEGER NOT NULL REFERENCES file, -- File the item belongs to
161 lod INTEGER REFERENCES symbol, -- Line of development (NULL => Trunk)
@@ -269,18 +269,21 @@
269 cid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
270 text TEXT NOT NULL UNIQUE
271 }
272
273 project::sym getsymtypes
 
274 return
275 }
276
277 typemethod load {} {
278 state reading symbol
279 state reading symtype
 
280
281 project::sym getsymtypes
 
282 repository loadsymbols
283 return
284 }
285
286 typemethod run {} {
@@ -608,10 +611,13 @@
608 namespace import ::vc::fossil::import::cvs::repository
609 namespace import ::vc::fossil::import::cvs::state
610 namespace eval project {
611 namespace import ::vc::fossil::import::cvs::project::sym
612 }
 
 
 
613 namespace import ::vc::tools::trouble
614 namespace import ::vc::tools::log
615 log register collrev
616 }
617 }
618
--- tools/cvs2fossil/lib/c2f_pcollrev.tcl
+++ tools/cvs2fossil/lib/c2f_pcollrev.tcl
@@ -21,11 +21,12 @@
21 package require vc::tools::trouble ; # Error reporting.
22 package require vc::tools::log ; # User feedback.
23 package require vc::fossil::import::cvs::pass ; # Pass management.
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::project::sym ; # Project level symbols.
27 package require vc::fossil::import::cvs::file::rev ; # File level revisions.
28 package require vc::rcs::parser ; # Rcs archive data extraction.
29
30 # # ## ### ##### ######## ############# #####################
31 ## Register the pass with the management
32
@@ -144,18 +145,17 @@
145 UNIQUE (fid, rev) -- The DTN is unique within the revision's file.
146 }
147 state writing optype {
148 oid INTEGER NOT NULL PRIMARY KEY,
149 name TEXT NOT NULL,
150 UNIQUE(name)
151 }
 
152 state run {
153 INSERT INTO optype VALUES (-1,'delete'); -- The opcode names are the
154 INSERT INTO optype VALUES ( 0,'nothing'); -- fixed pieces, see myopstate
155 INSERT INTO optype VALUES ( 1,'add'); -- in file::rev. myopcode is
156 INSERT INTO optype VALUES ( 2,'change'); -- loaded from this.
157 }
158 state writing tag {
159 tid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
160 fid INTEGER NOT NULL REFERENCES file, -- File the item belongs to
161 lod INTEGER REFERENCES symbol, -- Line of development (NULL => Trunk)
@@ -269,18 +269,21 @@
269 cid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
270 text TEXT NOT NULL UNIQUE
271 }
272
273 project::sym getsymtypes
274 file::rev getopcodes
275 return
276 }
277
278 typemethod load {} {
279 state reading symbol
280 state reading symtype
281 state reading optype
282
283 project::sym getsymtypes
284 file::rev getopcodes
285 repository loadsymbols
286 return
287 }
288
289 typemethod run {} {
@@ -608,10 +611,13 @@
611 namespace import ::vc::fossil::import::cvs::repository
612 namespace import ::vc::fossil::import::cvs::state
613 namespace eval project {
614 namespace import ::vc::fossil::import::cvs::project::sym
615 }
616 namespace eval file {
617 namespace import ::vc::fossil::import::cvs::file::rev
618 }
619 namespace import ::vc::tools::trouble
620 namespace import ::vc::tools::log
621 log register collrev
622 }
623 }
624

Keyboard Shortcuts

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