Artifact 143b6f64ebe82f6d566811dec9b7413f5dc1bcea:
File
tools/cvs2fossil/lib/c2f_pbreakacycle.tcl
part of check-in
[47d52d1efd]
- Added convenience method for assertions and used it in place of the existing if/trouble internal constructions. Changed API of 'log write' so that we can defer substituation of the message to when the write actually happen, and converted all places which would be hit by double-substitution. The remaining 'log write' calls will be converted incrementally.
by
aku on
2007-11-28 05:39:49.
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 49 58 2e 20 54 68 69 73 20 69 73 20 74 68 s IX. This is th
0210: 65 20 66 69 6e 61 6c 20 70 61 73 73 20 66 6f 72 e final pass for
0220: 20 62 72 65 61 6b 69 6e 67 20 63 68 61 6e 67 65 breaking change
0230: 73 65 74 20 64 65 70 65 6e 64 65 6e 63 79 0a 23 set dependency.#
0240: 23 20 63 79 63 6c 65 73 2e 20 54 68 65 20 70 72 # cycles. The pr
0250: 65 76 69 6f 75 73 20 62 72 65 61 6b 65 72 20 70 evious breaker p
0260: 61 73 73 65 73 20 28 36 20 61 6e 64 20 38 29 20 asses (6 and 8)
0270: 62 72 6f 6b 65 20 63 79 63 6c 65 73 20 63 6f 76 broke cycles cov
0280: 65 72 69 6e 67 0a 23 23 20 72 65 76 69 73 69 6f ering.## revisio
0290: 6e 20 61 6e 64 20 73 79 6d 62 6f 6c 20 63 68 61 n and symbol cha
02a0: 6e 67 65 73 65 74 73 2c 20 72 65 73 70 65 63 74 ngesets, respect
02b0: 69 76 65 6c 79 2e 20 54 68 69 73 20 70 61 73 73 ively. This pass
02c0: 20 6e 6f 77 20 62 72 65 61 6b 73 0a 23 23 20 61 now breaks.## a
02d0: 6e 79 20 72 65 6d 61 69 6e 69 6e 67 20 63 79 63 ny remaining cyc
02e0: 6c 65 73 2c 20 65 61 63 68 20 6f 66 20 77 68 69 les, each of whi
02f0: 63 68 20 68 61 73 20 74 6f 20 63 6f 6e 74 61 69 ch has to contai
0300: 6e 20 61 74 20 6c 65 61 73 74 20 6f 6e 65 0a 23 n at least one.#
0310: 23 20 72 65 76 69 73 69 6f 6e 20 61 6e 64 20 61 # revision and a
0320: 74 20 6c 65 61 73 74 20 6f 6e 65 20 73 79 6d 62 t least one symb
0330: 6f 6c 20 63 68 61 6e 67 65 73 65 74 2e 0a 0a 23 ol changeset...#
0340: 20 23 20 23 23 20 23 23 23 20 23 23 23 23 23 20 # ## ### #####
0350: 23 23 23 23 23 23 23 23 20 23 23 23 23 23 23 23 ######## #######
0360: 23 23 23 23 23 23 20 23 23 23 23 23 23 23 23 23 ###### #########
0370: 23 23 23 23 23 23 23 23 23 23 23 23 0a 23 23 20 ############.##
0380: 52 65 71 75 69 72 65 6d 65 6e 74 73 0a 0a 70 61 Requirements..pa
0390: 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 54 63 ckage require Tc
03a0: 6c 20 38 2e 34 20 20 20 20 20 20 20 20 20 20 20 l 8.4
03b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
03c0: 20 20 20 20 20 20 20 20 3b 20 23 20 52 65 71 75 ; # Requ
03d0: 69 72 65 64 20 72 75 6e 74 69 6d 65 2e 0a 70 61 ired runtime..pa
03e0: 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 73 6e ckage require sn
03f0: 69 74 20 20 20 20 20 20 20 20 20 20 20 20 20 20 it
0400: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0410: 20 20 20 20 20 20 20 20 3b 20 23 20 4f 4f 20 73 ; # OO s
0420: 79 73 74 65 6d 2e 0a 70 61 63 6b 61 67 65 20 72 ystem..package r
0430: 65 71 75 69 72 65 20 73 74 72 75 63 74 3a 3a 6c equire struct::l
0440: 69 73 74 20 20 20 20 20 20 20 20 20 20 20 20 20 ist
0450: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0460: 20 3b 20 23 20 48 69 67 68 65 72 20 6f 72 64 65 ; # Higher orde
0470: 72 20 6c 69 73 74 20 6f 70 65 72 61 74 69 6f 6e r list operation
0480: 73 2e 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 s..package requi
0490: 72 65 20 73 74 72 75 63 74 3a 3a 73 65 74 20 20 re struct::set
04a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
04b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 3b 20 23 ; #
04c0: 20 53 65 74 20 6f 70 65 72 61 74 69 6f 6e 73 2e Set operations.
04d0: 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 .package require
04e0: 20 76 63 3a 3a 74 6f 6f 6c 73 3a 3a 6d 69 73 63 vc::tools::misc
04f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0500: 20 20 20 20 20 20 20 20 20 20 20 3b 20 23 20 4d ; # M
0510: 69 6e 2c 20 6d 61 78 2e 0a 70 61 63 6b 61 67 65 in, max..package
0520: 20 72 65 71 75 69 72 65 20 76 63 3a 3a 74 6f 6f require vc::too
0530: 6c 73 3a 3a 6c 6f 67 20 20 20 20 20 20 20 20 20 ls::log
0540: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0550: 20 20 20 3b 20 23 20 55 73 65 72 20 66 65 65 64 ; # User feed
0560: 62 61 63 6b 2e 0a 70 61 63 6b 61 67 65 20 72 65 back..package re
0570: 71 75 69 72 65 20 76 63 3a 3a 74 6f 6f 6c 73 3a quire vc::tools:
0580: 3a 74 72 6f 75 62 6c 65 20 20 20 20 20 20 20 20 :trouble
0590: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
05a0: 3b 20 23 20 45 72 72 6f 72 20 72 65 70 6f 72 74 ; # Error report
05b0: 69 6e 67 2e 0a 70 61 63 6b 61 67 65 20 72 65 71 ing..package req
05c0: 75 69 72 65 20 76 63 3a 3a 66 6f 73 73 69 6c 3a uire vc::fossil:
05d0: 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 72 65 :import::cvs::re
05e0: 70 6f 73 69 74 6f 72 79 20 20 20 20 20 20 20 3b pository ;
05f0: 20 23 20 52 65 70 6f 73 69 74 6f 72 79 20 6d 61 # Repository ma
0600: 6e 61 67 65 6d 65 6e 74 2e 0a 70 61 63 6b 61 67 nagement..packag
0610: 65 20 72 65 71 75 69 72 65 20 76 63 3a 3a 66 6f e require vc::fo
0620: 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 ssil::import::cv
0630: 73 3a 3a 63 79 63 6c 65 62 72 65 61 6b 65 72 20 s::cyclebreaker
0640: 20 20 20 20 3b 20 23 20 42 72 65 61 6b 69 6e 67 ; # Breaking
0650: 20 64 65 70 65 6e 64 65 6e 63 79 20 63 79 63 6c dependency cycl
0660: 65 73 2e 0a 70 61 63 6b 61 67 65 20 72 65 71 75 es..package requ
0670: 69 72 65 20 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a ire vc::fossil::
0680: 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 73 74 61 import::cvs::sta
0690: 74 65 20 20 20 20 20 20 20 20 20 20 20 20 3b 20 te ;
06a0: 23 20 53 74 61 74 65 20 73 74 6f 72 61 67 65 2e # State storage.
06b0: 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 .package require
06c0: 20 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 vc::fossil::imp
06d0: 6f 72 74 3a 3a 63 76 73 3a 3a 69 6e 74 65 67 72 ort::cvs::integr
06e0: 69 74 79 20 20 20 20 20 20 20 20 3b 20 23 20 53 ity ; # S
06f0: 74 61 74 65 20 69 6e 74 65 67 72 69 74 79 20 63 tate integrity c
0700: 68 65 63 6b 73 2e 0a 70 61 63 6b 61 67 65 20 72 hecks..package r
0710: 65 71 75 69 72 65 20 76 63 3a 3a 66 6f 73 73 69 equire vc::fossi
0720: 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a l::import::cvs::
0730: 70 72 6f 6a 65 63 74 3a 3a 72 65 76 20 20 20 20 project::rev
0740: 20 3b 20 23 20 50 72 6f 6a 65 63 74 20 6c 65 76 ; # Project lev
0750: 65 6c 20 63 68 61 6e 67 65 73 65 74 73 0a 0a 23 el changesets..#
0760: 20 23 20 23 23 20 23 23 23 20 23 23 23 23 23 20 # ## ### #####
0770: 23 23 23 23 23 23 23 23 20 23 23 23 23 23 23 23 ######## #######
0780: 23 23 23 23 23 23 20 23 23 23 23 23 23 23 23 23 ###### #########
0790: 23 23 23 23 23 23 23 23 23 23 23 23 0a 23 23 20 ############.##
07a0: 52 65 67 69 73 74 65 72 20 74 68 65 20 70 61 73 Register the pas
07b0: 73 20 77 69 74 68 20 74 68 65 20 6d 61 6e 61 67 s with the manag
07c0: 65 6d 65 6e 74 0a 0a 76 63 3a 3a 66 6f 73 73 69 ement..vc::fossi
07d0: 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a l::import::cvs::
07e0: 70 61 73 73 20 64 65 66 69 6e 65 20 5c 0a 20 20 pass define \.
07f0: 20 20 42 72 65 61 6b 41 6c 6c 43 73 65 74 43 79 BreakAllCsetCy
0800: 63 6c 65 73 20 5c 0a 20 20 20 20 7b 42 72 65 61 cles \. {Brea
0810: 6b 20 52 65 6d 61 69 6e 69 6e 67 20 43 68 61 6e k Remaining Chan
0820: 67 65 53 65 74 20 44 65 70 65 6e 64 65 6e 63 79 geSet Dependency
0830: 20 43 79 63 6c 65 73 7d 20 5c 0a 20 20 20 20 3a Cycles} \. :
0840: 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 :vc::fossil::imp
0850: 6f 72 74 3a 3a 63 76 73 3a 3a 70 61 73 73 3a 3a ort::cvs::pass::
0860: 62 72 65 61 6b 61 63 79 63 6c 65 0a 0a 23 20 23 breakacycle..# #
0870: 20 23 23 20 23 23 23 20 23 23 23 23 23 20 23 23 ## ### ##### ##
0880: 23 23 23 23 23 23 20 23 23 23 23 23 23 23 23 23 ###### #########
0890: 23 23 23 23 20 23 23 23 23 23 23 23 23 23 23 23 #### ###########
08a0: 23 23 23 23 23 23 23 23 23 23 0a 23 23 0a 0a 73 ##########.##..s
08b0: 6e 69 74 3a 3a 74 79 70 65 20 3a 3a 76 63 3a 3a nit::type ::vc::
08c0: 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a fossil::import::
08d0: 63 76 73 3a 3a 70 61 73 73 3a 3a 62 72 65 61 6b cvs::pass::break
08e0: 61 63 79 63 6c 65 20 7b 0a 20 20 20 20 23 20 23 acycle {. # #
08f0: 20 23 23 20 23 23 23 20 23 23 23 23 23 20 23 23 ## ### ##### ##
0900: 23 23 23 23 23 23 20 23 23 23 23 23 23 23 23 23 ###### #########
0910: 23 23 23 23 0a 20 20 20 20 23 23 20 50 75 62 6c ####. ## Publ
0920: 69 63 20 41 50 49 0a 0a 20 20 20 20 74 79 70 65 ic API.. type
0930: 6d 65 74 68 6f 64 20 73 65 74 75 70 20 7b 7d 20 method setup {}
0940: 7b 0a 09 23 20 44 65 66 69 6e 65 20 74 68 65 20 {..# Define the
0950: 6e 61 6d 65 73 20 61 6e 64 20 73 74 72 75 63 74 names and struct
0960: 75 72 65 20 6f 66 20 74 68 65 20 70 65 72 73 69 ure of the persi
0970: 73 74 65 6e 74 20 73 74 61 74 65 20 6f 66 0a 09 stent state of..
0980: 23 20 74 68 69 73 20 70 61 73 73 2e 0a 0a 09 73 # this pass....s
0990: 74 61 74 65 20 72 65 61 64 69 6e 67 20 63 73 6f tate reading cso
09a0: 72 64 65 72 0a 09 72 65 74 75 72 6e 0a 20 20 20 rder..return.
09b0: 20 7d 0a 0a 20 20 20 20 74 79 70 65 6d 65 74 68 }.. typemeth
09c0: 6f 64 20 6c 6f 61 64 20 7b 7d 20 7b 0a 09 23 20 od load {} {..#
09d0: 50 61 73 73 20 6d 61 6e 61 67 65 72 20 69 6e 74 Pass manager int
09e0: 65 72 66 61 63 65 2e 20 45 78 65 63 75 74 65 64 erface. Executed
09f0: 20 74 6f 20 6c 6f 61 64 20 64 61 74 61 20 63 6f to load data co
0a00: 6d 70 75 74 65 64 20 62 79 0a 09 23 20 74 68 69 mputed by..# thi
0a10: 73 20 70 61 73 73 20 69 6e 74 6f 20 6d 65 6d 6f s pass into memo
0a20: 72 79 20 77 68 65 6e 20 74 68 69 73 20 70 61 73 ry when this pas
0a30: 73 20 69 73 20 73 6b 69 70 70 65 64 20 69 6e 73 s is skipped ins
0a40: 74 65 61 64 20 6f 66 0a 09 23 20 65 78 65 63 75 tead of..# execu
0a50: 74 65 64 2e 0a 09 72 65 74 75 72 6e 0a 20 20 20 ted...return.
0a60: 20 7d 0a 0a 20 20 20 20 74 79 70 65 6d 65 74 68 }.. typemeth
0a70: 6f 64 20 72 75 6e 20 7b 7d 20 7b 0a 09 23 20 50 od run {} {..# P
0a80: 61 73 73 20 6d 61 6e 61 67 65 72 20 69 6e 74 65 ass manager inte
0a90: 72 66 61 63 65 2e 20 45 78 65 63 75 74 65 64 20 rface. Executed
0aa0: 74 6f 20 70 65 72 66 6f 72 6d 20 74 68 65 0a 09 to perform the..
0ab0: 23 20 66 75 6e 63 74 69 6f 6e 61 6c 69 74 79 20 # functionality
0ac0: 6f 66 20 74 68 65 20 70 61 73 73 2e 0a 0a 09 73 of the pass....s
0ad0: 65 74 20 6c 65 6e 20 5b 73 74 72 69 6e 67 20 6c et len [string l
0ae0: 65 6e 67 74 68 20 5b 70 72 6f 6a 65 63 74 3a 3a ength [project::
0af0: 72 65 76 20 6e 75 6d 5d 5d 0a 09 73 65 74 20 6d rev num]]..set m
0b00: 79 61 74 66 6d 74 20 25 24 7b 6c 65 6e 7d 73 0a yatfmt %${len}s.
0b10: 09 69 6e 63 72 20 6c 65 6e 20 31 32 0a 09 73 65 .incr len 12..se
0b20: 74 20 6d 79 63 73 66 6d 74 20 25 24 7b 6c 65 6e t mycsfmt %${len
0b30: 7d 73 0a 0a 09 63 79 63 6c 65 62 72 65 61 6b 65 }s...cyclebreake
0b40: 72 20 70 72 65 63 6d 64 20 20 20 5b 6d 79 70 72 r precmd [mypr
0b50: 6f 63 20 42 72 65 61 6b 42 61 63 6b 77 61 72 64 oc BreakBackward
0b60: 5d 0a 09 63 79 63 6c 65 62 72 65 61 6b 65 72 20 ]..cyclebreaker
0b70: 73 61 76 65 63 6d 64 20 20 5b 6d 79 70 72 6f 63 savecmd [myproc
0b80: 20 4b 65 65 70 4f 72 64 65 72 5d 0a 0a 09 73 74 KeepOrder]...st
0b90: 61 74 65 20 74 72 61 6e 73 61 63 74 69 6f 6e 20 ate transaction
0ba0: 7b 0a 09 20 20 20 20 4c 6f 61 64 43 6f 6d 6d 69 {.. LoadCommi
0bb0: 74 4f 72 64 65 72 0a 09 20 20 20 20 63 79 63 6c tOrder.. cycl
0bc0: 65 62 72 65 61 6b 65 72 20 72 75 6e 20 62 72 65 ebreaker run bre
0bd0: 61 6b 2d 61 6c 6c 20 5b 6d 79 70 72 6f 63 20 43 ak-all [myproc C
0be0: 68 61 6e 67 65 73 65 74 73 5d 0a 09 7d 0a 0a 09 hangesets]..}...
0bf0: 72 65 70 6f 73 69 74 6f 72 79 20 70 72 69 6e 74 repository print
0c00: 63 73 65 74 73 74 61 74 69 73 74 69 63 73 0a 09 csetstatistics..
0c10: 69 6e 74 65 67 72 69 74 79 20 63 68 61 6e 67 65 integrity change
0c20: 73 65 74 73 0a 09 72 65 74 75 72 6e 0a 20 20 20 sets..return.
0c30: 20 7d 0a 0a 20 20 20 20 74 79 70 65 6d 65 74 68 }.. typemeth
0c40: 6f 64 20 64 69 73 63 61 72 64 20 7b 7d 20 7b 0a od discard {} {.
0c50: 09 23 20 50 61 73 73 20 6d 61 6e 61 67 65 72 20 .# Pass manager
0c60: 69 6e 74 65 72 66 61 63 65 2e 20 45 78 65 63 75 interface. Execu
0c70: 74 65 64 20 66 6f 72 20 61 6c 6c 20 70 61 73 73 ted for all pass
0c80: 65 73 20 61 66 74 65 72 20 74 68 65 0a 09 23 20 es after the..#
0c90: 72 75 6e 20 70 61 73 73 65 73 2c 20 74 6f 20 72 run passes, to r
0ca0: 65 6d 6f 76 65 20 61 6c 6c 20 64 61 74 61 20 6f emove all data o
0cb0: 66 20 74 68 69 73 20 70 61 73 73 20 66 72 6f 6d f this pass from
0cc0: 20 74 68 65 20 73 74 61 74 65 2c 0a 09 23 20 61 the state,..# a
0cd0: 73 20 62 65 69 6e 67 20 6f 75 74 20 6f 66 20 64 s being out of d
0ce0: 61 74 65 2e 0a 09 72 65 74 75 72 6e 0a 20 20 20 ate...return.
0cf0: 20 7d 0a 0a 20 20 20 20 23 20 23 20 23 23 20 23 }.. # # ## #
0d00: 23 23 20 23 23 23 23 23 20 23 23 23 23 23 23 23 ## ##### #######
0d10: 23 20 23 23 23 23 23 23 23 23 23 23 23 23 23 0a # #############.
0d20: 20 20 20 20 23 23 20 49 6e 74 65 72 6e 61 6c 20 ## Internal
0d30: 6d 65 74 68 6f 64 73 0a 0a 20 20 20 20 70 72 6f methods.. pro
0d40: 63 20 43 68 61 6e 67 65 73 65 74 73 20 7b 7d 20 c Changesets {}
0d50: 7b 20 70 72 6f 6a 65 63 74 3a 3a 72 65 76 20 61 { project::rev a
0d60: 6c 6c 20 7d 0a 0a 20 20 20 20 70 72 6f 63 20 4c ll }.. proc L
0d70: 6f 61 64 43 6f 6d 6d 69 74 4f 72 64 65 72 20 7b oadCommitOrder {
0d80: 7d 20 7b 0a 09 3a 3a 76 61 72 69 61 62 6c 65 20 } {..::variable
0d90: 6d 79 63 73 65 74 0a 09 3a 3a 76 61 72 69 61 62 mycset..::variab
0da0: 6c 65 20 6d 79 72 65 76 69 73 69 6f 6e 63 68 61 le myrevisioncha
0db0: 6e 67 65 73 65 74 73 0a 0a 09 73 74 61 74 65 20 ngesets...state
0dc0: 74 72 61 6e 73 61 63 74 69 6f 6e 20 7b 0a 09 20 transaction {..
0dd0: 20 20 20 66 6f 72 65 61 63 68 20 7b 63 69 64 20 foreach {cid
0de0: 70 6f 73 7d 20 5b 73 74 61 74 65 20 72 75 6e 20 pos} [state run
0df0: 7b 20 53 45 4c 45 43 54 20 63 69 64 2c 20 70 6f { SELECT cid, po
0e00: 73 20 46 52 4f 4d 20 63 73 6f 72 64 65 72 20 7d s FROM csorder }
0e10: 5d 20 7b 0a 09 09 73 65 74 20 63 73 65 74 20 5b ] {...set cset [
0e20: 70 72 6f 6a 65 63 74 3a 3a 72 65 76 20 6f 66 20 project::rev of
0e30: 24 63 69 64 5d 0a 09 09 24 63 73 65 74 20 73 65 $cid]...$cset se
0e40: 74 70 6f 73 20 24 70 6f 73 0a 09 09 73 65 74 20 tpos $pos...set
0e50: 6d 79 63 73 65 74 28 24 70 6f 73 29 20 24 63 73 mycset($pos) $cs
0e60: 65 74 0a 09 09 6c 61 70 70 65 6e 64 20 6d 79 72 et...lappend myr
0e70: 65 76 69 73 69 6f 6e 63 68 61 6e 67 65 73 65 74 evisionchangeset
0e80: 73 20 24 63 73 65 74 0a 09 20 20 20 20 7d 0a 09 s $cset.. }..
0e90: 7d 0a 09 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a }..return. }.
0ea0: 0a 20 20 20 20 23 20 23 20 23 23 20 23 23 23 20 . # # ## ###
0eb0: 23 23 23 23 23 20 23 23 23 23 23 23 23 23 20 23 ##### ######## #
0ec0: 23 23 23 23 23 23 23 23 23 23 23 23 0a 0a 20 20 ############..
0ed0: 20 20 70 72 6f 63 20 42 72 65 61 6b 42 61 63 6b proc BreakBack
0ee0: 77 61 72 64 20 7b 67 72 61 70 68 7d 20 7b 0a 09 ward {graph} {..
0ef0: 23 20 57 65 20 67 6f 20 6f 76 65 72 20 61 6c 6c # We go over all
0f00: 20 62 72 61 6e 63 68 20 63 68 61 6e 67 65 73 65 branch changese
0f10: 74 73 2c 20 69 2e 65 2e 20 74 68 65 20 63 68 61 ts, i.e. the cha
0f20: 6e 67 65 73 65 74 73 0a 09 23 20 63 72 65 61 74 ngesets..# creat
0f30: 65 64 20 62 79 20 74 68 65 20 73 79 6d 62 6f 6c ed by the symbol
0f40: 73 20 77 68 69 63 68 20 61 72 65 20 74 72 61 6e s which are tran
0f50: 73 6c 61 74 65 64 20 61 73 20 62 72 61 6e 63 68 slated as branch
0f60: 65 73 2c 20 61 6e 64 0a 09 23 20 62 72 65 61 6b es, and..# break
0f70: 20 61 6e 79 20 77 68 69 63 68 20 61 72 65 20 27 any which are '
0f80: 62 61 63 6b 77 61 72 64 27 2c 20 77 68 69 63 68 backward', which
0f90: 20 6d 65 61 6e 73 20 74 68 61 74 20 74 68 65 79 means that they
0fa0: 20 68 61 76 65 0a 09 23 20 61 74 20 6c 65 61 73 have..# at leas
0fb0: 74 20 6f 6e 65 20 69 6e 63 6f 6d 69 6e 67 20 72 t one incoming r
0fc0: 65 76 69 73 69 6f 6e 20 63 68 61 6e 67 65 73 65 evision changese
0fd0: 74 20 77 68 69 63 68 20 69 73 20 63 6f 6d 6d 69 t which is commi
0fe0: 74 74 65 64 0a 09 23 20 61 66 74 65 72 20 61 74 tted..# after at
0ff0: 20 6c 65 61 73 74 20 6f 6e 65 20 6f 66 20 74 68 least one of th
1000: 65 20 6f 75 74 67 6f 69 6e 67 20 72 65 76 69 73 e outgoing revis
1010: 69 6f 6e 20 63 68 61 6e 67 65 73 65 74 73 2c 20 ion changesets,
1020: 70 65 72 0a 09 23 20 74 68 65 20 6f 72 64 65 72 per..# the order
1030: 20 63 6f 6d 70 75 74 65 64 20 69 6e 20 70 61 73 computed in pas
1040: 73 20 36 2e 20 49 6e 20 22 63 76 73 32 73 76 6e s 6. In "cvs2svn
1050: 22 20 74 68 69 73 20 69 73 20 63 61 6c 6c 65 64 " this is called
1060: 0a 09 23 20 22 72 65 74 72 6f 67 72 61 64 65 22 ..# "retrograde"
1070: 2e 0a 0a 09 23 20 4e 4f 54 45 3a 20 57 65 20 6d ....# NOTE: We m
1080: 69 67 68 74 20 62 65 20 61 62 6c 65 20 74 6f 20 ight be able to
1090: 75 73 65 20 6f 75 72 20 6b 6e 6f 77 6c 65 64 67 use our knowledg
10a0: 65 20 74 68 61 74 20 77 65 20 61 72 65 0a 09 23 e that we are..#
10b0: 20 6c 6f 6f 6b 69 6e 67 20 61 74 20 61 6c 6c 20 looking at all
10c0: 63 68 61 6e 67 65 73 65 74 73 20 74 6f 20 63 72 changesets to cr
10d0: 65 61 74 65 20 61 20 73 71 6c 20 77 68 69 63 68 eate a sql which
10e0: 20 73 65 6c 65 63 74 73 20 61 6c 6c 0a 09 23 20 selects all..#
10f0: 74 68 65 20 62 72 61 6e 63 68 20 63 68 61 6e 67 the branch chang
1100: 65 73 65 74 73 20 66 72 6f 6d 20 74 68 65 20 73 esets from the s
1110: 74 61 74 65 20 69 6e 20 6f 6e 65 20 67 6f 20 69 tate in one go i
1120: 6e 73 74 65 61 64 20 6f 66 0a 09 23 20 68 61 76 nstead of..# hav
1130: 69 6e 67 20 74 6f 20 63 68 65 63 6b 20 65 61 63 ing to check eac
1140: 68 20 63 68 61 6e 67 65 73 65 74 20 73 65 70 61 h changeset sepa
1150: 72 61 74 65 6c 79 2e 20 43 6f 6e 73 69 64 65 72 rately. Consider
1160: 20 74 68 69 73 0a 09 23 20 6c 61 74 65 72 2c 20 this..# later,
1170: 67 65 74 20 74 68 65 20 70 61 73 73 20 77 6f 72 get the pass wor
1180: 6b 69 6e 67 20 66 69 72 73 74 2e 0a 09 23 0a 09 king first...#..
1190: 23 20 4e 4f 54 45 20 32 3a 20 4d 69 67 68 74 20 # NOTE 2: Might
11a0: 77 65 20 65 76 65 6e 20 62 65 20 61 62 6c 65 20 we even be able
11b0: 74 6f 20 73 65 6c 65 63 74 20 74 68 65 20 62 61 to select the ba
11c0: 63 6b 77 61 72 64 20 62 72 61 6e 63 68 0a 09 23 ckward branch..#
11d0: 20 63 68 61 6e 67 65 73 65 74 73 20 74 6f 6f 20 changesets too
11e0: 3f 0a 0a 09 66 6f 72 65 61 63 68 20 63 73 65 74 ?...foreach cset
11f0: 20 5b 24 67 72 61 70 68 20 6e 6f 64 65 73 5d 20 [$graph nodes]
1200: 7b 0a 09 20 20 20 20 69 66 20 7b 21 5b 24 63 73 {.. if {![$cs
1210: 65 74 20 62 79 73 79 6d 62 6f 6c 5d 7d 20 63 6f et bysymbol]} co
1220: 6e 74 69 6e 75 65 0a 09 20 20 20 20 43 68 65 63 ntinue.. Chec
1230: 6b 41 6e 64 42 72 65 61 6b 42 61 63 6b 77 61 72 kAndBreakBackwar
1240: 64 20 24 67 72 61 70 68 20 24 63 73 65 74 0a 09 d $graph $cset..
1250: 7d 0a 09 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a }..return. }.
1260: 0a 20 20 20 20 70 72 6f 63 20 43 68 65 63 6b 41 . proc CheckA
1270: 6e 64 42 72 65 61 6b 42 61 63 6b 77 61 72 64 20 ndBreakBackward
1280: 7b 67 72 61 70 68 20 63 73 65 74 7d 20 7b 0a 09 {graph cset} {..
1290: 77 68 69 6c 65 20 7b 5b 49 73 42 61 63 6b 77 61 while {[IsBackwa
12a0: 72 64 20 24 67 72 61 70 68 20 24 63 73 65 74 5d rd $graph $cset]
12b0: 7d 20 7b 0a 09 20 20 20 20 23 20 4b 6e 6f 77 69 } {.. # Knowi
12c0: 6e 67 20 74 68 61 74 20 74 68 65 20 62 72 61 6e ng that the bran
12d0: 63 68 20 69 73 20 62 61 63 6b 77 61 72 64 20 77 ch is backward w
12e0: 65 20 6e 6f 77 20 6c 6f 6f 6b 20 61 74 20 74 68 e now look at th
12f0: 65 0a 09 20 20 20 20 23 20 69 6e 64 69 76 69 64 e.. # individ
1300: 75 61 6c 20 72 65 76 69 73 69 6f 6e 73 20 69 6e ual revisions in
1310: 20 74 68 65 20 63 68 61 6e 67 65 73 65 74 20 61 the changeset a
1320: 6e 64 20 64 65 74 65 72 6d 69 6e 65 0a 09 20 20 nd determine..
1330: 20 20 23 20 77 68 69 63 68 20 6f 66 20 74 68 65 # which of the
1340: 6d 20 61 72 65 20 72 65 73 70 6f 6e 73 69 62 6c m are responsibl
1350: 65 20 66 6f 72 20 74 68 65 20 6f 76 65 72 6c 61 e for the overla
1360: 70 2e 20 54 68 69 73 0a 09 20 20 20 20 23 20 61 p. This.. # a
1370: 6c 6c 6f 77 73 20 75 73 20 74 6f 20 73 70 6c 69 llows us to spli
1380: 74 20 74 68 65 6d 20 69 6e 74 6f 20 74 77 6f 20 t them into two
1390: 73 65 74 73 2c 20 6f 6e 65 20 6f 66 0a 09 20 20 sets, one of..
13a0: 20 20 23 20 6e 6f 6e 2d 6f 76 65 72 6c 61 70 70 # non-overlapp
13b0: 69 6e 67 20 72 65 76 69 73 69 6f 6e 73 2c 20 61 ing revisions, a
13c0: 6e 64 20 6f 66 20 6f 76 65 72 6c 61 70 70 69 6e nd of overlappin
13d0: 67 20 6f 6e 65 73 2e 20 45 61 63 68 0a 09 20 20 g ones. Each..
13e0: 20 20 23 20 69 6e 64 75 63 65 73 20 61 20 6e 65 # induces a ne
13f0: 77 20 63 68 61 6e 67 65 73 65 74 2c 20 61 6e 64 w changeset, and
1400: 20 74 68 65 20 73 65 63 6f 6e 64 20 6d 61 79 20 the second may
1410: 73 74 69 6c 6c 20 62 65 0a 09 20 20 20 20 23 20 still be.. #
1420: 62 61 63 6b 77 61 72 64 20 61 6e 64 20 6e 65 65 backward and nee
1430: 64 20 66 75 72 74 68 65 72 20 73 70 6c 69 74 74 d further splitt
1440: 69 6e 67 2e 20 48 65 6e 63 65 20 74 68 65 20 6c ing. Hence the l
1450: 6f 6f 70 69 6e 67 2e 0a 09 20 20 20 20 23 0a 09 ooping... #..
1460: 20 20 20 20 23 20 54 68 65 20 62 6f 72 64 65 72 # The border
1470: 20 75 73 65 64 20 66 6f 72 20 74 68 65 20 73 70 used for the sp
1480: 6c 69 74 20 69 73 20 74 68 65 20 6d 69 6e 69 6d lit is the minim
1490: 61 6c 20 63 6f 6d 6d 69 74 0a 09 20 20 20 20 23 al commit.. #
14a0: 20 70 6f 73 69 74 69 6f 6e 20 61 6d 6f 6e 67 20 position among
14b0: 74 68 65 20 6d 69 6e 69 6d 61 6c 20 73 75 63 65 the minimal suce
14c0: 73 73 6f 72 20 63 6f 6d 6d 69 74 20 70 6f 73 69 ssor commit posi
14d0: 74 69 6f 6e 73 20 66 6f 72 0a 09 20 20 20 20 23 tions for.. #
14e0: 20 74 68 65 20 72 65 76 69 73 69 6f 6e 73 20 69 the revisions i
14f0: 6e 20 74 68 65 20 63 68 61 6e 67 65 73 65 74 2e n the changeset.
1500: 0a 0a 09 20 20 20 20 23 20 4e 6f 74 65 20 74 68 ... # Note th
1510: 61 74 20 69 6e 64 69 76 69 64 75 61 6c 20 72 65 at individual re
1520: 76 69 73 69 6f 6e 73 20 6d 61 79 20 6e 6f 74 20 visions may not
1530: 68 61 76 65 20 72 65 76 69 73 69 6f 6e 0a 09 20 have revision..
1540: 20 20 20 23 20 63 68 61 6e 67 65 73 65 74 73 20 # changesets
1550: 61 72 65 20 70 72 65 64 65 63 65 73 73 6f 72 73 are predecessors
1560: 20 61 6e 64 2f 6f 72 20 73 75 63 63 65 73 73 6f and/or successo
1570: 72 73 2c 20 6c 65 61 76 69 6e 67 0a 09 20 20 20 rs, leaving..
1580: 20 23 20 74 68 65 20 6c 69 6d 69 74 73 20 70 61 # the limits pa
1590: 72 74 69 61 6c 6c 79 20 6f 72 20 63 6f 6d 70 6c rtially or compl
15a0: 65 74 65 6c 79 20 75 6e 64 65 66 69 6e 65 64 2e etely undefined.
15b0: 0a 0a 09 20 20 20 20 23 20 6c 69 6d 69 74 73 20 ... # limits
15c0: 3a 20 64 69 63 74 20 28 72 65 76 69 73 69 6f 6e : dict (revision
15d0: 20 2d 3e 20 6c 69 73 74 20 28 6d 61 78 20 70 72 -> list (max pr
15e0: 65 64 65 63 65 73 73 6f 72 20 63 6f 6d 6d 69 74 edecessor commit
15f0: 2c 20 6d 69 6e 20 73 75 63 65 73 73 6f 72 20 63 , min sucessor c
1600: 6f 6d 6d 69 74 29 29 0a 0a 09 20 20 20 20 43 6f ommit))... Co
1610: 6d 70 75 74 65 4c 69 6d 69 74 73 20 24 63 73 65 mputeLimits $cse
1620: 74 20 6c 69 6d 69 74 73 20 62 6f 72 64 65 72 0a t limits border.
1630: 0a 09 20 20 20 20 6c 6f 67 20 77 72 69 74 65 20 .. log write
1640: 35 20 62 72 65 61 6b 61 63 79 63 6c 65 20 22 42 5 breakacycle "B
1650: 72 65 61 6b 69 6e 67 20 62 61 63 6b 77 61 72 64 reaking backward
1660: 20 63 68 61 6e 67 65 73 65 74 20 5b 24 63 73 65 changeset [$cse
1670: 74 20 73 74 72 5d 20 77 69 74 68 20 63 6f 6d 6d t str] with comm
1680: 69 74 20 70 6f 73 69 74 69 6f 6e 20 24 62 6f 72 it position $bor
1690: 64 65 72 20 61 73 20 62 6f 72 64 65 72 22 0a 0a der as border"..
16a0: 09 20 20 20 20 23 20 54 68 65 6e 20 77 65 20 73 . # Then we s
16b0: 6f 72 74 20 74 68 65 20 66 69 6c 65 20 6c 65 76 ort the file lev
16c0: 65 6c 20 69 74 65 6d 73 20 62 61 73 65 64 20 6f el items based o
16d0: 6e 20 74 68 65 72 65 20 74 68 65 79 0a 09 20 20 n there they..
16e0: 20 20 23 20 73 69 74 20 72 65 6c 61 74 69 76 65 # sit relative
16f0: 20 74 6f 20 74 68 65 20 62 6f 72 64 65 72 20 69 to the border i
1700: 6e 74 6f 20 62 65 66 6f 72 65 20 61 6e 64 20 61 nto before and a
1710: 66 74 65 72 20 74 68 65 0a 09 20 20 20 20 23 20 fter the.. #
1720: 62 6f 72 64 65 72 2e 0a 0a 09 20 20 20 20 53 70 border.... Sp
1730: 6c 69 74 52 65 76 69 73 69 6f 6e 73 20 24 6c 69 litRevisions $li
1740: 6d 69 74 73 20 24 62 6f 72 64 65 72 20 6e 6f 72 mits $border nor
1750: 6d 61 6c 72 65 76 69 73 69 6f 6e 73 20 62 61 63 malrevisions bac
1760: 6b 77 61 72 64 72 65 76 69 73 69 6f 6e 73 0a 0a kwardrevisions..
1770: 09 20 20 20 20 73 65 74 20 72 65 70 6c 61 63 65 . set replace
1780: 6d 65 6e 74 73 20 5b 70 72 6f 6a 65 63 74 3a 3a ments [project::
1790: 72 65 76 20 73 70 6c 69 74 20 24 63 73 65 74 20 rev split $cset
17a0: 24 6e 6f 72 6d 61 6c 72 65 76 69 73 69 6f 6e 73 $normalrevisions
17b0: 20 24 62 61 63 6b 77 61 72 64 72 65 76 69 73 69 $backwardrevisi
17c0: 6f 6e 73 5d 0a 09 20 20 20 20 63 79 63 6c 65 62 ons].. cycleb
17d0: 72 65 61 6b 65 72 20 72 65 70 6c 61 63 65 20 24 reaker replace $
17e0: 67 72 61 70 68 20 24 63 73 65 74 20 24 72 65 70 graph $cset $rep
17f0: 6c 61 63 65 6d 65 6e 74 73 0a 0a 09 20 20 20 20 lacements...
1800: 23 20 41 74 20 6c 61 73 74 20 63 68 65 63 6b 20 # At last check
1810: 74 68 61 74 20 74 68 65 20 6e 6f 72 6d 61 6c 20 that the normal
1820: 66 72 61 6d 65 6e 74 20 69 73 20 69 6e 64 65 65 frament is indee
1830: 64 20 6e 6f 74 0a 09 20 20 20 20 23 20 62 61 63 d not.. # bac
1840: 6b 77 61 72 64 2c 20 61 6e 64 20 69 74 65 72 61 kward, and itera
1850: 74 65 20 6f 76 65 72 20 74 68 65 20 70 6f 73 73 te over the poss
1860: 69 62 6c 79 20 73 74 69 6c 6c 20 62 61 63 6b 77 ibly still backw
1870: 61 72 64 0a 09 20 20 20 20 23 20 73 65 63 6f 6e ard.. # secon
1880: 64 20 66 72 61 67 6d 65 6e 74 2e 0a 0a 09 20 20 d fragment....
1890: 20 20 73 74 72 75 63 74 3a 3a 6c 69 73 74 20 61 struct::list a
18a0: 73 73 69 67 6e 20 24 72 65 70 6c 61 63 65 6d 65 ssign $replaceme
18b0: 6e 74 73 20 6e 6f 72 6d 61 6c 20 62 61 63 6b 77 nts normal backw
18c0: 61 72 64 0a 09 20 20 20 20 69 6e 74 65 67 72 69 ard.. integri
18d0: 74 79 20 61 73 73 65 72 74 20 7b 0a 09 09 21 5b ty assert {...![
18e0: 49 73 42 61 63 6b 77 61 72 64 20 24 67 72 61 70 IsBackward $grap
18f0: 68 20 24 6e 6f 72 6d 61 6c 5d 0a 09 20 20 20 20 h $normal]..
1900: 7d 20 7b 54 68 65 20 6e 6f 72 6d 61 6c 20 66 72 } {The normal fr
1910: 61 67 6d 65 6e 74 20 69 73 20 75 6e 65 78 70 65 agment is unexpe
1920: 63 74 65 64 6c 79 20 62 61 63 6b 77 61 72 64 7d ctedly backward}
1930: 0a 0a 09 20 20 20 20 73 65 74 20 63 73 65 74 20 ... set cset
1940: 24 62 61 63 6b 77 61 72 64 0a 09 7d 0a 09 72 65 $backward..}..re
1950: 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 20 20 turn. }..
1960: 70 72 6f 63 20 49 73 42 61 63 6b 77 61 72 64 20 proc IsBackward
1970: 7b 64 67 20 63 73 65 74 7d 20 7b 0a 09 23 20 41 {dg cset} {..# A
1980: 20 62 72 61 6e 63 68 20 69 73 20 22 62 61 63 6b branch is "back
1990: 77 61 72 64 22 20 69 66 20 69 74 20 68 61 73 20 ward" if it has
19a0: 61 74 20 6c 65 61 73 74 20 6f 6e 65 20 69 6e 63 at least one inc
19b0: 6f 6d 69 6e 67 0a 09 23 20 72 65 76 69 73 69 6f oming..# revisio
19c0: 6e 20 63 68 61 6e 67 65 73 65 74 20 77 68 69 63 n changeset whic
19d0: 68 20 69 73 20 63 6f 6d 6d 69 74 74 65 64 20 61 h is committed a
19e0: 66 74 65 72 20 61 74 20 6c 65 61 73 74 20 6f 6e fter at least on
19f0: 65 20 6f 66 0a 09 23 20 74 68 65 20 6f 75 74 67 e of..# the outg
1a00: 6f 69 6e 67 20 72 65 76 69 73 69 6f 6e 20 63 68 oing revision ch
1a10: 61 6e 67 65 73 65 74 73 2c 20 70 65 72 20 74 68 angesets, per th
1a20: 65 20 6f 72 64 65 72 20 63 6f 6d 70 75 74 65 64 e order computed
1a30: 20 69 6e 0a 09 23 20 70 61 73 73 20 36 2e 0a 0a in..# pass 6...
1a40: 09 23 20 52 65 70 68 72 61 73 65 64 2c 20 74 68 .# Rephrased, th
1a50: 65 20 6d 61 78 69 6d 61 6c 20 63 6f 6d 6d 69 74 e maximal commit
1a60: 20 70 6f 73 69 74 69 6f 6e 20 66 6f 75 6e 64 20 position found
1a70: 61 6d 6f 6e 67 20 74 68 65 0a 09 23 20 69 6e 63 among the..# inc
1a80: 6f 6d 69 6e 67 20 72 65 76 69 73 69 6f 6e 20 63 oming revision c
1a90: 68 61 6e 67 65 73 65 74 73 20 69 73 20 6c 61 72 hangesets is lar
1aa0: 67 65 72 20 74 68 61 6e 20 74 68 65 20 6d 69 6e ger than the min
1ab0: 69 6d 61 6c 0a 09 23 20 63 6f 6d 6d 69 74 20 70 imal..# commit p
1ac0: 6f 73 69 74 69 6f 6e 20 66 6f 75 6e 64 20 61 6d osition found am
1ad0: 6f 6e 67 20 74 68 65 20 6f 75 74 67 6f 69 6e 67 ong the outgoing
1ae0: 20 72 65 76 69 73 69 6f 6e 0a 09 23 20 63 68 61 revision..# cha
1af0: 6e 67 65 73 65 74 73 2e 20 41 73 73 75 6d 69 6e ngesets. Assumin
1b00: 67 20 74 68 61 74 20 77 65 20 68 61 76 65 20 62 g that we have b
1b10: 6f 74 68 20 69 6e 63 6f 6d 69 6e 67 20 61 6e 64 oth incoming and
1b20: 20 6f 75 74 67 6f 69 6e 67 0a 09 23 20 72 65 76 outgoing..# rev
1b30: 69 73 69 6f 6e 20 63 68 61 6e 67 65 73 65 74 73 ision changesets
1b40: 2e 0a 0a 09 23 20 54 68 65 20 68 65 6c 70 65 72 ....# The helper
1b50: 20 22 50 6f 73 69 74 69 6f 6e 73 22 20 63 6f 6d "Positions" com
1b60: 70 75 74 65 73 20 74 68 65 20 73 65 74 20 6f 66 putes the set of
1b70: 20 63 6f 6d 6d 69 74 20 70 6f 73 69 74 69 6f 6e commit position
1b80: 73 0a 09 23 20 66 6f 72 20 61 20 73 65 74 20 6f s..# for a set o
1b90: 66 20 63 68 61 6e 67 65 73 65 74 73 2c 20 77 68 f changesets, wh
1ba0: 69 63 68 20 63 61 6e 20 62 65 20 61 20 6d 69 78 ich can be a mix
1bb0: 20 6f 66 20 72 65 76 69 73 69 6f 6e 20 61 6e 64 of revision and
1bc0: 0a 09 23 20 73 79 6d 62 6f 6c 20 63 68 61 6e 67 ..# symbol chang
1bd0: 65 73 65 74 73 2e 0a 0a 09 73 65 74 20 70 72 65 esets....set pre
1be0: 64 65 63 65 73 73 6f 72 73 20 5b 50 6f 73 69 74 decessors [Posit
1bf0: 69 6f 6e 73 20 5b 24 64 67 20 6e 6f 64 65 73 20 ions [$dg nodes
1c00: 2d 69 6e 20 20 24 63 73 65 74 5d 5d 0a 09 73 65 -in $cset]]..se
1c10: 74 20 73 75 63 63 65 73 73 6f 72 73 20 20 20 5b t successors [
1c20: 50 6f 73 69 74 69 6f 6e 73 20 5b 24 64 67 20 6e Positions [$dg n
1c30: 6f 64 65 73 20 2d 6f 75 74 20 24 63 73 65 74 5d odes -out $cset]
1c40: 5d 0a 0a 09 72 65 74 75 72 6e 20 5b 65 78 70 72 ]...return [expr
1c50: 20 7b 0a 09 09 20 20 20 20 20 20 5b 6c 6c 65 6e {... [llen
1c60: 67 74 68 20 24 70 72 65 64 65 63 65 73 73 6f 72 gth $predecessor
1c70: 73 5d 20 26 26 0a 09 09 20 20 20 20 20 20 5b 6c s] &&... [l
1c80: 6c 65 6e 67 74 68 20 24 73 75 63 63 65 73 73 6f length $successo
1c90: 72 73 5d 20 20 20 26 26 0a 09 09 20 20 20 20 20 rs] &&...
1ca0: 20 28 5b 6d 61 78 20 24 70 72 65 64 65 63 65 73 ([max $predeces
1cb0: 73 6f 72 73 5d 20 3e 3d 20 5b 6d 69 6e 20 24 73 sors] >= [min $s
1cc0: 75 63 63 65 73 73 6f 72 73 5d 29 0a 09 09 20 20 uccessors])...
1cd0: 7d 5d 0a 20 20 20 20 7d 0a 0a 20 20 20 20 70 72 }]. }.. pr
1ce0: 6f 63 20 50 6f 73 69 74 69 6f 6e 73 20 7b 63 68 oc Positions {ch
1cf0: 61 6e 67 65 73 65 74 73 7d 20 7b 0a 09 23 20 54 angesets} {..# T
1d00: 6f 20 63 6f 6d 70 75 74 65 20 74 68 65 20 73 65 o compute the se
1d10: 74 20 6f 66 20 63 6f 6d 6d 69 74 20 70 6f 73 69 t of commit posi
1d20: 74 69 6f 6e 73 20 66 72 6f 6d 20 74 68 65 20 73 tions from the s
1d30: 65 74 20 6f 66 0a 09 23 20 63 68 61 6e 67 65 73 et of..# changes
1d40: 65 74 73 20 77 65 20 66 69 72 73 74 20 6d 61 70 ets we first map
1d50: 20 65 61 63 68 20 63 68 61 6e 67 65 73 65 74 20 each changeset
1d60: 74 6f 20 69 74 73 20 70 6f 73 69 74 69 6f 6e 20 to its position
1d70: 28 2a 29 0a 09 23 20 61 6e 64 20 74 68 65 6e 20 (*)..# and then
1d80: 66 69 6c 74 65 72 20 6f 75 74 20 74 68 65 20 69 filter out the i
1d90: 6e 76 61 6c 69 64 20 72 65 73 70 6f 6e 73 65 73 nvalid responses
1da0: 20 28 74 68 65 20 65 6d 70 74 79 20 73 74 72 69 (the empty stri
1db0: 6e 67 29 0a 09 23 20 72 65 74 75 72 6e 65 64 20 ng)..# returned
1dc0: 62 79 20 74 68 65 20 73 79 6d 62 6f 6c 20 63 68 by the symbol ch
1dd0: 61 6e 67 65 73 65 74 73 2e 0a 09 23 0a 09 23 20 angesets...#..#
1de0: 28 2a 29 20 54 68 69 73 20 64 61 74 61 20 77 61 (*) This data wa
1df0: 73 20 6c 6f 61 64 65 64 20 69 6e 74 6f 20 6d 65 s loaded into me
1e00: 6d 6f 72 79 20 65 61 72 6c 69 72 20 69 6e 20 74 mory earlir in t
1e10: 68 65 20 70 61 73 73 2c 20 62 79 0a 09 23 20 20 he pass, by..#
1e20: 20 20 20 4c 6f 61 64 43 6f 6d 6d 69 74 4f 72 64 LoadCommitOrd
1e30: 65 72 2e 0a 0a 09 72 65 74 75 72 6e 20 5b 73 74 er....return [st
1e40: 72 75 63 74 3a 3a 6c 69 73 74 20 66 69 6c 74 65 ruct::list filte
1e50: 72 20 5b 73 74 72 75 63 74 3a 3a 6c 69 73 74 20 r [struct::list
1e60: 6d 61 70 20 24 63 68 61 6e 67 65 73 65 74 73 20 map $changesets
1e70: 5c 0a 09 09 09 09 09 20 5b 6d 79 70 72 6f 63 20 \...... [myproc
1e80: 54 6f 50 6f 73 69 74 69 6f 6e 5d 5d 20 5c 0a 09 ToPosition]] \..
1e90: 09 20 20 20 20 5b 6d 79 70 72 6f 63 20 56 61 6c . [myproc Val
1ea0: 69 64 50 6f 73 69 74 69 6f 6e 5d 5d 0a 20 20 20 idPosition]].
1eb0: 20 7d 0a 0a 20 20 20 20 70 72 6f 63 20 54 6f 50 }.. proc ToP
1ec0: 6f 73 69 74 69 6f 6e 20 20 20 20 7b 63 73 65 74 osition {cset
1ed0: 7d 20 7b 20 24 63 73 65 74 20 70 6f 73 20 7d 0a } { $cset pos }.
1ee0: 20 20 20 20 70 72 6f 63 20 56 61 6c 69 64 50 6f proc ValidPo
1ef0: 73 69 74 69 6f 6e 20 7b 70 6f 73 7d 20 20 7b 20 sition {pos} {
1f00: 65 78 70 72 20 7b 24 70 6f 73 20 6e 65 20 22 22 expr {$pos ne ""
1f10: 7d 20 7d 0a 0a 20 20 20 20 70 72 6f 63 20 43 6f } }.. proc Co
1f20: 6d 70 75 74 65 4c 69 6d 69 74 73 20 7b 63 73 65 mputeLimits {cse
1f30: 74 20 6c 76 20 62 76 7d 20 7b 0a 09 75 70 76 61 t lv bv} {..upva
1f40: 72 20 31 20 24 6c 76 20 74 68 65 6c 69 6d 69 74 r 1 $lv thelimit
1f50: 73 20 24 62 76 20 62 6f 72 64 65 72 0a 0a 09 23 s $bv border...#
1f60: 20 49 6e 69 74 69 61 6c 69 7a 65 20 74 68 65 20 Initialize the
1f70: 62 6f 75 6e 64 61 72 69 65 73 20 66 6f 72 20 61 boundaries for a
1f80: 6c 6c 20 72 65 76 69 73 69 6f 6e 73 2e 0a 0a 09 ll revisions....
1f90: 61 72 72 61 79 20 73 65 74 20 6c 69 6d 69 74 73 array set limits
1fa0: 20 7b 7d 0a 09 66 6f 72 65 61 63 68 20 72 65 76 {}..foreach rev
1fb0: 69 73 69 6f 6e 20 5b 24 63 73 65 74 20 72 65 76 ision [$cset rev
1fc0: 69 73 69 6f 6e 73 5d 20 7b 0a 09 20 20 20 20 73 isions] {.. s
1fd0: 65 74 20 6c 69 6d 69 74 73 28 24 72 65 76 69 73 et limits($revis
1fe0: 69 6f 6e 29 20 7b 30 20 7b 7d 7d 0a 09 7d 0a 0a ion) {0 {}}..}..
1ff0: 09 23 20 43 6f 6d 70 75 74 65 20 61 6e 64 20 73 .# Compute and s
2000: 74 6f 72 65 20 74 68 65 20 6d 61 78 69 6d 61 6c tore the maximal
2010: 20 70 72 65 64 65 63 65 73 73 6f 72 73 20 70 65 predecessors pe
2020: 72 20 72 65 76 69 73 69 6f 6e 0a 0a 09 66 6f 72 r revision...for
2030: 65 61 63 68 20 7b 72 65 76 69 73 69 6f 6e 20 63 each {revision c
2040: 73 65 74 73 7d 20 5b 24 63 73 65 74 20 70 72 65 sets} [$cset pre
2050: 64 65 63 65 73 73 6f 72 6d 61 70 5d 20 7b 0a 09 decessormap] {..
2060: 20 20 20 20 73 65 74 20 73 20 5b 50 6f 73 69 74 set s [Posit
2070: 69 6f 6e 73 20 24 63 73 65 74 73 5d 0a 09 20 20 ions $csets]..
2080: 20 20 69 66 20 7b 21 5b 6c 6c 65 6e 67 74 68 20 if {![llength
2090: 24 73 5d 7d 20 63 6f 6e 74 69 6e 75 65 0a 09 20 $s]} continue..
20a0: 20 20 20 73 65 74 20 6c 69 6d 69 74 73 28 24 72 set limits($r
20b0: 65 76 69 73 69 6f 6e 29 20 5b 6c 72 65 70 6c 61 evision) [lrepla
20c0: 63 65 20 24 6c 69 6d 69 74 73 28 24 72 65 76 69 ce $limits($revi
20d0: 73 69 6f 6e 29 20 30 20 30 20 5b 6d 61 78 20 24 sion) 0 0 [max $
20e0: 73 5d 5d 0a 09 7d 0a 0a 09 23 20 43 6f 6d 70 75 s]]..}...# Compu
20f0: 74 65 20 61 6e 64 20 73 74 6f 72 65 20 74 68 65 te and store the
2100: 20 6d 69 6e 69 6d 61 6c 20 73 75 63 63 65 73 73 minimal success
2110: 6f 72 73 20 70 65 72 20 72 65 76 69 73 69 6f 6e ors per revision
2120: 0a 0a 09 66 6f 72 65 61 63 68 20 7b 72 65 76 69 ...foreach {revi
2130: 73 69 6f 6e 20 63 73 65 74 73 7d 20 5b 24 63 73 sion csets} [$cs
2140: 65 74 20 73 75 63 63 65 73 73 6f 72 6d 61 70 5d et successormap]
2150: 20 7b 0a 09 20 20 20 20 73 65 74 20 73 20 5b 50 {.. set s [P
2160: 6f 73 69 74 69 6f 6e 73 20 24 63 73 65 74 73 5d ositions $csets]
2170: 0a 09 20 20 20 20 69 66 20 7b 21 5b 6c 6c 65 6e .. if {![llen
2180: 67 74 68 20 24 73 5d 7d 20 63 6f 6e 74 69 6e 75 gth $s]} continu
2190: 65 0a 09 20 20 20 20 73 65 74 20 6c 69 6d 69 74 e.. set limit
21a0: 73 28 24 72 65 76 69 73 69 6f 6e 29 20 5b 6c 72 s($revision) [lr
21b0: 65 70 6c 61 63 65 20 24 6c 69 6d 69 74 73 28 24 eplace $limits($
21c0: 72 65 76 69 73 69 6f 6e 29 20 31 20 31 20 5b 6d revision) 1 1 [m
21d0: 69 6e 20 24 73 5d 5d 0a 09 7d 0a 0a 09 23 20 43 in $s]]..}...# C
21e0: 68 65 63 6b 20 74 68 61 74 20 74 68 65 20 6f 72 heck that the or
21f0: 64 65 72 69 6e 67 20 61 74 20 74 68 65 20 66 69 dering at the fi
2200: 6c 65 20 6c 65 76 65 6c 20 69 73 20 63 6f 72 72 le level is corr
2210: 65 63 74 2e 20 57 65 0a 09 23 20 63 61 6e 6e 6f ect. We..# canno
2220: 74 20 68 61 76 65 20 62 61 63 6b 77 61 72 64 20 t have backward
2230: 6f 72 64 65 72 69 6e 67 20 70 65 72 20 72 65 76 ordering per rev
2240: 69 73 69 6f 6e 2c 20 6f 72 20 73 6f 6d 65 74 68 ision, or someth
2250: 69 6e 67 20 69 73 0a 09 23 20 77 72 6f 6e 67 2e ing is..# wrong.
2260: 0a 0a 09 66 6f 72 65 61 63 68 20 72 65 76 69 73 ...foreach revis
2270: 69 6f 6e 20 5b 61 72 72 61 79 20 6e 61 6d 65 73 ion [array names
2280: 20 6c 69 6d 69 74 73 5d 20 7b 0a 09 20 20 20 20 limits] {..
2290: 73 74 72 75 63 74 3a 3a 6c 69 73 74 20 61 73 73 struct::list ass
22a0: 69 67 6e 20 24 6c 69 6d 69 74 73 28 24 72 65 76 ign $limits($rev
22b0: 69 73 69 6f 6e 29 20 6d 61 78 70 20 6d 69 6e 73 ision) maxp mins
22c0: 0a 09 20 20 20 20 23 20 48 61 6e 64 6c 65 20 6d .. # Handle m
22d0: 69 6e 20 73 75 63 63 65 73 73 6f 72 20 70 6f 73 in successor pos
22e0: 69 74 69 6f 6e 20 22 22 20 61 73 20 72 65 70 72 ition "" as repr
22f0: 65 73 65 6e 74 69 6e 67 20 69 6e 66 69 6e 69 74 esenting infinit
2300: 79 0a 09 20 20 20 20 69 6e 74 65 67 72 69 74 79 y.. integrity
2310: 20 61 73 73 65 72 74 20 7b 0a 09 09 28 24 6d 69 assert {...($mi
2320: 6e 73 20 65 71 20 22 22 29 20 7c 7c 20 28 24 6d ns eq "") || ($m
2330: 61 78 70 20 3c 20 24 6d 69 6e 73 29 20 0a 09 20 axp < $mins) ..
2340: 20 20 20 7d 20 7b 42 72 61 6e 63 68 20 72 65 76 } {Branch rev
2350: 69 73 69 6f 6e 20 24 72 65 76 69 73 69 6f 6e 20 ision $revision
2360: 69 73 20 62 61 63 6b 77 61 72 64 20 61 74 20 66 is backward at f
2370: 69 6c 65 20 6c 65 76 65 6c 20 28 24 6d 61 78 70 ile level ($maxp
2380: 20 3e 3d 20 24 6d 69 6e 73 29 7d 0a 09 7d 0a 0a >= $mins)}..}..
2390: 09 23 20 53 61 76 65 20 74 68 65 20 6c 69 6d 69 .# Save the limi
23a0: 74 73 20 66 6f 72 20 74 68 65 20 73 70 6c 69 74 ts for the split
23b0: 74 65 72 2c 20 61 6e 64 20 63 6f 6d 70 75 74 65 ter, and compute
23c0: 20 74 68 65 20 62 6f 72 64 65 72 20 61 74 0a 09 the border at..
23d0: 23 20 77 68 69 63 68 20 74 6f 20 73 70 6c 69 74 # which to split
23e0: 20 61 73 20 74 68 65 20 6d 69 6e 69 6d 75 6d 20 as the minimum
23f0: 6f 66 20 61 6c 6c 20 6d 69 6e 69 6d 61 6c 20 73 of all minimal s
2400: 75 63 63 65 73 73 6f 72 0a 09 23 20 70 6f 73 69 uccessor..# posi
2410: 74 69 6f 6e 73 2e 0a 0a 09 73 65 74 20 74 68 65 tions....set the
2420: 6c 69 6d 69 74 73 20 5b 61 72 72 61 79 20 67 65 limits [array ge
2430: 74 20 6c 69 6d 69 74 73 5d 0a 09 73 65 74 20 62 t limits]..set b
2440: 6f 72 64 65 72 20 5b 6d 69 6e 20 5b 73 74 72 75 order [min [stru
2450: 63 74 3a 3a 6c 69 73 74 20 66 69 6c 74 65 72 20 ct::list filter
2460: 5b 73 74 72 75 63 74 3a 3a 6c 69 73 74 20 6d 61 [struct::list ma
2470: 70 20 5b 56 61 6c 75 65 73 20 24 74 68 65 6c 69 p [Values $theli
2480: 6d 69 74 73 5d 20 5c 0a 09 09 09 09 09 09 20 20 mits] \.......
2490: 5b 6d 79 70 72 6f 63 20 4d 69 6e 53 75 63 63 65 [myproc MinSucce
24a0: 73 73 6f 72 50 6f 73 69 74 69 6f 6e 5d 5d 20 5c ssorPosition]] \
24b0: 0a 09 09 09 20 20 20 20 20 5b 6d 79 70 72 6f 63 .... [myproc
24c0: 20 56 61 6c 69 64 50 6f 73 69 74 69 6f 6e 5d 5d ValidPosition]]
24d0: 5d 0a 09 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a ]..return. }.
24e0: 0a 20 20 20 20 70 72 6f 63 20 56 61 6c 75 65 73 . proc Values
24f0: 20 7b 64 69 63 74 7d 20 7b 0a 09 73 65 74 20 72 {dict} {..set r
2500: 65 73 20 7b 7d 0a 09 66 6f 72 65 61 63 68 20 7b es {}..foreach {
2510: 6b 20 76 7d 20 24 64 69 63 74 20 7b 20 6c 61 70 k v} $dict { lap
2520: 70 65 6e 64 20 72 65 73 20 24 76 20 7d 0a 09 72 pend res $v }..r
2530: 65 74 75 72 6e 20 24 72 65 73 0a 20 20 20 20 7d eturn $res. }
2540: 0a 0a 20 20 20 20 70 72 6f 63 20 4d 69 6e 53 75 .. proc MinSu
2550: 63 63 65 73 73 6f 72 50 6f 73 69 74 69 6f 6e 20 ccessorPosition
2560: 7b 69 74 65 6d 7d 20 7b 20 6c 69 6e 64 65 78 20 {item} { lindex
2570: 24 69 74 65 6d 20 31 20 7d 0a 0a 20 20 20 20 70 $item 1 }.. p
2580: 72 6f 63 20 53 70 6c 69 74 52 65 76 69 73 69 6f roc SplitRevisio
2590: 6e 73 20 7b 6c 69 6d 69 74 73 20 62 6f 72 64 65 ns {limits borde
25a0: 72 20 6e 76 20 62 76 7d 20 7b 0a 09 75 70 76 61 r nv bv} {..upva
25b0: 72 20 31 20 24 6e 76 20 6e 6f 72 6d 61 6c 72 65 r 1 $nv normalre
25c0: 76 69 73 69 6f 6e 73 20 24 62 76 20 62 61 63 6b visions $bv back
25d0: 77 61 72 64 72 65 76 69 73 69 6f 6e 73 0a 0a 09 wardrevisions...
25e0: 73 65 74 20 6e 6f 72 6d 61 6c 72 65 76 69 73 69 set normalrevisi
25f0: 6f 6e 73 20 20 20 7b 7d 0a 09 73 65 74 20 62 61 ons {}..set ba
2600: 63 6b 77 61 72 64 72 65 76 69 73 69 6f 6e 73 20 ckwardrevisions
2610: 7b 7d 0a 0a 09 66 6f 72 65 61 63 68 20 7b 72 65 {}...foreach {re
2620: 76 20 76 7d 20 24 6c 69 6d 69 74 73 20 7b 0a 09 v v} $limits {..
2630: 20 20 20 20 73 74 72 75 63 74 3a 3a 6c 69 73 74 struct::list
2640: 20 61 73 73 69 67 6e 20 24 76 20 6d 61 78 70 20 assign $v maxp
2650: 6d 69 6e 73 0a 09 20 20 20 20 69 66 20 7b 24 6d mins.. if {$m
2660: 61 78 70 20 3e 3d 20 24 62 6f 72 64 65 72 7d 20 axp >= $border}
2670: 7b 0a 09 09 6c 61 70 70 65 6e 64 20 62 61 63 6b {...lappend back
2680: 77 61 72 64 72 65 76 69 73 69 6f 6e 73 20 20 24 wardrevisions $
2690: 72 65 76 0a 09 20 20 20 20 7d 20 65 6c 73 65 20 rev.. } else
26a0: 7b 0a 09 09 6c 61 70 70 65 6e 64 20 6e 6f 72 6d {...lappend norm
26b0: 61 6c 72 65 76 69 73 69 6f 6e 73 20 24 72 65 76 alrevisions $rev
26c0: 0a 09 20 20 20 20 7d 0a 09 7d 0a 0a 09 69 6e 74 .. }..}...int
26d0: 65 67 72 69 74 79 20 61 73 73 65 72 74 20 7b 5b egrity assert {[
26e0: 6c 6c 65 6e 67 74 68 20 24 6e 6f 72 6d 61 6c 72 llength $normalr
26f0: 65 76 69 73 69 6f 6e 73 5d 7d 20 20 20 7b 53 65 evisions]} {Se
2700: 74 20 6f 66 20 6e 6f 72 6d 61 6c 20 72 65 76 69 t of normal revi
2710: 73 69 6f 6e 73 20 69 73 20 65 6d 70 74 79 7d 0a sions is empty}.
2720: 09 69 6e 74 65 67 72 69 74 79 20 61 73 73 65 72 .integrity asser
2730: 74 20 7b 5b 6c 6c 65 6e 67 74 68 20 24 62 61 63 t {[llength $bac
2740: 6b 77 61 72 64 72 65 76 69 73 69 6f 6e 73 5d 7d kwardrevisions]}
2750: 20 7b 53 65 74 20 6f 66 20 62 61 63 6b 77 61 72 {Set of backwar
2760: 64 20 72 65 76 69 73 69 6f 6e 73 20 69 73 20 65 d revisions is e
2770: 6d 70 74 79 7d 0a 09 72 65 74 75 72 6e 0a 20 20 mpty}..return.
2780: 20 20 7d 0a 0a 0a 20 20 20 20 23 20 23 20 23 23 }... # # ##
2790: 20 23 23 23 20 23 23 23 23 23 20 23 23 23 23 23 ### ##### #####
27a0: 23 23 23 20 23 23 23 23 23 23 23 23 23 23 23 23 ### ############
27b0: 23 0a 0a 20 20 20 20 70 72 6f 63 20 4b 65 65 70 #.. proc Keep
27c0: 4f 72 64 65 72 20 7b 67 72 61 70 68 20 61 74 20 Order {graph at
27d0: 63 73 65 74 7d 20 7b 0a 09 3a 3a 76 61 72 69 61 cset} {..::varia
27e0: 62 6c 65 20 6d 79 61 74 66 6d 74 0a 09 3a 3a 76 ble myatfmt..::v
27f0: 61 72 69 61 62 6c 65 20 6d 79 63 73 66 6d 74 0a ariable mycsfmt.
2800: 0a 09 73 65 74 20 63 69 64 20 5b 24 63 73 65 74 ..set cid [$cset
2810: 20 69 64 5d 0a 0a 09 6c 6f 67 20 77 72 69 74 65 id]...log write
2820: 20 38 20 62 72 65 61 6b 61 63 79 63 6c 65 20 22 8 breakacycle "
2830: 43 68 61 6e 67 65 73 65 74 20 40 20 5b 66 6f 72 Changeset @ [for
2840: 6d 61 74 20 24 6d 79 61 74 66 6d 74 20 24 61 74 mat $myatfmt $at
2850: 5d 3a 20 5b 66 6f 72 6d 61 74 20 24 6d 79 63 73 ]: [format $mycs
2860: 66 6d 74 20 5b 24 63 73 65 74 20 73 74 72 5d 5d fmt [$cset str]]
2870: 20 3c 3c 5b 46 6f 72 6d 61 74 54 52 20 24 67 72 <<[FormatTR $gr
2880: 61 70 68 20 24 63 73 65 74 5d 3e 3e 22 0a 0a 09 aph $cset]>>"...
2890: 23 20 57 65 20 73 65 65 20 68 65 72 65 20 61 20 # We see here a
28a0: 6d 69 78 74 75 72 65 20 6f 66 20 73 79 6d 62 6f mixture of symbo
28b0: 6c 20 61 6e 64 20 72 65 76 69 73 69 6f 6e 20 63 l and revision c
28c0: 68 61 6e 67 65 73 65 74 73 2e 0a 09 23 20 54 68 hangesets...# Th
28d0: 65 20 73 79 6d 62 6f 6c 20 63 68 61 6e 67 65 73 e symbol changes
28e0: 65 74 73 20 61 72 65 20 69 67 6e 6f 72 65 64 20 ets are ignored
28f0: 61 73 20 69 72 72 65 6c 65 76 61 6e 74 2e 0a 0a as irrelevant...
2900: 09 69 66 20 7b 5b 24 63 73 65 74 20 70 6f 73 5d .if {[$cset pos]
2910: 20 65 71 20 22 22 7d 20 72 65 74 75 72 6e 0a 0a eq ""} return..
2920: 09 23 20 46 6f 72 20 74 68 65 20 72 65 76 69 73 .# For the revis
2930: 69 6f 6e 20 63 68 61 6e 67 65 73 65 74 73 20 77 ion changesets w
2940: 65 20 61 72 65 20 73 75 72 65 20 74 68 61 74 20 e are sure that
2950: 74 68 65 79 20 61 72 65 0a 09 23 20 63 6f 6e 73 they are..# cons
2960: 75 6d 65 64 20 69 6e 20 74 68 65 20 73 61 6d 65 umed in the same
2970: 20 6f 72 64 65 72 20 61 73 20 67 65 6e 65 72 61 order as genera
2980: 74 65 64 20 62 79 20 70 61 73 73 20 37 0a 09 23 ted by pass 7..#
2990: 20 28 52 65 76 54 6f 70 6f 6c 6f 67 69 63 61 6c (RevTopological
29a0: 53 6f 72 74 29 2e 20 50 65 72 20 74 68 65 20 63 Sort). Per the c
29b0: 6f 64 65 20 69 6e 20 63 76 73 32 73 76 6e 2e 0a ode in cvs2svn..
29c0: 0a 09 23 20 49 4d 48 4f 20 74 68 69 73 20 77 69 ..# IMHO this wi
29d0: 6c 6c 20 77 6f 72 6b 20 69 66 20 61 6e 64 20 6f ll work if and o
29e0: 6e 6c 79 20 69 66 20 6e 6f 6e 65 20 6f 66 20 74 nly if none of t
29f0: 68 65 20 73 79 6d 62 6f 6c 0a 09 23 20 63 68 61 he symbol..# cha
2a00: 6e 67 65 73 65 74 73 20 61 72 65 20 22 62 61 63 ngesets are "bac
2a10: 6b 77 61 72 64 73 22 2c 20 77 68 69 63 68 20 65 kwards", which e
2a20: 78 70 6c 61 69 6e 73 20 74 68 65 20 62 72 65 61 xplains the brea
2a30: 6b 69 6e 67 20 6f 66 0a 09 23 20 74 68 65 20 62 king of..# the b
2a40: 61 63 6b 77 61 72 64 20 63 68 61 6e 67 65 73 65 ackward changese
2a50: 74 73 20 66 69 72 73 74 2c 20 69 6e 20 74 68 65 ts first, in the
2a60: 20 70 72 65 2d 68 6f 6f 6b 2e 20 41 20 64 69 66 pre-hook. A dif
2a70: 66 65 72 65 6e 63 65 0a 09 23 20 74 6f 20 63 76 ference..# to cv
2a80: 73 32 73 76 6e 20 68 6f 77 65 76 65 72 20 69 73 s2svn however is
2a90: 20 74 68 61 74 20 77 65 20 61 72 65 20 62 72 65 that we are bre
2aa0: 61 6b 69 6e 67 20 61 6c 6c 20 62 61 63 6b 77 61 aking all backwa
2ab0: 72 64 0a 09 23 20 73 79 6d 62 6f 6c 20 63 68 61 rd..# symbol cha
2ac0: 6e 67 65 73 65 74 73 2c 20 62 6f 74 68 20 62 72 ngesets, both br
2ad0: 61 6e 63 68 20 61 6e 64 20 74 61 67 2e 20 63 76 anch and tag. cv
2ae0: 73 32 73 76 6e 20 63 61 6e 0a 09 23 20 61 70 70 s2svn can..# app
2af0: 61 72 65 6e 74 6c 79 20 61 73 73 75 6d 65 20 68 arently assume h
2b00: 65 72 65 20 74 68 61 74 20 74 61 67 20 73 79 6d ere that tag sym
2b10: 62 6f 6c 20 63 68 61 6e 67 65 73 65 74 73 20 61 bol changesets a
2b20: 72 65 20 6e 6f 74 0a 09 23 20 62 61 63 6b 77 61 re not..# backwa
2b30: 72 64 73 2c 20 65 76 65 72 2e 20 57 65 20 63 61 rds, ever. We ca
2b40: 6e 27 74 2c 20 61 70 70 61 72 65 6e 74 6c 79 2e n't, apparently.
2b50: 20 49 74 20 69 73 20 75 6e 63 6c 65 61 72 20 74 It is unclear t
2b60: 6f 20 6d 65 0a 09 23 20 77 68 65 72 65 20 74 68 o me..# where th
2b70: 65 20 64 69 66 66 65 72 65 6e 63 65 20 69 73 2e e difference is.
2b80: 0a 0a 09 23 20 41 6e 20 69 6e 74 65 72 65 73 74 ...# An interest
2b90: 69 6e 67 20 74 68 69 6e 67 20 49 4d 48 4f 2c 20 ing thing IMHO,
2ba0: 69 73 20 74 68 61 74 20 61 66 74 65 72 20 62 72 is that after br
2bb0: 65 61 6b 69 6e 67 20 62 61 63 6b 77 61 72 64 0a eaking backward.
2bc0: 09 23 20 73 79 6d 62 6f 6c 20 63 68 61 6e 67 65 .# symbol change
2bd0: 73 65 74 73 20 77 65 20 73 68 6f 75 6c 64 20 6e sets we should n
2be0: 6f 74 20 68 61 76 65 20 61 6e 79 20 63 69 72 63 ot have any circ
2bf0: 6c 65 73 20 61 6e 79 0a 09 23 20 6c 6f 6e 67 65 les any..# longe
2c00: 72 2e 20 45 61 63 68 20 63 69 72 63 6c 65 20 77 r. Each circle w
2c10: 68 69 63 68 20 77 61 73 20 73 74 69 6c 6c 20 70 hich was still p
2c20: 72 65 73 65 6e 74 20 68 61 64 20 74 6f 20 69 6e resent had to in
2c30: 76 6f 6c 76 65 20 61 0a 09 23 20 62 61 63 6b 77 volve a..# backw
2c40: 61 72 64 20 73 79 6d 62 6f 6c 2c 20 61 6e 64 20 ard symbol, and
2c50: 74 68 61 74 20 77 65 20 73 70 6c 69 74 2e 0a 0a that we split...
2c60: 09 23 20 50 72 6f 6f 66 3a 20 4c 65 74 20 75 73 .# Proof: Let us
2c70: 20 61 73 73 75 6d 65 20 77 65 20 74 68 61 74 20 assume we that
2c80: 68 61 76 65 20 61 20 63 69 72 63 6c 65 0a 09 23 have a circle..#
2c90: 20 09 43 3a 20 52 31 20 2d 3e 20 2e 2e 2e 20 2d .C: R1 -> ... -
2ca0: 3e 20 52 78 20 2d 3e 20 53 20 2d 3e 20 52 79 20 > Rx -> S -> Ry
2cb0: 2d 3e 20 2e 2e 2e 20 2d 3e 20 52 6e 20 2d 3e 20 -> ... -> Rn ->
2cc0: 52 31 0a 09 23 20 4c 65 74 20 75 73 20 66 75 72 R1..# Let us fur
2cd0: 74 68 65 72 20 61 73 73 75 6d 65 20 74 68 61 74 ther assume that
2ce0: 20 53 20 69 73 20 6e 6f 74 20 62 61 63 6b 77 61 S is not backwa
2cf0: 72 64 2e 20 54 68 61 74 20 6d 65 61 6e 73 0a 09 rd. That means..
2d00: 23 20 4f 52 44 28 52 78 29 20 3c 20 4f 52 44 28 # ORD(Rx) < ORD(
2d10: 52 79 29 2e 20 20 54 68 65 20 65 61 72 6c 69 65 Ry). The earlie
2d20: 72 20 74 6f 70 6f 6c 6f 67 69 63 61 6c 20 73 6f r topological so
2d30: 72 74 69 6e 67 20 77 69 74 68 6f 75 74 0a 09 23 rting without..#
2d40: 20 73 79 6d 62 6f 6c 73 20 6e 6f 77 20 66 6f 72 symbols now for
2d50: 63 65 73 20 74 68 69 73 20 72 65 6c 61 74 69 6f ces this relatio
2d60: 6e 73 68 69 70 20 74 68 72 6f 75 67 68 20 74 6f nship through to
2d70: 20 62 65 0a 09 23 09 4f 52 44 28 52 78 29 20 3c be..#.ORD(Rx) <
2d80: 20 4f 52 44 28 52 31 29 20 3c 20 4f 52 44 28 52 ORD(R1) < ORD(R
2d90: 78 29 2e 0a 09 23 20 57 65 20 68 61 76 65 20 72 x)...# We have r
2da0: 65 61 63 68 65 64 20 61 6e 20 69 6d 70 6f 73 73 eached an imposs
2db0: 69 62 69 6c 69 74 79 2c 20 61 20 70 61 72 61 64 ibility, a parad
2dc0: 6f 78 2e 20 4f 75 72 20 69 6e 69 74 69 61 6c 0a ox. Our initial.
2dd0: 09 23 20 61 73 73 75 6d 70 74 69 6f 6e 20 6f 66 .# assumption of
2de0: 20 53 20 6e 6f 74 20 62 65 69 6e 67 20 62 61 63 S not being bac
2df0: 6b 77 61 72 64 20 63 61 6e 6e 6f 74 20 68 6f 6c kward cannot hol
2e00: 64 2e 0a 09 23 0a 09 23 20 41 6c 74 65 72 6e 61 d...#..# Alterna
2e10: 74 65 2c 20 64 69 72 65 63 74 2c 20 72 65 61 73 te, direct, reas
2e20: 6f 6e 69 6e 67 3a 20 57 69 74 68 6f 75 74 20 53 oning: Without S
2e30: 20 74 68 65 20 63 68 61 69 6e 20 6f 66 0a 09 23 the chain of..#
2e40: 20 64 65 70 65 6e 64 65 6e 63 69 65 73 20 69 73 dependencies is
2e50: 20 52 79 20 2d 3e 20 2e 2e 20 2d 3e 20 52 31 20 Ry -> .. -> R1
2e60: 2d 3e 20 2e 2e 20 2d 3e 20 52 78 2c 20 74 68 65 -> .. -> Rx, the
2e70: 72 65 66 6f 72 65 0a 09 23 20 4f 52 44 28 52 79 refore..# ORD(Ry
2e80: 29 20 3c 20 4f 52 44 28 52 78 29 20 68 6f 6c 64 ) < ORD(Rx) hold
2e90: 73 2c 20 61 6e 64 20 74 68 69 73 20 6d 65 61 6e s, and this mean
2ea0: 73 20 53 20 69 73 20 62 61 63 6b 77 61 72 64 2e s S is backward.
2eb0: 0a 0a 09 23 20 4e 4f 54 45 2e 20 45 76 65 6e 20 ...# NOTE. Even
2ec0: 77 69 74 68 20 74 68 65 20 62 61 63 6b 77 61 72 with the backwar
2ed0: 64 20 73 79 6d 62 6f 6c 73 20 62 72 6f 6b 65 6e d symbols broken
2ee0: 2c 20 69 74 20 69 73 20 6e 6f 74 20 63 6c 65 61 , it is not clea
2ef0: 72 0a 09 23 20 74 6f 20 6d 65 20 79 65 74 20 77 r..# to me yet w
2f00: 68 61 74 20 74 68 69 73 20 6d 65 61 6e 73 20 69 hat this means i
2f10: 6e 20 74 65 72 6d 73 20 6f 66 20 74 61 67 67 69 n terms of taggi
2f20: 6e 67 20 72 65 76 69 73 69 6f 6e 73 0a 09 23 20 ng revisions..#
2f30: 6c 61 74 65 72 2c 20 61 73 20 77 65 20 6e 6f 77 later, as we now
2f40: 20 68 61 76 65 20 6d 6f 72 65 20 74 68 61 6e 20 have more than
2f50: 6f 6e 65 20 70 6c 61 63 65 20 77 68 65 72 65 20 one place where
2f60: 74 68 65 20 73 79 6d 62 6f 6c 0a 09 23 20 6f 63 the symbol..# oc
2f70: 63 75 72 73 20 6f 6e 20 74 68 65 20 72 65 6c 65 curs on the rele
2f80: 76 61 6e 74 20 4c 4f 44 2e 0a 0a 09 73 74 72 75 vant LOD....stru
2f90: 63 74 3a 3a 73 65 74 20 65 78 63 6c 75 64 65 20 ct::set exclude
2fa0: 6d 79 72 65 76 69 73 69 6f 6e 63 68 61 6e 67 65 myrevisionchange
2fb0: 73 65 74 73 20 24 63 73 65 74 0a 0a 09 3a 3a 76 sets $cset...::v
2fc0: 61 72 69 61 62 6c 65 20 6d 79 6c 61 73 74 70 6f ariable mylastpo
2fd0: 73 0a 09 73 65 74 20 6e 65 77 20 5b 24 63 73 65 s..set new [$cse
2fe0: 74 20 70 6f 73 5d 0a 0a 09 69 66 20 7b 24 6e 65 t pos]...if {$ne
2ff0: 77 20 21 3d 20 28 24 6d 79 6c 61 73 74 70 6f 73 w != ($mylastpos
3000: 20 2b 20 31 29 7d 20 7b 0a 09 20 20 20 20 69 66 + 1)} {.. if
3010: 20 7b 24 6d 79 6c 61 73 74 70 6f 73 20 3c 20 30 {$mylastpos < 0
3020: 7d 20 7b 0a 09 09 73 65 74 20 6f 6c 64 20 22 3c } {...set old "<
3030: 4e 4f 4e 45 3e 22 0a 09 20 20 20 20 7d 20 65 6c NONE>".. } el
3040: 73 65 20 7b 0a 09 09 3a 3a 76 61 72 69 61 62 6c se {...::variabl
3050: 65 20 6d 79 63 73 65 74 0a 09 09 73 65 74 20 6f e mycset...set o
3060: 6c 64 20 5b 24 6d 79 63 73 65 74 28 24 6d 79 6c ld [$mycset($myl
3070: 61 73 74 70 6f 73 29 20 73 74 72 5d 40 24 6d 79 astpos) str]@$my
3080: 6c 61 73 74 70 6f 73 0a 09 20 20 20 20 7d 0a 0a lastpos.. }..
3090: 09 20 20 20 20 69 6e 74 65 67 72 69 74 79 20 61 . integrity a
30a0: 73 73 65 72 74 20 30 20 7b 4f 72 64 65 72 69 6e ssert 0 {Orderin
30b0: 67 20 6f 66 20 72 65 76 69 73 69 6f 6e 20 63 68 g of revision ch
30c0: 61 6e 67 65 73 65 74 73 20 76 69 6f 6c 61 74 65 angesets violate
30d0: 64 2c 20 5b 24 63 73 65 74 20 73 74 72 5d 40 24 d, [$cset str]@$
30e0: 6e 65 77 20 69 73 20 6e 6f 74 20 69 6d 6d 65 64 new is not immed
30f0: 69 61 74 65 6c 79 20 61 66 74 65 72 20 24 6f 6c iately after $ol
3100: 64 7d 0a 09 7d 0a 0a 09 73 65 74 20 6d 79 6c 61 d}..}...set myla
3110: 73 74 70 6f 73 20 24 6e 65 77 0a 09 72 65 74 75 stpos $new..retu
3120: 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 20 20 70 72 rn. }.. pr
3130: 6f 63 20 46 6f 72 6d 61 74 54 52 20 7b 67 72 61 oc FormatTR {gra
3140: 70 68 20 63 73 65 74 7d 20 7b 0a 09 72 65 74 75 ph cset} {..retu
3150: 72 6e 20 5b 6a 6f 69 6e 20 5b 73 74 72 75 63 74 rn [join [struct
3160: 3a 3a 6c 69 73 74 20 6d 61 70 20 5b 24 67 72 61 ::list map [$gra
3170: 70 68 20 6e 6f 64 65 20 73 65 74 20 24 63 73 65 ph node set $cse
3180: 74 20 74 69 6d 65 72 61 6e 67 65 5d 20 7b 63 6c t timerange] {cl
3190: 6f 63 6b 20 66 6f 72 6d 61 74 7d 5d 20 7b 20 2d ock format}] { -
31a0: 2d 20 7d 5d 0a 20 20 20 20 7d 0a 0a 20 20 20 20 - }]. }..
31b0: 74 79 70 65 76 61 72 69 61 62 6c 65 20 6d 79 6c typevariable myl
31c0: 61 73 74 70 6f 73 20 20 20 20 20 20 20 20 20 20 astpos
31d0: 20 20 2d 31 20 3b 20 23 20 50 6f 73 69 74 69 6f -1 ; # Positio
31e0: 6e 20 6f 66 20 6c 61 73 74 20 72 65 76 69 73 69 n of last revisi
31f0: 6f 6e 20 63 68 61 6e 67 65 73 65 74 20 73 61 76 on changeset sav
3200: 65 64 2e 0a 20 20 20 20 74 79 70 65 76 61 72 69 ed.. typevari
3210: 61 62 6c 65 20 6d 79 72 65 76 69 73 69 6f 6e 63 able myrevisionc
3220: 68 61 6e 67 65 73 65 74 73 20 7b 7d 20 3b 20 23 hangesets {} ; #
3230: 20 53 65 74 20 6f 66 20 72 65 76 69 73 69 6f 6e Set of revision
3240: 20 63 68 61 6e 67 65 73 65 74 73 0a 0a 20 20 20 changesets..
3250: 20 74 79 70 65 76 61 72 69 61 62 6c 65 20 6d 79 typevariable my
3260: 61 74 66 6d 74 20 3b 20 23 20 46 6f 72 6d 61 74 atfmt ; # Format
3270: 20 66 6f 72 20 6c 6f 67 20 6f 75 74 70 75 74 20 for log output
3280: 74 6f 20 67 61 69 6e 20 62 65 74 74 65 72 20 61 to gain better a
3290: 6c 69 67 6e 6d 65 6e 74 20 6f 66 20 74 68 65 20 lignment of the
32a0: 76 61 72 69 6f 75 73 20 63 6f 6c 75 6d 6e 73 2e various columns.
32b0: 0a 20 20 20 20 74 79 70 65 76 61 72 69 61 62 6c . typevariabl
32c0: 65 20 6d 79 63 73 66 6d 74 20 3b 20 23 20 44 69 e mycsfmt ; # Di
32d0: 74 74 6f 20 66 6f 72 20 74 68 65 20 63 68 61 6e tto for the chan
32e0: 67 65 73 65 74 73 2e 0a 0a 20 20 20 20 23 20 23 gesets... # #
32f0: 20 23 23 20 23 23 23 20 23 23 23 23 23 20 23 23 ## ### ##### ##
3300: 23 23 23 23 23 23 20 23 23 23 23 23 23 23 23 23 ###### #########
3310: 23 23 23 23 0a 0a 20 20 20 20 74 79 70 65 76 61 ####.. typeva
3320: 72 69 61 62 6c 65 20 6d 79 63 73 65 74 20 2d 61 riable mycset -a
3330: 72 72 61 79 20 7b 7d 20 3b 20 23 20 4d 61 70 20 rray {} ; # Map
3340: 66 72 6f 6d 20 63 6f 6d 6d 69 74 20 70 6f 73 69 from commit posi
3350: 74 69 6f 6e 73 20 74 6f 20 74 68 65 0a 09 09 09 tions to the....
3360: 09 20 20 20 20 23 20 63 68 61 6e 67 65 73 65 74 . # changeset
3370: 20 28 6f 62 6a 65 63 74 20 72 65 66 29 20 61 74 (object ref) at
3380: 20 74 68 61 74 0a 09 09 09 09 20 20 20 20 23 20 that..... #
3390: 70 6f 73 69 74 69 6f 6e 2e 0a 0a 20 20 20 20 23 position... #
33a0: 20 23 20 23 23 20 23 23 23 20 23 23 23 23 23 20 # ## ### #####
33b0: 23 23 23 23 23 23 23 23 20 23 23 23 23 23 23 23 ######## #######
33c0: 23 23 23 23 23 23 0a 20 20 20 20 23 23 20 43 6f ######. ## Co
33d0: 6e 66 69 67 75 72 61 74 69 6f 6e 0a 0a 20 20 20 nfiguration..
33e0: 20 70 72 61 67 6d 61 20 2d 68 61 73 69 6e 73 74 pragma -hasinst
33f0: 61 6e 63 65 73 20 20 20 6e 6f 20 3b 20 23 20 73 ances no ; # s
3400: 69 6e 67 6c 65 74 6f 6e 0a 20 20 20 20 70 72 61 ingleton. pra
3410: 67 6d 61 20 2d 68 61 73 74 79 70 65 69 6e 66 6f gma -hastypeinfo
3420: 20 20 20 20 6e 6f 20 3b 20 23 20 6e 6f 20 69 6e no ; # no in
3430: 74 72 6f 73 70 65 63 74 69 6f 6e 0a 20 20 20 20 trospection.
3440: 70 72 61 67 6d 61 20 2d 68 61 73 74 79 70 65 64 pragma -hastyped
3450: 65 73 74 72 6f 79 20 6e 6f 20 3b 20 23 20 69 6d estroy no ; # im
3460: 6d 6f 72 74 61 6c 0a 0a 20 20 20 20 23 20 23 20 mortal.. # #
3470: 23 23 20 23 23 23 20 23 23 23 23 23 20 23 23 23 ## ### ##### ###
3480: 23 23 23 23 23 20 23 23 23 23 23 23 23 23 23 23 ##### ##########
3490: 23 23 23 0a 7d 0a 0a 6e 61 6d 65 73 70 61 63 65 ###.}..namespace
34a0: 20 65 76 61 6c 20 3a 3a 76 63 3a 3a 66 6f 73 73 eval ::vc::foss
34b0: 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a il::import::cvs:
34c0: 3a 70 61 73 73 20 7b 0a 20 20 20 20 6e 61 6d 65 :pass {. name
34d0: 73 70 61 63 65 20 65 78 70 6f 72 74 20 62 72 65 space export bre
34e0: 61 6b 61 63 79 63 6c 65 0a 20 20 20 20 6e 61 6d akacycle. nam
34f0: 65 73 70 61 63 65 20 65 76 61 6c 20 62 72 65 61 espace eval brea
3500: 6b 61 63 79 63 6c 65 20 7b 0a 09 6e 61 6d 65 73 kacycle {..names
3510: 70 61 63 65 20 69 6d 70 6f 72 74 20 3a 3a 76 63 pace import ::vc
3520: 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 ::fossil::import
3530: 3a 3a 63 76 73 3a 3a 63 79 63 6c 65 62 72 65 61 ::cvs::cyclebrea
3540: 6b 65 72 0a 09 6e 61 6d 65 73 70 61 63 65 20 69 ker..namespace i
3550: 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a 66 6f 73 73 mport ::vc::foss
3560: 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a il::import::cvs:
3570: 3a 72 65 70 6f 73 69 74 6f 72 79 0a 09 6e 61 6d :repository..nam
3580: 65 73 70 61 63 65 20 69 6d 70 6f 72 74 20 3a 3a espace import ::
3590: 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f vc::fossil::impo
35a0: 72 74 3a 3a 63 76 73 3a 3a 73 74 61 74 65 0a 09 rt::cvs::state..
35b0: 6e 61 6d 65 73 70 61 63 65 20 69 6d 70 6f 72 74 namespace import
35c0: 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 ::vc::fossil::i
35d0: 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 69 6e 74 65 mport::cvs::inte
35e0: 67 72 69 74 79 0a 09 6e 61 6d 65 73 70 61 63 65 grity..namespace
35f0: 20 65 76 61 6c 20 70 72 6f 6a 65 63 74 20 7b 0a eval project {.
3600: 09 20 20 20 20 6e 61 6d 65 73 70 61 63 65 20 69 . namespace i
3610: 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a 66 6f 73 73 mport ::vc::foss
3620: 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a il::import::cvs:
3630: 3a 70 72 6f 6a 65 63 74 3a 3a 72 65 76 0a 09 7d :project::rev..}
3640: 0a 09 6e 61 6d 65 73 70 61 63 65 20 69 6d 70 6f ..namespace impo
3650: 72 74 20 3a 3a 76 63 3a 3a 74 6f 6f 6c 73 3a 3a rt ::vc::tools::
3660: 6d 69 73 63 3a 3a 2a 0a 09 6e 61 6d 65 73 70 61 misc::*..namespa
3670: 63 65 20 69 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a ce import ::vc::
3680: 74 6f 6f 6c 73 3a 3a 74 72 6f 75 62 6c 65 0a 09 tools::trouble..
3690: 6e 61 6d 65 73 70 61 63 65 20 69 6d 70 6f 72 74 namespace import
36a0: 20 3a 3a 76 63 3a 3a 74 6f 6f 6c 73 3a 3a 6c 6f ::vc::tools::lo
36b0: 67 0a 09 6c 6f 67 20 72 65 67 69 73 74 65 72 20 g..log register
36c0: 62 72 65 61 6b 61 63 79 63 6c 65 0a 20 20 20 20 breakacycle.
36d0: 7d 0a 7d 0a 0a 23 20 23 20 23 23 20 23 23 23 20 }.}..# # ## ###
36e0: 23 23 23 23 23 20 23 23 23 23 23 23 23 23 20 23 ##### ######## #
36f0: 23 23 23 23 23 23 23 23 23 23 23 23 20 23 23 23 ############ ###
3700: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
3710: 23 23 0a 23 23 20 52 65 61 64 79 0a 0a 70 61 63 ##.## Ready..pac
3720: 6b 61 67 65 20 70 72 6f 76 69 64 65 20 76 63 3a kage provide vc:
3730: 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a :fossil::import:
3740: 3a 63 76 73 3a 3a 70 61 73 73 3a 3a 62 72 65 61 :cvs::pass::brea
3750: 6b 61 63 79 63 6c 65 20 31 2e 30 0a 72 65 74 75 kacycle 1.0.retu
3760: 72 6e 0a rn.