Hex Artifact Content
Not logged in

Artifact cec097c0345ad77a93741d4dce9aa1cda5ecb9d0:

File tools/cvs2fossil/lib/c2f_pinitcsets.tcl part of check-in [215d2f1ad9] - Brought knowledge of the new types to the state definition, changed the creation of the initial changesets to use tags and branches. by aku on 2007-11-29 06:21:57.

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 73 79 6d 20 3b 20 23 20 50 72 6f  ect::sym ; # Pro
0550: 6a 65 63 74 20 6c 65 76 65 6c 20 73 79 6d 62 6f  ject level symbo
0560: 6c 73 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69  ls.package requi
0570: 72 65 20 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69  re vc::fossil::i
0580: 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 70 72 6f 6a  mport::cvs::proj
0590: 65 63 74 3a 3a 72 65 76 20 3b 20 23 20 50 72 6f  ect::rev ; # Pro
05a0: 6a 65 63 74 20 6c 65 76 65 6c 20 63 68 61 6e 67  ject level chang
05b0: 65 73 65 74 73 0a 0a 23 20 23 20 23 23 20 23 23  esets..# # ## ##
05c0: 23 20 23 23 23 23 23 20 23 23 23 23 23 23 23 23  # ##### ########
05d0: 20 23 23 23 23 23 23 23 23 23 23 23 23 23 20 23   ############# #
05e0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
05f0: 23 23 23 23 0a 23 23 20 52 65 67 69 73 74 65 72  ####.## Register
0600: 20 74 68 65 20 70 61 73 73 20 77 69 74 68 20 74   the pass with t
0610: 68 65 20 6d 61 6e 61 67 65 6d 65 6e 74 0a 0a 76  he management..v
0620: 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72  c::fossil::impor
0630: 74 3a 3a 63 76 73 3a 3a 70 61 73 73 20 64 65 66  t::cvs::pass def
0640: 69 6e 65 20 5c 0a 20 20 20 20 49 6e 69 74 43 73  ine \.    InitCs
0650: 65 74 73 20 5c 0a 20 20 20 20 7b 49 6e 69 74 69  ets \.    {Initi
0660: 61 6c 69 7a 65 20 43 68 61 6e 67 65 53 65 74 73  alize ChangeSets
0670: 7d 20 5c 0a 20 20 20 20 3a 3a 76 63 3a 3a 66 6f  } \.    ::vc::fo
0680: 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76  ssil::import::cv
0690: 73 3a 3a 70 61 73 73 3a 3a 69 6e 69 74 63 73 65  s::pass::initcse
06a0: 74 73 0a 0a 23 20 23 20 23 23 20 23 23 23 20 23  ts..# # ## ### #
06b0: 23 23 23 23 20 23 23 23 23 23 23 23 23 20 23 23  #### ######## ##
06c0: 23 23 23 23 23 23 23 23 23 23 23 20 23 23 23 23  ########### ####
06d0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
06e0: 23 0a 23 23 0a 0a 73 6e 69 74 3a 3a 74 79 70 65  #.##..snit::type
06f0: 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69   ::vc::fossil::i
0700: 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 70 61 73 73  mport::cvs::pass
0710: 3a 3a 69 6e 69 74 63 73 65 74 73 20 7b 0a 20 20  ::initcsets {.  
0720: 20 20 23 20 23 20 23 23 20 23 23 23 20 23 23 23    # # ## ### ###
0730: 23 23 20 23 23 23 23 23 23 23 23 20 23 23 23 23  ## ######## ####
0740: 23 23 23 23 23 23 23 23 23 0a 20 20 20 20 23 23  #########.    ##
0750: 20 50 75 62 6c 69 63 20 41 50 49 0a 0a 20 20 20   Public API..   
0760: 20 74 79 70 65 6d 65 74 68 6f 64 20 73 65 74 75   typemethod setu
0770: 70 20 7b 7d 20 7b 0a 09 23 20 44 65 66 69 6e 65  p {} {..# Define
0780: 20 74 68 65 20 6e 61 6d 65 73 20 61 6e 64 20 73   the names and s
0790: 74 72 75 63 74 75 72 65 20 6f 66 20 74 68 65 20  tructure of the 
07a0: 70 65 72 73 69 73 74 65 6e 74 20 73 74 61 74 65  persistent state
07b0: 20 6f 66 0a 09 23 20 74 68 69 73 20 70 61 73 73   of..# this pass
07c0: 2e 0a 0a 09 73 74 61 74 65 20 72 65 61 64 69 6e  ....state readin
07d0: 67 20 6d 65 74 61 0a 09 73 74 61 74 65 20 72 65  g meta..state re
07e0: 61 64 69 6e 67 20 72 65 76 69 73 69 6f 6e 0a 09  ading revision..
07f0: 73 74 61 74 65 20 72 65 61 64 69 6e 67 20 72 65  state reading re
0800: 76 69 73 69 6f 6e 62 72 61 6e 63 68 63 68 69 6c  visionbranchchil
0810: 64 72 65 6e 0a 09 73 74 61 74 65 20 72 65 61 64  dren..state read
0820: 69 6e 67 20 62 72 61 6e 63 68 0a 09 73 74 61 74  ing branch..stat
0830: 65 20 72 65 61 64 69 6e 67 20 74 61 67 0a 09 73  e reading tag..s
0840: 74 61 74 65 20 72 65 61 64 69 6e 67 20 73 79 6d  tate reading sym
0850: 62 6f 6c 0a 0a 09 23 20 44 61 74 61 20 70 65 72  bol...# Data per
0860: 20 63 68 61 6e 67 65 73 65 74 2c 20 6e 61 6d 65   changeset, name
0870: 6c 79 20 74 68 65 20 70 72 6f 6a 65 63 74 20 69  ly the project i
0880: 74 20 62 65 6c 6f 6e 67 73 20 74 6f 2c 20 68 6f  t belongs to, ho
0890: 77 20 69 74 0a 09 23 20 77 61 73 20 69 6e 64 75  w it..# was indu
08a0: 63 65 64 20 28 72 65 76 69 73 69 6f 6e 20 6f 72  ced (revision or
08b0: 20 73 79 6d 62 6f 6c 29 2c 20 70 6c 75 73 20 72   symbol), plus r
08c0: 65 66 65 72 65 6e 63 65 20 74 6f 20 74 68 65 0a  eference to the.
08d0: 09 23 20 70 72 69 6d 61 72 79 20 65 6e 74 72 79  .# primary entry
08e0: 20 63 61 75 73 69 6e 67 20 69 74 20 28 6d 65 74   causing it (met
08f0: 61 20 65 6e 74 72 79 20 6f 72 20 73 79 6d 62 6f  a entry or symbo
0900: 6c 29 2e 20 41 6e 20 61 64 6a 75 6e 63 74 0a 09  l). An adjunct..
0910: 23 20 74 61 62 6c 65 20 74 72 61 6e 73 6c 61 74  # table translat
0920: 65 73 20 74 68 65 20 74 79 70 65 20 69 64 27 73  es the type id's
0930: 20 69 6e 74 6f 20 68 75 6d 61 6e 20 72 65 61 64   into human read
0940: 61 62 6c 65 20 6c 61 62 65 6c 73 2e 0a 0a 09 73  able labels....s
0950: 74 61 74 65 20 77 72 69 74 69 6e 67 20 63 68 61  tate writing cha
0960: 6e 67 65 73 65 74 20 7b 0a 09 20 20 20 20 63 69  ngeset {..    ci
0970: 64 20 20 20 49 4e 54 45 47 45 52 20 20 4e 4f 54  d   INTEGER  NOT
0980: 20 4e 55 4c 4c 20 20 50 52 49 4d 41 52 59 20 4b   NULL  PRIMARY K
0990: 45 59 20 20 41 55 54 4f 49 4e 43 52 45 4d 45 4e  EY  AUTOINCREMEN
09a0: 54 2c 0a 09 20 20 20 20 70 69 64 20 20 20 49 4e  T,..    pid   IN
09b0: 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c 20  TEGER  NOT NULL 
09c0: 20 52 45 46 45 52 45 4e 43 45 53 20 70 72 6f 6a   REFERENCES proj
09d0: 65 63 74 2c 0a 09 20 20 20 20 74 79 70 65 20 20  ect,..    type  
09e0: 49 4e 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c  INTEGER  NOT NUL
09f0: 4c 20 20 52 45 46 45 52 45 4e 43 45 53 20 63 73  L  REFERENCES cs
0a00: 74 79 70 65 2c 0a 09 20 20 20 20 73 72 63 20 20  type,..    src  
0a10: 20 49 4e 54 45 47 45 52 20 20 4e 4f 54 20 4e 55   INTEGER  NOT NU
0a20: 4c 4c 20 2d 2d 20 52 45 46 45 52 45 4e 43 45 53  LL -- REFERENCES
0a30: 20 6d 65 74 61 7c 73 79 6d 62 6f 6c 20 28 74 79   meta|symbol (ty
0a40: 70 65 20 64 65 70 65 6e 64 65 6e 74 29 0a 09 7d  pe dependent)..}
0a50: 0a 09 73 74 61 74 65 20 77 72 69 74 69 6e 67 20  ..state writing 
0a60: 63 73 74 79 70 65 20 7b 0a 09 20 20 20 20 74 69  cstype {..    ti
0a70: 64 20 20 20 49 4e 54 45 47 45 52 20 20 4e 4f 54  d   INTEGER  NOT
0a80: 20 4e 55 4c 4c 20 20 50 52 49 4d 41 52 59 20 4b   NULL  PRIMARY K
0a90: 45 59 20 20 41 55 54 4f 49 4e 43 52 45 4d 45 4e  EY  AUTOINCREMEN
0aa0: 54 2c 0a 09 20 20 20 20 6e 61 6d 65 20 20 54 45  T,..    name  TE
0ab0: 58 54 20 20 20 20 20 4e 4f 54 20 4e 55 4c 4c 2c  XT     NOT NULL,
0ac0: 0a 09 20 20 20 20 55 4e 49 51 55 45 20 28 6e 61  ..    UNIQUE (na
0ad0: 6d 65 29 0a 09 7d 0a 09 23 20 4e 6f 74 65 3a 20  me)..}..# Note: 
0ae0: 4b 65 65 70 20 74 68 65 20 6c 61 62 65 6c 73 20  Keep the labels 
0af0: 75 73 65 64 20 68 65 72 65 20 69 6e 20 73 79 6e  used here in syn
0b00: 63 20 77 69 74 68 20 74 68 65 20 6e 61 6d 65 73  c with the names
0b10: 20 66 6f 72 0a 09 23 20 20 20 20 20 20 20 73 69   for..#       si
0b20: 6e 67 6c 65 74 6f 6e 20 68 65 6c 70 65 72 20 63  ngleton helper c
0b30: 6c 61 73 73 65 73 20 66 6f 72 20 27 70 72 6f 6a  lasses for 'proj
0b40: 65 63 74 3a 3a 72 65 76 27 2e 20 54 68 65 79 20  ect::rev'. They 
0b50: 61 72 65 0a 09 23 20 20 20 20 20 20 20 74 68 65  are..#       the
0b60: 20 76 61 6c 69 64 20 74 79 70 65 20 6e 61 6d 65   valid type name
0b70: 73 20 66 6f 72 20 63 68 61 6e 67 65 73 65 74 73  s for changesets
0b80: 20 61 6e 64 20 61 6c 73 6f 20 68 61 72 64 77 69   and also hardwi
0b90: 72 65 64 0a 09 23 20 20 20 20 20 20 20 69 6e 20  red..#       in 
0ba0: 73 6f 6d 65 20 63 6f 64 65 2e 0a 09 73 74 61 74  some code...stat
0bb0: 65 20 72 75 6e 20 7b 0a 09 20 20 20 20 49 4e 53  e run {..    INS
0bc0: 45 52 54 20 49 4e 54 4f 20 63 73 74 79 70 65 20  ERT INTO cstype 
0bd0: 56 41 4c 55 45 53 20 28 30 2c 27 72 65 76 27 29  VALUES (0,'rev')
0be0: 3b 0a 09 20 20 20 20 49 4e 53 45 52 54 20 49 4e  ;..    INSERT IN
0bf0: 54 4f 20 63 73 74 79 70 65 20 56 41 4c 55 45 53  TO cstype VALUES
0c00: 20 28 31 2c 27 73 79 6d 3a 3a 74 61 67 27 29 3b   (1,'sym::tag');
0c10: 0a 09 20 20 20 20 49 4e 53 45 52 54 20 49 4e 54  ..    INSERT INT
0c20: 4f 20 63 73 74 79 70 65 20 56 41 4c 55 45 53 20  O cstype VALUES 
0c30: 28 32 2c 27 73 79 6d 3a 3a 62 72 61 6e 63 68 27  (2,'sym::branch'
0c40: 29 3b 0a 09 7d 0a 0a 09 23 20 4d 61 70 20 66 72  );..}...# Map fr
0c50: 6f 6d 20 63 68 61 6e 67 65 73 65 74 73 20 74 6f  om changesets to
0c60: 20 74 68 65 20 28 66 69 6c 65 20 6c 65 76 65 6c   the (file level
0c70: 29 20 72 65 76 69 73 69 6f 6e 73 2c 20 74 61 67  ) revisions, tag
0c80: 73 2c 20 6f 72 0a 09 23 20 62 72 61 6e 63 68 65  s, or..# branche
0c90: 73 20 74 68 65 79 20 63 6f 6e 74 61 69 6e 2e 20  s they contain. 
0ca0: 54 68 65 20 70 6f 73 27 69 74 69 6f 6e 20 70 72  The pos'ition pr
0cb0: 6f 76 69 64 65 73 20 61 6e 20 6f 72 64 65 72 20  ovides an order 
0cc0: 6f 66 0a 09 23 20 74 68 65 20 69 74 65 6d 73 20  of..# the items 
0cd0: 77 69 74 68 69 6e 20 61 20 63 68 61 6e 67 65 73  within a changes
0ce0: 65 74 2e 20 54 68 65 79 20 61 72 65 20 75 6e 69  et. They are uni
0cf0: 71 75 65 20 77 69 74 68 69 6e 20 74 68 65 0a 09  que within the..
0d00: 23 20 63 68 61 6e 67 65 73 65 74 2e 20 20 54 68  # changeset.  Th
0d10: 65 20 69 74 65 6d 73 20 61 72 65 20 69 6e 20 70  e items are in p
0d20: 72 69 6e 63 69 70 6c 65 20 75 6e 69 71 75 65 2c  rinciple unique,
0d30: 20 69 66 20 77 65 20 77 65 72 65 0a 09 23 20 6c   if we were..# l
0d40: 6f 6f 6b 69 6e 67 20 6f 6e 6c 79 20 61 74 20 72  ooking only at r
0d50: 65 6c 65 76 61 6e 74 20 63 68 61 6e 67 65 73 65  elevant changese
0d60: 74 73 2e 20 48 6f 77 65 76 65 72 20 61 73 20 74  ts. However as t
0d70: 68 65 79 20 63 6f 6d 65 0a 09 23 20 66 72 6f 6d  hey come..# from
0d80: 20 64 69 73 70 61 72 61 74 65 20 73 6f 75 72 63   disparate sourc
0d90: 65 73 20 74 68 65 20 73 61 6d 65 20 69 64 20 6d  es the same id m
0da0: 61 79 20 68 61 76 65 20 64 69 66 66 65 72 65 6e  ay have differen
0db0: 74 0a 09 23 20 6d 65 61 6e 69 6e 67 2c 20 62 65  t..# meaning, be
0dc0: 20 69 6e 20 64 69 66 66 65 72 65 6e 74 20 63 68   in different ch
0dd0: 61 6e 67 65 73 65 74 73 20 61 6e 64 20 73 6f 20  angesets and so 
0de0: 69 73 20 66 6f 72 6d 61 6c 6c 79 20 6e 6f 74 0a  is formally not.
0df0: 09 23 20 75 6e 69 71 75 65 2e 20 53 6f 20 77 65  .# unique. So we
0e00: 20 63 61 6e 20 6f 6e 6c 79 20 73 61 79 20 74 68   can only say th
0e10: 61 74 20 69 74 20 69 73 20 75 6e 69 71 75 65 20  at it is unique 
0e20: 77 69 74 68 69 6e 20 74 68 65 0a 09 23 20 63 68  within the..# ch
0e30: 61 6e 67 65 73 65 74 2e 20 54 68 65 20 69 6e 74  angeset. The int
0e40: 65 67 72 69 74 79 20 6d 6f 64 75 6c 65 20 68 61  egrity module ha
0e50: 73 20 73 74 72 6f 6e 67 65 72 20 63 68 65 63 6b  s stronger check
0e60: 73 2e 0a 0a 09 73 74 61 74 65 20 77 72 69 74 69  s....state writi
0e70: 6e 67 20 63 73 72 65 76 69 73 69 6f 6e 20 7b 0a  ng csrevision {.
0e80: 09 20 20 20 20 63 69 64 20 20 49 4e 54 45 47 45  .    cid  INTEGE
0e90: 52 20 20 4e 4f 54 20 4e 55 4c 4c 20 20 52 45 46  R  NOT NULL  REF
0ea0: 45 52 45 4e 43 45 53 20 63 68 61 6e 67 65 73 65  ERENCES changese
0eb0: 74 2c 0a 09 20 20 20 20 70 6f 73 20 20 49 4e 54  t,..    pos  INT
0ec0: 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c 2c 0a  EGER  NOT NULL,.
0ed0: 09 20 20 20 20 72 69 64 20 20 49 4e 54 45 47 45  .    rid  INTEGE
0ee0: 52 20 20 4e 4f 54 20 4e 55 4c 4c 2c 20 2d 2d 20  R  NOT NULL, -- 
0ef0: 52 45 46 45 52 45 4e 43 45 53 20 72 65 76 69 73  REFERENCES revis
0f00: 69 6f 6e 7c 74 61 67 7c 62 72 61 6e 63 68 0a 09  ion|tag|branch..
0f10: 20 20 20 20 55 4e 49 51 55 45 20 28 63 69 64 2c      UNIQUE (cid,
0f20: 20 70 6f 73 29 2c 0a 09 20 20 20 20 55 4e 49 51   pos),..    UNIQ
0f30: 55 45 20 28 63 69 64 2c 20 72 69 64 29 0a 09 7d  UE (cid, rid)..}
0f40: 0a 0a 09 70 72 6f 6a 65 63 74 3a 3a 72 65 76 20  ...project::rev 
0f50: 67 65 74 63 73 74 79 70 65 73 0a 09 72 65 74 75  getcstypes..retu
0f60: 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 20 20 74 79  rn.    }..    ty
0f70: 70 65 6d 65 74 68 6f 64 20 6c 6f 61 64 20 7b 7d  pemethod load {}
0f80: 20 7b 0a 09 23 20 50 61 73 73 20 6d 61 6e 61 67   {..# Pass manag
0f90: 65 72 20 69 6e 74 65 72 66 61 63 65 2e 20 45 78  er interface. Ex
0fa0: 65 63 75 74 65 64 20 74 6f 20 6c 6f 61 64 20 64  ecuted to load d
0fb0: 61 74 61 20 63 6f 6d 70 75 74 65 64 20 62 79 0a  ata computed by.
0fc0: 09 23 20 74 68 69 73 20 70 61 73 73 20 69 6e 74  .# this pass int
0fd0: 6f 20 6d 65 6d 6f 72 79 20 77 68 65 6e 20 74 68  o memory when th
0fe0: 69 73 20 70 61 73 73 20 69 73 20 73 6b 69 70 70  is pass is skipp
0ff0: 65 64 20 69 6e 73 74 65 61 64 20 6f 66 0a 09 23  ed instead of..#
1000: 20 65 78 65 63 75 74 65 64 2e 0a 0a 09 73 74 61   executed....sta
1010: 74 65 20 72 65 61 64 69 6e 67 20 63 68 61 6e 67  te reading chang
1020: 65 73 65 74 0a 09 73 74 61 74 65 20 72 65 61 64  eset..state read
1030: 69 6e 67 20 63 73 72 65 76 69 73 69 6f 6e 0a 09  ing csrevision..
1040: 73 74 61 74 65 20 72 65 61 64 69 6e 67 20 63 73  state reading cs
1050: 74 79 70 65 0a 0a 09 23 20 4e 65 65 64 20 74 68  type...# Need th
1060: 65 20 74 79 70 65 73 20 66 69 72 73 74 2c 20 74  e types first, t
1070: 68 65 20 63 6f 6e 73 74 72 75 63 74 6f 72 20 69  he constructor i
1080: 6e 20 74 68 65 20 6c 6f 6f 70 20 62 65 6c 6f 77  n the loop below
1090: 20 75 73 65 73 0a 09 23 20 74 68 65 6d 20 74 6f   uses..# them to
10a0: 20 61 73 73 65 72 74 20 74 68 65 20 63 6f 72 72   assert the corr
10b0: 65 63 74 6e 65 73 73 20 6f 66 20 74 79 70 65 20  ectness of type 
10c0: 6e 61 6d 65 73 2e 0a 09 70 72 6f 6a 65 63 74 3a  names...project:
10d0: 3a 72 65 76 20 67 65 74 63 73 74 79 70 65 73 0a  :rev getcstypes.
10e0: 0a 09 66 6f 72 65 61 63 68 20 7b 69 64 20 70 69  ..foreach {id pi
10f0: 64 20 63 73 74 79 70 65 20 73 72 63 69 64 7d 20  d cstype srcid} 
1100: 5b 73 74 61 74 65 20 72 75 6e 20 7b 0a 09 20 20  [state run {..  
1110: 20 20 53 45 4c 45 43 54 20 43 2e 63 69 64 2c 20    SELECT C.cid, 
1120: 43 2e 70 69 64 2c 20 43 53 2e 6e 61 6d 65 2c 20  C.pid, CS.name, 
1130: 43 2e 73 72 63 0a 09 20 20 20 20 46 52 4f 4d 20  C.src..    FROM 
1140: 20 20 63 68 61 6e 67 65 73 65 74 20 43 2c 20 63    changeset C, c
1150: 73 74 79 70 65 20 43 53 0a 09 20 20 20 20 57 48  stype CS..    WH
1160: 45 52 45 20 20 43 2e 74 79 70 65 20 3d 20 43 53  ERE  C.type = CS
1170: 2e 74 69 64 0a 09 20 20 20 20 4f 52 44 45 52 20  .tid..    ORDER 
1180: 42 59 20 43 2e 63 69 64 0a 09 7d 5d 20 7b 0a 09  BY C.cid..}] {..
1190: 20 20 20 20 73 65 74 20 72 20 5b 70 72 6f 6a 65      set r [proje
11a0: 63 74 3a 3a 72 65 76 20 25 41 55 54 4f 25 20 5b  ct::rev %AUTO% [
11b0: 72 65 70 6f 73 69 74 6f 72 79 20 70 72 6f 6a 65  repository proje
11c0: 63 74 6f 66 20 24 70 69 64 5d 20 24 63 73 74 79  ctof $pid] $csty
11d0: 70 65 20 24 73 72 63 69 64 20 5b 73 74 61 74 65  pe $srcid [state
11e0: 20 72 75 6e 20 7b 0a 09 09 53 45 4c 45 43 54 20   run {...SELECT 
11f0: 43 2e 72 69 64 0a 09 09 46 52 4f 4d 20 20 20 63  C.rid...FROM   c
1200: 73 72 65 76 69 73 69 6f 6e 20 43 0a 09 09 57 48  srevision C...WH
1210: 45 52 45 20 20 43 2e 63 69 64 20 3d 20 24 69 64  ERE  C.cid = $id
1220: 0a 09 09 4f 52 44 45 52 20 20 42 59 20 43 2e 70  ...ORDER  BY C.p
1230: 6f 73 0a 09 20 20 20 20 7d 5d 20 24 69 64 5d 0a  os..    }] $id].
1240: 09 7d 0a 0a 09 70 72 6f 6a 65 63 74 3a 3a 72 65  .}...project::re
1250: 76 20 6c 6f 61 64 63 6f 75 6e 74 65 72 0a 09 72  v loadcounter..r
1260: 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 20  eturn.    }..   
1270: 20 74 79 70 65 6d 65 74 68 6f 64 20 72 75 6e 20   typemethod run 
1280: 7b 7d 20 7b 0a 09 23 20 50 61 73 73 20 6d 61 6e  {} {..# Pass man
1290: 61 67 65 72 20 69 6e 74 65 72 66 61 63 65 2e 20  ager interface. 
12a0: 45 78 65 63 75 74 65 64 20 74 6f 20 70 65 72 66  Executed to perf
12b0: 6f 72 6d 20 74 68 65 0a 09 23 20 66 75 6e 63 74  orm the..# funct
12c0: 69 6f 6e 61 6c 69 74 79 20 6f 66 20 74 68 65 20  ionality of the 
12d0: 70 61 73 73 2e 0a 0a 09 73 74 61 74 65 20 74 72  pass....state tr
12e0: 61 6e 73 61 63 74 69 6f 6e 20 7b 0a 09 20 20 20  ansaction {..   
12f0: 20 43 72 65 61 74 65 52 65 76 69 73 69 6f 6e 43   CreateRevisionC
1300: 68 61 6e 67 65 73 65 74 73 20 20 3b 20 23 20 47  hangesets  ; # G
1310: 72 6f 75 70 20 66 69 6c 65 20 72 65 76 69 73 69  roup file revisi
1320: 6f 6e 73 20 69 6e 74 6f 20 63 73 65 74 73 2e 0a  ons into csets..
1330: 09 20 20 20 20 42 72 65 61 6b 49 6e 74 65 72 6e  .    BreakIntern
1340: 61 6c 44 65 70 65 6e 64 65 6e 63 69 65 73 20 3b  alDependencies ;
1350: 20 23 20 53 70 6c 69 74 20 74 68 65 20 63 73 65   # Split the cse
1360: 74 73 20 62 61 73 65 64 20 6f 6e 20 69 6e 74 65  ts based on inte
1370: 72 6e 61 6c 20 63 6f 6e 66 6c 69 63 74 73 2e 0a  rnal conflicts..
1380: 09 20 20 20 20 43 72 65 61 74 65 53 79 6d 62 6f  .    CreateSymbo
1390: 6c 43 68 61 6e 67 65 73 65 74 73 20 20 20 20 3b  lChangesets    ;
13a0: 20 23 20 43 72 65 61 74 65 20 63 73 65 74 73 20   # Create csets 
13b0: 66 6f 72 20 74 61 67 73 20 61 6e 64 20 62 72 61  for tags and bra
13c0: 6e 63 68 65 73 2e 0a 09 20 20 20 20 50 65 72 73  nches...    Pers
13d0: 69 73 74 54 68 65 43 68 61 6e 67 65 73 65 74 73  istTheChangesets
13e0: 0a 09 7d 0a 0a 09 72 65 70 6f 73 69 74 6f 72 79  ..}...repository
13f0: 20 70 72 69 6e 74 63 73 65 74 73 74 61 74 69 73   printcsetstatis
1400: 74 69 63 73 0a 09 69 6e 74 65 67 72 69 74 79 20  tics..integrity 
1410: 63 68 61 6e 67 65 73 65 74 73 0a 09 72 65 74 75  changesets..retu
1420: 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 20 20 74 79  rn.    }..    ty
1430: 70 65 6d 65 74 68 6f 64 20 64 69 73 63 61 72 64  pemethod discard
1440: 20 7b 7d 20 7b 0a 09 23 20 50 61 73 73 20 6d 61   {} {..# Pass ma
1450: 6e 61 67 65 72 20 69 6e 74 65 72 66 61 63 65 2e  nager interface.
1460: 20 45 78 65 63 75 74 65 64 20 66 6f 72 20 61 6c   Executed for al
1470: 6c 20 70 61 73 73 65 73 20 61 66 74 65 72 20 74  l passes after t
1480: 68 65 0a 09 23 20 72 75 6e 20 70 61 73 73 65 73  he..# run passes
1490: 2c 20 74 6f 20 72 65 6d 6f 76 65 20 61 6c 6c 20  , to remove all 
14a0: 64 61 74 61 20 6f 66 20 74 68 69 73 20 70 61 73  data of this pas
14b0: 73 20 66 72 6f 6d 20 74 68 65 20 73 74 61 74 65  s from the state
14c0: 2c 0a 09 23 20 61 73 20 62 65 69 6e 67 20 6f 75  ,..# as being ou
14d0: 74 20 6f 66 20 64 61 74 65 2e 0a 0a 09 73 74 61  t of date....sta
14e0: 74 65 20 64 69 73 63 61 72 64 20 63 68 61 6e 67  te discard chang
14f0: 65 73 65 74 0a 09 73 74 61 74 65 20 64 69 73 63  eset..state disc
1500: 61 72 64 20 63 73 74 79 70 65 0a 09 73 74 61 74  ard cstype..stat
1510: 65 20 64 69 73 63 61 72 64 20 63 73 72 65 76 69  e discard csrevi
1520: 73 69 6f 6e 0a 09 72 65 74 75 72 6e 0a 20 20 20  sion..return.   
1530: 20 7d 0a 0a 20 20 20 20 23 20 23 20 23 23 20 23   }..    # # ## #
1540: 23 23 20 23 23 23 23 23 20 23 23 23 23 23 23 23  ## ##### #######
1550: 23 20 23 23 23 23 23 23 23 23 23 23 23 23 23 0a  # #############.
1560: 20 20 20 20 23 23 20 49 6e 74 65 72 6e 61 6c 20      ## Internal 
1570: 6d 65 74 68 6f 64 73 0a 0a 20 20 20 20 70 72 6f  methods..    pro
1580: 63 20 43 72 65 61 74 65 52 65 76 69 73 69 6f 6e  c CreateRevision
1590: 43 68 61 6e 67 65 73 65 74 73 20 7b 7d 20 7b 0a  Changesets {} {.
15a0: 09 6c 6f 67 20 77 72 69 74 65 20 33 20 69 6e 69  .log write 3 ini
15b0: 74 63 73 65 74 73 20 7b 43 72 65 61 74 65 20 63  tcsets {Create c
15c0: 68 61 6e 67 65 73 65 74 73 20 62 61 73 65 64 20  hangesets based 
15d0: 6f 6e 20 72 65 76 69 73 69 6f 6e 73 7d 0a 0a 09  on revisions}...
15e0: 23 20 54 6f 20 67 65 74 20 74 68 65 20 69 6e 69  # To get the ini
15f0: 74 69 61 6c 20 6f 66 20 63 68 61 6e 67 65 73 65  tial of changese
1600: 74 73 20 77 65 20 66 69 72 73 74 20 67 72 6f 75  ts we first grou
1610: 70 20 61 6c 6c 20 66 69 6c 65 0a 09 23 20 6c 65  p all file..# le
1620: 76 65 6c 20 72 65 76 69 73 69 6f 6e 73 20 75 73  vel revisions us
1630: 69 6e 67 20 74 68 65 20 73 61 6d 65 20 6d 65 74  ing the same met
1640: 61 20 64 61 74 61 20 65 6e 74 72 79 20 74 6f 67  a data entry tog
1650: 65 74 68 65 72 2e 20 41 73 0a 09 23 20 74 68 65  ether. As..# the
1660: 20 6d 65 74 61 20 64 61 74 61 20 65 6e 63 6f 64   meta data encod
1670: 65 73 20 6e 6f 74 20 6f 6e 6c 79 20 61 75 74 68  es not only auth
1680: 6f 72 20 61 6e 64 20 6c 6f 67 20 6d 65 73 73 61  or and log messa
1690: 67 65 2c 20 62 75 74 0a 09 23 20 61 6c 73 6f 20  ge, but..# also 
16a0: 6c 69 6e 65 20 6f 66 20 64 65 76 65 6c 6f 70 6d  line of developm
16b0: 65 6e 74 20 61 6e 64 20 70 72 6f 6a 65 63 74 20  ent and project 
16c0: 77 65 20 63 61 6e 20 62 65 20 73 75 72 65 20 74  we can be sure t
16d0: 68 61 74 0a 09 23 20 72 65 76 69 73 69 6f 6e 73  hat..# revisions
16e0: 20 69 6e 20 64 69 66 66 65 72 65 6e 74 20 70 72   in different pr
16f0: 6f 6a 65 63 74 20 61 6e 64 20 6c 69 6e 65 73 20  oject and lines 
1700: 6f 66 20 64 65 76 65 6c 6f 70 6d 65 6e 74 20 61  of development a
1710: 72 65 0a 09 23 20 6e 6f 74 20 67 72 6f 75 70 65  re..# not groupe
1720: 64 20 74 6f 67 65 74 68 65 72 2e 20 49 6e 20 63  d together. In c
1730: 6f 6e 74 72 61 73 74 20 74 6f 20 63 76 73 32 73  ontrast to cvs2s
1740: 76 6e 20 77 65 20 64 6f 20 5f 5f 6e 6f 74 5f 5f  vn we do __not__
1750: 0a 09 23 20 75 73 65 20 64 69 73 74 61 6e 63 65  ..# use distance
1760: 20 69 6e 20 74 69 6d 65 20 62 65 74 77 65 65 6e   in time between
1770: 20 72 65 76 69 73 69 6f 6e 73 20 74 6f 20 62 72   revisions to br
1780: 65 61 6b 20 74 68 65 6d 0a 09 23 20 61 70 61 72  eak them..# apar
1790: 74 2e 20 57 65 20 68 61 76 65 20 73 65 65 6e 20  t. We have seen 
17a0: 43 56 53 20 72 65 70 6f 73 69 74 6f 72 69 65 73  CVS repositories
17b0: 20 28 66 72 6f 6d 20 53 46 29 20 77 68 65 72 65   (from SF) where
17c0: 20 61 0a 09 23 20 73 69 6e 67 6c 65 20 63 6f 6d   a..# single com
17d0: 6d 69 74 20 63 6f 6e 74 61 69 6e 65 64 20 72 65  mit contained re
17e0: 76 69 73 69 6f 6e 73 20 73 65 76 65 72 61 6c 20  visions several 
17f0: 68 6f 75 72 73 20 61 70 61 72 74 2c 0a 09 23 20  hours apart,..# 
1800: 6c 69 6b 65 6c 79 20 64 75 65 20 74 6f 20 74 72  likely due to tr
1810: 6f 75 62 6c 65 20 6f 6e 20 74 68 65 20 73 65 72  ouble on the ser
1820: 76 65 72 20 68 6f 73 74 69 6e 67 20 74 68 65 20  ver hosting the 
1830: 72 65 70 6f 73 69 74 6f 72 79 2e 0a 0a 09 23 20  repository....# 
1840: 57 65 20 6f 72 64 65 72 20 74 68 65 20 72 65 76  We order the rev
1850: 69 73 69 6f 6e 73 20 68 65 72 65 20 62 79 20 74  isions here by t
1860: 69 6d 65 2c 20 74 68 69 73 20 77 69 6c 6c 20 68  ime, this will h
1870: 65 6c 70 20 74 68 65 0a 09 23 20 6c 61 74 65 72  elp the..# later
1880: 20 70 61 73 73 65 73 20 28 61 76 6f 69 64 73 20   passes (avoids 
1890: 6a 6f 69 6e 73 20 6c 61 74 65 72 20 74 6f 20 67  joins later to g
18a0: 65 74 20 61 74 20 74 68 65 20 6f 72 64 65 72 69  et at the orderi
18b0: 6e 67 0a 09 23 20 69 6e 66 6f 29 2e 0a 0a 09 73  ng..# info)....s
18c0: 65 74 20 6e 20 30 0a 0a 09 73 65 74 20 6c 61 73  et n 0...set las
18d0: 74 6d 65 74 61 20 20 20 20 7b 7d 0a 09 73 65 74  tmeta    {}..set
18e0: 20 6c 61 73 74 70 72 6f 6a 65 63 74 20 7b 7d 0a   lastproject {}.
18f0: 09 73 65 74 20 72 65 76 69 73 69 6f 6e 73 20 20  .set revisions  
1900: 20 7b 7d 0a 0a 09 23 20 4e 6f 74 65 3a 20 57 65   {}...# Note: We
1910: 20 63 6f 75 6c 64 20 68 61 76 65 20 77 72 69 74   could have writ
1920: 74 65 6e 20 74 68 69 73 20 6c 6f 6f 70 20 74 6f  ten this loop to
1930: 20 63 72 65 61 74 65 20 74 68 65 20 63 73 65 74   create the cset
1940: 73 0a 09 23 20 20 20 20 20 20 20 65 61 72 6c 79  s..#       early
1950: 2c 20 65 78 74 65 6e 64 69 6e 67 20 74 68 65 6d  , extending them
1960: 20 77 69 74 68 20 61 6c 6c 20 74 68 65 69 72 20   with all their 
1970: 72 65 76 69 73 69 6f 6e 73 2e 20 54 68 69 73 0a  revisions. This.
1980: 09 23 20 20 20 20 20 20 20 68 6f 77 65 76 65 72  .#       however
1990: 20 77 6f 75 6c 64 20 6d 65 61 6e 20 6c 6f 74 73   would mean lots
19a0: 20 6f 66 20 28 73 6c 6f 77 29 20 6d 65 74 68 6f   of (slow) metho
19b0: 64 20 69 6e 76 6f 6b 61 74 69 6f 6e 73 0a 09 23  d invokations..#
19c0: 20 20 20 20 20 20 20 6f 6e 20 74 68 65 20 63 73         on the cs
19d0: 65 74 73 2e 20 44 6f 69 6e 67 20 69 74 20 6c 69  ets. Doing it li
19e0: 6b 65 20 74 68 69 73 2c 20 6c 61 74 65 20 63 72  ke this, late cr
19f0: 65 61 74 69 6f 6e 2c 20 6d 65 61 6e 73 0a 09 23  eation, means..#
1a00: 20 20 20 20 20 20 20 6c 65 73 73 20 73 75 63 68         less such
1a10: 20 63 61 6c 6c 73 2e 20 4e 6f 6e 65 2c 20 62 75   calls. None, bu
1a20: 74 20 74 68 65 20 63 72 65 61 74 69 6f 6e 20 69  t the creation i
1a30: 74 73 65 6c 66 2e 0a 0a 09 66 6f 72 65 61 63 68  tself....foreach
1a40: 20 7b 6d 69 64 20 72 69 64 20 70 69 64 7d 20 5b   {mid rid pid} [
1a50: 73 74 61 74 65 20 72 75 6e 20 7b 0a 09 20 20 20  state run {..   
1a60: 20 53 45 4c 45 43 54 20 4d 2e 6d 69 64 2c 20 52   SELECT M.mid, R
1a70: 2e 72 69 64 2c 20 4d 2e 70 69 64 0a 09 20 20 20  .rid, M.pid..   
1a80: 20 46 52 4f 4d 20 20 20 72 65 76 69 73 69 6f 6e   FROM   revision
1a90: 20 52 2c 20 6d 65 74 61 20 4d 20 20 20 2d 2d 20   R, meta M   -- 
1aa0: 52 20 3d 3d 3e 20 4d 2c 20 75 73 69 6e 67 20 50  R ==> M, using P
1ab0: 4b 20 69 6e 64 65 78 20 6f 66 20 4d 2e 0a 09 20  K index of M... 
1ac0: 20 20 20 57 48 45 52 45 20 20 52 2e 6d 69 64 20     WHERE  R.mid 
1ad0: 3d 20 4d 2e 6d 69 64 0a 09 20 20 20 20 4f 52 44  = M.mid..    ORD
1ae0: 45 52 20 20 42 59 20 4d 2e 6d 69 64 2c 20 52 2e  ER  BY M.mid, R.
1af0: 64 61 74 65 0a 09 7d 5d 20 7b 0a 09 20 20 20 20  date..}] {..    
1b00: 69 66 20 7b 24 6c 61 73 74 6d 65 74 61 20 21 3d  if {$lastmeta !=
1b10: 20 24 6d 69 64 7d 20 7b 0a 09 09 69 66 20 7b 5b   $mid} {...if {[
1b20: 6c 6c 65 6e 67 74 68 20 24 72 65 76 69 73 69 6f  llength $revisio
1b30: 6e 73 5d 7d 20 7b 0a 09 09 20 20 20 20 69 6e 63  ns]} {...    inc
1b40: 72 20 6e 0a 09 09 20 20 20 20 73 65 74 20 20 70  r n...    set  p
1b50: 20 5b 72 65 70 6f 73 69 74 6f 72 79 20 70 72 6f   [repository pro
1b60: 6a 65 63 74 6f 66 20 24 6c 61 73 74 70 72 6f 6a  jectof $lastproj
1b70: 65 63 74 5d 0a 09 09 20 20 20 20 70 72 6f 6a 65  ect]...    proje
1b80: 63 74 3a 3a 72 65 76 20 25 41 55 54 4f 25 20 24  ct::rev %AUTO% $
1b90: 70 20 72 65 76 20 24 6c 61 73 74 6d 65 74 61 20  p rev $lastmeta 
1ba0: 24 72 65 76 69 73 69 6f 6e 73 0a 09 09 20 20 20  $revisions...   
1bb0: 20 73 65 74 20 72 65 76 69 73 69 6f 6e 73 20 7b   set revisions {
1bc0: 7d 0a 09 09 7d 0a 09 09 73 65 74 20 6c 61 73 74  }...}...set last
1bd0: 6d 65 74 61 20 20 20 20 24 6d 69 64 0a 09 09 73  meta    $mid...s
1be0: 65 74 20 6c 61 73 74 70 72 6f 6a 65 63 74 20 24  et lastproject $
1bf0: 70 69 64 0a 09 20 20 20 20 7d 0a 09 20 20 20 20  pid..    }..    
1c00: 6c 61 70 70 65 6e 64 20 72 65 76 69 73 69 6f 6e  lappend revision
1c10: 73 20 24 72 69 64 0a 09 7d 0a 0a 09 69 66 20 7b  s $rid..}...if {
1c20: 5b 6c 6c 65 6e 67 74 68 20 24 72 65 76 69 73 69  [llength $revisi
1c30: 6f 6e 73 5d 7d 20 7b 0a 09 20 20 20 20 69 6e 63  ons]} {..    inc
1c40: 72 20 6e 0a 09 20 20 20 20 73 65 74 20 20 70 20  r n..    set  p 
1c50: 5b 72 65 70 6f 73 69 74 6f 72 79 20 70 72 6f 6a  [repository proj
1c60: 65 63 74 6f 66 20 24 6c 61 73 74 70 72 6f 6a 65  ectof $lastproje
1c70: 63 74 5d 0a 09 20 20 20 20 70 72 6f 6a 65 63 74  ct]..    project
1c80: 3a 3a 72 65 76 20 25 41 55 54 4f 25 20 24 70 20  ::rev %AUTO% $p 
1c90: 72 65 76 20 24 6c 61 73 74 6d 65 74 61 20 24 72  rev $lastmeta $r
1ca0: 65 76 69 73 69 6f 6e 73 0a 09 7d 0a 0a 09 6c 6f  evisions..}...lo
1cb0: 67 20 77 72 69 74 65 20 34 20 69 6e 69 74 63 73  g write 4 initcs
1cc0: 65 74 73 20 22 43 72 65 61 74 65 64 20 5b 6e 73  ets "Created [ns
1cd0: 70 20 24 6e 20 7b 72 65 76 69 73 69 6f 6e 20 63  p $n {revision c
1ce0: 68 61 6e 67 65 73 65 74 7d 5d 22 0a 09 72 65 74  hangeset}]"..ret
1cf0: 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 20 20 70  urn.    }..    p
1d00: 72 6f 63 20 43 72 65 61 74 65 53 79 6d 62 6f 6c  roc CreateSymbol
1d10: 43 68 61 6e 67 65 73 65 74 73 20 7b 7d 20 7b 0a  Changesets {} {.
1d20: 09 6c 6f 67 20 77 72 69 74 65 20 33 20 69 6e 69  .log write 3 ini
1d30: 74 63 73 65 74 73 20 7b 43 72 65 61 74 65 20 63  tcsets {Create c
1d40: 68 61 6e 67 65 73 65 74 73 20 62 61 73 65 64 20  hangesets based 
1d50: 6f 6e 20 73 79 6d 62 6f 6c 73 7d 0a 0a 09 23 20  on symbols}...# 
1d60: 54 61 67 73 20 61 6e 64 20 62 72 61 6e 63 68 65  Tags and branche
1d70: 73 20 69 6e 64 75 63 65 20 63 68 61 6e 67 65 73  s induce changes
1d80: 65 74 73 20 61 73 20 77 65 6c 6c 2c 20 63 6f 6e  ets as well, con
1d90: 74 61 69 6e 69 6e 67 20 74 68 65 0a 09 23 20 72  taining the..# r
1da0: 65 76 69 73 69 6f 6e 73 20 74 68 65 79 20 61 72  evisions they ar
1db0: 65 20 61 74 74 61 63 68 65 64 20 74 6f 20 28 74  e attached to (t
1dc0: 61 67 73 29 2c 20 6f 72 20 73 70 61 77 6e 65 64  ags), or spawned
1dd0: 20 66 72 6f 6d 0a 09 23 20 28 62 72 61 6e 63 68   from..# (branch
1de0: 65 73 29 2e 0a 0a 09 73 65 74 20 6e 20 30 0a 0a  es)....set n 0..
1df0: 09 23 20 46 69 72 73 74 20 70 72 6f 63 65 73 73  .# First process
1e00: 20 74 68 65 20 74 61 67 73 2c 20 74 68 65 6e 20   the tags, then 
1e10: 74 68 65 20 62 72 61 6e 63 68 65 73 2e 20 57 65  the branches. We
1e20: 20 6b 6e 6f 77 20 74 68 61 74 0a 09 23 20 74 68   know that..# th
1e30: 65 69 72 20 69 64 73 20 64 6f 20 6e 6f 74 20 6f  eir ids do not o
1e40: 76 65 72 6c 61 70 20 77 69 74 68 20 65 61 63 68  verlap with each
1e50: 20 6f 74 68 65 72 2e 0a 0a 09 73 65 74 20 6c 61   other....set la
1e60: 73 74 73 79 6d 62 6f 6c 20 20 7b 7d 0a 09 73 65  stsymbol  {}..se
1e70: 74 20 6c 61 73 74 70 72 6f 6a 65 63 74 20 7b 7d  t lastproject {}
1e80: 0a 09 73 65 74 20 72 65 76 69 73 69 6f 6e 73 20  ..set revisions 
1e90: 20 20 7b 7d 0a 0a 09 66 6f 72 65 61 63 68 20 7b    {}...foreach {
1ea0: 73 69 64 20 72 69 64 20 70 69 64 7d 20 5b 73 74  sid rid pid} [st
1eb0: 61 74 65 20 72 75 6e 20 7b 0a 09 20 20 20 20 53  ate run {..    S
1ec0: 45 4c 45 43 54 20 53 2e 73 69 64 2c 20 54 2e 74  ELECT S.sid, T.t
1ed0: 69 64 2c 20 53 2e 70 69 64 0a 09 20 20 20 20 46  id, S.pid..    F
1ee0: 52 4f 4d 20 20 74 61 67 20 54 2c 20 73 79 6d 62  ROM  tag T, symb
1ef0: 6f 6c 20 53 20 20 20 20 20 2d 2d 20 54 20 3d 3d  ol S     -- T ==
1f00: 3e 20 52 2f 53 2c 20 75 73 69 6e 67 20 50 4b 20  > R/S, using PK 
1f10: 69 6e 64 69 63 65 73 20 6f 66 20 52 2c 20 53 2e  indices of R, S.
1f20: 0a 09 20 20 20 20 57 48 45 52 45 20 54 2e 73 69  ..    WHERE T.si
1f30: 64 20 3d 20 53 2e 73 69 64 0a 09 20 20 20 20 4f  d = S.sid..    O
1f40: 52 44 45 52 20 42 59 20 53 2e 73 69 64 2c 20 54  RDER BY S.sid, T
1f50: 2e 74 69 64 0a 09 7d 5d 20 7b 0a 09 20 20 20 20  .tid..}] {..    
1f60: 69 66 20 7b 24 6c 61 73 74 73 79 6d 62 6f 6c 20  if {$lastsymbol 
1f70: 21 3d 20 24 73 69 64 7d 20 7b 0a 09 09 69 66 20  != $sid} {...if 
1f80: 7b 5b 6c 6c 65 6e 67 74 68 20 24 72 65 76 69 73  {[llength $revis
1f90: 69 6f 6e 73 5d 7d 20 7b 0a 09 09 20 20 20 20 69  ions]} {...    i
1fa0: 6e 63 72 20 6e 0a 09 09 20 20 20 20 73 65 74 20  ncr n...    set 
1fb0: 20 70 20 5b 72 65 70 6f 73 69 74 6f 72 79 20 70   p [repository p
1fc0: 72 6f 6a 65 63 74 6f 66 20 24 6c 61 73 74 70 72  rojectof $lastpr
1fd0: 6f 6a 65 63 74 5d 0a 09 09 20 20 20 20 70 72 6f  oject]...    pro
1fe0: 6a 65 63 74 3a 3a 72 65 76 20 25 41 55 54 4f 25  ject::rev %AUTO%
1ff0: 20 24 70 20 73 79 6d 3a 3a 74 61 67 20 24 6c 61   $p sym::tag $la
2000: 73 74 73 79 6d 62 6f 6c 20 24 72 65 76 69 73 69  stsymbol $revisi
2010: 6f 6e 73 0a 09 09 20 20 20 20 73 65 74 20 72 65  ons...    set re
2020: 76 69 73 69 6f 6e 73 20 7b 7d 0a 09 09 7d 0a 09  visions {}...}..
2030: 09 73 65 74 20 6c 61 73 74 73 79 6d 62 6f 6c 20  .set lastsymbol 
2040: 20 24 73 69 64 0a 09 09 73 65 74 20 6c 61 73 74   $sid...set last
2050: 70 72 6f 6a 65 63 74 20 24 70 69 64 0a 09 20 20  project $pid..  
2060: 20 20 7d 0a 09 20 20 20 20 6c 61 70 70 65 6e 64    }..    lappend
2070: 20 72 65 76 69 73 69 6f 6e 73 20 24 72 69 64 0a   revisions $rid.
2080: 09 7d 0a 0a 09 69 66 20 7b 5b 6c 6c 65 6e 67 74  .}...if {[llengt
2090: 68 20 24 72 65 76 69 73 69 6f 6e 73 5d 7d 20 7b  h $revisions]} {
20a0: 0a 09 20 20 20 20 69 6e 63 72 20 6e 0a 09 20 20  ..    incr n..  
20b0: 20 20 73 65 74 20 20 70 20 5b 72 65 70 6f 73 69    set  p [reposi
20c0: 74 6f 72 79 20 70 72 6f 6a 65 63 74 6f 66 20 24  tory projectof $
20d0: 6c 61 73 74 70 72 6f 6a 65 63 74 5d 0a 09 20 20  lastproject]..  
20e0: 20 20 70 72 6f 6a 65 63 74 3a 3a 72 65 76 20 25    project::rev %
20f0: 41 55 54 4f 25 20 24 70 20 73 79 6d 3a 3a 74 61  AUTO% $p sym::ta
2100: 67 20 24 6c 61 73 74 73 79 6d 62 6f 6c 20 24 72  g $lastsymbol $r
2110: 65 76 69 73 69 6f 6e 73 0a 09 7d 0a 0a 09 73 65  evisions..}...se
2120: 74 20 6c 61 73 74 73 79 6d 62 6f 6c 20 7b 7d 0a  t lastsymbol {}.
2130: 09 73 65 74 20 6c 61 73 70 72 6f 6a 65 63 74 20  .set lasproject 
2140: 7b 7d 0a 09 73 65 74 20 72 65 76 69 73 69 6f 6e  {}..set revision
2150: 73 20 20 7b 7d 0a 0a 09 66 6f 72 65 61 63 68 20  s  {}...foreach 
2160: 7b 73 69 64 20 72 69 64 20 70 69 64 7d 20 5b 73  {sid rid pid} [s
2170: 74 61 74 65 20 72 75 6e 20 7b 0a 09 20 20 20 20  tate run {..    
2180: 53 45 4c 45 43 54 20 53 2e 73 69 64 2c 20 42 2e  SELECT S.sid, B.
2190: 62 69 64 2c 20 53 2e 70 69 64 0a 09 20 20 20 20  bid, S.pid..    
21a0: 46 52 4f 4d 20 20 62 72 61 6e 63 68 20 42 2c 20  FROM  branch B, 
21b0: 73 79 6d 62 6f 6c 20 53 20 20 2d 2d 20 42 20 3d  symbol S  -- B =
21c0: 3d 3e 20 52 2f 53 2c 20 75 73 69 6e 67 20 50 4b  => R/S, using PK
21d0: 20 69 6e 64 69 63 65 73 20 6f 66 20 52 2c 20 53   indices of R, S
21e0: 2e 0a 09 20 20 20 20 57 48 45 52 45 20 42 2e 73  ...    WHERE B.s
21f0: 69 64 20 20 3d 20 53 2e 73 69 64 0a 09 20 20 20  id  = S.sid..   
2200: 20 4f 52 44 45 52 20 42 59 20 53 2e 73 69 64 2c   ORDER BY S.sid,
2210: 20 42 2e 62 69 64 0a 09 7d 5d 20 7b 0a 09 20 20   B.bid..}] {..  
2220: 20 20 69 66 20 7b 24 6c 61 73 74 73 79 6d 62 6f    if {$lastsymbo
2230: 6c 20 21 3d 20 24 73 69 64 7d 20 7b 0a 09 09 69  l != $sid} {...i
2240: 66 20 7b 5b 6c 6c 65 6e 67 74 68 20 24 72 65 76  f {[llength $rev
2250: 69 73 69 6f 6e 73 5d 7d 20 7b 0a 09 09 20 20 20  isions]} {...   
2260: 20 69 6e 63 72 20 6e 0a 09 09 20 20 20 20 73 65   incr n...    se
2270: 74 20 20 70 20 5b 72 65 70 6f 73 69 74 6f 72 79  t  p [repository
2280: 20 70 72 6f 6a 65 63 74 6f 66 20 24 6c 61 73 74   projectof $last
2290: 70 72 6f 6a 65 63 74 5d 0a 09 09 20 20 20 20 70  project]...    p
22a0: 72 6f 6a 65 63 74 3a 3a 72 65 76 20 25 41 55 54  roject::rev %AUT
22b0: 4f 25 20 24 70 20 73 79 6d 3a 3a 62 72 61 6e 63  O% $p sym::branc
22c0: 68 20 24 6c 61 73 74 73 79 6d 62 6f 6c 20 24 72  h $lastsymbol $r
22d0: 65 76 69 73 69 6f 6e 73 0a 09 09 20 20 20 20 73  evisions...    s
22e0: 65 74 20 72 65 76 69 73 69 6f 6e 73 20 7b 7d 0a  et revisions {}.
22f0: 09 09 7d 0a 09 09 73 65 74 20 6c 61 73 74 73 79  ..}...set lastsy
2300: 6d 62 6f 6c 20 20 24 73 69 64 0a 09 09 73 65 74  mbol  $sid...set
2310: 20 6c 61 73 74 70 72 6f 6a 65 63 74 20 24 70 69   lastproject $pi
2320: 64 0a 09 20 20 20 20 7d 0a 09 20 20 20 20 6c 61  d..    }..    la
2330: 70 70 65 6e 64 20 72 65 76 69 73 69 6f 6e 73 20  ppend revisions 
2340: 24 72 69 64 0a 09 7d 0a 0a 09 69 66 20 7b 5b 6c  $rid..}...if {[l
2350: 6c 65 6e 67 74 68 20 24 72 65 76 69 73 69 6f 6e  length $revision
2360: 73 5d 7d 20 7b 0a 09 20 20 20 20 69 6e 63 72 20  s]} {..    incr 
2370: 6e 0a 09 20 20 20 20 73 65 74 20 20 70 20 5b 72  n..    set  p [r
2380: 65 70 6f 73 69 74 6f 72 79 20 70 72 6f 6a 65 63  epository projec
2390: 74 6f 66 20 24 6c 61 73 74 70 72 6f 6a 65 63 74  tof $lastproject
23a0: 5d 0a 09 20 20 20 20 70 72 6f 6a 65 63 74 3a 3a  ]..    project::
23b0: 72 65 76 20 25 41 55 54 4f 25 20 24 70 20 73 79  rev %AUTO% $p sy
23c0: 6d 3a 3a 62 72 61 6e 63 68 20 24 6c 61 73 74 73  m::branch $lasts
23d0: 79 6d 62 6f 6c 20 24 72 65 76 69 73 69 6f 6e 73  ymbol $revisions
23e0: 0a 09 7d 0a 0a 09 6c 6f 67 20 77 72 69 74 65 20  ..}...log write 
23f0: 34 20 69 6e 69 74 63 73 65 74 73 20 22 43 72 65  4 initcsets "Cre
2400: 61 74 65 64 20 5b 6e 73 70 20 24 6e 20 7b 73 79  ated [nsp $n {sy
2410: 6d 62 6f 6c 20 63 68 61 6e 67 65 73 65 74 7d 5d  mbol changeset}]
2420: 22 0a 09 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a  "..return.    }.
2430: 0a 20 20 20 20 70 72 6f 63 20 42 72 65 61 6b 49  .    proc BreakI
2440: 6e 74 65 72 6e 61 6c 44 65 70 65 6e 64 65 6e 63  nternalDependenc
2450: 69 65 73 20 7b 7d 20 7b 0a 09 23 20 54 68 69 73  ies {} {..# This
2460: 20 63 6f 64 65 20 6f 70 65 72 61 74 65 73 20 6f   code operates o
2470: 6e 20 74 68 65 20 72 65 76 69 73 69 6f 6e 20 63  n the revision c
2480: 68 61 6e 67 65 73 65 74 73 20 63 72 65 61 74 65  hangesets create
2490: 64 20 62 79 0a 09 23 20 27 43 72 65 61 74 65 52  d by..# 'CreateR
24a0: 65 76 69 73 69 6f 6e 43 68 61 6e 67 65 73 65 74  evisionChangeset
24b0: 73 27 2e 20 41 73 20 73 75 63 68 20 69 74 20 68  s'. As such it h
24c0: 61 73 20 74 6f 20 66 6f 6c 6c 6f 77 20 61 66 74  as to follow aft
24d0: 65 72 0a 09 23 20 69 74 2c 20 62 65 66 6f 72 65  er..# it, before
24e0: 20 74 68 65 20 73 79 6d 62 6f 6c 20 63 68 61 6e   the symbol chan
24f0: 67 65 73 65 74 73 20 61 72 65 20 6d 61 64 65 2e  gesets are made.
2500: 20 54 68 65 20 63 68 61 6e 67 65 73 65 74 73 0a   The changesets.
2510: 09 23 20 61 72 65 20 69 6e 73 70 65 63 74 65 64  .# are inspected
2520: 20 66 6f 72 20 69 6e 74 65 72 6e 61 6c 20 63 6f   for internal co
2530: 6e 66 6c 69 63 74 73 20 61 6e 64 20 61 6e 79 20  nflicts and any 
2540: 73 75 63 68 20 61 72 65 20 62 72 6f 6b 65 6e 0a  such are broken.
2550: 09 23 20 62 79 20 73 70 6c 69 74 74 69 6e 67 20  .# by splitting 
2560: 74 68 65 20 70 72 6f 62 6c 65 6d 61 74 69 63 20  the problematic 
2570: 63 68 61 6e 67 65 73 65 74 20 69 6e 74 6f 20 6d  changeset into m
2580: 75 6c 74 69 70 6c 65 0a 09 23 20 66 72 61 67 6d  ultiple..# fragm
2590: 65 6e 74 73 2e 20 54 68 65 20 72 65 73 75 6c 74  ents. The result
25a0: 73 20 61 72 65 20 63 68 61 6e 67 65 73 65 74 73  s are changesets
25b0: 20 77 68 69 63 68 20 68 61 76 65 20 6e 6f 20 69   which have no i
25c0: 6e 74 65 72 6e 61 6c 0a 09 23 20 64 65 70 65 6e  nternal..# depen
25d0: 64 65 6e 63 69 65 73 2c 20 6f 6e 6c 79 20 65 78  dencies, only ex
25e0: 74 65 72 6e 61 6c 20 6f 6e 65 73 2e 0a 0a 09 6c  ternal ones....l
25f0: 6f 67 20 77 72 69 74 65 20 33 20 69 6e 69 74 63  og write 3 initc
2600: 73 65 74 73 20 7b 42 72 65 61 6b 20 69 6e 74 65  sets {Break inte
2610: 72 6e 61 6c 20 64 65 70 65 6e 64 65 6e 63 69 65  rnal dependencie
2620: 73 7d 0a 09 73 65 74 20 6f 6c 64 20 5b 6c 6c 65  s}..set old [lle
2630: 6e 67 74 68 20 5b 70 72 6f 6a 65 63 74 3a 3a 72  ngth [project::r
2640: 65 76 20 61 6c 6c 5d 5d 0a 0a 09 66 6f 72 65 61  ev all]]...forea
2650: 63 68 20 63 73 65 74 20 5b 70 72 6f 6a 65 63 74  ch cset [project
2660: 3a 3a 72 65 76 20 61 6c 6c 5d 20 7b 0a 09 20 20  ::rev all] {..  
2670: 20 20 24 63 73 65 74 20 62 72 65 61 6b 69 6e 74    $cset breakint
2680: 65 72 6e 61 6c 64 65 70 65 6e 64 65 6e 63 69 65  ernaldependencie
2690: 73 0a 09 7d 0a 0a 09 73 65 74 20 6e 20 5b 65 78  s..}...set n [ex
26a0: 70 72 20 7b 5b 6c 6c 65 6e 67 74 68 20 5b 70 72  pr {[llength [pr
26b0: 6f 6a 65 63 74 3a 3a 72 65 76 20 61 6c 6c 5d 5d  oject::rev all]]
26c0: 20 2d 20 24 6f 6c 64 7d 5d 0a 09 6c 6f 67 20 77   - $old}]..log w
26d0: 72 69 74 65 20 34 20 69 6e 69 74 63 73 65 74 73  rite 4 initcsets
26e0: 20 22 43 72 65 61 74 65 64 20 5b 6e 73 70 20 24   "Created [nsp $
26f0: 6e 20 7b 61 64 64 69 74 69 6f 6e 61 6c 20 72 65  n {additional re
2700: 76 69 73 69 6f 6e 20 63 68 61 6e 67 65 73 65 74  vision changeset
2710: 7d 5d 22 0a 09 6c 6f 67 20 77 72 69 74 65 20 34  }]"..log write 4
2720: 20 69 6e 69 74 63 73 65 74 73 20 4f 6b 2e 0a 09   initcsets Ok...
2730: 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20  return.    }..  
2740: 20 20 70 72 6f 63 20 50 65 72 73 69 73 74 54 68    proc PersistTh
2750: 65 43 68 61 6e 67 65 73 65 74 73 20 7b 7d 20 7b  eChangesets {} {
2760: 0a 09 6c 6f 67 20 77 72 69 74 65 20 33 20 69 6e  ..log write 3 in
2770: 69 74 63 73 65 74 73 20 22 53 61 76 69 6e 67 20  itcsets "Saving 
2780: 5b 6e 73 70 20 5b 6c 6c 65 6e 67 74 68 20 5b 70  [nsp [llength [p
2790: 72 6f 6a 65 63 74 3a 3a 72 65 76 20 61 6c 6c 5d  roject::rev all]
27a0: 5d 20 7b 69 6e 69 74 69 61 6c 20 63 68 61 6e 67  ] {initial chang
27b0: 65 73 65 74 7d 5d 20 74 6f 20 74 68 65 20 70 65  eset}] to the pe
27c0: 72 73 69 73 74 65 6e 74 20 73 74 61 74 65 22 0a  rsistent state".
27d0: 0a 09 66 6f 72 65 61 63 68 20 63 73 65 74 20 5b  ..foreach cset [
27e0: 70 72 6f 6a 65 63 74 3a 3a 72 65 76 20 61 6c 6c  project::rev all
27f0: 5d 20 7b 0a 09 20 20 20 20 24 63 73 65 74 20 70  ] {..    $cset p
2800: 65 72 73 69 73 74 0a 09 7d 0a 0a 09 6c 6f 67 20  ersist..}...log 
2810: 77 72 69 74 65 20 34 20 69 6e 69 74 63 73 65 74  write 4 initcset
2820: 73 20 4f 6b 2e 0a 09 72 65 74 75 72 6e 0a 20 20  s Ok...return.  
2830: 20 20 7d 0a 0a 20 20 20 20 23 20 23 20 23 23 20    }..    # # ## 
2840: 23 23 23 20 23 23 23 23 23 20 23 23 23 23 23 23  ### ##### ######
2850: 23 23 20 23 23 23 23 23 23 23 23 23 23 23 23 23  ## #############
2860: 0a 20 20 20 20 23 23 20 43 6f 6e 66 69 67 75 72  .    ## Configur
2870: 61 74 69 6f 6e 0a 0a 20 20 20 20 70 72 61 67 6d  ation..    pragm
2880: 61 20 2d 68 61 73 69 6e 73 74 61 6e 63 65 73 20  a -hasinstances 
2890: 20 20 6e 6f 20 3b 20 23 20 73 69 6e 67 6c 65 74    no ; # singlet
28a0: 6f 6e 0a 20 20 20 20 70 72 61 67 6d 61 20 2d 68  on.    pragma -h
28b0: 61 73 74 79 70 65 69 6e 66 6f 20 20 20 20 6e 6f  astypeinfo    no
28c0: 20 3b 20 23 20 6e 6f 20 69 6e 74 72 6f 73 70 65   ; # no introspe
28d0: 63 74 69 6f 6e 0a 20 20 20 20 70 72 61 67 6d 61  ction.    pragma
28e0: 20 2d 68 61 73 74 79 70 65 64 65 73 74 72 6f 79   -hastypedestroy
28f0: 20 6e 6f 20 3b 20 23 20 69 6d 6d 6f 72 74 61 6c   no ; # immortal
2900: 0a 0a 20 20 20 20 23 20 23 20 23 23 20 23 23 23  ..    # # ## ###
2910: 20 23 23 23 23 23 20 23 23 23 23 23 23 23 23 20   ##### ######## 
2920: 23 23 23 23 23 23 23 23 23 23 23 23 23 0a 7d 0a  #############.}.
2930: 0a 6e 61 6d 65 73 70 61 63 65 20 65 76 61 6c 20  .namespace eval 
2940: 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d  ::vc::fossil::im
2950: 70 6f 72 74 3a 3a 63 76 73 3a 3a 70 61 73 73 20  port::cvs::pass 
2960: 7b 0a 20 20 20 20 6e 61 6d 65 73 70 61 63 65 20  {.    namespace 
2970: 65 78 70 6f 72 74 20 69 6e 69 74 63 73 65 74 73  export initcsets
2980: 0a 20 20 20 20 6e 61 6d 65 73 70 61 63 65 20 65  .    namespace e
2990: 76 61 6c 20 69 6e 69 74 63 73 65 74 73 20 7b 0a  val initcsets {.
29a0: 09 6e 61 6d 65 73 70 61 63 65 20 69 6d 70 6f 72  .namespace impor
29b0: 74 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a  t ::vc::fossil::
29c0: 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 72 65 70  import::cvs::rep
29d0: 6f 73 69 74 6f 72 79 0a 09 6e 61 6d 65 73 70 61  ository..namespa
29e0: 63 65 20 69 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a  ce import ::vc::
29f0: 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a  fossil::import::
2a00: 63 76 73 3a 3a 73 74 61 74 65 0a 09 6e 61 6d 65  cvs::state..name
2a10: 73 70 61 63 65 20 69 6d 70 6f 72 74 20 3a 3a 76  space import ::v
2a20: 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72  c::fossil::impor
2a30: 74 3a 3a 63 76 73 3a 3a 69 6e 74 65 67 72 69 74  t::cvs::integrit
2a40: 79 0a 09 6e 61 6d 65 73 70 61 63 65 20 65 76 61  y..namespace eva
2a50: 6c 20 70 72 6f 6a 65 63 74 20 7b 0a 09 20 20 20  l project {..   
2a60: 20 6e 61 6d 65 73 70 61 63 65 20 69 6d 70 6f 72   namespace impor
2a70: 74 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a  t ::vc::fossil::
2a80: 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 70 72 6f  import::cvs::pro
2a90: 6a 65 63 74 3a 3a 72 65 76 0a 09 7d 0a 09 6e 61  ject::rev..}..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 74 6f 6f 6c 73 3a 3a 6d 69 73 63  :vc::tools::misc
2ac0: 3a 3a 2a 0a 09 6e 61 6d 65 73 70 61 63 65 20 69  ::*..namespace i
2ad0: 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a 74 6f 6f 6c  mport ::vc::tool
2ae0: 73 3a 3a 6c 6f 67 0a 09 6c 6f 67 20 72 65 67 69  s::log..log regi
2af0: 73 74 65 72 20 69 6e 69 74 63 73 65 74 73 0a 20  ster initcsets. 
2b00: 20 20 20 7d 0a 7d 0a 0a 23 20 23 20 23 23 20 23     }.}..# # ## #
2b10: 23 23 20 23 23 23 23 23 20 23 23 23 23 23 23 23  ## ##### #######
2b20: 23 20 23 23 23 23 23 23 23 23 23 23 23 23 23 20  # ############# 
2b30: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
2b40: 23 23 23 23 23 0a 23 23 20 52 65 61 64 79 0a 0a  #####.## Ready..
2b50: 70 61 63 6b 61 67 65 20 70 72 6f 76 69 64 65 20  package provide 
2b60: 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f  vc::fossil::impo
2b70: 72 74 3a 3a 63 76 73 3a 3a 70 61 73 73 3a 3a 69  rt::cvs::pass::i
2b80: 6e 69 74 63 73 65 74 73 20 31 2e 30 0a 72 65 74  nitcsets 1.0.ret
2b90: 75 72 6e 0a                                      urn.