Fossil SCM

fossil-scm / tools / cvs2fossil / lib / c2f_pbreakrcycle.tcl
Blame History Raw 127 lines
1
## -*- tcl -*-
2
# # ## ### ##### ######## ############# #####################
3
## Copyright (c) 2007 Andreas Kupries.
4
#
5
# This software is licensed as described in the file LICENSE, which
6
# you should have received as part of this distribution.
7
#
8
# This software consists of voluntary contributions made by many
9
# individuals. For exact contribution history, see the revision
10
# history and logs, available at http://fossil-scm.hwaci.com/fossil
11
# # ## ### ##### ######## ############# #####################
12
13
## Pass VII. This pass goes over the set of revision based changesets
14
## and breaks all dependency cycles they may be in. We need a
15
## dependency tree. Identical to pass IX, except for the selection of
16
## the changesets.
17
18
# # ## ### ##### ######## ############# #####################
19
## Requirements
20
21
package require Tcl 8.4 ; # Required runtime.
22
package require snit ; # OO system.
23
package require struct::list ; # Higher order list operations.
24
package require vc::tools::log ; # User feedback.
25
package require vc::fossil::import::cvs::repository ; # Repository management.
26
package require vc::fossil::import::cvs::cyclebreaker ; # Breaking dependency cycles.
27
package require vc::fossil::import::cvs::state ; # State storage.
28
package require vc::fossil::import::cvs::integrity ; # State integrity checks.
29
package require vc::fossil::import::cvs::project::rev ; # Project level changesets
30
31
# # ## ### ##### ######## ############# #####################
32
## Register the pass with the management
33
34
vc::fossil::import::cvs::pass define \
35
BreakRevCsetCycles \
36
{Break Revision ChangeSet Dependency Cycles} \
37
::vc::fossil::import::cvs::pass::breakrcycle
38
39
# # ## ### ##### ######## ############# #####################
40
##
41
42
snit::type ::vc::fossil::import::cvs::pass::breakrcycle {
43
# # ## ### ##### ######## #############
44
## Public API
45
46
typemethod setup {} {
47
# Define the names and structure of the persistent state of
48
# this pass.
49
50
state use revision
51
state use symbol
52
state use changeset
53
state use csitem
54
state use cstype
55
state use cssuccessor
56
57
return
58
}
59
60
typemethod load {} {
61
# Pass manager interface. Executed to load data computed by
62
# this pass into memory when this pass is skipped instead of
63
# executed.
64
return
65
}
66
67
typemethod run {} {
68
# Pass manager interface. Executed to perform the
69
# functionality of the pass.
70
71
cyclebreaker breakcmd {::vc::fossil::import::cvs::cyclebreaker break}
72
73
state transaction {
74
cyclebreaker run break-rev [myproc Changesets]
75
}
76
77
repository printcsetstatistics
78
integrity changesets
79
return
80
}
81
82
typemethod discard {} {
83
# Pass manager interface. Executed for all passes after the
84
# run passes, to remove all data of this pass from the state,
85
# as being out of date.
86
return
87
}
88
89
# # ## ### ##### ######## #############
90
## Internal methods
91
92
proc Changesets {} {
93
log write 2 breakrcycle {Selecting the revision changesets}
94
return [project::rev rev]
95
}
96
97
# # ## ### ##### ######## #############
98
## Configuration
99
100
pragma -hasinstances no ; # singleton
101
pragma -hastypeinfo no ; # no introspection
102
pragma -hastypedestroy no ; # immortal
103
104
# # ## ### ##### ######## #############
105
}
106
107
namespace eval ::vc::fossil::import::cvs::pass {
108
namespace export breakrcycle
109
namespace eval breakrcycle {
110
namespace import ::vc::fossil::import::cvs::cyclebreaker
111
namespace import ::vc::fossil::import::cvs::repository
112
namespace import ::vc::fossil::import::cvs::state
113
namespace import ::vc::fossil::import::cvs::integrity
114
namespace eval project {
115
namespace import ::vc::fossil::import::cvs::project::rev
116
}
117
namespace import ::vc::tools::log
118
log register breakrcycle
119
}
120
}
121
122
# # ## ### ##### ######## ############# #####################
123
## Ready
124
125
package provide vc::fossil::import::cvs::pass::breakrcycle 1.0
126
return
127

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button