1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
## -*- 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 VIII. This is the final pass for breaking changeset dependency
## cycles. The two previous passes broke cycles covering revision and
## symbol changesets, respectively. This pass now breaks any remaining
## cycles each of which has to contain at least one revision and at
## least one symbol changeset.
# # ## ### ##### ######## ############# #####################
## Requirements
package require Tcl 8.4 ; # Required runtime.
package require snit ; # OO system.
package require struct::list ; # Higher order list operations.
|
|
|
|
|
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
## -*- 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 IX. This is the final pass for breaking changeset dependency
## cycles. The previous breaker passes (6 and 8) broke cycles covering
## revision and symbol changesets, respectively. This pass now breaks
## any remaining cycles, each of which has to contain at least one
## revision and at least one symbol changeset.
# # ## ### ##### ######## ############# #####################
## Requirements
package require Tcl 8.4 ; # Required runtime.
package require snit ; # OO system.
package require struct::list ; # Higher order list operations.
|
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
}
typemethod run {} {
# Pass manager interface. Executed to perform the
# functionality of the pass.
cyclebreaker precmd [myproc BreakBackwardBranches]
cyclebreaker savecmd [myproc SaveOrder]
cyclebreaker breakcmd [myproc BreakCycle]
state transaction {
LoadCommitOrder
cyclebreaker run break-all [myproc Changesets]
}
|
<
|
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
}
typemethod run {} {
# Pass manager interface. Executed to perform the
# functionality of the pass.
cyclebreaker precmd [myproc BreakBackwardBranches]
cyclebreaker breakcmd [myproc BreakCycle]
state transaction {
LoadCommitOrder
cyclebreaker run break-all [myproc Changesets]
}
|
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
|
if {![llength $normalrevisions]} { trouble internal "Set of normal revisions is empty" }
if {![llength $backwardrevisions]} { trouble internal "Set of backward revisions is empty" }
return
}
# # ## ### ##### ######## #############
proc SaveOrder {graph at cset} {
set cid [$cset id]
log write 4 breakacycle "Comitting @ $at: [$cset str]"
state run {
INSERT INTO csorder (cid, pos)
VALUES ($cid, $at)
}
# MAYBE TODO: Write the project level changeset dependencies as well.
return
}
# # ## ### ##### ######## #############
proc BreakCycle {graph} {
cyclebreaker break $graph
}
# # ## ### ##### ######## #############
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
297
298
299
300
301
302
303
304
305
306
307
308
309
310
|
if {![llength $normalrevisions]} { trouble internal "Set of normal revisions is empty" }
if {![llength $backwardrevisions]} { trouble internal "Set of backward revisions is empty" }
return
}
# # ## ### ##### ######## #############
proc BreakCycle {graph} {
cyclebreaker break $graph
}
# # ## ### ##### ######## #############
|