Artifact ced4d957b164bc3d628e7d7765aea4c1dfe6e338:
File tools/cvs2fossil/lib/c2f_pinitcsets.tcl part of check-in [00bf8c198e] - The performance was still not satisfying, even with faster recomputing of successors. Doing it multiple times (Building the graph in each breaker and sort passes) eats time. Caching in memory blows the memory. Chosen solution: Cache this information in the database.Created a new pass 'CsetDeps' which is run between 'InitCsets' and 'BreakRevCsetCycles' (i.e. changeset creation and first breaker pass). It computes the changeset dependencies from the file-level dependencies once and saves the result in the state, in the new table 'cssuccessor'. Now the breaker and sort passes can get the information quickly, with virtually no effort. The dependencies are recomputed incrementally when a changeset is split by one of the breaker passes, for its fragments and its predecessors.
The loop check is now trivial, and integrated into the successor computation, with the heavy lifting for the detailed analysis and reporting moved down into the type-dependent SQL queries. The relevant new method is 'loops'. Now that the loop check is incremental the pass based checks have been removed from the integrity module, and the option '--loopcheck' has been eliminated. For paranoia the graph setup and modification code got its loop check reinstated as an assert, redusing the changeset report code.
Renumbered the breaker and sort passes. A number of places, like graph setup and traversal, loading of changesets, etc. got feedback indicators to show their progress.
The selection of revision and symbol changesets for the associated breaker passes was a bit on the slow side. We now keep changeset lists sorted by type (during loading or general construction) and access them directly.
by aku on 2007-12-02 20:04:40.
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 2e 20 54 68 69 73 20 70 61 73 73 20 63 s V. This pass c 0210: 72 65 61 74 65 73 20 74 68 65 20 69 6e 69 74 69 reates the initi 0220: 61 6c 20 73 65 74 20 6f 66 20 70 72 6f 6a 65 63 al set of projec 0230: 74 20 6c 65 76 65 6c 0a 23 23 20 72 65 76 69 73 t level.## revis 0240: 69 6f 6e 73 2c 20 61 6b 61 20 63 68 61 6e 67 65 ions, aka change 0250: 73 65 74 73 2e 20 4c 61 74 65 72 20 70 61 73 73 sets. Later pass 0260: 65 73 20 77 69 6c 6c 20 72 65 66 69 6e 65 20 74 es will refine t 0270: 68 65 6d 2c 20 70 75 74 73 20 74 68 65 6d 0a 23 hem, puts them.# 0280: 23 20 69 6e 74 6f 20 70 72 6f 70 65 72 20 6f 72 # into proper or 0290: 64 65 72 2c 20 73 65 74 20 74 68 65 69 72 20 64 der, set their d 02a0: 65 70 65 6e 64 65 6e 63 69 65 73 2c 20 65 74 63 ependencies, etc 02b0: 2e 0a 0a 23 20 23 20 23 23 20 23 23 23 20 23 23 ...# # ## ### ## 02c0: 23 23 23 20 23 23 23 23 23 23 23 23 20 23 23 23 ### ######## ### 02d0: 23 23 23 23 23 23 23 23 23 23 20 23 23 23 23 23 ########## ##### 02e0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 02f0: 0a 23 23 20 52 65 71 75 69 72 65 6d 65 6e 74 73 .## Requirements 0300: 0a 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 ..package requir 0310: 65 20 54 63 6c 20 38 2e 34 20 20 20 20 20 20 20 e Tcl 8.4 0320: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0330: 20 20 20 20 20 20 20 20 3b 20 23 20 52 65 71 75 ; # Requ 0340: 69 72 65 64 20 72 75 6e 74 69 6d 65 2e 0a 70 61 ired runtime..pa 0350: 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 73 6e ckage require sn 0360: 69 74 20 20 20 20 20 20 20 20 20 20 20 20 20 20 it 0370: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0380: 20 20 20 20 3b 20 23 20 4f 4f 20 73 79 73 74 65 ; # OO syste 0390: 6d 2e 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 m..package requi 03a0: 72 65 20 76 63 3a 3a 74 6f 6f 6c 73 3a 3a 6d 69 re vc::tools::mi 03b0: 73 63 20 20 20 20 20 20 20 20 20 20 20 20 20 20 sc 03c0: 20 20 20 20 20 20 20 20 20 3b 20 23 20 54 65 78 ; # Tex 03d0: 74 20 66 6f 72 6d 61 74 74 69 6e 67 2e 0a 70 61 t formatting..pa 03e0: 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 76 63 ckage require vc 03f0: 3a 3a 74 6f 6f 6c 73 3a 3a 6c 6f 67 20 20 20 20 ::tools::log 0400: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0410: 20 20 20 20 3b 20 23 20 55 73 65 72 20 66 65 65 ; # User fee 0420: 64 62 61 63 6b 2e 0a 70 61 63 6b 61 67 65 20 72 dback..package r 0430: 65 71 75 69 72 65 20 76 63 3a 3a 66 6f 73 73 69 equire vc::fossi 0440: 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a l::import::cvs:: 0450: 72 65 70 6f 73 69 74 6f 72 79 20 20 20 3b 20 23 repository ; # 0460: 20 52 65 70 6f 73 69 74 6f 72 79 20 6d 61 6e 61 Repository mana 0470: 67 65 6d 65 6e 74 2e 0a 70 61 63 6b 61 67 65 20 gement..package 0480: 72 65 71 75 69 72 65 20 76 63 3a 3a 66 6f 73 73 require vc::foss 0490: 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a il::import::cvs: 04a0: 3a 73 74 61 74 65 20 20 20 20 20 20 20 20 3b 20 :state ; 04b0: 23 20 53 74 61 74 65 20 73 74 6f 72 61 67 65 2e # State storage. 04c0: 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 .package require 04d0: 20 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 vc::fossil::imp 04e0: 6f 72 74 3a 3a 63 76 73 3a 3a 69 6e 74 65 67 72 ort::cvs::integr 04f0: 69 74 79 20 20 20 20 3b 20 23 20 53 74 61 74 65 ity ; # State 0500: 20 69 6e 74 65 67 72 69 74 79 20 63 68 65 63 6b integrity check 0510: 73 2e 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 s..package requi 0520: 72 65 20 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 re vc::fossil::i 0530: 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 70 72 6f 6a mport::cvs::proj 0540: 65 63 74 3a 3a 72 65 76 20 3b 20 23 20 50 72 6f ect::rev ; # Pro 0550: 6a 65 63 74 20 6c 65 76 65 6c 20 63 68 61 6e 67 ject level chang 0560: 65 73 65 74 73 0a 0a 23 20 23 20 23 23 20 23 23 esets..# # ## ## 0570: 23 20 23 23 23 23 23 20 23 23 23 23 23 23 23 23 # ##### ######## 0580: 20 23 23 23 23 23 23 23 23 23 23 23 23 23 20 23 ############# # 0590: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 05a0: 23 23 23 23 0a 23 23 20 52 65 67 69 73 74 65 72 ####.## Register 05b0: 20 74 68 65 20 70 61 73 73 20 77 69 74 68 20 74 the pass with t 05c0: 68 65 20 6d 61 6e 61 67 65 6d 65 6e 74 0a 0a 76 he management..v 05d0: 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 c::fossil::impor 05e0: 74 3a 3a 63 76 73 3a 3a 70 61 73 73 20 64 65 66 t::cvs::pass def 05f0: 69 6e 65 20 5c 0a 20 20 20 20 49 6e 69 74 43 73 ine \. InitCs 0600: 65 74 73 20 5c 0a 20 20 20 20 7b 49 6e 69 74 69 ets \. {Initi 0610: 61 6c 69 7a 65 20 43 68 61 6e 67 65 53 65 74 73 alize ChangeSets 0620: 7d 20 5c 0a 20 20 20 20 3a 3a 76 63 3a 3a 66 6f } \. ::vc::fo 0630: 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 ssil::import::cv 0640: 73 3a 3a 70 61 73 73 3a 3a 69 6e 69 74 63 73 65 s::pass::initcse 0650: 74 73 0a 0a 23 20 23 20 23 23 20 23 23 23 20 23 ts..# # ## ### # 0660: 23 23 23 23 20 23 23 23 23 23 23 23 23 20 23 23 #### ######## ## 0670: 23 23 23 23 23 23 23 23 23 23 23 20 23 23 23 23 ########### #### 0680: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 0690: 23 0a 23 23 0a 0a 73 6e 69 74 3a 3a 74 79 70 65 #.##..snit::type 06a0: 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 ::vc::fossil::i 06b0: 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 70 61 73 73 mport::cvs::pass 06c0: 3a 3a 69 6e 69 74 63 73 65 74 73 20 7b 0a 20 20 ::initcsets {. 06d0: 20 20 23 20 23 20 23 23 20 23 23 23 20 23 23 23 # # ## ### ### 06e0: 23 23 20 23 23 23 23 23 23 23 23 20 23 23 23 23 ## ######## #### 06f0: 23 23 23 23 23 23 23 23 23 0a 20 20 20 20 23 23 #########. ## 0700: 20 50 75 62 6c 69 63 20 41 50 49 0a 0a 20 20 20 Public API.. 0710: 20 74 79 70 65 6d 65 74 68 6f 64 20 73 65 74 75 typemethod setu 0720: 70 20 7b 7d 20 7b 0a 09 23 20 44 65 66 69 6e 65 p {} {..# Define 0730: 20 74 68 65 20 6e 61 6d 65 73 20 61 6e 64 20 73 the names and s 0740: 74 72 75 63 74 75 72 65 20 6f 66 20 74 68 65 20 tructure of the 0750: 70 65 72 73 69 73 74 65 6e 74 20 73 74 61 74 65 persistent state 0760: 20 6f 66 0a 09 23 20 74 68 69 73 20 70 61 73 73 of..# this pass 0770: 2e 0a 0a 09 73 74 61 74 65 20 72 65 61 64 69 6e ....state readin 0780: 67 20 6d 65 74 61 0a 09 73 74 61 74 65 20 72 65 g meta..state re 0790: 61 64 69 6e 67 20 72 65 76 69 73 69 6f 6e 0a 09 ading revision.. 07a0: 73 74 61 74 65 20 72 65 61 64 69 6e 67 20 72 65 state reading re 07b0: 76 69 73 69 6f 6e 62 72 61 6e 63 68 63 68 69 6c visionbranchchil 07c0: 64 72 65 6e 0a 09 73 74 61 74 65 20 72 65 61 64 dren..state read 07d0: 69 6e 67 20 62 72 61 6e 63 68 0a 09 73 74 61 74 ing branch..stat 07e0: 65 20 72 65 61 64 69 6e 67 20 74 61 67 0a 09 73 e reading tag..s 07f0: 74 61 74 65 20 72 65 61 64 69 6e 67 20 73 79 6d tate reading sym 0800: 62 6f 6c 0a 0a 09 23 20 44 61 74 61 20 70 65 72 bol...# Data per 0810: 20 63 68 61 6e 67 65 73 65 74 2c 20 6e 61 6d 65 changeset, name 0820: 6c 79 20 74 68 65 20 70 72 6f 6a 65 63 74 20 69 ly the project i 0830: 74 20 62 65 6c 6f 6e 67 73 20 74 6f 2c 20 68 6f t belongs to, ho 0840: 77 20 69 74 0a 09 23 20 77 61 73 20 69 6e 64 75 w it..# was indu 0850: 63 65 64 20 28 72 65 76 69 73 69 6f 6e 20 6f 72 ced (revision or 0860: 20 73 79 6d 62 6f 6c 29 2c 20 70 6c 75 73 20 72 symbol), plus r 0870: 65 66 65 72 65 6e 63 65 20 74 6f 20 74 68 65 0a eference to the. 0880: 09 23 20 70 72 69 6d 61 72 79 20 65 6e 74 72 79 .# primary entry 0890: 20 63 61 75 73 69 6e 67 20 69 74 20 28 6d 65 74 causing it (met 08a0: 61 20 65 6e 74 72 79 20 6f 72 20 73 79 6d 62 6f a entry or symbo 08b0: 6c 29 2e 20 41 6e 20 61 64 6a 75 6e 63 74 0a 09 l). An adjunct.. 08c0: 23 20 74 61 62 6c 65 20 74 72 61 6e 73 6c 61 74 # table translat 08d0: 65 73 20 74 68 65 20 74 79 70 65 20 69 64 27 73 es the type id's 08e0: 20 69 6e 74 6f 20 68 75 6d 61 6e 20 72 65 61 64 into human read 08f0: 61 62 6c 65 20 6c 61 62 65 6c 73 2e 0a 0a 09 73 able labels....s 0900: 74 61 74 65 20 77 72 69 74 69 6e 67 20 63 68 61 tate writing cha 0910: 6e 67 65 73 65 74 20 7b 0a 09 20 20 20 20 63 69 ngeset {.. ci 0920: 64 20 20 20 49 4e 54 45 47 45 52 20 20 4e 4f 54 d INTEGER NOT 0930: 20 4e 55 4c 4c 20 20 50 52 49 4d 41 52 59 20 4b NULL PRIMARY K 0940: 45 59 20 20 41 55 54 4f 49 4e 43 52 45 4d 45 4e EY AUTOINCREMEN 0950: 54 2c 0a 09 20 20 20 20 70 69 64 20 20 20 49 4e T,.. pid IN 0960: 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c 20 TEGER NOT NULL 0970: 20 52 45 46 45 52 45 4e 43 45 53 20 70 72 6f 6a REFERENCES proj 0980: 65 63 74 2c 0a 09 20 20 20 20 74 79 70 65 20 20 ect,.. type 0990: 49 4e 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c INTEGER NOT NUL 09a0: 4c 20 20 52 45 46 45 52 45 4e 43 45 53 20 63 73 L REFERENCES cs 09b0: 74 79 70 65 2c 0a 09 20 20 20 20 73 72 63 20 20 type,.. src 09c0: 20 49 4e 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 INTEGER NOT NU 09d0: 4c 4c 20 2d 2d 20 52 45 46 45 52 45 4e 43 45 53 LL -- REFERENCES 09e0: 20 6d 65 74 61 7c 73 79 6d 62 6f 6c 20 28 74 79 meta|symbol (ty 09f0: 70 65 20 64 65 70 65 6e 64 65 6e 74 29 0a 09 7d pe dependent)..} 0a00: 0a 09 73 74 61 74 65 20 77 72 69 74 69 6e 67 20 ..state writing 0a10: 63 73 74 79 70 65 20 7b 0a 09 20 20 20 20 74 69 cstype {.. ti 0a20: 64 20 20 20 49 4e 54 45 47 45 52 20 20 4e 4f 54 d INTEGER NOT 0a30: 20 4e 55 4c 4c 20 20 50 52 49 4d 41 52 59 20 4b NULL PRIMARY K 0a40: 45 59 20 20 41 55 54 4f 49 4e 43 52 45 4d 45 4e EY AUTOINCREMEN 0a50: 54 2c 0a 09 20 20 20 20 6e 61 6d 65 20 20 54 45 T,.. name TE 0a60: 58 54 20 20 20 20 20 4e 4f 54 20 4e 55 4c 4c 2c XT NOT NULL, 0a70: 0a 09 20 20 20 20 55 4e 49 51 55 45 20 28 6e 61 .. UNIQUE (na 0a80: 6d 65 29 0a 09 7d 0a 09 23 20 4e 6f 74 65 3a 20 me)..}..# Note: 0a90: 4b 65 65 70 20 74 68 65 20 6c 61 62 65 6c 73 20 Keep the labels 0aa0: 75 73 65 64 20 68 65 72 65 20 69 6e 20 73 79 6e used here in syn 0ab0: 63 20 77 69 74 68 20 74 68 65 20 6e 61 6d 65 73 c with the names 0ac0: 20 66 6f 72 0a 09 23 20 20 20 20 20 20 20 73 69 for..# si 0ad0: 6e 67 6c 65 74 6f 6e 20 68 65 6c 70 65 72 20 63 ngleton helper c 0ae0: 6c 61 73 73 65 73 20 66 6f 72 20 27 70 72 6f 6a lasses for 'proj 0af0: 65 63 74 3a 3a 72 65 76 27 2e 20 54 68 65 79 20 ect::rev'. They 0b00: 61 72 65 0a 09 23 20 20 20 20 20 20 20 74 68 65 are..# the 0b10: 20 76 61 6c 69 64 20 74 79 70 65 20 6e 61 6d 65 valid type name 0b20: 73 20 66 6f 72 20 63 68 61 6e 67 65 73 65 74 73 s for changesets 0b30: 20 61 6e 64 20 61 6c 73 6f 20 68 61 72 64 77 69 and also hardwi 0b40: 72 65 64 0a 09 23 20 20 20 20 20 20 20 69 6e 20 red..# in 0b50: 73 6f 6d 65 20 63 6f 64 65 2e 0a 09 73 74 61 74 some code...stat 0b60: 65 20 72 75 6e 20 7b 0a 09 20 20 20 20 49 4e 53 e run {.. INS 0b70: 45 52 54 20 49 4e 54 4f 20 63 73 74 79 70 65 20 ERT INTO cstype 0b80: 56 41 4c 55 45 53 20 28 30 2c 27 72 65 76 27 29 VALUES (0,'rev') 0b90: 3b 0a 09 20 20 20 20 49 4e 53 45 52 54 20 49 4e ;.. INSERT IN 0ba0: 54 4f 20 63 73 74 79 70 65 20 56 41 4c 55 45 53 TO cstype VALUES 0bb0: 20 28 31 2c 27 73 79 6d 3a 3a 74 61 67 27 29 3b (1,'sym::tag'); 0bc0: 0a 09 20 20 20 20 49 4e 53 45 52 54 20 49 4e 54 .. INSERT INT 0bd0: 4f 20 63 73 74 79 70 65 20 56 41 4c 55 45 53 20 O cstype VALUES 0be0: 28 32 2c 27 73 79 6d 3a 3a 62 72 61 6e 63 68 27 (2,'sym::branch' 0bf0: 29 3b 0a 09 7d 0a 0a 09 23 20 4d 61 70 20 66 72 );..}...# Map fr 0c00: 6f 6d 20 63 68 61 6e 67 65 73 65 74 73 20 74 6f om changesets to 0c10: 20 74 68 65 20 28 66 69 6c 65 20 6c 65 76 65 6c the (file level 0c20: 29 20 72 65 76 69 73 69 6f 6e 73 2c 20 74 61 67 ) revisions, tag 0c30: 73 2c 20 6f 72 0a 09 23 20 62 72 61 6e 63 68 65 s, or..# branche 0c40: 73 20 74 68 65 79 20 63 6f 6e 74 61 69 6e 2e 20 s they contain. 0c50: 54 68 65 20 70 6f 73 27 69 74 69 6f 6e 20 70 72 The pos'ition pr 0c60: 6f 76 69 64 65 73 20 61 6e 20 6f 72 64 65 72 20 ovides an order 0c70: 6f 66 0a 09 23 20 74 68 65 20 69 74 65 6d 73 20 of..# the items 0c80: 77 69 74 68 69 6e 20 61 20 63 68 61 6e 67 65 73 within a changes 0c90: 65 74 2e 20 54 68 65 79 20 61 72 65 20 75 6e 69 et. They are uni 0ca0: 71 75 65 20 77 69 74 68 69 6e 20 74 68 65 0a 09 que within the.. 0cb0: 23 20 63 68 61 6e 67 65 73 65 74 2e 20 20 54 68 # changeset. Th 0cc0: 65 20 69 74 65 6d 73 20 61 72 65 20 69 6e 20 70 e items are in p 0cd0: 72 69 6e 63 69 70 6c 65 20 75 6e 69 71 75 65 2c rinciple unique, 0ce0: 20 69 66 20 77 65 20 77 65 72 65 0a 09 23 20 6c if we were..# l 0cf0: 6f 6f 6b 69 6e 67 20 6f 6e 6c 79 20 61 74 20 72 ooking only at r 0d00: 65 6c 65 76 61 6e 74 20 63 68 61 6e 67 65 73 65 elevant changese 0d10: 74 73 2e 20 48 6f 77 65 76 65 72 20 61 73 20 74 ts. However as t 0d20: 68 65 79 20 63 6f 6d 65 0a 09 23 20 66 72 6f 6d hey come..# from 0d30: 20 64 69 73 70 61 72 61 74 65 20 73 6f 75 72 63 disparate sourc 0d40: 65 73 20 74 68 65 20 73 61 6d 65 20 69 64 20 6d es the same id m 0d50: 61 79 20 68 61 76 65 20 64 69 66 66 65 72 65 6e ay have differen 0d60: 74 0a 09 23 20 6d 65 61 6e 69 6e 67 2c 20 62 65 t..# meaning, be 0d70: 20 69 6e 20 64 69 66 66 65 72 65 6e 74 20 63 68 in different ch 0d80: 61 6e 67 65 73 65 74 73 20 61 6e 64 20 73 6f 20 angesets and so 0d90: 69 73 20 66 6f 72 6d 61 6c 6c 79 20 6e 6f 74 0a is formally not. 0da0: 09 23 20 75 6e 69 71 75 65 2e 20 53 6f 20 77 65 .# unique. So we 0db0: 20 63 61 6e 20 6f 6e 6c 79 20 73 61 79 20 74 68 can only say th 0dc0: 61 74 20 69 74 20 69 73 20 75 6e 69 71 75 65 20 at it is unique 0dd0: 77 69 74 68 69 6e 20 74 68 65 0a 09 23 20 63 68 within the..# ch 0de0: 61 6e 67 65 73 65 74 2e 20 54 68 65 20 69 6e 74 angeset. The int 0df0: 65 67 72 69 74 79 20 6d 6f 64 75 6c 65 20 68 61 egrity module ha 0e00: 73 20 73 74 72 6f 6e 67 65 72 20 63 68 65 63 6b s stronger check 0e10: 73 2e 0a 0a 09 73 74 61 74 65 20 77 72 69 74 69 s....state writi 0e20: 6e 67 20 63 73 69 74 65 6d 20 7b 0a 09 20 20 20 ng csitem {.. 0e30: 20 63 69 64 20 20 49 4e 54 45 47 45 52 20 20 4e cid INTEGER N 0e40: 4f 54 20 4e 55 4c 4c 20 20 52 45 46 45 52 45 4e OT NULL REFEREN 0e50: 43 45 53 20 63 68 61 6e 67 65 73 65 74 2c 0a 09 CES changeset,.. 0e60: 20 20 20 20 70 6f 73 20 20 49 4e 54 45 47 45 52 pos INTEGER 0e70: 20 20 4e 4f 54 20 4e 55 4c 4c 2c 0a 09 20 20 20 NOT NULL,.. 0e80: 20 69 69 64 20 20 49 4e 54 45 47 45 52 20 20 4e iid INTEGER N 0e90: 4f 54 20 4e 55 4c 4c 2c 20 2d 2d 20 52 45 46 45 OT NULL, -- REFE 0ea0: 52 45 4e 43 45 53 20 72 65 76 69 73 69 6f 6e 7c RENCES revision| 0eb0: 74 61 67 7c 62 72 61 6e 63 68 0a 09 20 20 20 20 tag|branch.. 0ec0: 55 4e 49 51 55 45 20 28 63 69 64 2c 20 70 6f 73 UNIQUE (cid, pos 0ed0: 29 2c 0a 09 20 20 20 20 55 4e 49 51 55 45 20 28 ),.. UNIQUE ( 0ee0: 63 69 64 2c 20 69 69 64 29 0a 09 7d 20 7b 20 69 cid, iid)..} { i 0ef0: 69 64 20 7d 0a 09 23 20 49 6e 64 65 78 20 6f 6e id }..# Index on 0f00: 3a 20 69 69 64 20 28 73 75 63 63 65 73 73 6f 72 : iid (successor 0f10: 2f 70 72 65 64 65 63 65 73 73 6f 72 20 72 65 74 /predecessor ret 0f20: 72 69 65 76 61 6c 29 0a 0a 09 70 72 6f 6a 65 63 rieval)...projec 0f30: 74 3a 3a 72 65 76 20 67 65 74 63 73 74 79 70 65 t::rev getcstype 0f40: 73 0a 09 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a s..return. }. 0f50: 0a 20 20 20 20 74 79 70 65 6d 65 74 68 6f 64 20 . typemethod 0f60: 6c 6f 61 64 20 7b 7d 20 7b 0a 09 23 20 50 61 73 load {} {..# Pas 0f70: 73 20 6d 61 6e 61 67 65 72 20 69 6e 74 65 72 66 s manager interf 0f80: 61 63 65 2e 20 45 78 65 63 75 74 65 64 20 74 6f ace. Executed to 0f90: 20 6c 6f 61 64 20 64 61 74 61 20 63 6f 6d 70 75 load data compu 0fa0: 74 65 64 20 62 79 0a 09 23 20 74 68 69 73 20 70 ted by..# this p 0fb0: 61 73 73 20 69 6e 74 6f 20 6d 65 6d 6f 72 79 20 ass into memory 0fc0: 77 68 65 6e 20 74 68 69 73 20 70 61 73 73 20 69 when this pass i 0fd0: 73 20 73 6b 69 70 70 65 64 20 69 6e 73 74 65 61 s skipped instea 0fe0: 64 20 6f 66 0a 09 23 20 65 78 65 63 75 74 65 64 d of..# executed 0ff0: 2e 0a 0a 09 73 74 61 74 65 20 72 65 61 64 69 6e ....state readin 1000: 67 20 63 68 61 6e 67 65 73 65 74 0a 09 73 74 61 g changeset..sta 1010: 74 65 20 72 65 61 64 69 6e 67 20 63 73 69 74 65 te reading csite 1020: 6d 0a 09 73 74 61 74 65 20 72 65 61 64 69 6e 67 m..state reading 1030: 20 63 73 74 79 70 65 0a 0a 09 23 20 4e 65 65 64 cstype...# Need 1040: 20 74 68 65 20 74 79 70 65 73 20 66 69 72 73 74 the types first 1050: 2c 20 74 68 65 20 63 6f 6e 73 74 72 75 63 74 6f , the constructo 1060: 72 20 69 6e 20 74 68 65 20 6c 6f 6f 70 20 62 65 r in the loop be 1070: 6c 6f 77 20 75 73 65 73 0a 09 23 20 74 68 65 6d low uses..# them 1080: 20 74 6f 20 61 73 73 65 72 74 20 74 68 65 20 63 to assert the c 1090: 6f 72 72 65 63 74 6e 65 73 73 20 6f 66 20 74 79 orrectness of ty 10a0: 70 65 20 6e 61 6d 65 73 2e 0a 09 70 72 6f 6a 65 pe names...proje 10b0: 63 74 3a 3a 72 65 76 20 67 65 74 63 73 74 79 70 ct::rev getcstyp 10c0: 65 73 0a 0a 09 23 20 54 4f 44 4f 3a 20 4d 6f 76 es...# TODO: Mov 10d0: 65 20 74 6f 20 70 72 6f 6a 65 63 74 3a 3a 72 65 e to project::re 10e0: 76 0a 09 73 65 74 20 6e 20 30 0a 09 6c 6f 67 20 v..set n 0..log 10f0: 77 72 69 74 65 20 32 20 69 6e 69 74 63 73 65 74 write 2 initcset 1100: 73 20 7b 4c 6f 61 64 69 6e 67 20 74 68 65 20 63 s {Loading the c 1110: 68 61 6e 67 65 73 65 74 73 7d 0a 09 66 6f 72 65 hangesets}..fore 1120: 61 63 68 20 7b 69 64 20 70 69 64 20 63 73 74 79 ach {id pid csty 1130: 70 65 20 73 72 63 69 64 7d 20 5b 73 74 61 74 65 pe srcid} [state 1140: 20 72 75 6e 20 7b 0a 09 20 20 20 20 53 45 4c 45 run {.. SELE 1150: 43 54 20 43 2e 63 69 64 2c 20 43 2e 70 69 64 2c CT C.cid, C.pid, 1160: 20 43 53 2e 6e 61 6d 65 2c 20 43 2e 73 72 63 0a CS.name, C.src. 1170: 09 20 20 20 20 46 52 4f 4d 20 20 20 63 68 61 6e . FROM chan 1180: 67 65 73 65 74 20 43 2c 20 63 73 74 79 70 65 20 geset C, cstype 1190: 43 53 0a 09 20 20 20 20 57 48 45 52 45 20 20 43 CS.. WHERE C 11a0: 2e 74 79 70 65 20 3d 20 43 53 2e 74 69 64 0a 09 .type = CS.tid.. 11b0: 20 20 20 20 4f 52 44 45 52 20 42 59 20 43 2e 63 ORDER BY C.c 11c0: 69 64 0a 09 7d 5d 20 7b 0a 09 20 20 20 20 6c 6f id..}] {.. lo 11d0: 67 20 70 72 6f 67 72 65 73 73 20 32 20 69 6e 69 g progress 2 ini 11e0: 74 63 73 65 74 73 20 24 6e 20 7b 7d 0a 09 20 20 tcsets $n {}.. 11f0: 20 20 73 65 74 20 72 20 5b 70 72 6f 6a 65 63 74 set r [project 1200: 3a 3a 72 65 76 20 25 41 55 54 4f 25 20 5b 72 65 ::rev %AUTO% [re 1210: 70 6f 73 69 74 6f 72 79 20 70 72 6f 6a 65 63 74 pository project 1220: 6f 66 20 24 70 69 64 5d 20 24 63 73 74 79 70 65 of $pid] $cstype 1230: 20 24 73 72 63 69 64 20 5b 73 74 61 74 65 20 72 $srcid [state r 1240: 75 6e 20 7b 0a 09 09 53 45 4c 45 43 54 20 43 2e un {...SELECT C. 1250: 69 69 64 0a 09 09 46 52 4f 4d 20 20 20 63 73 69 iid...FROM csi 1260: 74 65 6d 20 43 0a 09 09 57 48 45 52 45 20 20 43 tem C...WHERE C 1270: 2e 63 69 64 20 3d 20 24 69 64 0a 09 09 4f 52 44 .cid = $id...ORD 1280: 45 52 20 42 59 20 43 2e 70 6f 73 0a 09 20 20 20 ER BY C.pos.. 1290: 20 7d 5d 20 24 69 64 5d 0a 09 20 20 20 20 69 6e }] $id].. in 12a0: 63 72 20 6e 0a 09 7d 0a 0a 09 70 72 6f 6a 65 63 cr n..}...projec 12b0: 74 3a 3a 72 65 76 20 6c 6f 61 64 63 6f 75 6e 74 t::rev loadcount 12c0: 65 72 0a 09 72 65 74 75 72 6e 0a 20 20 20 20 7d er..return. } 12d0: 0a 0a 20 20 20 20 74 79 70 65 6d 65 74 68 6f 64 .. typemethod 12e0: 20 72 75 6e 20 7b 7d 20 7b 0a 09 23 20 50 61 73 run {} {..# Pas 12f0: 73 20 6d 61 6e 61 67 65 72 20 69 6e 74 65 72 66 s manager interf 1300: 61 63 65 2e 20 45 78 65 63 75 74 65 64 20 74 6f ace. Executed to 1310: 20 70 65 72 66 6f 72 6d 20 74 68 65 0a 09 23 20 perform the..# 1320: 66 75 6e 63 74 69 6f 6e 61 6c 69 74 79 20 6f 66 functionality of 1330: 20 74 68 65 20 70 61 73 73 2e 0a 0a 09 73 74 61 the pass....sta 1340: 74 65 20 74 72 61 6e 73 61 63 74 69 6f 6e 20 7b te transaction { 1350: 0a 09 20 20 20 20 43 72 65 61 74 65 52 65 76 69 .. CreateRevi 1360: 73 69 6f 6e 43 68 61 6e 67 65 73 65 74 73 20 20 sionChangesets 1370: 3b 20 23 20 47 72 6f 75 70 20 66 69 6c 65 20 72 ; # Group file r 1380: 65 76 69 73 69 6f 6e 73 20 69 6e 74 6f 20 63 73 evisions into cs 1390: 65 74 73 2e 0a 09 20 20 20 20 42 72 65 61 6b 49 ets... BreakI 13a0: 6e 74 65 72 6e 61 6c 44 65 70 65 6e 64 65 6e 63 nternalDependenc 13b0: 69 65 73 20 3b 20 23 20 53 70 6c 69 74 20 74 68 ies ; # Split th 13c0: 65 20 63 73 65 74 73 20 62 61 73 65 64 20 6f 6e e csets based on 13d0: 20 69 6e 74 65 72 6e 61 6c 20 63 6f 6e 66 6c 69 internal confli 13e0: 63 74 73 2e 0a 09 20 20 20 20 43 72 65 61 74 65 cts... Create 13f0: 53 79 6d 62 6f 6c 43 68 61 6e 67 65 73 65 74 73 SymbolChangesets 1400: 20 20 20 20 3b 20 23 20 43 72 65 61 74 65 20 63 ; # Create c 1410: 73 65 74 73 20 66 6f 72 20 74 61 67 73 20 61 6e sets for tags an 1420: 64 20 62 72 61 6e 63 68 65 73 2e 0a 09 20 20 20 d branches... 1430: 20 50 65 72 73 69 73 74 54 68 65 43 68 61 6e 67 PersistTheChang 1440: 65 73 65 74 73 0a 09 7d 0a 0a 09 72 65 70 6f 73 esets..}...repos 1450: 69 74 6f 72 79 20 70 72 69 6e 74 63 73 65 74 73 itory printcsets 1460: 74 61 74 69 73 74 69 63 73 0a 09 69 6e 74 65 67 tatistics..integ 1470: 72 69 74 79 20 63 68 61 6e 67 65 73 65 74 73 0a rity changesets. 1480: 09 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 .return. }.. 1490: 20 20 20 74 79 70 65 6d 65 74 68 6f 64 20 64 69 typemethod di 14a0: 73 63 61 72 64 20 7b 7d 20 7b 0a 09 23 20 50 61 scard {} {..# Pa 14b0: 73 73 20 6d 61 6e 61 67 65 72 20 69 6e 74 65 72 ss manager inter 14c0: 66 61 63 65 2e 20 45 78 65 63 75 74 65 64 20 66 face. Executed f 14d0: 6f 72 20 61 6c 6c 20 70 61 73 73 65 73 20 61 66 or all passes af 14e0: 74 65 72 20 74 68 65 0a 09 23 20 72 75 6e 20 70 ter the..# run p 14f0: 61 73 73 65 73 2c 20 74 6f 20 72 65 6d 6f 76 65 asses, to remove 1500: 20 61 6c 6c 20 64 61 74 61 20 6f 66 20 74 68 69 all data of thi 1510: 73 20 70 61 73 73 20 66 72 6f 6d 20 74 68 65 20 s pass from the 1520: 73 74 61 74 65 2c 0a 09 23 20 61 73 20 62 65 69 state,..# as bei 1530: 6e 67 20 6f 75 74 20 6f 66 20 64 61 74 65 2e 0a ng out of date.. 1540: 0a 09 73 74 61 74 65 20 64 69 73 63 61 72 64 20 ..state discard 1550: 63 68 61 6e 67 65 73 65 74 0a 09 73 74 61 74 65 changeset..state 1560: 20 64 69 73 63 61 72 64 20 63 73 74 79 70 65 0a discard cstype. 1570: 09 73 74 61 74 65 20 64 69 73 63 61 72 64 20 63 .state discard c 1580: 73 69 74 65 6d 0a 09 72 65 74 75 72 6e 0a 20 20 sitem..return. 1590: 20 20 7d 0a 0a 20 20 20 20 23 20 23 20 23 23 20 }.. # # ## 15a0: 23 23 23 20 23 23 23 23 23 20 23 23 23 23 23 23 ### ##### ###### 15b0: 23 23 20 23 23 23 23 23 23 23 23 23 23 23 23 23 ## ############# 15c0: 0a 20 20 20 20 23 23 20 49 6e 74 65 72 6e 61 6c . ## Internal 15d0: 20 6d 65 74 68 6f 64 73 0a 0a 20 20 20 20 70 72 methods.. pr 15e0: 6f 63 20 43 72 65 61 74 65 52 65 76 69 73 69 6f oc CreateRevisio 15f0: 6e 43 68 61 6e 67 65 73 65 74 73 20 7b 7d 20 7b nChangesets {} { 1600: 0a 09 6c 6f 67 20 77 72 69 74 65 20 33 20 69 6e ..log write 3 in 1610: 69 74 63 73 65 74 73 20 7b 43 72 65 61 74 65 20 itcsets {Create 1620: 63 68 61 6e 67 65 73 65 74 73 20 62 61 73 65 64 changesets based 1630: 20 6f 6e 20 72 65 76 69 73 69 6f 6e 73 7d 0a 0a on revisions}.. 1640: 09 23 20 54 6f 20 67 65 74 20 74 68 65 20 69 6e .# To get the in 1650: 69 74 69 61 6c 20 6f 66 20 63 68 61 6e 67 65 73 itial of changes 1660: 65 74 73 20 77 65 20 66 69 72 73 74 20 67 72 6f ets we first gro 1670: 75 70 20 61 6c 6c 20 66 69 6c 65 0a 09 23 20 6c up all file..# l 1680: 65 76 65 6c 20 72 65 76 69 73 69 6f 6e 73 20 75 evel revisions u 1690: 73 69 6e 67 20 74 68 65 20 73 61 6d 65 20 6d 65 sing the same me 16a0: 74 61 20 64 61 74 61 20 65 6e 74 72 79 20 74 6f ta data entry to 16b0: 67 65 74 68 65 72 2e 20 41 73 0a 09 23 20 74 68 gether. As..# th 16c0: 65 20 6d 65 74 61 20 64 61 74 61 20 65 6e 63 6f e meta data enco 16d0: 64 65 73 20 6e 6f 74 20 6f 6e 6c 79 20 61 75 74 des not only aut 16e0: 68 6f 72 20 61 6e 64 20 6c 6f 67 20 6d 65 73 73 hor and log mess 16f0: 61 67 65 2c 20 62 75 74 0a 09 23 20 61 6c 73 6f age, but..# also 1700: 20 6c 69 6e 65 20 6f 66 20 64 65 76 65 6c 6f 70 line of develop 1710: 6d 65 6e 74 20 61 6e 64 20 70 72 6f 6a 65 63 74 ment and project 1720: 20 77 65 20 63 61 6e 20 62 65 20 73 75 72 65 20 we can be sure 1730: 74 68 61 74 0a 09 23 20 72 65 76 69 73 69 6f 6e that..# revision 1740: 73 20 69 6e 20 64 69 66 66 65 72 65 6e 74 20 70 s in different p 1750: 72 6f 6a 65 63 74 20 61 6e 64 20 6c 69 6e 65 73 roject and lines 1760: 20 6f 66 20 64 65 76 65 6c 6f 70 6d 65 6e 74 20 of development 1770: 61 72 65 0a 09 23 20 6e 6f 74 20 67 72 6f 75 70 are..# not group 1780: 65 64 20 74 6f 67 65 74 68 65 72 2e 20 49 6e 20 ed together. In 1790: 63 6f 6e 74 72 61 73 74 20 74 6f 20 63 76 73 32 contrast to cvs2 17a0: 73 76 6e 20 77 65 20 64 6f 20 5f 5f 6e 6f 74 5f svn we do __not_ 17b0: 5f 0a 09 23 20 75 73 65 20 64 69 73 74 61 6e 63 _..# use distanc 17c0: 65 20 69 6e 20 74 69 6d 65 20 62 65 74 77 65 65 e in time betwee 17d0: 6e 20 72 65 76 69 73 69 6f 6e 73 20 74 6f 20 62 n revisions to b 17e0: 72 65 61 6b 20 74 68 65 6d 0a 09 23 20 61 70 61 reak them..# apa 17f0: 72 74 2e 20 57 65 20 68 61 76 65 20 73 65 65 6e rt. We have seen 1800: 20 43 56 53 20 72 65 70 6f 73 69 74 6f 72 69 65 CVS repositorie 1810: 73 20 28 66 72 6f 6d 20 53 46 29 20 77 68 65 72 s (from SF) wher 1820: 65 20 61 0a 09 23 20 73 69 6e 67 6c 65 20 63 6f e a..# single co 1830: 6d 6d 69 74 20 63 6f 6e 74 61 69 6e 65 64 20 72 mmit contained r 1840: 65 76 69 73 69 6f 6e 73 20 73 65 76 65 72 61 6c evisions several 1850: 20 68 6f 75 72 73 20 61 70 61 72 74 2c 0a 09 23 hours apart,..# 1860: 20 6c 69 6b 65 6c 79 20 64 75 65 20 74 6f 20 74 likely due to t 1870: 72 6f 75 62 6c 65 20 6f 6e 20 74 68 65 20 73 65 rouble on the se 1880: 72 76 65 72 20 68 6f 73 74 69 6e 67 20 74 68 65 rver hosting the 1890: 20 72 65 70 6f 73 69 74 6f 72 79 2e 0a 0a 09 23 repository....# 18a0: 20 57 65 20 6f 72 64 65 72 20 74 68 65 20 72 65 We order the re 18b0: 76 69 73 69 6f 6e 73 20 68 65 72 65 20 62 79 20 visions here by 18c0: 74 69 6d 65 2c 20 74 68 69 73 20 77 69 6c 6c 20 time, this will 18d0: 68 65 6c 70 20 74 68 65 0a 09 23 20 6c 61 74 65 help the..# late 18e0: 72 20 70 61 73 73 65 73 20 28 61 76 6f 69 64 73 r passes (avoids 18f0: 20 6a 6f 69 6e 73 20 6c 61 74 65 72 20 74 6f 20 joins later to 1900: 67 65 74 20 61 74 20 74 68 65 20 6f 72 64 65 72 get at the order 1910: 69 6e 67 0a 09 23 20 69 6e 66 6f 29 2e 0a 0a 09 ing..# info).... 1920: 73 65 74 20 6e 20 30 0a 0a 09 73 65 74 20 6c 61 set n 0...set la 1930: 73 74 6d 65 74 61 20 20 20 20 7b 7d 0a 09 73 65 stmeta {}..se 1940: 74 20 6c 61 73 74 70 72 6f 6a 65 63 74 20 7b 7d t lastproject {} 1950: 0a 09 73 65 74 20 72 65 76 69 73 69 6f 6e 73 20 ..set revisions 1960: 20 20 7b 7d 0a 0a 09 23 20 4e 6f 74 65 3a 20 57 {}...# Note: W 1970: 65 20 63 6f 75 6c 64 20 68 61 76 65 20 77 72 69 e could have wri 1980: 74 74 65 6e 20 74 68 69 73 20 6c 6f 6f 70 20 74 tten this loop t 1990: 6f 20 63 72 65 61 74 65 20 74 68 65 20 63 73 65 o create the cse 19a0: 74 73 0a 09 23 20 20 20 20 20 20 20 65 61 72 6c ts..# earl 19b0: 79 2c 20 65 78 74 65 6e 64 69 6e 67 20 74 68 65 y, extending the 19c0: 6d 20 77 69 74 68 20 61 6c 6c 20 74 68 65 69 72 m with all their 19d0: 20 72 65 76 69 73 69 6f 6e 73 2e 20 54 68 69 73 revisions. This 19e0: 0a 09 23 20 20 20 20 20 20 20 68 6f 77 65 76 65 ..# howeve 19f0: 72 20 77 6f 75 6c 64 20 6d 65 61 6e 20 6c 6f 74 r would mean lot 1a00: 73 20 6f 66 20 28 73 6c 6f 77 29 20 6d 65 74 68 s of (slow) meth 1a10: 6f 64 20 69 6e 76 6f 6b 61 74 69 6f 6e 73 0a 09 od invokations.. 1a20: 23 20 20 20 20 20 20 20 6f 6e 20 74 68 65 20 63 # on the c 1a30: 73 65 74 73 2e 20 44 6f 69 6e 67 20 69 74 20 6c sets. Doing it l 1a40: 69 6b 65 20 74 68 69 73 2c 20 6c 61 74 65 20 63 ike this, late c 1a50: 72 65 61 74 69 6f 6e 2c 20 6d 65 61 6e 73 0a 09 reation, means.. 1a60: 23 20 20 20 20 20 20 20 6c 65 73 73 20 73 75 63 # less suc 1a70: 68 20 63 61 6c 6c 73 2e 20 4e 6f 6e 65 2c 20 62 h calls. None, b 1a80: 75 74 20 74 68 65 20 63 72 65 61 74 69 6f 6e 20 ut the creation 1a90: 69 74 73 65 6c 66 2e 0a 0a 09 66 6f 72 65 61 63 itself....foreac 1aa0: 68 20 7b 6d 69 64 20 72 69 64 20 70 69 64 7d 20 h {mid rid pid} 1ab0: 5b 73 74 61 74 65 20 72 75 6e 20 7b 0a 09 20 20 [state run {.. 1ac0: 20 20 53 45 4c 45 43 54 20 4d 2e 6d 69 64 2c 20 SELECT M.mid, 1ad0: 52 2e 72 69 64 2c 20 4d 2e 70 69 64 0a 09 20 20 R.rid, M.pid.. 1ae0: 20 20 46 52 4f 4d 20 20 20 72 65 76 69 73 69 6f FROM revisio 1af0: 6e 20 52 2c 20 6d 65 74 61 20 4d 20 20 20 2d 2d n R, meta M -- 1b00: 20 52 20 3d 3d 3e 20 4d 2c 20 75 73 69 6e 67 20 R ==> M, using 1b10: 50 4b 20 69 6e 64 65 78 20 6f 66 20 4d 2e 0a 09 PK index of M... 1b20: 20 20 20 20 57 48 45 52 45 20 20 52 2e 6d 69 64 WHERE R.mid 1b30: 20 3d 20 4d 2e 6d 69 64 0a 09 20 20 20 20 4f 52 = M.mid.. OR 1b40: 44 45 52 20 20 42 59 20 4d 2e 6d 69 64 2c 20 52 DER BY M.mid, R 1b50: 2e 64 61 74 65 0a 09 7d 5d 20 7b 0a 09 20 20 20 .date..}] {.. 1b60: 20 69 66 20 7b 24 6c 61 73 74 6d 65 74 61 20 21 if {$lastmeta ! 1b70: 3d 20 24 6d 69 64 7d 20 7b 0a 09 09 69 66 20 7b = $mid} {...if { 1b80: 5b 6c 6c 65 6e 67 74 68 20 24 72 65 76 69 73 69 [llength $revisi 1b90: 6f 6e 73 5d 7d 20 7b 0a 09 09 20 20 20 20 69 6e ons]} {... in 1ba0: 63 72 20 6e 0a 09 09 20 20 20 20 73 65 74 20 20 cr n... set 1bb0: 70 20 5b 72 65 70 6f 73 69 74 6f 72 79 20 70 72 p [repository pr 1bc0: 6f 6a 65 63 74 6f 66 20 24 6c 61 73 74 70 72 6f ojectof $lastpro 1bd0: 6a 65 63 74 5d 0a 09 09 20 20 20 20 70 72 6f 6a ject]... proj 1be0: 65 63 74 3a 3a 72 65 76 20 25 41 55 54 4f 25 20 ect::rev %AUTO% 1bf0: 24 70 20 72 65 76 20 24 6c 61 73 74 6d 65 74 61 $p rev $lastmeta 1c00: 20 24 72 65 76 69 73 69 6f 6e 73 0a 09 09 20 20 $revisions... 1c10: 20 20 73 65 74 20 72 65 76 69 73 69 6f 6e 73 20 set revisions 1c20: 7b 7d 0a 09 09 7d 0a 09 09 73 65 74 20 6c 61 73 {}...}...set las 1c30: 74 6d 65 74 61 20 20 20 20 24 6d 69 64 0a 09 09 tmeta $mid... 1c40: 73 65 74 20 6c 61 73 74 70 72 6f 6a 65 63 74 20 set lastproject 1c50: 24 70 69 64 0a 09 20 20 20 20 7d 0a 09 20 20 20 $pid.. }.. 1c60: 20 6c 61 70 70 65 6e 64 20 72 65 76 69 73 69 6f lappend revisio 1c70: 6e 73 20 24 72 69 64 0a 09 7d 0a 0a 09 69 66 20 ns $rid..}...if 1c80: 7b 5b 6c 6c 65 6e 67 74 68 20 24 72 65 76 69 73 {[llength $revis 1c90: 69 6f 6e 73 5d 7d 20 7b 0a 09 20 20 20 20 69 6e ions]} {.. in 1ca0: 63 72 20 6e 0a 09 20 20 20 20 73 65 74 20 20 70 cr n.. set p 1cb0: 20 5b 72 65 70 6f 73 69 74 6f 72 79 20 70 72 6f [repository pro 1cc0: 6a 65 63 74 6f 66 20 24 6c 61 73 74 70 72 6f 6a jectof $lastproj 1cd0: 65 63 74 5d 0a 09 20 20 20 20 70 72 6f 6a 65 63 ect].. projec 1ce0: 74 3a 3a 72 65 76 20 25 41 55 54 4f 25 20 24 70 t::rev %AUTO% $p 1cf0: 20 72 65 76 20 24 6c 61 73 74 6d 65 74 61 20 24 rev $lastmeta $ 1d00: 72 65 76 69 73 69 6f 6e 73 0a 09 7d 0a 0a 09 6c revisions..}...l 1d10: 6f 67 20 77 72 69 74 65 20 34 20 69 6e 69 74 63 og write 4 initc 1d20: 73 65 74 73 20 22 43 72 65 61 74 65 64 20 5b 6e sets "Created [n 1d30: 73 70 20 24 6e 20 7b 72 65 76 69 73 69 6f 6e 20 sp $n {revision 1d40: 63 68 61 6e 67 65 73 65 74 7d 5d 22 0a 09 72 65 changeset}]"..re 1d50: 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 20 20 turn. }.. 1d60: 70 72 6f 63 20 43 72 65 61 74 65 53 79 6d 62 6f proc CreateSymbo 1d70: 6c 43 68 61 6e 67 65 73 65 74 73 20 7b 7d 20 7b lChangesets {} { 1d80: 0a 09 6c 6f 67 20 77 72 69 74 65 20 33 20 69 6e ..log write 3 in 1d90: 69 74 63 73 65 74 73 20 7b 43 72 65 61 74 65 20 itcsets {Create 1da0: 63 68 61 6e 67 65 73 65 74 73 20 62 61 73 65 64 changesets based 1db0: 20 6f 6e 20 73 79 6d 62 6f 6c 73 7d 0a 0a 09 23 on symbols}...# 1dc0: 20 54 61 67 73 20 61 6e 64 20 62 72 61 6e 63 68 Tags and branch 1dd0: 65 73 20 69 6e 64 75 63 65 20 63 68 61 6e 67 65 es induce change 1de0: 73 65 74 73 20 61 73 20 77 65 6c 6c 2c 20 63 6f sets as well, co 1df0: 6e 74 61 69 6e 69 6e 67 20 74 68 65 0a 09 23 20 ntaining the..# 1e00: 72 65 76 69 73 69 6f 6e 73 20 74 68 65 79 20 61 revisions they a 1e10: 72 65 20 61 74 74 61 63 68 65 64 20 74 6f 20 28 re attached to ( 1e20: 74 61 67 73 29 2c 20 6f 72 20 73 70 61 77 6e 65 tags), or spawne 1e30: 64 20 66 72 6f 6d 0a 09 23 20 28 62 72 61 6e 63 d from..# (branc 1e40: 68 65 73 29 2e 0a 0a 09 73 65 74 20 6e 20 30 0a hes)....set n 0. 1e50: 0a 09 23 20 46 69 72 73 74 20 70 72 6f 63 65 73 ..# First proces 1e60: 73 20 74 68 65 20 74 61 67 73 2c 20 74 68 65 6e s the tags, then 1e70: 20 74 68 65 20 62 72 61 6e 63 68 65 73 2e 20 57 the branches. W 1e80: 65 20 6b 6e 6f 77 20 74 68 61 74 0a 09 23 20 74 e know that..# t 1e90: 68 65 69 72 20 69 64 73 20 64 6f 20 6e 6f 74 20 heir ids do not 1ea0: 6f 76 65 72 6c 61 70 20 77 69 74 68 20 65 61 63 overlap with eac 1eb0: 68 20 6f 74 68 65 72 2e 0a 0a 09 73 65 74 20 6c h other....set l 1ec0: 61 73 74 73 79 6d 62 6f 6c 20 20 7b 7d 0a 09 73 astsymbol {}..s 1ed0: 65 74 20 6c 61 73 74 70 72 6f 6a 65 63 74 20 7b et lastproject { 1ee0: 7d 0a 09 73 65 74 20 74 61 67 73 20 20 20 20 20 }..set tags 1ef0: 20 20 20 7b 7d 0a 0a 09 66 6f 72 65 61 63 68 20 {}...foreach 1f00: 7b 73 69 64 20 74 69 64 20 70 69 64 7d 20 5b 73 {sid tid pid} [s 1f10: 74 61 74 65 20 72 75 6e 20 7b 0a 09 20 20 20 20 tate run {.. 1f20: 53 45 4c 45 43 54 20 53 2e 73 69 64 2c 20 54 2e SELECT S.sid, T. 1f30: 74 69 64 2c 20 53 2e 70 69 64 0a 09 20 20 20 20 tid, S.pid.. 1f40: 46 52 4f 4d 20 20 74 61 67 20 54 2c 20 73 79 6d FROM tag T, sym 1f50: 62 6f 6c 20 53 20 20 20 20 20 2d 2d 20 54 20 3d bol S -- T = 1f60: 3d 3e 20 52 2f 53 2c 20 75 73 69 6e 67 20 50 4b => R/S, using PK 1f70: 20 69 6e 64 69 63 65 73 20 6f 66 20 52 2c 20 53 indices of R, S 1f80: 2e 0a 09 20 20 20 20 57 48 45 52 45 20 54 2e 73 ... WHERE T.s 1f90: 69 64 20 3d 20 53 2e 73 69 64 0a 09 20 20 20 20 id = S.sid.. 1fa0: 4f 52 44 45 52 20 42 59 20 53 2e 73 69 64 2c 20 ORDER BY S.sid, 1fb0: 54 2e 74 69 64 0a 09 7d 5d 20 7b 0a 09 20 20 20 T.tid..}] {.. 1fc0: 20 69 66 20 7b 24 6c 61 73 74 73 79 6d 62 6f 6c if {$lastsymbol 1fd0: 20 21 3d 20 24 73 69 64 7d 20 7b 0a 09 09 69 66 != $sid} {...if 1fe0: 20 7b 5b 6c 6c 65 6e 67 74 68 20 24 74 61 67 73 {[llength $tags 1ff0: 5d 7d 20 7b 0a 09 09 20 20 20 20 69 6e 63 72 20 ]} {... incr 2000: 6e 0a 09 09 20 20 20 20 73 65 74 20 20 70 20 5b n... set p [ 2010: 72 65 70 6f 73 69 74 6f 72 79 20 70 72 6f 6a 65 repository proje 2020: 63 74 6f 66 20 24 6c 61 73 74 70 72 6f 6a 65 63 ctof $lastprojec 2030: 74 5d 0a 09 09 20 20 20 20 70 72 6f 6a 65 63 74 t]... project 2040: 3a 3a 72 65 76 20 25 41 55 54 4f 25 20 24 70 20 ::rev %AUTO% $p 2050: 73 79 6d 3a 3a 74 61 67 20 24 6c 61 73 74 73 79 sym::tag $lastsy 2060: 6d 62 6f 6c 20 24 74 61 67 73 0a 09 09 20 20 20 mbol $tags... 2070: 20 73 65 74 20 74 61 67 73 20 7b 7d 0a 09 09 7d set tags {}...} 2080: 0a 09 09 73 65 74 20 6c 61 73 74 73 79 6d 62 6f ...set lastsymbo 2090: 6c 20 20 24 73 69 64 0a 09 09 73 65 74 20 6c 61 l $sid...set la 20a0: 73 74 70 72 6f 6a 65 63 74 20 24 70 69 64 0a 09 stproject $pid.. 20b0: 20 20 20 20 7d 0a 09 20 20 20 20 6c 61 70 70 65 }.. lappe 20c0: 6e 64 20 74 61 67 73 20 24 74 69 64 0a 09 7d 0a nd tags $tid..}. 20d0: 0a 09 69 66 20 7b 5b 6c 6c 65 6e 67 74 68 20 24 ..if {[llength $ 20e0: 74 61 67 73 5d 7d 20 7b 0a 09 20 20 20 20 69 6e tags]} {.. in 20f0: 63 72 20 6e 0a 09 20 20 20 20 73 65 74 20 20 70 cr n.. set p 2100: 20 5b 72 65 70 6f 73 69 74 6f 72 79 20 70 72 6f [repository pro 2110: 6a 65 63 74 6f 66 20 24 6c 61 73 74 70 72 6f 6a jectof $lastproj 2120: 65 63 74 5d 0a 09 20 20 20 20 70 72 6f 6a 65 63 ect].. projec 2130: 74 3a 3a 72 65 76 20 25 41 55 54 4f 25 20 24 70 t::rev %AUTO% $p 2140: 20 73 79 6d 3a 3a 74 61 67 20 24 6c 61 73 74 73 sym::tag $lasts 2150: 79 6d 62 6f 6c 20 24 74 61 67 73 0a 09 7d 0a 0a ymbol $tags..}.. 2160: 09 73 65 74 20 6c 61 73 74 73 79 6d 62 6f 6c 20 .set lastsymbol 2170: 7b 7d 0a 09 73 65 74 20 6c 61 73 70 72 6f 6a 65 {}..set lasproje 2180: 63 74 20 7b 7d 0a 09 73 65 74 20 62 72 61 6e 63 ct {}..set branc 2190: 68 65 73 20 20 20 7b 7d 0a 0a 09 66 6f 72 65 61 hes {}...forea 21a0: 63 68 20 7b 73 69 64 20 62 69 64 20 70 69 64 7d ch {sid bid pid} 21b0: 20 5b 73 74 61 74 65 20 72 75 6e 20 7b 0a 09 20 [state run {.. 21c0: 20 20 20 53 45 4c 45 43 54 20 53 2e 73 69 64 2c SELECT S.sid, 21d0: 20 42 2e 62 69 64 2c 20 53 2e 70 69 64 0a 09 20 B.bid, S.pid.. 21e0: 20 20 20 46 52 4f 4d 20 20 62 72 61 6e 63 68 20 FROM branch 21f0: 42 2c 20 73 79 6d 62 6f 6c 20 53 20 20 2d 2d 20 B, symbol S -- 2200: 42 20 3d 3d 3e 20 52 2f 53 2c 20 75 73 69 6e 67 B ==> R/S, using 2210: 20 50 4b 20 69 6e 64 69 63 65 73 20 6f 66 20 52 PK indices of R 2220: 2c 20 53 2e 0a 09 20 20 20 20 57 48 45 52 45 20 , S... WHERE 2230: 42 2e 73 69 64 20 20 3d 20 53 2e 73 69 64 0a 09 B.sid = S.sid.. 2240: 20 20 20 20 4f 52 44 45 52 20 42 59 20 53 2e 73 ORDER BY S.s 2250: 69 64 2c 20 42 2e 62 69 64 0a 09 7d 5d 20 7b 0a id, B.bid..}] {. 2260: 09 20 20 20 20 69 66 20 7b 24 6c 61 73 74 73 79 . if {$lastsy 2270: 6d 62 6f 6c 20 21 3d 20 24 73 69 64 7d 20 7b 0a mbol != $sid} {. 2280: 09 09 69 66 20 7b 5b 6c 6c 65 6e 67 74 68 20 24 ..if {[llength $ 2290: 62 72 61 6e 63 68 65 73 5d 7d 20 7b 0a 09 09 20 branches]} {... 22a0: 20 20 20 69 6e 63 72 20 6e 0a 09 09 20 20 20 20 incr n... 22b0: 73 65 74 20 20 70 20 5b 72 65 70 6f 73 69 74 6f set p [reposito 22c0: 72 79 20 70 72 6f 6a 65 63 74 6f 66 20 24 6c 61 ry projectof $la 22d0: 73 74 70 72 6f 6a 65 63 74 5d 0a 09 09 20 20 20 stproject]... 22e0: 20 70 72 6f 6a 65 63 74 3a 3a 72 65 76 20 25 41 project::rev %A 22f0: 55 54 4f 25 20 24 70 20 73 79 6d 3a 3a 62 72 61 UTO% $p sym::bra 2300: 6e 63 68 20 24 6c 61 73 74 73 79 6d 62 6f 6c 20 nch $lastsymbol 2310: 24 62 72 61 6e 63 68 65 73 0a 09 09 20 20 20 20 $branches... 2320: 73 65 74 20 62 72 61 6e 63 68 65 73 20 7b 7d 0a set branches {}. 2330: 09 09 7d 0a 09 09 73 65 74 20 6c 61 73 74 73 79 ..}...set lastsy 2340: 6d 62 6f 6c 20 20 24 73 69 64 0a 09 09 73 65 74 mbol $sid...set 2350: 20 6c 61 73 74 70 72 6f 6a 65 63 74 20 24 70 69 lastproject $pi 2360: 64 0a 09 20 20 20 20 7d 0a 09 20 20 20 20 6c 61 d.. }.. la 2370: 70 70 65 6e 64 20 62 72 61 6e 63 68 65 73 20 24 ppend branches $ 2380: 62 69 64 0a 09 7d 0a 0a 09 69 66 20 7b 5b 6c 6c bid..}...if {[ll 2390: 65 6e 67 74 68 20 24 62 72 61 6e 63 68 65 73 5d ength $branches] 23a0: 7d 20 7b 0a 09 20 20 20 20 69 6e 63 72 20 6e 0a } {.. incr n. 23b0: 09 20 20 20 20 73 65 74 20 20 70 20 5b 72 65 70 . set p [rep 23c0: 6f 73 69 74 6f 72 79 20 70 72 6f 6a 65 63 74 6f ository projecto 23d0: 66 20 24 6c 61 73 74 70 72 6f 6a 65 63 74 5d 0a f $lastproject]. 23e0: 09 20 20 20 20 70 72 6f 6a 65 63 74 3a 3a 72 65 . project::re 23f0: 76 20 25 41 55 54 4f 25 20 24 70 20 73 79 6d 3a v %AUTO% $p sym: 2400: 3a 62 72 61 6e 63 68 20 24 6c 61 73 74 73 79 6d :branch $lastsym 2410: 62 6f 6c 20 24 62 72 61 6e 63 68 65 73 0a 09 7d bol $branches..} 2420: 0a 0a 09 6c 6f 67 20 77 72 69 74 65 20 34 20 69 ...log write 4 i 2430: 6e 69 74 63 73 65 74 73 20 22 43 72 65 61 74 65 nitcsets "Create 2440: 64 20 5b 6e 73 70 20 24 6e 20 7b 73 79 6d 62 6f d [nsp $n {symbo 2450: 6c 20 63 68 61 6e 67 65 73 65 74 7d 5d 22 0a 09 l changeset}]".. 2460: 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 return. }.. 2470: 20 20 70 72 6f 63 20 42 72 65 61 6b 49 6e 74 65 proc BreakInte 2480: 72 6e 61 6c 44 65 70 65 6e 64 65 6e 63 69 65 73 rnalDependencies 2490: 20 7b 7d 20 7b 0a 09 23 20 54 68 69 73 20 63 6f {} {..# This co 24a0: 64 65 20 6f 70 65 72 61 74 65 73 20 6f 6e 20 74 de operates on t 24b0: 68 65 20 72 65 76 69 73 69 6f 6e 20 63 68 61 6e he revision chan 24c0: 67 65 73 65 74 73 20 63 72 65 61 74 65 64 20 62 gesets created b 24d0: 79 0a 09 23 20 27 43 72 65 61 74 65 52 65 76 69 y..# 'CreateRevi 24e0: 73 69 6f 6e 43 68 61 6e 67 65 73 65 74 73 27 2e sionChangesets'. 24f0: 20 41 73 20 73 75 63 68 20 69 74 20 68 61 73 20 As such it has 2500: 74 6f 20 66 6f 6c 6c 6f 77 20 61 66 74 65 72 0a to follow after. 2510: 09 23 20 69 74 2c 20 62 65 66 6f 72 65 20 74 68 .# it, before th 2520: 65 20 73 79 6d 62 6f 6c 20 63 68 61 6e 67 65 73 e symbol changes 2530: 65 74 73 20 61 72 65 20 6d 61 64 65 2e 20 54 68 ets are made. Th 2540: 65 20 63 68 61 6e 67 65 73 65 74 73 0a 09 23 20 e changesets..# 2550: 61 72 65 20 69 6e 73 70 65 63 74 65 64 20 66 6f are inspected fo 2560: 72 20 69 6e 74 65 72 6e 61 6c 20 63 6f 6e 66 6c r internal confl 2570: 69 63 74 73 20 61 6e 64 20 61 6e 79 20 73 75 63 icts and any suc 2580: 68 20 61 72 65 20 62 72 6f 6b 65 6e 0a 09 23 20 h are broken..# 2590: 62 79 20 73 70 6c 69 74 74 69 6e 67 20 74 68 65 by splitting the 25a0: 20 70 72 6f 62 6c 65 6d 61 74 69 63 20 63 68 61 problematic cha 25b0: 6e 67 65 73 65 74 20 69 6e 74 6f 20 6d 75 6c 74 ngeset into mult 25c0: 69 70 6c 65 0a 09 23 20 66 72 61 67 6d 65 6e 74 iple..# fragment 25d0: 73 2e 20 54 68 65 20 72 65 73 75 6c 74 73 20 61 s. The results a 25e0: 72 65 20 63 68 61 6e 67 65 73 65 74 73 20 77 68 re changesets wh 25f0: 69 63 68 20 68 61 76 65 20 6e 6f 20 69 6e 74 65 ich have no inte 2600: 72 6e 61 6c 0a 09 23 20 64 65 70 65 6e 64 65 6e rnal..# dependen 2610: 63 69 65 73 2c 20 6f 6e 6c 79 20 65 78 74 65 72 cies, only exter 2620: 6e 61 6c 20 6f 6e 65 73 2e 0a 0a 09 6c 6f 67 20 nal ones....log 2630: 77 72 69 74 65 20 33 20 69 6e 69 74 63 73 65 74 write 3 initcset 2640: 73 20 7b 42 72 65 61 6b 20 69 6e 74 65 72 6e 61 s {Break interna 2650: 6c 20 64 65 70 65 6e 64 65 6e 63 69 65 73 7d 0a l dependencies}. 2660: 09 73 65 74 20 6f 6c 64 20 5b 6c 6c 65 6e 67 74 .set old [llengt 2670: 68 20 5b 70 72 6f 6a 65 63 74 3a 3a 72 65 76 20 h [project::rev 2680: 61 6c 6c 5d 5d 0a 0a 09 66 6f 72 65 61 63 68 20 all]]...foreach 2690: 63 73 65 74 20 5b 70 72 6f 6a 65 63 74 3a 3a 72 cset [project::r 26a0: 65 76 20 61 6c 6c 5d 20 7b 0a 09 20 20 20 20 24 ev all] {.. $ 26b0: 63 73 65 74 20 62 72 65 61 6b 69 6e 74 65 72 6e cset breakintern 26c0: 61 6c 64 65 70 65 6e 64 65 6e 63 69 65 73 0a 09 aldependencies.. 26d0: 7d 0a 0a 09 73 65 74 20 6e 20 5b 65 78 70 72 20 }...set n [expr 26e0: 7b 5b 6c 6c 65 6e 67 74 68 20 5b 70 72 6f 6a 65 {[llength [proje 26f0: 63 74 3a 3a 72 65 76 20 61 6c 6c 5d 5d 20 2d 20 ct::rev all]] - 2700: 24 6f 6c 64 7d 5d 0a 09 6c 6f 67 20 77 72 69 74 $old}]..log writ 2710: 65 20 34 20 69 6e 69 74 63 73 65 74 73 20 22 43 e 4 initcsets "C 2720: 72 65 61 74 65 64 20 5b 6e 73 70 20 24 6e 20 7b reated [nsp $n { 2730: 61 64 64 69 74 69 6f 6e 61 6c 20 72 65 76 69 73 additional revis 2740: 69 6f 6e 20 63 68 61 6e 67 65 73 65 74 7d 5d 22 ion changeset}]" 2750: 0a 09 6c 6f 67 20 77 72 69 74 65 20 34 20 69 6e ..log write 4 in 2760: 69 74 63 73 65 74 73 20 4f 6b 2e 0a 09 72 65 74 itcsets Ok...ret 2770: 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 20 20 70 urn. }.. p 2780: 72 6f 63 20 50 65 72 73 69 73 74 54 68 65 43 68 roc PersistTheCh 2790: 61 6e 67 65 73 65 74 73 20 7b 7d 20 7b 0a 09 6c angesets {} {..l 27a0: 6f 67 20 77 72 69 74 65 20 33 20 69 6e 69 74 63 og write 3 initc 27b0: 73 65 74 73 20 22 53 61 76 69 6e 67 20 5b 6e 73 sets "Saving [ns 27c0: 70 20 5b 6c 6c 65 6e 67 74 68 20 5b 70 72 6f 6a p [llength [proj 27d0: 65 63 74 3a 3a 72 65 76 20 61 6c 6c 5d 5d 20 7b ect::rev all]] { 27e0: 69 6e 69 74 69 61 6c 20 63 68 61 6e 67 65 73 65 initial changese 27f0: 74 7d 5d 20 74 6f 20 74 68 65 20 70 65 72 73 69 t}] to the persi 2800: 73 74 65 6e 74 20 73 74 61 74 65 22 0a 0a 09 66 stent state"...f 2810: 6f 72 65 61 63 68 20 63 73 65 74 20 5b 70 72 6f oreach cset [pro 2820: 6a 65 63 74 3a 3a 72 65 76 20 61 6c 6c 5d 20 7b ject::rev all] { 2830: 0a 09 20 20 20 20 24 63 73 65 74 20 70 65 72 73 .. $cset pers 2840: 69 73 74 0a 09 7d 0a 0a 09 6c 6f 67 20 77 72 69 ist..}...log wri 2850: 74 65 20 34 20 69 6e 69 74 63 73 65 74 73 20 4f te 4 initcsets O 2860: 6b 2e 0a 09 72 65 74 75 72 6e 0a 20 20 20 20 7d k...return. } 2870: 0a 0a 20 20 20 20 23 20 23 20 23 23 20 23 23 23 .. # # ## ### 2880: 20 23 23 23 23 23 20 23 23 23 23 23 23 23 23 20 ##### ######## 2890: 23 23 23 23 23 23 23 23 23 23 23 23 23 0a 20 20 #############. 28a0: 20 20 23 23 20 43 6f 6e 66 69 67 75 72 61 74 69 ## Configurati 28b0: 6f 6e 0a 0a 20 20 20 20 70 72 61 67 6d 61 20 2d on.. pragma - 28c0: 68 61 73 69 6e 73 74 61 6e 63 65 73 20 20 20 6e hasinstances n 28d0: 6f 20 3b 20 23 20 73 69 6e 67 6c 65 74 6f 6e 0a o ; # singleton. 28e0: 20 20 20 20 70 72 61 67 6d 61 20 2d 68 61 73 74 pragma -hast 28f0: 79 70 65 69 6e 66 6f 20 20 20 20 6e 6f 20 3b 20 ypeinfo no ; 2900: 23 20 6e 6f 20 69 6e 74 72 6f 73 70 65 63 74 69 # no introspecti 2910: 6f 6e 0a 20 20 20 20 70 72 61 67 6d 61 20 2d 68 on. pragma -h 2920: 61 73 74 79 70 65 64 65 73 74 72 6f 79 20 6e 6f astypedestroy no 2930: 20 3b 20 23 20 69 6d 6d 6f 72 74 61 6c 0a 0a 20 ; # immortal.. 2940: 20 20 20 23 20 23 20 23 23 20 23 23 23 20 23 23 # # ## ### ## 2950: 23 23 23 20 23 23 23 23 23 23 23 23 20 23 23 23 ### ######## ### 2960: 23 23 23 23 23 23 23 23 23 23 0a 7d 0a 0a 6e 61 ##########.}..na 2970: 6d 65 73 70 61 63 65 20 65 76 61 6c 20 3a 3a 76 mespace eval ::v 2980: 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 c::fossil::impor 2990: 74 3a 3a 63 76 73 3a 3a 70 61 73 73 20 7b 0a 20 t::cvs::pass {. 29a0: 20 20 20 6e 61 6d 65 73 70 61 63 65 20 65 78 70 namespace exp 29b0: 6f 72 74 20 69 6e 69 74 63 73 65 74 73 0a 20 20 ort initcsets. 29c0: 20 20 6e 61 6d 65 73 70 61 63 65 20 65 76 61 6c namespace eval 29d0: 20 69 6e 69 74 63 73 65 74 73 20 7b 0a 09 6e 61 initcsets {..na 29e0: 6d 65 73 70 61 63 65 20 69 6d 70 6f 72 74 20 3a mespace import : 29f0: 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 :vc::fossil::imp 2a00: 6f 72 74 3a 3a 63 76 73 3a 3a 72 65 70 6f 73 69 ort::cvs::reposi 2a10: 74 6f 72 79 0a 09 6e 61 6d 65 73 70 61 63 65 20 tory..namespace 2a20: 69 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a 66 6f 73 import ::vc::fos 2a30: 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 sil::import::cvs 2a40: 3a 3a 73 74 61 74 65 0a 09 6e 61 6d 65 73 70 61 ::state..namespa 2a50: 63 65 20 69 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a ce import ::vc:: 2a60: 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a fossil::import:: 2a70: 63 76 73 3a 3a 69 6e 74 65 67 72 69 74 79 0a 09 cvs::integrity.. 2a80: 6e 61 6d 65 73 70 61 63 65 20 65 76 61 6c 20 70 namespace eval p 2a90: 72 6f 6a 65 63 74 20 7b 0a 09 20 20 20 20 6e 61 roject {.. na 2aa0: 6d 65 73 70 61 63 65 20 69 6d 70 6f 72 74 20 3a mespace import : 2ab0: 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 :vc::fossil::imp 2ac0: 6f 72 74 3a 3a 63 76 73 3a 3a 70 72 6f 6a 65 63 ort::cvs::projec 2ad0: 74 3a 3a 72 65 76 0a 09 7d 0a 09 6e 61 6d 65 73 t::rev..}..names 2ae0: 70 61 63 65 20 69 6d 70 6f 72 74 20 3a 3a 76 63 pace import ::vc 2af0: 3a 3a 74 6f 6f 6c 73 3a 3a 6d 69 73 63 3a 3a 2a ::tools::misc::* 2b00: 0a 09 6e 61 6d 65 73 70 61 63 65 20 69 6d 70 6f ..namespace impo 2b10: 72 74 20 3a 3a 76 63 3a 3a 74 6f 6f 6c 73 3a 3a rt ::vc::tools:: 2b20: 6c 6f 67 0a 09 6c 6f 67 20 72 65 67 69 73 74 65 log..log registe 2b30: 72 20 69 6e 69 74 63 73 65 74 73 0a 20 20 20 20 r initcsets. 2b40: 7d 0a 7d 0a 0a 23 20 23 20 23 23 20 23 23 23 20 }.}..# # ## ### 2b50: 23 23 23 23 23 20 23 23 23 23 23 23 23 23 20 23 ##### ######## # 2b60: 23 23 23 23 23 23 23 23 23 23 23 23 20 23 23 23 ############ ### 2b70: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 2b80: 23 23 0a 23 23 20 52 65 61 64 79 0a 0a 70 61 63 ##.## Ready..pac 2b90: 6b 61 67 65 20 70 72 6f 76 69 64 65 20 76 63 3a kage provide vc: 2ba0: 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a :fossil::import: 2bb0: 3a 63 76 73 3a 3a 70 61 73 73 3a 3a 69 6e 69 74 :cvs::pass::init 2bc0: 63 73 65 74 73 20 31 2e 30 0a 72 65 74 75 72 6e csets 1.0.return 2bd0: 0a .