Fossil SCM

Added documentation to state definition, and debugging output to the state system itself.

aku 2007-10-06 03:55 trunk
Commit 10f9d51bb2ae7825c84db019587d8bb80654999a
--- tools/cvs2fossil/lib/c2f_pcollar.tcl
+++ tools/cvs2fossil/lib/c2f_pcollar.tcl
@@ -69,14 +69,14 @@
6969
pid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
7070
name TEXT NOT NULL UNIQUE
7171
}
7272
state writing file {
7373
fid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
74
- pid INTEGER NOT NULL REFERENCES project,
74
+ pid INTEGER NOT NULL REFERENCES project, -- project the file belongs to
7575
name TEXT NOT NULL,
7676
visible TEXT NOT NULL,
77
- UNIQUE (pid, name)
77
+ UNIQUE (pid, name) -- file names are unique within a project
7878
}
7979
return
8080
}
8181
8282
typemethod run {} {
8383
--- tools/cvs2fossil/lib/c2f_pcollar.tcl
+++ tools/cvs2fossil/lib/c2f_pcollar.tcl
@@ -69,14 +69,14 @@
69 pid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
70 name TEXT NOT NULL UNIQUE
71 }
72 state writing file {
73 fid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
74 pid INTEGER NOT NULL REFERENCES project,
75 name TEXT NOT NULL,
76 visible TEXT NOT NULL,
77 UNIQUE (pid, name)
78 }
79 return
80 }
81
82 typemethod run {} {
83
--- tools/cvs2fossil/lib/c2f_pcollar.tcl
+++ tools/cvs2fossil/lib/c2f_pcollar.tcl
@@ -69,14 +69,14 @@
69 pid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
70 name TEXT NOT NULL UNIQUE
71 }
72 state writing file {
73 fid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
74 pid INTEGER NOT NULL REFERENCES project, -- project the file belongs to
75 name TEXT NOT NULL,
76 visible TEXT NOT NULL,
77 UNIQUE (pid, name) -- file names are unique within a project
78 }
79 return
80 }
81
82 typemethod run {} {
83
--- tools/cvs2fossil/lib/c2f_state.tcl
+++ tools/cvs2fossil/lib/c2f_state.tcl
@@ -98,18 +98,22 @@
9898
typemethod writing {name definition} {
9999
# Method for a user to declare a table its needs for storing
100100
# persistent state, and the expected structure. A possibly
101101
# previously existing definition is dropped.
102102
103
+ log write 0 state "writing $name" ; # TODO move to level 5 or so
104
+
103105
$mystate transaction {
104106
catch { $mystate eval "DROP TABLE $name" }
105107
$mystate eval "CREATE TABLE $name ( $definition )"
106108
}
107109
return
108110
}
109111
110112
typemethod reading {name} {
113
+ log write 0 state "reading $name" ; # TODO move to level 5 or so
114
+
111115
# Method for a user to declare a table it wishes to read
112116
# from. A missing table is an internal error causing an
113117
# immediate exit.
114118
115119
set found [llength [$mystate eval {
116120
--- tools/cvs2fossil/lib/c2f_state.tcl
+++ tools/cvs2fossil/lib/c2f_state.tcl
@@ -98,18 +98,22 @@
98 typemethod writing {name definition} {
99 # Method for a user to declare a table its needs for storing
100 # persistent state, and the expected structure. A possibly
101 # previously existing definition is dropped.
102
 
 
103 $mystate transaction {
104 catch { $mystate eval "DROP TABLE $name" }
105 $mystate eval "CREATE TABLE $name ( $definition )"
106 }
107 return
108 }
109
110 typemethod reading {name} {
 
 
111 # Method for a user to declare a table it wishes to read
112 # from. A missing table is an internal error causing an
113 # immediate exit.
114
115 set found [llength [$mystate eval {
116
--- tools/cvs2fossil/lib/c2f_state.tcl
+++ tools/cvs2fossil/lib/c2f_state.tcl
@@ -98,18 +98,22 @@
98 typemethod writing {name definition} {
99 # Method for a user to declare a table its needs for storing
100 # persistent state, and the expected structure. A possibly
101 # previously existing definition is dropped.
102
103 log write 0 state "writing $name" ; # TODO move to level 5 or so
104
105 $mystate transaction {
106 catch { $mystate eval "DROP TABLE $name" }
107 $mystate eval "CREATE TABLE $name ( $definition )"
108 }
109 return
110 }
111
112 typemethod reading {name} {
113 log write 0 state "reading $name" ; # TODO move to level 5 or so
114
115 # Method for a user to declare a table it wishes to read
116 # from. A missing table is an internal error causing an
117 # immediate exit.
118
119 set found [llength [$mystate eval {
120

Keyboard Shortcuts

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