Fossil

Check-in [9214c118]
Login

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

Overview
Comment:Changeset handling, extended logging of how parent is determined. Fossil access, fixed importrev call to use correct workspace/repository. Fixed handling of output, stripping unwanted text, checking of output syntax. Extended logging. Added final 'rebuild'. NOTE: formation of the changesets/manifests is buggy, is not tracking unchanged files across changesets. Further not yet tracking when files have been removed.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9214c1183140fdbfec9a57640ba1f6fa9bf7c415
User & Date: aku 2008-02-02 07:03:39
Context
2008-02-02
07:33
Merged with mainline. check-in: dbdc1601 user: aku tags: trunk
07:03
Changeset handling, extended logging of how parent is determined. Fossil access, fixed importrev call to use correct workspace/repository. Fixed handling of output, stripping unwanted text, checking of output syntax. Extended logging. Added final 'rebuild'. NOTE: formation of the changesets/manifests is buggy, is not tracking unchanged files across changesets. Further not yet tracking when files have been removed. check-in: 9214c118 user: aku tags: trunk
06:49
Dropped primary key of temp table __im, record ids are not unique. Scenario: Several empty files. All have the same id, different paths. check-in: dfb6ee3b user: aku tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

34
35
36
37
38
39
40



41
42
43
44
45
46
47
...
111
112
113
114
115
116
117



118

119





120



121
122
123
124


125
126
127
128
129
130
131
	set myworkspace  [fileutil::tempfile cvs2fossil_wspc_]
	::file delete $myworkspace
	::file mkdir  $myworkspace

	Do new [::file nativename $myrepository]
	$self InWorkspace ; Do open [::file nativename $myrepository]
	$self RestorePwd



	return
    }

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

    method root {} {
................................................................................
	if {$parent ne ""} { lappend cmd -p $parent }
	foreach {frid fpath flabel} $revisions {
	    lappend cmd -f $frid $fpath
	    log write 2 fossil {** <[format %5d $frid]> = <$flabel>}
	}

	# run fossil test-command performing the import.



	set uuid [eval $cmd]







	log write 2 fossil {== $uuid}



	return $uuid
    }

    method finalize {destination} {


	::file rename -force $myrepository $destination
	::file delete -force $myworkspace
	$self destroy
	return
    }

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







>
>
>







 







>
>
>
|
>

>
>
>
>
>

>
>
>




>
>







34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
...
114
115
116
117
118
119
120
121
122
123
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
	set myworkspace  [fileutil::tempfile cvs2fossil_wspc_]
	::file delete $myworkspace
	::file mkdir  $myworkspace

	Do new [::file nativename $myrepository]
	$self InWorkspace ; Do open [::file nativename $myrepository]
	$self RestorePwd

	log write 8 fossil {scratch repository $myrepository}
	log write 8 fossil {scratch workspace  $myworkspace}
	return
    }

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

    method root {} {
................................................................................
	if {$parent ne ""} { lappend cmd -p $parent }
	foreach {frid fpath flabel} $revisions {
	    lappend cmd -f $frid $fpath
	    log write 2 fossil {** <[format %5d $frid]> = <$flabel>}
	}

	# run fossil test-command performing the import.
	log write 8 fossil {	[lreplace $cmd 3 3 @@]}

	$self InWorkspace
	set res [eval $cmd]
	$self RestorePwd

	integrity assert {
	    [regexp {^inserted as record \d+$} $res]
	} {Unable to process unexpected fossil output '$res'}
	set uuid [lindex $res 3]

	log write 2 fossil {== $uuid}
	log write 2 fossil { }
	log write 2 fossil { }

	return $uuid
    }

    method finalize {destination} {
	Do rebuild [::file nativename $myrepository]

	::file rename -force $myrepository $destination
	::file delete -force $myworkspace
	$self destroy
	return
    }

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

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

444
445
446
447
448
449
450








451
452
453
454
455
456
457
...
496
497
498
499
500
501
502
503



504
505
506
507
508
509
510
511
512
	return $revisions
    }

    proc Getparent {sv lodname project items} {
	upvar 1 $sv state

	struct::list assign [Getisdefault $items] isdefault lastdefaultontrunk









	# See (a) below, we have to remember if the changeset is last
	# on vendor branch also belonging to trunk even if we find a
	# parent in the state. The caller will later (after import)
	# make us the first trunk changeset in the state (See (**)).

	if {$lastdefaultontrunk} {
................................................................................
	    return {}
	}

	# Case (c). We find the parent LOD of our LOD and take the
	# last changeset committed to that as our parent. If that
	# doesn't exist we have an error on our hands.

	set lodname [[[$project getsymbol $lodname] parent] name]



	if {[info exists state($lodname)]} {
	    return $state($lodname)
	}

	trouble internal {Unable to determine changeset parent}
	return
    }

    proc Getisdefault {revisions} {







>
>
>
>
>
>
>
>







 







|
>
>
>
|
|







444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
...
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
	return $revisions
    }

    proc Getparent {sv lodname project items} {
	upvar 1 $sv state

	struct::list assign [Getisdefault $items] isdefault lastdefaultontrunk

	log write 8 csets {LOD    '$lodname'}
	log write 8 csets { def?  $isdefault}
	log write 8 csets { last? $lastdefaultontrunk}

	foreach k [lsort [array names state]] {
	    log write 8 csets {    $k = $state($k)}
	}

	# See (a) below, we have to remember if the changeset is last
	# on vendor branch also belonging to trunk even if we find a
	# parent in the state. The caller will later (after import)
	# make us the first trunk changeset in the state (See (**)).

	if {$lastdefaultontrunk} {
................................................................................
	    return {}
	}

	# Case (c). We find the parent LOD of our LOD and take the
	# last changeset committed to that as our parent. If that
	# doesn't exist we have an error on our hands.

	set plodname [[[$project getsymbol $lodname] parent] name]

	log write 8 csets {pLOD   '$plodname'}

	if {[info exists state($plodname)]} {
	    return $state($plodname)
	}

	trouble internal {Unable to determine changeset parent}
	return
    }

    proc Getisdefault {revisions} {