Fossil

Check-in [479c96c0]
Login

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

Overview
Comment:Fixed typo in a comment.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:479c96c0fc60975d773568e321e53c31c71a6502
User & Date: aku 2008-03-02 01:06:32
Context
2008-03-02
01:07
Fixed typo in a comment, and extended the description of the pass to be more clear. check-in: e3e3d301 user: aku tags: trunk
01:06
Fixed typo in a comment. check-in: 479c96c0 user: aku tags: trunk
2008-02-27
08:00
Fix comment typo, and add comment about possible simplification. check-in: 83ecb5b9 user: aku tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234

	set excl [project::sym excluded]

	# Phase I: Pull the possible parents, using sorting to put the
	#          prefered parent of each symbol last among all
	#          candidates, allowing us get the prefered one by
	#          each candidate overwriting all previous
	#          selections. Note that we ignore excluded symbol, we
	#          do not care about their prefered parents and do not
	#          attempt to compute them.

	state foreachrow {
	    SELECT   S.sid   AS xs,
	             P.pid   AS xp,
	             S.name  AS sname,
	             SB.name AS pname,
	             PR.name AS prname,







|
|
|







218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234

	set excl [project::sym excluded]

	# Phase I: Pull the possible parents, using sorting to put the
	#          prefered parent of each symbol last among all
	#          candidates, allowing us get the prefered one by
	#          each candidate overwriting all previous
	#          selections. Note that we ignore excluded symbols,
	#          we do not care about their prefered parents and do
	#          not attempt to compute them.

	state foreachrow {
	    SELECT   S.sid   AS xs,
	             P.pid   AS xp,
	             S.name  AS sname,
	             SB.name AS pname,
	             PR.name AS prname,

Deleted tools/cvs2fossil/lib/c2f_pimport.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
## -*- tcl -*-
# # ## ### ##### ######## ############# #####################
## Copyright (c) 2007-2008 Andreas Kupries.
#
# This software is licensed as described in the file LICENSE, which
# you should have received as part of this distribution.
#
# This software consists of voluntary contributions made by many
# individuals.  For exact contribution history, see the revision
# history and logs, available at http://fossil-scm.hwaci.com/fossil
# # ## ### ##### ######## ############# #####################

## Pass XII. This is the first of the backend passes. It imports the
## changesets constructed by the previous passes, and all file
## revisions they refer to into one or more fossil repositories, one
## per project.

# # ## ### ##### ######## ############# #####################
## Requirements

package require Tcl 8.4                                   ; # Required runtime.
package require snit                                      ; # OO system.
package require vc::tools::log                            ; # User feedback.
package require vc::fossil::import::cvs::repository       ; # Repository management.
package require vc::fossil::import::cvs::state            ; # State storage.
package require vc::fossil::import::cvs::fossil           ; # Access to fossil repositories.
package require vc::fossil::import::cvs::ristate          ; # Import state (revisions)

# # ## ### ##### ######## ############# #####################
## Register the pass with the management

vc::fossil::import::cvs::pass define \
    Import \
    {Import the changesets and file revisions into fossil repositories} \
    ::vc::fossil::import::cvs::pass::import

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

snit::type ::vc::fossil::import::cvs::pass::import {
    # # ## ### ##### ######## #############
    ## Public API

    typemethod setup {} {
	# Define the names and structure of the persistent state of
	# this pass.

	state use project
	state use file
	state use revision
	state use meta
	state use author
	state use cmessage
	state use symbol

	# This data is actually transient, confined to this pass. We
	# use the state storage only to keep the RAM usage low.
	state extend revuuid {
	    rid   INTEGER NOT NULL  REFERENCES revision UNIQUE,
	    uuid  INTEGER NOT NULL  -- fossil id of the revision
	    --                         unique within the project
	}

	# This information is truly non-transient, needed by the next
	# pass adding the tags.

	state extend csuuid {
	    cid   INTEGER NOT NULL  REFERENCES changeset UNIQUE,
	    uuid  INTEGER NOT NULL  -- fossil id of the changeset
	    --                         unique within the project
	}
	return
    }

    typemethod load {} {
	# Pass manager interface. Executed to load data computed by
	# this pass into memory when this pass is skipped instead of
	# executed.
	return
    }

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

	foreach project [repository projects] {
	    log write 1 import {Importing project "[$project base]"}

	    set fossil [fossil %AUTO%]
	    set rstate [ristate %AUTO%]

	    state transaction {
		# Layer I: Files and their revisions
		foreach file [$project files] {
		    $file pushto $fossil
		}
		# Layer II: Changesets
		foreach {revision date} [$project revisionsinorder] {
		    $revision pushto $fossil $date $rstate
		}
	    }

	    $rstate destroy

	    # At last copy the temporary repository file to its final
	    # destination and release the associated memory.

	    set destination [$project base]
	    if {$destination eq ""} {
		set destination [file tail [repository base?]]
	    }
	    append destination .fsl

	    $fossil finalize $destination
	}

	# This does not live beyond the pass. We use the state for the
	# data despite its transient nature to keep the memory
	# requirements down.
	#state discard revuuid
	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.
	return
    }

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

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

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

    # # ## ### ##### ######## #############
}

namespace eval ::vc::fossil::import::cvs::pass {
    namespace export import
    namespace eval import {
	namespace import ::vc::fossil::import::cvs::repository
	namespace import ::vc::fossil::import::cvs::state
	namespace import ::vc::fossil::import::cvs::fossil
	namespace import ::vc::fossil::import::cvs::ristate
	namespace import ::vc::tools::log
	log register import
    }
}

# # ## ### ##### ######## ############# #####################
## Ready

package provide vc::fossil::import::cvs::pass::import 1.0
return
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<