Fossil

Check-in [3a530ef9]
Login

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

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:3a530ef9473884c08bb9303099f77f9f84af354c
User & Date: aku 2007-11-06 08:05:40
Context
2007-11-07
06:19
Extended pass 2, save branch positions, needed for pass 4, and added optype table to have the revision opcodes available in the state as well. check-in: 7ab490df user: aku tags: trunk
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
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

69
70
71
72
73
74
75


76
77
78
79
80
81
82
...
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
...
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
243
244
245
	# 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
    }
................................................................................

	# 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
................................................................................

	# 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

    pragma -hasinstances   no ; # singleton
    pragma -hastypeinfo    no ; # no introspection
    pragma -hastypedestroy no ; # immortal







>
>







 







|




|
<







 







|




|
<








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







69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
...
194
195
196
197
198
199
200
201
202
203
204
205
206

207
208
209
210
211
212
213
...
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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
	# The removal of excluded symbols and everything referencing
	# to them is done completely in the database.

	state transaction {
	    FilterExcludedSymbols
	    MutateTagsToBranch
	    MutateBranchesToTag
	    AdjustTagParents
	    AdjustBranchParents

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

	log write 1 filtersym "Filtering completed"
	return
    }
................................................................................

	# 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]

	foreach {id fid lod sid rev} [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
	}] {

	    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
................................................................................

	# 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]

	foreach {id fid lod sid root first bra} [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
	}] {

	    state run {
		DELETE FROM branch WHERE bid = $id ;
		INSERT INTO tag (tid, fid,  lod,  sid,  rev)
		VALUES          ($id, $fid, $lod, $sid, $root);
	    }
	}
	return
    }

    # Adjust the parents of symbols to their preferred parents.

    # If a file level ymbol has a preferred parent that is different
    # than its current parent, and if the preferred parent is an
    # allowed parent of the symbol in this file, then we graft the
    # aSymbol onto its preferred parent.

    proc AdjustTagParents {} {
	log write 3 filtersym "Adjust tag parents"

	# Find the tags whose current parent (lod) is not the prefered
	# parent, the prefered parent is not the trunk, and the
	# prefered parent is a possible parent per the tag's file ().

	foreach {id fid lod pid preferedname revnr} [state run {
	    SELECT T.tid, T.fid, T.lod, P.pid, S.name, R.rev
	    FROM tag T, preferedparent P, symbol S, revision R
	    WHERE T.sid = P.sid
	    AND   T.lod != P.pid
	    AND   P.pid = S.sid
	    AND   S.name != ':trunk:'
	    AND   T.rev = R.rid	
	    AND   P.pid IN (SELECT B.sid FROM branch B WHERE B.root = R.rid)
	}] {
	    # The names for use in the log output are retrieved
	    # separately, to keep the join selecting the adjustable
	    # tags small, not burdened with the dereferencing of links
	    # to name.

	    set tagname [lindex [state run {
		SELECT S.name FROM tag T, symbol S WHERE T.sid = S.sid AND T.tid = $id
	    }] 0]
	    set oldname [lindex [state run {
		SELECT L.name FROM symbol L WHERE L.sid = $lod
	    }] 0]
	    struct::list assign [state run {
		SELECT F.name, P.name
		FROM file F, project P
		WHERE F.fid = $fid AND F.pid = P.pid
	    }] fname prname

	    # Do the grafting.

	    log write 3 filtersym "$prname : Grafting tag '$tagname' on $fname/$revnr from '$oldname' onto '$preferedname'"
	    state run {
		UPDATE tag SET lod = $pid WHERE tid = $id ;
	    }
	}
	return
    }

    proc AdjustBranchParents {} {
	log write 3 filtersym "Adjust branch parents"
	return
    }

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

    pragma -hasinstances   no ; # singleton
    pragma -hastypeinfo    no ; # no introspection
    pragma -hastypedestroy no ; # immortal