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 56 2e 20 43 6f 6d 69 6e 67 20 61 66 74 s IV. Coming aft
0210: 65 72 20 74 68 65 20 73 79 6d 62 6f 6c 20 63 6f er the symbol co
0220: 6c 6c 61 74 69 6f 6e 20 70 61 73 73 20 74 68 69 llation pass thi
0230: 73 20 70 61 73 73 20 6e 6f 77 0a 23 23 20 72 65 s pass now.## re
0240: 6d 6f 76 65 73 20 61 6c 6c 20 72 65 76 69 73 69 moves all revisi
0250: 6f 6e 73 20 61 6e 64 20 73 79 6d 62 6f 6c 73 20 ons and symbols
0260: 72 65 66 65 72 65 6e 63 69 6e 67 20 61 6e 79 20 referencing any
0270: 6f 66 20 74 68 65 20 65 78 63 6c 75 64 65 64 0a of the excluded.
0280: 23 23 20 73 79 6d 62 6f 6c 73 20 66 72 6f 6d 20 ## symbols from
0290: 74 68 65 20 70 65 72 73 69 73 74 65 6e 74 20 64 the persistent d
02a0: 61 74 61 62 61 73 65 2e 0a 0a 23 20 23 20 23 23 atabase...# # ##
02b0: 20 23 23 23 20 23 23 23 23 23 20 23 23 23 23 23 ### ##### #####
02c0: 23 23 23 20 23 23 23 23 23 23 23 23 23 23 23 23 ### ############
02d0: 23 20 23 23 23 23 23 23 23 23 23 23 23 23 23 23 # ##############
02e0: 23 23 23 23 23 23 23 0a 23 23 20 52 65 71 75 69 #######.## Requi
02f0: 72 65 6d 65 6e 74 73 0a 0a 70 61 63 6b 61 67 65 rements..package
0300: 20 72 65 71 75 69 72 65 20 54 63 6c 20 38 2e 34 require Tcl 8.4
0310: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0320: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3b ;
0330: 20 23 20 52 65 71 75 69 72 65 64 20 72 75 6e 74 # Required runt
0340: 69 6d 65 2e 0a 70 61 63 6b 61 67 65 20 72 65 71 ime..package req
0350: 75 69 72 65 20 73 6e 69 74 20 20 20 20 20 20 20 uire snit
0360: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0370: 20 20 20 20 20 20 20 20 20 20 20 3b 20 23 20 4f ; # O
0380: 4f 20 73 79 73 74 65 6d 2e 0a 70 61 63 6b 61 67 O system..packag
0390: 65 20 72 65 71 75 69 72 65 20 76 63 3a 3a 74 6f e require vc::to
03a0: 6f 6c 73 3a 3a 6c 6f 67 20 20 20 20 20 20 20 20 ols::log
03b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
03c0: 3b 20 23 20 55 73 65 72 20 66 65 65 64 62 61 63 ; # User feedbac
03d0: 6b 2e 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 k..package requi
03e0: 72 65 20 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 re vc::fossil::i
03f0: 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 73 74 61 74 mport::cvs::stat
0400: 65 20 20 20 20 20 20 20 20 3b 20 23 20 53 74 61 e ; # Sta
0410: 74 65 20 73 74 6f 72 61 67 65 2e 0a 70 61 63 6b te storage..pack
0420: 61 67 65 20 72 65 71 75 69 72 65 20 76 63 3a 3a age require vc::
0430: 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a fossil::import::
0440: 63 76 73 3a 3a 70 72 6f 6a 65 63 74 3a 3a 73 79 cvs::project::sy
0450: 6d 20 3b 20 23 20 50 72 6f 6a 65 63 74 20 6c 65 m ; # Project le
0460: 76 65 6c 20 73 79 6d 62 6f 6c 73 0a 0a 23 20 23 vel symbols..# #
0470: 20 23 23 20 23 23 23 20 23 23 23 23 23 20 23 23 ## ### ##### ##
0480: 23 23 23 23 23 23 20 23 23 23 23 23 23 23 23 23 ###### #########
0490: 23 23 23 23 20 23 23 23 23 23 23 23 23 23 23 23 #### ###########
04a0: 23 23 23 23 23 23 23 23 23 23 0a 23 23 20 52 65 ##########.## Re
04b0: 67 69 73 74 65 72 20 74 68 65 20 70 61 73 73 20 gister the pass
04c0: 77 69 74 68 20 74 68 65 20 6d 61 6e 61 67 65 6d with the managem
04d0: 65 6e 74 0a 0a 76 63 3a 3a 66 6f 73 73 69 6c 3a ent..vc::fossil:
04e0: 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 70 61 :import::cvs::pa
04f0: 73 73 20 64 65 66 69 6e 65 20 5c 0a 20 20 20 20 ss define \.
0500: 46 69 6c 74 65 72 53 79 6d 62 6f 6c 73 20 5c 0a FilterSymbols \.
0510: 20 20 20 20 7b 46 69 6c 74 65 72 20 73 79 6d 62 {Filter symb
0520: 6f 6c 73 2c 20 72 65 6d 6f 76 65 20 61 6c 6c 20 ols, remove all
0530: 65 78 63 6c 75 64 65 64 20 70 69 65 63 65 73 7d excluded pieces}
0540: 20 5c 0a 20 20 20 20 3a 3a 76 63 3a 3a 66 6f 73 \. ::vc::fos
0550: 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 sil::import::cvs
0560: 3a 3a 70 61 73 73 3a 3a 66 69 6c 74 65 72 73 79 ::pass::filtersy
0570: 6d 0a 0a 23 20 23 20 23 23 20 23 23 23 20 23 23 m..# # ## ### ##
0580: 23 23 23 20 23 23 23 23 23 23 23 23 20 23 23 23 ### ######## ###
0590: 23 23 23 23 23 23 23 23 23 23 20 23 23 23 23 23 ########## #####
05a0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
05b0: 0a 23 23 20 0a 0a 73 6e 69 74 3a 3a 74 79 70 65 .## ..snit::type
05c0: 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 ::vc::fossil::i
05d0: 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 70 61 73 73 mport::cvs::pass
05e0: 3a 3a 66 69 6c 74 65 72 73 79 6d 20 7b 0a 20 20 ::filtersym {.
05f0: 20 20 23 20 23 20 23 23 20 23 23 23 20 23 23 23 # # ## ### ###
0600: 23 23 20 23 23 23 23 23 23 23 23 20 23 23 23 23 ## ######## ####
0610: 23 23 23 23 23 23 23 23 23 0a 20 20 20 20 23 23 #########. ##
0620: 20 50 75 62 6c 69 63 20 41 50 49 0a 0a 20 20 20 Public API..
0630: 20 74 79 70 65 6d 65 74 68 6f 64 20 73 65 74 75 typemethod setu
0640: 70 20 7b 7d 20 7b 0a 09 23 20 44 65 66 69 6e 65 p {} {..# Define
0650: 20 6e 61 6d 65 73 20 61 6e 64 20 73 74 72 75 63 names and struc
0660: 74 75 72 65 20 6f 66 20 74 68 65 20 70 65 72 73 ture of the pers
0670: 69 73 74 65 6e 74 20 73 74 61 74 65 20 6f 66 20 istent state of
0680: 74 68 69 73 0a 09 23 20 70 61 73 73 2e 0a 0a 09 this..# pass....
0690: 73 74 61 74 65 20 72 65 61 64 69 6e 67 20 73 79 state reading sy
06a0: 6d 62 6f 6c 0a 09 73 74 61 74 65 20 72 65 61 64 mbol..state read
06b0: 69 6e 67 20 62 6c 6f 63 6b 65 72 0a 09 73 74 61 ing blocker..sta
06c0: 74 65 20 72 65 61 64 69 6e 67 20 70 61 72 65 6e te reading paren
06d0: 74 0a 09 73 74 61 74 65 20 72 65 61 64 69 6e 67 t..state reading
06e0: 20 70 72 65 66 65 72 65 64 70 61 72 65 6e 74 0a preferedparent.
06f0: 09 73 74 61 74 65 20 72 65 61 64 69 6e 67 20 72 .state reading r
0700: 65 76 69 73 69 6f 6e 0a 09 73 74 61 74 65 20 72 evision..state r
0710: 65 61 64 69 6e 67 20 62 72 61 6e 63 68 0a 09 73 eading branch..s
0720: 74 61 74 65 20 72 65 61 64 69 6e 67 20 74 61 67 tate reading tag
0730: 0a 09 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a ..return. }..
0740: 20 20 20 20 74 79 70 65 6d 65 74 68 6f 64 20 6c typemethod l
0750: 6f 61 64 20 7b 7d 20 7b 0a 09 23 20 50 61 73 73 oad {} {..# Pass
0760: 20 6d 61 6e 61 67 65 72 20 69 6e 74 65 72 66 61 manager interfa
0770: 63 65 2e 20 45 78 65 63 75 74 65 64 20 74 6f 20 ce. Executed to
0780: 6c 6f 61 64 20 64 61 74 61 20 63 6f 6d 70 75 74 load data comput
0790: 65 64 20 62 79 0a 09 23 20 74 68 69 73 20 70 61 ed by..# this pa
07a0: 73 73 20 69 6e 74 6f 20 6d 65 6d 6f 72 79 20 77 ss into memory w
07b0: 68 65 6e 20 74 68 69 73 20 70 61 73 73 20 69 73 hen this pass is
07c0: 20 73 6b 69 70 70 65 64 20 69 6e 73 74 65 61 64 skipped instead
07d0: 20 6f 66 0a 09 23 20 65 78 65 63 75 74 65 64 2e of..# executed.
07e0: 0a 0a 09 23 20 54 68 65 20 72 65 73 75 6c 74 73 ...# The results
07f0: 20 6f 66 20 74 68 69 73 20 70 61 73 73 20 61 72 of this pass ar
0800: 65 20 66 75 6c 6c 79 20 69 6e 20 74 68 65 20 70 e fully in the p
0810: 65 72 73 69 73 74 65 6e 74 20 73 74 61 74 65 2c ersistent state,
0820: 0a 09 23 20 74 68 65 72 65 20 69 73 20 6e 6f 74 ..# there is not
0830: 68 69 6e 67 20 74 6f 20 6c 6f 61 64 20 66 6f 72 hing to load for
0840: 20 74 68 65 20 6e 65 78 74 20 6f 6e 65 2e 0a 09 the next one...
0850: 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 return. }..
0860: 20 20 74 79 70 65 6d 65 74 68 6f 64 20 72 75 6e typemethod run
0870: 20 7b 7d 20 7b 0a 09 23 20 50 61 73 73 20 6d 61 {} {..# Pass ma
0880: 6e 61 67 65 72 20 69 6e 74 65 72 66 61 63 65 2e nager interface.
0890: 20 45 78 65 63 75 74 65 64 20 74 6f 20 70 65 72 Executed to per
08a0: 66 6f 72 6d 20 74 68 65 0a 09 23 20 66 75 6e 63 form the..# func
08b0: 74 69 6f 6e 61 6c 69 74 79 20 6f 66 20 74 68 65 tionality of the
08c0: 20 70 61 73 73 2e 0a 0a 09 23 20 54 68 65 20 72 pass....# The r
08d0: 65 6d 6f 76 61 6c 20 6f 66 20 65 78 63 6c 75 64 emoval of exclud
08e0: 65 64 20 73 79 6d 62 6f 6c 73 20 61 6e 64 20 65 ed symbols and e
08f0: 76 65 72 79 74 68 69 6e 67 20 72 65 66 65 72 65 verything refere
0900: 6e 63 69 6e 67 0a 09 23 20 74 6f 20 74 68 65 6d ncing..# to them
0910: 20 69 73 20 64 6f 6e 65 20 63 6f 6d 70 6c 65 74 is done complet
0920: 65 6c 79 20 69 6e 20 74 68 65 20 64 61 74 61 62 ely in the datab
0930: 61 73 65 2e 0a 0a 09 73 74 61 74 65 20 74 72 61 ase....state tra
0940: 6e 73 61 63 74 69 6f 6e 20 7b 0a 09 20 20 20 20 nsaction {..
0950: 46 69 6c 74 65 72 45 78 63 6c 75 64 65 64 53 79 FilterExcludedSy
0960: 6d 62 6f 6c 73 0a 09 20 20 20 20 4d 75 74 61 74 mbols.. Mutat
0970: 65 54 61 67 73 54 6f 42 72 61 6e 63 68 0a 09 20 eTagsToBranch..
0980: 20 20 20 4d 75 74 61 74 65 42 72 61 6e 63 68 65 MutateBranche
0990: 73 54 6f 54 61 67 0a 0a 09 20 20 20 20 23 20 43 sToTag... # C
09a0: 6f 6e 73 69 64 65 72 20 61 20 72 65 72 75 6e 20 onsider a rerun
09b0: 6f 66 20 74 68 65 20 70 61 73 73 20 32 20 70 61 of the pass 2 pa
09c0: 72 61 6e 6f 69 61 20 63 68 65 63 6b 73 2e 0a 09 ranoia checks...
09d0: 7d 0a 0a 09 6c 6f 67 20 77 72 69 74 65 20 31 20 }...log write 1
09e0: 66 69 6c 74 65 72 73 79 6d 20 22 46 69 6c 74 65 filtersym "Filte
09f0: 72 69 6e 67 20 63 6f 6d 70 6c 65 74 65 64 22 0a ring completed".
0a00: 09 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 .return. }..
0a10: 20 20 20 74 79 70 65 6d 65 74 68 6f 64 20 64 69 typemethod di
0a20: 73 63 61 72 64 20 7b 7d 20 7b 0a 09 23 20 50 61 scard {} {..# Pa
0a30: 73 73 20 6d 61 6e 61 67 65 72 20 69 6e 74 65 72 ss manager inter
0a40: 66 61 63 65 2e 20 45 78 65 63 75 74 65 64 20 66 face. Executed f
0a50: 6f 72 20 61 6c 6c 20 70 61 73 73 65 73 20 61 66 or all passes af
0a60: 74 65 72 20 74 68 65 0a 09 23 20 72 75 6e 20 70 ter the..# run p
0a70: 61 73 73 65 73 2c 20 74 6f 20 72 65 6d 6f 76 65 asses, to remove
0a80: 20 61 6c 6c 20 64 61 74 61 20 6f 66 20 74 68 69 all data of thi
0a90: 73 20 70 61 73 73 20 66 72 6f 6d 20 74 68 65 20 s pass from the
0aa0: 73 74 61 74 65 2c 0a 09 23 20 61 73 20 62 65 69 state,..# as bei
0ab0: 6e 67 20 6f 75 74 20 6f 66 20 64 61 74 65 2e 0a ng out of date..
0ac0: 09 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 .return. }..
0ad0: 20 20 20 23 20 23 20 23 23 20 23 23 23 20 23 23 # # ## ### ##
0ae0: 23 23 23 20 23 23 23 23 23 23 23 23 20 23 23 23 ### ######## ###
0af0: 23 23 23 23 23 23 23 23 23 23 0a 20 20 20 20 23 ##########. #
0b00: 23 20 49 6e 74 65 72 6e 61 6c 20 6d 65 74 68 6f # Internal metho
0b10: 64 73 0a 0a 20 20 20 20 70 72 6f 63 20 46 69 6c ds.. proc Fil
0b20: 74 65 72 45 78 63 6c 75 64 65 64 53 79 6d 62 6f terExcludedSymbo
0b30: 6c 73 20 7b 7d 20 7b 0a 09 6c 6f 67 20 77 72 69 ls {} {..log wri
0b40: 74 65 20 33 20 66 69 6c 74 65 72 73 79 6d 20 22 te 3 filtersym "
0b50: 46 69 6c 74 65 72 20 6f 75 74 20 65 78 63 6c 75 Filter out exclu
0b60: 64 65 64 20 73 79 6d 62 6f 6c 73 20 61 6e 64 20 ded symbols and
0b70: 75 73 65 72 73 22 0a 0a 09 23 20 57 65 20 70 75 users"...# We pu
0b80: 6c 6c 20 61 6c 6c 20 74 68 65 20 65 78 63 6c 75 ll all the exclu
0b90: 64 65 64 20 73 79 6d 62 6f 6c 73 20 74 6f 67 65 ded symbols toge
0ba0: 74 68 65 72 20 69 6e 74 6f 20 61 20 74 61 62 6c ther into a tabl
0bb0: 65 20 66 6f 72 0a 09 23 20 65 61 73 79 20 72 65 e for..# easy re
0bc0: 66 65 72 65 6e 63 65 20 62 79 20 74 68 65 20 75 ference by the u
0bd0: 70 63 6f 6d 69 6e 67 20 44 45 4c 45 54 45 20 61 pcoming DELETE a
0be0: 6e 64 20 6f 74 68 65 72 20 73 74 61 74 65 6d 65 nd other stateme
0bf0: 6e 74 73 2e 0a 09 23 20 28 27 78 20 49 4e 20 74 nts...# ('x IN t
0c00: 61 62 6c 65 27 20 63 6c 61 75 73 65 73 29 2e 0a able' clauses)..
0c10: 0a 09 73 65 74 20 65 78 63 6c 20 5b 70 72 6f 6a ..set excl [proj
0c20: 65 63 74 3a 3a 73 79 6d 20 65 78 63 6c 75 64 65 ect::sym exclude
0c30: 64 5d 0a 0a 09 73 74 61 74 65 20 72 75 6e 20 7b d]...state run {
0c40: 0a 09 20 20 20 20 43 52 45 41 54 45 20 54 45 4d .. CREATE TEM
0c50: 50 4f 52 41 52 59 20 54 41 42 4c 45 20 65 78 63 PORARY TABLE exc
0c60: 6c 75 64 65 64 73 79 6d 62 6f 6c 73 20 41 53 0a ludedsymbols AS.
0c70: 09 20 20 20 20 53 45 4c 45 43 54 20 73 69 64 0a . SELECT sid.
0c80: 09 20 20 20 20 46 52 4f 4d 20 20 20 73 79 6d 62 . FROM symb
0c90: 6f 6c 0a 09 20 20 20 20 57 48 45 52 45 20 20 74 ol.. WHERE t
0ca0: 79 70 65 20 3d 20 24 65 78 63 6c 0a 09 7d 0a 0a ype = $excl..}..
0cb0: 09 23 20 46 69 72 73 74 20 77 65 20 68 61 76 65 .# First we have
0cc0: 20 74 6f 20 68 61 6e 64 6c 65 20 74 68 65 20 70 to handle the p
0cd0: 6f 73 73 69 62 69 6c 69 74 79 20 6f 66 20 61 6e ossibility of an
0ce0: 20 65 78 63 6c 75 64 65 64 0a 09 23 20 4e 54 44 excluded..# NTD
0cf0: 42 2e 20 54 68 69 73 20 69 73 20 61 20 73 70 65 B. This is a spe
0d00: 63 69 61 6c 20 73 70 65 63 69 61 6c 20 63 61 73 cial special cas
0d10: 65 20 74 68 65 72 65 20 77 65 20 68 61 76 65 20 e there we have
0d20: 74 6f 0a 09 23 20 72 65 67 72 61 66 74 20 74 68 to..# regraft th
0d30: 65 20 72 65 76 69 73 69 6f 6e 73 20 77 68 69 63 e revisions whic
0d40: 68 20 61 72 65 20 73 68 61 72 65 64 20 62 65 74 h are shared bet
0d50: 77 65 65 6e 20 74 68 65 20 4e 54 44 42 20 61 6e ween the NTDB an
0d60: 64 0a 09 23 20 54 72 75 6e 6b 20 6f 6e 74 6f 20 d..# Trunk onto
0d70: 74 68 65 20 74 72 75 6e 6b 2c 20 70 72 65 76 65 the trunk, preve
0d80: 6e 74 69 6e 67 20 74 68 65 69 72 20 64 65 6c 65 nting their dele
0d90: 74 69 6f 6e 20 6c 61 74 65 72 2e 20 57 65 0a 09 tion later. We..
0da0: 23 20 68 61 76 65 20 63 6f 64 65 20 66 6f 72 20 # have code for
0db0: 74 68 61 74 20 69 6e 20 27 66 69 6c 65 27 2c 20 that in 'file',
0dc0: 68 6f 77 65 76 65 72 20 74 68 61 74 20 6f 70 65 however that ope
0dd0: 72 61 74 65 64 20 6f 6e 20 74 68 65 0a 09 23 20 rated on the..#
0de0: 69 6e 2d 6d 65 6d 6f 72 79 20 72 65 76 69 73 69 in-memory revisi
0df0: 6f 6e 20 6f 62 6a 65 63 74 73 2c 20 77 68 69 63 on objects, whic
0e00: 68 20 77 65 20 64 6f 20 6e 6f 74 20 68 61 76 65 h we do not have
0e10: 20 68 65 72 65 2e 20 57 65 20 64 6f 0a 09 23 20 here. We do..#
0e20: 74 68 65 20 73 61 6d 65 20 6e 6f 77 20 77 69 74 the same now wit
0e30: 68 6f 75 74 20 6f 62 6a 65 63 74 2c 20 62 79 20 hout object, by
0e40: 64 69 72 65 63 74 6c 79 20 6d 61 6e 69 70 75 6c directly manipul
0e50: 61 74 69 6e 67 20 74 68 65 0a 09 23 20 6c 69 6e ating the..# lin
0e60: 6b 73 20 69 6e 20 74 68 65 20 64 61 74 61 62 61 ks in the databa
0e70: 73 65 2e 0a 0a 09 61 72 72 61 79 20 73 65 74 20 se....array set
0e80: 6e 74 64 62 20 7b 7d 0a 09 61 72 72 61 79 20 73 ntdb {}..array s
0e90: 65 74 20 6c 69 6e 6b 20 7b 7d 0a 0a 09 66 6f 72 et link {}...for
0ea0: 65 61 63 68 20 7b 69 64 20 70 61 72 65 6e 74 20 each {id parent
0eb0: 74 72 61 6e 73 66 65 72 7d 20 5b 73 74 61 74 65 transfer} [state
0ec0: 20 72 75 6e 20 7b 0a 09 20 20 20 20 53 45 4c 45 run {.. SELE
0ed0: 43 54 20 52 2e 72 69 64 2c 20 52 2e 70 61 72 65 CT R.rid, R.pare
0ee0: 6e 74 2c 20 52 2e 64 62 63 68 69 6c 64 0a 09 20 nt, R.dbchild..
0ef0: 20 20 20 46 52 4f 4d 20 20 72 65 76 69 73 69 6f FROM revisio
0f00: 6e 20 52 2c 20 73 79 6d 62 6f 6c 20 53 0a 09 20 n R, symbol S..
0f10: 20 20 20 57 48 45 52 45 20 52 2e 6c 6f 64 20 3d WHERE R.lod =
0f20: 20 53 2e 73 69 64 0a 09 20 20 20 20 41 4e 44 20 S.sid.. AND
0f30: 20 20 53 2e 73 69 64 20 49 4e 20 65 78 63 6c 75 S.sid IN exclu
0f40: 64 65 64 73 79 6d 62 6f 6c 73 0a 09 20 20 20 20 dedsymbols..
0f50: 41 4e 44 20 20 20 52 2e 69 73 64 65 66 61 75 6c AND R.isdefaul
0f60: 74 0a 09 7d 5d 20 7b 0a 09 20 20 20 20 73 65 74 t..}] {.. set
0f70: 20 6e 74 64 62 28 24 69 64 29 20 24 70 61 72 65 ntdb($id) $pare
0f80: 6e 74 0a 09 20 20 20 20 69 66 20 7b 24 74 72 61 nt.. if {$tra
0f90: 6e 73 66 65 72 20 65 71 20 22 22 7d 20 63 6f 6e nsfer eq ""} con
0fa0: 74 69 6e 75 65 0a 09 20 20 20 20 73 65 74 20 6c tinue.. set l
0fb0: 69 6e 6b 28 24 69 64 29 20 24 74 72 61 6e 73 66 ink($id) $transf
0fc0: 65 72 0a 09 7d 0a 0a 09 66 6f 72 65 61 63 68 20 er..}...foreach
0fd0: 6a 6f 69 6e 74 20 5b 61 72 72 61 79 20 6e 61 6d joint [array nam
0fe0: 65 73 20 6c 69 6e 6b 5d 20 7b 0a 09 20 20 20 20 es link] {..
0ff0: 23 20 54 68 65 20 6a 6f 69 6e 74 73 20 61 72 65 # The joints are
1000: 20 74 68 65 20 68 69 67 68 65 73 74 20 4e 54 44 the highest NTD
1010: 42 20 72 65 76 69 73 69 6f 6e 73 20 77 68 69 63 B revisions whic
1020: 68 20 61 72 65 0a 09 20 20 20 20 23 20 73 68 61 h are.. # sha
1030: 72 65 64 20 77 69 74 68 20 74 68 65 69 72 20 72 red with their r
1040: 65 73 70 65 63 74 69 76 65 20 74 72 75 6e 6b 2e espective trunk.
1050: 20 57 65 20 64 69 73 63 6f 6e 6e 65 63 74 20 66 We disconnect f
1060: 72 6f 6d 0a 09 20 20 20 20 23 20 74 68 65 69 72 rom.. # their
1070: 20 4e 54 44 42 20 63 68 69 6c 64 72 65 6e 2c 20 NTDB children,
1080: 61 6e 64 20 6d 61 6b 65 20 74 68 65 6d 20 70 61 and make them pa
1090: 72 65 6e 74 73 20 6f 66 20 74 68 65 69 72 0a 09 rents of their..
10a0: 20 20 20 20 23 20 27 64 62 63 68 69 6c 64 27 2e # 'dbchild'.
10b0: 20 54 68 65 20 61 73 73 6f 63 69 61 74 65 64 20 The associated
10c0: 27 64 62 70 61 72 65 6e 74 27 20 69 73 20 73 71 'dbparent' is sq
10d0: 75 61 73 68 65 64 0a 09 20 20 20 20 23 20 69 6e uashed.. # in
10e0: 73 74 65 61 64 2e 20 41 6c 6c 20 70 61 72 65 6e stead. All paren
10f0: 74 73 20 6f 66 20 74 68 65 20 6a 6f 69 6e 74 73 ts of the joints
1100: 20 61 72 65 20 6d 6f 76 65 64 20 74 6f 20 74 68 are moved to th
1110: 65 0a 09 20 20 20 20 23 20 74 72 75 6e 6b 20 61 e.. # trunk a
1120: 73 20 77 65 6c 6c 2e 0a 0a 09 20 20 20 20 73 65 s well.... se
1130: 74 20 74 6a 6f 69 6e 74 20 24 6c 69 6e 6b 28 24 t tjoint $link($
1140: 6a 6f 69 6e 74 29 0a 09 20 20 20 20 73 65 74 20 joint).. set
1150: 74 6c 6f 64 20 5b 6c 69 6e 64 65 78 20 5b 73 74 tlod [lindex [st
1160: 61 74 65 20 72 75 6e 20 7b 0a 09 09 53 45 4c 45 ate run {...SELE
1170: 43 54 20 6c 6f 64 20 46 52 4f 4d 20 72 65 76 69 CT lod FROM revi
1180: 73 69 6f 6e 20 57 48 45 52 45 20 72 69 64 20 3d sion WHERE rid =
1190: 20 24 74 6a 6f 69 6e 74 0a 09 20 20 20 20 7d 5d $tjoint.. }]
11a0: 20 30 5d 0a 0a 09 20 20 20 20 23 20 43 6f 76 6e 0]... # Covn
11b0: 65 72 74 20 64 62 2f 70 61 72 65 6e 74 2f 63 68 ert db/parent/ch
11c0: 69 6c 64 20 69 6e 74 6f 20 72 65 67 75 6c 61 72 ild into regular
11d0: 20 70 61 72 65 6e 74 2f 63 68 69 6c 64 20 6c 69 parent/child li
11e0: 6e 6b 73 2e 0a 09 20 20 20 20 73 74 61 74 65 20 nks... state
11f0: 72 75 6e 20 7b 0a 09 09 55 50 44 41 54 45 20 72 run {...UPDATE r
1200: 65 76 69 73 69 6f 6e 20 53 45 54 20 64 62 70 61 evision SET dbpa
1210: 72 65 6e 74 20 3d 20 4e 55 4c 4c 2c 20 70 61 72 rent = NULL, par
1220: 65 6e 74 20 3d 20 24 6a 6f 69 6e 74 20 20 57 48 ent = $joint WH
1230: 45 52 45 20 72 69 64 20 3d 20 24 74 6a 6f 69 6e ERE rid = $tjoin
1240: 74 20 3b 0a 09 09 55 50 44 41 54 45 20 72 65 76 t ;...UPDATE rev
1250: 69 73 69 6f 6e 20 53 45 54 20 64 62 63 68 69 6c ision SET dbchil
1260: 64 20 20 3d 20 4e 55 4c 4c 2c 20 63 68 69 6c 64 d = NULL, child
1270: 20 20 3d 20 24 74 6a 6f 69 6e 74 20 57 48 45 52 = $tjoint WHER
1280: 45 20 72 69 64 20 3d 20 24 6a 6f 69 6e 74 20 20 E rid = $joint
1290: 3b 0a 09 20 20 20 20 7d 0a 09 20 20 20 20 77 68 ;.. }.. wh
12a0: 69 6c 65 20 7b 31 7d 20 7b 0a 09 09 23 20 4d 6f ile {1} {...# Mo
12b0: 76 65 20 74 68 65 20 4e 54 44 42 20 74 72 75 6e ve the NTDB trun
12c0: 6b 20 72 65 76 69 73 69 6f 6e 73 20 74 6f 20 74 k revisions to t
12d0: 72 75 6e 6b 2e 0a 09 09 73 74 61 74 65 20 72 75 runk....state ru
12e0: 6e 20 7b 0a 09 09 20 20 20 20 55 50 44 41 54 45 n {... UPDATE
12f0: 20 72 65 76 69 73 69 6f 6e 20 53 45 54 20 6c 6f revision SET lo
1300: 64 20 3d 20 24 74 6c 6f 64 2c 20 69 73 64 65 66 d = $tlod, isdef
1310: 61 75 6c 74 20 3d 20 30 20 57 48 45 52 45 20 72 ault = 0 WHERE r
1320: 69 64 20 3d 20 24 6a 6f 69 6e 74 0a 09 09 7d 0a id = $joint...}.
1330: 09 09 73 65 74 20 6c 61 73 74 20 24 6a 6f 69 6e ..set last $join
1340: 74 0a 09 09 73 65 74 20 6a 6f 69 6e 74 20 24 6e t...set joint $n
1350: 74 64 62 28 24 6a 6f 69 6e 74 29 0a 09 09 69 66 tdb($joint)...if
1360: 20 7b 21 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 {![info exists
1370: 6e 74 64 62 28 24 6a 6f 69 6e 74 29 5d 7d 20 62 ntdb($joint)]} b
1380: 72 65 61 6b 0a 09 20 20 20 20 7d 0a 0a 09 20 20 reak.. }...
1390: 20 20 23 20 52 65 61 63 68 65 64 20 74 68 65 20 # Reached the
13a0: 4e 54 44 42 20 62 61 73 69 73 20 69 6e 20 74 68 NTDB basis in th
13b0: 65 20 74 72 75 6e 6b 2e 20 46 69 6e 61 6c 69 7a e trunk. Finaliz
13c0: 65 20 74 68 65 0a 09 20 20 20 20 23 20 70 61 72 e the.. # par
13d0: 65 6e 74 2f 63 68 69 6c 64 20 6c 69 6e 6b 61 67 ent/child linkag
13e0: 65 20 61 6e 64 20 73 71 75 61 73 68 20 74 68 65 e and squash the
13f0: 20 62 72 61 6e 63 68 20 70 61 72 65 6e 74 20 73 branch parent s
1400: 79 6d 62 6f 6c 0a 09 20 20 20 20 23 20 72 65 66 ymbol.. # ref
1410: 65 72 65 6e 63 65 2e 0a 0a 09 20 20 20 20 73 74 erence.... st
1420: 61 74 65 20 72 75 6e 20 7b 0a 09 09 55 50 44 41 ate run {...UPDA
1430: 54 45 20 72 65 76 69 73 69 6f 6e 20 53 45 54 20 TE revision SET
1440: 63 68 69 6c 64 20 20 20 3d 20 24 6c 61 73 74 20 child = $last
1450: 57 48 45 52 45 20 72 69 64 20 3d 20 24 6a 6f 69 WHERE rid = $joi
1460: 6e 74 20 3b 0a 09 09 55 50 44 41 54 45 20 72 65 nt ;...UPDATE re
1470: 76 69 73 69 6f 6e 20 53 45 54 20 62 70 61 72 65 vision SET bpare
1480: 6e 74 20 3d 20 4e 55 4c 4c 20 20 57 48 45 52 45 nt = NULL WHERE
1490: 20 72 69 64 20 3d 20 24 6c 61 73 74 20 20 3b 0a rid = $last ;.
14a0: 09 20 20 20 20 7d 0a 09 7d 0a 0a 09 23 20 4e 6f . }..}...# No
14b0: 77 20 74 68 61 74 20 74 68 65 20 73 70 65 63 69 w that the speci
14c0: 61 6c 20 63 61 73 65 20 69 73 20 64 6f 6e 65 20 al case is done
14d0: 77 65 20 63 61 6e 20 73 69 6d 70 6c 79 20 6b 69 we can simply ki
14e0: 6c 6c 20 61 6c 6c 20 74 68 65 0a 09 23 20 72 65 ll all the..# re
14f0: 76 69 73 69 6f 6e 73 2c 20 74 61 67 73 2c 20 61 visions, tags, a
1500: 6e 64 20 62 72 61 6e 63 68 65 73 20 72 65 66 65 nd branches refe
1510: 72 65 6e 63 69 6e 67 20 61 6e 79 20 6f 66 20 74 rencing any of t
1520: 68 65 0a 09 23 20 65 78 63 6c 75 64 65 64 20 73 he..# excluded s
1530: 79 6d 62 6f 6c 73 20 69 6e 20 73 6f 6d 65 20 77 ymbols in some w
1540: 61 79 2e 20 54 68 69 73 20 69 73 20 65 61 73 79 ay. This is easy
1550: 20 61 73 20 77 65 20 64 6f 20 6e 6f 74 20 68 61 as we do not ha
1560: 76 65 0a 09 23 20 74 6f 20 73 65 6c 65 63 74 20 ve..# to select
1570: 74 68 65 6d 20 61 67 61 69 6e 20 61 6e 64 20 61 them again and a
1580: 67 61 69 6e 20 66 72 6f 6d 20 74 68 65 20 62 61 gain from the ba
1590: 73 65 20 74 61 62 6c 65 73 20 61 6e 79 0a 09 23 se tables any..#
15a0: 20 6c 6f 6e 67 65 72 2e 0a 0a 09 73 74 61 74 65 longer....state
15b0: 20 72 75 6e 20 7b 0a 09 20 20 20 20 44 45 4c 45 run {.. DELE
15c0: 54 45 20 46 52 4f 4d 20 72 65 76 69 73 69 6f 6e TE FROM revision
15d0: 20 57 48 45 52 45 20 6c 6f 64 20 49 4e 20 65 78 WHERE lod IN ex
15e0: 63 6c 75 64 65 64 73 79 6d 62 6f 6c 73 3b 0a 09 cludedsymbols;..
15f0: 20 20 20 20 44 45 4c 45 54 45 20 46 52 4f 4d 20 DELETE FROM
1600: 74 61 67 20 20 20 20 20 20 57 48 45 52 45 20 6c tag WHERE l
1610: 6f 64 20 49 4e 20 65 78 63 6c 75 64 65 64 73 79 od IN excludedsy
1620: 6d 62 6f 6c 73 3b 0a 09 20 20 20 20 44 45 4c 45 mbols;.. DELE
1630: 54 45 20 46 52 4f 4d 20 74 61 67 20 20 20 20 20 TE FROM tag
1640: 20 57 48 45 52 45 20 73 69 64 20 49 4e 20 65 78 WHERE sid IN ex
1650: 63 6c 75 64 65 64 73 79 6d 62 6f 6c 73 3b 0a 09 cludedsymbols;..
1660: 20 20 20 20 44 45 4c 45 54 45 20 46 52 4f 4d 20 DELETE FROM
1670: 62 72 61 6e 63 68 20 20 20 57 48 45 52 45 20 6c branch WHERE l
1680: 6f 64 20 49 4e 20 65 78 63 6c 75 64 65 64 73 79 od IN excludedsy
1690: 6d 62 6f 6c 73 3b 0a 09 20 20 20 20 44 45 4c 45 mbols;.. DELE
16a0: 54 45 20 46 52 4f 4d 20 62 72 61 6e 63 68 20 20 TE FROM branch
16b0: 20 57 48 45 52 45 20 73 69 64 20 49 4e 20 65 78 WHERE sid IN ex
16c0: 63 6c 75 64 65 64 73 79 6d 62 6f 6c 73 3b 0a 0a cludedsymbols;..
16d0: 09 20 20 20 20 44 52 4f 50 20 54 41 42 4c 45 20 . DROP TABLE
16e0: 65 78 63 6c 75 64 65 64 73 79 6d 62 6f 6c 73 3b excludedsymbols;
16f0: 0a 09 7d 0a 09 72 65 74 75 72 6e 0a 20 20 20 20 ..}..return.
1700: 7d 0a 0a 20 20 20 20 70 72 6f 63 20 4d 75 74 61 }.. proc Muta
1710: 74 65 54 61 67 73 54 6f 42 72 61 6e 63 68 20 7b teTagsToBranch {
1720: 7d 20 7b 0a 09 6c 6f 67 20 77 72 69 74 65 20 33 } {..log write 3
1730: 20 66 69 6c 74 65 72 73 79 6d 20 22 4d 75 74 61 filtersym "Muta
1740: 74 65 20 74 61 67 73 20 74 6f 20 62 72 61 6e 63 te tags to branc
1750: 68 65 73 22 0a 0a 09 23 20 4e 65 78 74 2c 20 6e hes"...# Next, n
1760: 6f 77 20 74 68 61 74 20 77 65 20 6b 6e 6f 77 20 ow that we know
1770: 77 68 69 63 68 20 73 79 6d 62 6f 6c 73 20 61 72 which symbols ar
1780: 65 20 77 68 61 74 20 77 65 20 6c 6f 6f 6b 20 66 e what we look f
1790: 6f 72 0a 09 23 20 66 69 6c 65 20 6c 65 76 65 6c or..# file level
17a0: 20 74 61 67 73 20 77 68 69 63 68 20 61 72 65 20 tags which are
17b0: 61 63 74 75 61 6c 6c 79 20 63 6f 6e 76 65 72 74 actually convert
17c0: 65 64 20 61 73 20 62 72 61 6e 63 68 65 73 0a 09 ed as branches..
17d0: 23 20 28 70 72 6f 6a 65 63 74 20 6c 65 76 65 6c # (project level
17e0: 29 2c 20 61 6e 64 20 70 75 74 20 74 68 65 6d 20 ), and put them
17f0: 69 6e 74 6f 20 74 68 65 20 63 6f 72 72 65 63 74 into the correct
1800: 20 74 61 62 6c 65 2e 0a 0a 09 73 65 74 20 62 72 table....set br
1810: 61 6e 63 68 20 5b 70 72 6f 6a 65 63 74 3a 3a 73 anch [project::s
1820: 79 6d 20 62 72 61 6e 63 68 5d 0a 0a 09 73 65 74 ym branch]...set
1830: 20 74 61 67 73 74 6f 6d 75 74 61 74 65 20 5b 73 tagstomutate [s
1840: 74 61 74 65 20 72 75 6e 20 7b 0a 09 20 20 20 20 tate run {..
1850: 53 45 4c 45 43 54 20 54 2e 74 69 64 2c 20 54 2e SELECT T.tid, T.
1860: 66 69 64 2c 20 54 2e 6c 6f 64 2c 20 54 2e 73 69 fid, T.lod, T.si
1870: 64 2c 20 54 2e 72 65 76 0a 09 20 20 20 20 46 52 d, T.rev.. FR
1880: 4f 4d 20 74 61 67 20 54 2c 20 73 79 6d 62 6f 6c OM tag T, symbol
1890: 20 53 0a 09 20 20 20 20 57 48 45 52 45 20 54 2e S.. WHERE T.
18a0: 73 69 64 20 3d 20 53 2e 73 69 64 0a 09 20 20 20 sid = S.sid..
18b0: 20 41 4e 44 20 53 2e 74 79 70 65 20 3d 20 24 62 AND S.type = $b
18c0: 72 61 6e 63 68 0a 09 7d 5d 0a 09 66 6f 72 65 61 ranch..}]..forea
18d0: 63 68 20 7b 69 64 20 66 69 64 20 6c 6f 64 20 73 ch {id fid lod s
18e0: 69 64 20 72 65 76 7d 20 24 74 61 67 73 74 6f 6d id rev} $tagstom
18f0: 75 74 61 74 65 20 7b 0a 09 20 20 20 20 73 74 61 utate {.. sta
1900: 74 65 20 72 75 6e 20 7b 0a 09 09 44 45 4c 45 54 te run {...DELET
1910: 45 20 46 52 4f 4d 20 74 61 67 20 57 48 45 52 45 E FROM tag WHERE
1920: 20 74 69 64 20 3d 20 24 69 64 20 3b 0a 09 09 49 tid = $id ;...I
1930: 4e 53 45 52 54 20 49 4e 54 4f 20 62 72 61 6e 63 NSERT INTO branc
1940: 68 20 28 62 69 64 2c 20 66 69 64 2c 20 20 6c 6f h (bid, fid, lo
1950: 64 2c 20 20 73 69 64 2c 20 20 72 6f 6f 74 2c 20 d, sid, root,
1960: 66 69 72 73 74 2c 20 62 72 61 29 0a 09 09 56 41 first, bra)...VA
1970: 4c 55 45 53 20 20 20 20 20 20 20 20 20 20 20 20 LUES
1980: 20 28 24 69 64 2c 20 24 66 69 64 2c 20 24 6c 6f ($id, $fid, $lo
1990: 64 2c 20 24 73 69 64 2c 20 24 72 65 76 2c 20 4e d, $sid, $rev, N
19a0: 55 4c 4c 2c 20 20 27 27 29 3b 0a 09 20 20 20 20 ULL, '');..
19b0: 7d 0a 09 7d 0a 09 72 65 74 75 72 6e 0a 20 20 20 }..}..return.
19c0: 20 7d 0a 0a 20 20 20 20 70 72 6f 63 20 4d 75 74 }.. proc Mut
19d0: 61 74 65 42 72 61 6e 63 68 65 73 54 6f 54 61 67 ateBranchesToTag
19e0: 20 7b 7d 20 7b 0a 09 6c 6f 67 20 77 72 69 74 65 {} {..log write
19f0: 20 33 20 66 69 6c 74 65 72 73 79 6d 20 22 4d 75 3 filtersym "Mu
1a00: 74 61 74 65 20 62 72 61 6e 63 68 65 73 20 74 6f tate branches to
1a10: 20 74 61 67 73 22 0a 0a 09 23 20 4e 65 78 74 2c tags"...# Next,
1a20: 20 6e 6f 77 20 74 68 61 74 20 77 65 20 6b 6e 6f now that we kno
1a30: 77 20 77 68 69 63 68 20 73 79 6d 62 6f 6c 73 20 w which symbols
1a40: 61 72 65 20 77 68 61 74 20 77 65 20 6c 6f 6f 6b are what we look
1a50: 20 66 6f 72 0a 09 23 20 66 69 6c 65 20 6c 65 76 for..# file lev
1a60: 65 6c 20 62 72 61 6e 63 68 65 73 20 77 68 69 63 el branches whic
1a70: 68 20 61 72 65 20 61 63 74 75 61 6c 6c 79 20 63 h are actually c
1a80: 6f 6e 76 65 72 74 65 64 20 61 73 20 74 61 67 73 onverted as tags
1a90: 0a 09 23 20 28 70 72 6f 6a 65 63 74 20 6c 65 76 ..# (project lev
1aa0: 65 6c 29 2c 20 61 6e 64 20 70 75 74 20 74 68 65 el), and put the
1ab0: 6d 20 69 6e 74 6f 20 74 68 65 20 63 6f 72 72 65 m into the corre
1ac0: 63 74 20 74 61 62 6c 65 2e 0a 0a 09 73 65 74 20 ct table....set
1ad0: 74 61 67 20 5b 70 72 6f 6a 65 63 74 3a 3a 73 79 tag [project::sy
1ae0: 6d 20 74 61 67 5d 0a 0a 09 73 65 74 20 62 72 61 m tag]...set bra
1af0: 6e 63 68 65 73 74 6f 6d 75 74 61 74 65 20 5b 73 nchestomutate [s
1b00: 74 61 74 65 20 72 75 6e 20 7b 0a 09 20 20 20 20 tate run {..
1b10: 53 45 4c 45 43 54 20 42 2e 62 69 64 2c 20 42 2e SELECT B.bid, B.
1b20: 66 69 64 2c 20 42 2e 6c 6f 64 2c 20 42 2e 73 69 fid, B.lod, B.si
1b30: 64 2c 20 42 2e 72 6f 6f 74 2c 20 42 2e 66 69 72 d, B.root, B.fir
1b40: 73 74 2c 20 42 2e 62 72 61 0a 09 20 20 20 20 46 st, B.bra.. F
1b50: 52 4f 4d 20 62 72 61 6e 63 68 20 42 2c 20 73 79 ROM branch B, sy
1b60: 6d 62 6f 6c 20 53 0a 09 20 20 20 20 57 48 45 52 mbol S.. WHER
1b70: 45 20 42 2e 73 69 64 20 3d 20 53 2e 73 69 64 0a E B.sid = S.sid.
1b80: 09 20 20 20 20 41 4e 44 20 53 2e 74 79 70 65 20 . AND S.type
1b90: 3d 20 24 74 61 67 0a 09 7d 5d 0a 09 66 6f 72 65 = $tag..}]..fore
1ba0: 61 63 68 20 7b 69 64 20 66 69 64 20 6c 6f 64 20 ach {id fid lod
1bb0: 73 69 64 20 72 6f 6f 74 20 66 69 72 73 74 20 62 sid root first b
1bc0: 72 61 7d 20 24 62 72 61 6e 63 68 65 73 74 6f 6d ra} $branchestom
1bd0: 75 74 61 74 65 20 7b 0a 09 20 20 20 20 73 74 61 utate {.. sta
1be0: 74 65 20 72 75 6e 20 7b 0a 09 09 44 45 4c 45 54 te run {...DELET
1bf0: 45 20 46 52 4f 4d 20 62 72 61 6e 63 68 20 57 48 E FROM branch WH
1c00: 45 52 45 20 62 69 64 20 3d 20 24 69 64 20 3b 0a ERE bid = $id ;.
1c10: 09 09 49 4e 53 45 52 54 20 49 4e 54 4f 20 74 61 ..INSERT INTO ta
1c20: 67 20 28 74 69 64 2c 20 66 69 64 2c 20 20 6c 6f g (tid, fid, lo
1c30: 64 2c 20 20 73 69 64 2c 20 20 72 65 76 29 0a 09 d, sid, rev)..
1c40: 09 56 41 4c 55 45 53 20 20 20 20 20 20 20 20 20 .VALUES
1c50: 20 28 24 69 64 2c 20 24 66 69 64 2c 20 24 6c 6f ($id, $fid, $lo
1c60: 64 2c 20 24 73 69 64 2c 20 24 72 6f 6f 74 29 3b d, $sid, $root);
1c70: 0a 09 20 20 20 20 7d 0a 09 7d 0a 09 72 65 74 75 .. }..}..retu
1c80: 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 20 20 23 20 rn. }.. #
1c90: 23 20 23 23 20 23 23 23 20 23 23 23 23 23 20 23 # ## ### ##### #
1ca0: 23 23 23 23 23 23 23 20 23 23 23 23 23 23 23 23 ####### ########
1cb0: 23 23 23 23 23 0a 20 20 20 20 23 23 20 43 6f 6e #####. ## Con
1cc0: 66 69 67 75 72 61 74 69 6f 6e 0a 0a 20 20 20 20 figuration..
1cd0: 70 72 61 67 6d 61 20 2d 68 61 73 69 6e 73 74 61 pragma -hasinsta
1ce0: 6e 63 65 73 20 20 20 6e 6f 20 3b 20 23 20 73 69 nces no ; # si
1cf0: 6e 67 6c 65 74 6f 6e 0a 20 20 20 20 70 72 61 67 ngleton. prag
1d00: 6d 61 20 2d 68 61 73 74 79 70 65 69 6e 66 6f 20 ma -hastypeinfo
1d10: 20 20 20 6e 6f 20 3b 20 23 20 6e 6f 20 69 6e 74 no ; # no int
1d20: 72 6f 73 70 65 63 74 69 6f 6e 0a 20 20 20 20 70 rospection. p
1d30: 72 61 67 6d 61 20 2d 68 61 73 74 79 70 65 64 65 ragma -hastypede
1d40: 73 74 72 6f 79 20 6e 6f 20 3b 20 23 20 69 6d 6d stroy no ; # imm
1d50: 6f 72 74 61 6c 0a 0a 20 20 20 20 23 20 23 20 23 ortal.. # # #
1d60: 23 20 23 23 23 20 23 23 23 23 23 20 23 23 23 23 # ### ##### ####
1d70: 23 23 23 23 20 23 23 23 23 23 23 23 23 23 23 23 #### ###########
1d80: 23 23 0a 7d 0a 0a 6e 61 6d 65 73 70 61 63 65 20 ##.}..namespace
1d90: 65 76 61 6c 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 eval ::vc::fossi
1da0: 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a l::import::cvs::
1db0: 70 61 73 73 20 7b 0a 20 20 20 20 6e 61 6d 65 73 pass {. names
1dc0: 70 61 63 65 20 65 78 70 6f 72 74 20 66 69 6c 74 pace export filt
1dd0: 65 72 73 79 6d 0a 20 20 20 20 6e 61 6d 65 73 70 ersym. namesp
1de0: 61 63 65 20 65 76 61 6c 20 66 69 6c 74 65 72 73 ace eval filters
1df0: 79 6d 20 7b 0a 09 6e 61 6d 65 73 70 61 63 65 20 ym {..namespace
1e00: 69 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a 66 6f 73 import ::vc::fos
1e10: 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 sil::import::cvs
1e20: 3a 3a 73 74 61 74 65 0a 09 6e 61 6d 65 73 70 61 ::state..namespa
1e30: 63 65 20 65 76 61 6c 20 70 72 6f 6a 65 63 74 20 ce eval project
1e40: 7b 0a 09 20 20 20 20 6e 61 6d 65 73 70 61 63 65 {.. namespace
1e50: 20 69 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a 66 6f import ::vc::fo
1e60: 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 ssil::import::cv
1e70: 73 3a 3a 70 72 6f 6a 65 63 74 3a 3a 73 79 6d 0a s::project::sym.
1e80: 09 7d 0a 09 6e 61 6d 65 73 70 61 63 65 20 69 6d .}..namespace im
1e90: 70 6f 72 74 20 3a 3a 76 63 3a 3a 74 6f 6f 6c 73 port ::vc::tools
1ea0: 3a 3a 6c 6f 67 0a 09 6c 6f 67 20 72 65 67 69 73 ::log..log regis
1eb0: 74 65 72 20 66 69 6c 74 65 72 73 79 6d 0a 20 20 ter filtersym.
1ec0: 20 20 7d 0a 7d 0a 0a 23 20 23 20 23 23 20 23 23 }.}..# # ## ##
1ed0: 23 20 23 23 23 23 23 20 23 23 23 23 23 23 23 23 # ##### ########
1ee0: 20 23 23 23 23 23 23 23 23 23 23 23 23 23 20 23 ############# #
1ef0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
1f00: 23 23 23 23 0a 23 23 20 52 65 61 64 79 0a 0a 70 ####.## Ready..p
1f10: 61 63 6b 61 67 65 20 70 72 6f 76 69 64 65 20 76 ackage provide v
1f20: 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 c::fossil::impor
1f30: 74 3a 3a 63 76 73 3a 3a 70 61 73 73 3a 3a 66 69 t::cvs::pass::fi
1f40: 6c 74 65 72 73 79 6d 20 31 2e 30 0a 72 65 74 75 ltersym 1.0.retu
1f50: 72 6e 0a rn.