Fossil

Check-in [060513f2]
Login

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

Overview
Comment:Actually put the code for the new pass into the repository.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:060513f2a9d9794936741279999fb6266b03032f
User & Date: aku 2007-12-02 23:45:09
Context
2007-12-02
23:47
Fluff: Renamed state methods use/reading/writing to usedb/use/extend for clarity. Updated all callers. Extended state module with code to dump the SQL statements it receives to a file for analysis. Extended the 'use' declarations of several passes. check-in: e288af39 user: aku tags: trunk
23:45
Actually put the code for the new pass into the repository. check-in: 060513f2 user: aku tags: trunk
20:06
Importer Status...

Speed. This is now mostly acceptable. The one exception is pass 'BreakAllCsetCycles'. The reason is that the limit computation it does for backward branches still uses the inefficient file-level dependency computation. This will be tackled in short order. For the other passes the file spent is 'CsetsDeps' is recouped by the much faster graph setup.

Memory. This seems to be mostly acceptable as well, with the exceptions of 'BreakAllCsetCycles' (again, for reasons see above), and 'InitCsets'. It seems to happen while the pass breaks internal dependencies, but there is no hard data. I have to measure using a memory-debug enabled tclsh. I suspect either the actual internal dependencies, or the pseudo-dependencies. Maybe combined with a bad choice of data structures. Well, measuring first. check-in: e8c374f6 user: aku tags: trunk

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added tools/cvs2fossil/lib/c2f_pcsetdeps.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
## -*- tcl -*-
# # ## ### ##### ######## ############# #####################
## Copyright (c) 2007 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 VI. This pass computes the dependencies between the changeset
## from the file level dependencies and stores them in the state for
## use by the cycle breaker and topological sorting passes.

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

package require Tcl 8.4                               ; # Required runtime.
package require snit                                  ; # OO system.
package require vc::tools::misc                       ; # Text formatting.
package require vc::tools::log                        ; # User feedback.
package require vc::fossil::import::cvs::state        ; # State storage.
package require vc::fossil::import::cvs::project::rev ; # Project level changesets

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

vc::fossil::import::cvs::pass define \
    CsetDeps \
    {ChangeSet Dependencies} \
    ::vc::fossil::import::cvs::pass::csetdeps

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

snit::type ::vc::fossil::import::cvs::pass::csetdeps {
    # # ## ### ##### ######## #############
    ## 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 revisionbranchchildren
	state use branch
	state use tag
	state use symbol
	state use preferedparent
	state use changeset
	state use csitem

	# A table listing for each changeset the set of successor
	# changesets. The predecessor information is implied.

	state extend cssuccessor {
	    cid  INTEGER  NOT NULL  REFERENCES changeset,
	    nid  INTEGER  NOT NULL  REFERENCES changeset,
	    UNIQUE (cid,nid)
	} {cid nid}
	# Index on both columns for fast forward and back retrieval.
	return
    }

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

	state use cssuccessor
	return
    }

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

	set n   0
	set max [llength [project::rev all]]

	foreach cset [project::rev all] {
	    log progress 2 csetdeps $n $max
	    # NOTE: Consider to commit only every N calls.
	    state transaction {
		$cset determinesuccessors
	    }
	    incr n
	}
	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 cssuccessor
	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 csetdeps
    namespace eval csetdeps {
	namespace import ::vc::fossil::import::cvs::state
	namespace eval project {
	    namespace import ::vc::fossil::import::cvs::project::rev
	}
	namespace import ::vc::tools::misc::*
	namespace import ::vc::tools::log
	log register csetdeps
    }
}

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

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