Fossil SCM

Cycle breaker, API change. The changesets are now communicated via a retrieval callback instead of directly. Updated passes 6 and 7. This allowed us to move the start/done graph exports into the cyclebreaker as well. Changeset selection in pass 8 now in separate command too for this.

aku 2007-11-21 04:36 trunk
Commit 2a0ec504c5d4e843a0e9ff637dbe025af7a85d0b
--- tools/cvs2fossil/lib/c2f_cyclebreaker.tcl
+++ tools/cvs2fossil/lib/c2f_cyclebreaker.tcl
@@ -66,11 +66,11 @@
6666
return
6767
}
6868
6969
# # ## ### ##### ######## #############
7070
71
- typemethod run {label changesets} {
71
+ typemethod run {label changesetcmd} {
7272
::variable myat 0
7373
::variable mydotprefix $label
7474
::variable mydotid 0
7575
7676
# We create a graph of the revision changesets, using the file
@@ -79,10 +79,11 @@
7979
# in that graph and break them.
8080
8181
# 1. Create nodes for all relevant changesets and a mapping
8282
# from the revisions to their changesets/nodes.
8383
84
+ set changesets [uplevel #0 $changesetcmd]
8485
set dg [Setup $changesets]
8586
8687
# 3. Lastly we iterate the graph topologically. We mark off
8788
# the nodes which have no predecessors, in order from
8889
# oldest to youngest, saving and removing dependencies. If
@@ -103,14 +104,24 @@
103104
104105
BreakCycleHook $dg
105106
InitializeCandidates $dg
106107
}
107108
108
- dg destroy
109
+ $dg destroy
109110
110111
log write 3 cyclebreaker Done.
111112
ClearHooks
113
+
114
+ # Reread the graph and dump its final form, if graph export
115
+ # was activated.
116
+
117
+ ::variable mydotdestination
118
+ if {$mydotdestination eq ""} return
119
+
120
+ set dg [Setup [uplevel #0 $changesetcmd] 0]
121
+ Mark $dg -done
122
+ $dg destroy
112123
return
113124
}
114125
115126
# # ## ### ##### ######## #############
116127
@@ -153,12 +164,13 @@
153164
}
154165
155166
# Run the user hook to manipulate the graph before
156167
# consummation.
157168
169
+ if {$log} { Mark $dg -start }
158170
PreHook $dg
159
- return $dg
171
+ return $dg
160172
}
161173
162174
# Instead of searching the whole graph for the degree-0 nodes in
163175
# each iteration we compute the list once to start, and then only
164176
# update it incrementally based on the outgoing neighbours of the
@@ -357,10 +369,11 @@
357369
358370
::variable myprecmd
359371
if {![llength $myprecmd]} return
360372
361373
uplevel #0 [linsert $myprecmd end $graph]
374
+ Mark $graph -pre-done
362375
return
363376
}
364377
365378
proc ProcessedHook {cset pos} {
366379
# Give the user of the cycle breaker the opportunity to work
367380
--- tools/cvs2fossil/lib/c2f_cyclebreaker.tcl
+++ tools/cvs2fossil/lib/c2f_cyclebreaker.tcl
@@ -66,11 +66,11 @@
66 return
67 }
68
69 # # ## ### ##### ######## #############
70
71 typemethod run {label changesets} {
72 ::variable myat 0
73 ::variable mydotprefix $label
74 ::variable mydotid 0
75
76 # We create a graph of the revision changesets, using the file
@@ -79,10 +79,11 @@
79 # in that graph and break them.
80
81 # 1. Create nodes for all relevant changesets and a mapping
82 # from the revisions to their changesets/nodes.
83
 
84 set dg [Setup $changesets]
85
86 # 3. Lastly we iterate the graph topologically. We mark off
87 # the nodes which have no predecessors, in order from
88 # oldest to youngest, saving and removing dependencies. If
@@ -103,14 +104,24 @@
103
104 BreakCycleHook $dg
105 InitializeCandidates $dg
106 }
107
108 dg destroy
109
110 log write 3 cyclebreaker Done.
111 ClearHooks
 
 
 
 
 
 
 
 
 
 
112 return
113 }
114
115 # # ## ### ##### ######## #############
116
@@ -153,12 +164,13 @@
153 }
154
155 # Run the user hook to manipulate the graph before
156 # consummation.
157
 
158 PreHook $dg
159 return $dg
160 }
161
162 # Instead of searching the whole graph for the degree-0 nodes in
163 # each iteration we compute the list once to start, and then only
164 # update it incrementally based on the outgoing neighbours of the
@@ -357,10 +369,11 @@
357
358 ::variable myprecmd
359 if {![llength $myprecmd]} return
360
361 uplevel #0 [linsert $myprecmd end $graph]
 
362 return
363 }
364
365 proc ProcessedHook {cset pos} {
366 # Give the user of the cycle breaker the opportunity to work
367
--- tools/cvs2fossil/lib/c2f_cyclebreaker.tcl
+++ tools/cvs2fossil/lib/c2f_cyclebreaker.tcl
@@ -66,11 +66,11 @@
66 return
67 }
68
69 # # ## ### ##### ######## #############
70
71 typemethod run {label changesetcmd} {
72 ::variable myat 0
73 ::variable mydotprefix $label
74 ::variable mydotid 0
75
76 # We create a graph of the revision changesets, using the file
@@ -79,10 +79,11 @@
79 # in that graph and break them.
80
81 # 1. Create nodes for all relevant changesets and a mapping
82 # from the revisions to their changesets/nodes.
83
84 set changesets [uplevel #0 $changesetcmd]
85 set dg [Setup $changesets]
86
87 # 3. Lastly we iterate the graph topologically. We mark off
88 # the nodes which have no predecessors, in order from
89 # oldest to youngest, saving and removing dependencies. If
@@ -103,14 +104,24 @@
104
105 BreakCycleHook $dg
106 InitializeCandidates $dg
107 }
108
109 $dg destroy
110
111 log write 3 cyclebreaker Done.
112 ClearHooks
113
114 # Reread the graph and dump its final form, if graph export
115 # was activated.
116
117 ::variable mydotdestination
118 if {$mydotdestination eq ""} return
119
120 set dg [Setup [uplevel #0 $changesetcmd] 0]
121 Mark $dg -done
122 $dg destroy
123 return
124 }
125
126 # # ## ### ##### ######## #############
127
@@ -153,12 +164,13 @@
164 }
165
166 # Run the user hook to manipulate the graph before
167 # consummation.
168
169 if {$log} { Mark $dg -start }
170 PreHook $dg
171 return $dg
172 }
173
174 # Instead of searching the whole graph for the degree-0 nodes in
175 # each iteration we compute the list once to start, and then only
176 # update it incrementally based on the outgoing neighbours of the
@@ -357,10 +369,11 @@
369
370 ::variable myprecmd
371 if {![llength $myprecmd]} return
372
373 uplevel #0 [linsert $myprecmd end $graph]
374 Mark $graph -pre-done
375 return
376 }
377
378 proc ProcessedHook {cset pos} {
379 # Give the user of the cycle breaker the opportunity to work
380
--- tools/cvs2fossil/lib/c2f_pbreakacycle.tcl
+++ tools/cvs2fossil/lib/c2f_pbreakacycle.tcl
@@ -58,11 +58,11 @@
5858
typemethod run {} {
5959
# Pass manager interface. Executed to perform the
6060
# functionality of the pass.
6161
6262
set changesets [project::rev all]
63
- cyclebreaker dot break-all-start $changesets
63
+ #cyclebreaker dot break-all-start $changesets
6464
6565
return
6666
}
6767
6868
typemethod discard {} {
@@ -72,10 +72,12 @@
7272
return
7373
}
7474
7575
# # ## ### ##### ######## #############
7676
## Internal methods
77
+
78
+ proc Changesets {} { project::rev all }
7779
7880
# # ## ### ##### ######## #############
7981
## Configuration
8082
8183
pragma -hasinstances no ; # singleton
8284
--- tools/cvs2fossil/lib/c2f_pbreakacycle.tcl
+++ tools/cvs2fossil/lib/c2f_pbreakacycle.tcl
@@ -58,11 +58,11 @@
58 typemethod run {} {
59 # Pass manager interface. Executed to perform the
60 # functionality of the pass.
61
62 set changesets [project::rev all]
63 cyclebreaker dot break-all-start $changesets
64
65 return
66 }
67
68 typemethod discard {} {
@@ -72,10 +72,12 @@
72 return
73 }
74
75 # # ## ### ##### ######## #############
76 ## Internal methods
 
 
77
78 # # ## ### ##### ######## #############
79 ## Configuration
80
81 pragma -hasinstances no ; # singleton
82
--- tools/cvs2fossil/lib/c2f_pbreakacycle.tcl
+++ tools/cvs2fossil/lib/c2f_pbreakacycle.tcl
@@ -58,11 +58,11 @@
58 typemethod run {} {
59 # Pass manager interface. Executed to perform the
60 # functionality of the pass.
61
62 set changesets [project::rev all]
63 #cyclebreaker dot break-all-start $changesets
64
65 return
66 }
67
68 typemethod discard {} {
@@ -72,10 +72,12 @@
72 return
73 }
74
75 # # ## ### ##### ######## #############
76 ## Internal methods
77
78 proc Changesets {} { project::rev all }
79
80 # # ## ### ##### ######## #############
81 ## Configuration
82
83 pragma -hasinstances no ; # singleton
84
--- tools/cvs2fossil/lib/c2f_pbreakrcycle.tcl
+++ tools/cvs2fossil/lib/c2f_pbreakrcycle.tcl
@@ -72,22 +72,17 @@
7272
7373
typemethod run {} {
7474
# Pass manager interface. Executed to perform the
7575
# functionality of the pass.
7676
77
- set changesets [Changesets]
78
- cyclebreaker dot break-rev-start $changesets
79
-
8077
cyclebreaker savecmd [myproc SaveOrder]
8178
cyclebreaker breakcmd {::vc::fossil::import::cvs::cyclebreaker break}
8279
8380
state transaction {
84
- cyclebreaker run break-rev $changesets
81
+ cyclebreaker run break-rev [myproc Changesets]
8582
}
8683
87
- cyclebreaker dot break-rev-done [Changesets]
88
-
8984
repository printcsetstatistics
9085
return
9186
}
9287
9388
typemethod discard {} {
9489
--- tools/cvs2fossil/lib/c2f_pbreakrcycle.tcl
+++ tools/cvs2fossil/lib/c2f_pbreakrcycle.tcl
@@ -72,22 +72,17 @@
72
73 typemethod run {} {
74 # Pass manager interface. Executed to perform the
75 # functionality of the pass.
76
77 set changesets [Changesets]
78 cyclebreaker dot break-rev-start $changesets
79
80 cyclebreaker savecmd [myproc SaveOrder]
81 cyclebreaker breakcmd {::vc::fossil::import::cvs::cyclebreaker break}
82
83 state transaction {
84 cyclebreaker run break-rev $changesets
85 }
86
87 cyclebreaker dot break-rev-done [Changesets]
88
89 repository printcsetstatistics
90 return
91 }
92
93 typemethod discard {} {
94
--- tools/cvs2fossil/lib/c2f_pbreakrcycle.tcl
+++ tools/cvs2fossil/lib/c2f_pbreakrcycle.tcl
@@ -72,22 +72,17 @@
72
73 typemethod run {} {
74 # Pass manager interface. Executed to perform the
75 # functionality of the pass.
76
 
 
 
77 cyclebreaker savecmd [myproc SaveOrder]
78 cyclebreaker breakcmd {::vc::fossil::import::cvs::cyclebreaker break}
79
80 state transaction {
81 cyclebreaker run break-rev [myproc Changesets]
82 }
83
 
 
84 repository printcsetstatistics
85 return
86 }
87
88 typemethod discard {} {
89
--- tools/cvs2fossil/lib/c2f_pbreakscycle.tcl
+++ tools/cvs2fossil/lib/c2f_pbreakscycle.tcl
@@ -60,21 +60,16 @@
6060
6161
typemethod run {} {
6262
# Pass manager interface. Executed to perform the
6363
# functionality of the pass.
6464
65
- set changesets [Changesets]
66
- cyclebreaker dot break-sym-start $changesets
67
-
6865
cyclebreaker breakcmd {::vc::fossil::import::cvs::cyclebreaker break}
6966
7067
state transaction {
71
- cyclebreaker run break-sym $changesets
68
+ cyclebreaker run break-sym [myproc Changesets]
7269
}
7370
74
- cyclebreaker dot break-sym-done [Changesets]
75
-
7671
repository printcsetstatistics
7772
return
7873
}
7974
8075
typemethod discard {} {
8176
--- tools/cvs2fossil/lib/c2f_pbreakscycle.tcl
+++ tools/cvs2fossil/lib/c2f_pbreakscycle.tcl
@@ -60,21 +60,16 @@
60
61 typemethod run {} {
62 # Pass manager interface. Executed to perform the
63 # functionality of the pass.
64
65 set changesets [Changesets]
66 cyclebreaker dot break-sym-start $changesets
67
68 cyclebreaker breakcmd {::vc::fossil::import::cvs::cyclebreaker break}
69
70 state transaction {
71 cyclebreaker run break-sym $changesets
72 }
73
74 cyclebreaker dot break-sym-done [Changesets]
75
76 repository printcsetstatistics
77 return
78 }
79
80 typemethod discard {} {
81
--- tools/cvs2fossil/lib/c2f_pbreakscycle.tcl
+++ tools/cvs2fossil/lib/c2f_pbreakscycle.tcl
@@ -60,21 +60,16 @@
60
61 typemethod run {} {
62 # Pass manager interface. Executed to perform the
63 # functionality of the pass.
64
 
 
 
65 cyclebreaker breakcmd {::vc::fossil::import::cvs::cyclebreaker break}
66
67 state transaction {
68 cyclebreaker run break-sym [myproc Changesets]
69 }
70
 
 
71 repository printcsetstatistics
72 return
73 }
74
75 typemethod discard {} {
76

Keyboard Shortcuts

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