Hex Artifact Content
Not logged in

Artifact 9999ef81cc158f742a82e65e4a847e7826d240d8:

File tools/cvs2fossil/lib/c2f_pinitcsets.tcl part of check-in [27ed4f7dc3] - Extended pass InitCsets and underlying code with more log output geared towards memory introspection, and added markers for special locations. Extended my notes with general observations from the first test runs over my example CVS repositories. by aku on 2008-02-16 06:46:41.

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 2d 32 30 30 38 20 41 6e 64 72 65 61 73 20  07-2008 Andreas 
0070: 4b 75 70 72 69 65 73 2e 0a 23 0a 23 20 54 68 69  Kupries..#.# Thi
0080: 73 20 73 6f 66 74 77 61 72 65 20 69 73 20 6c 69  s software is li
0090: 63 65 6e 73 65 64 20 61 73 20 64 65 73 63 72 69  censed as descri
00a0: 62 65 64 20 69 6e 20 74 68 65 20 66 69 6c 65 20  bed in the file 
00b0: 4c 49 43 45 4e 53 45 2c 20 77 68 69 63 68 0a 23  LICENSE, which.#
00c0: 20 79 6f 75 20 73 68 6f 75 6c 64 20 68 61 76 65   you should have
00d0: 20 72 65 63 65 69 76 65 64 20 61 73 20 70 61 72   received as par
00e0: 74 20 6f 66 20 74 68 69 73 20 64 69 73 74 72 69  t of this distri
00f0: 62 75 74 69 6f 6e 2e 0a 23 0a 23 20 54 68 69 73  bution..#.# This
0100: 20 73 6f 66 74 77 61 72 65 20 63 6f 6e 73 69 73   software consis
0110: 74 73 20 6f 66 20 76 6f 6c 75 6e 74 61 72 79 20  ts of voluntary 
0120: 63 6f 6e 74 72 69 62 75 74 69 6f 6e 73 20 6d 61  contributions ma
0130: 64 65 20 62 79 20 6d 61 6e 79 0a 23 20 69 6e 64  de by many.# ind
0140: 69 76 69 64 75 61 6c 73 2e 20 20 46 6f 72 20 65  ividuals.  For e
0150: 78 61 63 74 20 63 6f 6e 74 72 69 62 75 74 69 6f  xact contributio
0160: 6e 20 68 69 73 74 6f 72 79 2c 20 73 65 65 20 74  n history, see t
0170: 68 65 20 72 65 76 69 73 69 6f 6e 0a 23 20 68 69  he revision.# hi
0180: 73 74 6f 72 79 20 61 6e 64 20 6c 6f 67 73 2c 20  story and logs, 
0190: 61 76 61 69 6c 61 62 6c 65 20 61 74 20 68 74 74  available at htt
01a0: 70 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 68  p://fossil-scm.h
01b0: 77 61 63 69 2e 63 6f 6d 2f 66 6f 73 73 69 6c 0a  waci.com/fossil.
01c0: 23 20 23 20 23 23 20 23 23 23 20 23 23 23 23 23  # # ## ### #####
01d0: 20 23 23 23 23 23 23 23 23 20 23 23 23 23 23 23   ######## ######
01e0: 23 23 23 23 23 23 23 20 23 23 23 23 23 23 23 23  ####### ########
01f0: 23 23 23 23 23 23 23 23 23 23 23 23 23 0a 0a 23  #############..#
0200: 23 20 50 61 73 73 20 56 2e 20 54 68 69 73 20 70  # Pass V. This p
0210: 61 73 73 20 63 72 65 61 74 65 73 20 74 68 65 20  ass creates the 
0220: 69 6e 69 74 69 61 6c 20 73 65 74 20 6f 66 20 70  initial set of p
0230: 72 6f 6a 65 63 74 20 6c 65 76 65 6c 0a 23 23 20  roject level.## 
0240: 72 65 76 69 73 69 6f 6e 73 2c 20 61 6b 61 20 63  revisions, aka c
0250: 68 61 6e 67 65 73 65 74 73 2e 20 4c 61 74 65 72  hangesets. Later
0260: 20 70 61 73 73 65 73 20 77 69 6c 6c 20 72 65 66   passes will ref
0270: 69 6e 65 20 74 68 65 6d 2c 20 70 75 74 73 20 74  ine them, puts t
0280: 68 65 6d 0a 23 23 20 69 6e 74 6f 20 70 72 6f 70  hem.## into prop
0290: 65 72 20 6f 72 64 65 72 2c 20 73 65 74 20 74 68  er order, set th
02a0: 65 69 72 20 64 65 70 65 6e 64 65 6e 63 69 65 73  eir dependencies
02b0: 2c 20 65 74 63 2e 0a 0a 23 20 23 20 23 23 20 23  , etc...# # ## #
02c0: 23 23 20 23 23 23 23 23 20 23 23 23 23 23 23 23  ## ##### #######
02d0: 23 20 23 23 23 23 23 23 23 23 23 23 23 23 23 20  # ############# 
02e0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
02f0: 23 23 23 23 23 0a 23 23 20 52 65 71 75 69 72 65  #####.## Require
0300: 6d 65 6e 74 73 0a 0a 70 61 63 6b 61 67 65 20 72  ments..package r
0310: 65 71 75 69 72 65 20 54 63 6c 20 38 2e 34 20 20  equire 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 20 20 20 20 20 3b 20 23               ; #
0340: 20 52 65 71 75 69 72 65 64 20 72 75 6e 74 69 6d   Required runtim
0350: 65 2e 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69  e..package requi
0360: 72 65 20 73 6e 69 74 20 20 20 20 20 20 20 20 20  re snit         
0370: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0380: 20 20 20 20 20 20 20 20 20 3b 20 23 20 4f 4f 20           ; # OO 
0390: 73 79 73 74 65 6d 2e 0a 70 61 63 6b 61 67 65 20  system..package 
03a0: 72 65 71 75 69 72 65 20 76 63 3a 3a 74 6f 6f 6c  require vc::tool
03b0: 73 3a 3a 6d 69 73 63 20 20 20 20 20 20 20 20 20  s::misc         
03c0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3b 20                ; 
03d0: 23 20 54 65 78 74 20 66 6f 72 6d 61 74 74 69 6e  # Text formattin
03e0: 67 2e 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69  g..package requi
03f0: 72 65 20 76 63 3a 3a 74 6f 6f 6c 73 3a 3a 6c 6f  re vc::tools::lo
0400: 67 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  g               
0410: 20 20 20 20 20 20 20 20 20 3b 20 23 20 55 73 65           ; # Use
0420: 72 20 66 65 65 64 62 61 63 6b 2e 0a 70 61 63 6b  r feedback..pack
0430: 61 67 65 20 72 65 71 75 69 72 65 20 76 63 3a 3a  age require vc::
0440: 74 6f 6f 6c 73 3a 3a 6d 65 6d 20 20 20 20 20 20  tools::mem      
0450: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0460: 20 20 3b 20 23 20 4d 65 6d 6f 72 79 20 74 72 61    ; # Memory tra
0470: 63 6b 69 6e 67 2e 0a 70 61 63 6b 61 67 65 20 72  cking..package r
0480: 65 71 75 69 72 65 20 76 63 3a 3a 66 6f 73 73 69  equire vc::fossi
0490: 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a  l::import::cvs::
04a0: 72 65 70 6f 73 69 74 6f 72 79 20 20 20 3b 20 23  repository   ; #
04b0: 20 52 65 70 6f 73 69 74 6f 72 79 20 6d 61 6e 61   Repository mana
04c0: 67 65 6d 65 6e 74 2e 0a 70 61 63 6b 61 67 65 20  gement..package 
04d0: 72 65 71 75 69 72 65 20 76 63 3a 3a 66 6f 73 73  require vc::foss
04e0: 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a  il::import::cvs:
04f0: 3a 73 74 61 74 65 20 20 20 20 20 20 20 20 3b 20  :state        ; 
0500: 23 20 53 74 61 74 65 20 73 74 6f 72 61 67 65 2e  # State storage.
0510: 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65  .package require
0520: 20 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70   vc::fossil::imp
0530: 6f 72 74 3a 3a 63 76 73 3a 3a 69 6e 74 65 67 72  ort::cvs::integr
0540: 69 74 79 20 20 20 20 3b 20 23 20 53 74 61 74 65  ity    ; # State
0550: 20 69 6e 74 65 67 72 69 74 79 20 63 68 65 63 6b   integrity check
0560: 73 2e 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69  s..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 75 73 65 20 70 72  ....state use pr
07d0: 6f 6a 65 63 74 0a 09 73 74 61 74 65 20 75 73 65  oject..state use
07e0: 20 66 69 6c 65 0a 09 73 74 61 74 65 20 75 73 65   file..state use
07f0: 20 72 65 76 69 73 69 6f 6e 0a 09 73 74 61 74 65   revision..state
0800: 20 75 73 65 20 72 65 76 69 73 69 6f 6e 62 72 61   use revisionbra
0810: 6e 63 68 63 68 69 6c 64 72 65 6e 0a 09 73 74 61  nchchildren..sta
0820: 74 65 20 75 73 65 20 62 72 61 6e 63 68 0a 09 73  te use branch..s
0830: 74 61 74 65 20 75 73 65 20 74 61 67 0a 09 73 74  tate use tag..st
0840: 61 74 65 20 75 73 65 20 73 79 6d 62 6f 6c 0a 09  ate use symbol..
0850: 73 74 61 74 65 20 75 73 65 20 6d 65 74 61 0a 0a  state use meta..
0860: 09 23 20 44 61 74 61 20 70 65 72 20 63 68 61 6e  .# Data per chan
0870: 67 65 73 65 74 2c 20 6e 61 6d 65 6c 79 20 74 68  geset, namely th
0880: 65 20 70 72 6f 6a 65 63 74 20 69 74 20 62 65 6c  e project it bel
0890: 6f 6e 67 73 20 74 6f 2c 20 68 6f 77 20 69 74 0a  ongs to, how it.
08a0: 09 23 20 77 61 73 20 69 6e 64 75 63 65 64 20 28  .# was induced (
08b0: 72 65 76 69 73 69 6f 6e 20 6f 72 20 73 79 6d 62  revision or symb
08c0: 6f 6c 29 2c 20 70 6c 75 73 20 72 65 66 65 72 65  ol), plus refere
08d0: 6e 63 65 20 74 6f 20 74 68 65 0a 09 23 20 70 72  nce to the..# pr
08e0: 69 6d 61 72 79 20 65 6e 74 72 79 20 63 61 75 73  imary entry caus
08f0: 69 6e 67 20 69 74 20 28 6d 65 74 61 20 65 6e 74  ing it (meta ent
0900: 72 79 20 6f 72 20 73 79 6d 62 6f 6c 29 2e 20 41  ry or symbol). A
0910: 6e 20 61 64 6a 75 6e 63 74 0a 09 23 20 74 61 62  n adjunct..# tab
0920: 6c 65 20 74 72 61 6e 73 6c 61 74 65 73 20 74 68  le translates th
0930: 65 20 74 79 70 65 20 69 64 27 73 20 69 6e 74 6f  e type id's into
0940: 20 68 75 6d 61 6e 20 72 65 61 64 61 62 6c 65 20   human readable 
0950: 6c 61 62 65 6c 73 2e 0a 0a 09 73 74 61 74 65 20  labels....state 
0960: 65 78 74 65 6e 64 20 63 68 61 6e 67 65 73 65 74  extend changeset
0970: 20 7b 0a 09 20 20 20 20 63 69 64 20 20 20 49 4e   {..    cid   IN
0980: 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c 20  TEGER  NOT NULL 
0990: 20 50 52 49 4d 41 52 59 20 4b 45 59 20 20 41 55   PRIMARY KEY  AU
09a0: 54 4f 49 4e 43 52 45 4d 45 4e 54 2c 0a 09 20 20  TOINCREMENT,..  
09b0: 20 20 70 69 64 20 20 20 49 4e 54 45 47 45 52 20    pid   INTEGER 
09c0: 20 4e 4f 54 20 4e 55 4c 4c 20 20 52 45 46 45 52   NOT NULL  REFER
09d0: 45 4e 43 45 53 20 70 72 6f 6a 65 63 74 2c 0a 09  ENCES project,..
09e0: 20 20 20 20 74 79 70 65 20 20 49 4e 54 45 47 45      type  INTEGE
09f0: 52 20 20 4e 4f 54 20 4e 55 4c 4c 20 20 52 45 46  R  NOT NULL  REF
0a00: 45 52 45 4e 43 45 53 20 63 73 74 79 70 65 2c 0a  ERENCES cstype,.
0a10: 09 20 20 20 20 73 72 63 20 20 20 49 4e 54 45 47  .    src   INTEG
0a20: 45 52 20 20 4e 4f 54 20 4e 55 4c 4c 20 2d 2d 20  ER  NOT NULL -- 
0a30: 52 45 46 45 52 45 4e 43 45 53 20 6d 65 74 61 7c  REFERENCES meta|
0a40: 73 79 6d 62 6f 6c 20 28 74 79 70 65 20 64 65 70  symbol (type dep
0a50: 65 6e 64 65 6e 74 29 0a 09 7d 0a 09 73 74 61 74  endent)..}..stat
0a60: 65 20 65 78 74 65 6e 64 20 63 73 74 79 70 65 20  e extend cstype 
0a70: 7b 0a 09 20 20 20 20 74 69 64 20 20 20 49 4e 54  {..    tid   INT
0a80: 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c 20 20  EGER  NOT NULL  
0a90: 50 52 49 4d 41 52 59 20 4b 45 59 20 20 41 55 54  PRIMARY KEY  AUT
0aa0: 4f 49 4e 43 52 45 4d 45 4e 54 2c 0a 09 20 20 20  OINCREMENT,..   
0ab0: 20 6e 61 6d 65 20 20 54 45 58 54 20 20 20 20 20   name  TEXT     
0ac0: 4e 4f 54 20 4e 55 4c 4c 2c 0a 09 20 20 20 20 55  NOT NULL,..    U
0ad0: 4e 49 51 55 45 20 28 6e 61 6d 65 29 0a 09 7d 0a  NIQUE (name)..}.
0ae0: 09 23 20 4e 6f 74 65 3a 20 4b 65 65 70 20 74 68  .# Note: Keep th
0af0: 65 20 6c 61 62 65 6c 73 20 75 73 65 64 20 68 65  e labels used he
0b00: 72 65 20 69 6e 20 73 79 6e 63 20 77 69 74 68 20  re in sync with 
0b10: 74 68 65 20 6e 61 6d 65 73 20 66 6f 72 0a 09 23  the names for..#
0b20: 20 20 20 20 20 20 20 73 69 6e 67 6c 65 74 6f 6e         singleton
0b30: 20 68 65 6c 70 65 72 20 63 6c 61 73 73 65 73 20   helper classes 
0b40: 66 6f 72 20 27 70 72 6f 6a 65 63 74 3a 3a 72 65  for 'project::re
0b50: 76 27 2e 20 54 68 65 79 20 61 72 65 0a 09 23 20  v'. They are..# 
0b60: 20 20 20 20 20 20 74 68 65 20 76 61 6c 69 64 20        the valid 
0b70: 74 79 70 65 20 6e 61 6d 65 73 20 66 6f 72 20 63  type names for c
0b80: 68 61 6e 67 65 73 65 74 73 20 61 6e 64 20 61 6c  hangesets and al
0b90: 73 6f 20 68 61 72 64 77 69 72 65 64 0a 09 23 20  so hardwired..# 
0ba0: 20 20 20 20 20 20 69 6e 20 73 6f 6d 65 20 63 6f        in some co
0bb0: 64 65 2e 0a 09 73 74 61 74 65 20 72 75 6e 20 7b  de...state run {
0bc0: 0a 09 20 20 20 20 49 4e 53 45 52 54 20 49 4e 54  ..    INSERT INT
0bd0: 4f 20 63 73 74 79 70 65 20 56 41 4c 55 45 53 20  O cstype VALUES 
0be0: 28 30 2c 27 72 65 76 27 29 3b 0a 09 20 20 20 20  (0,'rev');..    
0bf0: 49 4e 53 45 52 54 20 49 4e 54 4f 20 63 73 74 79  INSERT INTO csty
0c00: 70 65 20 56 41 4c 55 45 53 20 28 31 2c 27 73 79  pe VALUES (1,'sy
0c10: 6d 3a 3a 74 61 67 27 29 3b 0a 09 20 20 20 20 49  m::tag');..    I
0c20: 4e 53 45 52 54 20 49 4e 54 4f 20 63 73 74 79 70  NSERT INTO cstyp
0c30: 65 20 56 41 4c 55 45 53 20 28 32 2c 27 73 79 6d  e VALUES (2,'sym
0c40: 3a 3a 62 72 61 6e 63 68 27 29 3b 0a 09 7d 0a 0a  ::branch');..}..
0c50: 09 23 20 4d 61 70 20 66 72 6f 6d 20 63 68 61 6e  .# Map from chan
0c60: 67 65 73 65 74 73 20 74 6f 20 74 68 65 20 28 66  gesets to the (f
0c70: 69 6c 65 20 6c 65 76 65 6c 29 20 72 65 76 69 73  ile level) revis
0c80: 69 6f 6e 73 2c 20 74 61 67 73 2c 20 6f 72 0a 09  ions, tags, or..
0c90: 23 20 62 72 61 6e 63 68 65 73 20 74 68 65 79 20  # branches they 
0ca0: 63 6f 6e 74 61 69 6e 2e 20 54 68 65 20 70 6f 73  contain. The pos
0cb0: 27 69 74 69 6f 6e 20 70 72 6f 76 69 64 65 73 20  'ition provides 
0cc0: 61 6e 20 6f 72 64 65 72 20 6f 66 0a 09 23 20 74  an order of..# t
0cd0: 68 65 20 69 74 65 6d 73 20 77 69 74 68 69 6e 20  he items within 
0ce0: 61 20 63 68 61 6e 67 65 73 65 74 2e 20 54 68 65  a changeset. The
0cf0: 79 20 61 72 65 20 75 6e 69 71 75 65 20 77 69 74  y are unique wit
0d00: 68 69 6e 20 74 68 65 0a 09 23 20 63 68 61 6e 67  hin the..# chang
0d10: 65 73 65 74 2e 20 20 54 68 65 20 69 74 65 6d 73  eset.  The items
0d20: 20 61 72 65 20 69 6e 20 70 72 69 6e 63 69 70 6c   are in principl
0d30: 65 20 75 6e 69 71 75 65 2c 20 69 66 20 77 65 20  e unique, if we 
0d40: 77 65 72 65 0a 09 23 20 6c 6f 6f 6b 69 6e 67 20  were..# looking 
0d50: 6f 6e 6c 79 20 61 74 20 72 65 6c 65 76 61 6e 74  only at relevant
0d60: 20 63 68 61 6e 67 65 73 65 74 73 2e 20 48 6f 77   changesets. How
0d70: 65 76 65 72 20 61 73 20 74 68 65 79 20 63 6f 6d  ever as they com
0d80: 65 0a 09 23 20 66 72 6f 6d 20 64 69 73 70 61 72  e..# from dispar
0d90: 61 74 65 20 73 6f 75 72 63 65 73 20 74 68 65 20  ate sources the 
0da0: 73 61 6d 65 20 69 64 20 6d 61 79 20 68 61 76 65  same id may have
0db0: 20 64 69 66 66 65 72 65 6e 74 0a 09 23 20 6d 65   different..# me
0dc0: 61 6e 69 6e 67 2c 20 62 65 20 69 6e 20 64 69 66  aning, be in dif
0dd0: 66 65 72 65 6e 74 20 63 68 61 6e 67 65 73 65 74  ferent changeset
0de0: 73 20 61 6e 64 20 73 6f 20 69 73 20 66 6f 72 6d  s and so is form
0df0: 61 6c 6c 79 20 6e 6f 74 0a 09 23 20 75 6e 69 71  ally not..# uniq
0e00: 75 65 2e 20 53 6f 20 77 65 20 63 61 6e 20 6f 6e  ue. So we can on
0e10: 6c 79 20 73 61 79 20 74 68 61 74 20 69 74 20 69  ly say that it i
0e20: 73 20 75 6e 69 71 75 65 20 77 69 74 68 69 6e 20  s unique within 
0e30: 74 68 65 0a 09 23 20 63 68 61 6e 67 65 73 65 74  the..# changeset
0e40: 2e 20 54 68 65 20 69 6e 74 65 67 72 69 74 79 20  . The integrity 
0e50: 6d 6f 64 75 6c 65 20 68 61 73 20 73 74 72 6f 6e  module has stron
0e60: 67 65 72 20 63 68 65 63 6b 73 2e 0a 0a 09 73 74  ger checks....st
0e70: 61 74 65 20 65 78 74 65 6e 64 20 63 73 69 74 65  ate extend csite
0e80: 6d 20 7b 0a 09 20 20 20 20 63 69 64 20 20 49 4e  m {..    cid  IN
0e90: 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c 20  TEGER  NOT NULL 
0ea0: 20 52 45 46 45 52 45 4e 43 45 53 20 63 68 61 6e   REFERENCES chan
0eb0: 67 65 73 65 74 2c 0a 09 20 20 20 20 70 6f 73 20  geset,..    pos 
0ec0: 20 49 4e 54 45 47 45 52 20 20 4e 4f 54 20 4e 55   INTEGER  NOT NU
0ed0: 4c 4c 2c 0a 09 20 20 20 20 69 69 64 20 20 49 4e  LL,..    iid  IN
0ee0: 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c 2c  TEGER  NOT NULL,
0ef0: 20 2d 2d 20 52 45 46 45 52 45 4e 43 45 53 20 72   -- REFERENCES r
0f00: 65 76 69 73 69 6f 6e 7c 74 61 67 7c 62 72 61 6e  evision|tag|bran
0f10: 63 68 0a 09 20 20 20 20 55 4e 49 51 55 45 20 28  ch..    UNIQUE (
0f20: 63 69 64 2c 20 70 6f 73 29 2c 0a 09 20 20 20 20  cid, pos),..    
0f30: 55 4e 49 51 55 45 20 28 63 69 64 2c 20 69 69 64  UNIQUE (cid, iid
0f40: 29 0a 09 7d 20 7b 20 69 69 64 20 7d 0a 09 23 20  )..} { iid }..# 
0f50: 49 6e 64 65 78 20 6f 6e 3a 20 69 69 64 20 28 73  Index on: iid (s
0f60: 75 63 63 65 73 73 6f 72 2f 70 72 65 64 65 63 65  uccessor/predece
0f70: 73 73 6f 72 20 72 65 74 72 69 65 76 61 6c 29 0a  ssor retrieval).
0f80: 0a 09 70 72 6f 6a 65 63 74 3a 3a 72 65 76 20 67  ..project::rev g
0f90: 65 74 63 73 74 79 70 65 73 0a 09 72 65 74 75 72  etcstypes..retur
0fa0: 6e 0a 20 20 20 20 7d 0a 0a 20 20 20 20 74 79 70  n.    }..    typ
0fb0: 65 6d 65 74 68 6f 64 20 6c 6f 61 64 20 7b 7d 20  emethod load {} 
0fc0: 7b 0a 09 23 20 50 61 73 73 20 6d 61 6e 61 67 65  {..# Pass manage
0fd0: 72 20 69 6e 74 65 72 66 61 63 65 2e 20 45 78 65  r interface. Exe
0fe0: 63 75 74 65 64 20 74 6f 20 6c 6f 61 64 20 64 61  cuted to load da
0ff0: 74 61 20 63 6f 6d 70 75 74 65 64 20 62 79 0a 09  ta computed by..
1000: 23 20 74 68 69 73 20 70 61 73 73 20 69 6e 74 6f  # this pass into
1010: 20 6d 65 6d 6f 72 79 20 77 68 65 6e 20 74 68 69   memory when thi
1020: 73 20 70 61 73 73 20 69 73 20 73 6b 69 70 70 65  s pass is skippe
1030: 64 20 69 6e 73 74 65 61 64 20 6f 66 0a 09 23 20  d instead of..# 
1040: 65 78 65 63 75 74 65 64 2e 0a 0a 09 73 74 61 74  executed....stat
1050: 65 20 75 73 65 20 63 68 61 6e 67 65 73 65 74 0a  e use changeset.
1060: 09 73 74 61 74 65 20 75 73 65 20 63 73 69 74 65  .state use csite
1070: 6d 0a 09 73 74 61 74 65 20 75 73 65 20 63 73 74  m..state use cst
1080: 79 70 65 0a 0a 09 23 20 4e 65 65 64 20 74 68 65  ype...# Need the
1090: 20 74 79 70 65 73 20 66 69 72 73 74 2c 20 74 68   types first, th
10a0: 65 20 63 6f 6e 73 74 72 75 63 74 6f 72 20 75 73  e constructor us
10b0: 65 64 20 69 6e 73 69 64 65 20 6f 66 20 74 68 65  ed inside of the
10c0: 0a 09 23 20 27 6c 6f 61 64 27 20 62 65 6c 6f 77  ..# 'load' below
10d0: 20 75 73 65 73 20 74 68 65 6d 20 74 6f 20 61 73   uses them to as
10e0: 73 65 72 74 20 74 68 65 20 63 6f 72 72 65 63 74  sert the correct
10f0: 6e 65 73 73 20 6f 66 20 74 79 70 65 0a 09 23 20  ness of type..# 
1100: 6e 61 6d 65 73 2e 0a 09 70 72 6f 6a 65 63 74 3a  names...project:
1110: 3a 72 65 76 20 67 65 74 63 73 74 79 70 65 73 0a  :rev getcstypes.
1120: 09 70 72 6f 6a 65 63 74 3a 3a 72 65 76 20 6c 6f  .project::rev lo
1130: 61 64 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a  ad ::vc::fossil:
1140: 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 72 65  :import::cvs::re
1150: 70 6f 73 69 74 6f 72 79 0a 09 70 72 6f 6a 65 63  pository..projec
1160: 74 3a 3a 72 65 76 20 6c 6f 61 64 63 6f 75 6e 74  t::rev loadcount
1170: 65 72 0a 09 72 65 74 75 72 6e 0a 20 20 20 20 7d  er..return.    }
1180: 0a 0a 20 20 20 20 74 79 70 65 6d 65 74 68 6f 64  ..    typemethod
1190: 20 72 75 6e 20 7b 7d 20 7b 0a 09 23 20 50 61 73   run {} {..# Pas
11a0: 73 20 6d 61 6e 61 67 65 72 20 69 6e 74 65 72 66  s manager interf
11b0: 61 63 65 2e 20 45 78 65 63 75 74 65 64 20 74 6f  ace. Executed to
11c0: 20 70 65 72 66 6f 72 6d 20 74 68 65 0a 09 23 20   perform the..# 
11d0: 66 75 6e 63 74 69 6f 6e 61 6c 69 74 79 20 6f 66  functionality of
11e0: 20 74 68 65 20 70 61 73 73 2e 0a 0a 09 73 74 61   the pass....sta
11f0: 74 65 20 74 72 61 6e 73 61 63 74 69 6f 6e 20 7b  te transaction {
1200: 0a 09 20 20 20 20 43 72 65 61 74 65 52 65 76 69  ..    CreateRevi
1210: 73 69 6f 6e 43 68 61 6e 67 65 73 65 74 73 20 20  sionChangesets  
1220: 3b 20 23 20 47 72 6f 75 70 20 66 69 6c 65 20 72  ; # Group file r
1230: 65 76 69 73 69 6f 6e 73 20 69 6e 74 6f 20 63 73  evisions into cs
1240: 65 74 73 2e 0a 09 20 20 20 20 42 72 65 61 6b 49  ets...    BreakI
1250: 6e 74 65 72 6e 61 6c 44 65 70 65 6e 64 65 6e 63  nternalDependenc
1260: 69 65 73 20 3b 20 23 20 53 70 6c 69 74 20 74 68  ies ; # Split th
1270: 65 20 63 73 65 74 73 20 62 61 73 65 64 20 6f 6e  e csets based on
1280: 20 69 6e 74 65 72 6e 61 6c 20 63 6f 6e 66 6c 69   internal confli
1290: 63 74 73 2e 0a 09 20 20 20 20 43 72 65 61 74 65  cts...    Create
12a0: 53 79 6d 62 6f 6c 43 68 61 6e 67 65 73 65 74 73  SymbolChangesets
12b0: 20 20 20 20 3b 20 23 20 43 72 65 61 74 65 20 63      ; # Create c
12c0: 73 65 74 73 20 66 6f 72 20 74 61 67 73 20 61 6e  sets for tags an
12d0: 64 20 62 72 61 6e 63 68 65 73 2e 0a 09 20 20 20  d branches...   
12e0: 20 50 65 72 73 69 73 74 54 68 65 43 68 61 6e 67   PersistTheChang
12f0: 65 73 65 74 73 0a 09 7d 0a 0a 09 72 65 70 6f 73  esets..}...repos
1300: 69 74 6f 72 79 20 70 72 69 6e 74 63 73 65 74 73  itory printcsets
1310: 74 61 74 69 73 74 69 63 73 0a 09 69 6e 74 65 67  tatistics..integ
1320: 72 69 74 79 20 63 68 61 6e 67 65 73 65 74 73 0a  rity changesets.
1330: 09 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20  .return.    }.. 
1340: 20 20 20 74 79 70 65 6d 65 74 68 6f 64 20 64 69     typemethod di
1350: 73 63 61 72 64 20 7b 7d 20 7b 0a 09 23 20 50 61  scard {} {..# Pa
1360: 73 73 20 6d 61 6e 61 67 65 72 20 69 6e 74 65 72  ss manager inter
1370: 66 61 63 65 2e 20 45 78 65 63 75 74 65 64 20 66  face. Executed f
1380: 6f 72 20 61 6c 6c 20 70 61 73 73 65 73 20 61 66  or all passes af
1390: 74 65 72 20 74 68 65 0a 09 23 20 72 75 6e 20 70  ter the..# run p
13a0: 61 73 73 65 73 2c 20 74 6f 20 72 65 6d 6f 76 65  asses, to remove
13b0: 20 61 6c 6c 20 64 61 74 61 20 6f 66 20 74 68 69   all data of thi
13c0: 73 20 70 61 73 73 20 66 72 6f 6d 20 74 68 65 20  s pass from the 
13d0: 73 74 61 74 65 2c 0a 09 23 20 61 73 20 62 65 69  state,..# as bei
13e0: 6e 67 20 6f 75 74 20 6f 66 20 64 61 74 65 2e 0a  ng out of date..
13f0: 0a 09 73 74 61 74 65 20 64 69 73 63 61 72 64 20  ..state discard 
1400: 63 68 61 6e 67 65 73 65 74 0a 09 73 74 61 74 65  changeset..state
1410: 20 64 69 73 63 61 72 64 20 63 73 74 79 70 65 0a   discard cstype.
1420: 09 73 74 61 74 65 20 64 69 73 63 61 72 64 20 63  .state discard c
1430: 73 69 74 65 6d 0a 09 72 65 74 75 72 6e 0a 20 20  sitem..return.  
1440: 20 20 7d 0a 0a 20 20 20 20 23 20 23 20 23 23 20    }..    # # ## 
1450: 23 23 23 20 23 23 23 23 23 20 23 23 23 23 23 23  ### ##### ######
1460: 23 23 20 23 23 23 23 23 23 23 23 23 23 23 23 23  ## #############
1470: 0a 20 20 20 20 23 23 20 49 6e 74 65 72 6e 61 6c  .    ## Internal
1480: 20 6d 65 74 68 6f 64 73 0a 0a 20 20 20 20 70 72   methods..    pr
1490: 6f 63 20 43 72 65 61 74 65 52 65 76 69 73 69 6f  oc CreateRevisio
14a0: 6e 43 68 61 6e 67 65 73 65 74 73 20 7b 7d 20 7b  nChangesets {} {
14b0: 0a 09 6c 6f 67 20 77 72 69 74 65 20 33 20 69 6e  ..log write 3 in
14c0: 69 74 63 73 65 74 73 20 7b 43 72 65 61 74 65 20  itcsets {Create 
14d0: 63 68 61 6e 67 65 73 65 74 73 20 62 61 73 65 64  changesets based
14e0: 20 6f 6e 20 72 65 76 69 73 69 6f 6e 73 7d 0a 0a   on revisions}..
14f0: 09 23 20 54 6f 20 67 65 74 20 74 68 65 20 69 6e  .# To get the in
1500: 69 74 69 61 6c 20 6f 66 20 63 68 61 6e 67 65 73  itial of changes
1510: 65 74 73 20 77 65 20 66 69 72 73 74 20 67 72 6f  ets we first gro
1520: 75 70 20 61 6c 6c 20 66 69 6c 65 0a 09 23 20 6c  up all file..# l
1530: 65 76 65 6c 20 72 65 76 69 73 69 6f 6e 73 20 75  evel revisions u
1540: 73 69 6e 67 20 74 68 65 20 73 61 6d 65 20 6d 65  sing the same me
1550: 74 61 20 64 61 74 61 20 65 6e 74 72 79 20 74 6f  ta data entry to
1560: 67 65 74 68 65 72 2e 20 41 73 0a 09 23 20 74 68  gether. As..# th
1570: 65 20 6d 65 74 61 20 64 61 74 61 20 65 6e 63 6f  e meta data enco
1580: 64 65 73 20 6e 6f 74 20 6f 6e 6c 79 20 61 75 74  des not only aut
1590: 68 6f 72 20 61 6e 64 20 6c 6f 67 20 6d 65 73 73  hor and log mess
15a0: 61 67 65 2c 20 62 75 74 0a 09 23 20 61 6c 73 6f  age, but..# also
15b0: 20 6c 69 6e 65 20 6f 66 20 64 65 76 65 6c 6f 70   line of develop
15c0: 6d 65 6e 74 20 61 6e 64 20 70 72 6f 6a 65 63 74  ment and project
15d0: 20 77 65 20 63 61 6e 20 62 65 20 73 75 72 65 20   we can be sure 
15e0: 74 68 61 74 0a 09 23 20 72 65 76 69 73 69 6f 6e  that..# revision
15f0: 73 20 69 6e 20 64 69 66 66 65 72 65 6e 74 20 70  s in different p
1600: 72 6f 6a 65 63 74 20 61 6e 64 20 6c 69 6e 65 73  roject and lines
1610: 20 6f 66 20 64 65 76 65 6c 6f 70 6d 65 6e 74 20   of development 
1620: 61 72 65 0a 09 23 20 6e 6f 74 20 67 72 6f 75 70  are..# not group
1630: 65 64 20 74 6f 67 65 74 68 65 72 2e 20 49 6e 20  ed together. In 
1640: 63 6f 6e 74 72 61 73 74 20 74 6f 20 63 76 73 32  contrast to cvs2
1650: 73 76 6e 20 77 65 20 64 6f 20 5f 5f 6e 6f 74 5f  svn we do __not_
1660: 5f 0a 09 23 20 75 73 65 20 64 69 73 74 61 6e 63  _..# use distanc
1670: 65 20 69 6e 20 74 69 6d 65 20 62 65 74 77 65 65  e in time betwee
1680: 6e 20 72 65 76 69 73 69 6f 6e 73 20 74 6f 20 62  n revisions to b
1690: 72 65 61 6b 20 74 68 65 6d 0a 09 23 20 61 70 61  reak them..# apa
16a0: 72 74 2e 20 57 65 20 68 61 76 65 20 73 65 65 6e  rt. We have seen
16b0: 20 43 56 53 20 72 65 70 6f 73 69 74 6f 72 69 65   CVS repositorie
16c0: 73 20 28 66 72 6f 6d 20 53 46 29 20 77 68 65 72  s (from SF) wher
16d0: 65 20 61 0a 09 23 20 73 69 6e 67 6c 65 20 63 6f  e a..# single co
16e0: 6d 6d 69 74 20 63 6f 6e 74 61 69 6e 65 64 20 72  mmit contained r
16f0: 65 76 69 73 69 6f 6e 73 20 73 65 76 65 72 61 6c  evisions several
1700: 20 68 6f 75 72 73 20 61 70 61 72 74 2c 0a 09 23   hours apart,..#
1710: 20 6c 69 6b 65 6c 79 20 64 75 65 20 74 6f 20 74   likely due to t
1720: 72 6f 75 62 6c 65 20 6f 6e 20 74 68 65 20 73 65  rouble on the se
1730: 72 76 65 72 20 68 6f 73 74 69 6e 67 20 74 68 65  rver hosting the
1740: 20 72 65 70 6f 73 69 74 6f 72 79 2e 0a 0a 09 23   repository....#
1750: 20 57 65 20 6f 72 64 65 72 20 74 68 65 20 72 65   We order the re
1760: 76 69 73 69 6f 6e 73 20 68 65 72 65 20 62 79 20  visions here by 
1770: 74 69 6d 65 2c 20 74 68 69 73 20 77 69 6c 6c 20  time, this will 
1780: 68 65 6c 70 20 74 68 65 0a 09 23 20 6c 61 74 65  help the..# late
1790: 72 20 70 61 73 73 65 73 20 28 61 76 6f 69 64 73  r passes (avoids
17a0: 20 6a 6f 69 6e 73 20 6c 61 74 65 72 20 74 6f 20   joins later to 
17b0: 67 65 74 20 61 74 20 74 68 65 20 6f 72 64 65 72  get at the order
17c0: 69 6e 67 0a 09 23 20 69 6e 66 6f 29 2e 0a 0a 09  ing..# info)....
17d0: 73 65 74 20 6e 20 30 0a 0a 09 73 65 74 20 6c 61  set n 0...set la
17e0: 73 74 6d 65 74 61 20 20 20 20 7b 7d 0a 09 73 65  stmeta    {}..se
17f0: 74 20 6c 61 73 74 70 72 6f 6a 65 63 74 20 7b 7d  t lastproject {}
1800: 0a 09 73 65 74 20 72 65 76 69 73 69 6f 6e 73 20  ..set revisions 
1810: 20 20 7b 7d 0a 0a 09 23 20 4e 6f 74 65 3a 20 57    {}...# Note: W
1820: 65 20 63 6f 75 6c 64 20 68 61 76 65 20 77 72 69  e could have wri
1830: 74 74 65 6e 20 74 68 69 73 20 6c 6f 6f 70 20 74  tten this loop t
1840: 6f 20 63 72 65 61 74 65 20 74 68 65 20 63 73 65  o create the cse
1850: 74 73 0a 09 23 20 20 20 20 20 20 20 65 61 72 6c  ts..#       earl
1860: 79 2c 20 65 78 74 65 6e 64 69 6e 67 20 74 68 65  y, extending the
1870: 6d 20 77 69 74 68 20 61 6c 6c 20 74 68 65 69 72  m with all their
1880: 20 72 65 76 69 73 69 6f 6e 73 2e 20 54 68 69 73   revisions. This
1890: 0a 09 23 20 20 20 20 20 20 20 68 6f 77 65 76 65  ..#       howeve
18a0: 72 20 77 6f 75 6c 64 20 6d 65 61 6e 20 6c 6f 74  r would mean lot
18b0: 73 20 6f 66 20 28 73 6c 6f 77 29 20 6d 65 74 68  s of (slow) meth
18c0: 6f 64 20 69 6e 76 6f 6b 61 74 69 6f 6e 73 0a 09  od invokations..
18d0: 23 20 20 20 20 20 20 20 6f 6e 20 74 68 65 20 63  #       on the c
18e0: 73 65 74 73 2e 20 44 6f 69 6e 67 20 69 74 20 6c  sets. Doing it l
18f0: 69 6b 65 20 74 68 69 73 2c 20 6c 61 74 65 20 63  ike this, late c
1900: 72 65 61 74 69 6f 6e 2c 20 6d 65 61 6e 73 0a 09  reation, means..
1910: 23 20 20 20 20 20 20 20 6c 65 73 73 20 73 75 63  #       less suc
1920: 68 20 63 61 6c 6c 73 2e 20 4e 6f 6e 65 2c 20 62  h calls. None, b
1930: 75 74 20 74 68 65 20 63 72 65 61 74 69 6f 6e 20  ut the creation 
1940: 69 74 73 65 6c 66 2e 0a 0a 09 6c 6f 67 20 77 72  itself....log wr
1950: 69 74 65 20 31 34 20 69 6e 69 74 63 73 65 74 73  ite 14 initcsets
1960: 20 6d 65 74 61 5f 62 65 67 69 6e 0a 09 6d 65 6d   meta_begin..mem
1970: 3a 3a 6d 61 72 6b 0a 09 66 6f 72 65 61 63 68 20  ::mark..foreach 
1980: 7b 6d 69 64 20 72 69 64 20 70 69 64 7d 20 5b 73  {mid rid pid} [s
1990: 74 61 74 65 20 72 75 6e 20 7b 0a 09 20 20 20 20  tate run {..    
19a0: 53 45 4c 45 43 54 20 4d 2e 6d 69 64 2c 20 52 2e  SELECT M.mid, R.
19b0: 72 69 64 2c 20 4d 2e 70 69 64 0a 09 20 20 20 20  rid, M.pid..    
19c0: 46 52 4f 4d 20 20 20 72 65 76 69 73 69 6f 6e 20  FROM   revision 
19d0: 52 2c 20 6d 65 74 61 20 4d 20 20 20 2d 2d 20 52  R, meta M   -- R
19e0: 20 3d 3d 3e 20 4d 2c 20 75 73 69 6e 67 20 50 4b   ==> M, using PK
19f0: 20 69 6e 64 65 78 20 6f 66 20 4d 2e 0a 09 20 20   index of M...  
1a00: 20 20 57 48 45 52 45 20 20 52 2e 6d 69 64 20 3d    WHERE  R.mid =
1a10: 20 4d 2e 6d 69 64 0a 09 20 20 20 20 4f 52 44 45   M.mid..    ORDE
1a20: 52 20 20 42 59 20 4d 2e 6d 69 64 2c 20 52 2e 64  R  BY M.mid, R.d
1a30: 61 74 65 0a 09 7d 5d 20 7b 0a 09 20 20 20 20 6c  ate..}] {..    l
1a40: 6f 67 20 77 72 69 74 65 20 31 34 20 69 6e 69 74  og write 14 init
1a50: 63 73 65 74 73 20 6d 65 74 61 5f 6e 65 78 74 0a  csets meta_next.
1a60: 0a 09 20 20 20 20 69 66 20 7b 24 6c 61 73 74 6d  ..    if {$lastm
1a70: 65 74 61 20 21 3d 20 24 6d 69 64 7d 20 7b 0a 09  eta != $mid} {..
1a80: 09 69 66 20 7b 5b 6c 6c 65 6e 67 74 68 20 24 72  .if {[llength $r
1a90: 65 76 69 73 69 6f 6e 73 5d 7d 20 7b 0a 09 09 20  evisions]} {... 
1aa0: 20 20 20 69 6e 63 72 20 6e 0a 09 09 20 20 20 20     incr n...    
1ab0: 73 65 74 20 20 70 20 5b 72 65 70 6f 73 69 74 6f  set  p [reposito
1ac0: 72 79 20 70 72 6f 6a 65 63 74 6f 66 20 24 6c 61  ry projectof $la
1ad0: 73 74 70 72 6f 6a 65 63 74 5d 0a 09 09 20 20 20  stproject]...   
1ae0: 20 6c 6f 67 20 77 72 69 74 65 20 31 34 20 69 6e   log write 14 in
1af0: 69 74 63 73 65 74 73 20 6d 65 74 61 5f 63 73 65  itcsets meta_cse
1b00: 74 5f 62 65 67 69 6e 0a 09 09 20 20 20 20 6d 65  t_begin...    me
1b10: 6d 3a 3a 6d 61 72 6b 0a 09 09 20 20 20 20 70 72  m::mark...    pr
1b20: 6f 6a 65 63 74 3a 3a 72 65 76 20 25 41 55 54 4f  oject::rev %AUTO
1b30: 25 20 24 70 20 72 65 76 20 24 6c 61 73 74 6d 65  % $p rev $lastme
1b40: 74 61 20 24 72 65 76 69 73 69 6f 6e 73 0a 09 09  ta $revisions...
1b50: 20 20 20 20 6c 6f 67 20 77 72 69 74 65 20 31 34      log write 14
1b60: 20 69 6e 69 74 63 73 65 74 73 20 6d 65 74 61 5f   initcsets meta_
1b70: 63 73 65 74 5f 64 6f 6e 65 0a 09 09 20 20 20 20  cset_done...    
1b80: 6d 65 6d 3a 3a 6d 61 72 6b 0a 09 09 20 20 20 20  mem::mark...    
1b90: 73 65 74 20 72 65 76 69 73 69 6f 6e 73 20 7b 7d  set revisions {}
1ba0: 0a 09 09 7d 0a 09 09 73 65 74 20 6c 61 73 74 6d  ...}...set lastm
1bb0: 65 74 61 20 20 20 20 24 6d 69 64 0a 09 09 73 65  eta    $mid...se
1bc0: 74 20 6c 61 73 74 70 72 6f 6a 65 63 74 20 24 70  t lastproject $p
1bd0: 69 64 0a 09 20 20 20 20 7d 0a 09 20 20 20 20 6c  id..    }..    l
1be0: 61 70 70 65 6e 64 20 72 65 76 69 73 69 6f 6e 73  append revisions
1bf0: 20 24 72 69 64 0a 09 7d 0a 0a 09 69 66 20 7b 5b   $rid..}...if {[
1c00: 6c 6c 65 6e 67 74 68 20 24 72 65 76 69 73 69 6f  llength $revisio
1c10: 6e 73 5d 7d 20 7b 0a 09 20 20 20 20 69 6e 63 72  ns]} {..    incr
1c20: 20 6e 0a 09 20 20 20 20 73 65 74 20 20 70 20 5b   n..    set  p [
1c30: 72 65 70 6f 73 69 74 6f 72 79 20 70 72 6f 6a 65  repository proje
1c40: 63 74 6f 66 20 24 6c 61 73 74 70 72 6f 6a 65 63  ctof $lastprojec
1c50: 74 5d 0a 09 20 20 20 20 6c 6f 67 20 77 72 69 74  t]..    log writ
1c60: 65 20 31 34 20 69 6e 69 74 63 73 65 74 73 20 6d  e 14 initcsets m
1c70: 65 74 61 5f 63 73 65 74 5f 62 65 67 69 6e 0a 09  eta_cset_begin..
1c80: 20 20 20 20 6d 65 6d 3a 3a 6d 61 72 6b 0a 09 20      mem::mark.. 
1c90: 20 20 20 70 72 6f 6a 65 63 74 3a 3a 72 65 76 20     project::rev 
1ca0: 25 41 55 54 4f 25 20 24 70 20 72 65 76 20 24 6c  %AUTO% $p rev $l
1cb0: 61 73 74 6d 65 74 61 20 24 72 65 76 69 73 69 6f  astmeta $revisio
1cc0: 6e 73 0a 09 20 20 20 20 6c 6f 67 20 77 72 69 74  ns..    log writ
1cd0: 65 20 31 34 20 69 6e 69 74 63 73 65 74 73 20 6d  e 14 initcsets m
1ce0: 65 74 61 5f 63 73 65 74 5f 64 6f 6e 65 0a 09 20  eta_cset_done.. 
1cf0: 20 20 20 6d 65 6d 3a 3a 6d 61 72 6b 0a 09 7d 0a     mem::mark..}.
1d00: 0a 09 6c 6f 67 20 77 72 69 74 65 20 31 34 20 69  ..log write 14 i
1d10: 6e 69 74 63 73 65 74 73 20 6d 65 74 61 5f 64 6f  nitcsets meta_do
1d20: 6e 65 0a 09 6d 65 6d 3a 3a 6d 61 72 6b 0a 0a 09  ne..mem::mark...
1d30: 6c 6f 67 20 77 72 69 74 65 20 34 20 69 6e 69 74  log write 4 init
1d40: 63 73 65 74 73 20 22 43 72 65 61 74 65 64 20 5b  csets "Created [
1d50: 6e 73 70 20 24 6e 20 7b 72 65 76 69 73 69 6f 6e  nsp $n {revision
1d60: 20 63 68 61 6e 67 65 73 65 74 7d 5d 22 0a 09 72   changeset}]"..r
1d70: 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 20  eturn.    }..   
1d80: 20 70 72 6f 63 20 43 72 65 61 74 65 53 79 6d 62   proc CreateSymb
1d90: 6f 6c 43 68 61 6e 67 65 73 65 74 73 20 7b 7d 20  olChangesets {} 
1da0: 7b 0a 09 6c 6f 67 20 77 72 69 74 65 20 33 20 69  {..log write 3 i
1db0: 6e 69 74 63 73 65 74 73 20 7b 43 72 65 61 74 65  nitcsets {Create
1dc0: 20 63 68 61 6e 67 65 73 65 74 73 20 62 61 73 65   changesets base
1dd0: 64 20 6f 6e 20 73 79 6d 62 6f 6c 73 7d 0a 09 6d  d on symbols}..m
1de0: 65 6d 3a 3a 6d 61 72 6b 0a 0a 09 23 20 54 61 67  em::mark...# Tag
1df0: 73 20 61 6e 64 20 62 72 61 6e 63 68 65 73 20 69  s and branches i
1e00: 6e 64 75 63 65 20 63 68 61 6e 67 65 73 65 74 73  nduce changesets
1e10: 20 61 73 20 77 65 6c 6c 2c 20 63 6f 6e 74 61 69   as well, contai
1e20: 6e 69 6e 67 20 74 68 65 0a 09 23 20 72 65 76 69  ning the..# revi
1e30: 73 69 6f 6e 73 20 74 68 65 79 20 61 72 65 20 61  sions they are a
1e40: 74 74 61 63 68 65 64 20 74 6f 20 28 74 61 67 73  ttached to (tags
1e50: 29 2c 20 6f 72 20 73 70 61 77 6e 65 64 20 66 72  ), or spawned fr
1e60: 6f 6d 0a 09 23 20 28 62 72 61 6e 63 68 65 73 29  om..# (branches)
1e70: 2e 0a 0a 09 73 65 74 20 6e 20 30 0a 0a 09 23 20  ....set n 0...# 
1e80: 46 69 72 73 74 20 70 72 6f 63 65 73 73 20 74 68  First process th
1e90: 65 20 74 61 67 73 2c 20 74 68 65 6e 20 74 68 65  e tags, then the
1ea0: 20 62 72 61 6e 63 68 65 73 2e 20 57 65 20 6b 6e   branches. We kn
1eb0: 6f 77 20 74 68 61 74 0a 09 23 20 74 68 65 69 72  ow that..# their
1ec0: 20 69 64 73 20 64 6f 20 6e 6f 74 20 6f 76 65 72   ids do not over
1ed0: 6c 61 70 20 77 69 74 68 20 65 61 63 68 20 6f 74  lap with each ot
1ee0: 68 65 72 2e 0a 0a 09 73 65 74 20 6c 61 73 74 73  her....set lasts
1ef0: 79 6d 62 6f 6c 20 20 7b 7d 0a 09 73 65 74 20 6c  ymbol  {}..set l
1f00: 61 73 74 70 72 6f 6a 65 63 74 20 7b 7d 0a 09 73  astproject {}..s
1f10: 65 74 20 74 61 67 73 20 20 20 20 20 20 20 20 7b  et tags        {
1f20: 7d 0a 0a 09 66 6f 72 65 61 63 68 20 7b 73 69 64  }...foreach {sid
1f30: 20 74 69 64 20 70 69 64 7d 20 5b 73 74 61 74 65   tid pid} [state
1f40: 20 72 75 6e 20 7b 0a 09 20 20 20 20 53 45 4c 45   run {..    SELE
1f50: 43 54 20 53 2e 73 69 64 2c 20 54 2e 74 69 64 2c  CT S.sid, T.tid,
1f60: 20 53 2e 70 69 64 0a 09 20 20 20 20 46 52 4f 4d   S.pid..    FROM
1f70: 20 20 74 61 67 20 54 2c 20 73 79 6d 62 6f 6c 20    tag T, symbol 
1f80: 53 20 20 20 20 20 2d 2d 20 54 20 3d 3d 3e 20 52  S     -- T ==> R
1f90: 2f 53 2c 20 75 73 69 6e 67 20 50 4b 20 69 6e 64  /S, using PK ind
1fa0: 69 63 65 73 20 6f 66 20 52 2c 20 53 2e 0a 09 20  ices of R, S... 
1fb0: 20 20 20 57 48 45 52 45 20 54 2e 73 69 64 20 3d     WHERE T.sid =
1fc0: 20 53 2e 73 69 64 0a 09 20 20 20 20 4f 52 44 45   S.sid..    ORDE
1fd0: 52 20 42 59 20 53 2e 73 69 64 2c 20 54 2e 74 69  R BY S.sid, T.ti
1fe0: 64 0a 09 7d 5d 20 7b 0a 09 20 20 20 20 69 66 20  d..}] {..    if 
1ff0: 7b 24 6c 61 73 74 73 79 6d 62 6f 6c 20 21 3d 20  {$lastsymbol != 
2000: 24 73 69 64 7d 20 7b 0a 09 09 69 66 20 7b 5b 6c  $sid} {...if {[l
2010: 6c 65 6e 67 74 68 20 24 74 61 67 73 5d 7d 20 7b  length $tags]} {
2020: 0a 09 09 20 20 20 20 69 6e 63 72 20 6e 0a 09 09  ...    incr n...
2030: 20 20 20 20 73 65 74 20 20 70 20 5b 72 65 70 6f      set  p [repo
2040: 73 69 74 6f 72 79 20 70 72 6f 6a 65 63 74 6f 66  sitory projectof
2050: 20 24 6c 61 73 74 70 72 6f 6a 65 63 74 5d 0a 09   $lastproject]..
2060: 09 20 20 20 20 70 72 6f 6a 65 63 74 3a 3a 72 65  .    project::re
2070: 76 20 25 41 55 54 4f 25 20 24 70 20 73 79 6d 3a  v %AUTO% $p sym:
2080: 3a 74 61 67 20 24 6c 61 73 74 73 79 6d 62 6f 6c  :tag $lastsymbol
2090: 20 24 74 61 67 73 0a 09 09 20 20 20 20 73 65 74   $tags...    set
20a0: 20 74 61 67 73 20 7b 7d 0a 09 09 7d 0a 09 09 73   tags {}...}...s
20b0: 65 74 20 6c 61 73 74 73 79 6d 62 6f 6c 20 20 24  et lastsymbol  $
20c0: 73 69 64 0a 09 09 73 65 74 20 6c 61 73 74 70 72  sid...set lastpr
20d0: 6f 6a 65 63 74 20 24 70 69 64 0a 09 20 20 20 20  oject $pid..    
20e0: 7d 0a 09 20 20 20 20 6c 61 70 70 65 6e 64 20 74  }..    lappend t
20f0: 61 67 73 20 24 74 69 64 0a 09 7d 0a 0a 09 69 66  ags $tid..}...if
2100: 20 7b 5b 6c 6c 65 6e 67 74 68 20 24 74 61 67 73   {[llength $tags
2110: 5d 7d 20 7b 0a 09 20 20 20 20 69 6e 63 72 20 6e  ]} {..    incr n
2120: 0a 09 20 20 20 20 73 65 74 20 20 70 20 5b 72 65  ..    set  p [re
2130: 70 6f 73 69 74 6f 72 79 20 70 72 6f 6a 65 63 74  pository project
2140: 6f 66 20 24 6c 61 73 74 70 72 6f 6a 65 63 74 5d  of $lastproject]
2150: 0a 09 20 20 20 20 70 72 6f 6a 65 63 74 3a 3a 72  ..    project::r
2160: 65 76 20 25 41 55 54 4f 25 20 24 70 20 73 79 6d  ev %AUTO% $p sym
2170: 3a 3a 74 61 67 20 24 6c 61 73 74 73 79 6d 62 6f  ::tag $lastsymbo
2180: 6c 20 24 74 61 67 73 0a 09 7d 0a 0a 09 73 65 74  l $tags..}...set
2190: 20 6c 61 73 74 73 79 6d 62 6f 6c 20 7b 7d 0a 09   lastsymbol {}..
21a0: 73 65 74 20 6c 61 73 70 72 6f 6a 65 63 74 20 7b  set lasproject {
21b0: 7d 0a 09 73 65 74 20 62 72 61 6e 63 68 65 73 20  }..set branches 
21c0: 20 20 7b 7d 0a 0a 09 66 6f 72 65 61 63 68 20 7b    {}...foreach {
21d0: 73 69 64 20 62 69 64 20 70 69 64 7d 20 5b 73 74  sid bid pid} [st
21e0: 61 74 65 20 72 75 6e 20 7b 0a 09 20 20 20 20 53  ate run {..    S
21f0: 45 4c 45 43 54 20 53 2e 73 69 64 2c 20 42 2e 62  ELECT S.sid, B.b
2200: 69 64 2c 20 53 2e 70 69 64 0a 09 20 20 20 20 46  id, S.pid..    F
2210: 52 4f 4d 20 20 62 72 61 6e 63 68 20 42 2c 20 73  ROM  branch B, s
2220: 79 6d 62 6f 6c 20 53 20 20 2d 2d 20 42 20 3d 3d  ymbol S  -- B ==
2230: 3e 20 52 2f 53 2c 20 75 73 69 6e 67 20 50 4b 20  > R/S, using PK 
2240: 69 6e 64 69 63 65 73 20 6f 66 20 52 2c 20 53 2e  indices of R, S.
2250: 0a 09 20 20 20 20 57 48 45 52 45 20 42 2e 73 69  ..    WHERE B.si
2260: 64 20 20 3d 20 53 2e 73 69 64 0a 09 20 20 20 20  d  = S.sid..    
2270: 4f 52 44 45 52 20 42 59 20 53 2e 73 69 64 2c 20  ORDER BY S.sid, 
2280: 42 2e 62 69 64 0a 09 7d 5d 20 7b 0a 09 20 20 20  B.bid..}] {..   
2290: 20 69 66 20 7b 24 6c 61 73 74 73 79 6d 62 6f 6c   if {$lastsymbol
22a0: 20 21 3d 20 24 73 69 64 7d 20 7b 0a 09 09 69 66   != $sid} {...if
22b0: 20 7b 5b 6c 6c 65 6e 67 74 68 20 24 62 72 61 6e   {[llength $bran
22c0: 63 68 65 73 5d 7d 20 7b 0a 09 09 20 20 20 20 69  ches]} {...    i
22d0: 6e 63 72 20 6e 0a 09 09 20 20 20 20 73 65 74 20  ncr n...    set 
22e0: 20 70 20 5b 72 65 70 6f 73 69 74 6f 72 79 20 70   p [repository p
22f0: 72 6f 6a 65 63 74 6f 66 20 24 6c 61 73 74 70 72  rojectof $lastpr
2300: 6f 6a 65 63 74 5d 0a 09 09 20 20 20 20 70 72 6f  oject]...    pro
2310: 6a 65 63 74 3a 3a 72 65 76 20 25 41 55 54 4f 25  ject::rev %AUTO%
2320: 20 24 70 20 73 79 6d 3a 3a 62 72 61 6e 63 68 20   $p sym::branch 
2330: 24 6c 61 73 74 73 79 6d 62 6f 6c 20 24 62 72 61  $lastsymbol $bra
2340: 6e 63 68 65 73 0a 09 09 20 20 20 20 73 65 74 20  nches...    set 
2350: 62 72 61 6e 63 68 65 73 20 7b 7d 0a 09 09 7d 0a  branches {}...}.
2360: 09 09 73 65 74 20 6c 61 73 74 73 79 6d 62 6f 6c  ..set lastsymbol
2370: 20 20 24 73 69 64 0a 09 09 73 65 74 20 6c 61 73    $sid...set las
2380: 74 70 72 6f 6a 65 63 74 20 24 70 69 64 0a 09 20  tproject $pid.. 
2390: 20 20 20 7d 0a 09 20 20 20 20 6c 61 70 70 65 6e     }..    lappen
23a0: 64 20 62 72 61 6e 63 68 65 73 20 24 62 69 64 0a  d branches $bid.
23b0: 09 7d 0a 0a 09 69 66 20 7b 5b 6c 6c 65 6e 67 74  .}...if {[llengt
23c0: 68 20 24 62 72 61 6e 63 68 65 73 5d 7d 20 7b 0a  h $branches]} {.
23d0: 09 20 20 20 20 69 6e 63 72 20 6e 0a 09 20 20 20  .    incr n..   
23e0: 20 73 65 74 20 20 70 20 5b 72 65 70 6f 73 69 74   set  p [reposit
23f0: 6f 72 79 20 70 72 6f 6a 65 63 74 6f 66 20 24 6c  ory projectof $l
2400: 61 73 74 70 72 6f 6a 65 63 74 5d 0a 09 20 20 20  astproject]..   
2410: 20 70 72 6f 6a 65 63 74 3a 3a 72 65 76 20 25 41   project::rev %A
2420: 55 54 4f 25 20 24 70 20 73 79 6d 3a 3a 62 72 61  UTO% $p sym::bra
2430: 6e 63 68 20 24 6c 61 73 74 73 79 6d 62 6f 6c 20  nch $lastsymbol 
2440: 24 62 72 61 6e 63 68 65 73 0a 09 7d 0a 0a 09 6c  $branches..}...l
2450: 6f 67 20 77 72 69 74 65 20 34 20 69 6e 69 74 63  og write 4 initc
2460: 73 65 74 73 20 22 43 72 65 61 74 65 64 20 5b 6e  sets "Created [n
2470: 73 70 20 24 6e 20 7b 73 79 6d 62 6f 6c 20 63 68  sp $n {symbol ch
2480: 61 6e 67 65 73 65 74 7d 5d 22 0a 09 6d 65 6d 3a  angeset}]"..mem:
2490: 3a 6d 61 72 6b 0a 09 72 65 74 75 72 6e 0a 20 20  :mark..return.  
24a0: 20 20 7d 0a 0a 20 20 20 20 70 72 6f 63 20 42 72    }..    proc Br
24b0: 65 61 6b 49 6e 74 65 72 6e 61 6c 44 65 70 65 6e  eakInternalDepen
24c0: 64 65 6e 63 69 65 73 20 7b 7d 20 7b 0a 09 23 20  dencies {} {..# 
24d0: 54 68 69 73 20 63 6f 64 65 20 6f 70 65 72 61 74  This code operat
24e0: 65 73 20 6f 6e 20 74 68 65 20 72 65 76 69 73 69  es on the revisi
24f0: 6f 6e 20 63 68 61 6e 67 65 73 65 74 73 20 63 72  on changesets cr
2500: 65 61 74 65 64 20 62 79 0a 09 23 20 27 43 72 65  eated by..# 'Cre
2510: 61 74 65 52 65 76 69 73 69 6f 6e 43 68 61 6e 67  ateRevisionChang
2520: 65 73 65 74 73 27 2e 20 41 73 20 73 75 63 68 20  esets'. As such 
2530: 69 74 20 68 61 73 20 74 6f 20 66 6f 6c 6c 6f 77  it has to follow
2540: 20 61 66 74 65 72 0a 09 23 20 69 74 2c 20 62 65   after..# it, be
2550: 66 6f 72 65 20 74 68 65 20 73 79 6d 62 6f 6c 20  fore the symbol 
2560: 63 68 61 6e 67 65 73 65 74 73 20 61 72 65 20 6d  changesets are m
2570: 61 64 65 2e 20 54 68 65 20 63 68 61 6e 67 65 73  ade. The changes
2580: 65 74 73 0a 09 23 20 61 72 65 20 69 6e 73 70 65  ets..# are inspe
2590: 63 74 65 64 20 66 6f 72 20 69 6e 74 65 72 6e 61  cted for interna
25a0: 6c 20 63 6f 6e 66 6c 69 63 74 73 20 61 6e 64 20  l conflicts and 
25b0: 61 6e 79 20 73 75 63 68 20 61 72 65 20 62 72 6f  any such are bro
25c0: 6b 65 6e 0a 09 23 20 62 79 20 73 70 6c 69 74 74  ken..# by splitt
25d0: 69 6e 67 20 74 68 65 20 70 72 6f 62 6c 65 6d 61  ing the problema
25e0: 74 69 63 20 63 68 61 6e 67 65 73 65 74 20 69 6e  tic changeset in
25f0: 74 6f 20 6d 75 6c 74 69 70 6c 65 0a 09 23 20 66  to multiple..# f
2600: 72 61 67 6d 65 6e 74 73 2e 20 54 68 65 20 72 65  ragments. The re
2610: 73 75 6c 74 73 20 61 72 65 20 63 68 61 6e 67 65  sults are change
2620: 73 65 74 73 20 77 68 69 63 68 20 68 61 76 65 20  sets which have 
2630: 6e 6f 20 69 6e 74 65 72 6e 61 6c 0a 09 23 20 64  no internal..# d
2640: 65 70 65 6e 64 65 6e 63 69 65 73 2c 20 6f 6e 6c  ependencies, onl
2650: 79 20 65 78 74 65 72 6e 61 6c 20 6f 6e 65 73 2e  y external ones.
2660: 0a 0a 09 6c 6f 67 20 77 72 69 74 65 20 33 20 69  ...log write 3 i
2670: 6e 69 74 63 73 65 74 73 20 7b 42 72 65 61 6b 20  nitcsets {Break 
2680: 69 6e 74 65 72 6e 61 6c 20 64 65 70 65 6e 64 65  internal depende
2690: 6e 63 69 65 73 7d 0a 09 6d 65 6d 3a 3a 6d 61 72  ncies}..mem::mar
26a0: 6b 0a 09 73 65 74 20 6f 6c 64 20 5b 6c 6c 65 6e  k..set old [llen
26b0: 67 74 68 20 5b 70 72 6f 6a 65 63 74 3a 3a 72 65  gth [project::re
26c0: 76 20 61 6c 6c 5d 5d 0a 0a 09 66 6f 72 65 61 63  v all]]...foreac
26d0: 68 20 63 73 65 74 20 5b 70 72 6f 6a 65 63 74 3a  h cset [project:
26e0: 3a 72 65 76 20 61 6c 6c 5d 20 7b 0a 09 20 20 20  :rev all] {..   
26f0: 20 24 63 73 65 74 20 62 72 65 61 6b 69 6e 74 65   $cset breakinte
2700: 72 6e 61 6c 64 65 70 65 6e 64 65 6e 63 69 65 73  rnaldependencies
2710: 0a 09 7d 0a 0a 09 73 65 74 20 6e 20 5b 65 78 70  ..}...set n [exp
2720: 72 20 7b 5b 6c 6c 65 6e 67 74 68 20 5b 70 72 6f  r {[llength [pro
2730: 6a 65 63 74 3a 3a 72 65 76 20 61 6c 6c 5d 5d 20  ject::rev all]] 
2740: 2d 20 24 6f 6c 64 7d 5d 0a 09 6c 6f 67 20 77 72  - $old}]..log wr
2750: 69 74 65 20 34 20 69 6e 69 74 63 73 65 74 73 20  ite 4 initcsets 
2760: 22 43 72 65 61 74 65 64 20 5b 6e 73 70 20 24 6e  "Created [nsp $n
2770: 20 7b 61 64 64 69 74 69 6f 6e 61 6c 20 72 65 76   {additional rev
2780: 69 73 69 6f 6e 20 63 68 61 6e 67 65 73 65 74 7d  ision changeset}
2790: 5d 22 0a 09 6c 6f 67 20 77 72 69 74 65 20 34 20  ]"..log write 4 
27a0: 69 6e 69 74 63 73 65 74 73 20 4f 6b 2e 0a 09 6d  initcsets Ok...m
27b0: 65 6d 3a 3a 6d 61 72 6b 0a 09 72 65 74 75 72 6e  em::mark..return
27c0: 0a 20 20 20 20 7d 0a 0a 20 20 20 20 70 72 6f 63  .    }..    proc
27d0: 20 50 65 72 73 69 73 74 54 68 65 43 68 61 6e 67   PersistTheChang
27e0: 65 73 65 74 73 20 7b 7d 20 7b 0a 09 6c 6f 67 20  esets {} {..log 
27f0: 77 72 69 74 65 20 33 20 69 6e 69 74 63 73 65 74  write 3 initcset
2800: 73 20 22 53 61 76 69 6e 67 20 5b 6e 73 70 20 5b  s "Saving [nsp [
2810: 6c 6c 65 6e 67 74 68 20 5b 70 72 6f 6a 65 63 74  llength [project
2820: 3a 3a 72 65 76 20 61 6c 6c 5d 5d 20 7b 69 6e 69  ::rev all]] {ini
2830: 74 69 61 6c 20 63 68 61 6e 67 65 73 65 74 7d 5d  tial changeset}]
2840: 20 74 6f 20 74 68 65 20 70 65 72 73 69 73 74 65   to the persiste
2850: 6e 74 20 73 74 61 74 65 22 0a 0a 09 66 6f 72 65  nt state"...fore
2860: 61 63 68 20 63 73 65 74 20 5b 70 72 6f 6a 65 63  ach cset [projec
2870: 74 3a 3a 72 65 76 20 61 6c 6c 5d 20 7b 0a 09 20  t::rev all] {.. 
2880: 20 20 20 24 63 73 65 74 20 70 65 72 73 69 73 74     $cset persist
2890: 0a 09 7d 0a 0a 09 6c 6f 67 20 77 72 69 74 65 20  ..}...log write 
28a0: 34 20 69 6e 69 74 63 73 65 74 73 20 4f 6b 2e 0a  4 initcsets Ok..
28b0: 09 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20  .return.    }.. 
28c0: 20 20 20 23 20 23 20 23 23 20 23 23 23 20 23 23     # # ## ### ##
28d0: 23 23 23 20 23 23 23 23 23 23 23 23 20 23 23 23  ### ######## ###
28e0: 23 23 23 23 23 23 23 23 23 23 0a 20 20 20 20 23  ##########.    #
28f0: 23 20 43 6f 6e 66 69 67 75 72 61 74 69 6f 6e 0a  # Configuration.
2900: 0a 20 20 20 20 70 72 61 67 6d 61 20 2d 68 61 73  .    pragma -has
2910: 69 6e 73 74 61 6e 63 65 73 20 20 20 6e 6f 20 3b  instances   no ;
2920: 20 23 20 73 69 6e 67 6c 65 74 6f 6e 0a 20 20 20   # singleton.   
2930: 20 70 72 61 67 6d 61 20 2d 68 61 73 74 79 70 65   pragma -hastype
2940: 69 6e 66 6f 20 20 20 20 6e 6f 20 3b 20 23 20 6e  info    no ; # n
2950: 6f 20 69 6e 74 72 6f 73 70 65 63 74 69 6f 6e 0a  o introspection.
2960: 20 20 20 20 70 72 61 67 6d 61 20 2d 68 61 73 74      pragma -hast
2970: 79 70 65 64 65 73 74 72 6f 79 20 6e 6f 20 3b 20  ypedestroy no ; 
2980: 23 20 69 6d 6d 6f 72 74 61 6c 0a 0a 20 20 20 20  # immortal..    
2990: 23 20 23 20 23 23 20 23 23 23 20 23 23 23 23 23  # # ## ### #####
29a0: 20 23 23 23 23 23 23 23 23 20 23 23 23 23 23 23   ######## ######
29b0: 23 23 23 23 23 23 23 0a 7d 0a 0a 6e 61 6d 65 73  #######.}..names
29c0: 70 61 63 65 20 65 76 61 6c 20 3a 3a 76 63 3a 3a  pace eval ::vc::
29d0: 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a  fossil::import::
29e0: 63 76 73 3a 3a 70 61 73 73 20 7b 0a 20 20 20 20  cvs::pass {.    
29f0: 6e 61 6d 65 73 70 61 63 65 20 65 78 70 6f 72 74  namespace export
2a00: 20 69 6e 69 74 63 73 65 74 73 0a 20 20 20 20 6e   initcsets.    n
2a10: 61 6d 65 73 70 61 63 65 20 65 76 61 6c 20 69 6e  amespace eval in
2a20: 69 74 63 73 65 74 73 20 7b 0a 09 6e 61 6d 65 73  itcsets {..names
2a30: 70 61 63 65 20 69 6d 70 6f 72 74 20 3a 3a 76 63  pace import ::vc
2a40: 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74  ::fossil::import
2a50: 3a 3a 63 76 73 3a 3a 72 65 70 6f 73 69 74 6f 72  ::cvs::repositor
2a60: 79 0a 09 6e 61 6d 65 73 70 61 63 65 20 69 6d 70  y..namespace imp
2a70: 6f 72 74 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c  ort ::vc::fossil
2a80: 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 73  ::import::cvs::s
2a90: 74 61 74 65 0a 09 6e 61 6d 65 73 70 61 63 65 20  tate..namespace 
2aa0: 69 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a 66 6f 73  import ::vc::fos
2ab0: 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73  sil::import::cvs
2ac0: 3a 3a 69 6e 74 65 67 72 69 74 79 0a 09 6e 61 6d  ::integrity..nam
2ad0: 65 73 70 61 63 65 20 65 76 61 6c 20 70 72 6f 6a  espace eval proj
2ae0: 65 63 74 20 7b 0a 09 20 20 20 20 6e 61 6d 65 73  ect {..    names
2af0: 70 61 63 65 20 69 6d 70 6f 72 74 20 3a 3a 76 63  pace import ::vc
2b00: 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74  ::fossil::import
2b10: 3a 3a 63 76 73 3a 3a 70 72 6f 6a 65 63 74 3a 3a  ::cvs::project::
2b20: 72 65 76 0a 09 7d 0a 09 6e 61 6d 65 73 70 61 63  rev..}..namespac
2b30: 65 20 65 76 61 6c 20 6d 65 6d 20 7b 0a 09 20 20  e eval mem {..  
2b40: 20 20 6e 61 6d 65 73 70 61 63 65 20 69 6d 70 6f    namespace impo
2b50: 72 74 20 3a 3a 76 63 3a 3a 74 6f 6f 6c 73 3a 3a  rt ::vc::tools::
2b60: 6d 65 6d 3a 3a 6d 61 72 6b 0a 09 7d 0a 09 6e 61  mem::mark..}..na
2b70: 6d 65 73 70 61 63 65 20 69 6d 70 6f 72 74 20 3a  mespace import :
2b80: 3a 76 63 3a 3a 74 6f 6f 6c 73 3a 3a 6d 69 73 63  :vc::tools::misc
2b90: 3a 3a 2a 0a 09 6e 61 6d 65 73 70 61 63 65 20 69  ::*..namespace i
2ba0: 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a 74 6f 6f 6c  mport ::vc::tool
2bb0: 73 3a 3a 6c 6f 67 0a 09 6c 6f 67 20 72 65 67 69  s::log..log regi
2bc0: 73 74 65 72 20 69 6e 69 74 63 73 65 74 73 0a 20  ster initcsets. 
2bd0: 20 20 20 7d 0a 7d 0a 0a 23 20 23 20 23 23 20 23     }.}..# # ## #
2be0: 23 23 20 23 23 23 23 23 20 23 23 23 23 23 23 23  ## ##### #######
2bf0: 23 20 23 23 23 23 23 23 23 23 23 23 23 23 23 20  # ############# 
2c00: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
2c10: 23 23 23 23 23 0a 23 23 20 52 65 61 64 79 0a 0a  #####.## Ready..
2c20: 70 61 63 6b 61 67 65 20 70 72 6f 76 69 64 65 20  package provide 
2c30: 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f  vc::fossil::impo
2c40: 72 74 3a 3a 63 76 73 3a 3a 70 61 73 73 3a 3a 69  rt::cvs::pass::i
2c50: 6e 69 74 63 73 65 74 73 20 31 2e 30 0a 72 65 74  nitcsets 1.0.ret
2c60: 75 72 6e 0a                                      urn.