Hex Artifact Content
Not logged in

Artifact 2e961c0798313b94c228bfc4674a55985b5d3180:

File tools/cvs2fossil/lib/c2f_pimport.tcl part of check-in [be2f99e6a4] - Merge with aku's branch. by drh on 2008-02-13 14:44:50. Also file tools/cvs2fossil/lib/c2f_pimport.tcl part of check-in [0d02fe6c7a] - Report destination file for repository, and fix bug with the naming of the destination triggered when importing a repository in toto. by aku on 2008-02-12 04:25:34.

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 58 49 49 2e 20 54 68 69 73  # Pass XII. This
0210: 20 69 73 20 74 68 65 20 66 69 72 73 74 20 6f 66   is the first of
0220: 20 74 68 65 20 62 61 63 6b 65 6e 64 20 70 61 73   the backend pas
0230: 73 65 73 2e 20 49 74 20 69 6d 70 6f 72 74 73 20  ses. It imports 
0240: 74 68 65 0a 23 23 20 63 68 61 6e 67 65 73 65 74  the.## changeset
0250: 73 20 63 6f 6e 73 74 72 75 63 74 65 64 20 62 79  s constructed by
0260: 20 74 68 65 20 70 72 65 76 69 6f 75 73 20 70 61   the previous pa
0270: 73 73 65 73 2c 20 61 6e 64 20 61 6c 6c 20 66 69  sses, and all fi
0280: 6c 65 0a 23 23 20 72 65 76 69 73 69 6f 6e 73 20  le.## revisions 
0290: 74 68 65 79 20 72 65 66 65 72 20 74 6f 20 69 6e  they refer to in
02a0: 74 6f 20 6f 6e 65 20 6f 72 20 6d 6f 72 65 20 66  to one or more f
02b0: 6f 73 73 69 6c 20 72 65 70 6f 73 69 74 6f 72 69  ossil repositori
02c0: 65 73 2c 20 6f 6e 65 0a 23 23 20 70 65 72 20 70  es, one.## per p
02d0: 72 6f 6a 65 63 74 2e 0a 0a 23 20 23 20 23 23 20  roject...# # ## 
02e0: 23 23 23 20 23 23 23 23 23 20 23 23 23 23 23 23  ### ##### ######
02f0: 23 23 20 23 23 23 23 23 23 23 23 23 23 23 23 23  ## #############
0300: 20 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23   ###############
0310: 23 23 23 23 23 23 0a 23 23 20 52 65 71 75 69 72  ######.## Requir
0320: 65 6d 65 6e 74 73 0a 0a 70 61 63 6b 61 67 65 20  ements..package 
0330: 72 65 71 75 69 72 65 20 54 63 6c 20 38 2e 34 20  require Tcl 8.4 
0340: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0350: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0360: 20 20 3b 20 23 20 52 65 71 75 69 72 65 64 20 72    ; # Required r
0370: 75 6e 74 69 6d 65 2e 0a 70 61 63 6b 61 67 65 20  untime..package 
0380: 72 65 71 75 69 72 65 20 73 6e 69 74 20 20 20 20  require snit    
0390: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
03a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
03b0: 20 20 3b 20 23 20 4f 4f 20 73 79 73 74 65 6d 2e    ; # OO system.
03c0: 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65  .package require
03d0: 20 76 63 3a 3a 74 6f 6f 6c 73 3a 3a 6c 6f 67 20   vc::tools::log 
03e0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
03f0: 20 20 20 20 20 20 20 20 20 20 20 3b 20 23 20 55             ; # U
0400: 73 65 72 20 66 65 65 64 62 61 63 6b 2e 0a 70 61  ser feedback..pa
0410: 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 76 63  ckage require vc
0420: 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74  ::fossil::import
0430: 3a 3a 63 76 73 3a 3a 72 65 70 6f 73 69 74 6f 72  ::cvs::repositor
0440: 79 20 20 20 20 20 20 20 3b 20 23 20 52 65 70 6f  y       ; # Repo
0450: 73 69 74 6f 72 79 20 6d 61 6e 61 67 65 6d 65 6e  sitory managemen
0460: 74 2e 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69  t..package requi
0470: 72 65 20 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69  re vc::fossil::i
0480: 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 73 74 61 74  mport::cvs::stat
0490: 65 20 20 20 20 20 20 20 20 20 20 20 20 3b 20 23  e            ; #
04a0: 20 53 74 61 74 65 20 73 74 6f 72 61 67 65 2e 0a   State storage..
04b0: 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 20  package require 
04c0: 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f  vc::fossil::impo
04d0: 72 74 3a 3a 63 76 73 3a 3a 66 6f 73 73 69 6c 20  rt::cvs::fossil 
04e0: 20 20 20 20 20 20 20 20 20 20 3b 20 23 20 41 63            ; # Ac
04f0: 63 65 73 73 20 74 6f 20 66 6f 73 73 69 6c 20 72  cess to fossil r
0500: 65 70 6f 73 69 74 6f 72 69 65 73 2e 0a 70 61 63  epositories..pac
0510: 6b 61 67 65 20 72 65 71 75 69 72 65 20 76 63 3a  kage require vc:
0520: 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a  :fossil::import:
0530: 3a 63 76 73 3a 3a 72 69 73 74 61 74 65 20 20 20  :cvs::ristate   
0540: 20 20 20 20 20 20 20 3b 20 23 20 49 6d 70 6f 72         ; # Impor
0550: 74 20 73 74 61 74 65 20 28 72 65 76 69 73 69 6f  t state (revisio
0560: 6e 73 29 0a 0a 23 20 23 20 23 23 20 23 23 23 20  ns)..# # ## ### 
0570: 23 23 23 23 23 20 23 23 23 23 23 23 23 23 20 23  ##### ######## #
0580: 23 23 23 23 23 23 23 23 23 23 23 23 20 23 23 23  ############ ###
0590: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
05a0: 23 23 0a 23 23 20 52 65 67 69 73 74 65 72 20 74  ##.## Register t
05b0: 68 65 20 70 61 73 73 20 77 69 74 68 20 74 68 65  he pass with the
05c0: 20 6d 61 6e 61 67 65 6d 65 6e 74 0a 0a 76 63 3a   management..vc:
05d0: 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a  :fossil::import:
05e0: 3a 63 76 73 3a 3a 70 61 73 73 20 64 65 66 69 6e  :cvs::pass defin
05f0: 65 20 5c 0a 20 20 20 20 49 6d 70 6f 72 74 20 5c  e \.    Import \
0600: 0a 20 20 20 20 7b 49 6d 70 6f 72 74 20 74 68 65  .    {Import the
0610: 20 63 68 61 6e 67 65 73 65 74 73 20 61 6e 64 20   changesets and 
0620: 66 69 6c 65 20 72 65 76 69 73 69 6f 6e 73 20 69  file revisions i
0630: 6e 74 6f 20 66 6f 73 73 69 6c 20 72 65 70 6f 73  nto fossil repos
0640: 69 74 6f 72 69 65 73 7d 20 5c 0a 20 20 20 20 3a  itories} \.    :
0650: 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70  :vc::fossil::imp
0660: 6f 72 74 3a 3a 63 76 73 3a 3a 70 61 73 73 3a 3a  ort::cvs::pass::
0670: 69 6d 70 6f 72 74 0a 0a 23 20 23 20 23 23 20 23  import..# # ## #
0680: 23 23 20 23 23 23 23 23 20 23 23 23 23 23 23 23  ## ##### #######
0690: 23 20 23 23 23 23 23 23 23 23 23 23 23 23 23 20  # ############# 
06a0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
06b0: 23 23 23 23 23 0a 23 23 0a 0a 73 6e 69 74 3a 3a  #####.##..snit::
06c0: 74 79 70 65 20 3a 3a 76 63 3a 3a 66 6f 73 73 69  type ::vc::fossi
06d0: 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a  l::import::cvs::
06e0: 70 61 73 73 3a 3a 69 6d 70 6f 72 74 20 7b 0a 20  pass::import {. 
06f0: 20 20 20 23 20 23 20 23 23 20 23 23 23 20 23 23     # # ## ### ##
0700: 23 23 23 20 23 23 23 23 23 23 23 23 20 23 23 23  ### ######## ###
0710: 23 23 23 23 23 23 23 23 23 23 0a 20 20 20 20 23  ##########.    #
0720: 23 20 50 75 62 6c 69 63 20 41 50 49 0a 0a 20 20  # Public API..  
0730: 20 20 74 79 70 65 6d 65 74 68 6f 64 20 73 65 74    typemethod set
0740: 75 70 20 7b 7d 20 7b 0a 09 23 20 44 65 66 69 6e  up {} {..# Defin
0750: 65 20 74 68 65 20 6e 61 6d 65 73 20 61 6e 64 20  e the names and 
0760: 73 74 72 75 63 74 75 72 65 20 6f 66 20 74 68 65  structure of the
0770: 20 70 65 72 73 69 73 74 65 6e 74 20 73 74 61 74   persistent stat
0780: 65 20 6f 66 0a 09 23 20 74 68 69 73 20 70 61 73  e of..# this pas
0790: 73 2e 0a 0a 09 73 74 61 74 65 20 75 73 65 20 70  s....state use p
07a0: 72 6f 6a 65 63 74 0a 09 73 74 61 74 65 20 75 73  roject..state us
07b0: 65 20 66 69 6c 65 0a 09 73 74 61 74 65 20 75 73  e file..state us
07c0: 65 20 72 65 76 69 73 69 6f 6e 0a 09 73 74 61 74  e revision..stat
07d0: 65 20 75 73 65 20 6d 65 74 61 0a 09 73 74 61 74  e use meta..stat
07e0: 65 20 75 73 65 20 61 75 74 68 6f 72 0a 09 73 74  e use author..st
07f0: 61 74 65 20 75 73 65 20 63 6d 65 73 73 61 67 65  ate use cmessage
0800: 0a 09 73 74 61 74 65 20 75 73 65 20 73 79 6d 62  ..state use symb
0810: 6f 6c 0a 0a 09 23 20 54 68 69 73 20 64 61 74 61  ol...# This data
0820: 20 69 73 20 61 63 74 75 61 6c 6c 79 20 74 72 61   is actually tra
0830: 6e 73 69 65 6e 74 2c 20 63 6f 6e 66 69 6e 65 64  nsient, confined
0840: 20 74 6f 20 74 68 69 73 20 70 61 73 73 2e 20 57   to this pass. W
0850: 65 0a 09 23 20 75 73 65 20 74 68 65 20 73 74 61  e..# use the sta
0860: 74 65 20 73 74 6f 72 61 67 65 20 6f 6e 6c 79 20  te storage only 
0870: 74 6f 20 6b 65 65 70 20 74 68 65 20 52 41 4d 20  to keep the RAM 
0880: 75 73 61 67 65 20 6c 6f 77 2e 0a 09 73 74 61 74  usage low...stat
0890: 65 20 65 78 74 65 6e 64 20 72 65 76 75 75 69 64  e extend revuuid
08a0: 20 7b 0a 09 20 20 20 20 72 69 64 20 20 20 49 4e   {..    rid   IN
08b0: 54 45 47 45 52 20 4e 4f 54 20 4e 55 4c 4c 20 20  TEGER NOT NULL  
08c0: 52 45 46 45 52 45 4e 43 45 53 20 72 65 76 69 73  REFERENCES revis
08d0: 69 6f 6e 20 55 4e 49 51 55 45 2c 0a 09 20 20 20  ion UNIQUE,..   
08e0: 20 75 75 69 64 20 20 49 4e 54 45 47 45 52 20 4e   uuid  INTEGER N
08f0: 4f 54 20 4e 55 4c 4c 20 20 2d 2d 20 66 6f 73 73  OT NULL  -- foss
0900: 69 6c 20 69 64 20 6f 66 20 74 68 65 20 72 65 76  il id of the rev
0910: 69 73 69 6f 6e 0a 09 20 20 20 20 2d 2d 20 20 20  ision..    --   
0920: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0930: 20 20 20 20 20 20 75 6e 69 71 75 65 20 77 69 74        unique wit
0940: 68 69 6e 20 74 68 65 20 70 72 6f 6a 65 63 74 0a  hin the project.
0950: 09 7d 0a 0a 09 23 20 54 68 69 73 20 69 6e 66 6f  .}...# This info
0960: 72 6d 61 74 69 6f 6e 20 69 73 20 74 72 75 6c 79  rmation is truly
0970: 20 6e 6f 6e 2d 74 72 61 6e 73 69 65 6e 74 2c 20   non-transient, 
0980: 6e 65 65 64 65 64 20 62 79 20 74 68 65 20 6e 65  needed by the ne
0990: 78 74 0a 09 23 20 70 61 73 73 20 61 64 64 69 6e  xt..# pass addin
09a0: 67 20 74 68 65 20 74 61 67 73 2e 0a 0a 09 73 74  g the tags....st
09b0: 61 74 65 20 65 78 74 65 6e 64 20 63 73 75 75 69  ate extend csuui
09c0: 64 20 7b 0a 09 20 20 20 20 63 69 64 20 20 20 49  d {..    cid   I
09d0: 4e 54 45 47 45 52 20 4e 4f 54 20 4e 55 4c 4c 20  NTEGER NOT NULL 
09e0: 20 52 45 46 45 52 45 4e 43 45 53 20 63 68 61 6e   REFERENCES chan
09f0: 67 65 73 65 74 20 55 4e 49 51 55 45 2c 0a 09 20  geset UNIQUE,.. 
0a00: 20 20 20 75 75 69 64 20 20 49 4e 54 45 47 45 52     uuid  INTEGER
0a10: 20 4e 4f 54 20 4e 55 4c 4c 20 20 2d 2d 20 66 6f   NOT NULL  -- fo
0a20: 73 73 69 6c 20 69 64 20 6f 66 20 74 68 65 20 63  ssil id of the c
0a30: 68 61 6e 67 65 73 65 74 0a 09 20 20 20 20 2d 2d  hangeset..    --
0a40: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0a50: 20 20 20 20 20 20 20 20 20 75 6e 69 71 75 65 20           unique 
0a60: 77 69 74 68 69 6e 20 74 68 65 20 70 72 6f 6a 65  within the proje
0a70: 63 74 0a 09 7d 0a 09 72 65 74 75 72 6e 0a 20 20  ct..}..return.  
0a80: 20 20 7d 0a 0a 20 20 20 20 74 79 70 65 6d 65 74    }..    typemet
0a90: 68 6f 64 20 6c 6f 61 64 20 7b 7d 20 7b 0a 09 23  hod load {} {..#
0aa0: 20 50 61 73 73 20 6d 61 6e 61 67 65 72 20 69 6e   Pass manager in
0ab0: 74 65 72 66 61 63 65 2e 20 45 78 65 63 75 74 65  terface. Execute
0ac0: 64 20 74 6f 20 6c 6f 61 64 20 64 61 74 61 20 63  d to load data c
0ad0: 6f 6d 70 75 74 65 64 20 62 79 0a 09 23 20 74 68  omputed by..# th
0ae0: 69 73 20 70 61 73 73 20 69 6e 74 6f 20 6d 65 6d  is pass into mem
0af0: 6f 72 79 20 77 68 65 6e 20 74 68 69 73 20 70 61  ory when this pa
0b00: 73 73 20 69 73 20 73 6b 69 70 70 65 64 20 69 6e  ss is skipped in
0b10: 73 74 65 61 64 20 6f 66 0a 09 23 20 65 78 65 63  stead of..# exec
0b20: 75 74 65 64 2e 0a 09 72 65 74 75 72 6e 0a 20 20  uted...return.  
0b30: 20 20 7d 0a 0a 20 20 20 20 74 79 70 65 6d 65 74    }..    typemet
0b40: 68 6f 64 20 72 75 6e 20 7b 7d 20 7b 0a 09 23 20  hod run {} {..# 
0b50: 50 61 73 73 20 6d 61 6e 61 67 65 72 20 69 6e 74  Pass manager int
0b60: 65 72 66 61 63 65 2e 20 45 78 65 63 75 74 65 64  erface. Executed
0b70: 20 74 6f 20 70 65 72 66 6f 72 6d 20 74 68 65 0a   to perform the.
0b80: 09 23 20 66 75 6e 63 74 69 6f 6e 61 6c 69 74 79  .# functionality
0b90: 20 6f 66 20 74 68 65 20 70 61 73 73 2e 0a 0a 09   of the pass....
0ba0: 66 6f 72 65 61 63 68 20 70 72 6f 6a 65 63 74 20  foreach project 
0bb0: 5b 72 65 70 6f 73 69 74 6f 72 79 20 70 72 6f 6a  [repository proj
0bc0: 65 63 74 73 5d 20 7b 0a 09 20 20 20 20 6c 6f 67  ects] {..    log
0bd0: 20 77 72 69 74 65 20 31 20 69 6d 70 6f 72 74 20   write 1 import 
0be0: 7b 49 6d 70 6f 72 74 69 6e 67 20 70 72 6f 6a 65  {Importing proje
0bf0: 63 74 20 22 5b 24 70 72 6f 6a 65 63 74 20 62 61  ct "[$project ba
0c00: 73 65 5d 22 7d 0a 0a 09 20 20 20 20 73 65 74 20  se]"}...    set 
0c10: 66 6f 73 73 69 6c 20 5b 66 6f 73 73 69 6c 20 25  fossil [fossil %
0c20: 41 55 54 4f 25 5d 0a 09 20 20 20 20 73 65 74 20  AUTO%]..    set 
0c30: 72 73 74 61 74 65 20 5b 72 69 73 74 61 74 65 20  rstate [ristate 
0c40: 25 41 55 54 4f 25 5d 0a 0a 09 20 20 20 20 73 74  %AUTO%]...    st
0c50: 61 74 65 20 74 72 61 6e 73 61 63 74 69 6f 6e 20  ate transaction 
0c60: 7b 0a 09 09 23 20 4c 61 79 65 72 20 49 3a 20 46  {...# Layer I: F
0c70: 69 6c 65 73 20 61 6e 64 20 74 68 65 69 72 20 72  iles and their r
0c80: 65 76 69 73 69 6f 6e 73 0a 09 09 66 6f 72 65 61  evisions...forea
0c90: 63 68 20 66 69 6c 65 20 5b 24 70 72 6f 6a 65 63  ch file [$projec
0ca0: 74 20 66 69 6c 65 73 5d 20 7b 0a 09 09 20 20 20  t files] {...   
0cb0: 20 24 66 69 6c 65 20 70 75 73 68 74 6f 20 24 66   $file pushto $f
0cc0: 6f 73 73 69 6c 0a 09 09 7d 0a 09 09 23 20 4c 61  ossil...}...# La
0cd0: 79 65 72 20 49 49 3a 20 43 68 61 6e 67 65 73 65  yer II: Changese
0ce0: 74 73 0a 09 09 66 6f 72 65 61 63 68 20 7b 72 65  ts...foreach {re
0cf0: 76 69 73 69 6f 6e 20 64 61 74 65 7d 20 5b 24 70  vision date} [$p
0d00: 72 6f 6a 65 63 74 20 72 65 76 69 73 69 6f 6e 73  roject revisions
0d10: 69 6e 6f 72 64 65 72 5d 20 7b 0a 09 09 20 20 20  inorder] {...   
0d20: 20 24 72 65 76 69 73 69 6f 6e 20 70 75 73 68 74   $revision pusht
0d30: 6f 20 24 66 6f 73 73 69 6c 20 24 64 61 74 65 20  o $fossil $date 
0d40: 24 72 73 74 61 74 65 0a 09 09 7d 0a 09 20 20 20  $rstate...}..   
0d50: 20 7d 0a 0a 09 20 20 20 20 24 72 73 74 61 74 65   }...    $rstate
0d60: 20 64 65 73 74 72 6f 79 0a 0a 09 20 20 20 20 23   destroy...    #
0d70: 20 41 74 20 6c 61 73 74 20 63 6f 70 79 20 74 68   At last copy th
0d80: 65 20 74 65 6d 70 6f 72 61 72 79 20 72 65 70 6f  e temporary repo
0d90: 73 69 74 6f 72 79 20 66 69 6c 65 20 74 6f 20 69  sitory file to i
0da0: 74 73 20 66 69 6e 61 6c 0a 09 20 20 20 20 23 20  ts final..    # 
0db0: 64 65 73 74 69 6e 61 74 69 6f 6e 20 61 6e 64 20  destination and 
0dc0: 72 65 6c 65 61 73 65 20 74 68 65 20 61 73 73 6f  release the asso
0dd0: 63 69 61 74 65 64 20 6d 65 6d 6f 72 79 2e 0a 0a  ciated memory...
0de0: 09 20 20 20 20 73 65 74 20 64 65 73 74 69 6e 61  .    set destina
0df0: 74 69 6f 6e 20 5b 24 70 72 6f 6a 65 63 74 20 62  tion [$project b
0e00: 61 73 65 5d 0a 09 20 20 20 20 69 66 20 7b 24 64  ase]..    if {$d
0e10: 65 73 74 69 6e 61 74 69 6f 6e 20 65 71 20 22 22  estination eq ""
0e20: 7d 20 7b 0a 09 09 73 65 74 20 64 65 73 74 69 6e  } {...set destin
0e30: 61 74 69 6f 6e 20 5b 66 69 6c 65 20 74 61 69 6c  ation [file tail
0e40: 20 5b 72 65 70 6f 73 69 74 6f 72 79 20 62 61 73   [repository bas
0e50: 65 3f 5d 5d 0a 09 20 20 20 20 7d 0a 09 20 20 20  e?]]..    }..   
0e60: 20 61 70 70 65 6e 64 20 64 65 73 74 69 6e 61 74   append destinat
0e70: 69 6f 6e 20 2e 66 73 6c 0a 0a 09 20 20 20 20 24  ion .fsl...    $
0e80: 66 6f 73 73 69 6c 20 66 69 6e 61 6c 69 7a 65 20  fossil finalize 
0e90: 24 64 65 73 74 69 6e 61 74 69 6f 6e 0a 09 7d 0a  $destination..}.
0ea0: 0a 09 23 20 54 68 69 73 20 64 6f 65 73 20 6e 6f  ..# This does no
0eb0: 74 20 6c 69 76 65 20 62 65 79 6f 6e 64 20 74 68  t live beyond th
0ec0: 65 20 70 61 73 73 2e 20 57 65 20 75 73 65 20 74  e pass. We use t
0ed0: 68 65 20 73 74 61 74 65 20 66 6f 72 20 74 68 65  he state for the
0ee0: 0a 09 23 20 64 61 74 61 20 64 65 73 70 69 74 65  ..# data despite
0ef0: 20 69 74 73 20 74 72 61 6e 73 69 65 6e 74 20 6e   its transient n
0f00: 61 74 75 72 65 20 74 6f 20 6b 65 65 70 20 74 68  ature to keep th
0f10: 65 20 6d 65 6d 6f 72 79 0a 09 23 20 72 65 71 75  e memory..# requ
0f20: 69 72 65 6d 65 6e 74 73 20 64 6f 77 6e 2e 0a 09  irements down...
0f30: 23 73 74 61 74 65 20 64 69 73 63 61 72 64 20 72  #state discard r
0f40: 65 76 75 75 69 64 0a 09 72 65 74 75 72 6e 0a 20  evuuid..return. 
0f50: 20 20 20 7d 0a 0a 20 20 20 20 74 79 70 65 6d 65     }..    typeme
0f60: 74 68 6f 64 20 64 69 73 63 61 72 64 20 7b 7d 20  thod discard {} 
0f70: 7b 0a 09 23 20 50 61 73 73 20 6d 61 6e 61 67 65  {..# Pass manage
0f80: 72 20 69 6e 74 65 72 66 61 63 65 2e 20 45 78 65  r interface. Exe
0f90: 63 75 74 65 64 20 66 6f 72 20 61 6c 6c 20 70 61  cuted for all pa
0fa0: 73 73 65 73 20 61 66 74 65 72 20 74 68 65 0a 09  sses after the..
0fb0: 23 20 72 75 6e 20 70 61 73 73 65 73 2c 20 74 6f  # run passes, to
0fc0: 20 72 65 6d 6f 76 65 20 61 6c 6c 20 64 61 74 61   remove all data
0fd0: 20 6f 66 20 74 68 69 73 20 70 61 73 73 20 66 72   of this pass fr
0fe0: 6f 6d 20 74 68 65 20 73 74 61 74 65 2c 0a 09 23  om the state,..#
0ff0: 20 61 73 20 62 65 69 6e 67 20 6f 75 74 20 6f 66   as being out of
1000: 20 64 61 74 65 2e 0a 09 72 65 74 75 72 6e 0a 20   date...return. 
1010: 20 20 20 7d 0a 0a 20 20 20 20 23 20 23 20 23 23     }..    # # ##
1020: 20 23 23 23 20 23 23 23 23 23 20 23 23 23 23 23   ### ##### #####
1030: 23 23 23 20 23 23 23 23 23 23 23 23 23 23 23 23  ### ############
1040: 23 0a 20 20 20 20 23 23 20 49 6e 74 65 72 6e 61  #.    ## Interna
1050: 6c 20 6d 65 74 68 6f 64 73 0a 0a 20 20 20 20 23  l methods..    #
1060: 20 23 20 23 23 20 23 23 23 20 23 23 23 23 23 20   # ## ### ##### 
1070: 23 23 23 23 23 23 23 23 20 23 23 23 23 23 23 23  ######## #######
1080: 23 23 23 23 23 23 0a 20 20 20 20 23 23 20 43 6f  ######.    ## Co
1090: 6e 66 69 67 75 72 61 74 69 6f 6e 0a 0a 20 20 20  nfiguration..   
10a0: 20 70 72 61 67 6d 61 20 2d 68 61 73 69 6e 73 74   pragma -hasinst
10b0: 61 6e 63 65 73 20 20 20 6e 6f 20 3b 20 23 20 73  ances   no ; # s
10c0: 69 6e 67 6c 65 74 6f 6e 0a 20 20 20 20 70 72 61  ingleton.    pra
10d0: 67 6d 61 20 2d 68 61 73 74 79 70 65 69 6e 66 6f  gma -hastypeinfo
10e0: 20 20 20 20 6e 6f 20 3b 20 23 20 6e 6f 20 69 6e      no ; # no in
10f0: 74 72 6f 73 70 65 63 74 69 6f 6e 0a 20 20 20 20  trospection.    
1100: 70 72 61 67 6d 61 20 2d 68 61 73 74 79 70 65 64  pragma -hastyped
1110: 65 73 74 72 6f 79 20 6e 6f 20 3b 20 23 20 69 6d  estroy no ; # im
1120: 6d 6f 72 74 61 6c 0a 0a 20 20 20 20 23 20 23 20  mortal..    # # 
1130: 23 23 20 23 23 23 20 23 23 23 23 23 20 23 23 23  ## ### ##### ###
1140: 23 23 23 23 23 20 23 23 23 23 23 23 23 23 23 23  ##### ##########
1150: 23 23 23 0a 7d 0a 0a 6e 61 6d 65 73 70 61 63 65  ###.}..namespace
1160: 20 65 76 61 6c 20 3a 3a 76 63 3a 3a 66 6f 73 73   eval ::vc::foss
1170: 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a  il::import::cvs:
1180: 3a 70 61 73 73 20 7b 0a 20 20 20 20 6e 61 6d 65  :pass {.    name
1190: 73 70 61 63 65 20 65 78 70 6f 72 74 20 69 6d 70  space export imp
11a0: 6f 72 74 0a 20 20 20 20 6e 61 6d 65 73 70 61 63  ort.    namespac
11b0: 65 20 65 76 61 6c 20 69 6d 70 6f 72 74 20 7b 0a  e eval import {.
11c0: 09 6e 61 6d 65 73 70 61 63 65 20 69 6d 70 6f 72  .namespace impor
11d0: 74 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a  t ::vc::fossil::
11e0: 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 72 65 70  import::cvs::rep
11f0: 6f 73 69 74 6f 72 79 0a 09 6e 61 6d 65 73 70 61  ository..namespa
1200: 63 65 20 69 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a  ce import ::vc::
1210: 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a  fossil::import::
1220: 63 76 73 3a 3a 73 74 61 74 65 0a 09 6e 61 6d 65  cvs::state..name
1230: 73 70 61 63 65 20 69 6d 70 6f 72 74 20 3a 3a 76  space import ::v
1240: 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72  c::fossil::impor
1250: 74 3a 3a 63 76 73 3a 3a 66 6f 73 73 69 6c 0a 09  t::cvs::fossil..
1260: 6e 61 6d 65 73 70 61 63 65 20 69 6d 70 6f 72 74  namespace import
1270: 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69   ::vc::fossil::i
1280: 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 72 69 73 74  mport::cvs::rist
1290: 61 74 65 0a 09 6e 61 6d 65 73 70 61 63 65 20 69  ate..namespace i
12a0: 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a 74 6f 6f 6c  mport ::vc::tool
12b0: 73 3a 3a 6c 6f 67 0a 09 6c 6f 67 20 72 65 67 69  s::log..log regi
12c0: 73 74 65 72 20 69 6d 70 6f 72 74 0a 20 20 20 20  ster import.    
12d0: 7d 0a 7d 0a 0a 23 20 23 20 23 23 20 23 23 23 20  }.}..# # ## ### 
12e0: 23 23 23 23 23 20 23 23 23 23 23 23 23 23 20 23  ##### ######## #
12f0: 23 23 23 23 23 23 23 23 23 23 23 23 20 23 23 23  ############ ###
1300: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
1310: 23 23 0a 23 23 20 52 65 61 64 79 0a 0a 70 61 63  ##.## Ready..pac
1320: 6b 61 67 65 20 70 72 6f 76 69 64 65 20 76 63 3a  kage provide vc:
1330: 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a  :fossil::import:
1340: 3a 63 76 73 3a 3a 70 61 73 73 3a 3a 69 6d 70 6f  :cvs::pass::impo
1350: 72 74 20 31 2e 30 0a 72 65 74 75 72 6e 0a        rt 1.0.return.