Fossil

Check-in [383c10f0]
Login

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

Overview
Comment:Merged bugfix [b3d61d7829] into this semi-abandoned branch just in case we will work on it again. Do it now instead of forgetting it later.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | trunk
Files: files | file ages | folders
SHA1: 383c10f0048f1b5896dc6410cebcfeb8b525e17c
User & Date: aku 2008-02-23 06:37:54
References
2008-10-26
04:44 New ticket [d0a7fc67] fossil crashes with assert() if non-existant sha identifier picked for checkout. artifact: 3023be13 user: anonymous
Context
2008-02-23
06:37
Merged bugfix [b3d61d7829] into this semi-abandoned branch just in case we will work on it again. Do it now instead of forgetting it later. Closed-Leaf check-in: 383c10f0 user: aku tags: trunk
06:33
Fixed bug made in [f46458d5bd] which prevented the saving of the changesets generated by the breaking of the internal dependencies. check-in: b3d61d78 user: aku tags: trunk
2008-02-20
06:03
Modified the changeset class to move handling of the changeset lists to fully after their creation and storage. This is item (3) in cvsfossil.txt. The results do not satisfy however. During the creation of each changeset memory usage is (fractonally) lower, however at the end, after all changesets haven been loaded memory usage is consistently higher. The reason for that is not known. I am saving this for possible future evolution and usage, but will not pursue this further right now. The gains seem to be too small compared to the overall loss. InitializeBreakstate is likely a better target, despite its complexity. check-in: faf57d74 user: aku tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

209
210
211
212
213
214
215
216
217
218

219
220
221
222
223
224
225
...
228
229
230
231
232
233
234
235
236
237

238
239
240
241
242
243
244
		if {[llength $revisions]} {
		    incr n
		    set  p [repository projectof $lastproject]
		    log write 14 initcsets meta_cset_begin
		    mem::mark
		    set cset [project::rev %AUTO% $p rev $lastmeta $revisions]
		    log write 14 initcsets meta_cset_done
		    $cset breakinternaldependencies nx
		    $cset persist
		    $cset destroy

		    mem::mark
		    set revisions {}
		}
		set lastmeta    $mid
		set lastproject $pid
	    }
	    lappend revisions $rid
................................................................................
	if {[llength $revisions]} {
	    incr n
	    set  p [repository projectof $lastproject]
	    log write 14 initcsets meta_cset_begin
	    mem::mark
	    set cset [project::rev %AUTO% $p rev $lastmeta $revisions]
	    log write 14 initcsets meta_cset_done
	    $cset breakinternaldependencies nx
	    $cset persist
	    $cset destroy

	    mem::mark
	}

	log write 14 initcsets meta_done
	mem::mark

	log write 4 initcsets "Created and saved [nsp $n {revision changeset}]"







|


>







 







|


>







209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
...
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
		if {[llength $revisions]} {
		    incr n
		    set  p [repository projectof $lastproject]
		    log write 14 initcsets meta_cset_begin
		    mem::mark
		    set cset [project::rev %AUTO% $p rev $lastmeta $revisions]
		    log write 14 initcsets meta_cset_done
		    set spawned [$cset breakinternaldependencies nx]
		    $cset persist
		    $cset destroy
		    foreach cset $spawned { $cset persist ; $cset destroy }
		    mem::mark
		    set revisions {}
		}
		set lastmeta    $mid
		set lastproject $pid
	    }
	    lappend revisions $rid
................................................................................
	if {[llength $revisions]} {
	    incr n
	    set  p [repository projectof $lastproject]
	    log write 14 initcsets meta_cset_begin
	    mem::mark
	    set cset [project::rev %AUTO% $p rev $lastmeta $revisions]
	    log write 14 initcsets meta_cset_done
	    set spawned [$cset breakinternaldependencies nx]
	    $cset persist
	    $cset destroy
	    foreach cset $spawned { $cset persist ; $cset destroy }
	    mem::mark
	}

	log write 14 initcsets meta_done
	mem::mark

	log write 4 initcsets "Created and saved [nsp $n {revision changeset}]"

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

196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
...
302
303
304
305
306
307
308

309
310
311
312
313
314
315
...
316
317
318
319
320
321
322

323
324
325
326
327
328
329
...
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355

	# Array of dependencies (parent -> child). This is pulled from
	# the state, and limited to successors within the changeset.

	array set dependencies {}
	$mytypeobj internalsuccessors dependencies $myitems
	if {![array size dependencies]} {
	    return 0
	} ; # Nothing to break.

	log write 5 csets ...[$self str].......................................................
	vc::tools::mem::mark

	# We have internal dependencies to break. We now iterate over
	# all positions in the list (which is chronological, at least
................................................................................
	    log write 8 csets {MAP- item <$key> $self = [$self str]}
	}

	# Create changesets for the fragments, reusing the current one
	# for the first fragment. We sort them in order to allow
	# checking for gaps and nice messages.


	set fragments [lsort -index 0 -integer $fragments]

	#puts \t.[join [PRs $fragments] .\n\t.].

	Border [lindex $fragments 0] firsts firste

	integrity assert {$firsts == 0} {Bad fragment start @ $firsts, gap, or before beginning of the range}
................................................................................

	set laste $firste
	foreach fragment [lrange $fragments 1 end] {
	    Border $fragment s e
	    integrity assert {$laste == ($s - 1)} {Bad fragment border <$laste | $s>, gap or overlap}

	    set new [$type %AUTO% $myproject $mytype $mysrcid [lrange $myitems $s $e]]

	    incr counter

            log write 4 csets "Breaking [$self str ] @ $laste, new [$new str], cutting $breaks($laste)"

	    set laste $e
	}

................................................................................
	set mytitems [lrange $mytitems 0 $firste]
	foreach iid $myitems {
	    set key [list $mytype $iid]
	    #set myitemmap($key) $self
	    log write 8 csets {MAP+ item <$key> $self = [$self str]}
	}

	return 1
    }

    method persist {} {
	set tid $mycstype($mytype)
	set pid [$myproject id]
	set pos 0








|







 







>







 







>







 







|







196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
...
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
...
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
...
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357

	# Array of dependencies (parent -> child). This is pulled from
	# the state, and limited to successors within the changeset.

	array set dependencies {}
	$mytypeobj internalsuccessors dependencies $myitems
	if {![array size dependencies]} {
	    return {}
	} ; # Nothing to break.

	log write 5 csets ...[$self str].......................................................
	vc::tools::mem::mark

	# We have internal dependencies to break. We now iterate over
	# all positions in the list (which is chronological, at least
................................................................................
	    log write 8 csets {MAP- item <$key> $self = [$self str]}
	}

	# Create changesets for the fragments, reusing the current one
	# for the first fragment. We sort them in order to allow
	# checking for gaps and nice messages.

	set newcsets  {}
	set fragments [lsort -index 0 -integer $fragments]

	#puts \t.[join [PRs $fragments] .\n\t.].

	Border [lindex $fragments 0] firsts firste

	integrity assert {$firsts == 0} {Bad fragment start @ $firsts, gap, or before beginning of the range}
................................................................................

	set laste $firste
	foreach fragment [lrange $fragments 1 end] {
	    Border $fragment s e
	    integrity assert {$laste == ($s - 1)} {Bad fragment border <$laste | $s>, gap or overlap}

	    set new [$type %AUTO% $myproject $mytype $mysrcid [lrange $myitems $s $e]]
	    lappend newcsets $new
	    incr counter

            log write 4 csets "Breaking [$self str ] @ $laste, new [$new str], cutting $breaks($laste)"

	    set laste $e
	}

................................................................................
	set mytitems [lrange $mytitems 0 $firste]
	foreach iid $myitems {
	    set key [list $mytype $iid]
	    #set myitemmap($key) $self
	    log write 8 csets {MAP+ item <$key> $self = [$self str]}
	}

	return $newcsets
    }

    method persist {} {
	set tid $mycstype($mytype)
	set pid [$myproject id]
	set pos 0