Fossil

Check-in [ae19c0fc]
Login

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

Overview
Comment:Extended pass manager to handle the skipped and defered passes coming before and after the actually executed passes. Extended passes I and II to have the required methods. Implemented loading (for skipped passes) as skeletons, implemented discarding (for defered passes) completely. Extended state manager with ability to discard state.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:ae19c0fcb4c72ed82a4bb6354cbbbced11aeed74
User & Date: aku 2007-10-13 23:29:17
Context
2007-10-13
23:57
Completed loading of pass I from persistent state when skipped. check-in: 54ac684d user: aku tags: trunk
23:42
For the record an alternative design for the main method of the pass manager where the four principal loops (skip, setup, run, and defer) are merged into two (skip/setup) and (run/defer). Not really less code, also more complex to understand and maintain. The fact that 'setup' and 'run' is performed for the same passes is more difficult to see. This code will not be used. Closed-Leaf check-in: 4df56a9e user: aku tags: trunk
23:29
Extended pass manager to handle the skipped and defered passes coming before and after the actually executed passes. Extended passes I and II to have the required methods. Implemented loading (for skipped passes) as skeletons, implemented discarding (for defered passes) completely. Extended state manager with ability to discard state. check-in: ae19c0fc user: aku tags: trunk
21:15
Extended pass I to capture the 'file executable' info of rcs archives. Currently the only way to store this info in the destination will be the use of fossil tags. check-in: 27470a93 user: aku tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

93
94
95
96
97
98
99
100
101
102
103
104
105
106
107








108
109
110
111
112
113
114
115
116




117
118
119
120
121
122
123
	    set mystart [Id $start]
	    set myend   $mystart
	}
    }

    typemethod run {} {
	if {$mystart < 0} {set mystart 0}
	if {$myend   < 0} {set myend end}

	set runlist [lrange $mypasses $mystart $myend]
	# TODO: Timing statistics for the passes.
	# TODO: Artifact manager (clean after pass?. need to know skipped/defered passes ?)
	# TODO: 
	# TODO: 









	foreach p $runlist {
	    log write 0 pass "Setup $p" 
	    Call $p setup
	}
	foreach p $runlist {
	    log write 0 pass "Begin $p" 
	    Call $p run
	    log write 0 pass "Done  $p"
	    trouble abort?




	}

	state release
	return
    }

    # # ## ### ##### ######## #############







|

<





>
>
>
>
>
>
>
>
|



|




>
>
>
>







93
94
95
96
97
98
99
100
101

102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
	    set mystart [Id $start]
	    set myend   $mystart
	}
    }

    typemethod run {} {
	if {$mystart < 0} {set mystart 0}
	if {$myend   < 0} {set myend [expr {[llength $mypasses] - 1}]}


	# TODO: Timing statistics for the passes.
	# TODO: Artifact manager (clean after pass?. need to know skipped/defered passes ?)
	# TODO: 
	# TODO: 

	set skipped [lrange $mypasses 0 [expr {$mystart - 1}]]
	set run     [lrange $mypasses $mystart $myend]
	set defered [lrange $mypasses [expr {$myend + 1}] end]

	foreach p $skipped {
	    log write 0 pass "Skip  $p" 
	    Call $p load
	}
	foreach p $run {
	    log write 0 pass "Setup $p" 
	    Call $p setup
	}
	foreach p $run {
	    log write 0 pass "Begin $p" 
	    Call $p run
	    log write 0 pass "Done  $p"
	    trouble abort?
	}
	foreach p $defered {
	    log write 0 pass "Defer $p" 
	    Call $p discard
	}

	state release
	return
    }

    # # ## ### ##### ######## #############

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

75
76
77
78
79
80
81
82










83



84
85
86
87
88
89
90
...
124
125
126
127
128
129
130










131
132
133
134
135
136
137
	    name    TEXT     NOT NULL,
	    visible TEXT     NOT NULL,
	    exec    INTEGER  NOT NULL, -- boolean, 'file executable'.
	    UNIQUE (pid, name)         -- file names are unique within a project
	}
	return
    }











    typemethod run {} {



	set rbase [repository base?]
	foreach project [repository projects] {
	    set base [file join $rbase [$project base]]
	    log write 1 collar "Scan $base"

	    set traverse [fileutil::traverse %AUTO% $base \
			      -prefilter [myproc FilterAtticSubdir $base]]
................................................................................

	repository printstatistics
	repository persist

	log write 1 collar "Scan completed"
	return
    }











    typemethod ignore_conflicting_attics {} {
	set myignore 1
	return
    }

    # # ## ### ##### ######## #############








>
>
>
>
>
>
>
>
>
>

>
>
>







 







>
>
>
>
>
>
>
>
>
>







75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
...
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
	    name    TEXT     NOT NULL,
	    visible TEXT     NOT NULL,
	    exec    INTEGER  NOT NULL, -- boolean, 'file executable'.
	    UNIQUE (pid, name)         -- file names are unique within a project
	}
	return
    }

    typemethod load {} {	
	# Pass manager interface. Executed for all passes before the
	# run passes, to load all data of their pass from the state,
	# as if it had been computed by the pass itself.

	state reading project
	state reading file
	return
    }

    typemethod run {} {
	# Pass manager interface. Executed to perform the
	# functionality of the pass.

	set rbase [repository base?]
	foreach project [repository projects] {
	    set base [file join $rbase [$project base]]
	    log write 1 collar "Scan $base"

	    set traverse [fileutil::traverse %AUTO% $base \
			      -prefilter [myproc FilterAtticSubdir $base]]
................................................................................

	repository printstatistics
	repository persist

	log write 1 collar "Scan completed"
	return
    }

    typemethod discard {} {
	# Pass manager interface. Executed for all passes after the
	# run passes, to remove all data of this pass from the state,
	# as being out of date.

	state discard project
	state discard file
	return
    }

    typemethod ignore_conflicting_attics {} {
	set myignore 1
	return
    }

    # # ## ### ##### ######## #############

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

178
179
180
181
182
183
184
185





186



187
188
189
190
191
192
193
...
208
209
210
211
212
213
214



















215
216
217
218
219
220
221
	# project. All refer to other items, and symbols, which again
	# belong to a project. The projects have to agree with each
	# other. I.e. items may not refer to items or symbols which
	# belong to a different project than their own.

	return
    }






    typemethod run {} {



	set rbase [repository base?]
	foreach project [repository projects] {
	    set base [file join $rbase [$project base]]
	    log write 1 collrev "Processing $base"

	    foreach file [$project files] {
		set path [$file path]
................................................................................

	repository printrevstatistics
	repository persistrev

	log write 1 collrev "Scan completed"
	return
    }




















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

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









>
>
>
>
>

>
>
>







 







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







178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
...
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
243
244
245
246
247
248
	# project. All refer to other items, and symbols, which again
	# belong to a project. The projects have to agree with each
	# other. I.e. items may not refer to items or symbols which
	# belong to a different project than their own.

	return
    }

    typemethod load {} {
	# TODO
	return
    }

    typemethod run {} {
	# Pass manager interface. Executed to perform the
	# functionality of the pass.

	set rbase [repository base?]
	foreach project [repository projects] {
	    set base [file join $rbase [$project base]]
	    log write 1 collrev "Processing $base"

	    foreach file [$project files] {
		set path [$file path]
................................................................................

	repository printrevstatistics
	repository persistrev

	log write 1 collrev "Scan completed"
	return
    }

    typemethod discard {} {
	# Pass manager interface. Executed for all passes after the
	# run passes, to remove all data of this pass from the state,
	# as being out of date.

	state discard rcs
	state discard item
	state discard revision
	state discard tag
	state discard branch
	state discard symbol
	state discard blocker
	state discard parent
	state discard meta
	state discard author
	state discard cmessage
	return
    }

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

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

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

124
125
126
127
128
129
130












131
132
133
134
135
136
137
	    ;
	}]]

	if {$found} return

	trouble internal "The required table \"$name\" is not defined."
	# Not reached












	return
    }

    typemethod run {args} {
	return [uplevel 1 [linsert $args 0 $mystate eval]]
    }








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







124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
	    ;
	}]]

	if {$found} return

	trouble internal "The required table \"$name\" is not defined."
	# Not reached
	return
    }

    typemethod discard {name} {
	# Method for a user to remove outdated information from the
	# persistent state, table by table.

	log write 0 state "discard $name" ; # TODO move to level 5 or so

	$mystate transaction {
	    catch { $mystate eval "DROP TABLE $name" }
	}
	return
    }

    typemethod run {args} {
	return [uplevel 1 [linsert $args 0 $mystate eval]]
    }