Hex Artifact Content
Not logged in

Artifact b1c3a78eda5fa79bfc74875acee65d53bec9e070:

File tools/cvs2fossil/lib/c2f_pinitcsets.tcl part of check-in [80b1e8936f] - Renamed state table 'csrevision' to 'csitem' to reflect the new internals of changesets. Updated all places where it is used. by aku on 2007-11-29 09:16:33.

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 69 74 65 6d 20 7b 0a 09 20 20 20  ng csitem {..   
0e80: 20 63 69 64 20 20 49 4e 54 45 47 45 52 20 20 4e   cid  INTEGER  N
0e90: 4f 54 20 4e 55 4c 4c 20 20 52 45 46 45 52 45 4e  OT NULL  REFEREN
0ea0: 43 45 53 20 63 68 61 6e 67 65 73 65 74 2c 0a 09  CES changeset,..
0eb0: 20 20 20 20 70 6f 73 20 20 49 4e 54 45 47 45 52      pos  INTEGER
0ec0: 20 20 4e 4f 54 20 4e 55 4c 4c 2c 0a 09 20 20 20    NOT NULL,..   
0ed0: 20 69 69 64 20 20 49 4e 54 45 47 45 52 20 20 4e   iid  INTEGER  N
0ee0: 4f 54 20 4e 55 4c 4c 2c 20 2d 2d 20 52 45 46 45  OT NULL, -- REFE
0ef0: 52 45 4e 43 45 53 20 72 65 76 69 73 69 6f 6e 7c  RENCES revision|
0f00: 74 61 67 7c 62 72 61 6e 63 68 0a 09 20 20 20 20  tag|branch..    
0f10: 55 4e 49 51 55 45 20 28 63 69 64 2c 20 70 6f 73  UNIQUE (cid, pos
0f20: 29 2c 0a 09 20 20 20 20 55 4e 49 51 55 45 20 28  ),..    UNIQUE (
0f30: 63 69 64 2c 20 69 69 64 29 0a 09 7d 0a 0a 09 70  cid, iid)..}...p
0f40: 72 6f 6a 65 63 74 3a 3a 72 65 76 20 67 65 74 63  roject::rev getc
0f50: 73 74 79 70 65 73 0a 09 72 65 74 75 72 6e 0a 20  stypes..return. 
0f60: 20 20 20 7d 0a 0a 20 20 20 20 74 79 70 65 6d 65     }..    typeme
0f70: 74 68 6f 64 20 6c 6f 61 64 20 7b 7d 20 7b 0a 09  thod load {} {..
0f80: 23 20 50 61 73 73 20 6d 61 6e 61 67 65 72 20 69  # Pass manager i
0f90: 6e 74 65 72 66 61 63 65 2e 20 45 78 65 63 75 74  nterface. Execut
0fa0: 65 64 20 74 6f 20 6c 6f 61 64 20 64 61 74 61 20  ed to load data 
0fb0: 63 6f 6d 70 75 74 65 64 20 62 79 0a 09 23 20 74  computed by..# t
0fc0: 68 69 73 20 70 61 73 73 20 69 6e 74 6f 20 6d 65  his pass into me
0fd0: 6d 6f 72 79 20 77 68 65 6e 20 74 68 69 73 20 70  mory when this p
0fe0: 61 73 73 20 69 73 20 73 6b 69 70 70 65 64 20 69  ass is skipped i
0ff0: 6e 73 74 65 61 64 20 6f 66 0a 09 23 20 65 78 65  nstead of..# exe
1000: 63 75 74 65 64 2e 0a 0a 09 73 74 61 74 65 20 72  cuted....state r
1010: 65 61 64 69 6e 67 20 63 68 61 6e 67 65 73 65 74  eading changeset
1020: 0a 09 73 74 61 74 65 20 72 65 61 64 69 6e 67 20  ..state reading 
1030: 63 73 69 74 65 6d 0a 09 73 74 61 74 65 20 72 65  csitem..state re
1040: 61 64 69 6e 67 20 63 73 74 79 70 65 0a 0a 09 23  ading cstype...#
1050: 20 4e 65 65 64 20 74 68 65 20 74 79 70 65 73 20   Need the types 
1060: 66 69 72 73 74 2c 20 74 68 65 20 63 6f 6e 73 74  first, the const
1070: 72 75 63 74 6f 72 20 69 6e 20 74 68 65 20 6c 6f  ructor in the lo
1080: 6f 70 20 62 65 6c 6f 77 20 75 73 65 73 0a 09 23  op below uses..#
1090: 20 74 68 65 6d 20 74 6f 20 61 73 73 65 72 74 20   them to assert 
10a0: 74 68 65 20 63 6f 72 72 65 63 74 6e 65 73 73 20  the correctness 
10b0: 6f 66 20 74 79 70 65 20 6e 61 6d 65 73 2e 0a 09  of type names...
10c0: 70 72 6f 6a 65 63 74 3a 3a 72 65 76 20 67 65 74  project::rev get
10d0: 63 73 74 79 70 65 73 0a 0a 09 66 6f 72 65 61 63  cstypes...foreac
10e0: 68 20 7b 69 64 20 70 69 64 20 63 73 74 79 70 65  h {id pid cstype
10f0: 20 73 72 63 69 64 7d 20 5b 73 74 61 74 65 20 72   srcid} [state r
1100: 75 6e 20 7b 0a 09 20 20 20 20 53 45 4c 45 43 54  un {..    SELECT
1110: 20 43 2e 63 69 64 2c 20 43 2e 70 69 64 2c 20 43   C.cid, C.pid, C
1120: 53 2e 6e 61 6d 65 2c 20 43 2e 73 72 63 0a 09 20  S.name, C.src.. 
1130: 20 20 20 46 52 4f 4d 20 20 20 63 68 61 6e 67 65     FROM   change
1140: 73 65 74 20 43 2c 20 63 73 74 79 70 65 20 43 53  set C, cstype CS
1150: 0a 09 20 20 20 20 57 48 45 52 45 20 20 43 2e 74  ..    WHERE  C.t
1160: 79 70 65 20 3d 20 43 53 2e 74 69 64 0a 09 20 20  ype = CS.tid..  
1170: 20 20 4f 52 44 45 52 20 42 59 20 43 2e 63 69 64    ORDER BY C.cid
1180: 0a 09 7d 5d 20 7b 0a 09 20 20 20 20 73 65 74 20  ..}] {..    set 
1190: 72 20 5b 70 72 6f 6a 65 63 74 3a 3a 72 65 76 20  r [project::rev 
11a0: 25 41 55 54 4f 25 20 5b 72 65 70 6f 73 69 74 6f  %AUTO% [reposito
11b0: 72 79 20 70 72 6f 6a 65 63 74 6f 66 20 24 70 69  ry projectof $pi
11c0: 64 5d 20 24 63 73 74 79 70 65 20 24 73 72 63 69  d] $cstype $srci
11d0: 64 20 5b 73 74 61 74 65 20 72 75 6e 20 7b 0a 09  d [state run {..
11e0: 09 53 45 4c 45 43 54 20 43 2e 69 69 64 0a 09 09  .SELECT C.iid...
11f0: 46 52 4f 4d 20 20 20 63 73 69 74 65 6d 20 43 0a  FROM   csitem C.
1200: 09 09 57 48 45 52 45 20 20 43 2e 63 69 64 20 3d  ..WHERE  C.cid =
1210: 20 24 69 64 0a 09 09 4f 52 44 45 52 20 42 59 20   $id...ORDER BY 
1220: 43 2e 70 6f 73 0a 09 20 20 20 20 7d 5d 20 24 69  C.pos..    }] $i
1230: 64 5d 0a 09 7d 0a 0a 09 70 72 6f 6a 65 63 74 3a  d]..}...project:
1240: 3a 72 65 76 20 6c 6f 61 64 63 6f 75 6e 74 65 72  :rev loadcounter
1250: 0a 09 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a  ..return.    }..
1260: 20 20 20 20 74 79 70 65 6d 65 74 68 6f 64 20 72      typemethod r
1270: 75 6e 20 7b 7d 20 7b 0a 09 23 20 50 61 73 73 20  un {} {..# Pass 
1280: 6d 61 6e 61 67 65 72 20 69 6e 74 65 72 66 61 63  manager interfac
1290: 65 2e 20 45 78 65 63 75 74 65 64 20 74 6f 20 70  e. Executed to p
12a0: 65 72 66 6f 72 6d 20 74 68 65 0a 09 23 20 66 75  erform the..# fu
12b0: 6e 63 74 69 6f 6e 61 6c 69 74 79 20 6f 66 20 74  nctionality of t
12c0: 68 65 20 70 61 73 73 2e 0a 0a 09 73 74 61 74 65  he pass....state
12d0: 20 74 72 61 6e 73 61 63 74 69 6f 6e 20 7b 0a 09   transaction {..
12e0: 20 20 20 20 43 72 65 61 74 65 52 65 76 69 73 69      CreateRevisi
12f0: 6f 6e 43 68 61 6e 67 65 73 65 74 73 20 20 3b 20  onChangesets  ; 
1300: 23 20 47 72 6f 75 70 20 66 69 6c 65 20 72 65 76  # Group file rev
1310: 69 73 69 6f 6e 73 20 69 6e 74 6f 20 63 73 65 74  isions into cset
1320: 73 2e 0a 09 20 20 20 20 42 72 65 61 6b 49 6e 74  s...    BreakInt
1330: 65 72 6e 61 6c 44 65 70 65 6e 64 65 6e 63 69 65  ernalDependencie
1340: 73 20 3b 20 23 20 53 70 6c 69 74 20 74 68 65 20  s ; # Split the 
1350: 63 73 65 74 73 20 62 61 73 65 64 20 6f 6e 20 69  csets based on i
1360: 6e 74 65 72 6e 61 6c 20 63 6f 6e 66 6c 69 63 74  nternal conflict
1370: 73 2e 0a 09 20 20 20 20 43 72 65 61 74 65 53 79  s...    CreateSy
1380: 6d 62 6f 6c 43 68 61 6e 67 65 73 65 74 73 20 20  mbolChangesets  
1390: 20 20 3b 20 23 20 43 72 65 61 74 65 20 63 73 65    ; # Create cse
13a0: 74 73 20 66 6f 72 20 74 61 67 73 20 61 6e 64 20  ts for tags and 
13b0: 62 72 61 6e 63 68 65 73 2e 0a 09 20 20 20 20 50  branches...    P
13c0: 65 72 73 69 73 74 54 68 65 43 68 61 6e 67 65 73  ersistTheChanges
13d0: 65 74 73 0a 09 7d 0a 0a 09 72 65 70 6f 73 69 74  ets..}...reposit
13e0: 6f 72 79 20 70 72 69 6e 74 63 73 65 74 73 74 61  ory printcsetsta
13f0: 74 69 73 74 69 63 73 0a 09 69 6e 74 65 67 72 69  tistics..integri
1400: 74 79 20 63 68 61 6e 67 65 73 65 74 73 0a 09 72  ty changesets..r
1410: 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 20  eturn.    }..   
1420: 20 74 79 70 65 6d 65 74 68 6f 64 20 64 69 73 63   typemethod disc
1430: 61 72 64 20 7b 7d 20 7b 0a 09 23 20 50 61 73 73  ard {} {..# Pass
1440: 20 6d 61 6e 61 67 65 72 20 69 6e 74 65 72 66 61   manager interfa
1450: 63 65 2e 20 45 78 65 63 75 74 65 64 20 66 6f 72  ce. Executed for
1460: 20 61 6c 6c 20 70 61 73 73 65 73 20 61 66 74 65   all passes afte
1470: 72 20 74 68 65 0a 09 23 20 72 75 6e 20 70 61 73  r the..# run pas
1480: 73 65 73 2c 20 74 6f 20 72 65 6d 6f 76 65 20 61  ses, to remove a
1490: 6c 6c 20 64 61 74 61 20 6f 66 20 74 68 69 73 20  ll data of this 
14a0: 70 61 73 73 20 66 72 6f 6d 20 74 68 65 20 73 74  pass from the st
14b0: 61 74 65 2c 0a 09 23 20 61 73 20 62 65 69 6e 67  ate,..# as being
14c0: 20 6f 75 74 20 6f 66 20 64 61 74 65 2e 0a 0a 09   out of date....
14d0: 73 74 61 74 65 20 64 69 73 63 61 72 64 20 63 68  state discard ch
14e0: 61 6e 67 65 73 65 74 0a 09 73 74 61 74 65 20 64  angeset..state d
14f0: 69 73 63 61 72 64 20 63 73 74 79 70 65 0a 09 73  iscard cstype..s
1500: 74 61 74 65 20 64 69 73 63 61 72 64 20 63 73 69  tate discard csi
1510: 74 65 6d 0a 09 72 65 74 75 72 6e 0a 20 20 20 20  tem..return.    
1520: 7d 0a 0a 20 20 20 20 23 20 23 20 23 23 20 23 23  }..    # # ## ##
1530: 23 20 23 23 23 23 23 20 23 23 23 23 23 23 23 23  # ##### ########
1540: 20 23 23 23 23 23 23 23 23 23 23 23 23 23 0a 20   #############. 
1550: 20 20 20 23 23 20 49 6e 74 65 72 6e 61 6c 20 6d     ## Internal m
1560: 65 74 68 6f 64 73 0a 0a 20 20 20 20 70 72 6f 63  ethods..    proc
1570: 20 43 72 65 61 74 65 52 65 76 69 73 69 6f 6e 43   CreateRevisionC
1580: 68 61 6e 67 65 73 65 74 73 20 7b 7d 20 7b 0a 09  hangesets {} {..
1590: 6c 6f 67 20 77 72 69 74 65 20 33 20 69 6e 69 74  log write 3 init
15a0: 63 73 65 74 73 20 7b 43 72 65 61 74 65 20 63 68  csets {Create ch
15b0: 61 6e 67 65 73 65 74 73 20 62 61 73 65 64 20 6f  angesets based o
15c0: 6e 20 72 65 76 69 73 69 6f 6e 73 7d 0a 0a 09 23  n revisions}...#
15d0: 20 54 6f 20 67 65 74 20 74 68 65 20 69 6e 69 74   To get the init
15e0: 69 61 6c 20 6f 66 20 63 68 61 6e 67 65 73 65 74  ial of changeset
15f0: 73 20 77 65 20 66 69 72 73 74 20 67 72 6f 75 70  s we first group
1600: 20 61 6c 6c 20 66 69 6c 65 0a 09 23 20 6c 65 76   all file..# lev
1610: 65 6c 20 72 65 76 69 73 69 6f 6e 73 20 75 73 69  el revisions usi
1620: 6e 67 20 74 68 65 20 73 61 6d 65 20 6d 65 74 61  ng the same meta
1630: 20 64 61 74 61 20 65 6e 74 72 79 20 74 6f 67 65   data entry toge
1640: 74 68 65 72 2e 20 41 73 0a 09 23 20 74 68 65 20  ther. As..# the 
1650: 6d 65 74 61 20 64 61 74 61 20 65 6e 63 6f 64 65  meta data encode
1660: 73 20 6e 6f 74 20 6f 6e 6c 79 20 61 75 74 68 6f  s not only autho
1670: 72 20 61 6e 64 20 6c 6f 67 20 6d 65 73 73 61 67  r and log messag
1680: 65 2c 20 62 75 74 0a 09 23 20 61 6c 73 6f 20 6c  e, but..# also l
1690: 69 6e 65 20 6f 66 20 64 65 76 65 6c 6f 70 6d 65  ine of developme
16a0: 6e 74 20 61 6e 64 20 70 72 6f 6a 65 63 74 20 77  nt and project w
16b0: 65 20 63 61 6e 20 62 65 20 73 75 72 65 20 74 68  e can be sure th
16c0: 61 74 0a 09 23 20 72 65 76 69 73 69 6f 6e 73 20  at..# revisions 
16d0: 69 6e 20 64 69 66 66 65 72 65 6e 74 20 70 72 6f  in different pro
16e0: 6a 65 63 74 20 61 6e 64 20 6c 69 6e 65 73 20 6f  ject and lines o
16f0: 66 20 64 65 76 65 6c 6f 70 6d 65 6e 74 20 61 72  f development ar
1700: 65 0a 09 23 20 6e 6f 74 20 67 72 6f 75 70 65 64  e..# not grouped
1710: 20 74 6f 67 65 74 68 65 72 2e 20 49 6e 20 63 6f   together. In co
1720: 6e 74 72 61 73 74 20 74 6f 20 63 76 73 32 73 76  ntrast to cvs2sv
1730: 6e 20 77 65 20 64 6f 20 5f 5f 6e 6f 74 5f 5f 0a  n we do __not__.
1740: 09 23 20 75 73 65 20 64 69 73 74 61 6e 63 65 20  .# use distance 
1750: 69 6e 20 74 69 6d 65 20 62 65 74 77 65 65 6e 20  in time between 
1760: 72 65 76 69 73 69 6f 6e 73 20 74 6f 20 62 72 65  revisions to bre
1770: 61 6b 20 74 68 65 6d 0a 09 23 20 61 70 61 72 74  ak them..# apart
1780: 2e 20 57 65 20 68 61 76 65 20 73 65 65 6e 20 43  . We have seen C
1790: 56 53 20 72 65 70 6f 73 69 74 6f 72 69 65 73 20  VS repositories 
17a0: 28 66 72 6f 6d 20 53 46 29 20 77 68 65 72 65 20  (from SF) where 
17b0: 61 0a 09 23 20 73 69 6e 67 6c 65 20 63 6f 6d 6d  a..# single comm
17c0: 69 74 20 63 6f 6e 74 61 69 6e 65 64 20 72 65 76  it contained rev
17d0: 69 73 69 6f 6e 73 20 73 65 76 65 72 61 6c 20 68  isions several h
17e0: 6f 75 72 73 20 61 70 61 72 74 2c 0a 09 23 20 6c  ours apart,..# l
17f0: 69 6b 65 6c 79 20 64 75 65 20 74 6f 20 74 72 6f  ikely due to tro
1800: 75 62 6c 65 20 6f 6e 20 74 68 65 20 73 65 72 76  uble on the serv
1810: 65 72 20 68 6f 73 74 69 6e 67 20 74 68 65 20 72  er hosting the r
1820: 65 70 6f 73 69 74 6f 72 79 2e 0a 0a 09 23 20 57  epository....# W
1830: 65 20 6f 72 64 65 72 20 74 68 65 20 72 65 76 69  e order the revi
1840: 73 69 6f 6e 73 20 68 65 72 65 20 62 79 20 74 69  sions here by ti
1850: 6d 65 2c 20 74 68 69 73 20 77 69 6c 6c 20 68 65  me, this will he
1860: 6c 70 20 74 68 65 0a 09 23 20 6c 61 74 65 72 20  lp the..# later 
1870: 70 61 73 73 65 73 20 28 61 76 6f 69 64 73 20 6a  passes (avoids j
1880: 6f 69 6e 73 20 6c 61 74 65 72 20 74 6f 20 67 65  oins later to ge
1890: 74 20 61 74 20 74 68 65 20 6f 72 64 65 72 69 6e  t at the orderin
18a0: 67 0a 09 23 20 69 6e 66 6f 29 2e 0a 0a 09 73 65  g..# info)....se
18b0: 74 20 6e 20 30 0a 0a 09 73 65 74 20 6c 61 73 74  t n 0...set last
18c0: 6d 65 74 61 20 20 20 20 7b 7d 0a 09 73 65 74 20  meta    {}..set 
18d0: 6c 61 73 74 70 72 6f 6a 65 63 74 20 7b 7d 0a 09  lastproject {}..
18e0: 73 65 74 20 72 65 76 69 73 69 6f 6e 73 20 20 20  set revisions   
18f0: 7b 7d 0a 0a 09 23 20 4e 6f 74 65 3a 20 57 65 20  {}...# Note: We 
1900: 63 6f 75 6c 64 20 68 61 76 65 20 77 72 69 74 74  could have writt
1910: 65 6e 20 74 68 69 73 20 6c 6f 6f 70 20 74 6f 20  en this loop to 
1920: 63 72 65 61 74 65 20 74 68 65 20 63 73 65 74 73  create the csets
1930: 0a 09 23 20 20 20 20 20 20 20 65 61 72 6c 79 2c  ..#       early,
1940: 20 65 78 74 65 6e 64 69 6e 67 20 74 68 65 6d 20   extending them 
1950: 77 69 74 68 20 61 6c 6c 20 74 68 65 69 72 20 72  with all their r
1960: 65 76 69 73 69 6f 6e 73 2e 20 54 68 69 73 0a 09  evisions. This..
1970: 23 20 20 20 20 20 20 20 68 6f 77 65 76 65 72 20  #       however 
1980: 77 6f 75 6c 64 20 6d 65 61 6e 20 6c 6f 74 73 20  would mean lots 
1990: 6f 66 20 28 73 6c 6f 77 29 20 6d 65 74 68 6f 64  of (slow) method
19a0: 20 69 6e 76 6f 6b 61 74 69 6f 6e 73 0a 09 23 20   invokations..# 
19b0: 20 20 20 20 20 20 6f 6e 20 74 68 65 20 63 73 65        on the cse
19c0: 74 73 2e 20 44 6f 69 6e 67 20 69 74 20 6c 69 6b  ts. Doing it lik
19d0: 65 20 74 68 69 73 2c 20 6c 61 74 65 20 63 72 65  e this, late cre
19e0: 61 74 69 6f 6e 2c 20 6d 65 61 6e 73 0a 09 23 20  ation, means..# 
19f0: 20 20 20 20 20 20 6c 65 73 73 20 73 75 63 68 20        less such 
1a00: 63 61 6c 6c 73 2e 20 4e 6f 6e 65 2c 20 62 75 74  calls. None, but
1a10: 20 74 68 65 20 63 72 65 61 74 69 6f 6e 20 69 74   the creation it
1a20: 73 65 6c 66 2e 0a 0a 09 66 6f 72 65 61 63 68 20  self....foreach 
1a30: 7b 6d 69 64 20 72 69 64 20 70 69 64 7d 20 5b 73  {mid rid pid} [s
1a40: 74 61 74 65 20 72 75 6e 20 7b 0a 09 20 20 20 20  tate run {..    
1a50: 53 45 4c 45 43 54 20 4d 2e 6d 69 64 2c 20 52 2e  SELECT M.mid, R.
1a60: 72 69 64 2c 20 4d 2e 70 69 64 0a 09 20 20 20 20  rid, M.pid..    
1a70: 46 52 4f 4d 20 20 20 72 65 76 69 73 69 6f 6e 20  FROM   revision 
1a80: 52 2c 20 6d 65 74 61 20 4d 20 20 20 2d 2d 20 52  R, meta M   -- R
1a90: 20 3d 3d 3e 20 4d 2c 20 75 73 69 6e 67 20 50 4b   ==> M, using PK
1aa0: 20 69 6e 64 65 78 20 6f 66 20 4d 2e 0a 09 20 20   index of M...  
1ab0: 20 20 57 48 45 52 45 20 20 52 2e 6d 69 64 20 3d    WHERE  R.mid =
1ac0: 20 4d 2e 6d 69 64 0a 09 20 20 20 20 4f 52 44 45   M.mid..    ORDE
1ad0: 52 20 20 42 59 20 4d 2e 6d 69 64 2c 20 52 2e 64  R  BY M.mid, R.d
1ae0: 61 74 65 0a 09 7d 5d 20 7b 0a 09 20 20 20 20 69  ate..}] {..    i
1af0: 66 20 7b 24 6c 61 73 74 6d 65 74 61 20 21 3d 20  f {$lastmeta != 
1b00: 24 6d 69 64 7d 20 7b 0a 09 09 69 66 20 7b 5b 6c  $mid} {...if {[l
1b10: 6c 65 6e 67 74 68 20 24 72 65 76 69 73 69 6f 6e  length $revision
1b20: 73 5d 7d 20 7b 0a 09 09 20 20 20 20 69 6e 63 72  s]} {...    incr
1b30: 20 6e 0a 09 09 20 20 20 20 73 65 74 20 20 70 20   n...    set  p 
1b40: 5b 72 65 70 6f 73 69 74 6f 72 79 20 70 72 6f 6a  [repository proj
1b50: 65 63 74 6f 66 20 24 6c 61 73 74 70 72 6f 6a 65  ectof $lastproje
1b60: 63 74 5d 0a 09 09 20 20 20 20 70 72 6f 6a 65 63  ct]...    projec
1b70: 74 3a 3a 72 65 76 20 25 41 55 54 4f 25 20 24 70  t::rev %AUTO% $p
1b80: 20 72 65 76 20 24 6c 61 73 74 6d 65 74 61 20 24   rev $lastmeta $
1b90: 72 65 76 69 73 69 6f 6e 73 0a 09 09 20 20 20 20  revisions...    
1ba0: 73 65 74 20 72 65 76 69 73 69 6f 6e 73 20 7b 7d  set revisions {}
1bb0: 0a 09 09 7d 0a 09 09 73 65 74 20 6c 61 73 74 6d  ...}...set lastm
1bc0: 65 74 61 20 20 20 20 24 6d 69 64 0a 09 09 73 65  eta    $mid...se
1bd0: 74 20 6c 61 73 74 70 72 6f 6a 65 63 74 20 24 70  t lastproject $p
1be0: 69 64 0a 09 20 20 20 20 7d 0a 09 20 20 20 20 6c  id..    }..    l
1bf0: 61 70 70 65 6e 64 20 72 65 76 69 73 69 6f 6e 73  append revisions
1c00: 20 24 72 69 64 0a 09 7d 0a 0a 09 69 66 20 7b 5b   $rid..}...if {[
1c10: 6c 6c 65 6e 67 74 68 20 24 72 65 76 69 73 69 6f  llength $revisio
1c20: 6e 73 5d 7d 20 7b 0a 09 20 20 20 20 69 6e 63 72  ns]} {..    incr
1c30: 20 6e 0a 09 20 20 20 20 73 65 74 20 20 70 20 5b   n..    set  p [
1c40: 72 65 70 6f 73 69 74 6f 72 79 20 70 72 6f 6a 65  repository proje
1c50: 63 74 6f 66 20 24 6c 61 73 74 70 72 6f 6a 65 63  ctof $lastprojec
1c60: 74 5d 0a 09 20 20 20 20 70 72 6f 6a 65 63 74 3a  t]..    project:
1c70: 3a 72 65 76 20 25 41 55 54 4f 25 20 24 70 20 72  :rev %AUTO% $p r
1c80: 65 76 20 24 6c 61 73 74 6d 65 74 61 20 24 72 65  ev $lastmeta $re
1c90: 76 69 73 69 6f 6e 73 0a 09 7d 0a 0a 09 6c 6f 67  visions..}...log
1ca0: 20 77 72 69 74 65 20 34 20 69 6e 69 74 63 73 65   write 4 initcse
1cb0: 74 73 20 22 43 72 65 61 74 65 64 20 5b 6e 73 70  ts "Created [nsp
1cc0: 20 24 6e 20 7b 72 65 76 69 73 69 6f 6e 20 63 68   $n {revision ch
1cd0: 61 6e 67 65 73 65 74 7d 5d 22 0a 09 72 65 74 75  angeset}]"..retu
1ce0: 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 20 20 70 72  rn.    }..    pr
1cf0: 6f 63 20 43 72 65 61 74 65 53 79 6d 62 6f 6c 43  oc CreateSymbolC
1d00: 68 61 6e 67 65 73 65 74 73 20 7b 7d 20 7b 0a 09  hangesets {} {..
1d10: 6c 6f 67 20 77 72 69 74 65 20 33 20 69 6e 69 74  log write 3 init
1d20: 63 73 65 74 73 20 7b 43 72 65 61 74 65 20 63 68  csets {Create ch
1d30: 61 6e 67 65 73 65 74 73 20 62 61 73 65 64 20 6f  angesets based o
1d40: 6e 20 73 79 6d 62 6f 6c 73 7d 0a 0a 09 23 20 54  n symbols}...# T
1d50: 61 67 73 20 61 6e 64 20 62 72 61 6e 63 68 65 73  ags and branches
1d60: 20 69 6e 64 75 63 65 20 63 68 61 6e 67 65 73 65   induce changese
1d70: 74 73 20 61 73 20 77 65 6c 6c 2c 20 63 6f 6e 74  ts as well, cont
1d80: 61 69 6e 69 6e 67 20 74 68 65 0a 09 23 20 72 65  aining the..# re
1d90: 76 69 73 69 6f 6e 73 20 74 68 65 79 20 61 72 65  visions they are
1da0: 20 61 74 74 61 63 68 65 64 20 74 6f 20 28 74 61   attached to (ta
1db0: 67 73 29 2c 20 6f 72 20 73 70 61 77 6e 65 64 20  gs), or spawned 
1dc0: 66 72 6f 6d 0a 09 23 20 28 62 72 61 6e 63 68 65  from..# (branche
1dd0: 73 29 2e 0a 0a 09 73 65 74 20 6e 20 30 0a 0a 09  s)....set n 0...
1de0: 23 20 46 69 72 73 74 20 70 72 6f 63 65 73 73 20  # First process 
1df0: 74 68 65 20 74 61 67 73 2c 20 74 68 65 6e 20 74  the tags, then t
1e00: 68 65 20 62 72 61 6e 63 68 65 73 2e 20 57 65 20  he branches. We 
1e10: 6b 6e 6f 77 20 74 68 61 74 0a 09 23 20 74 68 65  know that..# the
1e20: 69 72 20 69 64 73 20 64 6f 20 6e 6f 74 20 6f 76  ir ids do not ov
1e30: 65 72 6c 61 70 20 77 69 74 68 20 65 61 63 68 20  erlap with each 
1e40: 6f 74 68 65 72 2e 0a 0a 09 73 65 74 20 6c 61 73  other....set las
1e50: 74 73 79 6d 62 6f 6c 20 20 7b 7d 0a 09 73 65 74  tsymbol  {}..set
1e60: 20 6c 61 73 74 70 72 6f 6a 65 63 74 20 7b 7d 0a   lastproject {}.
1e70: 09 73 65 74 20 74 61 67 73 20 20 20 20 20 20 20  .set tags       
1e80: 20 7b 7d 0a 0a 09 66 6f 72 65 61 63 68 20 7b 73   {}...foreach {s
1e90: 69 64 20 74 69 64 20 70 69 64 7d 20 5b 73 74 61  id tid pid} [sta
1ea0: 74 65 20 72 75 6e 20 7b 0a 09 20 20 20 20 53 45  te run {..    SE
1eb0: 4c 45 43 54 20 53 2e 73 69 64 2c 20 54 2e 74 69  LECT S.sid, T.ti
1ec0: 64 2c 20 53 2e 70 69 64 0a 09 20 20 20 20 46 52  d, S.pid..    FR
1ed0: 4f 4d 20 20 74 61 67 20 54 2c 20 73 79 6d 62 6f  OM  tag T, symbo
1ee0: 6c 20 53 20 20 20 20 20 2d 2d 20 54 20 3d 3d 3e  l S     -- T ==>
1ef0: 20 52 2f 53 2c 20 75 73 69 6e 67 20 50 4b 20 69   R/S, using PK i
1f00: 6e 64 69 63 65 73 20 6f 66 20 52 2c 20 53 2e 0a  ndices of R, S..
1f10: 09 20 20 20 20 57 48 45 52 45 20 54 2e 73 69 64  .    WHERE T.sid
1f20: 20 3d 20 53 2e 73 69 64 0a 09 20 20 20 20 4f 52   = S.sid..    OR
1f30: 44 45 52 20 42 59 20 53 2e 73 69 64 2c 20 54 2e  DER BY S.sid, T.
1f40: 74 69 64 0a 09 7d 5d 20 7b 0a 09 20 20 20 20 69  tid..}] {..    i
1f50: 66 20 7b 24 6c 61 73 74 73 79 6d 62 6f 6c 20 21  f {$lastsymbol !
1f60: 3d 20 24 73 69 64 7d 20 7b 0a 09 09 69 66 20 7b  = $sid} {...if {
1f70: 5b 6c 6c 65 6e 67 74 68 20 24 74 61 67 73 5d 7d  [llength $tags]}
1f80: 20 7b 0a 09 09 20 20 20 20 69 6e 63 72 20 6e 0a   {...    incr n.
1f90: 09 09 20 20 20 20 73 65 74 20 20 70 20 5b 72 65  ..    set  p [re
1fa0: 70 6f 73 69 74 6f 72 79 20 70 72 6f 6a 65 63 74  pository project
1fb0: 6f 66 20 24 6c 61 73 74 70 72 6f 6a 65 63 74 5d  of $lastproject]
1fc0: 0a 09 09 20 20 20 20 70 72 6f 6a 65 63 74 3a 3a  ...    project::
1fd0: 72 65 76 20 25 41 55 54 4f 25 20 24 70 20 73 79  rev %AUTO% $p sy
1fe0: 6d 3a 3a 74 61 67 20 24 6c 61 73 74 73 79 6d 62  m::tag $lastsymb
1ff0: 6f 6c 20 24 74 61 67 73 0a 09 09 20 20 20 20 73  ol $tags...    s
2000: 65 74 20 74 61 67 73 20 7b 7d 0a 09 09 7d 0a 09  et tags {}...}..
2010: 09 73 65 74 20 6c 61 73 74 73 79 6d 62 6f 6c 20  .set lastsymbol 
2020: 20 24 73 69 64 0a 09 09 73 65 74 20 6c 61 73 74   $sid...set last
2030: 70 72 6f 6a 65 63 74 20 24 70 69 64 0a 09 20 20  project $pid..  
2040: 20 20 7d 0a 09 20 20 20 20 6c 61 70 70 65 6e 64    }..    lappend
2050: 20 74 61 67 73 20 24 74 69 64 0a 09 7d 0a 0a 09   tags $tid..}...
2060: 69 66 20 7b 5b 6c 6c 65 6e 67 74 68 20 24 74 61  if {[llength $ta
2070: 67 73 5d 7d 20 7b 0a 09 20 20 20 20 69 6e 63 72  gs]} {..    incr
2080: 20 6e 0a 09 20 20 20 20 73 65 74 20 20 70 20 5b   n..    set  p [
2090: 72 65 70 6f 73 69 74 6f 72 79 20 70 72 6f 6a 65  repository proje
20a0: 63 74 6f 66 20 24 6c 61 73 74 70 72 6f 6a 65 63  ctof $lastprojec
20b0: 74 5d 0a 09 20 20 20 20 70 72 6f 6a 65 63 74 3a  t]..    project:
20c0: 3a 72 65 76 20 25 41 55 54 4f 25 20 24 70 20 73  :rev %AUTO% $p s
20d0: 79 6d 3a 3a 74 61 67 20 24 6c 61 73 74 73 79 6d  ym::tag $lastsym
20e0: 62 6f 6c 20 24 74 61 67 73 0a 09 7d 0a 0a 09 73  bol $tags..}...s
20f0: 65 74 20 6c 61 73 74 73 79 6d 62 6f 6c 20 7b 7d  et lastsymbol {}
2100: 0a 09 73 65 74 20 6c 61 73 70 72 6f 6a 65 63 74  ..set lasproject
2110: 20 7b 7d 0a 09 73 65 74 20 62 72 61 6e 63 68 65   {}..set branche
2120: 73 20 20 20 7b 7d 0a 0a 09 66 6f 72 65 61 63 68  s   {}...foreach
2130: 20 7b 73 69 64 20 62 69 64 20 70 69 64 7d 20 5b   {sid bid pid} [
2140: 73 74 61 74 65 20 72 75 6e 20 7b 0a 09 20 20 20  state run {..   
2150: 20 53 45 4c 45 43 54 20 53 2e 73 69 64 2c 20 42   SELECT S.sid, B
2160: 2e 62 69 64 2c 20 53 2e 70 69 64 0a 09 20 20 20  .bid, S.pid..   
2170: 20 46 52 4f 4d 20 20 62 72 61 6e 63 68 20 42 2c   FROM  branch B,
2180: 20 73 79 6d 62 6f 6c 20 53 20 20 2d 2d 20 42 20   symbol S  -- B 
2190: 3d 3d 3e 20 52 2f 53 2c 20 75 73 69 6e 67 20 50  ==> R/S, using P
21a0: 4b 20 69 6e 64 69 63 65 73 20 6f 66 20 52 2c 20  K indices of R, 
21b0: 53 2e 0a 09 20 20 20 20 57 48 45 52 45 20 42 2e  S...    WHERE B.
21c0: 73 69 64 20 20 3d 20 53 2e 73 69 64 0a 09 20 20  sid  = S.sid..  
21d0: 20 20 4f 52 44 45 52 20 42 59 20 53 2e 73 69 64    ORDER BY S.sid
21e0: 2c 20 42 2e 62 69 64 0a 09 7d 5d 20 7b 0a 09 20  , B.bid..}] {.. 
21f0: 20 20 20 69 66 20 7b 24 6c 61 73 74 73 79 6d 62     if {$lastsymb
2200: 6f 6c 20 21 3d 20 24 73 69 64 7d 20 7b 0a 09 09  ol != $sid} {...
2210: 69 66 20 7b 5b 6c 6c 65 6e 67 74 68 20 24 62 72  if {[llength $br
2220: 61 6e 63 68 65 73 5d 7d 20 7b 0a 09 09 20 20 20  anches]} {...   
2230: 20 69 6e 63 72 20 6e 0a 09 09 20 20 20 20 73 65   incr n...    se
2240: 74 20 20 70 20 5b 72 65 70 6f 73 69 74 6f 72 79  t  p [repository
2250: 20 70 72 6f 6a 65 63 74 6f 66 20 24 6c 61 73 74   projectof $last
2260: 70 72 6f 6a 65 63 74 5d 0a 09 09 20 20 20 20 70  project]...    p
2270: 72 6f 6a 65 63 74 3a 3a 72 65 76 20 25 41 55 54  roject::rev %AUT
2280: 4f 25 20 24 70 20 73 79 6d 3a 3a 62 72 61 6e 63  O% $p sym::branc
2290: 68 20 24 6c 61 73 74 73 79 6d 62 6f 6c 20 24 62  h $lastsymbol $b
22a0: 72 61 6e 63 68 65 73 0a 09 09 20 20 20 20 73 65  ranches...    se
22b0: 74 20 62 72 61 6e 63 68 65 73 20 7b 7d 0a 09 09  t branches {}...
22c0: 7d 0a 09 09 73 65 74 20 6c 61 73 74 73 79 6d 62  }...set lastsymb
22d0: 6f 6c 20 20 24 73 69 64 0a 09 09 73 65 74 20 6c  ol  $sid...set l
22e0: 61 73 74 70 72 6f 6a 65 63 74 20 24 70 69 64 0a  astproject $pid.
22f0: 09 20 20 20 20 7d 0a 09 20 20 20 20 6c 61 70 70  .    }..    lapp
2300: 65 6e 64 20 62 72 61 6e 63 68 65 73 20 24 62 69  end branches $bi
2310: 64 0a 09 7d 0a 0a 09 69 66 20 7b 5b 6c 6c 65 6e  d..}...if {[llen
2320: 67 74 68 20 24 62 72 61 6e 63 68 65 73 5d 7d 20  gth $branches]} 
2330: 7b 0a 09 20 20 20 20 69 6e 63 72 20 6e 0a 09 20  {..    incr n.. 
2340: 20 20 20 73 65 74 20 20 70 20 5b 72 65 70 6f 73     set  p [repos
2350: 69 74 6f 72 79 20 70 72 6f 6a 65 63 74 6f 66 20  itory projectof 
2360: 24 6c 61 73 74 70 72 6f 6a 65 63 74 5d 0a 09 20  $lastproject].. 
2370: 20 20 20 70 72 6f 6a 65 63 74 3a 3a 72 65 76 20     project::rev 
2380: 25 41 55 54 4f 25 20 24 70 20 73 79 6d 3a 3a 62  %AUTO% $p sym::b
2390: 72 61 6e 63 68 20 24 6c 61 73 74 73 79 6d 62 6f  ranch $lastsymbo
23a0: 6c 20 24 62 72 61 6e 63 68 65 73 0a 09 7d 0a 0a  l $branches..}..
23b0: 09 6c 6f 67 20 77 72 69 74 65 20 34 20 69 6e 69  .log write 4 ini
23c0: 74 63 73 65 74 73 20 22 43 72 65 61 74 65 64 20  tcsets "Created 
23d0: 5b 6e 73 70 20 24 6e 20 7b 73 79 6d 62 6f 6c 20  [nsp $n {symbol 
23e0: 63 68 61 6e 67 65 73 65 74 7d 5d 22 0a 09 72 65  changeset}]"..re
23f0: 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 20 20  turn.    }..    
2400: 70 72 6f 63 20 42 72 65 61 6b 49 6e 74 65 72 6e  proc BreakIntern
2410: 61 6c 44 65 70 65 6e 64 65 6e 63 69 65 73 20 7b  alDependencies {
2420: 7d 20 7b 0a 09 23 20 54 68 69 73 20 63 6f 64 65  } {..# This code
2430: 20 6f 70 65 72 61 74 65 73 20 6f 6e 20 74 68 65   operates on the
2440: 20 72 65 76 69 73 69 6f 6e 20 63 68 61 6e 67 65   revision change
2450: 73 65 74 73 20 63 72 65 61 74 65 64 20 62 79 0a  sets created by.
2460: 09 23 20 27 43 72 65 61 74 65 52 65 76 69 73 69  .# 'CreateRevisi
2470: 6f 6e 43 68 61 6e 67 65 73 65 74 73 27 2e 20 41  onChangesets'. A
2480: 73 20 73 75 63 68 20 69 74 20 68 61 73 20 74 6f  s such it has to
2490: 20 66 6f 6c 6c 6f 77 20 61 66 74 65 72 0a 09 23   follow after..#
24a0: 20 69 74 2c 20 62 65 66 6f 72 65 20 74 68 65 20   it, before the 
24b0: 73 79 6d 62 6f 6c 20 63 68 61 6e 67 65 73 65 74  symbol changeset
24c0: 73 20 61 72 65 20 6d 61 64 65 2e 20 54 68 65 20  s are made. The 
24d0: 63 68 61 6e 67 65 73 65 74 73 0a 09 23 20 61 72  changesets..# ar
24e0: 65 20 69 6e 73 70 65 63 74 65 64 20 66 6f 72 20  e inspected for 
24f0: 69 6e 74 65 72 6e 61 6c 20 63 6f 6e 66 6c 69 63  internal conflic
2500: 74 73 20 61 6e 64 20 61 6e 79 20 73 75 63 68 20  ts and any such 
2510: 61 72 65 20 62 72 6f 6b 65 6e 0a 09 23 20 62 79  are broken..# by
2520: 20 73 70 6c 69 74 74 69 6e 67 20 74 68 65 20 70   splitting the p
2530: 72 6f 62 6c 65 6d 61 74 69 63 20 63 68 61 6e 67  roblematic chang
2540: 65 73 65 74 20 69 6e 74 6f 20 6d 75 6c 74 69 70  eset into multip
2550: 6c 65 0a 09 23 20 66 72 61 67 6d 65 6e 74 73 2e  le..# fragments.
2560: 20 54 68 65 20 72 65 73 75 6c 74 73 20 61 72 65   The results are
2570: 20 63 68 61 6e 67 65 73 65 74 73 20 77 68 69 63   changesets whic
2580: 68 20 68 61 76 65 20 6e 6f 20 69 6e 74 65 72 6e  h have no intern
2590: 61 6c 0a 09 23 20 64 65 70 65 6e 64 65 6e 63 69  al..# dependenci
25a0: 65 73 2c 20 6f 6e 6c 79 20 65 78 74 65 72 6e 61  es, only externa
25b0: 6c 20 6f 6e 65 73 2e 0a 0a 09 6c 6f 67 20 77 72  l ones....log wr
25c0: 69 74 65 20 33 20 69 6e 69 74 63 73 65 74 73 20  ite 3 initcsets 
25d0: 7b 42 72 65 61 6b 20 69 6e 74 65 72 6e 61 6c 20  {Break internal 
25e0: 64 65 70 65 6e 64 65 6e 63 69 65 73 7d 0a 09 73  dependencies}..s
25f0: 65 74 20 6f 6c 64 20 5b 6c 6c 65 6e 67 74 68 20  et old [llength 
2600: 5b 70 72 6f 6a 65 63 74 3a 3a 72 65 76 20 61 6c  [project::rev al
2610: 6c 5d 5d 0a 0a 09 66 6f 72 65 61 63 68 20 63 73  l]]...foreach cs
2620: 65 74 20 5b 70 72 6f 6a 65 63 74 3a 3a 72 65 76  et [project::rev
2630: 20 61 6c 6c 5d 20 7b 0a 09 20 20 20 20 24 63 73   all] {..    $cs
2640: 65 74 20 62 72 65 61 6b 69 6e 74 65 72 6e 61 6c  et breakinternal
2650: 64 65 70 65 6e 64 65 6e 63 69 65 73 0a 09 7d 0a  dependencies..}.
2660: 0a 09 73 65 74 20 6e 20 5b 65 78 70 72 20 7b 5b  ..set n [expr {[
2670: 6c 6c 65 6e 67 74 68 20 5b 70 72 6f 6a 65 63 74  llength [project
2680: 3a 3a 72 65 76 20 61 6c 6c 5d 5d 20 2d 20 24 6f  ::rev all]] - $o
2690: 6c 64 7d 5d 0a 09 6c 6f 67 20 77 72 69 74 65 20  ld}]..log write 
26a0: 34 20 69 6e 69 74 63 73 65 74 73 20 22 43 72 65  4 initcsets "Cre
26b0: 61 74 65 64 20 5b 6e 73 70 20 24 6e 20 7b 61 64  ated [nsp $n {ad
26c0: 64 69 74 69 6f 6e 61 6c 20 72 65 76 69 73 69 6f  ditional revisio
26d0: 6e 20 63 68 61 6e 67 65 73 65 74 7d 5d 22 0a 09  n changeset}]"..
26e0: 6c 6f 67 20 77 72 69 74 65 20 34 20 69 6e 69 74  log write 4 init
26f0: 63 73 65 74 73 20 4f 6b 2e 0a 09 72 65 74 75 72  csets Ok...retur
2700: 6e 0a 20 20 20 20 7d 0a 0a 20 20 20 20 70 72 6f  n.    }..    pro
2710: 63 20 50 65 72 73 69 73 74 54 68 65 43 68 61 6e  c PersistTheChan
2720: 67 65 73 65 74 73 20 7b 7d 20 7b 0a 09 6c 6f 67  gesets {} {..log
2730: 20 77 72 69 74 65 20 33 20 69 6e 69 74 63 73 65   write 3 initcse
2740: 74 73 20 22 53 61 76 69 6e 67 20 5b 6e 73 70 20  ts "Saving [nsp 
2750: 5b 6c 6c 65 6e 67 74 68 20 5b 70 72 6f 6a 65 63  [llength [projec
2760: 74 3a 3a 72 65 76 20 61 6c 6c 5d 5d 20 7b 69 6e  t::rev all]] {in
2770: 69 74 69 61 6c 20 63 68 61 6e 67 65 73 65 74 7d  itial changeset}
2780: 5d 20 74 6f 20 74 68 65 20 70 65 72 73 69 73 74  ] to the persist
2790: 65 6e 74 20 73 74 61 74 65 22 0a 0a 09 66 6f 72  ent state"...for
27a0: 65 61 63 68 20 63 73 65 74 20 5b 70 72 6f 6a 65  each cset [proje
27b0: 63 74 3a 3a 72 65 76 20 61 6c 6c 5d 20 7b 0a 09  ct::rev all] {..
27c0: 20 20 20 20 24 63 73 65 74 20 70 65 72 73 69 73      $cset persis
27d0: 74 0a 09 7d 0a 0a 09 6c 6f 67 20 77 72 69 74 65  t..}...log write
27e0: 20 34 20 69 6e 69 74 63 73 65 74 73 20 4f 6b 2e   4 initcsets Ok.
27f0: 0a 09 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a  ..return.    }..
2800: 20 20 20 20 23 20 23 20 23 23 20 23 23 23 20 23      # # ## ### #
2810: 23 23 23 23 20 23 23 23 23 23 23 23 23 20 23 23  #### ######## ##
2820: 23 23 23 23 23 23 23 23 23 23 23 0a 20 20 20 20  ###########.    
2830: 23 23 20 43 6f 6e 66 69 67 75 72 61 74 69 6f 6e  ## Configuration
2840: 0a 0a 20 20 20 20 70 72 61 67 6d 61 20 2d 68 61  ..    pragma -ha
2850: 73 69 6e 73 74 61 6e 63 65 73 20 20 20 6e 6f 20  sinstances   no 
2860: 3b 20 23 20 73 69 6e 67 6c 65 74 6f 6e 0a 20 20  ; # singleton.  
2870: 20 20 70 72 61 67 6d 61 20 2d 68 61 73 74 79 70    pragma -hastyp
2880: 65 69 6e 66 6f 20 20 20 20 6e 6f 20 3b 20 23 20  einfo    no ; # 
2890: 6e 6f 20 69 6e 74 72 6f 73 70 65 63 74 69 6f 6e  no introspection
28a0: 0a 20 20 20 20 70 72 61 67 6d 61 20 2d 68 61 73  .    pragma -has
28b0: 74 79 70 65 64 65 73 74 72 6f 79 20 6e 6f 20 3b  typedestroy no ;
28c0: 20 23 20 69 6d 6d 6f 72 74 61 6c 0a 0a 20 20 20   # immortal..   
28d0: 20 23 20 23 20 23 23 20 23 23 23 20 23 23 23 23   # # ## ### ####
28e0: 23 20 23 23 23 23 23 23 23 23 20 23 23 23 23 23  # ######## #####
28f0: 23 23 23 23 23 23 23 23 0a 7d 0a 0a 6e 61 6d 65  ########.}..name
2900: 73 70 61 63 65 20 65 76 61 6c 20 3a 3a 76 63 3a  space eval ::vc:
2910: 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a  :fossil::import:
2920: 3a 63 76 73 3a 3a 70 61 73 73 20 7b 0a 20 20 20  :cvs::pass {.   
2930: 20 6e 61 6d 65 73 70 61 63 65 20 65 78 70 6f 72   namespace expor
2940: 74 20 69 6e 69 74 63 73 65 74 73 0a 20 20 20 20  t initcsets.    
2950: 6e 61 6d 65 73 70 61 63 65 20 65 76 61 6c 20 69  namespace eval i
2960: 6e 69 74 63 73 65 74 73 20 7b 0a 09 6e 61 6d 65  nitcsets {..name
2970: 73 70 61 63 65 20 69 6d 70 6f 72 74 20 3a 3a 76  space import ::v
2980: 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72  c::fossil::impor
2990: 74 3a 3a 63 76 73 3a 3a 72 65 70 6f 73 69 74 6f  t::cvs::reposito
29a0: 72 79 0a 09 6e 61 6d 65 73 70 61 63 65 20 69 6d  ry..namespace im
29b0: 70 6f 72 74 20 3a 3a 76 63 3a 3a 66 6f 73 73 69  port ::vc::fossi
29c0: 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a  l::import::cvs::
29d0: 73 74 61 74 65 0a 09 6e 61 6d 65 73 70 61 63 65  state..namespace
29e0: 20 69 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a 66 6f   import ::vc::fo
29f0: 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76  ssil::import::cv
2a00: 73 3a 3a 69 6e 74 65 67 72 69 74 79 0a 09 6e 61  s::integrity..na
2a10: 6d 65 73 70 61 63 65 20 65 76 61 6c 20 70 72 6f  mespace eval pro
2a20: 6a 65 63 74 20 7b 0a 09 20 20 20 20 6e 61 6d 65  ject {..    name
2a30: 73 70 61 63 65 20 69 6d 70 6f 72 74 20 3a 3a 76  space import ::v
2a40: 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72  c::fossil::impor
2a50: 74 3a 3a 63 76 73 3a 3a 70 72 6f 6a 65 63 74 3a  t::cvs::project:
2a60: 3a 72 65 76 0a 09 7d 0a 09 6e 61 6d 65 73 70 61  :rev..}..namespa
2a70: 63 65 20 69 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a  ce import ::vc::
2a80: 74 6f 6f 6c 73 3a 3a 6d 69 73 63 3a 3a 2a 0a 09  tools::misc::*..
2a90: 6e 61 6d 65 73 70 61 63 65 20 69 6d 70 6f 72 74  namespace import
2aa0: 20 3a 3a 76 63 3a 3a 74 6f 6f 6c 73 3a 3a 6c 6f   ::vc::tools::lo
2ab0: 67 0a 09 6c 6f 67 20 72 65 67 69 73 74 65 72 20  g..log register 
2ac0: 69 6e 69 74 63 73 65 74 73 0a 20 20 20 20 7d 0a  initcsets.    }.
2ad0: 7d 0a 0a 23 20 23 20 23 23 20 23 23 23 20 23 23  }..# # ## ### ##
2ae0: 23 23 23 20 23 23 23 23 23 23 23 23 20 23 23 23  ### ######## ###
2af0: 23 23 23 23 23 23 23 23 23 23 20 23 23 23 23 23  ########## #####
2b00: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
2b10: 0a 23 23 20 52 65 61 64 79 0a 0a 70 61 63 6b 61  .## Ready..packa
2b20: 67 65 20 70 72 6f 76 69 64 65 20 76 63 3a 3a 66  ge provide vc::f
2b30: 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63  ossil::import::c
2b40: 76 73 3a 3a 70 61 73 73 3a 3a 69 6e 69 74 63 73  vs::pass::initcs
2b50: 65 74 73 20 31 2e 30 0a 72 65 74 75 72 6e 0a     ets 1.0.return.