Hex Artifact Content
Not logged in

Artifact 5c566fc378c34de8a2d3ae1a47b5576bd53236e6:

File tools/cvs2fossil/lib/c2f_pcollar.tcl part of check-in [47740cc1f6] - Added stub for repository management, added most of pass I, collecting archives in the repository. by aku on 2007-10-03 04:18:18.

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 49 2e 20 54 68 69 73 20 70 61 73 73 20 73  s I. This pass s
0210: 63 61 6e 73 20 74 68 65 20 72 65 70 6f 73 69 74  cans the reposit
0220: 6f 72 79 20 74 6f 20 69 6d 70 6f 72 74 20 66 6f  ory to import fo
0230: 72 20 52 43 53 20 61 72 63 68 69 76 65 73 2c 0a  r RCS archives,.
0240: 23 23 20 61 6e 64 20 73 6f 72 74 73 20 61 6e 64  ## and sorts and
0250: 20 66 69 6c 74 65 72 73 20 74 68 65 6d 20 69 6e   filters them in
0260: 74 6f 20 74 68 65 20 64 65 63 6c 61 72 65 64 20  to the declared 
0270: 70 72 6f 6a 65 63 74 73 2c 20 69 66 20 61 6e 79  projects, if any
0280: 0a 23 23 20 57 69 74 68 6f 75 74 20 64 65 63 6c  .## Without decl
0290: 61 72 65 64 20 70 72 6f 6a 65 63 74 73 20 74 68  ared projects th
02a0: 65 20 77 68 6f 6c 65 20 72 65 70 6f 73 69 74 6f  e whole reposito
02b0: 72 79 20 69 73 20 74 72 65 61 74 65 64 20 61 73  ry is treated as
02c0: 20 61 0a 23 23 20 73 69 6e 67 6c 65 20 70 72 6f   a.## single pro
02d0: 6a 65 63 74 2e 0a 0a 23 20 23 20 23 23 20 23 23  ject...# # ## ##
02e0: 23 20 23 23 23 23 23 20 23 23 23 23 23 23 23 23  # ##### ########
02f0: 20 23 23 23 23 23 23 23 23 23 23 23 23 23 20 23   ############# #
0300: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
0310: 23 23 23 23 0a 23 23 20 52 65 71 75 69 72 65 6d  ####.## Requirem
0320: 65 6e 74 73 0a 0a 70 61 63 6b 61 67 65 20 72 65  ents..package re
0330: 71 75 69 72 65 20 54 63 6c 20 38 2e 34 20 20 20  quire 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 3b 20 23 20 52 65            ; # Re
0360: 71 75 69 72 65 64 20 72 75 6e 74 69 6d 65 2e 0a  quired runtime..
0370: 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 20  package require 
0380: 73 6e 69 74 20 20 20 20 20 20 20 20 20 20 20 20  snit            
0390: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
03a0: 20 20 20 20 3b 20 23 20 4f 4f 20 73 79 73 74 65      ; # OO syste
03b0: 6d 2e 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69  m..package requi
03c0: 72 65 20 66 69 6c 65 75 74 69 6c 3a 3a 74 72 61  re fileutil::tra
03d0: 76 65 72 73 65 20 20 20 20 20 20 20 20 20 20 20  verse           
03e0: 20 20 20 20 20 20 20 3b 20 23 20 44 69 72 65 63         ; # Direc
03f0: 74 6f 72 79 20 74 72 61 76 65 72 73 61 6c 2e 0a  tory traversal..
0400: 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 20  package require 
0410: 66 69 6c 65 75 74 69 6c 20 20 20 20 20 20 20 20  fileutil        
0420: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0430: 20 20 20 20 3b 20 23 20 46 69 6c 65 20 26 20 70      ; # File & p
0440: 61 74 68 20 75 74 69 6c 69 74 69 65 73 2e 0a 70  ath utilities..p
0450: 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 76  ackage require v
0460: 63 3a 3a 74 6f 6f 6c 73 3a 3a 74 72 6f 75 62 6c  c::tools::troubl
0470: 65 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  e               
0480: 20 20 20 3b 20 23 20 45 72 72 6f 72 20 72 65 70     ; # Error rep
0490: 6f 72 74 69 6e 67 2e 0a 70 61 63 6b 61 67 65 20  orting..package 
04a0: 72 65 71 75 69 72 65 20 76 63 3a 3a 74 6f 6f 6c  require vc::tool
04b0: 73 3a 3a 6c 6f 67 20 20 20 20 20 20 20 20 20 20  s::log          
04c0: 20 20 20 20 20 20 20 20 20 20 20 20 3b 20 23 20              ; # 
04d0: 55 73 65 72 20 66 65 65 64 62 61 63 6b 2e 0a 70  User feedback..p
04e0: 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 76  ackage require v
04f0: 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72  c::fossil::impor
0500: 74 3a 3a 63 76 73 3a 3a 70 61 73 73 20 20 20 20  t::cvs::pass    
0510: 20 20 20 3b 20 23 20 50 61 73 73 20 6d 61 6e 61     ; # Pass mana
0520: 67 65 6d 65 6e 74 2e 0a 70 61 63 6b 61 67 65 20  gement..package 
0530: 72 65 71 75 69 72 65 20 76 63 3a 3a 66 6f 73 73  require vc::foss
0540: 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a  il::import::cvs:
0550: 3a 72 65 70 6f 73 69 74 6f 72 79 20 3b 20 23 20  :repository ; # 
0560: 52 65 70 6f 73 69 74 6f 72 79 20 6d 61 6e 61 67  Repository manag
0570: 65 6d 65 6e 74 2e 0a 0a 23 20 23 20 23 23 20 23  ement...# # ## #
0580: 23 23 20 23 23 23 23 23 20 23 23 23 23 23 23 23  ## ##### #######
0590: 23 20 23 23 23 23 23 23 23 23 23 23 23 23 23 20  # ############# 
05a0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
05b0: 23 23 23 23 23 0a 23 23 20 52 65 67 69 73 74 65  #####.## Registe
05c0: 72 20 74 68 65 20 70 61 73 73 20 77 69 74 68 20  r the pass with 
05d0: 74 68 65 20 6d 61 6e 61 67 65 6d 65 6e 74 0a 0a  the management..
05e0: 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f  vc::fossil::impo
05f0: 72 74 3a 3a 63 76 73 3a 3a 70 61 73 73 20 64 65  rt::cvs::pass de
0600: 66 69 6e 65 20 5c 0a 20 20 20 20 43 6f 6c 6c 65  fine \.    Colle
0610: 63 74 41 72 20 5c 0a 20 20 20 20 7b 43 6f 6c 6c  ctAr \.    {Coll
0620: 65 63 74 20 61 72 63 68 69 76 65 73 20 69 6e 20  ect archives in 
0630: 72 65 70 6f 73 69 74 6f 72 79 7d 20 5c 0a 20 20  repository} \.  
0640: 20 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a    ::vc::fossil::
0650: 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 70 61 73  import::cvs::pas
0660: 73 3a 3a 63 6f 6c 6c 61 72 0a 0a 23 20 23 20 23  s::collar..# # #
0670: 23 20 23 23 23 20 23 23 23 23 23 20 23 23 23 23  # ### ##### ####
0680: 23 23 23 23 20 23 23 23 23 23 23 23 23 23 23 23  #### ###########
0690: 23 23 20 23 23 23 23 23 23 23 23 23 23 23 23 23  ## #############
06a0: 23 23 23 23 23 23 23 23 0a 23 23 20 0a 0a 73 6e  ########.## ..sn
06b0: 69 74 3a 3a 74 79 70 65 20 3a 3a 76 63 3a 3a 66  it::type ::vc::f
06c0: 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63  ossil::import::c
06d0: 76 73 3a 3a 70 61 73 73 3a 3a 63 6f 6c 6c 61 72  vs::pass::collar
06e0: 20 7b 0a 20 20 20 20 23 20 23 20 23 23 20 23 23   {.    # # ## ##
06f0: 23 20 23 23 23 23 23 20 23 23 23 23 23 23 23 23  # ##### ########
0700: 20 23 23 23 23 23 23 23 23 23 23 23 23 23 0a 20   #############. 
0710: 20 20 20 23 23 20 50 75 62 6c 69 63 20 41 50 49     ## Public API
0720: 0a 0a 20 20 20 20 74 79 70 65 6d 65 74 68 6f 64  ..    typemethod
0730: 20 73 65 74 75 70 20 7b 7d 20 7b 0a 09 23 20 54   setup {} {..# T
0740: 4f 44 4f 20 2e 2e 2e 20 61 72 74 69 66 61 63 74  ODO ... artifact
0750: 2f 63 61 63 68 65 20 2d 20 64 72 6f 70 20 70 72  /cache - drop pr
0760: 6f 6a 65 63 74 73 2f 66 69 6c 65 73 2c 20 63 72  ojects/files, cr
0770: 65 61 74 65 20 70 72 6f 6a 65 63 74 73 2f 66 69  eate projects/fi
0780: 6c 65 73 0a 20 20 20 20 7d 0a 0a 20 20 20 20 74  les.    }..    t
0790: 79 70 65 6d 65 74 68 6f 64 20 72 75 6e 20 7b 7d  ypemethod run {}
07a0: 20 7b 0a 09 66 6f 72 65 61 63 68 20 70 72 6f 6a   {..foreach proj
07b0: 65 63 74 20 5b 72 65 70 6f 73 69 74 6f 72 79 20  ect [repository 
07c0: 70 72 6f 6a 65 63 74 73 5d 20 7b 0a 09 20 20 20  projects] {..   
07d0: 20 73 65 74 20 62 61 73 65 20 5b 24 70 72 6f 6a   set base [$proj
07e0: 65 63 74 20 62 61 73 65 5d 0a 09 20 20 20 20 6c  ect base]..    l
07f0: 6f 67 20 77 72 69 74 65 20 31 20 63 6f 6c 6c 61  og write 1 colla
0800: 72 20 22 53 63 61 6e 20 24 62 61 73 65 22 0a 0a  r "Scan $base"..
0810: 09 20 20 20 20 73 65 74 20 74 72 61 76 65 72 73  .    set travers
0820: 65 20 5b 66 69 6c 65 75 74 69 6c 3a 3a 74 72 61  e [fileutil::tra
0830: 76 65 72 73 65 20 25 41 55 54 4f 25 20 24 62 61  verse %AUTO% $ba
0840: 73 65 5d 0a 09 20 20 20 20 73 65 74 20 6e 20 30  se]..    set n 0
0850: 0a 09 20 20 20 20 73 65 74 20 72 20 7b 7d 0a 0a  ..    set r {}..
0860: 09 20 20 20 20 24 74 72 61 76 65 72 73 65 20 66  .    $traverse f
0870: 6f 72 65 61 63 68 20 70 61 74 68 20 7b 0a 09 09  oreach path {...
0880: 73 65 74 20 72 63 73 20 5b 66 69 6c 65 75 74 69  set rcs [fileuti
0890: 6c 3a 3a 73 74 72 69 70 50 61 74 68 20 24 62 61  l::stripPath $ba
08a0: 73 65 20 24 70 61 74 68 5d 0a 09 09 69 66 20 7b  se $path]...if {
08b0: 5b 49 73 43 56 53 41 64 6d 69 6e 20 20 20 20 24  [IsCVSAdmin    $
08c0: 72 63 73 5d 7d 20 20 63 6f 6e 74 69 6e 75 65 0a  rcs]}  continue.
08d0: 09 09 69 66 20 7b 21 5b 49 73 52 43 53 41 72 63  ..if {![IsRCSArc
08e0: 68 69 76 65 20 24 70 61 74 68 5d 7d 20 63 6f 6e  hive $path]} con
08f0: 74 69 6e 75 65 0a 0a 09 09 73 65 74 20 75 73 72  tinue....set usr
0900: 20 5b 55 73 65 72 50 61 74 68 20 24 72 63 73 20   [UserPath $rcs 
0910: 69 73 61 74 74 69 63 5d 0a 09 09 69 66 20 7b 5b  isattic]...if {[
0920: 49 73 53 75 70 65 72 63 65 64 65 64 20 24 62 61  IsSuperceded $ba
0930: 73 65 20 24 72 63 73 20 24 75 73 72 20 24 69 73  se $rcs $usr $is
0940: 61 74 74 69 63 5d 7d 20 63 6f 6e 74 69 6e 75 65  attic]} continue
0950: 0a 0a 09 09 6c 6f 67 20 77 72 69 74 65 20 31 20  ....log write 1 
0960: 63 6f 6c 6c 61 72 20 22 46 6f 75 6e 64 20 20 20  collar "Found   
0970: 24 72 63 73 22 0a 09 09 24 70 72 6f 6a 65 63 74  $rcs"...$project
0980: 20 61 64 64 20 24 72 63 73 20 24 75 73 72 0a 0a   add $rcs $usr..
0990: 09 09 69 6e 63 72 20 6e 0a 09 09 6c 6f 67 20 70  ..incr n...log p
09a0: 72 6f 67 72 65 73 73 20 30 20 63 6f 6c 6c 61 72  rogress 0 collar
09b0: 20 24 6e 20 7b 7d 0a 09 20 20 20 20 7d 0a 0a 09   $n {}..    }...
09c0: 20 20 20 20 24 74 72 61 76 65 72 73 65 20 64 65      $traverse de
09d0: 73 74 72 6f 79 0a 09 7d 0a 09 72 65 74 75 72 6e  stroy..}..return
09e0: 0a 20 20 20 20 7d 0a 0a 20 20 20 20 74 79 70 65  .    }..    type
09f0: 6d 65 74 68 6f 64 20 69 67 6e 6f 72 65 5f 63 6f  method ignore_co
0a00: 6e 66 6c 69 63 74 69 6e 67 5f 61 74 74 69 63 73  nflicting_attics
0a10: 20 7b 7d 20 7b 0a 09 73 65 74 20 69 67 6e 6f 72   {} {..set ignor
0a20: 65 20 31 0a 09 72 65 74 75 72 6e 0a 20 20 20 20  e 1..return.    
0a30: 7d 0a 0a 20 20 20 20 23 20 23 20 23 23 20 23 23  }..    # # ## ##
0a40: 23 20 23 23 23 23 23 20 23 23 23 23 23 23 23 23  # ##### ########
0a50: 20 23 23 23 23 23 23 23 23 23 23 23 23 23 0a 20   #############. 
0a60: 20 20 20 23 23 20 49 6e 74 65 72 6e 61 6c 20 6d     ## Internal m
0a70: 65 74 68 6f 64 73 0a 0a 20 20 20 20 74 79 70 65  ethods..    type
0a80: 76 61 72 69 61 62 6c 65 20 69 67 6e 6f 72 65 20  variable ignore 
0a90: 30 0a 0a 20 20 20 20 70 72 6f 63 20 49 73 52 43  0..    proc IsRC
0aa0: 53 41 72 63 68 69 76 65 20 7b 70 61 74 68 7d 20  SArchive {path} 
0ab0: 7b 0a 09 69 66 20 7b 21 5b 73 74 72 69 6e 67 20  {..if {![string 
0ac0: 6d 61 74 63 68 20 2a 2c 76 20 24 70 61 74 68 5d  match *,v $path]
0ad0: 7d 20 20 20 20 20 7b 72 65 74 75 72 6e 20 30 7d  }     {return 0}
0ae0: 0a 09 69 66 20 7b 5b 66 69 6c 65 75 74 69 6c 3a  ..if {[fileutil:
0af0: 3a 74 65 73 74 20 24 70 61 74 68 20 66 72 20 6d  :test $path fr m
0b00: 73 67 5d 7d 20 7b 72 65 74 75 72 6e 20 31 7d 0a  sg]} {return 1}.
0b10: 09 74 72 6f 75 62 6c 65 20 77 61 72 6e 20 24 6d  .trouble warn $m
0b20: 73 67 0a 09 72 65 74 75 72 6e 20 30 0a 20 20 20  sg..return 0.   
0b30: 20 7d 0a 0a 20 20 20 20 70 72 6f 63 20 49 73 43   }..    proc IsC
0b40: 56 53 41 64 6d 69 6e 20 7b 72 63 73 7d 20 7b 0a  VSAdmin {rcs} {.
0b50: 09 69 66 20 7b 21 5b 73 74 72 69 6e 67 20 6d 61  .if {![string ma
0b60: 74 63 68 20 43 56 53 52 4f 4f 54 2f 2a 20 24 72  tch CVSROOT/* $r
0b70: 63 73 5d 7d 20 7b 72 65 74 75 72 6e 20 30 7d 0a  cs]} {return 0}.
0b80: 09 6c 6f 67 20 77 72 69 74 65 20 32 20 63 6f 6c  .log write 2 col
0b90: 6c 61 72 20 22 49 67 6e 6f 72 65 64 20 24 72 63  lar "Ignored $rc
0ba0: 73 2c 20 61 64 6d 69 6e 69 73 74 72 61 74 69 76  s, administrativ
0bb0: 65 20 61 72 63 68 69 76 65 22 0a 09 72 65 74 75  e archive"..retu
0bc0: 72 6e 20 31 0a 20 20 20 20 7d 0a 0a 20 20 20 20  rn 1.    }..    
0bd0: 70 72 6f 63 20 55 73 65 72 50 61 74 68 20 7b 72  proc UserPath {r
0be0: 63 73 20 69 61 76 7d 20 7b 0a 09 75 70 76 61 72  cs iav} {..upvar
0bf0: 20 31 20 24 69 61 76 20 69 73 61 74 74 69 63 0a   1 $iav isattic.
0c00: 0a 09 23 20 44 65 72 69 76 65 20 74 68 65 20 75  ..# Derive the u
0c10: 73 65 72 2d 76 69 73 69 62 6c 65 20 70 61 74 68  ser-visible path
0c20: 20 66 72 6f 6d 20 74 68 65 20 72 63 73 20 70 61   from the rcs pa
0c30: 74 68 2e 20 4d 65 61 6e 69 6e 67 3a 0a 09 23 20  th. Meaning:..# 
0c40: 43 68 6f 70 20 6f 66 66 20 74 68 65 20 22 2c 76  Chop off the ",v
0c50: 22 20 73 75 66 66 69 78 2c 20 61 6e 64 20 72 65  " suffix, and re
0c60: 6d 6f 76 65 20 61 20 70 6f 73 73 69 62 6c 65 20  move a possible 
0c70: 22 41 74 74 69 63 22 2e 0a 0a 09 73 65 74 20 66  "Attic"....set f
0c80: 20 5b 73 74 72 69 6e 67 20 72 61 6e 67 65 20 24   [string range $
0c90: 72 63 73 20 30 20 65 6e 64 2d 32 5d 0a 0a 09 69  rcs 0 end-2]...i
0ca0: 66 20 7b 22 41 74 74 69 63 22 20 65 71 20 5b 6c  f {"Attic" eq [l
0cb0: 69 6e 64 65 78 20 5b 66 69 6c 65 20 73 70 6c 69  index [file spli
0cc0: 74 20 24 72 63 73 5d 20 65 6e 64 2d 31 5d 7d 20  t $rcs] end-1]} 
0cd0: 7b 0a 0a 09 20 20 20 20 23 20 54 68 65 20 63 6f  {...    # The co
0ce0: 6e 73 74 72 75 63 74 69 6f 6e 20 62 65 6c 6f 77  nstruction below
0cf0: 20 65 6e 73 75 72 65 73 20 74 68 61 74 20 41 74   ensures that At
0d00: 74 69 63 2f 58 20 6d 61 70 73 20 74 6f 20 58 0a  tic/X maps to X.
0d10: 09 20 20 20 20 23 20 69 6e 73 74 65 61 64 20 6f  .    # instead o
0d20: 66 20 2e 2f 58 2e 20 4f 74 68 65 72 77 69 73 65  f ./X. Otherwise
0d30: 2c 20 59 2f 41 74 74 69 63 2f 58 20 6d 61 70 73  , Y/Attic/X maps
0d40: 20 74 6f 20 59 2f 58 2e 0a 0a 09 20 20 20 20 73   to Y/X....    s
0d50: 65 74 20 66 78 20 5b 66 69 6c 65 20 64 69 72 6e  et fx [file dirn
0d60: 61 6d 65 20 5b 66 69 6c 65 20 64 69 72 6e 61 6d  ame [file dirnam
0d70: 65 20 24 66 5d 5d 0a 09 20 20 20 20 73 65 74 20  e $f]]..    set 
0d80: 66 20 20 5b 66 69 6c 65 20 74 61 69 6c 20 24 66  f  [file tail $f
0d90: 5d 0a 09 20 20 20 20 69 66 20 7b 24 66 78 20 6e  ]..    if {$fx n
0da0: 65 20 22 2e 22 7d 20 7b 20 73 65 74 20 66 20 5b  e "."} { set f [
0db0: 66 69 6c 65 20 6a 6f 69 6e 20 24 66 78 20 24 66  file join $fx $f
0dc0: 5d 20 7d 0a 0a 09 20 20 20 20 73 65 74 20 69 73  ] }...    set is
0dd0: 61 74 74 69 63 20 31 0a 09 7d 20 65 6c 73 65 20  attic 1..} else 
0de0: 7b 0a 09 20 20 20 20 73 65 74 20 69 73 61 74 74  {..    set isatt
0df0: 69 63 20 30 0a 09 7d 0a 0a 09 72 65 74 75 72 6e  ic 0..}...return
0e00: 20 24 66 0a 20 20 20 20 7d 0a 0a 20 20 20 20 70   $f.    }..    p
0e10: 72 6f 63 20 49 73 53 75 70 65 72 63 65 64 65 64  roc IsSuperceded
0e20: 20 7b 62 61 73 65 20 72 63 73 20 75 73 72 20 69   {base rcs usr i
0e30: 73 61 74 74 69 63 7d 20 7b 0a 09 69 66 20 7b 21  sattic} {..if {!
0e40: 24 69 73 61 74 74 69 63 7d 20 20 20 20 20 20 20  $isattic}       
0e50: 20 20 20 20 20 20 20 20 20 20 20 20 7b 72 65 74              {ret
0e60: 75 72 6e 20 30 7d 0a 09 69 66 20 7b 21 5b 66 69  urn 0}..if {![fi
0e70: 6c 65 20 65 78 69 73 74 73 20 24 62 61 73 65 2f  le exists $base/
0e80: 24 75 73 72 2c 76 5d 7d 20 7b 72 65 74 75 72 6e  $usr,v]} {return
0e90: 20 30 7d 0a 0a 09 23 20 57 65 20 68 61 76 65 20   0}...# We have 
0ea0: 61 20 72 65 67 75 6c 61 72 20 61 72 63 68 69 76  a regular archiv
0eb0: 65 20 61 6e 64 20 61 6e 20 41 74 74 69 63 20 61  e and an Attic a
0ec0: 72 63 68 69 76 65 20 72 65 66 65 72 69 6e 67 20  rchive refering 
0ed0: 74 6f 0a 09 23 20 74 68 65 20 73 61 6d 65 20 75  to..# the same u
0ee0: 73 65 72 20 76 69 73 69 62 6c 65 20 66 69 6c 65  ser visible file
0ef0: 2e 20 49 67 6e 6f 72 65 20 74 68 65 20 66 69 6c  . Ignore the fil
0f00: 65 20 69 6e 20 74 68 65 20 41 74 74 69 63 2e 0a  e in the Attic..
0f10: 09 23 0a 09 23 20 42 79 20 64 65 66 61 75 6c 74  .#..# By default
0f20: 20 74 68 69 73 20 69 73 20 61 20 70 72 6f 62 6c   this is a probl
0f30: 65 6d 20 63 61 75 73 69 6e 67 20 61 6e 20 61 62  em causing an ab
0f40: 6f 72 74 20 61 66 74 65 72 20 74 68 65 20 70 61  ort after the pa
0f50: 73 73 0a 09 23 20 68 61 73 20 63 6f 6d 70 6c 65  ss..# has comple
0f60: 74 65 64 2e 20 54 68 65 20 75 73 65 72 20 63 61  ted. The user ca
0f70: 6e 20 68 6f 77 65 76 65 72 20 66 6f 72 63 65 20  n however force 
0f80: 75 73 20 74 6f 20 69 67 6e 6f 72 65 20 69 74 2e  us to ignore it.
0f90: 0a 09 23 20 49 6e 20 74 68 61 74 20 63 61 73 65  ..# In that case
0fa0: 20 74 68 65 20 77 61 72 6e 69 6e 67 20 69 73 20   the warning is 
0fb0: 73 74 69 6c 6c 20 70 72 69 6e 74 65 64 2c 20 62  still printed, b
0fc0: 75 74 20 77 69 6c 6c 20 6e 6f 74 0a 09 23 20 69  ut will not..# i
0fd0: 6e 64 75 63 65 20 61 6e 20 61 62 6f 72 74 20 61  nduce an abort a
0fe0: 6e 79 20 6c 6f 6e 67 65 72 2e 0a 0a 09 69 66 20  ny longer....if 
0ff0: 7b 24 69 67 6e 6f 72 65 7d 20 7b 0a 09 20 20 20  {$ignore} {..   
1000: 20 6c 6f 67 20 77 72 69 74 65 20 32 20 63 6f 6c   log write 2 col
1010: 6c 61 72 20 22 49 67 6e 6f 72 65 64 20 24 72 63  lar "Ignored $rc
1020: 73 2c 20 73 75 70 65 72 63 65 64 65 64 20 61 72  s, superceded ar
1030: 63 68 69 76 65 22 0a 09 7d 20 65 6c 73 65 20 7b  chive"..} else {
1040: 0a 09 20 20 20 20 74 72 6f 75 62 6c 65 20 77 61  ..    trouble wa
1050: 72 6e 20 20 20 20 20 20 20 22 49 67 6e 6f 72 65  rn       "Ignore
1060: 64 20 24 72 63 73 2c 20 73 75 70 65 72 63 65 64  d $rcs, superced
1070: 65 64 20 61 72 63 68 69 76 65 22 0a 09 7d 0a 09  ed archive"..}..
1080: 72 65 74 75 72 6e 20 31 0a 20 20 20 20 7d 0a 0a  return 1.    }..
1090: 20 20 20 20 23 20 23 20 23 23 20 23 23 23 20 23      # # ## ### #
10a0: 23 23 23 23 20 23 23 23 23 23 23 23 23 20 23 23  #### ######## ##
10b0: 23 23 23 23 23 23 23 23 23 23 23 0a 20 20 20 20  ###########.    
10c0: 23 23 20 43 6f 6e 66 69 67 75 72 61 74 69 6f 6e  ## Configuration
10d0: 0a 0a 20 20 20 20 70 72 61 67 6d 61 20 2d 68 61  ..    pragma -ha
10e0: 73 69 6e 73 74 61 6e 63 65 73 20 20 20 6e 6f 20  sinstances   no 
10f0: 3b 20 23 20 73 69 6e 67 6c 65 74 6f 6e 0a 20 20  ; # singleton.  
1100: 20 20 70 72 61 67 6d 61 20 2d 68 61 73 74 79 70    pragma -hastyp
1110: 65 69 6e 66 6f 20 20 20 20 6e 6f 20 3b 20 23 20  einfo    no ; # 
1120: 6e 6f 20 69 6e 74 72 6f 73 70 65 63 74 69 6f 6e  no introspection
1130: 0a 20 20 20 20 70 72 61 67 6d 61 20 2d 68 61 73  .    pragma -has
1140: 74 79 70 65 64 65 73 74 72 6f 79 20 6e 6f 20 3b  typedestroy no ;
1150: 20 23 20 69 6d 6d 6f 72 74 61 6c 0a 0a 20 20 20   # immortal..   
1160: 20 23 20 23 20 23 23 20 23 23 23 20 23 23 23 23   # # ## ### ####
1170: 23 20 23 23 23 23 23 23 23 23 20 23 23 23 23 23  # ######## #####
1180: 23 23 23 23 23 23 23 23 0a 7d 0a 0a 6e 61 6d 65  ########.}..name
1190: 73 70 61 63 65 20 65 76 61 6c 20 3a 3a 76 63 3a  space eval ::vc:
11a0: 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a  :fossil::import:
11b0: 3a 63 76 73 3a 3a 70 61 73 73 20 7b 0a 20 20 20  :cvs::pass {.   
11c0: 20 6e 61 6d 65 73 70 61 63 65 20 65 78 70 6f 72   namespace expor
11d0: 74 20 63 6f 6c 6c 61 72 0a 20 20 20 20 6e 61 6d  t collar.    nam
11e0: 65 73 70 61 63 65 20 65 76 61 6c 20 63 6f 6c 6c  espace eval coll
11f0: 61 72 20 7b 0a 09 6e 61 6d 65 73 70 61 63 65 20  ar {..namespace 
1200: 69 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a 66 6f 73  import ::vc::fos
1210: 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73  sil::import::cvs
1220: 3a 3a 72 65 70 6f 73 69 74 6f 72 79 0a 09 6e 61  ::repository..na
1230: 6d 65 73 70 61 63 65 20 69 6d 70 6f 72 74 20 3a  mespace import :
1240: 3a 76 63 3a 3a 74 6f 6f 6c 73 3a 3a 74 72 6f 75  :vc::tools::trou
1250: 62 6c 65 0a 09 6e 61 6d 65 73 70 61 63 65 20 69  ble..namespace i
1260: 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a 74 6f 6f 6c  mport ::vc::tool
1270: 73 3a 3a 6c 6f 67 0a 09 6c 6f 67 20 72 65 67 69  s::log..log regi
1280: 73 74 65 72 20 63 6f 6c 6c 61 72 0a 20 20 20 20  ster collar.    
1290: 7d 0a 7d 0a 0a 23 20 23 20 23 23 20 23 23 23 20  }.}..# # ## ### 
12a0: 23 23 23 23 23 20 23 23 23 23 23 23 23 23 20 23  ##### ######## #
12b0: 23 23 23 23 23 23 23 23 23 23 23 23 20 23 23 23  ############ ###
12c0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
12d0: 23 23 0a 23 23 20 52 65 61 64 79 0a 0a 70 61 63  ##.## Ready..pac
12e0: 6b 61 67 65 20 70 72 6f 76 69 64 65 20 76 63 3a  kage provide vc:
12f0: 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a  :fossil::import:
1300: 3a 63 76 73 3a 3a 70 61 73 73 3a 3a 63 6f 6c 6c  :cvs::pass::coll
1310: 61 72 20 31 2e 30 0a 72 65 74 75 72 6e 0a        ar 1.0.return.