Fossil

Check-in [ffafc0bd]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Continued work on pass 4. Added code bringing the file level symbol data into compliance with the project level symbol types, converting tags to branches and vice versa.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ffafc0bd6541fe2995248374de37293c0dd2a6e4
User & Date: aku 2007-11-06 07:14:07
Context
2007-11-06
08:05
Continued work on pass 4. Now propagating the project level information about prefered parents down to the file level tags. Same for the file level branches is not yet done. check-in: 3a530ef9 user: aku tags: trunk
07:14
Continued work on pass 4. Added code bringing the file level symbol data into compliance with the project level symbol types, converting tags to branches and vice versa. check-in: ffafc0bd user: aku tags: trunk
06:47
Continued work on pass 4. Implemented the deletion of excluded symbols and all parts referencing them. The complex part is the regrafting of NTDB revisions should a NTDB branch be excluded. This is like 'GraftNTDB2Trunk' in 'file' when excluding everything but the trunk. check-in: 69bf6ab9 user: aku tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tools/cvs2fossil/lib/c2f_pfiltersym.tcl.

67
68
69
70
71
72
73




74
75
76
77
78
79
80
..
84
85
86
87
88
89
90


91
92
93
94
95
96
97
...
173
174
175
176
177
178
179


















































180
181
182
183
184
185
186
	# functionality of the pass.

	# The removal of excluded symbols and everything referencing
	# to them is done completely in the database.

	state transaction {
	    FilterExcludedSymbols




	}

	log write 1 filtersym "Filtering completed"
	return
    }

    typemethod discard {} {
................................................................................
	return
    }

    # # ## ### ##### ######## #############
    ## Internal methods

    proc FilterExcludedSymbols {} {


	# We pull all the excluded symbols together into a table for
	# easy reference by the upcoming DELETE and other statements.
	# ('x IN table' clauses).

	set excl [project::sym excluded]

	state run {
................................................................................
	    DELETE FROM revision WHERE lod IN excludedsymbols;
	    DELETE FROM tag      WHERE lod IN excludedsymbols;
	    DELETE FROM tag      WHERE sid IN excludedsymbols;
	    DELETE FROM branch   WHERE lod IN excludedsymbols;
	    DELETE FROM branch   WHERE sid IN excludedsymbols;

	    DROP TABLE excludedsymbols;


















































	}
	return
    }

    # # ## ### ##### ######## #############
    ## Configuration








>
>
>
>







 







>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
..
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
...
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
	# functionality of the pass.

	# The removal of excluded symbols and everything referencing
	# to them is done completely in the database.

	state transaction {
	    FilterExcludedSymbols
	    MutateTagsToBranch
	    MutateBranchesToTag

	    # Consider a rerun of the pass 2 paranoia checks.
	}

	log write 1 filtersym "Filtering completed"
	return
    }

    typemethod discard {} {
................................................................................
	return
    }

    # # ## ### ##### ######## #############
    ## Internal methods

    proc FilterExcludedSymbols {} {
	log write 3 filtersym "Filter out excluded symbols and users"

	# We pull all the excluded symbols together into a table for
	# easy reference by the upcoming DELETE and other statements.
	# ('x IN table' clauses).

	set excl [project::sym excluded]

	state run {
................................................................................
	    DELETE FROM revision WHERE lod IN excludedsymbols;
	    DELETE FROM tag      WHERE lod IN excludedsymbols;
	    DELETE FROM tag      WHERE sid IN excludedsymbols;
	    DELETE FROM branch   WHERE lod IN excludedsymbols;
	    DELETE FROM branch   WHERE sid IN excludedsymbols;

	    DROP TABLE excludedsymbols;
	}
	return
    }

    proc MutateTagsToBranch {} {
	log write 3 filtersym "Mutate tags to branches"

	# Next, now that we know which symbols are what we look for
	# file level tags which are actually converted as branches
	# (project level), and put them into the correct table.

	set branch [project::sym branch]

	set tagstomutate [state run {
	    SELECT T.tid, T.fid, T.lod, T.sid, T.rev
	    FROM tag T, symbol S
	    WHERE T.sid = S.sid
	    AND S.type = $branch
	}]
	foreach {id fid lod sid rev} $tagstomutate {
	    state run {
		DELETE FROM tag WHERE tid = $id ;
		INSERT INTO branch (bid, fid,  lod,  sid,  root, first, bra)
		VALUES             ($id, $fid, $lod, $sid, $rev, NULL,  '');
	    }
	}
	return
    }

    proc MutateBranchesToTag {} {
	log write 3 filtersym "Mutate branches to tags"

	# Next, now that we know which symbols are what we look for
	# file level branches which are actually converted as tags
	# (project level), and put them into the correct table.

	set tag [project::sym tag]

	set branchestomutate [state run {
	    SELECT B.bid, B.fid, B.lod, B.sid, B.root, B.first, B.bra
	    FROM branch B, symbol S
	    WHERE B.sid = S.sid
	    AND S.type = $tag
	}]
	foreach {id fid lod sid root first bra} $branchestomutate {
	    state run {
		DELETE FROM branch WHERE bid = $id ;
		INSERT INTO tag (tid, fid,  lod,  sid,  rev)
		VALUES          ($id, $fid, $lod, $sid, $root);
	    }
	}
	return
    }

    # # ## ### ##### ######## #############
    ## Configuration

Changes to tools/cvs2fossil/lib/c2f_psym.tcl.

244
245
246
247
248
249
250

251
252
253
254
255
256
257
    typevariable mybranch          2 ; # Code for symbols which are branches.
    typevariable myundef           3 ; # Code for symbols of unknown type.
    typevariable mysymtype -array {} ; # Map from type code to label for the log.

    typemethod undef    {} { return $myundef    }
    typemethod excluded {} { return $myexcluded }
    typemethod tag      {} { return $mytag      }


    typemethod printrulestatistics {} {
	log write 2 symbol "Rule usage statistics:"

	set fmt %[string length $mynum]s
	set all 0








>







244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
    typevariable mybranch          2 ; # Code for symbols which are branches.
    typevariable myundef           3 ; # Code for symbols of unknown type.
    typevariable mysymtype -array {} ; # Map from type code to label for the log.

    typemethod undef    {} { return $myundef    }
    typemethod excluded {} { return $myexcluded }
    typemethod tag      {} { return $mytag      }
    typemethod branch   {} { return $mybranch   }

    typemethod printrulestatistics {} {
	log write 2 symbol "Rule usage statistics:"

	set fmt %[string length $mynum]s
	set all 0