Hex Artifact Content
Not logged in

Artifact 8f42ee8f95b8eb61ccc4eecd782d3440564d0fcc:

File tools/cvs2fossil/lib/c2f_pinitcsets.tcl part of check-in [95af789e1f] - Oops. pass 5 is not complete. Missed the breaking of internal dependencies, this is done in this pass already. Extended pass _2_ and file revisions with code to save the branchchildren (possible dependencies), and pass 5 and changesets with the proper algorithm. From cvs2svn, works, do not truly like it, as it throws away and recomputes a lot of state after each split of a cset. Could update and reuse the state to perform all splits in one go. Will try that next, for now we have a working form in the code base. by aku on 2007-11-10 20:40:06.

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 70 72 6f 6a 65 63  ort::cvs::projec
04f0: 74 3a 3a 73 79 6d 20 3b 20 23 20 50 72 6f 6a 65  t::sym ; # Proje
0500: 63 74 20 6c 65 76 65 6c 20 73 79 6d 62 6f 6c 73  ct level symbols
0510: 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65  .package require
0520: 20 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70   vc::fossil::imp
0530: 6f 72 74 3a 3a 63 76 73 3a 3a 70 72 6f 6a 65 63  ort::cvs::projec
0540: 74 3a 3a 72 65 76 20 3b 20 23 20 50 72 6f 6a 65  t::rev ; # Proje
0550: 63 74 20 6c 65 76 65 6c 20 63 68 61 6e 67 65 73  ct level changes
0560: 65 74 73 0a 0a 23 20 23 20 23 23 20 23 23 23 20  ets..# # ## ### 
0570: 23 23 23 23 23 20 23 23 23 23 23 23 23 23 20 23  ##### ######## #
0580: 23 23 23 23 23 23 23 23 23 23 23 23 20 23 23 23  ############ ###
0590: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
05a0: 23 23 0a 23 23 20 52 65 67 69 73 74 65 72 20 74  ##.## Register t
05b0: 68 65 20 70 61 73 73 20 77 69 74 68 20 74 68 65  he pass with the
05c0: 20 6d 61 6e 61 67 65 6d 65 6e 74 0a 0a 76 63 3a   management..vc:
05d0: 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a  :fossil::import:
05e0: 3a 63 76 73 3a 3a 70 61 73 73 20 64 65 66 69 6e  :cvs::pass defin
05f0: 65 20 5c 0a 20 20 20 20 49 6e 69 74 43 73 65 74  e \.    InitCset
0600: 73 20 5c 0a 20 20 20 20 7b 49 6e 69 74 69 61 6c  s \.    {Initial
0610: 69 7a 65 20 43 68 61 6e 67 65 53 65 74 73 7d 20  ize ChangeSets} 
0620: 5c 0a 20 20 20 20 3a 3a 76 63 3a 3a 66 6f 73 73  \.    ::vc::foss
0630: 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a  il::import::cvs:
0640: 3a 70 61 73 73 3a 3a 69 6e 69 74 63 73 65 74 73  :pass::initcsets
0650: 0a 0a 23 20 23 20 23 23 20 23 23 23 20 23 23 23  ..# # ## ### ###
0660: 23 23 20 23 23 23 23 23 23 23 23 20 23 23 23 23  ## ######## ####
0670: 23 23 23 23 23 23 23 23 23 20 23 23 23 23 23 23  ######### ######
0680: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 0a  ###############.
0690: 23 23 20 0a 0a 73 6e 69 74 3a 3a 74 79 70 65 20  ## ..snit::type 
06a0: 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d  ::vc::fossil::im
06b0: 70 6f 72 74 3a 3a 63 76 73 3a 3a 70 61 73 73 3a  port::cvs::pass:
06c0: 3a 69 6e 69 74 63 73 65 74 73 20 7b 0a 20 20 20  :initcsets {.   
06d0: 20 23 20 23 20 23 23 20 23 23 23 20 23 23 23 23   # # ## ### ####
06e0: 23 20 23 23 23 23 23 23 23 23 20 23 23 23 23 23  # ######## #####
06f0: 23 23 23 23 23 23 23 23 0a 20 20 20 20 23 23 20  ########.    ## 
0700: 50 75 62 6c 69 63 20 41 50 49 0a 0a 20 20 20 20  Public API..    
0710: 74 79 70 65 6d 65 74 68 6f 64 20 73 65 74 75 70  typemethod setup
0720: 20 7b 7d 20 7b 0a 09 23 20 44 65 66 69 6e 65 20   {} {..# Define 
0730: 74 68 65 20 6e 61 6d 65 73 20 61 6e 64 20 73 74  the names and st
0740: 72 75 63 74 75 72 65 20 6f 66 20 74 68 65 20 70  ructure of the p
0750: 65 72 73 69 73 74 65 6e 74 20 73 74 61 74 65 20  ersistent state 
0760: 6f 66 0a 09 23 20 74 68 69 73 20 70 61 73 73 2e  of..# this pass.
0770: 0a 0a 09 73 74 61 74 65 20 72 65 61 64 69 6e 67  ...state reading
0780: 20 6d 65 74 61 0a 09 73 74 61 74 65 20 72 65 61   meta..state rea
0790: 64 69 6e 67 20 72 65 76 69 73 69 6f 6e 0a 09 73  ding revision..s
07a0: 74 61 74 65 20 72 65 61 64 69 6e 67 20 72 65 76  tate reading rev
07b0: 69 73 69 6f 6e 62 72 61 6e 63 68 63 68 69 6c 64  isionbranchchild
07c0: 72 65 6e 0a 09 73 74 61 74 65 20 72 65 61 64 69  ren..state readi
07d0: 6e 67 20 62 72 61 6e 63 68 0a 09 73 74 61 74 65  ng branch..state
07e0: 20 72 65 61 64 69 6e 67 20 74 61 67 0a 09 73 74   reading tag..st
07f0: 61 74 65 20 72 65 61 64 69 6e 67 20 73 79 6d 62  ate reading symb
0800: 6f 6c 0a 0a 09 23 20 44 61 74 61 20 70 65 72 20  ol...# Data per 
0810: 63 68 61 6e 67 65 73 65 74 2c 20 6e 61 6d 65 6c  changeset, namel
0820: 79 20 74 68 65 20 70 72 6f 6a 65 63 74 20 69 74  y the project it
0830: 20 62 65 6c 6f 6e 67 73 20 74 6f 2c 20 68 6f 77   belongs to, how
0840: 20 69 74 0a 09 23 20 77 61 73 20 69 6e 64 75 63   it..# was induc
0850: 65 64 20 28 72 65 76 69 73 69 6f 6e 20 6f 72 20  ed (revision or 
0860: 73 79 6d 62 6f 6c 29 2c 20 70 6c 75 73 20 72 65  symbol), plus re
0870: 66 65 72 65 6e 63 65 20 74 6f 20 74 68 65 0a 09  ference to the..
0880: 23 20 70 72 69 6d 61 72 79 20 65 6e 74 72 79 20  # primary entry 
0890: 63 61 75 73 69 6e 67 20 69 74 20 28 6d 65 74 61  causing it (meta
08a0: 20 65 6e 74 72 79 20 6f 72 20 73 79 6d 62 6f 6c   entry or symbol
08b0: 29 2e 20 41 6e 20 61 64 6a 75 6e 63 74 0a 09 23  ). An adjunct..#
08c0: 20 74 61 62 6c 65 20 74 72 61 6e 73 6c 61 74 65   table translate
08d0: 73 20 74 68 65 20 74 79 70 65 20 69 64 27 73 20  s the type id's 
08e0: 69 6e 74 6f 20 68 75 6d 61 6e 20 72 65 61 64 61  into human reada
08f0: 62 6c 65 20 6c 61 62 65 6c 73 2e 0a 0a 09 73 74  ble labels....st
0900: 61 74 65 20 77 72 69 74 69 6e 67 20 63 68 61 6e  ate writing chan
0910: 67 65 73 65 74 20 7b 0a 09 20 20 20 20 63 69 64  geset {..    cid
0920: 20 20 20 49 4e 54 45 47 45 52 20 20 4e 4f 54 20     INTEGER  NOT 
0930: 4e 55 4c 4c 20 20 50 52 49 4d 41 52 59 20 4b 45  NULL  PRIMARY KE
0940: 59 20 20 41 55 54 4f 49 4e 43 52 45 4d 45 4e 54  Y  AUTOINCREMENT
0950: 2c 0a 09 20 20 20 20 70 69 64 20 20 20 49 4e 54  ,..    pid   INT
0960: 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c 20 20  EGER  NOT NULL  
0970: 52 45 46 45 52 45 4e 43 45 53 20 70 72 6f 6a 65  REFERENCES proje
0980: 63 74 2c 0a 09 20 20 20 20 74 79 70 65 20 20 49  ct,..    type  I
0990: 4e 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c  NTEGER  NOT NULL
09a0: 20 20 52 45 46 45 52 45 4e 43 45 53 20 63 73 74    REFERENCES cst
09b0: 79 70 65 2c 0a 09 20 20 20 20 73 72 63 20 20 20  ype,..    src   
09c0: 49 4e 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c  INTEGER  NOT NUL
09d0: 4c 20 2d 2d 20 52 45 46 45 52 45 4e 43 45 53 20  L -- REFERENCES 
09e0: 6d 65 74 61 7c 73 79 6d 62 6f 6c 20 28 74 79 70  meta|symbol (typ
09f0: 65 20 64 65 70 65 6e 64 65 6e 74 29 0a 09 7d 0a  e dependent)..}.
0a00: 09 73 74 61 74 65 20 77 72 69 74 69 6e 67 20 63  .state writing c
0a10: 73 74 79 70 65 20 7b 0a 09 20 20 20 20 74 69 64  stype {..    tid
0a20: 20 20 20 49 4e 54 45 47 45 52 20 20 4e 4f 54 20     INTEGER  NOT 
0a30: 4e 55 4c 4c 20 20 50 52 49 4d 41 52 59 20 4b 45  NULL  PRIMARY KE
0a40: 59 20 20 41 55 54 4f 49 4e 43 52 45 4d 45 4e 54  Y  AUTOINCREMENT
0a50: 2c 0a 09 20 20 20 20 6e 61 6d 65 20 20 54 45 58  ,..    name  TEX
0a60: 54 20 20 20 20 20 4e 4f 54 20 4e 55 4c 4c 2c 0a  T     NOT NULL,.
0a70: 09 20 20 20 20 55 4e 49 51 55 45 20 28 6e 61 6d  .    UNIQUE (nam
0a80: 65 29 0a 09 7d 0a 09 73 74 61 74 65 20 72 75 6e  e)..}..state run
0a90: 20 7b 0a 09 20 20 20 20 49 4e 53 45 52 54 20 49   {..    INSERT I
0aa0: 4e 54 4f 20 63 73 74 79 70 65 20 56 41 4c 55 45  NTO cstype VALUE
0ab0: 53 20 28 30 2c 27 72 65 76 27 29 3b 0a 09 20 20  S (0,'rev');..  
0ac0: 20 20 49 4e 53 45 52 54 20 49 4e 54 4f 20 63 73    INSERT INTO cs
0ad0: 74 79 70 65 20 56 41 4c 55 45 53 20 28 31 2c 27  type VALUES (1,'
0ae0: 73 79 6d 27 29 3b 0a 09 7d 0a 0a 09 23 20 4d 61  sym');..}...# Ma
0af0: 70 20 66 72 6f 6d 20 63 68 61 6e 67 65 73 65 74  p from changeset
0b00: 73 20 74 6f 20 74 68 65 20 28 66 69 6c 65 20 6c  s to the (file l
0b10: 65 76 65 6c 29 20 72 65 76 69 73 69 6f 6e 73 20  evel) revisions 
0b20: 74 68 65 79 0a 09 23 20 63 6f 6e 74 61 69 6e 2e  they..# contain.
0b30: 20 54 68 65 20 70 6f 73 27 69 74 69 6f 6e 20 70   The pos'ition p
0b40: 72 6f 76 69 64 65 73 20 61 6e 20 6f 72 64 65 72  rovides an order
0b50: 20 6f 66 20 74 68 65 20 72 65 76 69 73 69 6f 6e   of the revision
0b60: 73 0a 09 23 20 77 69 74 68 69 6e 20 61 20 63 68  s..# within a ch
0b70: 61 6e 67 65 73 65 74 2e 20 54 68 65 79 20 61 72  angeset. They ar
0b80: 65 20 75 6e 69 71 75 65 20 77 69 74 68 69 6e 20  e unique within 
0b90: 74 68 65 20 63 68 61 6e 67 65 73 65 74 2e 0a 09  the changeset...
0ba0: 23 20 54 68 65 20 72 65 76 69 73 69 6f 6e 73 20  # The revisions 
0bb0: 61 72 65 20 69 6e 20 70 72 69 6e 63 69 70 6c 65  are in principle
0bc0: 20 75 6e 69 71 75 65 2c 20 69 66 20 77 65 20 77   unique, if we w
0bd0: 65 72 65 20 6c 6f 6f 6b 69 6e 67 0a 09 23 20 6f  ere looking..# o
0be0: 6e 6c 79 20 61 74 20 72 65 76 69 73 69 6f 6e 20  nly at revision 
0bf0: 63 68 61 6e 67 65 73 65 74 73 2e 20 48 6f 77 65  changesets. Howe
0c00: 76 65 72 20 61 20 72 65 76 69 73 69 6f 6e 20 63  ver a revision c
0c10: 61 6e 20 61 70 70 65 61 72 0a 09 23 20 69 6e 20  an appear..# in 
0c20: 62 6f 74 68 20 72 65 76 69 73 69 6f 6e 20 61 6e  both revision an
0c30: 64 20 73 79 6d 62 6f 6c 20 63 68 61 6e 67 65 73  d symbol changes
0c40: 65 74 73 2c 20 61 6e 64 20 69 6e 20 6d 75 6c 74  ets, and in mult
0c50: 69 70 6c 65 0a 09 23 20 73 79 6d 62 6f 6c 20 63  iple..# symbol c
0c60: 68 61 6e 67 65 73 65 74 73 20 61 73 20 77 65 6c  hangesets as wel
0c70: 6c 2e 20 53 6f 20 77 65 20 63 61 6e 20 6f 6e 6c  l. So we can onl
0c80: 79 20 73 61 79 20 74 68 61 74 20 69 74 20 69 73  y say that it is
0c90: 0a 09 23 20 75 6e 69 71 75 65 20 77 69 74 68 69  ..# unique withi
0ca0: 6e 20 74 68 65 20 63 68 61 6e 67 65 73 65 74 2e  n the changeset.
0cb0: 20 0a 09 23 0a 09 23 20 54 4f 44 4f 3a 20 43 68   ..#..# TODO: Ch
0cc0: 65 63 6b 20 69 66 20 69 6e 74 65 67 72 69 74 79  eck if integrity
0cd0: 20 63 68 65 63 6b 73 20 61 72 65 20 70 6f 73 73   checks are poss
0ce0: 69 62 6c 65 2e 0a 0a 09 73 74 61 74 65 20 77 72  ible....state wr
0cf0: 69 74 69 6e 67 20 63 73 72 65 76 69 73 69 6f 6e  iting csrevision
0d00: 20 7b 0a 09 20 20 20 20 63 69 64 20 20 49 4e 54   {..    cid  INT
0d10: 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c 20 20  EGER  NOT NULL  
0d20: 52 45 46 45 52 45 4e 43 45 53 20 63 68 61 6e 67  REFERENCES chang
0d30: 65 73 65 74 2c 0a 09 20 20 20 20 70 6f 73 20 20  eset,..    pos  
0d40: 49 4e 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c  INTEGER  NOT NUL
0d50: 4c 2c 0a 09 20 20 20 20 72 69 64 20 20 49 4e 54  L,..    rid  INT
0d60: 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c 20 20  EGER  NOT NULL  
0d70: 52 45 46 45 52 45 4e 43 45 53 20 72 65 76 69 73  REFERENCES revis
0d80: 69 6f 6e 2c 0a 09 20 20 20 20 55 4e 49 51 55 45  ion,..    UNIQUE
0d90: 20 28 63 69 64 2c 20 70 6f 73 29 2c 0a 09 20 20   (cid, pos),..  
0da0: 20 20 55 4e 49 51 55 45 20 28 63 69 64 2c 20 72    UNIQUE (cid, r
0db0: 69 64 29 0a 09 7d 0a 0a 09 70 72 6f 6a 65 63 74  id)..}...project
0dc0: 3a 3a 72 65 76 20 67 65 74 63 73 74 79 70 65 73  ::rev getcstypes
0dd0: 0a 09 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a  ..return.    }..
0de0: 20 20 20 20 74 79 70 65 6d 65 74 68 6f 64 20 6c      typemethod l
0df0: 6f 61 64 20 7b 7d 20 7b 0a 09 23 20 50 61 73 73  oad {} {..# Pass
0e00: 20 6d 61 6e 61 67 65 72 20 69 6e 74 65 72 66 61   manager interfa
0e10: 63 65 2e 20 45 78 65 63 75 74 65 64 20 74 6f 20  ce. Executed to 
0e20: 6c 6f 61 64 20 64 61 74 61 20 63 6f 6d 70 75 74  load data comput
0e30: 65 64 20 62 79 0a 09 23 20 74 68 69 73 20 70 61  ed by..# this pa
0e40: 73 73 20 69 6e 74 6f 20 6d 65 6d 6f 72 79 20 77  ss into memory w
0e50: 68 65 6e 20 74 68 69 73 20 70 61 73 73 20 69 73  hen this pass is
0e60: 20 73 6b 69 70 70 65 64 20 69 6e 73 74 65 61 64   skipped instead
0e70: 20 6f 66 0a 09 23 20 65 78 65 63 75 74 65 64 2e   of..# executed.
0e80: 0a 09 23 20 2f 54 4f 44 4f 2f 6c 6f 61 64 20 63  ..# /TODO/load c
0e90: 68 61 6e 67 65 73 65 74 73 0a 0a 09 70 72 6f 6a  hangesets...proj
0ea0: 65 63 74 3a 3a 72 65 76 20 67 65 74 63 73 74 79  ect::rev getcsty
0eb0: 70 65 73 0a 09 72 65 74 75 72 6e 0a 20 20 20 20  pes..return.    
0ec0: 7d 0a 0a 20 20 20 20 74 79 70 65 6d 65 74 68 6f  }..    typemetho
0ed0: 64 20 72 75 6e 20 7b 7d 20 7b 0a 09 23 20 50 61  d run {} {..# Pa
0ee0: 73 73 20 6d 61 6e 61 67 65 72 20 69 6e 74 65 72  ss manager inter
0ef0: 66 61 63 65 2e 20 45 78 65 63 75 74 65 64 20 74  face. Executed t
0f00: 6f 20 70 65 72 66 6f 72 6d 20 74 68 65 0a 09 23  o perform the..#
0f10: 20 66 75 6e 63 74 69 6f 6e 61 6c 69 74 79 20 6f   functionality o
0f20: 66 20 74 68 65 20 70 61 73 73 2e 0a 0a 09 73 65  f the pass....se
0f30: 74 20 63 73 65 74 73 20 7b 7d 0a 09 73 74 61 74  t csets {}..stat
0f40: 65 20 74 72 61 6e 73 61 63 74 69 6f 6e 20 7b 0a  e transaction {.
0f50: 09 20 20 20 20 43 72 65 61 74 65 52 65 76 69 73  .    CreateRevis
0f60: 69 6f 6e 43 68 61 6e 67 65 73 65 74 73 20 20 63  ionChangesets  c
0f70: 73 65 74 73 20 3b 20 23 20 47 72 6f 75 70 20 66  sets ; # Group f
0f80: 69 6c 65 20 72 65 76 69 73 69 6f 6e 73 20 69 6e  ile revisions in
0f90: 74 6f 20 63 73 65 74 73 2e 0a 09 20 20 20 20 42  to csets...    B
0fa0: 72 65 61 6b 49 6e 74 65 72 6e 61 6c 44 65 70 65  reakInternalDepe
0fb0: 6e 64 65 6e 63 69 65 73 20 63 73 65 74 73 20 3b  ndencies csets ;
0fc0: 20 23 20 53 70 6c 69 74 20 74 68 65 20 63 73 65   # Split the cse
0fd0: 74 73 20 62 61 73 65 64 20 6f 6e 20 69 6e 74 65  ts based on inte
0fe0: 72 6e 61 6c 20 63 6f 6e 66 6c 69 63 74 73 2e 0a  rnal conflicts..
0ff0: 09 20 20 20 20 43 72 65 61 74 65 53 79 6d 62 6f  .    CreateSymbo
1000: 6c 43 68 61 6e 67 65 73 65 74 73 20 20 20 20 63  lChangesets    c
1010: 73 65 74 73 20 3b 20 23 20 43 72 65 61 74 65 20  sets ; # Create 
1020: 63 73 65 74 73 20 66 6f 72 20 74 61 67 73 20 61  csets for tags a
1030: 6e 64 20 62 72 61 6e 63 68 65 73 2e 0a 09 20 20  nd branches...  
1040: 20 20 50 65 72 73 69 73 74 54 68 65 43 68 61 6e    PersistTheChan
1050: 67 65 73 65 74 73 20 20 20 20 20 24 63 73 65 74  gesets     $cset
1060: 73 0a 09 7d 0a 09 72 65 74 75 72 6e 0a 20 20 20  s..}..return.   
1070: 20 7d 0a 0a 20 20 20 20 74 79 70 65 6d 65 74 68   }..    typemeth
1080: 6f 64 20 64 69 73 63 61 72 64 20 7b 7d 20 7b 0a  od discard {} {.
1090: 09 23 20 50 61 73 73 20 6d 61 6e 61 67 65 72 20  .# Pass manager 
10a0: 69 6e 74 65 72 66 61 63 65 2e 20 45 78 65 63 75  interface. Execu
10b0: 74 65 64 20 66 6f 72 20 61 6c 6c 20 70 61 73 73  ted for all pass
10c0: 65 73 20 61 66 74 65 72 20 74 68 65 0a 09 23 20  es after the..# 
10d0: 72 75 6e 20 70 61 73 73 65 73 2c 20 74 6f 20 72  run passes, to r
10e0: 65 6d 6f 76 65 20 61 6c 6c 20 64 61 74 61 20 6f  emove all data o
10f0: 66 20 74 68 69 73 20 70 61 73 73 20 66 72 6f 6d  f this pass from
1100: 20 74 68 65 20 73 74 61 74 65 2c 0a 09 23 20 61   the state,..# a
1110: 73 20 62 65 69 6e 67 20 6f 75 74 20 6f 66 20 64  s being out of d
1120: 61 74 65 2e 0a 0a 09 73 74 61 74 65 20 64 69 73  ate....state dis
1130: 63 61 72 64 20 63 68 61 6e 67 65 73 65 74 0a 09  card changeset..
1140: 73 74 61 74 65 20 64 69 73 63 61 72 64 20 63 73  state discard cs
1150: 74 79 70 65 0a 09 73 74 61 74 65 20 64 69 73 63  type..state disc
1160: 61 72 64 20 63 73 72 65 76 69 73 69 6f 6e 0a 09  ard csrevision..
1170: 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20  return.    }..  
1180: 20 20 23 20 23 20 23 23 20 23 23 23 20 23 23 23    # # ## ### ###
1190: 23 23 20 23 23 23 23 23 23 23 23 20 23 23 23 23  ## ######## ####
11a0: 23 23 23 23 23 23 23 23 23 0a 20 20 20 20 23 23  #########.    ##
11b0: 20 49 6e 74 65 72 6e 61 6c 20 6d 65 74 68 6f 64   Internal method
11c0: 73 0a 0a 20 20 20 20 70 72 6f 63 20 43 72 65 61  s..    proc Crea
11d0: 74 65 52 65 76 69 73 69 6f 6e 43 68 61 6e 67 65  teRevisionChange
11e0: 73 65 74 73 20 7b 63 76 7d 20 7b 0a 09 75 70 76  sets {cv} {..upv
11f0: 61 72 20 31 20 24 63 76 20 63 73 65 74 73 0a 0a  ar 1 $cv csets..
1200: 09 6c 6f 67 20 77 72 69 74 65 20 33 20 69 6e 69  .log write 3 ini
1210: 74 63 73 65 74 73 20 7b 43 72 65 61 74 65 20 63  tcsets {Create c
1220: 68 61 6e 67 65 73 65 74 73 20 62 61 73 65 64 20  hangesets based 
1230: 6f 6e 20 72 65 76 69 73 69 6f 6e 73 7d 0a 0a 09  on revisions}...
1240: 23 20 54 6f 20 67 65 74 20 74 68 65 20 69 6e 69  # To get the ini
1250: 74 69 61 6c 20 6f 66 20 63 68 61 6e 67 65 73 65  tial of changese
1260: 74 73 20 77 65 20 66 69 72 73 74 20 67 72 6f 75  ts we first grou
1270: 70 20 61 6c 6c 20 66 69 6c 65 0a 09 23 20 6c 65  p all file..# le
1280: 76 65 6c 20 72 65 76 69 73 69 6f 6e 73 20 75 73  vel revisions us
1290: 69 6e 67 20 74 68 65 20 73 61 6d 65 20 6d 65 74  ing the same met
12a0: 61 20 64 61 74 61 20 65 6e 74 72 79 20 74 6f 67  a data entry tog
12b0: 65 74 68 65 72 2e 20 41 73 0a 09 23 20 74 68 65  ether. As..# the
12c0: 20 6d 65 74 61 20 64 61 74 61 20 65 6e 63 6f 64   meta data encod
12d0: 65 73 20 6e 6f 74 20 6f 6e 6c 79 20 61 75 74 68  es not only auth
12e0: 6f 72 20 61 6e 64 20 6c 6f 67 20 6d 65 73 73 61  or and log messa
12f0: 67 65 2c 20 62 75 74 0a 09 23 20 61 6c 73 6f 20  ge, but..# also 
1300: 6c 69 6e 65 20 6f 66 20 64 65 76 65 6c 6f 70 6d  line of developm
1310: 65 6e 74 20 61 6e 64 20 70 72 6f 6a 65 63 74 20  ent and project 
1320: 77 65 20 63 61 6e 20 62 65 20 73 75 72 65 20 74  we can be sure t
1330: 68 61 74 0a 09 23 20 72 65 76 69 73 69 6f 6e 73  hat..# revisions
1340: 20 69 6e 20 64 69 66 66 65 72 65 6e 74 20 70 72   in different pr
1350: 6f 6a 65 63 74 20 61 6e 64 20 6c 69 6e 65 73 20  oject and lines 
1360: 6f 66 20 64 65 76 65 6c 6f 70 6d 65 6e 74 20 61  of development a
1370: 72 65 0a 09 23 20 6e 6f 74 20 67 72 6f 75 70 65  re..# not groupe
1380: 64 20 74 6f 67 65 74 68 65 72 2e 20 49 6e 20 63  d together. In c
1390: 6f 6e 74 72 61 73 74 20 74 6f 20 63 76 73 32 73  ontrast to cvs2s
13a0: 76 6e 20 77 65 20 64 6f 20 5f 5f 6e 6f 74 5f 5f  vn we do __not__
13b0: 0a 09 23 20 75 73 65 20 64 69 73 74 61 6e 63 65  ..# use distance
13c0: 20 69 6e 20 74 69 6d 65 20 62 65 74 77 65 65 6e   in time between
13d0: 20 72 65 76 69 73 69 6f 6e 73 20 74 6f 20 62 72   revisions to br
13e0: 65 61 6b 20 74 68 65 6d 0a 09 23 20 61 70 61 72  eak them..# apar
13f0: 74 2e 20 57 65 20 68 61 76 65 20 73 65 65 6e 20  t. We have seen 
1400: 43 56 53 20 72 65 70 6f 73 69 74 6f 72 69 65 73  CVS repositories
1410: 20 28 66 72 6f 6d 20 53 46 29 20 77 68 65 72 65   (from SF) where
1420: 20 61 0a 09 23 20 73 69 6e 67 6c 65 20 63 6f 6d   a..# single com
1430: 6d 69 74 20 63 6f 6e 74 61 69 6e 65 64 20 72 65  mit contained re
1440: 76 69 73 69 6f 6e 73 20 73 65 76 65 72 61 6c 20  visions several 
1450: 68 6f 75 72 73 20 61 70 61 72 74 2c 0a 09 23 20  hours apart,..# 
1460: 6c 69 6b 65 6c 79 20 64 75 65 20 74 6f 20 74 72  likely due to tr
1470: 6f 75 62 6c 65 20 6f 6e 20 74 68 65 20 73 65 72  ouble on the ser
1480: 76 65 72 20 68 6f 73 74 69 6e 67 20 74 68 65 20  ver hosting the 
1490: 72 65 70 6f 73 69 74 6f 72 79 2e 0a 0a 09 23 20  repository....# 
14a0: 57 65 20 6f 72 64 65 72 20 74 68 65 20 72 65 76  We order the rev
14b0: 69 73 69 6f 6e 73 20 68 65 72 65 20 62 79 20 74  isions here by t
14c0: 69 6d 65 2c 20 74 68 69 73 20 77 69 6c 6c 20 68  ime, this will h
14d0: 65 6c 70 20 74 68 65 0a 09 23 20 6c 61 74 65 72  elp the..# later
14e0: 20 70 61 73 73 65 73 20 28 61 76 6f 69 64 73 20   passes (avoids 
14f0: 6a 6f 69 6e 73 20 6c 61 74 65 72 20 74 6f 20 67  joins later to g
1500: 65 74 20 61 74 20 74 68 65 20 6f 72 64 65 72 69  et at the orderi
1510: 6e 67 0a 09 23 20 69 6e 66 6f 29 2e 0a 0a 09 73  ng..# info)....s
1520: 65 74 20 6e 20 30 0a 0a 09 73 65 74 20 6c 61 73  et n 0...set las
1530: 74 6d 65 74 61 20 20 20 20 7b 7d 0a 09 73 65 74  tmeta    {}..set
1540: 20 6c 61 73 74 70 72 6f 6a 65 63 74 20 7b 7d 0a   lastproject {}.
1550: 09 73 65 74 20 72 65 76 69 73 69 6f 6e 73 20 20  .set revisions  
1560: 20 7b 7d 0a 0a 09 23 20 4e 6f 74 65 3a 20 57 65   {}...# Note: We
1570: 20 63 6f 75 6c 64 20 68 61 76 65 20 77 72 69 74   could have writ
1580: 74 65 6e 20 74 68 69 73 20 6c 6f 6f 70 20 74 6f  ten this loop to
1590: 20 63 72 65 61 74 65 20 74 68 65 20 63 73 65 74   create the cset
15a0: 73 0a 09 23 20 20 20 20 20 20 20 65 61 72 6c 79  s..#       early
15b0: 2c 20 65 78 74 65 6e 64 69 6e 67 20 74 68 65 6d  , extending them
15c0: 20 77 69 74 68 20 61 6c 6c 20 74 68 65 69 72 20   with all their 
15d0: 72 65 76 69 73 69 6f 6e 73 2e 20 54 68 69 73 0a  revisions. This.
15e0: 09 23 20 20 20 20 20 20 20 68 6f 77 65 76 65 72  .#       however
15f0: 20 77 6f 75 6c 64 20 6d 65 61 6e 20 6c 6f 74 73   would mean lots
1600: 20 6f 66 20 28 73 6c 6f 77 29 20 6d 65 74 68 6f   of (slow) metho
1610: 64 20 69 6e 76 6f 6b 61 74 69 6f 6e 73 0a 09 23  d invokations..#
1620: 20 20 20 20 20 20 20 6f 6e 20 74 68 65 20 63 73         on the cs
1630: 65 74 73 2e 20 44 6f 69 6e 67 20 69 74 20 6c 69  ets. Doing it li
1640: 6b 65 20 74 68 69 73 2c 20 6c 61 74 65 20 63 72  ke this, late cr
1650: 65 61 74 69 6f 6e 2c 20 6d 65 61 6e 73 0a 09 23  eation, means..#
1660: 20 20 20 20 20 20 20 6c 65 73 73 20 73 75 63 68         less such
1670: 20 63 61 6c 6c 73 2e 20 4e 6f 6e 65 2c 20 62 75   calls. None, bu
1680: 74 20 74 68 65 20 63 72 65 61 74 69 6f 6e 20 69  t the creation i
1690: 74 73 65 6c 66 2e 0a 0a 09 66 6f 72 65 61 63 68  tself....foreach
16a0: 20 7b 6d 69 64 20 72 69 64 20 70 69 64 7d 20 5b   {mid rid pid} [
16b0: 73 74 61 74 65 20 72 75 6e 20 7b 0a 09 20 20 20  state run {..   
16c0: 20 53 45 4c 45 43 54 20 4d 2e 6d 69 64 2c 20 52   SELECT M.mid, R
16d0: 2e 72 69 64 2c 20 4d 2e 70 69 64 0a 09 20 20 20  .rid, M.pid..   
16e0: 20 46 52 4f 4d 20 20 20 72 65 76 69 73 69 6f 6e   FROM   revision
16f0: 20 52 2c 20 6d 65 74 61 20 4d 20 20 20 2d 2d 20   R, meta M   -- 
1700: 52 20 3d 3d 3e 20 4d 2c 20 75 73 69 6e 67 20 50  R ==> M, using P
1710: 4b 20 69 6e 64 65 78 20 6f 66 20 4d 2e 0a 09 20  K index of M... 
1720: 20 20 20 57 48 45 52 45 20 20 52 2e 6d 69 64 20     WHERE  R.mid 
1730: 3d 20 4d 2e 6d 69 64 0a 09 20 20 20 20 4f 52 44  = M.mid..    ORD
1740: 45 52 20 20 42 59 20 4d 2e 6d 69 64 2c 20 52 2e  ER  BY M.mid, R.
1750: 64 61 74 65 0a 09 7d 5d 20 7b 0a 09 20 20 20 20  date..}] {..    
1760: 69 66 20 7b 24 6c 61 73 74 6d 65 74 61 20 21 3d  if {$lastmeta !=
1770: 20 24 6d 69 64 7d 20 7b 0a 09 09 69 66 20 7b 5b   $mid} {...if {[
1780: 6c 6c 65 6e 67 74 68 20 24 72 65 76 69 73 69 6f  llength $revisio
1790: 6e 73 5d 7d 20 7b 0a 09 09 20 20 20 20 69 6e 63  ns]} {...    inc
17a0: 72 20 6e 0a 09 09 20 20 20 20 73 65 74 20 20 70  r n...    set  p
17b0: 20 5b 72 65 70 6f 73 69 74 6f 72 79 20 70 72 6f   [repository pro
17c0: 6a 65 63 74 6f 66 20 24 6c 61 73 74 70 72 6f 6a  jectof $lastproj
17d0: 65 63 74 5d 0a 09 09 20 20 20 20 6c 61 70 70 65  ect]...    lappe
17e0: 6e 64 20 63 73 65 74 73 20 5b 70 72 6f 6a 65 63  nd csets [projec
17f0: 74 3a 3a 72 65 76 20 25 41 55 54 4f 25 20 24 70  t::rev %AUTO% $p
1800: 20 72 65 76 20 24 6c 61 73 74 6d 65 74 61 20 24   rev $lastmeta $
1810: 72 65 76 69 73 69 6f 6e 73 5d 0a 09 09 20 20 20  revisions]...   
1820: 20 73 65 74 20 72 65 76 69 73 69 6f 6e 73 20 7b   set revisions {
1830: 7d 0a 09 09 7d 0a 09 09 73 65 74 20 6c 61 73 74  }...}...set last
1840: 6d 65 74 61 20 20 20 20 24 6d 69 64 0a 09 09 73  meta    $mid...s
1850: 65 74 20 6c 61 73 74 70 72 6f 6a 65 63 74 20 24  et lastproject $
1860: 70 69 64 0a 09 20 20 20 20 7d 0a 09 20 20 20 20  pid..    }..    
1870: 6c 61 70 70 65 6e 64 20 72 65 76 69 73 69 6f 6e  lappend revision
1880: 73 20 24 72 69 64 0a 09 7d 0a 0a 09 69 66 20 7b  s $rid..}...if {
1890: 5b 6c 6c 65 6e 67 74 68 20 24 72 65 76 69 73 69  [llength $revisi
18a0: 6f 6e 73 5d 7d 20 7b 0a 09 20 20 20 20 69 6e 63  ons]} {..    inc
18b0: 72 20 6e 0a 09 20 20 20 20 73 65 74 20 20 70 20  r n..    set  p 
18c0: 5b 72 65 70 6f 73 69 74 6f 72 79 20 70 72 6f 6a  [repository proj
18d0: 65 63 74 6f 66 20 24 6c 61 73 74 70 72 6f 6a 65  ectof $lastproje
18e0: 63 74 5d 0a 09 20 20 20 20 6c 61 70 70 65 6e 64  ct]..    lappend
18f0: 20 63 73 65 74 73 20 5b 70 72 6f 6a 65 63 74 3a   csets [project:
1900: 3a 72 65 76 20 25 41 55 54 4f 25 20 24 70 20 72  :rev %AUTO% $p r
1910: 65 76 20 24 6c 61 73 74 6d 65 74 61 20 24 72 65  ev $lastmeta $re
1920: 76 69 73 69 6f 6e 73 5d 0a 09 7d 0a 0a 09 6c 6f  visions]..}...lo
1930: 67 20 77 72 69 74 65 20 34 20 69 6e 69 74 63 73  g write 4 initcs
1940: 65 74 73 20 22 43 72 65 61 74 65 64 20 5b 6e 73  ets "Created [ns
1950: 70 20 24 6e 20 7b 72 65 76 69 73 69 6f 6e 20 63  p $n {revision c
1960: 68 61 6e 67 65 73 65 74 7d 5d 22 0a 09 72 65 74  hangeset}]"..ret
1970: 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 20 20 70  urn.    }..    p
1980: 72 6f 63 20 43 72 65 61 74 65 53 79 6d 62 6f 6c  roc CreateSymbol
1990: 43 68 61 6e 67 65 73 65 74 73 20 7b 63 76 7d 20  Changesets {cv} 
19a0: 7b 0a 09 75 70 76 61 72 20 31 20 24 63 76 20 63  {..upvar 1 $cv c
19b0: 73 65 74 73 0a 0a 09 6c 6f 67 20 77 72 69 74 65  sets...log write
19c0: 20 33 20 69 6e 69 74 63 73 65 74 73 20 7b 43 72   3 initcsets {Cr
19d0: 65 61 74 65 20 63 68 61 6e 67 65 73 65 74 73 20  eate changesets 
19e0: 62 61 73 65 64 20 6f 6e 20 73 79 6d 62 6f 6c 73  based on symbols
19f0: 7d 0a 0a 09 23 20 54 61 67 73 20 61 6e 64 20 62  }...# Tags and b
1a00: 72 61 6e 63 68 65 73 20 69 6e 64 75 63 65 20 63  ranches induce c
1a10: 68 61 6e 67 65 73 65 74 73 20 61 73 20 77 65 6c  hangesets as wel
1a20: 6c 2c 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68  l, containing th
1a30: 65 0a 09 23 20 72 65 76 69 73 69 6f 6e 73 20 74  e..# revisions t
1a40: 68 65 79 20 61 72 65 20 61 74 74 61 63 68 65 64  hey are attached
1a50: 20 74 6f 20 28 74 61 67 73 29 2c 20 6f 72 20 73   to (tags), or s
1a60: 70 61 77 6e 65 64 20 66 72 6f 6d 0a 09 23 20 28  pawned from..# (
1a70: 62 72 61 6e 63 68 65 73 29 2e 0a 0a 09 73 65 74  branches)....set
1a80: 20 6e 20 30 0a 0a 09 23 20 46 69 72 73 74 20 70   n 0...# First p
1a90: 72 6f 63 65 73 73 20 74 68 65 20 74 61 67 73 2c  rocess the tags,
1aa0: 20 74 68 65 6e 20 74 68 65 20 62 72 61 6e 63 68   then the branch
1ab0: 65 73 2e 20 57 65 20 6b 6e 6f 77 20 74 68 61 74  es. We know that
1ac0: 0a 09 23 20 74 68 65 69 72 20 69 64 73 20 64 6f  ..# their ids do
1ad0: 20 6e 6f 74 20 6f 76 65 72 6c 61 70 20 77 69 74   not overlap wit
1ae0: 68 20 65 61 63 68 20 6f 74 68 65 72 2e 0a 0a 09  h each other....
1af0: 73 65 74 20 6c 61 73 74 73 79 6d 62 6f 6c 20 20  set lastsymbol  
1b00: 7b 7d 0a 09 73 65 74 20 6c 61 73 74 70 72 6f 6a  {}..set lastproj
1b10: 65 63 74 20 7b 7d 0a 09 73 65 74 20 72 65 76 69  ect {}..set revi
1b20: 73 69 6f 6e 73 20 20 20 7b 7d 0a 0a 09 66 6f 72  sions   {}...for
1b30: 65 61 63 68 20 7b 73 69 64 20 72 69 64 20 70 69  each {sid rid pi
1b40: 64 7d 20 5b 73 74 61 74 65 20 72 75 6e 20 7b 0a  d} [state run {.
1b50: 09 20 20 20 20 53 45 4c 45 43 54 20 53 2e 73 69  .    SELECT S.si
1b60: 64 2c 20 52 2e 72 69 64 2c 20 53 2e 70 69 64 0a  d, R.rid, S.pid.
1b70: 09 20 20 20 20 46 52 4f 4d 20 20 74 61 67 20 54  .    FROM  tag T
1b80: 2c 20 72 65 76 69 73 69 6f 6e 20 52 2c 20 73 79  , revision R, sy
1b90: 6d 62 6f 6c 20 53 20 20 20 20 20 2d 2d 20 54 20  mbol S     -- T 
1ba0: 3d 3d 3e 20 52 2f 53 2c 20 75 73 69 6e 67 20 50  ==> R/S, using P
1bb0: 4b 20 69 6e 64 69 63 65 73 20 6f 66 20 52 2c 20  K indices of R, 
1bc0: 53 2e 0a 09 20 20 20 20 57 48 45 52 45 20 54 2e  S...    WHERE T.
1bd0: 72 65 76 20 3d 20 52 2e 72 69 64 0a 09 20 20 20  rev = R.rid..   
1be0: 20 41 4e 44 20 20 20 54 2e 73 69 64 20 3d 20 53   AND   T.sid = S
1bf0: 2e 73 69 64 0a 09 20 20 20 20 4f 52 44 45 52 20  .sid..    ORDER 
1c00: 42 59 20 53 2e 73 69 64 2c 20 52 2e 64 61 74 65  BY S.sid, R.date
1c10: 0a 09 7d 5d 20 7b 0a 09 20 20 20 20 69 66 20 7b  ..}] {..    if {
1c20: 24 6c 61 73 74 73 79 6d 62 6f 6c 20 21 3d 20 24  $lastsymbol != $
1c30: 73 69 64 7d 20 7b 0a 09 09 69 66 20 7b 5b 6c 6c  sid} {...if {[ll
1c40: 65 6e 67 74 68 20 24 72 65 76 69 73 69 6f 6e 73  ength $revisions
1c50: 5d 7d 20 7b 0a 09 09 20 20 20 20 69 6e 63 72 20  ]} {...    incr 
1c60: 6e 0a 09 09 20 20 20 20 73 65 74 20 20 70 20 5b  n...    set  p [
1c70: 72 65 70 6f 73 69 74 6f 72 79 20 70 72 6f 6a 65  repository proje
1c80: 63 74 6f 66 20 24 6c 61 73 74 70 72 6f 6a 65 63  ctof $lastprojec
1c90: 74 5d 0a 09 09 20 20 20 20 6c 61 70 70 65 6e 64  t]...    lappend
1ca0: 20 63 73 65 74 73 20 5b 70 72 6f 6a 65 63 74 3a   csets [project:
1cb0: 3a 72 65 76 20 25 41 55 54 4f 25 20 24 70 20 73  :rev %AUTO% $p s
1cc0: 79 6d 20 24 6c 61 73 74 73 79 6d 62 6f 6c 20 24  ym $lastsymbol $
1cd0: 72 65 76 69 73 69 6f 6e 73 5d 0a 09 09 20 20 20  revisions]...   
1ce0: 20 73 65 74 20 72 65 76 69 73 69 6f 6e 73 20 7b   set revisions {
1cf0: 7d 0a 09 09 7d 0a 09 09 73 65 74 20 6c 61 73 74  }...}...set last
1d00: 73 79 6d 62 6f 6c 20 20 24 73 69 64 0a 09 09 73  symbol  $sid...s
1d10: 65 74 20 6c 61 73 74 70 72 6f 6a 65 63 74 20 24  et lastproject $
1d20: 70 69 64 0a 09 20 20 20 20 7d 0a 09 20 20 20 20  pid..    }..    
1d30: 6c 61 70 70 65 6e 64 20 72 65 76 69 73 69 6f 6e  lappend revision
1d40: 73 20 24 72 69 64 0a 09 7d 0a 0a 09 69 66 20 7b  s $rid..}...if {
1d50: 5b 6c 6c 65 6e 67 74 68 20 24 72 65 76 69 73 69  [llength $revisi
1d60: 6f 6e 73 5d 7d 20 7b 0a 09 20 20 20 20 69 6e 63  ons]} {..    inc
1d70: 72 20 6e 0a 09 20 20 20 20 73 65 74 20 20 70 20  r n..    set  p 
1d80: 5b 72 65 70 6f 73 69 74 6f 72 79 20 70 72 6f 6a  [repository proj
1d90: 65 63 74 6f 66 20 24 6c 61 73 74 70 72 6f 6a 65  ectof $lastproje
1da0: 63 74 5d 0a 09 20 20 20 20 6c 61 70 70 65 6e 64  ct]..    lappend
1db0: 20 63 73 65 74 73 20 5b 70 72 6f 6a 65 63 74 3a   csets [project:
1dc0: 3a 72 65 76 20 25 41 55 54 4f 25 20 24 70 20 73  :rev %AUTO% $p s
1dd0: 79 6d 20 24 6c 61 73 74 73 79 6d 62 6f 6c 20 24  ym $lastsymbol $
1de0: 72 65 76 69 73 69 6f 6e 73 5d 0a 09 7d 0a 0a 09  revisions]..}...
1df0: 73 65 74 20 6c 61 73 74 73 79 6d 62 6f 6c 20 7b  set lastsymbol {
1e00: 7d 0a 09 73 65 74 20 6c 61 73 70 72 6f 6a 65 63  }..set lasprojec
1e10: 74 20 7b 7d 0a 09 73 65 74 20 72 65 76 69 73 69  t {}..set revisi
1e20: 6f 6e 73 20 20 7b 7d 0a 0a 09 66 6f 72 65 61 63  ons  {}...foreac
1e30: 68 20 7b 73 69 64 20 72 69 64 20 70 69 64 7d 20  h {sid rid pid} 
1e40: 5b 73 74 61 74 65 20 72 75 6e 20 7b 0a 09 20 20  [state run {..  
1e50: 20 20 53 45 4c 45 43 54 20 53 2e 73 69 64 2c 20    SELECT S.sid, 
1e60: 52 2e 72 69 64 2c 20 53 2e 70 69 64 0a 09 20 20  R.rid, S.pid..  
1e70: 20 20 46 52 4f 4d 20 20 62 72 61 6e 63 68 20 42    FROM  branch B
1e80: 2c 20 72 65 76 69 73 69 6f 6e 20 52 2c 20 73 79  , revision R, sy
1e90: 6d 62 6f 6c 20 53 20 20 2d 2d 20 42 20 3d 3d 3e  mbol S  -- B ==>
1ea0: 20 52 2f 53 2c 20 75 73 69 6e 67 20 50 4b 20 69   R/S, using PK i
1eb0: 6e 64 69 63 65 73 20 6f 66 20 52 2c 20 53 2e 0a  ndices of R, S..
1ec0: 09 20 20 20 20 57 48 45 52 45 20 42 2e 72 6f 6f  .    WHERE B.roo
1ed0: 74 20 3d 20 52 2e 72 69 64 0a 09 20 20 20 20 41  t = R.rid..    A
1ee0: 4e 44 20 20 20 42 2e 73 69 64 20 20 3d 20 53 2e  ND   B.sid  = S.
1ef0: 73 69 64 0a 09 20 20 20 20 4f 52 44 45 52 20 42  sid..    ORDER B
1f00: 59 20 53 2e 73 69 64 2c 20 52 2e 64 61 74 65 0a  Y S.sid, R.date.
1f10: 09 7d 5d 20 7b 0a 09 20 20 20 20 69 66 20 7b 24  .}] {..    if {$
1f20: 6c 61 73 74 73 79 6d 62 6f 6c 20 21 3d 20 24 73  lastsymbol != $s
1f30: 69 64 7d 20 7b 0a 09 09 69 66 20 7b 5b 6c 6c 65  id} {...if {[lle
1f40: 6e 67 74 68 20 24 72 65 76 69 73 69 6f 6e 73 5d  ngth $revisions]
1f50: 7d 20 7b 0a 09 09 20 20 20 20 69 6e 63 72 20 6e  } {...    incr n
1f60: 0a 09 09 20 20 20 20 73 65 74 20 20 70 20 5b 72  ...    set  p [r
1f70: 65 70 6f 73 69 74 6f 72 79 20 70 72 6f 6a 65 63  epository projec
1f80: 74 6f 66 20 24 6c 61 73 74 70 72 6f 6a 65 63 74  tof $lastproject
1f90: 5d 0a 09 09 20 20 20 20 6c 61 70 70 65 6e 64 20  ]...    lappend 
1fa0: 63 73 65 74 73 20 5b 70 72 6f 6a 65 63 74 3a 3a  csets [project::
1fb0: 72 65 76 20 25 41 55 54 4f 25 20 24 70 20 73 79  rev %AUTO% $p sy
1fc0: 6d 20 24 6c 61 73 74 73 79 6d 62 6f 6c 20 24 72  m $lastsymbol $r
1fd0: 65 76 69 73 69 6f 6e 73 5d 0a 09 09 20 20 20 20  evisions]...    
1fe0: 73 65 74 20 72 65 76 69 73 69 6f 6e 73 20 7b 7d  set revisions {}
1ff0: 0a 09 09 7d 0a 09 09 73 65 74 20 6c 61 73 74 73  ...}...set lasts
2000: 79 6d 62 6f 6c 20 20 24 73 69 64 0a 09 09 73 65  ymbol  $sid...se
2010: 74 20 6c 61 73 74 70 72 6f 6a 65 63 74 20 24 70  t lastproject $p
2020: 69 64 0a 09 20 20 20 20 7d 0a 09 20 20 20 20 6c  id..    }..    l
2030: 61 70 70 65 6e 64 20 72 65 76 69 73 69 6f 6e 73  append revisions
2040: 20 24 72 69 64 0a 09 7d 0a 0a 09 69 66 20 7b 5b   $rid..}...if {[
2050: 6c 6c 65 6e 67 74 68 20 24 72 65 76 69 73 69 6f  llength $revisio
2060: 6e 73 5d 7d 20 7b 0a 09 20 20 20 20 69 6e 63 72  ns]} {..    incr
2070: 20 6e 0a 09 20 20 20 20 73 65 74 20 20 70 20 5b   n..    set  p [
2080: 72 65 70 6f 73 69 74 6f 72 79 20 70 72 6f 6a 65  repository proje
2090: 63 74 6f 66 20 24 6c 61 73 74 70 72 6f 6a 65 63  ctof $lastprojec
20a0: 74 5d 0a 09 20 20 20 20 6c 61 70 70 65 6e 64 20  t]..    lappend 
20b0: 63 73 65 74 73 20 5b 70 72 6f 6a 65 63 74 3a 3a  csets [project::
20c0: 72 65 76 20 25 41 55 54 4f 25 20 24 70 20 73 79  rev %AUTO% $p sy
20d0: 6d 20 24 6c 61 73 74 73 79 6d 62 6f 6c 20 24 72  m $lastsymbol $r
20e0: 65 76 69 73 69 6f 6e 73 5d 0a 09 7d 0a 0a 09 6c  evisions]..}...l
20f0: 6f 67 20 77 72 69 74 65 20 34 20 69 6e 69 74 63  og write 4 initc
2100: 73 65 74 73 20 22 43 72 65 61 74 65 64 20 5b 6e  sets "Created [n
2110: 73 70 20 24 6e 20 7b 73 79 6d 62 6f 6c 20 63 68  sp $n {symbol ch
2120: 61 6e 67 65 73 65 74 7d 5d 22 0a 09 72 65 74 75  angeset}]"..retu
2130: 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 20 20 70 72  rn.    }..    pr
2140: 6f 63 20 42 72 65 61 6b 49 6e 74 65 72 6e 61 6c  oc BreakInternal
2150: 44 65 70 65 6e 64 65 6e 63 69 65 73 20 7b 63 76  Dependencies {cv
2160: 7d 20 7b 0a 09 75 70 76 61 72 20 31 20 24 63 76  } {..upvar 1 $cv
2170: 20 63 73 65 74 73 0a 0a 09 23 20 54 68 69 73 20   csets...# This 
2180: 63 6f 64 65 20 6f 70 65 72 61 74 65 73 20 6f 6e  code operates on
2190: 20 74 68 65 20 72 65 76 69 73 69 6f 6e 20 63 68   the revision ch
21a0: 61 6e 67 65 73 65 74 73 20 63 72 65 61 74 65 64  angesets created
21b0: 20 62 79 0a 09 23 20 27 43 72 65 61 74 65 52 65   by..# 'CreateRe
21c0: 76 69 73 69 6f 6e 43 68 61 6e 67 65 73 65 74 73  visionChangesets
21d0: 27 2e 20 41 73 20 73 75 63 68 20 69 74 20 68 61  '. As such it ha
21e0: 73 20 74 6f 20 66 6f 6c 6c 6f 77 20 61 66 74 65  s to follow afte
21f0: 72 0a 09 23 20 69 74 2c 20 62 65 66 6f 72 65 20  r..# it, before 
2200: 74 68 65 20 73 79 6d 62 6f 6c 20 63 68 61 6e 67  the symbol chang
2210: 65 73 65 74 73 20 61 72 65 20 6d 61 64 65 2e 20  esets are made. 
2220: 54 68 65 20 63 68 61 6e 67 65 73 65 74 73 0a 09  The changesets..
2230: 23 20 61 72 65 20 69 6e 73 70 65 63 74 65 64 20  # are inspected 
2240: 66 6f 72 20 69 6e 74 65 72 6e 61 6c 20 63 6f 6e  for internal con
2250: 66 6c 69 63 74 73 20 61 6e 64 20 61 6e 79 20 73  flicts and any s
2260: 75 63 68 20 61 72 65 20 62 72 6f 6b 65 6e 0a 09  uch are broken..
2270: 23 20 62 79 20 73 70 6c 69 74 74 69 6e 67 20 74  # by splitting t
2280: 68 65 20 70 72 6f 62 6c 65 6d 61 74 69 63 20 63  he problematic c
2290: 68 61 6e 67 65 73 65 74 20 69 6e 74 6f 20 6d 75  hangeset into mu
22a0: 6c 74 69 70 6c 65 0a 09 23 20 66 72 61 67 6d 65  ltiple..# fragme
22b0: 6e 74 73 2e 20 54 68 65 20 72 65 73 75 6c 74 73  nts. The results
22c0: 20 61 72 65 20 63 68 61 6e 67 65 73 65 74 73 20   are changesets 
22d0: 77 68 69 63 68 20 68 61 76 65 20 6e 6f 20 69 6e  which have no in
22e0: 74 65 72 6e 61 6c 0a 09 23 20 64 65 70 65 6e 64  ternal..# depend
22f0: 65 6e 63 69 65 73 2c 20 6f 6e 6c 79 20 65 78 74  encies, only ext
2300: 65 72 6e 61 6c 20 6f 6e 65 73 2e 0a 0a 09 6c 6f  ernal ones....lo
2310: 67 20 77 72 69 74 65 20 33 20 69 6e 69 74 63 73  g write 3 initcs
2320: 65 74 73 20 7b 42 72 65 61 6b 20 69 6e 74 65 72  ets {Break inter
2330: 6e 61 6c 20 64 65 70 65 6e 64 65 6e 63 69 65 73  nal dependencies
2340: 7d 0a 09 73 65 74 20 6e 20 30 0a 0a 09 66 6f 72  }..set n 0...for
2350: 65 61 63 68 20 63 73 65 74 20 24 63 73 65 74 73  each cset $csets
2360: 20 7b 0a 09 20 20 20 20 23 20 54 68 65 20 6d 61   {..    # The ma
2370: 69 6e 20 6d 65 74 68 6f 64 20 66 6f 72 20 73 70  in method for sp
2380: 6c 69 74 74 69 6e 67 20 64 6f 65 73 20 6f 6e 6c  litting does onl
2390: 79 20 6f 6e 65 20 73 70 6c 69 74 2c 20 77 68 69  y one split, whi
23a0: 63 68 0a 09 20 20 20 20 23 20 6d 61 79 20 6e 6f  ch..    # may no
23b0: 74 20 62 65 20 65 6e 6f 75 67 68 2e 20 54 68 65  t be enough. The
23c0: 20 63 6f 64 65 20 68 65 72 65 20 69 74 65 72 61   code here itera
23d0: 74 65 73 20 75 6e 74 69 6c 20 6e 6f 20 6d 6f 72  tes until no mor
23e0: 65 0a 09 20 20 20 20 23 20 73 70 6c 69 74 73 20  e..    # splits 
23f0: 63 61 6e 20 62 65 20 70 65 72 66 6f 72 6d 65 64  can be performed
2400: 2e 20 41 6e 20 69 74 65 72 61 74 69 76 65 20 61  . An iterative a
2410: 6c 67 6f 72 69 74 68 6d 20 77 61 73 0a 09 20 20  lgorithm was..  
2420: 20 20 23 20 63 68 6f 73 65 6e 20 6f 76 65 72 20    # chosen over 
2430: 61 20 72 65 63 75 72 73 69 76 65 20 6f 6e 65 20  a recursive one 
2440: 74 6f 20 70 72 65 76 65 6e 74 20 72 75 6e 6e 69  to prevent runni
2450: 6e 67 20 69 6e 74 6f 0a 09 20 20 20 20 23 20 73  ng into..    # s
2460: 74 61 63 6b 20 6c 69 6d 69 74 73 2e 0a 0a 09 20  tack limits.... 
2470: 20 20 20 73 65 74 20 74 6f 73 70 6c 69 74 20 5b     set tosplit [
2480: 6c 69 73 74 20 24 63 73 65 74 5d 0a 09 20 20 20  list $cset]..   
2490: 20 73 65 74 20 61 74 20 30 0a 09 20 20 20 20 77   set at 0..    w
24a0: 68 69 6c 65 20 7b 24 61 74 20 3c 20 5b 6c 6c 65  hile {$at < [lle
24b0: 6e 67 74 68 20 24 74 6f 73 70 6c 69 74 5d 7d 20  ngth $tosplit]} 
24c0: 7b 0a 09 09 23 20 4e 6f 74 65 20 68 65 72 65 20  {...# Note here 
24d0: 68 6f 77 20 77 65 20 61 72 65 20 5f 5f 6e 6f 74  how we are __not
24e0: 5f 5f 20 61 64 76 61 6e 63 69 6e 67 20 69 6e 20  __ advancing in 
24f0: 74 68 65 20 6c 69 73 74 0a 09 09 23 20 20 20 20  the list...#    
2500: 20 20 77 68 65 6e 20 77 65 20 77 65 72 65 20 61    when we were a
2510: 62 6c 65 20 74 6f 20 62 72 65 61 6b 20 74 68 65  ble to break the
2520: 20 63 75 72 72 65 6e 74 0a 09 09 23 20 20 20 20   current...#    
2530: 20 20 63 68 61 6e 67 65 73 65 74 20 69 6e 74 6f    changeset into
2540: 20 74 77 6f 20 70 69 65 63 65 73 2c 20 63 61 75   two pieces, cau
2550: 73 69 6e 67 20 74 68 65 20 6c 6f 6f 70 20 74 6f  sing the loop to
2560: 0a 09 09 23 20 20 20 20 20 20 69 6d 6d 65 64 69  ...#      immedi
2570: 61 74 65 6c 79 20 63 68 65 63 6b 20 74 68 65 20  ately check the 
2580: 66 69 72 73 74 20 6f 66 20 74 68 65 20 74 77 6f  first of the two
2590: 20 70 69 65 63 65 73 0a 09 09 23 20 20 20 20 20   pieces...#     
25a0: 20 61 67 61 69 6e 20 66 6f 72 20 66 75 72 74 68   again for furth
25b0: 65 72 20 62 72 65 61 6b 20 70 6f 73 73 69 62 69  er break possibi
25c0: 6c 69 74 69 65 73 2e 20 54 68 65 0a 09 09 23 20  lities. The...# 
25d0: 20 20 20 20 20 6f 74 68 65 72 20 70 69 65 63 65       other piece
25e0: 20 69 73 20 61 64 64 65 64 20 61 74 20 74 68 65   is added at the
25f0: 20 65 6e 64 2c 20 74 68 75 73 20 70 72 6f 63 65   end, thus proce
2600: 73 73 65 64 0a 09 09 23 20 20 20 20 20 20 6c 61  ssed...#      la
2610: 74 65 72 2e 0a 09 09 77 68 69 6c 65 20 7b 5b 5b  ter....while {[[
2620: 6c 69 6e 64 65 78 20 24 74 6f 73 70 6c 69 74 20  lindex $tosplit 
2630: 24 61 74 5d 20 62 72 65 61 6b 69 6e 74 65 72 6e  $at] breakintern
2640: 61 6c 64 65 70 65 6e 64 65 6e 63 69 65 73 20 74  aldependencies t
2650: 6f 73 70 6c 69 74 5d 7d 20 7b 7d 0a 09 09 69 6e  osplit]} {}...in
2660: 63 72 20 61 74 0a 09 20 20 20 20 7d 0a 0a 09 20  cr at..    }... 
2670: 20 20 20 23 20 41 74 20 6c 61 73 74 20 74 68 65     # At last the
2680: 20 67 65 6e 65 72 61 74 65 64 20 66 72 61 67 6d   generated fragm
2690: 65 6e 74 73 20 61 72 65 20 61 64 64 65 64 20 74  ents are added t
26a0: 6f 20 74 68 65 20 6d 61 69 6e 0a 09 20 20 20 20  o the main..    
26b0: 23 20 6c 69 73 74 20 6f 66 20 63 68 61 6e 67 65  # list of change
26c0: 73 65 74 73 2e 20 54 68 65 20 66 69 72 73 74 20  sets. The first 
26d0: 65 6c 65 6d 65 6e 74 20 69 73 20 73 6b 69 70 70  element is skipp
26e0: 65 64 20 61 73 20 69 74 0a 09 20 20 20 20 23 20  ed as it..    # 
26f0: 69 73 20 61 6c 72 65 61 64 79 20 69 6e 20 74 68  is already in th
2700: 65 20 6c 69 73 74 2e 0a 09 20 20 20 20 66 6f 72  e list...    for
2710: 65 61 63 68 20 63 73 65 74 20 5b 6c 72 61 6e 67  each cset [lrang
2720: 65 20 24 74 6f 73 70 6c 69 74 20 31 20 65 6e 64  e $tosplit 1 end
2730: 5d 20 7b 20 6c 61 70 70 65 6e 64 20 63 73 65 74  ] { lappend cset
2740: 73 20 24 63 73 65 74 20 3b 20 69 6e 63 72 20 6e  s $cset ; incr n
2750: 20 7d 0a 09 7d 0a 0a 09 6c 6f 67 20 77 72 69 74   }..}...log writ
2760: 65 20 34 20 69 6e 69 74 63 73 65 74 73 20 22 43  e 4 initcsets "C
2770: 72 65 61 74 65 64 20 5b 6e 73 70 20 24 6e 20 7b  reated [nsp $n {
2780: 61 64 64 69 74 69 6f 6e 61 6c 20 72 65 76 69 73  additional revis
2790: 69 6f 6e 20 63 68 61 6e 67 65 73 65 74 7d 5d 22  ion changeset}]"
27a0: 0a 09 6c 6f 67 20 77 72 69 74 65 20 34 20 69 6e  ..log write 4 in
27b0: 69 74 63 73 65 74 73 20 4f 6b 2e 0a 09 72 65 74  itcsets Ok...ret
27c0: 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 20 20 70  urn.    }..    p
27d0: 72 6f 63 20 50 65 72 73 69 73 74 54 68 65 43 68  roc PersistTheCh
27e0: 61 6e 67 65 73 65 74 73 20 7b 63 73 65 74 73 7d  angesets {csets}
27f0: 20 7b 0a 09 6c 6f 67 20 77 72 69 74 65 20 33 20   {..log write 3 
2800: 69 6e 69 74 63 73 65 74 73 20 22 53 61 76 69 6e  initcsets "Savin
2810: 67 20 5b 6e 73 70 20 5b 6c 6c 65 6e 67 74 68 20  g [nsp [llength 
2820: 24 63 73 65 74 73 5d 20 7b 69 6e 69 74 69 61 6c  $csets] {initial
2830: 20 63 68 61 6e 67 65 73 65 74 7d 5d 20 74 6f 20   changeset}] to 
2840: 74 68 65 20 70 65 72 73 69 73 74 65 6e 74 20 73  the persistent s
2850: 74 61 74 65 22 0a 0a 09 66 6f 72 65 61 63 68 20  tate"...foreach 
2860: 63 73 65 74 20 24 63 73 65 74 73 20 7b 0a 09 20  cset $csets {.. 
2870: 20 20 20 24 63 73 65 74 20 70 65 72 73 69 73 74     $cset persist
2880: 0a 09 7d 0a 0a 09 6c 6f 67 20 77 72 69 74 65 20  ..}...log write 
2890: 34 20 69 6e 69 74 63 73 65 74 73 20 4f 6b 2e 0a  4 initcsets Ok..
28a0: 09 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20  .return.    }.. 
28b0: 20 20 20 23 20 23 20 23 23 20 23 23 23 20 23 23     # # ## ### ##
28c0: 23 23 23 20 23 23 23 23 23 23 23 23 20 23 23 23  ### ######## ###
28d0: 23 23 23 23 23 23 23 23 23 23 0a 20 20 20 20 23  ##########.    #
28e0: 23 20 43 6f 6e 66 69 67 75 72 61 74 69 6f 6e 0a  # Configuration.
28f0: 0a 20 20 20 20 70 72 61 67 6d 61 20 2d 68 61 73  .    pragma -has
2900: 69 6e 73 74 61 6e 63 65 73 20 20 20 6e 6f 20 3b  instances   no ;
2910: 20 23 20 73 69 6e 67 6c 65 74 6f 6e 0a 20 20 20   # singleton.   
2920: 20 70 72 61 67 6d 61 20 2d 68 61 73 74 79 70 65   pragma -hastype
2930: 69 6e 66 6f 20 20 20 20 6e 6f 20 3b 20 23 20 6e  info    no ; # n
2940: 6f 20 69 6e 74 72 6f 73 70 65 63 74 69 6f 6e 0a  o introspection.
2950: 20 20 20 20 70 72 61 67 6d 61 20 2d 68 61 73 74      pragma -hast
2960: 79 70 65 64 65 73 74 72 6f 79 20 6e 6f 20 3b 20  ypedestroy no ; 
2970: 23 20 69 6d 6d 6f 72 74 61 6c 0a 0a 20 20 20 20  # immortal..    
2980: 23 20 23 20 23 23 20 23 23 23 20 23 23 23 23 23  # # ## ### #####
2990: 20 23 23 23 23 23 23 23 23 20 23 23 23 23 23 23   ######## ######
29a0: 23 23 23 23 23 23 23 0a 7d 0a 0a 6e 61 6d 65 73  #######.}..names
29b0: 70 61 63 65 20 65 76 61 6c 20 3a 3a 76 63 3a 3a  pace eval ::vc::
29c0: 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a  fossil::import::
29d0: 63 76 73 3a 3a 70 61 73 73 20 7b 0a 20 20 20 20  cvs::pass {.    
29e0: 6e 61 6d 65 73 70 61 63 65 20 65 78 70 6f 72 74  namespace export
29f0: 20 69 6e 69 74 63 73 65 74 73 0a 20 20 20 20 6e   initcsets.    n
2a00: 61 6d 65 73 70 61 63 65 20 65 76 61 6c 20 69 6e  amespace eval in
2a10: 69 74 63 73 65 74 73 20 7b 0a 09 6e 61 6d 65 73  itcsets {..names
2a20: 70 61 63 65 20 69 6d 70 6f 72 74 20 3a 3a 76 63  pace import ::vc
2a30: 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74  ::fossil::import
2a40: 3a 3a 63 76 73 3a 3a 72 65 70 6f 73 69 74 6f 72  ::cvs::repositor
2a50: 79 0a 09 6e 61 6d 65 73 70 61 63 65 20 69 6d 70  y..namespace imp
2a60: 6f 72 74 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c  ort ::vc::fossil
2a70: 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 73  ::import::cvs::s
2a80: 74 61 74 65 0a 09 6e 61 6d 65 73 70 61 63 65 20  tate..namespace 
2a90: 65 76 61 6c 20 70 72 6f 6a 65 63 74 20 7b 0a 09  eval project {..
2aa0: 20 20 20 20 6e 61 6d 65 73 70 61 63 65 20 69 6d      namespace im
2ab0: 70 6f 72 74 20 3a 3a 76 63 3a 3a 66 6f 73 73 69  port ::vc::fossi
2ac0: 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a  l::import::cvs::
2ad0: 70 72 6f 6a 65 63 74 3a 3a 72 65 76 0a 09 7d 0a  project::rev..}.
2ae0: 09 6e 61 6d 65 73 70 61 63 65 20 69 6d 70 6f 72  .namespace impor
2af0: 74 20 3a 3a 76 63 3a 3a 74 6f 6f 6c 73 3a 3a 6d  t ::vc::tools::m
2b00: 69 73 63 3a 3a 2a 0a 09 6e 61 6d 65 73 70 61 63  isc::*..namespac
2b10: 65 20 69 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a 74  e import ::vc::t
2b20: 6f 6f 6c 73 3a 3a 6c 6f 67 0a 09 6c 6f 67 20 72  ools::log..log r
2b30: 65 67 69 73 74 65 72 20 69 6e 69 74 63 73 65 74  egister initcset
2b40: 73 0a 20 20 20 20 7d 0a 7d 0a 0a 23 20 23 20 23  s.    }.}..# # #
2b50: 23 20 23 23 23 20 23 23 23 23 23 20 23 23 23 23  # ### ##### ####
2b60: 23 23 23 23 20 23 23 23 23 23 23 23 23 23 23 23  #### ###########
2b70: 23 23 20 23 23 23 23 23 23 23 23 23 23 23 23 23  ## #############
2b80: 23 23 23 23 23 23 23 23 0a 23 23 20 52 65 61 64  ########.## Read
2b90: 79 0a 0a 70 61 63 6b 61 67 65 20 70 72 6f 76 69  y..package provi
2ba0: 64 65 20 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69  de vc::fossil::i
2bb0: 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 70 61 73 73  mport::cvs::pass
2bc0: 3a 3a 69 6e 69 74 63 73 65 74 73 20 31 2e 30 0a  ::initcsets 1.0.
2bd0: 72 65 74 75 72 6e 0a                             return.