Artifact 5bbb1492868c7bca67d2173b95c2df4ce213ce95:
File
tools/cvs2fossil/lib/c2f_pbreakacycle.tcl
part of check-in
[de4cff4142]
- Extended changeset class with in-memory database mapping from changeset ids to the proper object, and extended the objects with position information and associated accessors. Extended pass 8 to load the commit order computed in pass 6, this is stored in the new position slot of changesets, and an inverted index mapping from position to changeset at that position.
by
aku on
2007-11-22 03:21:43.
0000: 23 23 20 2d 2a 2d 20 74 63 6c 20 2d 2a 2d 0a 23 ## -*- tcl -*-.#
0010: 20 23 20 23 23 20 23 23 23 20 23 23 23 23 23 20 # ## ### #####
0020: 23 23 23 23 23 23 23 23 20 23 23 23 23 23 23 23 ######## #######
0030: 23 23 23 23 23 23 20 23 23 23 23 23 23 23 23 23 ###### #########
0040: 23 23 23 23 23 23 23 23 23 23 23 23 0a 23 23 20 ############.##
0050: 43 6f 70 79 72 69 67 68 74 20 28 63 29 20 32 30 Copyright (c) 20
0060: 30 37 20 41 6e 64 72 65 61 73 20 4b 75 70 72 69 07 Andreas Kupri
0070: 65 73 2e 0a 23 0a 23 20 54 68 69 73 20 73 6f 66 es..#.# This sof
0080: 74 77 61 72 65 20 69 73 20 6c 69 63 65 6e 73 65 tware is license
0090: 64 20 61 73 20 64 65 73 63 72 69 62 65 64 20 69 d as described i
00a0: 6e 20 74 68 65 20 66 69 6c 65 20 4c 49 43 45 4e n the file LICEN
00b0: 53 45 2c 20 77 68 69 63 68 0a 23 20 79 6f 75 20 SE, which.# you
00c0: 73 68 6f 75 6c 64 20 68 61 76 65 20 72 65 63 65 should have rece
00d0: 69 76 65 64 20 61 73 20 70 61 72 74 20 6f 66 20 ived as part of
00e0: 74 68 69 73 20 64 69 73 74 72 69 62 75 74 69 6f this distributio
00f0: 6e 2e 0a 23 0a 23 20 54 68 69 73 20 73 6f 66 74 n..#.# This soft
0100: 77 61 72 65 20 63 6f 6e 73 69 73 74 73 20 6f 66 ware consists of
0110: 20 76 6f 6c 75 6e 74 61 72 79 20 63 6f 6e 74 72 voluntary contr
0120: 69 62 75 74 69 6f 6e 73 20 6d 61 64 65 20 62 79 ibutions made by
0130: 20 6d 61 6e 79 0a 23 20 69 6e 64 69 76 69 64 75 many.# individu
0140: 61 6c 73 2e 20 20 46 6f 72 20 65 78 61 63 74 20 als. For exact
0150: 63 6f 6e 74 72 69 62 75 74 69 6f 6e 20 68 69 73 contribution his
0160: 74 6f 72 79 2c 20 73 65 65 20 74 68 65 20 72 65 tory, see the re
0170: 76 69 73 69 6f 6e 0a 23 20 68 69 73 74 6f 72 79 vision.# history
0180: 20 61 6e 64 20 6c 6f 67 73 2c 20 61 76 61 69 6c and logs, avail
0190: 61 62 6c 65 20 61 74 20 68 74 74 70 3a 2f 2f 66 able at http://f
01a0: 6f 73 73 69 6c 2d 73 63 6d 2e 68 77 61 63 69 2e ossil-scm.hwaci.
01b0: 63 6f 6d 2f 66 6f 73 73 69 6c 0a 23 20 23 20 23 com/fossil.# # #
01c0: 23 20 23 23 23 20 23 23 23 23 23 20 23 23 23 23 # ### ##### ####
01d0: 23 23 23 23 20 23 23 23 23 23 23 23 23 23 23 23 #### ###########
01e0: 23 23 20 23 23 23 23 23 23 23 23 23 23 23 23 23 ## #############
01f0: 23 23 23 23 23 23 23 23 0a 0a 23 23 20 50 61 73 ########..## Pas
0200: 73 20 56 49 49 49 2e 20 54 68 69 73 20 69 73 20 s VIII. This is
0210: 74 68 65 20 66 69 6e 61 6c 20 70 61 73 73 20 66 the final pass f
0220: 6f 72 20 62 72 65 61 6b 69 6e 67 20 63 68 61 6e or breaking chan
0230: 67 65 73 65 74 20 64 65 70 65 6e 64 65 6e 63 79 geset dependency
0240: 0a 23 23 20 63 79 63 6c 65 73 2e 20 54 68 65 20 .## cycles. The
0250: 74 77 6f 20 70 72 65 76 69 6f 75 73 20 70 61 73 two previous pas
0260: 73 65 73 20 62 72 6f 6b 65 20 63 79 63 6c 65 73 ses broke cycles
0270: 20 63 6f 76 65 72 69 6e 67 20 72 65 76 69 73 69 covering revisi
0280: 6f 6e 20 61 6e 64 0a 23 23 20 73 79 6d 62 6f 6c on and.## symbol
0290: 20 63 68 61 6e 67 65 73 65 74 73 2c 20 72 65 73 changesets, res
02a0: 70 65 63 74 69 76 65 6c 79 2e 20 54 68 69 73 20 pectively. This
02b0: 70 61 73 73 20 6e 6f 77 20 62 72 65 61 6b 73 20 pass now breaks
02c0: 61 6e 79 20 72 65 6d 61 69 6e 69 6e 67 0a 23 23 any remaining.##
02d0: 20 63 79 63 6c 65 73 20 65 61 63 68 20 6f 66 20 cycles each of
02e0: 77 68 69 63 68 20 68 61 73 20 74 6f 20 63 6f 6e which has to con
02f0: 74 61 69 6e 20 61 74 20 6c 65 61 73 74 20 6f 6e tain at least on
0300: 65 20 72 65 76 69 73 69 6f 6e 20 61 6e 64 20 61 e revision and a
0310: 74 0a 23 23 20 6c 65 61 73 74 20 6f 6e 65 20 73 t.## least one s
0320: 79 6d 62 6f 6c 20 63 68 61 6e 67 65 73 65 74 2e ymbol changeset.
0330: 0a 0a 23 20 23 20 23 23 20 23 23 23 20 23 23 23 ..# # ## ### ###
0340: 23 23 20 23 23 23 23 23 23 23 23 20 23 23 23 23 ## ######## ####
0350: 23 23 23 23 23 23 23 23 23 20 23 23 23 23 23 23 ######### ######
0360: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 0a ###############.
0370: 23 23 20 52 65 71 75 69 72 65 6d 65 6e 74 73 0a ## Requirements.
0380: 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 .package require
0390: 20 54 63 6c 20 38 2e 34 20 20 20 20 20 20 20 20 Tcl 8.4
03a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
03b0: 20 20 20 20 20 20 20 20 20 20 20 3b 20 23 20 52 ; # R
03c0: 65 71 75 69 72 65 64 20 72 75 6e 74 69 6d 65 2e equired runtime.
03d0: 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 .package require
03e0: 20 73 6e 69 74 20 20 20 20 20 20 20 20 20 20 20 snit
03f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0400: 20 20 20 20 20 20 20 20 20 20 20 3b 20 23 20 4f ; # O
0410: 4f 20 73 79 73 74 65 6d 2e 0a 70 61 63 6b 61 67 O system..packag
0420: 65 20 72 65 71 75 69 72 65 20 73 74 72 75 63 74 e require struct
0430: 3a 3a 6c 69 73 74 20 20 20 20 20 20 20 20 20 20 ::list
0440: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0450: 20 20 20 20 3b 20 23 20 48 69 67 68 65 72 20 6f ; # Higher o
0460: 72 64 65 72 20 6c 69 73 74 20 6f 70 65 72 61 74 rder list operat
0470: 69 6f 6e 73 2e 0a 70 61 63 6b 61 67 65 20 72 65 ions..package re
0480: 71 75 69 72 65 20 76 63 3a 3a 74 6f 6f 6c 73 3a quire vc::tools:
0490: 3a 6c 6f 67 20 20 20 20 20 20 20 20 20 20 20 20 :log
04a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
04b0: 3b 20 23 20 55 73 65 72 20 66 65 65 64 62 61 63 ; # User feedbac
04c0: 6b 2e 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 k..package requi
04d0: 72 65 20 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 re vc::fossil::i
04e0: 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 72 65 70 6f mport::cvs::repo
04f0: 73 69 74 6f 72 79 20 20 20 20 20 20 20 3b 20 23 sitory ; #
0500: 20 52 65 70 6f 73 69 74 6f 72 79 20 6d 61 6e 61 Repository mana
0510: 67 65 6d 65 6e 74 2e 0a 70 61 63 6b 61 67 65 20 gement..package
0520: 72 65 71 75 69 72 65 20 76 63 3a 3a 66 6f 73 73 require vc::foss
0530: 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a il::import::cvs:
0540: 3a 63 79 63 6c 65 62 72 65 61 6b 65 72 20 20 20 :cyclebreaker
0550: 20 20 3b 20 23 20 42 72 65 61 6b 69 6e 67 20 64 ; # Breaking d
0560: 65 70 65 6e 64 65 6e 63 79 20 63 79 63 6c 65 73 ependency cycles
0570: 2e 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 ..package requir
0580: 65 20 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d e vc::fossil::im
0590: 70 6f 72 74 3a 3a 63 76 73 3a 3a 73 74 61 74 65 port::cvs::state
05a0: 20 20 20 20 20 20 20 20 20 20 20 20 3b 20 23 20 ; #
05b0: 53 74 61 74 65 20 73 74 6f 72 61 67 65 2e 0a 70 State storage..p
05c0: 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 76 ackage require v
05d0: 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 c::fossil::impor
05e0: 74 3a 3a 63 76 73 3a 3a 70 72 6f 6a 65 63 74 3a t::cvs::project:
05f0: 3a 72 65 76 20 20 20 20 20 3b 20 23 20 50 72 6f :rev ; # Pro
0600: 6a 65 63 74 20 6c 65 76 65 6c 20 63 68 61 6e 67 ject level chang
0610: 65 73 65 74 73 0a 0a 23 20 23 20 23 23 20 23 23 esets..# # ## ##
0620: 23 20 23 23 23 23 23 20 23 23 23 23 23 23 23 23 # ##### ########
0630: 20 23 23 23 23 23 23 23 23 23 23 23 23 23 20 23 ############# #
0640: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
0650: 23 23 23 23 0a 23 23 20 52 65 67 69 73 74 65 72 ####.## Register
0660: 20 74 68 65 20 70 61 73 73 20 77 69 74 68 20 74 the pass with t
0670: 68 65 20 6d 61 6e 61 67 65 6d 65 6e 74 0a 0a 76 he management..v
0680: 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 c::fossil::impor
0690: 74 3a 3a 63 76 73 3a 3a 70 61 73 73 20 64 65 66 t::cvs::pass def
06a0: 69 6e 65 20 5c 0a 20 20 20 20 42 72 65 61 6b 41 ine \. BreakA
06b0: 6c 6c 43 73 65 74 43 79 63 6c 65 73 20 5c 0a 20 llCsetCycles \.
06c0: 20 20 20 7b 42 72 65 61 6b 20 52 65 6d 61 69 6e {Break Remain
06d0: 69 6e 67 20 43 68 61 6e 67 65 53 65 74 20 44 65 ing ChangeSet De
06e0: 70 65 6e 64 65 6e 63 79 20 43 79 63 6c 65 73 7d pendency Cycles}
06f0: 20 5c 0a 20 20 20 20 3a 3a 76 63 3a 3a 66 6f 73 \. ::vc::fos
0700: 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 sil::import::cvs
0710: 3a 3a 70 61 73 73 3a 3a 62 72 65 61 6b 61 63 79 ::pass::breakacy
0720: 63 6c 65 0a 0a 23 20 23 20 23 23 20 23 23 23 20 cle..# # ## ###
0730: 23 23 23 23 23 20 23 23 23 23 23 23 23 23 20 23 ##### ######## #
0740: 23 23 23 23 23 23 23 23 23 23 23 23 20 23 23 23 ############ ###
0750: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
0760: 23 23 0a 23 23 20 0a 0a 73 6e 69 74 3a 3a 74 79 ##.## ..snit::ty
0770: 70 65 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a pe ::vc::fossil:
0780: 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 70 61 :import::cvs::pa
0790: 73 73 3a 3a 62 72 65 61 6b 61 63 79 63 6c 65 20 ss::breakacycle
07a0: 7b 0a 20 20 20 20 23 20 23 20 23 23 20 23 23 23 {. # # ## ###
07b0: 20 23 23 23 23 23 20 23 23 23 23 23 23 23 23 20 ##### ########
07c0: 23 23 23 23 23 23 23 23 23 23 23 23 23 0a 20 20 #############.
07d0: 20 20 23 23 20 50 75 62 6c 69 63 20 41 50 49 0a ## Public API.
07e0: 0a 20 20 20 20 74 79 70 65 6d 65 74 68 6f 64 20 . typemethod
07f0: 73 65 74 75 70 20 7b 7d 20 7b 0a 09 23 20 44 65 setup {} {..# De
0800: 66 69 6e 65 20 74 68 65 20 6e 61 6d 65 73 20 61 fine the names a
0810: 6e 64 20 73 74 72 75 63 74 75 72 65 20 6f 66 20 nd structure of
0820: 74 68 65 20 70 65 72 73 69 73 74 65 6e 74 20 73 the persistent s
0830: 74 61 74 65 20 6f 66 0a 09 23 20 74 68 69 73 20 tate of..# this
0840: 70 61 73 73 2e 0a 0a 09 73 74 61 74 65 20 72 65 pass....state re
0850: 61 64 69 6e 67 20 63 73 6f 72 64 65 72 0a 09 72 ading csorder..r
0860: 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 20 eturn. }..
0870: 20 74 79 70 65 6d 65 74 68 6f 64 20 6c 6f 61 64 typemethod load
0880: 20 7b 7d 20 7b 0a 09 23 20 50 61 73 73 20 6d 61 {} {..# Pass ma
0890: 6e 61 67 65 72 20 69 6e 74 65 72 66 61 63 65 2e nager interface.
08a0: 20 45 78 65 63 75 74 65 64 20 74 6f 20 6c 6f 61 Executed to loa
08b0: 64 20 64 61 74 61 20 63 6f 6d 70 75 74 65 64 20 d data computed
08c0: 62 79 0a 09 23 20 74 68 69 73 20 70 61 73 73 20 by..# this pass
08d0: 69 6e 74 6f 20 6d 65 6d 6f 72 79 20 77 68 65 6e into memory when
08e0: 20 74 68 69 73 20 70 61 73 73 20 69 73 20 73 6b this pass is sk
08f0: 69 70 70 65 64 20 69 6e 73 74 65 61 64 20 6f 66 ipped instead of
0900: 0a 09 23 20 65 78 65 63 75 74 65 64 2e 0a 09 72 ..# executed...r
0910: 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 20 eturn. }..
0920: 20 74 79 70 65 6d 65 74 68 6f 64 20 72 75 6e 20 typemethod run
0930: 7b 7d 20 7b 0a 09 23 20 50 61 73 73 20 6d 61 6e {} {..# Pass man
0940: 61 67 65 72 20 69 6e 74 65 72 66 61 63 65 2e 20 ager interface.
0950: 45 78 65 63 75 74 65 64 20 74 6f 20 70 65 72 66 Executed to perf
0960: 6f 72 6d 20 74 68 65 0a 09 23 20 66 75 6e 63 74 orm the..# funct
0970: 69 6f 6e 61 6c 69 74 79 20 6f 66 20 74 68 65 20 ionality of the
0980: 70 61 73 73 2e 0a 0a 09 63 79 63 6c 65 62 72 65 pass....cyclebre
0990: 61 6b 65 72 20 70 72 65 63 6d 64 20 20 20 5b 6d aker precmd [m
09a0: 79 70 72 6f 63 20 42 72 65 61 6b 52 65 74 72 6f yproc BreakRetro
09b0: 67 72 61 64 65 42 72 61 6e 63 68 65 73 5d 0a 09 gradeBranches]..
09c0: 63 79 63 6c 65 62 72 65 61 6b 65 72 20 73 61 76 cyclebreaker sav
09d0: 65 63 6d 64 20 20 5b 6d 79 70 72 6f 63 20 53 61 ecmd [myproc Sa
09e0: 76 65 4f 72 64 65 72 5d 0a 09 63 79 63 6c 65 62 veOrder]..cycleb
09f0: 72 65 61 6b 65 72 20 62 72 65 61 6b 63 6d 64 20 reaker breakcmd
0a00: 5b 6d 79 70 72 6f 63 20 42 72 65 61 6b 43 79 63 [myproc BreakCyc
0a10: 6c 65 5d 0a 0a 09 73 74 61 74 65 20 74 72 61 6e le]...state tran
0a20: 73 61 63 74 69 6f 6e 20 7b 0a 09 20 20 20 20 4c saction {.. L
0a30: 6f 61 64 43 6f 6d 6d 69 74 4f 72 64 65 72 0a 09 oadCommitOrder..
0a40: 20 20 20 20 63 79 63 6c 65 62 72 65 61 6b 65 72 cyclebreaker
0a50: 20 72 75 6e 20 62 72 65 61 6b 2d 61 6c 6c 20 5b run break-all [
0a60: 6d 79 70 72 6f 63 20 43 68 61 6e 67 65 73 65 74 myproc Changeset
0a70: 73 5d 0a 09 7d 0a 0a 09 72 65 70 6f 73 69 74 6f s]..}...reposito
0a80: 72 79 20 70 72 69 6e 74 63 73 65 74 73 74 61 74 ry printcsetstat
0a90: 69 73 74 69 63 73 0a 09 72 65 74 75 72 6e 0a 20 istics..return.
0aa0: 20 20 20 7d 0a 0a 20 20 20 20 74 79 70 65 6d 65 }.. typeme
0ab0: 74 68 6f 64 20 64 69 73 63 61 72 64 20 7b 7d 20 thod discard {}
0ac0: 7b 0a 09 23 20 50 61 73 73 20 6d 61 6e 61 67 65 {..# Pass manage
0ad0: 72 20 69 6e 74 65 72 66 61 63 65 2e 20 45 78 65 r interface. Exe
0ae0: 63 75 74 65 64 20 66 6f 72 20 61 6c 6c 20 70 61 cuted for all pa
0af0: 73 73 65 73 20 61 66 74 65 72 20 74 68 65 0a 09 sses after the..
0b00: 23 20 72 75 6e 20 70 61 73 73 65 73 2c 20 74 6f # run passes, to
0b10: 20 72 65 6d 6f 76 65 20 61 6c 6c 20 64 61 74 61 remove all data
0b20: 20 6f 66 20 74 68 69 73 20 70 61 73 73 20 66 72 of this pass fr
0b30: 6f 6d 20 74 68 65 20 73 74 61 74 65 2c 0a 09 23 om the state,..#
0b40: 20 61 73 20 62 65 69 6e 67 20 6f 75 74 20 6f 66 as being out of
0b50: 20 64 61 74 65 2e 0a 09 72 65 74 75 72 6e 0a 20 date...return.
0b60: 20 20 20 7d 0a 0a 20 20 20 20 23 20 23 20 23 23 }.. # # ##
0b70: 20 23 23 23 20 23 23 23 23 23 20 23 23 23 23 23 ### ##### #####
0b80: 23 23 23 20 23 23 23 23 23 23 23 23 23 23 23 23 ### ############
0b90: 23 0a 20 20 20 20 23 23 20 49 6e 74 65 72 6e 61 #. ## Interna
0ba0: 6c 20 6d 65 74 68 6f 64 73 0a 0a 20 20 20 20 70 l methods.. p
0bb0: 72 6f 63 20 43 68 61 6e 67 65 73 65 74 73 20 7b roc Changesets {
0bc0: 7d 20 7b 20 70 72 6f 6a 65 63 74 3a 3a 72 65 76 } { project::rev
0bd0: 20 61 6c 6c 20 7d 0a 0a 20 20 20 20 70 72 6f 63 all }.. proc
0be0: 20 4c 6f 61 64 43 6f 6d 6d 69 74 4f 72 64 65 72 LoadCommitOrder
0bf0: 20 7b 7d 20 7b 0a 09 3a 3a 76 61 72 69 61 62 6c {} {..::variabl
0c00: 65 20 6d 79 63 73 65 74 0a 0a 09 73 74 61 74 65 e mycset...state
0c10: 20 74 72 61 6e 73 61 63 74 69 6f 6e 20 7b 0a 09 transaction {..
0c20: 20 20 20 20 66 6f 72 65 61 63 68 20 7b 63 69 64 foreach {cid
0c30: 20 70 6f 73 7d 20 5b 73 74 61 74 65 20 72 75 6e pos} [state run
0c40: 20 7b 20 53 45 4c 45 43 54 20 63 69 64 2c 20 70 { SELECT cid, p
0c50: 6f 73 20 46 52 4f 4d 20 63 73 6f 72 64 65 72 20 os FROM csorder
0c60: 7d 5d 20 7b 0a 09 09 73 65 74 20 63 73 65 74 20 }] {...set cset
0c70: 5b 70 72 6f 6a 65 63 74 3a 3a 72 65 76 20 6f 66 [project::rev of
0c80: 20 24 63 69 64 5d 0a 09 09 24 63 73 65 74 20 73 $cid]...$cset s
0c90: 65 74 70 6f 73 20 24 70 6f 73 0a 09 09 73 65 74 etpos $pos...set
0ca0: 20 6d 79 63 73 65 74 28 24 70 6f 73 29 20 24 63 mycset($pos) $c
0cb0: 73 65 74 0a 09 20 20 20 20 7d 0a 09 20 20 20 20 set.. }..
0cc0: 23 20 52 65 6d 6f 76 65 20 74 68 65 20 6f 72 64 # Remove the ord
0cd0: 65 72 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 6e er information n
0ce0: 6f 77 20 74 68 61 74 20 77 65 20 68 61 76 65 20 ow that we have
0cf0: 69 74 20 69 6e 0a 09 20 20 20 20 23 20 6d 65 6d it in.. # mem
0d00: 6f 72 79 2c 20 73 6f 20 74 68 61 74 20 77 65 20 ory, so that we
0d10: 63 61 6e 20 73 61 76 65 20 69 74 20 6f 6e 63 65 can save it once
0d20: 20 6d 6f 72 65 2c 20 66 6f 72 20 61 6c 6c 0a 09 more, for all..
0d30: 20 20 20 20 23 20 63 68 61 6e 67 65 73 65 74 73 # changesets
0d40: 2c 20 77 68 69 6c 65 20 62 72 65 61 6b 69 6e 67 , while breaking
0d50: 20 74 68 65 20 72 65 6d 61 69 6e 69 6e 67 20 63 the remaining c
0d60: 79 63 6c 65 73 2e 0a 09 20 20 20 20 73 74 61 74 ycles... stat
0d70: 65 20 72 75 6e 20 7b 20 44 45 4c 45 54 45 20 46 e run { DELETE F
0d80: 52 4f 4d 20 63 73 6f 72 64 65 72 20 7d 0a 09 7d ROM csorder }..}
0d90: 0a 09 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a ..return. }..
0da0: 20 20 20 20 23 20 23 20 23 23 20 23 23 23 20 23 # # ## ### #
0db0: 23 23 23 23 20 23 23 23 23 23 23 23 23 20 23 23 #### ######## ##
0dc0: 23 23 23 23 23 23 23 23 23 23 23 0a 0a 20 20 20 ###########..
0dd0: 20 70 72 6f 63 20 42 72 65 61 6b 52 65 74 72 6f proc BreakRetro
0de0: 67 72 61 64 65 42 72 61 6e 63 68 65 73 20 7b 67 gradeBranches {g
0df0: 72 61 70 68 7d 20 7b 0a 20 20 20 20 7d 0a 0a 20 raph} {. }..
0e00: 20 20 20 23 20 23 20 23 23 20 23 23 23 20 23 23 # # ## ### ##
0e10: 23 23 23 20 23 23 23 23 23 23 23 23 20 23 23 23 ### ######## ###
0e20: 23 23 23 23 23 23 23 23 23 23 0a 0a 20 20 20 20 ##########..
0e30: 70 72 6f 63 20 53 61 76 65 4f 72 64 65 72 20 7b proc SaveOrder {
0e40: 63 73 65 74 20 70 6f 73 7d 20 7b 0a 20 20 20 20 cset pos} {.
0e50: 7d 0a 0a 20 20 20 20 23 20 23 20 23 23 20 23 23 }.. # # ## ##
0e60: 23 20 23 23 23 23 23 20 23 23 23 23 23 23 23 23 # ##### ########
0e70: 20 23 23 23 23 23 23 23 23 23 23 23 23 23 0a 0a #############..
0e80: 20 20 20 20 70 72 6f 63 20 42 72 65 61 6b 43 79 proc BreakCy
0e90: 63 6c 65 20 7b 67 72 61 70 68 7d 20 7b 0a 09 63 cle {graph} {..c
0ea0: 79 63 6c 65 62 72 65 61 6b 65 72 20 62 72 65 61 yclebreaker brea
0eb0: 6b 20 24 67 72 61 70 68 0a 20 20 20 20 7d 0a 0a k $graph. }..
0ec0: 20 20 20 20 23 20 23 20 23 23 20 23 23 23 20 23 # # ## ### #
0ed0: 23 23 23 23 20 23 23 23 23 23 23 23 23 20 23 23 #### ######## ##
0ee0: 23 23 23 23 23 23 23 23 23 23 23 0a 0a 20 20 20 ###########..
0ef0: 20 74 79 70 65 76 61 72 69 61 62 6c 65 20 6d 79 typevariable my
0f00: 63 73 65 74 20 2d 61 72 72 61 79 20 7b 7d 20 3b cset -array {} ;
0f10: 20 23 20 4d 61 70 20 66 72 6f 6d 20 63 6f 6d 6d # Map from comm
0f20: 69 74 20 70 6f 73 69 74 69 6f 6e 73 20 74 6f 20 it positions to
0f30: 74 68 65 0a 09 09 09 09 20 20 20 20 23 20 63 68 the..... # ch
0f40: 61 6e 67 65 73 65 74 20 28 6f 62 6a 65 63 74 20 angeset (object
0f50: 72 65 66 29 20 61 74 20 74 68 61 74 0a 09 09 09 ref) at that....
0f60: 09 20 20 20 20 23 20 70 6f 73 69 74 69 6f 6e 2e . # position.
0f70: 0a 0a 20 20 20 20 23 20 23 20 23 23 20 23 23 23 .. # # ## ###
0f80: 20 23 23 23 23 23 20 23 23 23 23 23 23 23 23 20 ##### ########
0f90: 23 23 23 23 23 23 23 23 23 23 23 23 23 0a 20 20 #############.
0fa0: 20 20 23 23 20 43 6f 6e 66 69 67 75 72 61 74 69 ## Configurati
0fb0: 6f 6e 0a 0a 20 20 20 20 70 72 61 67 6d 61 20 2d on.. pragma -
0fc0: 68 61 73 69 6e 73 74 61 6e 63 65 73 20 20 20 6e hasinstances n
0fd0: 6f 20 3b 20 23 20 73 69 6e 67 6c 65 74 6f 6e 0a o ; # singleton.
0fe0: 20 20 20 20 70 72 61 67 6d 61 20 2d 68 61 73 74 pragma -hast
0ff0: 79 70 65 69 6e 66 6f 20 20 20 20 6e 6f 20 3b 20 ypeinfo no ;
1000: 23 20 6e 6f 20 69 6e 74 72 6f 73 70 65 63 74 69 # no introspecti
1010: 6f 6e 0a 20 20 20 20 70 72 61 67 6d 61 20 2d 68 on. pragma -h
1020: 61 73 74 79 70 65 64 65 73 74 72 6f 79 20 6e 6f astypedestroy no
1030: 20 3b 20 23 20 69 6d 6d 6f 72 74 61 6c 0a 0a 20 ; # immortal..
1040: 20 20 20 23 20 23 20 23 23 20 23 23 23 20 23 23 # # ## ### ##
1050: 23 23 23 20 23 23 23 23 23 23 23 23 20 23 23 23 ### ######## ###
1060: 23 23 23 23 23 23 23 23 23 23 0a 7d 0a 0a 6e 61 ##########.}..na
1070: 6d 65 73 70 61 63 65 20 65 76 61 6c 20 3a 3a 76 mespace eval ::v
1080: 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 c::fossil::impor
1090: 74 3a 3a 63 76 73 3a 3a 70 61 73 73 20 7b 0a 20 t::cvs::pass {.
10a0: 20 20 20 6e 61 6d 65 73 70 61 63 65 20 65 78 70 namespace exp
10b0: 6f 72 74 20 62 72 65 61 6b 61 63 79 63 6c 65 0a ort breakacycle.
10c0: 20 20 20 20 6e 61 6d 65 73 70 61 63 65 20 65 76 namespace ev
10d0: 61 6c 20 62 72 65 61 6b 61 63 79 63 6c 65 20 7b al breakacycle {
10e0: 0a 09 6e 61 6d 65 73 70 61 63 65 20 69 6d 70 6f ..namespace impo
10f0: 72 74 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a rt ::vc::fossil:
1100: 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 63 79 :import::cvs::cy
1110: 63 6c 65 62 72 65 61 6b 65 72 0a 09 6e 61 6d 65 clebreaker..name
1120: 73 70 61 63 65 20 69 6d 70 6f 72 74 20 3a 3a 76 space import ::v
1130: 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 c::fossil::impor
1140: 74 3a 3a 63 76 73 3a 3a 72 65 70 6f 73 69 74 6f t::cvs::reposito
1150: 72 79 0a 09 6e 61 6d 65 73 70 61 63 65 20 69 6d ry..namespace im
1160: 70 6f 72 74 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 port ::vc::fossi
1170: 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a l::import::cvs::
1180: 73 74 61 74 65 0a 09 6e 61 6d 65 73 70 61 63 65 state..namespace
1190: 20 65 76 61 6c 20 70 72 6f 6a 65 63 74 20 7b 0a eval project {.
11a0: 09 20 20 20 20 6e 61 6d 65 73 70 61 63 65 20 69 . namespace i
11b0: 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a 66 6f 73 73 mport ::vc::foss
11c0: 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a il::import::cvs:
11d0: 3a 70 72 6f 6a 65 63 74 3a 3a 72 65 76 0a 09 7d :project::rev..}
11e0: 0a 09 6e 61 6d 65 73 70 61 63 65 20 69 6d 70 6f ..namespace impo
11f0: 72 74 20 3a 3a 76 63 3a 3a 74 6f 6f 6c 73 3a 3a rt ::vc::tools::
1200: 6c 6f 67 0a 09 6c 6f 67 20 72 65 67 69 73 74 65 log..log registe
1210: 72 20 62 72 65 61 6b 61 63 79 63 6c 65 0a 20 20 r breakacycle.
1220: 20 20 7d 0a 7d 0a 0a 23 20 23 20 23 23 20 23 23 }.}..# # ## ##
1230: 23 20 23 23 23 23 23 20 23 23 23 23 23 23 23 23 # ##### ########
1240: 20 23 23 23 23 23 23 23 23 23 23 23 23 23 20 23 ############# #
1250: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
1260: 23 23 23 23 0a 23 23 20 52 65 61 64 79 0a 0a 70 ####.## Ready..p
1270: 61 63 6b 61 67 65 20 70 72 6f 76 69 64 65 20 76 ackage provide v
1280: 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 c::fossil::impor
1290: 74 3a 3a 63 76 73 3a 3a 70 61 73 73 3a 3a 62 72 t::cvs::pass::br
12a0: 65 61 6b 61 63 79 63 6c 65 20 31 2e 30 0a 72 65 eakacycle 1.0.re
12b0: 74 75 72 6e 0a turn.