Artifact 08c3ec353cac7dda49c380b3325edb259acdb450:
File
tools/cvs2fossil/lib/c2f_pcollar.tcl
part of check-in
[edc46651c7]
- Moved the new case-sensitive file checking code into the misc package with descriptive command names, to recapture clarity of code at the calling places.
by
aku on
2008-01-29 04:05:10.
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 74 6f 6f 6c 73 3a 3a 6d 69 73 63 20 20 c::tools::misc
0500: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0510: 20 20 20 3b 20 23 20 4c 6f 63 61 6c 20 66 69 6c ; # Local fil
0520: 65 20 75 74 69 6c 69 74 69 65 73 2e 0a 70 61 63 e utilities..pac
0530: 6b 61 67 65 20 72 65 71 75 69 72 65 20 76 63 3a kage require vc:
0540: 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a :fossil::import:
0550: 3a 63 76 73 3a 3a 70 61 73 73 20 20 20 20 20 20 :cvs::pass
0560: 20 3b 20 23 20 50 61 73 73 20 6d 61 6e 61 67 65 ; # Pass manage
0570: 6d 65 6e 74 2e 0a 70 61 63 6b 61 67 65 20 72 65 ment..package re
0580: 71 75 69 72 65 20 76 63 3a 3a 66 6f 73 73 69 6c quire vc::fossil
0590: 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 72 ::import::cvs::r
05a0: 65 70 6f 73 69 74 6f 72 79 20 3b 20 23 20 52 65 epository ; # Re
05b0: 70 6f 73 69 74 6f 72 79 20 6d 61 6e 61 67 65 6d pository managem
05c0: 65 6e 74 2e 0a 70 61 63 6b 61 67 65 20 72 65 71 ent..package req
05d0: 75 69 72 65 20 76 63 3a 3a 66 6f 73 73 69 6c 3a uire vc::fossil:
05e0: 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 73 74 :import::cvs::st
05f0: 61 74 65 20 20 20 20 20 20 3b 20 23 20 53 74 61 ate ; # Sta
0600: 74 65 20 73 74 6f 72 61 67 65 0a 0a 23 20 23 20 te storage..# #
0610: 23 23 20 23 23 23 20 23 23 23 23 23 20 23 23 23 ## ### ##### ###
0620: 23 23 23 23 23 20 23 23 23 23 23 23 23 23 23 23 ##### ##########
0630: 23 23 23 20 23 23 23 23 23 23 23 23 23 23 23 23 ### ############
0640: 23 23 23 23 23 23 23 23 23 0a 23 23 20 52 65 67 #########.## Reg
0650: 69 73 74 65 72 20 74 68 65 20 70 61 73 73 20 77 ister the pass w
0660: 69 74 68 20 74 68 65 20 6d 61 6e 61 67 65 6d 65 ith the manageme
0670: 6e 74 0a 0a 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a nt..vc::fossil::
0680: 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 70 61 73 import::cvs::pas
0690: 73 20 64 65 66 69 6e 65 20 5c 0a 20 20 20 20 43 s define \. C
06a0: 6f 6c 6c 65 63 74 41 72 20 5c 0a 20 20 20 20 7b ollectAr \. {
06b0: 43 6f 6c 6c 65 63 74 20 61 72 63 68 69 76 65 73 Collect archives
06c0: 20 69 6e 20 72 65 70 6f 73 69 74 6f 72 79 7d 20 in repository}
06d0: 5c 0a 20 20 20 20 3a 3a 76 63 3a 3a 66 6f 73 73 \. ::vc::foss
06e0: 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a il::import::cvs:
06f0: 3a 70 61 73 73 3a 3a 63 6f 6c 6c 61 72 0a 0a 23 :pass::collar..#
0700: 20 23 20 23 23 20 23 23 23 20 23 23 23 23 23 20 # ## ### #####
0710: 23 23 23 23 23 23 23 23 20 23 23 23 23 23 23 23 ######## #######
0720: 23 23 23 23 23 23 20 23 23 23 23 23 23 23 23 23 ###### #########
0730: 23 23 23 23 23 23 23 23 23 23 23 23 0a 23 23 0a ############.##.
0740: 0a 73 6e 69 74 3a 3a 74 79 70 65 20 3a 3a 76 63 .snit::type ::vc
0750: 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 ::fossil::import
0760: 3a 3a 63 76 73 3a 3a 70 61 73 73 3a 3a 63 6f 6c ::cvs::pass::col
0770: 6c 61 72 20 7b 0a 20 20 20 20 23 20 23 20 23 23 lar {. # # ##
0780: 20 23 23 23 20 23 23 23 23 23 20 23 23 23 23 23 ### ##### #####
0790: 23 23 23 20 23 23 23 23 23 23 23 23 23 23 23 23 ### ############
07a0: 23 0a 20 20 20 20 23 23 20 50 75 62 6c 69 63 20 #. ## Public
07b0: 41 50 49 0a 0a 20 20 20 20 74 79 70 65 6d 65 74 API.. typemet
07c0: 68 6f 64 20 73 65 74 75 70 20 7b 7d 20 7b 0a 09 hod setup {} {..
07d0: 23 20 44 65 66 69 6e 65 20 6e 61 6d 65 73 20 61 # Define names a
07e0: 6e 64 20 73 74 72 75 63 74 75 72 65 20 6f 66 20 nd structure of
07f0: 74 68 65 20 70 65 72 73 69 73 74 65 6e 74 20 73 the persistent s
0800: 74 61 74 65 20 6f 66 20 74 68 69 73 0a 09 23 20 tate of this..#
0810: 70 61 73 73 2e 0a 0a 09 23 20 57 65 20 64 65 61 pass....# We dea
0820: 6c 20 77 69 74 68 20 72 65 70 6f 73 69 74 6f 72 l with repositor
0830: 79 20 70 72 6f 6a 65 63 74 73 2c 20 61 6e 64 20 y projects, and
0840: 74 68 65 20 72 63 73 20 61 72 63 68 69 76 65 20 the rcs archive
0850: 66 69 6c 65 73 0a 09 23 20 69 6e 20 74 68 65 20 files..# in the
0860: 70 72 6f 6a 65 63 74 73 2e 0a 0a 09 23 20 46 6f projects....# Fo
0870: 72 20 74 68 65 20 66 69 72 73 74 2c 20 70 72 6f r the first, pro
0880: 6a 65 63 74 73 2c 20 77 65 20 6b 65 65 70 20 74 jects, we keep t
0890: 68 65 69 72 20 6e 61 6d 65 73 2c 20 77 68 69 63 heir names, whic
08a0: 68 20 61 72 65 0a 09 23 20 74 68 65 69 72 20 70 h are..# their p
08b0: 61 74 68 73 20 72 65 6c 61 74 69 76 65 20 74 6f aths relative to
08c0: 20 74 68 65 20 62 61 73 65 20 64 69 72 65 63 74 the base direct
08d0: 6f 72 79 20 6f 66 20 74 68 65 20 77 68 6f 6c 65 ory of the whole
08e0: 0a 09 23 20 72 65 70 6f 73 69 74 6f 72 79 2e 20 ..# repository.
08f0: 54 68 65 73 65 20 68 61 76 65 20 74 6f 20 62 65 These have to be
0900: 20 67 6c 6f 62 61 6c 6c 79 20 75 6e 69 71 75 65 globally unique
0910: 2c 20 69 2e 65 2e 20 6e 6f 20 74 77 6f 0a 09 23 , i.e. no two..#
0920: 20 70 72 6f 6a 65 63 74 73 20 63 61 6e 20 68 61 projects can ha
0930: 76 65 20 74 68 65 20 73 61 6d 65 20 6e 61 6d 65 ve the same name
0940: 2e 0a 0a 09 23 20 46 6f 72 20 74 68 65 20 66 69 ....# For the fi
0950: 6c 65 73 20 77 65 20 6b 65 65 70 20 74 68 65 69 les we keep thei
0960: 72 20 6e 61 6d 65 73 2c 20 77 68 69 63 68 20 61 r names, which a
0970: 72 65 20 74 68 65 69 72 20 70 61 74 68 73 0a 09 re their paths..
0980: 23 20 72 65 6c 61 74 69 76 65 20 74 6f 20 74 68 # relative to th
0990: 65 20 62 61 73 65 20 64 69 72 65 63 74 6f 72 79 e base directory
09a0: 20 6f 66 20 74 68 65 20 77 68 6f 6c 65 20 70 72 of the whole pr
09b0: 6f 6a 65 63 74 21 20 54 68 65 73 65 0a 09 23 20 oject! These..#
09c0: 68 61 76 65 20 74 6f 20 62 65 20 75 6e 69 71 75 have to be uniqu
09d0: 65 20 77 69 74 68 69 6e 20 61 20 70 72 6f 6a 65 e within a proje
09e0: 63 74 2c 20 68 6f 77 65 76 65 72 20 67 6c 6f 62 ct, however glob
09f0: 61 6c 6c 79 20 74 68 69 73 0a 09 23 20 64 6f 65 ally this..# doe
0a00: 73 20 6e 6f 74 20 68 6f 6c 64 2c 20 61 20 6e 61 s not hold, a na
0a10: 6d 65 20 6d 61 79 20 6f 63 63 75 72 20 73 65 76 me may occur sev
0a20: 65 72 61 6c 20 74 69 6d 65 73 2c 20 69 6e 20 64 eral times, in d
0a30: 69 66 66 65 72 65 6e 74 0a 09 23 20 70 72 6f 6a ifferent..# proj
0a40: 65 63 74 73 2e 20 57 65 20 66 75 72 74 68 65 72 ects. We further
0a50: 20 73 74 6f 72 65 20 74 68 65 20 75 73 65 72 20 store the user
0a60: 76 69 73 69 62 6c 65 20 66 69 6c 65 20 6e 61 6d visible file nam
0a70: 65 0a 09 23 20 61 73 73 6f 63 69 61 74 65 64 20 e..# associated
0a80: 77 69 74 68 20 74 68 65 20 72 63 73 20 61 72 63 with the rcs arc
0a90: 68 69 76 65 2e 0a 0a 09 23 20 42 6f 74 68 20 70 hive....# Both p
0aa0: 72 6f 6a 65 63 74 73 20 61 6e 64 20 66 69 6c 65 rojects and file
0ab0: 73 20 61 72 65 20 69 64 65 6e 74 69 66 69 65 64 s are identified
0ac0: 20 62 79 20 67 6c 6f 62 61 6c 6c 79 20 75 6e 69 by globally uni
0ad0: 71 75 65 0a 09 23 20 69 6e 74 65 67 65 72 20 69 que..# integer i
0ae0: 64 73 2c 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c ds, automaticall
0af0: 79 20 61 73 73 69 67 6e 65 64 20 62 79 20 74 68 y assigned by th
0b00: 65 20 64 61 74 61 62 61 73 65 2e 0a 0a 09 73 74 e database....st
0b10: 61 74 65 20 65 78 74 65 6e 64 20 70 72 6f 6a 65 ate extend proje
0b20: 63 74 20 7b 0a 09 20 20 20 20 70 69 64 20 20 49 ct {.. pid I
0b30: 4e 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c NTEGER NOT NULL
0b40: 20 20 50 52 49 4d 41 52 59 20 4b 45 59 20 41 55 PRIMARY KEY AU
0b50: 54 4f 49 4e 43 52 45 4d 45 4e 54 2c 0a 09 20 20 TOINCREMENT,..
0b60: 20 20 6e 61 6d 65 20 54 45 58 54 20 20 20 20 20 name TEXT
0b70: 4e 4f 54 20 4e 55 4c 4c 20 20 55 4e 49 51 55 45 NOT NULL UNIQUE
0b80: 0a 09 7d 0a 09 73 74 61 74 65 20 65 78 74 65 6e ..}..state exten
0b90: 64 20 66 69 6c 65 20 7b 0a 09 20 20 20 20 66 69 d file {.. fi
0ba0: 64 20 20 20 20 20 49 4e 54 45 47 45 52 20 20 4e d INTEGER N
0bb0: 4f 54 20 4e 55 4c 4c 20 20 50 52 49 4d 41 52 59 OT NULL PRIMARY
0bc0: 20 4b 45 59 20 41 55 54 4f 49 4e 43 52 45 4d 45 KEY AUTOINCREME
0bd0: 4e 54 2c 0a 09 20 20 20 20 70 69 64 20 20 20 20 NT,.. pid
0be0: 20 49 4e 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 INTEGER NOT NU
0bf0: 4c 4c 20 20 52 45 46 45 52 45 4e 43 45 53 20 70 LL REFERENCES p
0c00: 72 6f 6a 65 63 74 2c 20 20 20 20 20 20 20 2d 2d roject, --
0c10: 20 70 72 6f 6a 65 63 74 20 74 68 65 20 66 69 6c project the fil
0c20: 65 20 62 65 6c 6f 6e 67 73 20 74 6f 0a 09 20 20 e belongs to..
0c30: 20 20 6e 61 6d 65 20 20 20 20 54 45 58 54 20 20 name TEXT
0c40: 20 20 20 4e 4f 54 20 4e 55 4c 4c 2c 0a 09 20 20 NOT NULL,..
0c50: 20 20 76 69 73 69 62 6c 65 20 54 45 58 54 20 20 visible TEXT
0c60: 20 20 20 4e 4f 54 20 4e 55 4c 4c 2c 0a 09 20 20 NOT NULL,..
0c70: 20 20 65 78 65 63 20 20 20 20 49 4e 54 45 47 45 exec INTEGE
0c80: 52 20 20 4e 4f 54 20 4e 55 4c 4c 2c 20 2d 2d 20 R NOT NULL, --
0c90: 62 6f 6f 6c 65 61 6e 2c 20 27 66 69 6c 65 20 65 boolean, 'file e
0ca0: 78 65 63 75 74 61 62 6c 65 27 2e 0a 09 20 20 20 xecutable'...
0cb0: 20 55 4e 49 51 55 45 20 28 70 69 64 2c 20 6e 61 UNIQUE (pid, na
0cc0: 6d 65 29 20 20 20 20 20 20 20 20 20 2d 2d 20 66 me) -- f
0cd0: 69 6c 65 20 6e 61 6d 65 73 20 61 72 65 20 75 6e ile names are un
0ce0: 69 71 75 65 20 77 69 74 68 69 6e 20 61 20 70 72 ique within a pr
0cf0: 6f 6a 65 63 74 0a 09 7d 0a 09 72 65 74 75 72 6e oject..}..return
0d00: 0a 20 20 20 20 7d 0a 0a 20 20 20 20 74 79 70 65 . }.. type
0d10: 6d 65 74 68 6f 64 20 6c 6f 61 64 20 7b 7d 20 7b method load {} {
0d20: 0a 09 23 20 50 61 73 73 20 6d 61 6e 61 67 65 72 ..# Pass manager
0d30: 20 69 6e 74 65 72 66 61 63 65 2e 20 45 78 65 63 interface. Exec
0d40: 75 74 65 64 20 66 6f 72 20 61 6c 6c 20 70 61 73 uted for all pas
0d50: 73 65 73 20 62 65 66 6f 72 65 20 74 68 65 0a 09 ses before the..
0d60: 23 20 72 75 6e 20 70 61 73 73 65 73 2c 20 74 6f # run passes, to
0d70: 20 6c 6f 61 64 20 61 6c 6c 20 64 61 74 61 20 6f load all data o
0d80: 66 20 74 68 65 69 72 20 70 61 73 73 20 66 72 6f f their pass fro
0d90: 6d 20 74 68 65 20 73 74 61 74 65 2c 0a 09 23 20 m the state,..#
0da0: 61 73 20 69 66 20 69 74 20 68 61 64 20 62 65 65 as if it had bee
0db0: 6e 20 63 6f 6d 70 75 74 65 64 20 62 79 20 74 68 n computed by th
0dc0: 65 20 70 61 73 73 20 69 74 73 65 6c 66 2e 0a 0a e pass itself...
0dd0: 09 73 74 61 74 65 20 75 73 65 20 70 72 6f 6a 65 .state use proje
0de0: 63 74 0a 09 73 74 61 74 65 20 75 73 65 20 66 69 ct..state use fi
0df0: 6c 65 0a 0a 09 72 65 70 6f 73 69 74 6f 72 79 20 le...repository
0e00: 6c 6f 61 64 0a 09 72 65 74 75 72 6e 0a 20 20 20 load..return.
0e10: 20 7d 0a 0a 20 20 20 20 74 79 70 65 6d 65 74 68 }.. typemeth
0e20: 6f 64 20 72 75 6e 20 7b 7d 20 7b 0a 09 23 20 50 od run {} {..# P
0e30: 61 73 73 20 6d 61 6e 61 67 65 72 20 69 6e 74 65 ass manager inte
0e40: 72 66 61 63 65 2e 20 45 78 65 63 75 74 65 64 20 rface. Executed
0e50: 74 6f 20 70 65 72 66 6f 72 6d 20 74 68 65 0a 09 to perform the..
0e60: 23 20 66 75 6e 63 74 69 6f 6e 61 6c 69 74 79 20 # functionality
0e70: 6f 66 20 74 68 65 20 70 61 73 73 2e 0a 0a 09 73 of the pass....s
0e80: 65 74 20 72 62 61 73 65 20 5b 72 65 70 6f 73 69 et rbase [reposi
0e90: 74 6f 72 79 20 62 61 73 65 3f 5d 0a 09 66 6f 72 tory base?]..for
0ea0: 65 61 63 68 20 70 72 6f 6a 65 63 74 20 5b 72 65 each project [re
0eb0: 70 6f 73 69 74 6f 72 79 20 70 72 6f 6a 65 63 74 pository project
0ec0: 73 5d 20 7b 0a 09 20 20 20 20 73 65 74 20 62 61 s] {.. set ba
0ed0: 73 65 20 5b 3a 3a 66 69 6c 65 20 6a 6f 69 6e 20 se [::file join
0ee0: 24 72 62 61 73 65 20 5b 24 70 72 6f 6a 65 63 74 $rbase [$project
0ef0: 20 62 61 73 65 5d 5d 0a 09 20 20 20 20 6c 6f 67 base]].. log
0f00: 20 77 72 69 74 65 20 31 20 63 6f 6c 6c 61 72 20 write 1 collar
0f10: 22 53 63 61 6e 20 24 62 61 73 65 22 0a 0a 09 20 "Scan $base"...
0f20: 20 20 20 73 65 74 20 74 72 61 76 65 72 73 65 20 set traverse
0f30: 5b 66 69 6c 65 75 74 69 6c 3a 3a 74 72 61 76 65 [fileutil::trave
0f40: 72 73 65 20 25 41 55 54 4f 25 20 24 62 61 73 65 rse %AUTO% $base
0f50: 20 5c 0a 09 09 09 20 20 20 20 20 20 2d 70 72 65 \.... -pre
0f60: 66 69 6c 74 65 72 20 5b 6d 79 70 72 6f 63 20 46 filter [myproc F
0f70: 69 6c 74 65 72 41 74 74 69 63 53 75 62 64 69 72 ilterAtticSubdir
0f80: 20 24 62 61 73 65 5d 5d 0a 09 20 20 20 20 73 65 $base]].. se
0f90: 74 20 6e 20 30 0a 09 20 20 20 20 73 65 74 20 72 t n 0.. set r
0fa0: 20 7b 7d 0a 0a 09 20 20 20 20 24 74 72 61 76 65 {}... $trave
0fb0: 72 73 65 20 66 6f 72 65 61 63 68 20 70 61 74 68 rse foreach path
0fc0: 20 7b 0a 09 09 73 65 74 20 72 63 73 20 5b 66 69 {...set rcs [fi
0fd0: 6c 65 75 74 69 6c 3a 3a 73 74 72 69 70 50 61 74 leutil::stripPat
0fe0: 68 20 24 62 61 73 65 20 24 70 61 74 68 5d 0a 09 h $base $path]..
0ff0: 09 69 66 20 7b 5b 49 73 43 56 53 41 64 6d 69 6e .if {[IsCVSAdmin
1000: 20 20 20 20 24 72 63 73 5d 7d 20 20 63 6f 6e 74 $rcs]} cont
1010: 69 6e 75 65 0a 09 09 69 66 20 7b 21 5b 49 73 52 inue...if {![IsR
1020: 43 53 41 72 63 68 69 76 65 20 24 70 61 74 68 5d CSArchive $path]
1030: 7d 20 63 6f 6e 74 69 6e 75 65 0a 0a 09 09 73 65 } continue....se
1040: 74 20 75 73 72 20 5b 55 73 65 72 50 61 74 68 20 t usr [UserPath
1050: 24 72 63 73 20 69 73 61 74 74 69 63 5d 0a 09 09 $rcs isattic]...
1060: 69 66 20 7b 5b 49 73 53 75 70 65 72 63 65 64 65 if {[IsSupercede
1070: 64 20 24 62 61 73 65 20 24 72 63 73 20 24 75 73 d $base $rcs $us
1080: 72 20 24 69 73 61 74 74 69 63 5d 7d 20 63 6f 6e r $isattic]} con
1090: 74 69 6e 75 65 0a 0a 09 09 23 20 58 58 58 20 43 tinue....# XXX C
10a0: 68 65 63 6b 6d 65 3a 20 6e 6f 74 20 73 75 72 65 heckme: not sure
10b0: 20 69 66 20 74 68 69 73 20 77 69 6c 6c 20 73 74 if this will st
10c0: 69 6c 6c 20 66 61 69 6c 20 69 6e 20 74 68 65 20 ill fail in the
10d0: 63 61 73 65 20 77 68 65 72 65 20 61 20 64 69 72 case where a dir
10e0: 65 63 74 6f 72 79 20 64 6f 65 73 20 63 6f 6e 66 ectory does conf
10f0: 6c 69 63 74 20 77 69 74 68 20 61 20 66 69 6c 65 lict with a file
1100: 20 58 58 58 0a 09 09 69 66 20 7b 0a 09 09 20 20 XXX...if {...
1110: 20 20 5b 66 69 6c 65 65 78 69 73 74 73 5f 63 69 [fileexists_ci
1120: 20 24 62 61 73 65 2f 24 75 73 72 5d 20 26 26 0a $base/$usr] &&.
1130: 09 09 20 20 20 20 5b 66 69 6c 65 69 73 64 69 72 .. [fileisdir
1140: 5f 63 69 20 20 24 62 61 73 65 2f 24 75 73 72 5d _ci $base/$usr]
1150: 0a 09 09 7d 20 7b 0a 09 09 20 20 20 20 74 72 6f ...} {... tro
1160: 75 62 6c 65 20 66 61 74 61 6c 20 22 44 69 72 65 uble fatal "Dire
1170: 63 74 6f 72 79 20 6e 61 6d 65 20 63 6f 6e 66 6c ctory name confl
1180: 69 63 74 73 20 77 69 74 68 20 66 69 6c 65 6e 61 icts with filena
1190: 6d 65 2e 22 0a 09 09 20 20 20 20 74 72 6f 75 62 me."... troub
11a0: 6c 65 20 66 61 74 61 6c 20 22 50 6c 65 61 73 65 le fatal "Please
11b0: 20 72 65 6d 6f 76 65 20 6f 72 20 72 65 6e 61 6d remove or renam
11c0: 65 20 6f 6e 65 20 6f 66 20 74 68 65 20 66 6f 6c e one of the fol
11d0: 6c 6f 77 69 6e 67 3a 22 0a 09 09 20 20 20 20 74 lowing:"... t
11e0: 72 6f 75 62 6c 65 20 66 61 74 61 6c 20 22 20 20 rouble fatal "
11f0: 20 20 24 62 61 73 65 2f 24 75 73 72 22 0a 09 09 $base/$usr"...
1200: 20 20 20 20 74 72 6f 75 62 6c 65 20 66 61 74 61 trouble fata
1210: 6c 20 22 20 20 20 20 24 62 61 73 65 2f 24 72 63 l " $base/$rc
1220: 73 22 0a 09 09 20 20 20 20 63 6f 6e 74 69 6e 75 s"... continu
1230: 65 0a 09 09 7d 0a 0a 09 09 6c 6f 67 20 77 72 69 e...}....log wri
1240: 74 65 20 34 20 63 6f 6c 6c 61 72 20 22 46 6f 75 te 4 collar "Fou
1250: 6e 64 20 20 20 24 72 63 73 22 0a 09 09 24 70 72 nd $rcs"...$pr
1260: 6f 6a 65 63 74 20 61 64 64 66 69 6c 65 20 24 72 oject addfile $r
1270: 63 73 20 24 75 73 72 20 5b 66 69 6c 65 20 65 78 cs $usr [file ex
1280: 65 63 75 74 61 62 6c 65 20 24 72 63 73 5d 0a 0a ecutable $rcs]..
1290: 09 09 69 6e 63 72 20 6e 0a 09 09 69 66 20 7b 5b ..incr n...if {[
12a0: 6c 6f 67 20 76 65 72 62 6f 73 69 74 79 3f 5d 20 log verbosity?]
12b0: 3c 20 34 7d 20 7b 0a 09 09 20 20 20 20 6c 6f 67 < 4} {... log
12c0: 20 70 72 6f 67 72 65 73 73 20 30 20 63 6f 6c 6c progress 0 coll
12d0: 61 72 20 24 6e 20 7b 7d 0a 09 09 7d 0a 09 20 20 ar $n {}...}..
12e0: 20 20 7d 0a 0a 09 20 20 20 20 24 74 72 61 76 65 }... $trave
12f0: 72 73 65 20 64 65 73 74 72 6f 79 0a 09 7d 0a 0a rse destroy..}..
1300: 09 72 65 70 6f 73 69 74 6f 72 79 20 70 72 69 6e .repository prin
1310: 74 73 74 61 74 69 73 74 69 63 73 0a 09 72 65 70 tstatistics..rep
1320: 6f 73 69 74 6f 72 79 20 70 65 72 73 69 73 74 0a ository persist.
1330: 0a 09 6c 6f 67 20 77 72 69 74 65 20 31 20 63 6f ..log write 1 co
1340: 6c 6c 61 72 20 22 53 63 61 6e 20 63 6f 6d 70 6c llar "Scan compl
1350: 65 74 65 64 22 0a 09 72 65 74 75 72 6e 0a 20 20 eted"..return.
1360: 20 20 7d 0a 0a 20 20 20 20 74 79 70 65 6d 65 74 }.. typemet
1370: 68 6f 64 20 64 69 73 63 61 72 64 20 7b 7d 20 7b hod discard {} {
1380: 0a 09 23 20 50 61 73 73 20 6d 61 6e 61 67 65 72 ..# Pass manager
1390: 20 69 6e 74 65 72 66 61 63 65 2e 20 45 78 65 63 interface. Exec
13a0: 75 74 65 64 20 66 6f 72 20 61 6c 6c 20 70 61 73 uted for all pas
13b0: 73 65 73 20 61 66 74 65 72 20 74 68 65 0a 09 23 ses after the..#
13c0: 20 72 75 6e 20 70 61 73 73 65 73 2c 20 74 6f 20 run passes, to
13d0: 72 65 6d 6f 76 65 20 61 6c 6c 20 64 61 74 61 20 remove all data
13e0: 6f 66 20 74 68 69 73 20 70 61 73 73 20 66 72 6f of this pass fro
13f0: 6d 20 74 68 65 20 73 74 61 74 65 2c 0a 09 23 20 m the state,..#
1400: 61 73 20 62 65 69 6e 67 20 6f 75 74 20 6f 66 20 as being out of
1410: 64 61 74 65 2e 0a 0a 09 73 74 61 74 65 20 64 69 date....state di
1420: 73 63 61 72 64 20 70 72 6f 6a 65 63 74 0a 09 73 scard project..s
1430: 74 61 74 65 20 64 69 73 63 61 72 64 20 66 69 6c tate discard fil
1440: 65 0a 09 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a e..return. }.
1450: 0a 20 20 20 20 74 79 70 65 6d 65 74 68 6f 64 20 . typemethod
1460: 69 67 6e 6f 72 65 5f 63 6f 6e 66 6c 69 63 74 69 ignore_conflicti
1470: 6e 67 5f 61 74 74 69 63 73 20 7b 7d 20 7b 0a 09 ng_attics {} {..
1480: 73 65 74 20 6d 79 69 67 6e 6f 72 65 20 31 0a 09 set myignore 1..
1490: 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 return. }..
14a0: 20 20 23 20 23 20 23 23 20 23 23 23 20 23 23 23 # # ## ### ###
14b0: 23 23 20 23 23 23 23 23 23 23 23 20 23 23 23 23 ## ######## ####
14c0: 23 23 23 23 23 23 23 23 23 0a 20 20 20 20 23 23 #########. ##
14d0: 20 49 6e 74 65 72 6e 61 6c 20 6d 65 74 68 6f 64 Internal method
14e0: 73 0a 0a 20 20 20 20 74 79 70 65 76 61 72 69 61 s.. typevaria
14f0: 62 6c 65 20 6d 79 69 67 6e 6f 72 65 20 30 0a 0a ble myignore 0..
1500: 20 20 20 20 70 72 6f 63 20 46 69 6c 74 65 72 41 proc FilterA
1510: 74 74 69 63 53 75 62 64 69 72 20 7b 62 61 73 65 tticSubdir {base
1520: 20 70 61 74 68 7d 20 7b 0a 09 23 20 54 68 69 73 path} {..# This
1530: 20 63 6f 6d 6d 61 6e 64 20 69 73 20 75 73 65 64 command is used
1540: 20 62 79 20 74 68 65 20 74 72 61 76 65 72 73 65 by the traverse
1550: 72 20 74 6f 20 70 72 65 76 65 6e 74 20 69 74 20 r to prevent it
1560: 66 72 6f 6d 0a 09 23 20 73 63 61 6e 6e 69 6e 67 from..# scanning
1570: 20 69 6e 74 6f 20 73 75 62 64 69 72 65 63 74 6f into subdirecto
1580: 72 69 65 73 20 6f 66 20 61 6e 20 41 74 74 69 63 ries of an Attic
1590: 2e 20 57 65 20 67 65 74 20 61 77 61 79 20 77 69 . We get away wi
15a0: 74 68 0a 09 23 20 63 68 65 63 6b 69 6e 67 20 74 th..# checking t
15b0: 68 65 20 69 6d 6d 65 64 69 61 74 65 20 70 61 72 he immediate par
15c0: 65 6e 74 20 64 69 72 65 63 74 6f 72 79 20 6f 66 ent directory of
15d0: 20 74 68 65 20 63 75 72 72 65 6e 74 20 70 61 74 the current pat
15e0: 68 0a 09 23 20 61 73 20 6f 75 72 20 72 65 6a 65 h..# as our reje
15f0: 63 74 69 6f 6e 20 6d 65 61 6e 73 20 74 68 61 74 ction means that
1600: 20 64 65 65 70 65 72 20 70 61 74 68 20 64 6f 20 deeper path do
1610: 6e 6f 74 20 6f 63 63 75 72 2e 0a 0a 09 69 66 20 not occur....if
1620: 7b 5b 66 69 6c 65 20 74 61 69 6c 20 5b 66 69 6c {[file tail [fil
1630: 65 20 64 69 72 6e 61 6d 65 20 24 70 61 74 68 5d e dirname $path]
1640: 5d 20 65 71 20 22 41 74 74 69 63 22 7d 20 7b 0a ] eq "Attic"} {.
1650: 09 20 20 20 20 73 65 74 20 61 64 20 5b 66 69 6c . set ad [fil
1660: 65 75 74 69 6c 3a 3a 73 74 72 69 70 50 61 74 68 eutil::stripPath
1670: 20 24 62 61 73 65 20 24 70 61 74 68 5d 0a 09 20 $base $path]..
1680: 20 20 20 6c 6f 67 20 77 72 69 74 65 20 31 20 63 log write 1 c
1690: 6f 6c 6c 61 72 20 22 44 69 72 65 63 74 6f 72 79 ollar "Directory
16a0: 20 24 61 64 20 66 6f 75 6e 64 20 69 6e 20 41 74 $ad found in At
16b0: 74 69 63 2c 20 69 67 6e 6f 72 69 6e 67 2e 22 0a tic, ignoring.".
16c0: 09 20 20 20 20 72 65 74 75 72 6e 20 30 0a 09 7d . return 0..}
16d0: 0a 09 72 65 74 75 72 6e 20 31 0a 20 20 20 20 7d ..return 1. }
16e0: 0a 0a 20 20 20 20 70 72 6f 63 20 49 73 52 43 53 .. proc IsRCS
16f0: 41 72 63 68 69 76 65 20 7b 70 61 74 68 7d 20 7b Archive {path} {
1700: 0a 09 69 66 20 7b 21 5b 73 74 72 69 6e 67 20 6d ..if {![string m
1710: 61 74 63 68 20 2a 2c 76 20 24 70 61 74 68 5d 7d atch *,v $path]}
1720: 20 20 20 20 20 7b 72 65 74 75 72 6e 20 30 7d 0a {return 0}.
1730: 09 69 66 20 7b 5b 66 69 6c 65 75 74 69 6c 3a 3a .if {[fileutil::
1740: 74 65 73 74 20 24 70 61 74 68 20 66 72 20 6d 73 test $path fr ms
1750: 67 5d 7d 20 7b 72 65 74 75 72 6e 20 31 7d 0a 09 g]} {return 1}..
1760: 74 72 6f 75 62 6c 65 20 77 61 72 6e 20 24 6d 73 trouble warn $ms
1770: 67 0a 09 72 65 74 75 72 6e 20 30 0a 20 20 20 20 g..return 0.
1780: 7d 0a 0a 20 20 20 20 70 72 6f 63 20 49 73 43 56 }.. proc IsCV
1790: 53 41 64 6d 69 6e 20 7b 72 63 73 7d 20 7b 0a 09 SAdmin {rcs} {..
17a0: 69 66 20 7b 21 5b 73 74 72 69 6e 67 20 6d 61 74 if {![string mat
17b0: 63 68 20 43 56 53 52 4f 4f 54 2f 2a 20 24 72 63 ch CVSROOT/* $rc
17c0: 73 5d 7d 20 7b 72 65 74 75 72 6e 20 30 7d 0a 09 s]} {return 0}..
17d0: 6c 6f 67 20 77 72 69 74 65 20 34 20 63 6f 6c 6c log write 4 coll
17e0: 61 72 20 22 49 67 6e 6f 72 65 64 20 24 72 63 73 ar "Ignored $rcs
17f0: 2c 20 61 64 6d 69 6e 69 73 74 72 61 74 69 76 65 , administrative
1800: 20 61 72 63 68 69 76 65 22 0a 09 72 65 74 75 72 archive"..retur
1810: 6e 20 31 0a 20 20 20 20 7d 0a 0a 20 20 20 20 70 n 1. }.. p
1820: 72 6f 63 20 55 73 65 72 50 61 74 68 20 7b 72 63 roc UserPath {rc
1830: 73 20 69 61 76 7d 20 7b 0a 09 75 70 76 61 72 20 s iav} {..upvar
1840: 31 20 24 69 61 76 20 69 73 61 74 74 69 63 0a 0a 1 $iav isattic..
1850: 09 23 20 44 65 72 69 76 65 20 74 68 65 20 75 73 .# Derive the us
1860: 65 72 2d 76 69 73 69 62 6c 65 20 70 61 74 68 20 er-visible path
1870: 66 72 6f 6d 20 74 68 65 20 72 63 73 20 70 61 74 from the rcs pat
1880: 68 2e 20 4d 65 61 6e 69 6e 67 3a 0a 09 23 20 43 h. Meaning:..# C
1890: 68 6f 70 20 6f 66 66 20 74 68 65 20 22 2c 76 22 hop off the ",v"
18a0: 20 73 75 66 66 69 78 2c 20 61 6e 64 20 72 65 6d suffix, and rem
18b0: 6f 76 65 20 61 20 70 6f 73 73 69 62 6c 65 20 22 ove a possible "
18c0: 41 74 74 69 63 22 2e 0a 0a 09 73 65 74 20 66 20 Attic"....set f
18d0: 5b 73 74 72 69 6e 67 20 72 61 6e 67 65 20 24 72 [string range $r
18e0: 63 73 20 30 20 65 6e 64 2d 32 5d 0a 0a 09 69 66 cs 0 end-2]...if
18f0: 20 7b 22 41 74 74 69 63 22 20 65 71 20 5b 6c 69 {"Attic" eq [li
1900: 6e 64 65 78 20 5b 66 69 6c 65 20 73 70 6c 69 74 ndex [file split
1910: 20 24 72 63 73 5d 20 65 6e 64 2d 31 5d 7d 20 7b $rcs] end-1]} {
1920: 0a 0a 09 20 20 20 20 23 20 54 68 65 20 63 6f 6e ... # The con
1930: 73 74 72 75 63 74 69 6f 6e 20 62 65 6c 6f 77 20 struction below
1940: 65 6e 73 75 72 65 73 20 74 68 61 74 20 41 74 74 ensures that Att
1950: 69 63 2f 58 20 6d 61 70 73 20 74 6f 20 58 0a 09 ic/X maps to X..
1960: 20 20 20 20 23 20 69 6e 73 74 65 61 64 20 6f 66 # instead of
1970: 20 2e 2f 58 2e 20 4f 74 68 65 72 77 69 73 65 2c ./X. Otherwise,
1980: 20 59 2f 41 74 74 69 63 2f 58 20 6d 61 70 73 20 Y/Attic/X maps
1990: 74 6f 20 59 2f 58 2e 0a 0a 09 20 20 20 20 73 65 to Y/X.... se
19a0: 74 20 66 78 20 5b 66 69 6c 65 20 64 69 72 6e 61 t fx [file dirna
19b0: 6d 65 20 5b 66 69 6c 65 20 64 69 72 6e 61 6d 65 me [file dirname
19c0: 20 24 66 5d 5d 0a 09 20 20 20 20 73 65 74 20 66 $f]].. set f
19d0: 20 20 5b 66 69 6c 65 20 74 61 69 6c 20 24 66 5d [file tail $f]
19e0: 0a 09 20 20 20 20 69 66 20 7b 24 66 78 20 6e 65 .. if {$fx ne
19f0: 20 22 2e 22 7d 20 7b 20 73 65 74 20 66 20 5b 66 "."} { set f [f
1a00: 69 6c 65 20 6a 6f 69 6e 20 24 66 78 20 24 66 5d ile join $fx $f]
1a10: 20 7d 0a 0a 09 20 20 20 20 73 65 74 20 69 73 61 }... set isa
1a20: 74 74 69 63 20 31 0a 09 7d 20 65 6c 73 65 20 7b ttic 1..} else {
1a30: 0a 09 20 20 20 20 73 65 74 20 69 73 61 74 74 69 .. set isatti
1a40: 63 20 30 0a 09 7d 0a 0a 09 72 65 74 75 72 6e 20 c 0..}...return
1a50: 24 66 0a 20 20 20 20 7d 0a 0a 20 20 20 20 70 72 $f. }.. pr
1a60: 6f 63 20 49 73 53 75 70 65 72 63 65 64 65 64 20 oc IsSuperceded
1a70: 7b 62 61 73 65 20 72 63 73 20 75 73 72 20 69 73 {base rcs usr is
1a80: 61 74 74 69 63 7d 20 7b 0a 09 3a 3a 76 61 72 69 attic} {..::vari
1a90: 61 62 6c 65 20 6d 79 69 67 6e 6f 72 65 0a 0a 09 able myignore...
1aa0: 69 66 20 7b 21 24 69 73 61 74 74 69 63 7d 20 20 if {!$isattic}
1ab0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1ac0: 20 20 20 7b 72 65 74 75 72 6e 20 30 7d 0a 09 69 {return 0}..i
1ad0: 66 20 7b 21 5b 66 69 6c 65 65 78 69 73 74 73 5f f {![fileexists_
1ae0: 63 69 20 24 62 61 73 65 2f 24 75 73 72 2c 76 5d ci $base/$usr,v]
1af0: 7d 20 7b 72 65 74 75 72 6e 20 30 7d 0a 0a 09 23 } {return 0}...#
1b00: 20 57 65 20 68 61 76 65 20 61 20 72 65 67 75 6c We have a regul
1b10: 61 72 20 61 72 63 68 69 76 65 20 61 6e 64 20 61 ar archive and a
1b20: 6e 20 41 74 74 69 63 20 61 72 63 68 69 76 65 20 n Attic archive
1b30: 72 65 66 65 72 69 6e 67 20 74 6f 0a 09 23 20 74 refering to..# t
1b40: 68 65 20 73 61 6d 65 20 75 73 65 72 20 76 69 73 he same user vis
1b50: 69 62 6c 65 20 66 69 6c 65 2e 20 49 67 6e 6f 72 ible file. Ignor
1b60: 65 20 74 68 65 20 66 69 6c 65 20 69 6e 20 74 68 e the file in th
1b70: 65 20 41 74 74 69 63 2e 0a 09 23 0a 09 23 20 42 e Attic...#..# B
1b80: 79 20 64 65 66 61 75 6c 74 20 74 68 69 73 20 69 y default this i
1b90: 73 20 61 20 70 72 6f 62 6c 65 6d 20 63 61 75 73 s a problem caus
1ba0: 69 6e 67 20 61 6e 20 61 62 6f 72 74 20 61 66 74 ing an abort aft
1bb0: 65 72 20 74 68 65 20 70 61 73 73 0a 09 23 20 68 er the pass..# h
1bc0: 61 73 20 63 6f 6d 70 6c 65 74 65 64 2e 20 54 68 as completed. Th
1bd0: 65 20 75 73 65 72 20 63 61 6e 20 68 6f 77 65 76 e user can howev
1be0: 65 72 20 66 6f 72 63 65 20 75 73 20 74 6f 20 69 er force us to i
1bf0: 67 6e 6f 72 65 20 69 74 2e 0a 09 23 20 49 6e 20 gnore it...# In
1c00: 74 68 61 74 20 63 61 73 65 20 74 68 65 20 77 61 that case the wa
1c10: 72 6e 69 6e 67 20 69 73 20 73 74 69 6c 6c 20 70 rning is still p
1c20: 72 69 6e 74 65 64 2c 20 62 75 74 20 77 69 6c 6c rinted, but will
1c30: 20 6e 6f 74 0a 09 23 20 69 6e 64 75 63 65 20 61 not..# induce a
1c40: 6e 20 61 62 6f 72 74 20 61 6e 79 20 6c 6f 6e 67 n abort any long
1c50: 65 72 2e 0a 0a 09 69 66 20 7b 24 6d 79 69 67 6e er....if {$myign
1c60: 6f 72 65 7d 20 7b 0a 09 20 20 20 20 6c 6f 67 20 ore} {.. log
1c70: 77 72 69 74 65 20 32 20 63 6f 6c 6c 61 72 20 22 write 2 collar "
1c80: 49 67 6e 6f 72 65 64 20 24 72 63 73 2c 20 73 75 Ignored $rcs, su
1c90: 70 65 72 63 65 64 65 64 20 61 72 63 68 69 76 65 perceded archive
1ca0: 22 0a 09 7d 20 65 6c 73 65 20 7b 0a 09 20 20 20 "..} else {..
1cb0: 20 74 72 6f 75 62 6c 65 20 77 61 72 6e 20 20 20 trouble warn
1cc0: 20 20 20 20 22 49 67 6e 6f 72 65 64 20 24 72 63 "Ignored $rc
1cd0: 73 2c 20 73 75 70 65 72 63 65 64 65 64 20 61 72 s, superceded ar
1ce0: 63 68 69 76 65 22 0a 09 7d 0a 09 72 65 74 75 72 chive"..}..retur
1cf0: 6e 20 31 0a 20 20 20 20 7d 0a 0a 20 20 20 20 23 n 1. }.. #
1d00: 20 23 20 23 23 20 23 23 23 20 23 23 23 23 23 20 # ## ### #####
1d10: 23 23 23 23 23 23 23 23 20 23 23 23 23 23 23 23 ######## #######
1d20: 23 23 23 23 23 23 0a 20 20 20 20 23 23 20 43 6f ######. ## Co
1d30: 6e 66 69 67 75 72 61 74 69 6f 6e 0a 0a 20 20 20 nfiguration..
1d40: 20 70 72 61 67 6d 61 20 2d 68 61 73 69 6e 73 74 pragma -hasinst
1d50: 61 6e 63 65 73 20 20 20 6e 6f 20 3b 20 23 20 73 ances no ; # s
1d60: 69 6e 67 6c 65 74 6f 6e 0a 20 20 20 20 70 72 61 ingleton. pra
1d70: 67 6d 61 20 2d 68 61 73 74 79 70 65 69 6e 66 6f gma -hastypeinfo
1d80: 20 20 20 20 6e 6f 20 3b 20 23 20 6e 6f 20 69 6e no ; # no in
1d90: 74 72 6f 73 70 65 63 74 69 6f 6e 0a 20 20 20 20 trospection.
1da0: 70 72 61 67 6d 61 20 2d 68 61 73 74 79 70 65 64 pragma -hastyped
1db0: 65 73 74 72 6f 79 20 6e 6f 20 3b 20 23 20 69 6d estroy no ; # im
1dc0: 6d 6f 72 74 61 6c 0a 0a 20 20 20 20 23 20 23 20 mortal.. # #
1dd0: 23 23 20 23 23 23 20 23 23 23 23 23 20 23 23 23 ## ### ##### ###
1de0: 23 23 23 23 23 20 23 23 23 23 23 23 23 23 23 23 ##### ##########
1df0: 23 23 23 0a 7d 0a 0a 6e 61 6d 65 73 70 61 63 65 ###.}..namespace
1e00: 20 65 76 61 6c 20 3a 3a 76 63 3a 3a 66 6f 73 73 eval ::vc::foss
1e10: 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a il::import::cvs:
1e20: 3a 70 61 73 73 20 7b 0a 20 20 20 20 6e 61 6d 65 :pass {. name
1e30: 73 70 61 63 65 20 65 78 70 6f 72 74 20 63 6f 6c space export col
1e40: 6c 61 72 0a 20 20 20 20 6e 61 6d 65 73 70 61 63 lar. namespac
1e50: 65 20 65 76 61 6c 20 63 6f 6c 6c 61 72 20 7b 0a e eval collar {.
1e60: 09 6e 61 6d 65 73 70 61 63 65 20 69 6d 70 6f 72 .namespace impor
1e70: 74 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a t ::vc::fossil::
1e80: 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 72 65 70 import::cvs::rep
1e90: 6f 73 69 74 6f 72 79 0a 09 6e 61 6d 65 73 70 61 ository..namespa
1ea0: 63 65 20 69 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a ce import ::vc::
1eb0: 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a fossil::import::
1ec0: 63 76 73 3a 3a 73 74 61 74 65 0a 09 6e 61 6d 65 cvs::state..name
1ed0: 73 70 61 63 65 20 69 6d 70 6f 72 74 20 3a 3a 76 space import ::v
1ee0: 63 3a 3a 74 6f 6f 6c 73 3a 3a 74 72 6f 75 62 6c c::tools::troubl
1ef0: 65 0a 09 6e 61 6d 65 73 70 61 63 65 20 69 6d 70 e..namespace imp
1f00: 6f 72 74 20 3a 3a 76 63 3a 3a 74 6f 6f 6c 73 3a ort ::vc::tools:
1f10: 3a 6c 6f 67 0a 09 6e 61 6d 65 73 70 61 63 65 20 :log..namespace
1f20: 69 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a 74 6f 6f import ::vc::too
1f30: 6c 73 3a 3a 6d 69 73 63 3a 3a 66 69 6c 65 2a 0a ls::misc::file*.
1f40: 09 6c 6f 67 20 72 65 67 69 73 74 65 72 20 63 6f .log register co
1f50: 6c 6c 61 72 0a 20 20 20 20 7d 0a 7d 0a 0a 23 20 llar. }.}..#
1f60: 23 20 23 23 20 23 23 23 20 23 23 23 23 23 20 23 # ## ### ##### #
1f70: 23 23 23 23 23 23 23 20 23 23 23 23 23 23 23 23 ####### ########
1f80: 23 23 23 23 23 20 23 23 23 23 23 23 23 23 23 23 ##### ##########
1f90: 23 23 23 23 23 23 23 23 23 23 23 0a 23 23 20 52 ###########.## R
1fa0: 65 61 64 79 0a 0a 70 61 63 6b 61 67 65 20 70 72 eady..package pr
1fb0: 6f 76 69 64 65 20 76 63 3a 3a 66 6f 73 73 69 6c ovide vc::fossil
1fc0: 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 70 ::import::cvs::p
1fd0: 61 73 73 3a 3a 63 6f 6c 6c 61 72 20 31 2e 30 0a ass::collar 1.0.
1fe0: 72 65 74 75 72 6e 0a return.