Artifact bcbf738b02b68b4cae76fdfcec67938095322fb7:
File
tools/cvs2fossil/lib/c2f_pbreakrcycle.tcl
part of check-in
[de64c94f54]
- Bugfix. When setting up or extended the changeset graph a changeset's successor may lay outside of the set of changesets under consideration, i.e. without a node in the graph. Ignore these. This did not (or only rarely) happen before the bugfix to the successor computation of changesets in project::rev (list instead of single).
by
aku on
2007-11-16 03:59:21.
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 2e 20 54 68 69 73 20 70 61 73 73 20 s VI. This pass
0210: 67 6f 65 73 20 6f 76 65 72 20 74 68 65 20 73 65 goes over the se
0220: 74 20 6f 66 20 72 65 76 69 73 69 6f 6e 20 62 61 t of revision ba
0230: 73 65 64 20 63 68 61 6e 67 65 73 65 74 73 0a 23 sed changesets.#
0240: 23 20 61 6e 64 20 62 72 65 61 6b 73 20 61 6c 6c # and breaks all
0250: 20 64 65 70 65 6e 64 65 6e 63 79 20 63 79 63 6c dependency cycl
0260: 65 73 20 74 68 65 79 20 6d 61 79 20 62 65 20 69 es they may be i
0270: 6e 2e 20 57 65 20 6e 65 65 64 20 61 0a 23 23 20 n. We need a.##
0280: 64 65 70 65 6e 64 65 6e 63 79 20 74 72 65 65 2e dependency tree.
0290: 0a 0a 23 20 23 20 23 23 20 23 23 23 20 23 23 23 ..# # ## ### ###
02a0: 23 23 20 23 23 23 23 23 23 23 23 20 23 23 23 23 ## ######## ####
02b0: 23 23 23 23 23 23 23 23 23 20 23 23 23 23 23 23 ######### ######
02c0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 0a ###############.
02d0: 23 23 20 52 65 71 75 69 72 65 6d 65 6e 74 73 0a ## Requirements.
02e0: 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 .package require
02f0: 20 54 63 6c 20 38 2e 34 20 20 20 20 20 20 20 20 Tcl 8.4
0300: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0310: 20 20 20 20 20 20 20 20 20 20 20 3b 20 23 20 52 ; # R
0320: 65 71 75 69 72 65 64 20 72 75 6e 74 69 6d 65 2e equired runtime.
0330: 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 .package require
0340: 20 73 6e 69 74 20 20 20 20 20 20 20 20 20 20 20 snit
0350: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0360: 20 20 20 20 20 20 20 20 20 20 20 3b 20 23 20 4f ; # O
0370: 4f 20 73 79 73 74 65 6d 2e 0a 70 61 63 6b 61 67 O system..packag
0380: 65 20 72 65 71 75 69 72 65 20 73 74 72 75 63 74 e require struct
0390: 3a 3a 67 72 61 70 68 20 20 20 20 20 20 20 20 20 ::graph
03a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
03b0: 20 20 20 20 3b 20 23 20 47 72 61 70 68 20 68 61 ; # Graph ha
03c0: 6e 64 6c 69 6e 67 2e 0a 70 61 63 6b 61 67 65 20 ndling..package
03d0: 72 65 71 75 69 72 65 20 73 74 72 75 63 74 3a 3a require struct::
03e0: 6c 69 73 74 20 20 20 20 20 20 20 20 20 20 20 20 list
03f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0400: 20 20 3b 20 23 20 48 69 67 68 65 72 20 6f 72 64 ; # Higher ord
0410: 65 72 20 6c 69 73 74 20 6f 70 65 72 61 74 69 6f er list operatio
0420: 6e 73 2e 0a 70 61 63 6b 61 67 65 20 72 65 71 75 ns..package requ
0430: 69 72 65 20 76 63 3a 3a 74 6f 6f 6c 73 3a 3a 6c ire vc::tools::l
0440: 6f 67 20 20 20 20 20 20 20 20 20 20 20 20 20 20 og
0450: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3b 20 ;
0460: 23 20 55 73 65 72 20 66 65 65 64 62 61 63 6b 2e # User feedback.
0470: 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 .package require
0480: 20 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 vc::fossil::imp
0490: 6f 72 74 3a 3a 63 76 73 3a 3a 73 74 61 74 65 20 ort::cvs::state
04a0: 20 20 20 20 20 20 20 20 20 20 20 3b 20 23 20 53 ; # S
04b0: 74 61 74 65 20 73 74 6f 72 61 67 65 2e 0a 70 61 tate storage..pa
04c0: 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 76 63 ckage require vc
04d0: 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 ::fossil::import
04e0: 3a 3a 63 76 73 3a 3a 70 72 6f 6a 65 63 74 3a 3a ::cvs::project::
04f0: 72 65 76 20 20 20 20 20 3b 20 23 20 50 72 6f 6a rev ; # Proj
0500: 65 63 74 20 6c 65 76 65 6c 20 63 68 61 6e 67 65 ect level change
0510: 73 65 74 73 0a 70 61 63 6b 61 67 65 20 72 65 71 sets.package req
0520: 75 69 72 65 20 76 63 3a 3a 66 6f 73 73 69 6c 3a uire vc::fossil:
0530: 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 70 72 :import::cvs::pr
0540: 6f 6a 65 63 74 3a 3a 72 65 76 6c 69 6e 6b 20 3b oject::revlink ;
0550: 20 23 20 43 79 63 6c 65 20 6c 69 6e 6b 73 2e 0a # Cycle links..
0560: 0a 23 20 23 20 23 23 20 23 23 23 20 23 23 23 23 .# # ## ### ####
0570: 23 20 23 23 23 23 23 23 23 23 20 23 23 23 23 23 # ######## #####
0580: 23 23 23 23 23 23 23 23 20 23 23 23 23 23 23 23 ######## #######
0590: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 0a 23 ##############.#
05a0: 23 20 52 65 67 69 73 74 65 72 20 74 68 65 20 70 # Register the p
05b0: 61 73 73 20 77 69 74 68 20 74 68 65 20 6d 61 6e ass with the man
05c0: 61 67 65 6d 65 6e 74 0a 0a 76 63 3a 3a 66 6f 73 agement..vc::fos
05d0: 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 sil::import::cvs
05e0: 3a 3a 70 61 73 73 20 64 65 66 69 6e 65 20 5c 0a ::pass define \.
05f0: 20 20 20 20 42 72 65 61 6b 52 65 76 43 73 65 74 BreakRevCset
0600: 43 79 63 6c 65 73 20 5c 0a 20 20 20 20 7b 42 72 Cycles \. {Br
0610: 65 61 6b 20 52 65 76 69 73 69 6f 6e 20 43 68 61 eak Revision Cha
0620: 6e 67 65 53 65 74 20 44 65 70 65 6e 64 65 6e 63 ngeSet Dependenc
0630: 79 20 43 79 63 6c 65 73 7d 20 5c 0a 20 20 20 20 y Cycles} \.
0640: 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d ::vc::fossil::im
0650: 70 6f 72 74 3a 3a 63 76 73 3a 3a 70 61 73 73 3a port::cvs::pass:
0660: 3a 62 72 65 61 6b 72 63 79 63 6c 65 0a 0a 23 20 :breakrcycle..#
0670: 23 20 23 23 20 23 23 23 20 23 23 23 23 23 20 23 # ## ### ##### #
0680: 23 23 23 23 23 23 23 20 23 23 23 23 23 23 23 23 ####### ########
0690: 23 23 23 23 23 20 23 23 23 23 23 23 23 23 23 23 ##### ##########
06a0: 23 23 23 23 23 23 23 23 23 23 23 0a 23 23 20 0a ###########.## .
06b0: 0a 73 6e 69 74 3a 3a 74 79 70 65 20 3a 3a 76 63 .snit::type ::vc
06c0: 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 ::fossil::import
06d0: 3a 3a 63 76 73 3a 3a 70 61 73 73 3a 3a 62 72 65 ::cvs::pass::bre
06e0: 61 6b 72 63 79 63 6c 65 20 7b 0a 20 20 20 20 23 akrcycle {. #
06f0: 20 23 20 23 23 20 23 23 23 20 23 23 23 23 23 20 # ## ### #####
0700: 23 23 23 23 23 23 23 23 20 23 23 23 23 23 23 23 ######## #######
0710: 23 23 23 23 23 23 0a 20 20 20 20 23 23 20 50 75 ######. ## Pu
0720: 62 6c 69 63 20 41 50 49 0a 0a 20 20 20 20 74 79 blic API.. ty
0730: 70 65 6d 65 74 68 6f 64 20 73 65 74 75 70 20 7b pemethod setup {
0740: 7d 20 7b 0a 09 23 20 44 65 66 69 6e 65 20 74 68 } {..# Define th
0750: 65 20 6e 61 6d 65 73 20 61 6e 64 20 73 74 72 75 e names and stru
0760: 63 74 75 72 65 20 6f 66 20 74 68 65 20 70 65 72 cture of the per
0770: 73 69 73 74 65 6e 74 20 73 74 61 74 65 20 6f 66 sistent state of
0780: 0a 09 23 20 74 68 69 73 20 70 61 73 73 2e 0a 0a ..# this pass...
0790: 09 73 74 61 74 65 20 77 72 69 74 69 6e 67 20 63 .state writing c
07a0: 73 6f 72 64 65 72 20 7b 0a 09 20 20 20 20 2d 2d sorder {.. --
07b0: 20 43 6f 6d 6d 69 74 20 6f 72 64 65 72 20 6f 66 Commit order of
07c0: 20 63 68 61 6e 67 65 73 65 74 73 20 62 61 73 65 changesets base
07d0: 64 20 6f 6e 20 74 68 65 69 72 20 64 65 70 65 6e d on their depen
07e0: 64 65 6e 63 69 65 73 0a 09 20 20 20 20 63 69 64 dencies.. cid
07f0: 20 49 4e 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 INTEGER NOT NU
0800: 4c 4c 20 20 52 45 46 45 52 45 4e 43 45 53 20 63 LL REFERENCES c
0810: 68 61 6e 67 65 73 65 74 2c 0a 09 20 20 20 20 70 hangeset,.. p
0820: 6f 73 20 49 4e 54 45 47 45 52 20 20 4e 4f 54 20 os INTEGER NOT
0830: 4e 55 4c 4c 2c 0a 09 20 20 20 20 55 4e 49 51 55 NULL,.. UNIQU
0840: 45 20 28 63 69 64 29 2c 0a 09 20 20 20 20 55 4e E (cid),.. UN
0850: 49 51 55 45 20 28 70 6f 73 29 0a 09 7d 0a 0a 09 IQUE (pos)..}...
0860: 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 return. }..
0870: 20 20 74 79 70 65 6d 65 74 68 6f 64 20 6c 6f 61 typemethod loa
0880: 64 20 7b 7d 20 7b 0a 09 23 20 50 61 73 73 20 6d d {} {..# Pass m
0890: 61 6e 61 67 65 72 20 69 6e 74 65 72 66 61 63 65 anager interface
08a0: 2e 20 45 78 65 63 75 74 65 64 20 74 6f 20 6c 6f . Executed to lo
08b0: 61 64 20 64 61 74 61 20 63 6f 6d 70 75 74 65 64 ad data computed
08c0: 20 62 79 0a 09 23 20 74 68 69 73 20 70 61 73 73 by..# this pass
08d0: 20 69 6e 74 6f 20 6d 65 6d 6f 72 79 20 77 68 65 into memory whe
08e0: 6e 20 74 68 69 73 20 70 61 73 73 20 69 73 20 73 n this pass is s
08f0: 6b 69 70 70 65 64 20 69 6e 73 74 65 61 64 20 6f kipped instead o
0900: 66 0a 09 23 20 65 78 65 63 75 74 65 64 2e 0a 09 f..# executed...
0910: 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 return. }..
0920: 20 20 74 79 70 65 6d 65 74 68 6f 64 20 72 75 6e typemethod run
0930: 20 7b 7d 20 7b 0a 09 23 20 50 61 73 73 20 6d 61 {} {..# Pass ma
0940: 6e 61 67 65 72 20 69 6e 74 65 72 66 61 63 65 2e nager interface.
0950: 20 45 78 65 63 75 74 65 64 20 74 6f 20 70 65 72 Executed to per
0960: 66 6f 72 6d 20 74 68 65 0a 09 23 20 66 75 6e 63 form the..# func
0970: 74 69 6f 6e 61 6c 69 74 79 20 6f 66 20 74 68 65 tionality of the
0980: 20 70 61 73 73 2e 0a 0a 09 73 74 61 74 65 20 72 pass....state r
0990: 65 61 64 69 6e 67 20 72 65 76 69 73 69 6f 6e 0a eading revision.
09a0: 09 73 74 61 74 65 20 72 65 61 64 69 6e 67 20 63 .state reading c
09b0: 68 61 6e 67 65 73 65 74 0a 09 73 74 61 74 65 20 hangeset..state
09c0: 72 65 61 64 69 6e 67 20 63 73 72 65 76 69 73 69 reading csrevisi
09d0: 6f 6e 0a 0a 09 23 20 57 65 20 63 72 65 61 74 65 on...# We create
09e0: 20 61 20 67 72 61 70 68 20 6f 66 20 74 68 65 20 a graph of the
09f0: 72 65 76 69 73 69 6f 6e 20 63 68 61 6e 67 65 73 revision changes
0a00: 65 74 73 2c 20 75 73 69 6e 67 20 74 68 65 20 66 ets, using the f
0a10: 69 6c 65 0a 09 23 20 6c 65 76 65 6c 20 64 65 70 ile..# level dep
0a20: 65 6e 64 65 6e 63 69 65 73 20 74 6f 20 63 6f 6e endencies to con
0a30: 73 74 72 75 63 74 20 61 20 66 69 72 73 74 20 61 struct a first a
0a40: 70 70 72 6f 78 69 6d 61 74 69 6f 6e 20 6f 66 0a pproximation of.
0a50: 09 23 20 74 68 65 6d 20 61 74 20 74 68 65 20 70 .# them at the p
0a60: 72 6f 6a 65 63 74 20 6c 65 76 65 6c 2e 20 54 68 roject level. Th
0a70: 65 6e 20 6c 6f 6f 6b 20 66 6f 72 20 63 79 63 6c en look for cycl
0a80: 65 73 20 69 6e 20 74 68 61 74 0a 09 23 20 67 72 es in that..# gr
0a90: 61 70 68 20 61 6e 64 20 62 72 65 61 6b 20 74 68 aph and break th
0aa0: 65 6d 2e 0a 0a 09 23 20 31 2e 20 43 72 65 61 74 em....# 1. Creat
0ab0: 65 20 6e 6f 64 65 73 20 66 6f 72 20 61 6c 6c 20 e nodes for all
0ac0: 72 65 6c 65 76 61 6e 74 20 63 68 61 6e 67 65 73 relevant changes
0ad0: 65 74 73 20 61 6e 64 20 61 20 6d 61 70 70 69 6e ets and a mappin
0ae0: 67 0a 09 23 20 20 20 20 66 72 6f 6d 20 74 68 65 g..# from the
0af0: 20 72 65 76 69 73 69 6f 6e 73 20 74 6f 20 74 68 revisions to th
0b00: 65 69 72 20 63 68 61 6e 67 65 73 65 74 73 2f 6e eir changesets/n
0b10: 6f 64 65 73 2e 0a 0a 09 6c 6f 67 20 77 72 69 74 odes....log writ
0b20: 65 20 33 20 62 72 65 61 6b 72 63 79 63 6c 65 20 e 3 breakrcycle
0b30: 7b 43 72 65 61 74 69 6e 67 20 63 68 61 6e 67 65 {Creating change
0b40: 73 65 74 20 67 72 61 70 68 2c 20 66 69 6c 6c 69 set graph, filli
0b50: 6e 67 20 77 69 74 68 20 6e 6f 64 65 73 7d 0a 0a ng with nodes}..
0b60: 09 73 65 74 20 64 67 20 5b 73 74 72 75 63 74 3a .set dg [struct:
0b70: 3a 67 72 61 70 68 20 64 67 5d 0a 0a 09 73 74 61 :graph dg]...sta
0b80: 74 65 20 74 72 61 6e 73 61 63 74 69 6f 6e 20 7b te transaction {
0b90: 0a 09 20 20 20 20 66 6f 72 65 61 63 68 20 63 73 .. foreach cs
0ba0: 65 74 20 5b 70 72 6f 6a 65 63 74 3a 3a 72 65 76 et [project::rev
0bb0: 20 61 6c 6c 5d 20 7b 0a 09 09 69 66 20 7b 5b 24 all] {...if {[$
0bc0: 63 73 65 74 20 62 79 73 79 6d 62 6f 6c 5d 7d 20 cset bysymbol]}
0bd0: 63 6f 6e 74 69 6e 75 65 0a 09 09 64 67 20 6e 6f continue...dg no
0be0: 64 65 20 69 6e 73 65 72 74 20 24 63 73 65 74 0a de insert $cset.
0bf0: 09 09 64 67 20 6e 6f 64 65 20 73 65 74 20 20 20 ..dg node set
0c00: 20 24 63 73 65 74 20 74 69 6d 65 72 61 6e 67 65 $cset timerange
0c10: 20 5b 24 63 73 65 74 20 74 69 6d 65 72 61 6e 67 [$cset timerang
0c20: 65 5d 0a 09 20 20 20 20 7d 0a 09 7d 0a 0a 09 23 e].. }..}...#
0c30: 20 32 2e 20 46 69 6e 64 20 66 6f 72 20 61 6c 6c 2. Find for all
0c40: 20 72 65 6c 65 76 61 6e 74 20 63 68 61 6e 67 65 relevant change
0c50: 73 65 74 20 74 68 65 69 72 20 72 65 76 69 73 69 set their revisi
0c60: 6f 6e 73 20 61 6e 64 20 74 68 65 69 72 0a 09 23 ons and their..#
0c70: 20 20 20 20 64 65 70 65 6e 64 65 6e 63 69 65 73 dependencies
0c80: 2e 20 4d 61 70 20 74 68 65 20 6c 61 74 74 65 72 . Map the latter
0c90: 20 62 61 63 6b 20 74 6f 20 63 68 61 6e 67 65 73 back to changes
0ca0: 65 74 73 20 61 6e 64 0a 09 23 20 20 20 20 63 6f ets and..# co
0cb0: 6e 73 74 72 75 63 74 20 74 68 65 20 63 6f 72 72 nstruct the corr
0cc0: 65 73 70 6f 6e 64 69 6e 67 20 61 72 63 73 2e 0a esponding arcs..
0cd0: 0a 09 6c 6f 67 20 77 72 69 74 65 20 33 20 62 72 ..log write 3 br
0ce0: 65 61 6b 72 63 79 63 6c 65 20 7b 53 65 74 74 69 eakrcycle {Setti
0cf0: 6e 67 20 75 70 20 6e 6f 64 65 20 64 65 70 65 6e ng up node depen
0d00: 64 65 6e 63 69 65 73 7d 0a 0a 09 73 74 61 74 65 dencies}...state
0d10: 20 74 72 61 6e 73 61 63 74 69 6f 6e 20 7b 0a 09 transaction {..
0d20: 20 20 20 20 66 6f 72 65 61 63 68 20 63 73 65 74 foreach cset
0d30: 20 5b 70 72 6f 6a 65 63 74 3a 3a 72 65 76 20 61 [project::rev a
0d40: 6c 6c 5d 20 7b 0a 09 09 69 66 20 7b 5b 24 63 73 ll] {...if {[$cs
0d50: 65 74 20 62 79 73 79 6d 62 6f 6c 5d 7d 20 63 6f et bysymbol]} co
0d60: 6e 74 69 6e 75 65 0a 09 09 66 6f 72 65 61 63 68 ntinue...foreach
0d70: 20 73 75 63 63 20 5b 24 63 73 65 74 20 73 75 63 succ [$cset suc
0d80: 63 65 73 73 6f 72 73 5d 20 7b 0a 09 09 20 20 20 cessors] {...
0d90: 20 23 20 43 68 61 6e 67 65 73 65 74 73 20 6d 61 # Changesets ma
0da0: 79 20 68 61 76 65 20 64 65 70 65 6e 64 65 6e 63 y have dependenc
0db0: 69 65 73 20 6f 75 74 73 69 64 65 20 6f 66 20 74 ies outside of t
0dc0: 68 65 0a 09 09 20 20 20 20 23 20 63 68 6f 73 65 he... # chose
0dd0: 6e 20 73 65 74 2e 20 54 68 65 73 65 20 61 72 65 n set. These are
0de0: 20 69 67 6e 6f 72 65 64 0a 09 09 20 20 20 20 69 ignored... i
0df0: 66 20 7b 21 5b 64 67 20 6e 6f 64 65 20 65 78 69 f {![dg node exi
0e00: 73 74 73 20 24 73 75 63 63 5d 7d 20 63 6f 6e 74 sts $succ]} cont
0e10: 69 6e 75 65 0a 09 09 20 20 20 20 64 67 20 61 72 inue... dg ar
0e20: 63 20 69 6e 73 65 72 74 20 24 63 73 65 74 20 24 c insert $cset $
0e30: 73 75 63 63 0a 09 09 7d 0a 09 20 20 20 20 7d 0a succ...}.. }.
0e40: 09 7d 0a 0a 09 23 20 33 2e 20 4c 61 73 74 6c 79 .}...# 3. Lastly
0e50: 20 77 65 20 69 74 65 72 61 74 65 20 74 68 65 20 we iterate the
0e60: 67 72 61 70 68 20 74 6f 70 6f 6c 6f 67 69 63 61 graph topologica
0e70: 6c 6c 79 2e 20 57 65 20 6d 61 72 6b 20 6f 66 66 lly. We mark off
0e80: 0a 09 23 20 20 20 20 74 68 65 20 6e 6f 64 65 73 ..# the nodes
0e90: 20 77 68 69 63 68 20 68 61 76 65 20 6e 6f 20 70 which have no p
0ea0: 72 65 64 65 63 65 73 73 6f 72 73 2c 20 69 6e 20 redecessors, in
0eb0: 6f 72 64 65 72 20 66 72 6f 6d 0a 09 23 20 20 20 order from..#
0ec0: 20 6f 6c 64 65 73 74 20 74 6f 20 79 6f 75 6e 67 oldest to young
0ed0: 65 73 74 2c 20 73 61 76 69 6e 67 20 61 6e 64 20 est, saving and
0ee0: 72 65 6d 6f 76 69 6e 67 20 64 65 70 65 6e 64 65 removing depende
0ef0: 6e 63 69 65 73 2e 20 49 66 0a 09 23 20 20 20 20 ncies. If..#
0f00: 77 65 20 66 69 6e 64 20 6e 6f 20 6e 6f 64 65 73 we find no nodes
0f10: 20 77 69 74 68 6f 75 74 20 70 72 65 64 65 63 65 without predece
0f20: 73 73 6f 72 73 20 77 65 20 68 61 76 65 20 61 20 ssors we have a
0f30: 63 79 63 6c 65 2c 0a 09 23 20 20 20 20 61 6e 64 cycle,..# and
0f40: 20 77 6f 72 6b 20 6f 6e 20 62 72 65 61 6b 69 6e work on breakin
0f50: 67 20 69 74 2e 0a 0a 09 6c 6f 67 20 77 72 69 74 g it....log writ
0f60: 65 20 33 20 62 72 65 61 6b 72 63 79 63 6c 65 20 e 3 breakrcycle
0f70: 7b 43 6f 6d 70 75 74 69 6e 67 20 63 68 61 6e 67 {Computing chang
0f80: 65 73 65 74 20 6f 72 64 65 72 2c 20 62 72 65 61 eset order, brea
0f90: 6b 69 6e 67 20 63 79 63 6c 65 73 7d 0a 0a 09 49 king cycles}...I
0fa0: 6e 69 74 69 61 6c 69 7a 65 43 61 6e 64 69 64 61 nitializeCandida
0fb0: 74 65 73 20 24 64 67 0a 09 73 74 61 74 65 20 74 tes $dg..state t
0fc0: 72 61 6e 73 61 63 74 69 6f 6e 20 7b 0a 09 20 20 ransaction {..
0fd0: 20 20 77 68 69 6c 65 20 7b 31 7d 20 7b 0a 09 09 while {1} {...
0fe0: 77 68 69 6c 65 20 7b 5b 57 69 74 68 6f 75 74 50 while {[WithoutP
0ff0: 72 65 64 65 63 65 73 73 6f 72 20 24 64 67 20 6e redecessor $dg n
1000: 5d 7d 20 7b 0a 09 09 20 20 20 20 53 61 76 65 41 ]} {... SaveA
1010: 6e 64 52 65 6d 6f 76 65 20 24 64 67 20 24 6e 0a ndRemove $dg $n.
1020: 09 09 7d 0a 09 09 69 66 20 7b 21 5b 6c 6c 65 6e ..}...if {![llen
1030: 67 74 68 20 5b 64 67 20 6e 6f 64 65 73 5d 5d 7d gth [dg nodes]]}
1040: 20 62 72 65 61 6b 0a 09 09 42 72 65 61 6b 43 79 break...BreakCy
1050: 63 6c 65 20 24 64 67 20 5b 46 69 6e 64 43 79 63 cle $dg [FindCyc
1060: 6c 65 20 24 64 67 5d 0a 09 09 49 6e 69 74 69 61 le $dg]...Initia
1070: 6c 69 7a 65 43 61 6e 64 69 64 61 74 65 73 20 24 lizeCandidates $
1080: 64 67 0a 09 20 20 20 20 7d 0a 09 7d 0a 0a 09 72 dg.. }..}...r
1090: 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 20 eturn. }..
10a0: 20 74 79 70 65 6d 65 74 68 6f 64 20 64 69 73 63 typemethod disc
10b0: 61 72 64 20 7b 7d 20 7b 0a 09 23 20 50 61 73 73 ard {} {..# Pass
10c0: 20 6d 61 6e 61 67 65 72 20 69 6e 74 65 72 66 61 manager interfa
10d0: 63 65 2e 20 45 78 65 63 75 74 65 64 20 66 6f 72 ce. Executed for
10e0: 20 61 6c 6c 20 70 61 73 73 65 73 20 61 66 74 65 all passes afte
10f0: 72 20 74 68 65 0a 09 23 20 72 75 6e 20 70 61 73 r the..# run pas
1100: 73 65 73 2c 20 74 6f 20 72 65 6d 6f 76 65 20 61 ses, to remove a
1110: 6c 6c 20 64 61 74 61 20 6f 66 20 74 68 69 73 20 ll data of this
1120: 70 61 73 73 20 66 72 6f 6d 20 74 68 65 20 73 74 pass from the st
1130: 61 74 65 2c 0a 09 23 20 61 73 20 62 65 69 6e 67 ate,..# as being
1140: 20 6f 75 74 20 6f 66 20 64 61 74 65 2e 0a 0a 09 out of date....
1150: 73 74 61 74 65 20 64 69 73 63 61 72 64 20 63 73 state discard cs
1160: 6f 72 64 65 72 0a 09 72 65 74 75 72 6e 0a 20 20 order..return.
1170: 20 20 7d 0a 0a 20 20 20 20 23 20 23 20 23 23 20 }.. # # ##
1180: 23 23 23 20 23 23 23 23 23 20 23 23 23 23 23 23 ### ##### ######
1190: 23 23 20 23 23 23 23 23 23 23 23 23 23 23 23 23 ## #############
11a0: 0a 20 20 20 20 23 23 20 49 6e 74 65 72 6e 61 6c . ## Internal
11b0: 20 6d 65 74 68 6f 64 73 0a 0a 20 20 20 20 23 20 methods.. #
11c0: 49 6e 73 74 65 61 64 20 6f 66 20 73 65 61 72 63 Instead of searc
11d0: 68 69 6e 67 20 74 68 65 20 77 68 6f 6c 65 20 67 hing the whole g
11e0: 72 61 70 68 20 66 6f 72 20 74 68 65 20 64 65 67 raph for the deg
11f0: 72 65 65 2d 30 20 6e 6f 64 65 73 20 69 6e 0a 20 ree-0 nodes in.
1200: 20 20 20 23 20 65 61 63 68 20 69 74 65 72 61 74 # each iterat
1210: 69 6f 6e 20 77 65 20 63 6f 6d 70 75 74 65 20 74 ion we compute t
1220: 68 65 20 6c 69 73 74 20 6f 6e 63 65 20 74 6f 20 he list once to
1230: 73 74 61 72 74 2c 20 61 6e 64 20 74 68 65 6e 20 start, and then
1240: 6f 6e 6c 79 0a 20 20 20 20 23 20 75 70 64 61 74 only. # updat
1250: 65 20 69 74 20 69 6e 63 72 65 6d 65 6e 74 61 6c e it incremental
1260: 6c 79 20 62 61 73 65 64 20 6f 6e 20 74 68 65 20 ly based on the
1270: 6f 75 74 67 6f 69 6e 67 20 6e 65 69 67 68 62 6f outgoing neighbo
1280: 75 72 73 20 6f 66 20 74 68 65 0a 20 20 20 20 23 urs of the. #
1290: 20 6e 6f 64 65 20 63 68 6f 73 65 6e 20 66 6f 72 node chosen for
12a0: 20 63 6f 6d 6d 69 74 2e 0a 0a 20 20 20 20 70 72 commit... pr
12b0: 6f 63 20 49 6e 69 74 69 61 6c 69 7a 65 43 61 6e oc InitializeCan
12c0: 64 69 64 61 74 65 73 20 7b 64 67 7d 20 7b 0a 09 didates {dg} {..
12d0: 23 20 62 6f 74 74 6f 6d 20 3d 20 6c 69 73 74 20 # bottom = list
12e0: 28 6c 69 73 74 20 28 6e 6f 64 65 2c 20 72 61 6e (list (node, ran
12f0: 67 65 20 6d 69 6e 2c 20 72 61 6e 67 65 20 6d 61 ge min, range ma
1300: 78 29 29 0a 09 3a 3a 76 61 72 69 61 62 6c 65 20 x))..::variable
1310: 62 6f 74 74 6f 6d 0a 09 66 6f 72 65 61 63 68 20 bottom..foreach
1320: 6e 20 5b 24 64 67 20 6e 6f 64 65 73 5d 20 7b 0a n [$dg nodes] {.
1330: 09 20 20 20 20 69 66 20 7b 5b 24 64 67 20 6e 6f . if {[$dg no
1340: 64 65 20 64 65 67 72 65 65 20 2d 69 6e 20 24 6e de degree -in $n
1350: 5d 7d 20 63 6f 6e 74 69 6e 75 65 0a 09 20 20 20 ]} continue..
1360: 20 6c 61 70 70 65 6e 64 20 62 6f 74 74 6f 6d 20 lappend bottom
1370: 5b 6c 69 6e 73 65 72 74 20 5b 24 64 67 20 6e 6f [linsert [$dg no
1380: 64 65 20 67 65 74 20 24 6e 20 74 69 6d 65 72 61 de get $n timera
1390: 6e 67 65 5d 20 30 20 24 6e 5d 0a 09 7d 0a 09 73 nge] 0 $n]..}..s
13a0: 65 74 20 62 6f 74 74 6f 6d 20 5b 6c 73 6f 72 74 et bottom [lsort
13b0: 20 2d 69 6e 64 65 78 20 31 20 2d 69 6e 74 65 67 -index 1 -integ
13c0: 65 72 20 5b 6c 73 6f 72 74 20 2d 69 6e 64 65 78 er [lsort -index
13d0: 20 32 20 2d 69 6e 74 65 67 65 72 20 24 62 6f 74 2 -integer $bot
13e0: 74 6f 6d 5d 5d 0a 09 72 65 74 75 72 6e 0a 20 20 tom]]..return.
13f0: 20 20 7d 0a 0a 20 20 20 20 70 72 6f 63 20 57 69 }.. proc Wi
1400: 74 68 6f 75 74 50 72 65 64 65 63 65 73 73 6f 72 thoutPredecessor
1410: 20 7b 64 67 20 6e 76 7d 20 7b 0a 09 3a 3a 76 61 {dg nv} {..::va
1420: 72 69 61 62 6c 65 20 62 6f 74 74 6f 6d 0a 0a 09 riable bottom...
1430: 75 70 76 61 72 20 31 20 24 6e 76 20 6e 0a 09 69 upvar 1 $nv n..i
1440: 66 20 7b 21 5b 6c 6c 65 6e 67 74 68 20 24 62 6f f {![llength $bo
1450: 74 74 6f 6d 5d 7d 20 7b 20 72 65 74 75 72 6e 20 ttom]} { return
1460: 30 20 7d 0a 0a 09 73 65 74 20 6e 20 5b 6c 69 6e 0 }...set n [lin
1470: 64 65 78 20 5b 6c 69 6e 64 65 78 20 24 62 6f 74 dex [lindex $bot
1480: 74 6f 6d 20 30 5d 20 30 5d 0a 09 73 65 74 20 62 tom 0] 0]..set b
1490: 6f 74 74 6f 6d 20 5b 6c 72 61 6e 67 65 20 24 62 ottom [lrange $b
14a0: 6f 74 74 6f 6d 20 31 20 65 6e 64 5d 0a 09 73 65 ottom 1 end]..se
14b0: 74 20 63 68 61 6e 67 65 64 20 30 0a 0a 09 23 20 t changed 0...#
14c0: 55 70 64 61 74 65 20 6c 69 73 74 20 6f 66 20 6e Update list of n
14d0: 6f 64 65 73 20 77 69 74 68 6f 75 74 20 70 72 65 odes without pre
14e0: 64 65 63 65 73 73 6f 72 2c 20 62 61 73 65 64 20 decessor, based
14f0: 6f 6e 20 74 68 65 0a 09 23 20 6f 75 74 67 6f 69 on the..# outgoi
1500: 6e 67 20 6e 65 69 67 68 62 6f 75 72 73 20 6f 66 ng neighbours of
1510: 20 74 68 65 20 63 68 6f 73 65 6e 20 6e 6f 64 65 the chosen node
1520: 2e 20 54 68 69 73 20 73 68 6f 75 6c 64 20 62 65 . This should be
1530: 0a 09 23 20 66 61 73 74 65 72 20 74 68 61 6e 20 ..# faster than
1540: 69 74 65 72 61 74 69 6e 67 20 6f 66 20 74 68 65 iterating of the
1550: 20 77 68 6f 6c 65 20 73 65 74 20 6f 66 20 6e 6f whole set of no
1560: 64 65 73 2c 20 66 69 6e 64 69 6e 67 20 61 6c 6c des, finding all
1570: 0a 09 23 20 77 69 74 68 6f 75 74 20 70 72 65 64 ..# without pred
1580: 65 63 65 73 73 6f 72 73 2c 20 73 6f 72 74 69 6e ecessors, sortin
1590: 67 20 74 68 65 6d 20 62 79 20 74 69 6d 65 2c 20 g them by time,
15a0: 65 74 63 2e 20 70 70 2e 0a 09 66 6f 72 65 61 63 etc. pp...foreac
15b0: 68 20 6f 75 74 20 5b 24 64 67 20 6e 6f 64 65 73 h out [$dg nodes
15c0: 20 2d 6f 75 74 20 24 6e 5d 20 7b 0a 09 20 20 20 -out $n] {..
15d0: 20 69 66 20 7b 5b 24 64 67 20 6e 6f 64 65 20 64 if {[$dg node d
15e0: 65 67 72 65 65 20 2d 69 6e 20 24 6f 75 74 5d 20 egree -in $out]
15f0: 3e 20 31 7d 20 63 6f 6e 74 69 6e 75 65 0a 09 20 > 1} continue..
1600: 20 20 20 23 20 44 65 67 72 65 65 2d 31 20 6e 65 # Degree-1 ne
1610: 69 67 68 62 6f 75 72 2c 20 77 69 6c 6c 20 68 61 ighbour, will ha
1620: 76 65 20 6e 6f 20 70 72 65 64 65 63 65 73 73 6f ve no predecesso
1630: 72 73 20 61 66 74 65 72 20 74 68 65 0a 09 20 20 rs after the..
1640: 20 20 23 20 72 65 6d 6f 76 61 6c 20 6f 66 20 6e # removal of n
1650: 2e 20 50 75 74 20 6f 6e 20 74 68 65 20 6c 69 73 . Put on the lis
1660: 74 2e 0a 09 20 20 20 20 6c 61 70 70 65 6e 64 20 t... lappend
1670: 62 6f 74 74 6f 6d 20 5b 6c 69 6e 73 65 72 74 20 bottom [linsert
1680: 5b 24 64 67 20 6e 6f 64 65 20 67 65 74 20 24 6f [$dg node get $o
1690: 75 74 20 74 69 6d 65 72 61 6e 67 65 5d 20 30 20 ut timerange] 0
16a0: 24 6f 75 74 5d 0a 09 20 20 20 20 73 65 74 20 63 $out].. set c
16b0: 68 61 6e 67 65 64 20 31 0a 09 7d 0a 09 69 66 20 hanged 1..}..if
16c0: 7b 24 63 68 61 6e 67 65 64 7d 20 7b 0a 09 20 20 {$changed} {..
16d0: 20 20 73 65 74 20 62 6f 74 74 6f 6d 20 5b 6c 73 set bottom [ls
16e0: 6f 72 74 20 2d 69 6e 64 65 78 20 31 20 2d 69 6e ort -index 1 -in
16f0: 74 65 67 65 72 20 5b 6c 73 6f 72 74 20 2d 69 6e teger [lsort -in
1700: 64 65 78 20 32 20 2d 69 6e 74 65 67 65 72 20 24 dex 2 -integer $
1710: 62 6f 74 74 6f 6d 5d 5d 0a 09 7d 0a 0a 09 23 20 bottom]]..}...#
1720: 57 65 20 64 6f 20 6e 6f 74 20 64 65 6c 65 74 65 We do not delete
1730: 20 74 68 65 20 6e 6f 64 65 20 69 6d 6d 65 64 69 the node immedi
1740: 61 74 65 6c 79 2c 20 74 6f 20 61 6c 6c 6f 77 20 ately, to allow
1750: 74 68 65 20 53 61 76 65 0a 09 23 20 70 72 6f 63 the Save..# proc
1760: 65 64 75 72 65 20 74 6f 20 73 61 76 65 20 74 68 edure to save th
1770: 65 20 64 65 70 65 6e 64 65 6e 63 69 65 73 20 61 e dependencies a
1780: 73 20 77 65 6c 6c 20 28 65 6e 63 6f 64 65 64 20 s well (encoded
1790: 69 6e 20 74 68 65 0a 09 23 20 61 72 63 73 29 2e in the..# arcs).
17a0: 0a 09 72 65 74 75 72 6e 20 31 0a 20 20 20 20 7d ..return 1. }
17b0: 0a 0a 20 20 20 20 70 72 6f 63 20 53 61 76 65 41 .. proc SaveA
17c0: 6e 64 52 65 6d 6f 76 65 20 7b 64 67 20 6e 7d 20 ndRemove {dg n}
17d0: 7b 0a 09 3a 3a 76 61 72 69 61 62 6c 65 20 61 74 {..::variable at
17e0: 0a 09 73 65 74 20 63 69 64 20 5b 24 6e 20 69 64 ..set cid [$n id
17f0: 5d 0a 0a 09 6c 6f 67 20 77 72 69 74 65 20 34 20 ]...log write 4
1800: 62 72 65 61 6b 72 63 79 63 6c 65 20 22 43 6f 6d breakrcycle "Com
1810: 69 74 74 69 6e 67 20 40 20 24 61 74 3a 20 3c 24 itting @ $at: <$
1820: 63 69 64 3e 22 0a 09 73 74 61 74 65 20 72 75 6e cid>"..state run
1830: 20 7b 0a 09 20 20 20 20 49 4e 53 45 52 54 20 49 {.. INSERT I
1840: 4e 54 4f 20 63 73 6f 72 64 65 72 20 28 63 69 64 NTO csorder (cid
1850: 2c 20 20 70 6f 73 29 0a 09 20 20 20 20 56 41 4c , pos).. VAL
1860: 55 45 53 20 20 20 20 20 20 20 20 20 20 20 20 20 UES
1870: 20 28 24 63 69 64 2c 20 24 61 74 29 0a 09 7d 0a ($cid, $at)..}.
1880: 09 23 20 54 4f 44 4f 3a 20 57 72 69 74 65 20 74 .# TODO: Write t
1890: 68 65 20 70 72 6f 6a 65 63 74 20 6c 65 76 65 6c he project level
18a0: 20 63 68 61 6e 67 65 73 65 74 20 64 65 70 65 6e changeset depen
18b0: 64 65 6e 63 69 65 73 20 61 73 20 77 65 6c 6c 2e dencies as well.
18c0: 0a 09 69 6e 63 72 20 61 74 0a 09 24 64 67 20 6e ..incr at..$dg n
18d0: 6f 64 65 20 64 65 6c 65 74 65 20 24 6e 0a 09 72 ode delete $n..r
18e0: 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 20 eturn. }..
18f0: 20 70 72 6f 63 20 46 69 6e 64 43 79 63 6c 65 20 proc FindCycle
1900: 7b 64 67 7d 20 7b 0a 09 23 20 54 68 69 73 20 70 {dg} {..# This p
1910: 72 6f 63 65 64 75 72 65 20 69 73 20 72 75 6e 20 rocedure is run
1920: 69 66 20 61 6e 64 20 6f 6e 6c 79 20 74 68 65 20 if and only the
1930: 67 72 61 70 68 20 69 73 20 6e 6f 74 20 65 6d 70 graph is not emp
1940: 74 79 20 61 6e 64 0a 09 23 20 61 6c 6c 20 6e 6f ty and..# all no
1950: 64 65 73 20 68 61 76 65 20 70 72 65 64 65 63 65 des have predece
1960: 73 73 6f 72 73 2e 20 54 68 69 73 20 6d 65 61 6e ssors. This mean
1970: 73 20 74 68 61 74 20 65 61 63 68 20 6e 6f 64 65 s that each node
1980: 20 69 73 0a 09 23 20 65 69 74 68 65 72 20 70 61 is..# either pa
1990: 72 74 20 6f 66 20 61 20 63 79 63 6c 65 20 6f 72 rt of a cycle or
19a0: 20 28 69 6e 64 69 72 65 63 74 6c 79 29 20 64 65 (indirectly) de
19b0: 70 65 6e 64 69 6e 67 20 6f 6e 20 61 20 6e 6f 64 pending on a nod
19c0: 65 0a 09 23 20 69 6e 20 61 20 63 79 63 6c 65 2e e..# in a cycle.
19d0: 20 57 65 20 63 61 6e 20 73 74 61 72 74 20 61 74 We can start at
19e0: 20 61 6e 20 61 72 62 69 74 72 61 72 79 20 6e 6f an arbitrary no
19f0: 64 65 2c 20 66 6f 6c 6c 6f 77 20 69 74 73 0a 09 de, follow its..
1a00: 23 20 69 6e 63 6f 6d 69 6e 67 20 65 64 67 65 73 # incoming edges
1a10: 20 74 6f 20 69 74 73 20 70 72 65 64 65 63 65 73 to its predeces
1a20: 73 6f 72 73 20 75 6e 74 69 6c 20 77 65 20 73 65 sors until we se
1a30: 65 20 61 20 6e 6f 64 65 20 61 0a 09 23 20 73 65 e a node a..# se
1a40: 63 6f 6e 64 20 74 69 6d 65 2e 20 54 68 61 74 20 cond time. That
1a50: 6e 6f 64 65 20 63 6c 6f 73 65 73 20 74 68 65 20 node closes the
1a60: 63 79 63 6c 65 20 61 6e 64 20 74 68 65 20 62 65 cycle and the be
1a70: 67 69 6e 6e 69 6e 67 20 69 73 0a 09 23 20 69 74 ginning is..# it
1a80: 73 20 66 69 72 73 74 20 6f 63 63 75 72 65 6e 63 s first occurenc
1a90: 65 2e 20 4e 6f 74 65 20 74 68 61 74 20 77 65 20 e. Note that we
1aa0: 63 61 6e 20 63 68 6f 6f 73 65 20 61 6e 20 61 72 can choose an ar
1ab0: 62 69 74 72 61 72 79 0a 09 23 20 70 72 65 64 65 bitrary..# prede
1ac0: 63 65 73 73 6f 72 20 6f 66 20 65 61 63 68 20 6e cessor of each n
1ad0: 6f 64 65 20 61 73 20 77 65 6c 6c 2c 20 77 65 20 ode as well, we
1ae0: 64 6f 20 6e 6f 74 20 68 61 76 65 20 74 6f 20 73 do not have to s
1af0: 65 61 72 63 68 2e 0a 0a 09 23 20 57 65 20 72 65 earch....# We re
1b00: 63 6f 72 64 20 66 6f 72 20 65 61 63 68 20 6e 6f cord for each no
1b10: 64 65 20 74 68 65 20 69 6e 64 65 78 20 6f 66 20 de the index of
1b20: 74 68 65 20 66 69 72 73 74 20 61 70 70 65 61 72 the first appear
1b30: 61 6e 63 65 20 69 6e 0a 09 23 20 74 68 65 20 70 ance in..# the p
1b40: 61 74 68 2c 20 6d 61 6b 69 6e 67 20 69 74 20 65 ath, making it e
1b50: 61 73 79 20 61 74 20 74 68 65 20 65 6e 64 20 74 asy at the end t
1b60: 6f 20 63 75 74 20 74 68 65 20 63 79 63 6c 65 20 o cut the cycle
1b70: 66 72 6f 6d 0a 09 23 20 69 74 2e 0a 0a 09 23 20 from..# it....#
1b80: 43 68 6f 6f 73 65 20 61 72 62 69 74 72 61 72 79 Choose arbitrary
1b90: 20 6e 6f 64 65 20 74 6f 20 73 74 61 72 74 20 6f node to start o
1ba0: 75 72 20 73 65 61 72 63 68 20 61 74 2e 0a 09 73 ur search at...s
1bb0: 65 74 20 73 74 61 72 74 20 5b 6c 69 6e 64 65 78 et start [lindex
1bc0: 20 5b 24 64 67 20 6e 6f 64 65 73 5d 20 30 5d 0a [$dg nodes] 0].
1bd0: 0a 09 23 20 49 6e 69 74 69 61 6c 69 7a 65 20 73 ..# Initialize s
1be0: 74 61 74 65 2c 20 70 61 74 68 20 6f 66 20 73 65 tate, path of se
1bf0: 65 6e 20 6e 6f 64 65 73 2c 20 61 6e 64 20 77 68 en nodes, and wh
1c00: 65 6e 20 73 65 65 6e 2e 0a 09 73 65 74 20 20 20 en seen...set
1c10: 20 20 20 20 70 61 74 68 20 7b 7d 0a 09 61 72 72 path {}..arr
1c20: 61 79 20 73 65 74 20 73 65 65 6e 20 7b 7d 0a 0a ay set seen {}..
1c30: 09 77 68 69 6c 65 20 7b 31 7d 20 7b 0a 09 20 20 .while {1} {..
1c40: 20 20 23 20 53 74 6f 70 20 73 65 61 72 63 68 69 # Stop searchi
1c50: 6e 67 20 77 68 65 6e 20 77 65 20 68 61 76 65 20 ng when we have
1c60: 73 65 65 6e 20 74 68 65 20 63 75 72 72 65 6e 74 seen the current
1c70: 20 6e 6f 64 65 0a 09 20 20 20 20 23 20 61 6c 72 node.. # alr
1c80: 65 61 64 79 2c 20 74 68 65 20 63 69 72 63 6c 65 eady, the circle
1c90: 20 68 61 73 20 62 65 65 6e 20 63 6c 6f 73 65 64 has been closed
1ca0: 2e 0a 09 20 20 20 20 69 66 20 7b 5b 69 6e 66 6f ... if {[info
1cb0: 20 65 78 69 73 74 73 20 73 65 65 6e 28 24 73 74 exists seen($st
1cc0: 61 72 74 29 5d 7d 20 62 72 65 61 6b 0a 09 20 20 art)]} break..
1cd0: 20 20 6c 61 70 70 65 6e 64 20 70 61 74 68 20 24 lappend path $
1ce0: 73 74 61 72 74 0a 09 20 20 20 20 73 65 74 20 73 start.. set s
1cf0: 65 65 6e 28 24 73 74 61 72 74 29 20 5b 65 78 70 een($start) [exp
1d00: 72 20 7b 5b 6c 6c 65 6e 67 74 68 20 24 70 61 74 r {[llength $pat
1d10: 68 5d 2d 31 7d 5d 0a 09 20 20 20 20 23 20 43 68 h]-1}].. # Ch
1d20: 6f 6f 73 65 20 61 72 62 69 74 72 61 72 79 20 70 oose arbitrary p
1d30: 72 65 64 65 63 65 73 73 6f 72 0a 09 20 20 20 20 redecessor..
1d40: 73 65 74 20 73 74 61 72 74 20 5b 6c 69 6e 64 65 set start [linde
1d50: 78 20 5b 24 64 67 20 6e 6f 64 65 73 20 2d 69 6e x [$dg nodes -in
1d60: 20 24 73 74 61 72 74 5d 20 30 5d 0a 09 7d 0a 0a $start] 0]..}..
1d70: 09 72 65 74 75 72 6e 20 5b 73 74 72 75 63 74 3a .return [struct:
1d80: 3a 6c 69 73 74 20 72 65 76 65 72 73 65 20 5b 6c :list reverse [l
1d90: 72 61 6e 67 65 20 24 70 61 74 68 20 24 73 65 65 range $path $see
1da0: 6e 28 24 73 74 61 72 74 29 20 65 6e 64 5d 5d 0a n($start) end]].
1db0: 20 20 20 20 7d 0a 0a 20 20 20 20 70 72 6f 63 20 }.. proc
1dc0: 49 44 20 7b 63 73 65 74 7d 20 7b 20 72 65 74 75 ID {cset} { retu
1dd0: 72 6e 20 22 3c 5b 24 63 73 65 74 20 69 64 5d 3e rn "<[$cset id]>
1de0: 22 20 7d 0a 0a 20 20 20 20 70 72 6f 63 20 42 72 " }.. proc Br
1df0: 65 61 6b 43 79 63 6c 65 20 7b 64 67 20 63 79 63 eakCycle {dg cyc
1e00: 6c 65 7d 20 7b 0a 09 23 20 54 68 65 20 63 79 63 le} {..# The cyc
1e10: 6c 65 20 77 65 20 68 61 76 65 20 67 6f 74 74 65 le we have gotte
1e20: 6e 20 69 73 20 62 72 6f 6b 65 6e 20 62 79 20 62 n is broken by b
1e30: 72 65 61 6b 69 6e 67 20 61 70 61 72 74 20 6f 6e reaking apart on
1e40: 65 20 6f 72 0a 09 23 20 6d 6f 72 65 20 6f 66 20 e or..# more of
1e50: 74 68 65 20 63 68 61 6e 67 65 73 65 74 73 20 69 the changesets i
1e60: 6e 20 74 68 65 20 63 79 63 6c 65 2e 20 54 68 69 n the cycle. Thi
1e70: 73 20 63 61 75 73 65 73 20 75 73 20 74 6f 0a 09 s causes us to..
1e80: 23 20 63 72 65 61 74 65 20 6f 6e 65 20 6f 72 20 # create one or
1e90: 6d 6f 72 65 20 63 68 61 6e 67 65 73 65 74 73 20 more changesets
1ea0: 77 68 69 63 68 20 61 72 65 20 74 6f 20 62 65 20 which are to be
1eb0: 63 6f 6d 6d 69 74 74 65 64 2c 0a 09 23 20 61 64 committed,..# ad
1ec0: 64 65 64 20 74 6f 20 74 68 65 20 67 72 61 70 68 ded to the graph
1ed0: 2c 20 65 74 63 2e 20 70 70 2e 0a 0a 09 73 65 74 , etc. pp....set
1ee0: 20 63 70 72 69 6e 74 20 5b 6a 6f 69 6e 20 5b 73 cprint [join [s
1ef0: 74 72 75 63 74 3a 3a 6c 69 73 74 20 6d 61 70 20 truct::list map
1f00: 24 63 79 63 6c 65 20 5b 6d 79 70 72 6f 63 20 49 $cycle [myproc I
1f10: 44 5d 5d 20 7b 20 7d 5d 0a 0a 09 6c 61 70 70 65 D]] { }]...lappe
1f20: 6e 64 20 63 79 63 6c 65 20 5b 6c 69 6e 64 65 78 nd cycle [lindex
1f30: 20 24 63 79 63 6c 65 20 30 5d 20 5b 6c 69 6e 64 $cycle 0] [lind
1f40: 65 78 20 24 63 79 63 6c 65 20 31 5d 0a 09 73 65 ex $cycle 1]..se
1f50: 74 20 62 65 73 74 6c 69 6e 6b 20 7b 7d 0a 09 73 t bestlink {}..s
1f60: 65 74 20 62 65 73 74 6e 6f 64 65 20 7b 7d 0a 0a et bestnode {}..
1f70: 09 66 6f 72 65 61 63 68 20 5c 0a 09 20 20 20 20 .foreach \..
1f80: 70 72 65 76 20 5b 6c 72 61 6e 67 65 20 24 63 79 prev [lrange $cy
1f90: 63 6c 65 20 30 20 65 6e 64 2d 32 5d 20 5c 0a 09 cle 0 end-2] \..
1fa0: 20 20 20 20 63 73 65 74 20 5b 6c 72 61 6e 67 65 cset [lrange
1fb0: 20 24 63 79 63 6c 65 20 31 20 65 6e 64 2d 31 5d $cycle 1 end-1]
1fc0: 20 5c 0a 09 20 20 20 20 6e 65 78 74 20 5b 6c 72 \.. next [lr
1fd0: 61 6e 67 65 20 24 63 79 63 6c 65 20 32 20 65 6e ange $cycle 2 en
1fe0: 64 5d 20 7b 0a 0a 09 09 23 20 45 61 63 68 20 74 d] {....# Each t
1ff0: 72 69 70 6c 65 20 50 52 45 56 20 2d 3e 20 43 53 riple PREV -> CS
2000: 45 54 20 2d 3e 20 4e 45 58 54 20 6f 66 20 63 68 ET -> NEXT of ch
2010: 61 6e 67 65 73 65 74 73 2c 20 61 0a 09 09 23 20 angesets, a...#
2020: 27 6c 69 6e 6b 27 20 69 6e 20 74 68 65 20 63 79 'link' in the cy
2030: 63 6c 65 2c 20 69 73 20 61 6e 61 6c 79 73 65 64 cle, is analysed
2040: 20 61 6e 64 20 74 68 65 20 62 65 73 74 0a 09 09 and the best...
2050: 23 20 6c 6f 63 61 74 69 6f 6e 20 77 68 65 72 65 # location where
2060: 20 74 6f 20 61 74 20 6c 65 61 73 74 20 77 65 61 to at least wea
2070: 6b 65 6e 20 74 68 65 20 63 79 63 6c 65 20 69 73 ken the cycle is
2080: 0a 09 09 23 20 63 68 6f 73 65 6e 20 66 6f 72 20 ...# chosen for
2090: 66 75 72 74 68 65 72 20 70 72 6f 63 65 73 73 69 further processi
20a0: 6e 67 2e 0a 0a 09 09 73 65 74 20 6c 69 6e 6b 20 ng.....set link
20b0: 5b 70 72 6f 6a 65 63 74 3a 3a 72 65 76 6c 69 6e [project::revlin
20c0: 6b 20 25 41 55 54 4f 25 20 24 70 72 65 76 20 24 k %AUTO% $prev $
20d0: 63 73 65 74 20 24 6e 65 78 74 5d 0a 09 09 69 66 cset $next]...if
20e0: 20 7b 24 62 65 73 74 6c 69 6e 6b 20 65 71 20 22 {$bestlink eq "
20f0: 22 7d 20 7b 0a 09 09 20 20 20 20 73 65 74 20 62 "} {... set b
2100: 65 73 74 6c 69 6e 6b 20 24 6c 69 6e 6b 0a 09 09 estlink $link...
2110: 20 20 20 20 73 65 74 20 62 65 73 74 6e 6f 64 65 set bestnode
2120: 20 24 63 73 65 74 0a 09 09 7d 20 65 6c 73 65 69 $cset...} elsei
2130: 66 20 7b 5b 24 6c 69 6e 6b 20 62 65 74 74 65 72 f {[$link better
2140: 74 68 61 6e 20 24 62 65 73 74 6c 69 6e 6b 5d 7d than $bestlink]}
2150: 20 7b 0a 09 09 20 20 20 20 24 62 65 73 74 6c 69 {... $bestli
2160: 6e 6b 20 64 65 73 74 72 6f 79 0a 09 09 20 20 20 nk destroy...
2170: 20 73 65 74 20 62 65 73 74 6c 69 6e 6b 20 24 6c set bestlink $l
2180: 69 6e 6b 0a 09 09 20 20 20 20 73 65 74 20 62 65 ink... set be
2190: 73 74 6e 6f 64 65 20 24 63 73 65 74 0a 09 09 7d stnode $cset...}
21a0: 20 65 6c 73 65 20 7b 0a 09 09 20 20 20 20 24 6c else {... $l
21b0: 69 6e 6b 20 64 65 73 74 72 6f 79 0a 09 09 7d 0a ink destroy...}.
21c0: 09 20 20 20 20 7d 0a 0a 09 6c 6f 67 20 77 72 69 . }...log wri
21d0: 74 65 20 35 20 62 72 65 61 6b 72 63 79 63 6c 65 te 5 breakrcycle
21e0: 20 22 42 72 65 61 6b 69 6e 67 20 63 79 63 6c 65 "Breaking cycle
21f0: 20 28 24 63 70 72 69 6e 74 29 20 62 79 20 73 70 ($cprint) by sp
2200: 6c 69 74 74 69 6e 67 20 63 68 61 6e 67 65 73 65 litting changese
2210: 74 20 3c 5b 24 62 65 73 74 6e 6f 64 65 20 69 64 t <[$bestnode id
2220: 5d 3e 22 0a 0a 09 73 65 74 20 6e 65 77 63 73 65 ]>"...set newcse
2230: 74 73 20 5b 24 62 65 73 74 6c 69 6e 6b 20 62 72 ts [$bestlink br
2240: 65 61 6b 5d 0a 09 24 62 65 73 74 6c 69 6e 6b 20 eak]..$bestlink
2250: 64 65 73 74 72 6f 79 0a 0a 20 20 20 20 20 20 20 destroy..
2260: 20 23 20 41 74 20 74 68 69 73 20 70 6f 69 6e 74 # At this point
2270: 20 74 68 65 20 6f 6c 64 20 63 68 61 6e 67 65 73 the old changes
2280: 65 74 20 28 42 45 53 54 4e 4f 44 45 29 20 69 73 et (BESTNODE) is
2290: 20 67 6f 6e 65 0a 20 20 20 20 20 20 20 20 23 20 gone. #
22a0: 61 6c 72 65 61 64 79 2e 20 57 65 20 72 65 6d 6f already. We remo
22b0: 76 65 20 69 74 20 66 72 6f 6d 20 74 68 65 20 67 ve it from the g
22c0: 72 61 70 68 20 61 73 20 77 65 6c 6c 20 61 6e 64 raph as well and
22d0: 20 74 68 65 6e 20 65 6e 74 65 72 0a 20 20 20 20 then enter.
22e0: 20 20 20 20 23 20 74 68 65 20 66 72 61 67 6d 65 # the fragme
22f0: 6e 74 73 20 67 65 6e 65 72 61 74 65 64 20 66 6f nts generated fo
2300: 72 20 69 74 2e 0a 0a 20 20 20 20 20 20 20 20 24 r it... $
2310: 64 67 20 6e 6f 64 65 20 64 65 6c 65 74 65 20 24 dg node delete $
2320: 62 65 73 74 6e 6f 64 65 0a 0a 09 66 6f 72 65 61 bestnode...forea
2330: 63 68 20 63 73 65 74 20 24 6e 65 77 63 73 65 74 ch cset $newcset
2340: 73 20 7b 0a 09 20 20 20 20 24 64 67 20 6e 6f 64 s {.. $dg nod
2350: 65 20 69 6e 73 65 72 74 20 24 63 73 65 74 0a 09 e insert $cset..
2360: 20 20 20 20 24 64 67 20 6e 6f 64 65 20 73 65 74 $dg node set
2370: 20 20 20 20 24 63 73 65 74 20 74 69 6d 65 72 61 $cset timera
2380: 6e 67 65 20 5b 24 63 73 65 74 20 74 69 6d 65 72 nge [$cset timer
2390: 61 6e 67 65 5d 0a 09 7d 0a 0a 09 66 6f 72 65 61 ange]..}...forea
23a0: 63 68 20 63 73 65 74 20 24 6e 65 77 63 73 65 74 ch cset $newcset
23b0: 73 20 7b 0a 09 20 20 20 20 66 6f 72 65 61 63 68 s {.. foreach
23c0: 20 73 75 63 63 20 5b 24 63 73 65 74 20 73 75 63 succ [$cset suc
23d0: 63 65 73 73 6f 72 73 5d 20 7b 0a 09 09 23 20 43 cessors] {...# C
23e0: 68 61 6e 67 65 73 65 74 73 20 6d 61 79 20 68 61 hangesets may ha
23f0: 76 65 20 64 65 70 65 6e 64 65 6e 63 69 65 73 20 ve dependencies
2400: 6f 75 74 73 69 64 65 20 6f 66 20 74 68 65 0a 09 outside of the..
2410: 09 23 20 63 68 6f 73 65 6e 20 73 65 74 2e 20 54 .# chosen set. T
2420: 68 65 73 65 20 61 72 65 20 69 67 6e 6f 72 65 64 hese are ignored
2430: 0a 09 09 69 66 20 7b 21 5b 64 67 20 6e 6f 64 65 ...if {![dg node
2440: 20 65 78 69 73 74 73 20 24 73 75 63 63 5d 7d 20 exists $succ]}
2450: 63 6f 6e 74 69 6e 75 65 0a 09 09 24 64 67 20 61 continue...$dg a
2460: 72 63 20 69 6e 73 65 72 74 20 24 63 73 65 74 20 rc insert $cset
2470: 24 73 75 63 63 0a 09 20 20 20 20 7d 0a 09 7d 0a $succ.. }..}.
2480: 09 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 .return. }..
2490: 20 20 20 74 79 70 65 76 61 72 69 61 62 6c 65 20 typevariable
24a0: 61 74 20 20 20 20 20 20 30 20 3b 20 23 20 43 6f at 0 ; # Co
24b0: 75 6e 74 65 72 20 66 6f 72 20 63 6f 6d 6d 69 74 unter for commit
24c0: 20 69 64 73 20 66 6f 72 20 74 68 65 20 63 68 61 ids for the cha
24d0: 6e 67 65 73 65 74 73 2e 0a 20 20 20 20 74 79 70 ngesets.. typ
24e0: 65 76 61 72 69 61 62 6c 65 20 62 6f 74 74 6f 6d evariable bottom
24f0: 20 7b 7d 20 3b 20 23 20 4c 69 73 74 20 6f 66 20 {} ; # List of
2500: 63 61 6e 64 69 64 61 74 65 20 6e 6f 64 65 73 20 candidate nodes
2510: 66 6f 72 20 63 6f 6d 6d 69 74 74 69 6e 67 2e 0a for committing..
2520: 0a 20 20 20 20 23 20 23 20 23 23 20 23 23 23 20 . # # ## ###
2530: 23 23 23 23 23 20 23 23 23 23 23 23 23 23 20 23 ##### ######## #
2540: 23 23 23 23 23 23 23 23 23 23 23 23 0a 20 20 20 ############.
2550: 20 23 23 20 43 6f 6e 66 69 67 75 72 61 74 69 6f ## Configuratio
2560: 6e 0a 0a 20 20 20 20 70 72 61 67 6d 61 20 2d 68 n.. pragma -h
2570: 61 73 69 6e 73 74 61 6e 63 65 73 20 20 20 6e 6f asinstances no
2580: 20 3b 20 23 20 73 69 6e 67 6c 65 74 6f 6e 0a 20 ; # singleton.
2590: 20 20 20 70 72 61 67 6d 61 20 2d 68 61 73 74 79 pragma -hasty
25a0: 70 65 69 6e 66 6f 20 20 20 20 6e 6f 20 3b 20 23 peinfo no ; #
25b0: 20 6e 6f 20 69 6e 74 72 6f 73 70 65 63 74 69 6f no introspectio
25c0: 6e 0a 20 20 20 20 70 72 61 67 6d 61 20 2d 68 61 n. pragma -ha
25d0: 73 74 79 70 65 64 65 73 74 72 6f 79 20 6e 6f 20 stypedestroy no
25e0: 3b 20 23 20 69 6d 6d 6f 72 74 61 6c 0a 0a 20 20 ; # immortal..
25f0: 20 20 23 20 23 20 23 23 20 23 23 23 20 23 23 23 # # ## ### ###
2600: 23 23 20 23 23 23 23 23 23 23 23 20 23 23 23 23 ## ######## ####
2610: 23 23 23 23 23 23 23 23 23 0a 7d 0a 0a 6e 61 6d #########.}..nam
2620: 65 73 70 61 63 65 20 65 76 61 6c 20 3a 3a 76 63 espace eval ::vc
2630: 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 ::fossil::import
2640: 3a 3a 63 76 73 3a 3a 70 61 73 73 20 7b 0a 20 20 ::cvs::pass {.
2650: 20 20 6e 61 6d 65 73 70 61 63 65 20 65 78 70 6f namespace expo
2660: 72 74 20 62 72 65 61 6b 72 63 79 63 6c 65 0a 20 rt breakrcycle.
2670: 20 20 20 6e 61 6d 65 73 70 61 63 65 20 65 76 61 namespace eva
2680: 6c 20 62 72 65 61 6b 72 63 79 63 6c 65 20 7b 0a l breakrcycle {.
2690: 09 6e 61 6d 65 73 70 61 63 65 20 69 6d 70 6f 72 .namespace impor
26a0: 74 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a t ::vc::fossil::
26b0: 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 73 74 61 import::cvs::sta
26c0: 74 65 0a 09 6e 61 6d 65 73 70 61 63 65 20 65 76 te..namespace ev
26d0: 61 6c 20 70 72 6f 6a 65 63 74 20 7b 0a 09 20 20 al project {..
26e0: 20 20 6e 61 6d 65 73 70 61 63 65 20 69 6d 70 6f namespace impo
26f0: 72 74 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a rt ::vc::fossil:
2700: 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 70 72 :import::cvs::pr
2710: 6f 6a 65 63 74 3a 3a 72 65 76 0a 09 20 20 20 20 oject::rev..
2720: 6e 61 6d 65 73 70 61 63 65 20 69 6d 70 6f 72 74 namespace import
2730: 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 ::vc::fossil::i
2740: 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 70 72 6f 6a mport::cvs::proj
2750: 65 63 74 3a 3a 72 65 76 6c 69 6e 6b 0a 09 7d 0a ect::revlink..}.
2760: 09 6e 61 6d 65 73 70 61 63 65 20 69 6d 70 6f 72 .namespace impor
2770: 74 20 3a 3a 76 63 3a 3a 74 6f 6f 6c 73 3a 3a 6c t ::vc::tools::l
2780: 6f 67 0a 09 6c 6f 67 20 72 65 67 69 73 74 65 72 og..log register
2790: 20 62 72 65 61 6b 72 63 79 63 6c 65 0a 20 20 20 breakrcycle.
27a0: 20 7d 0a 7d 0a 0a 23 20 23 20 23 23 20 23 23 23 }.}..# # ## ###
27b0: 20 23 23 23 23 23 20 23 23 23 23 23 23 23 23 20 ##### ########
27c0: 23 23 23 23 23 23 23 23 23 23 23 23 23 20 23 23 ############# ##
27d0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
27e0: 23 23 23 0a 23 23 20 52 65 61 64 79 0a 0a 70 61 ###.## Ready..pa
27f0: 63 6b 61 67 65 20 70 72 6f 76 69 64 65 20 76 63 ckage provide vc
2800: 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 ::fossil::import
2810: 3a 3a 63 76 73 3a 3a 70 61 73 73 3a 3a 62 72 65 ::cvs::pass::bre
2820: 61 6b 72 63 79 63 6c 65 20 31 2e 30 0a 72 65 74 akrcycle 1.0.ret
2830: 75 72 6e 0a urn.