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 49 2e 20 54 68 69 73 20 70 61 73 73 20 s II. This pass
0210: 70 61 72 73 65 73 20 74 68 65 20 63 6f 6c 6c 65 parses the colle
0220: 63 74 65 64 20 72 63 73 20 61 72 63 68 69 76 65 cted rcs archive
0230: 73 20 61 6e 64 20 65 78 74 72 61 63 74 73 0a 23 s and extracts.#
0240: 23 20 61 6c 6c 20 74 68 65 20 69 6e 66 6f 72 6d # all the inform
0250: 61 74 69 6f 6e 20 74 68 65 79 20 63 6f 6e 74 61 ation they conta
0260: 69 6e 20 28 72 65 76 69 73 69 6f 6e 73 2c 20 61 in (revisions, a
0270: 6e 64 20 73 79 6d 62 6f 6c 73 29 2e 0a 0a 23 20 nd symbols)...#
0280: 23 20 23 23 20 23 23 23 20 23 23 23 23 23 20 23 # ## ### ##### #
0290: 23 23 23 23 23 23 23 20 23 23 23 23 23 23 23 23 ####### ########
02a0: 23 23 23 23 23 20 23 23 23 23 23 23 23 23 23 23 ##### ##########
02b0: 23 23 23 23 23 23 23 23 23 23 23 0a 23 23 20 52 ###########.## R
02c0: 65 71 75 69 72 65 6d 65 6e 74 73 0a 0a 70 61 63 equirements..pac
02d0: 6b 61 67 65 20 72 65 71 75 69 72 65 20 54 63 6c kage require Tcl
02e0: 20 38 2e 34 20 20 20 20 20 20 20 20 20 20 20 20 8.4
02f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0300: 20 20 20 3b 20 23 20 52 65 71 75 69 72 65 64 20 ; # Required
0310: 72 75 6e 74 69 6d 65 2e 0a 70 61 63 6b 61 67 65 runtime..package
0320: 20 72 65 71 75 69 72 65 20 73 6e 69 74 20 20 20 require snit
0330: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0340: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3b ;
0350: 20 23 20 4f 4f 20 73 79 73 74 65 6d 2e 0a 70 61 # OO system..pa
0360: 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 76 63 ckage require vc
0370: 3a 3a 74 6f 6f 6c 73 3a 3a 74 72 6f 75 62 6c 65 ::tools::trouble
0380: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0390: 20 20 20 20 3b 20 23 20 45 72 72 6f 72 20 72 65 ; # Error re
03a0: 70 6f 72 74 69 6e 67 2e 0a 70 61 63 6b 61 67 65 porting..package
03b0: 20 72 65 71 75 69 72 65 20 76 63 3a 3a 74 6f 6f require vc::too
03c0: 6c 73 3a 3a 6c 6f 67 20 20 20 20 20 20 20 20 20 ls::log
03d0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3b ;
03e0: 20 23 20 55 73 65 72 20 66 65 65 64 62 61 63 6b # User feedback
03f0: 2e 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 ..package requir
0400: 65 20 76 63 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d e vc::fossil::im
0410: 70 6f 72 74 3a 3a 63 76 73 3a 3a 70 61 73 73 20 port::cvs::pass
0420: 20 20 20 20 20 20 20 20 3b 20 23 20 50 61 73 73 ; # Pass
0430: 20 6d 61 6e 61 67 65 6d 65 6e 74 2e 0a 70 61 63 management..pac
0440: 6b 61 67 65 20 72 65 71 75 69 72 65 20 76 63 3a kage require vc:
0450: 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a :fossil::import:
0460: 3a 63 76 73 3a 3a 72 65 70 6f 73 69 74 6f 72 79 :cvs::repository
0470: 20 20 20 3b 20 23 20 52 65 70 6f 73 69 74 6f 72 ; # Repositor
0480: 79 20 6d 61 6e 61 67 65 6d 65 6e 74 2e 0a 70 61 y management..pa
0490: 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 76 63 ckage require vc
04a0: 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 ::fossil::import
04b0: 3a 3a 63 76 73 3a 3a 73 74 61 74 65 20 20 20 20 ::cvs::state
04c0: 20 20 20 20 3b 20 23 20 53 74 61 74 65 20 73 74 ; # State st
04d0: 6f 72 61 67 65 2e 0a 70 61 63 6b 61 67 65 20 72 orage..package r
04e0: 65 71 75 69 72 65 20 76 63 3a 3a 66 6f 73 73 69 equire vc::fossi
04f0: 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a l::import::cvs::
0500: 69 6e 74 65 67 72 69 74 79 20 20 20 20 3b 20 23 integrity ; #
0510: 20 53 74 61 74 65 20 69 6e 74 65 67 72 69 74 79 State integrity
0520: 20 63 68 65 63 6b 73 2e 0a 70 61 63 6b 61 67 65 checks..package
0530: 20 72 65 71 75 69 72 65 20 76 63 3a 3a 66 6f 73 require vc::fos
0540: 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 sil::import::cvs
0550: 3a 3a 70 72 6f 6a 65 63 74 3a 3a 73 79 6d 20 3b ::project::sym ;
0560: 20 23 20 50 72 6f 6a 65 63 74 20 6c 65 76 65 6c # Project level
0570: 20 73 79 6d 62 6f 6c 73 2e 0a 70 61 63 6b 61 67 symbols..packag
0580: 65 20 72 65 71 75 69 72 65 20 76 63 3a 3a 66 6f e require vc::fo
0590: 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 ssil::import::cv
05a0: 73 3a 3a 66 69 6c 65 3a 3a 72 65 76 20 20 20 20 s::file::rev
05b0: 3b 20 23 20 46 69 6c 65 20 6c 65 76 65 6c 20 72 ; # File level r
05c0: 65 76 69 73 69 6f 6e 73 2e 0a 70 61 63 6b 61 67 evisions..packag
05d0: 65 20 72 65 71 75 69 72 65 20 76 63 3a 3a 72 63 e require vc::rc
05e0: 73 3a 3a 70 61 72 73 65 72 20 20 20 20 20 20 20 s::parser
05f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0600: 3b 20 23 20 52 63 73 20 61 72 63 68 69 76 65 20 ; # Rcs archive
0610: 64 61 74 61 20 65 78 74 72 61 63 74 69 6f 6e 2e data extraction.
0620: 0a 0a 23 20 23 20 23 23 20 23 23 23 20 23 23 23 ..# # ## ### ###
0630: 23 23 20 23 23 23 23 23 23 23 23 20 23 23 23 23 ## ######## ####
0640: 23 23 23 23 23 23 23 23 23 20 23 23 23 23 23 23 ######### ######
0650: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 0a ###############.
0660: 23 23 20 52 65 67 69 73 74 65 72 20 74 68 65 20 ## Register the
0670: 70 61 73 73 20 77 69 74 68 20 74 68 65 20 6d 61 pass with the ma
0680: 6e 61 67 65 6d 65 6e 74 0a 0a 76 63 3a 3a 66 6f nagement..vc::fo
0690: 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 ssil::import::cv
06a0: 73 3a 3a 70 61 73 73 20 64 65 66 69 6e 65 20 5c s::pass define \
06b0: 0a 20 20 20 20 43 6f 6c 6c 65 63 74 52 65 76 20 . CollectRev
06c0: 5c 0a 20 20 20 20 7b 43 6f 6c 6c 65 63 74 20 72 \. {Collect r
06d0: 65 76 69 73 69 6f 6e 73 20 61 6e 64 20 73 79 6d evisions and sym
06e0: 62 6f 6c 73 7d 20 5c 0a 20 20 20 20 3a 3a 76 63 bols} \. ::vc
06f0: 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 ::fossil::import
0700: 3a 3a 63 76 73 3a 3a 70 61 73 73 3a 3a 63 6f 6c ::cvs::pass::col
0710: 6c 72 65 76 0a 0a 23 20 23 20 23 23 20 23 23 23 lrev..# # ## ###
0720: 20 23 23 23 23 23 20 23 23 23 23 23 23 23 23 20 ##### ########
0730: 23 23 23 23 23 23 23 23 23 23 23 23 23 20 23 23 ############# ##
0740: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
0750: 23 23 23 0a 23 23 0a 0a 73 6e 69 74 3a 3a 74 79 ###.##..snit::ty
0760: 70 65 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c 3a pe ::vc::fossil:
0770: 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 70 61 :import::cvs::pa
0780: 73 73 3a 3a 63 6f 6c 6c 72 65 76 20 7b 0a 20 20 ss::collrev {.
0790: 20 20 23 20 23 20 23 23 20 23 23 23 20 23 23 23 # # ## ### ###
07a0: 23 23 20 23 23 23 23 23 23 23 23 20 23 23 23 23 ## ######## ####
07b0: 23 23 23 23 23 23 23 23 23 0a 20 20 20 20 23 23 #########. ##
07c0: 20 50 75 62 6c 69 63 20 41 50 49 0a 0a 20 20 20 Public API..
07d0: 20 74 79 70 65 6d 65 74 68 6f 64 20 73 65 74 75 typemethod setu
07e0: 70 20 7b 7d 20 7b 0a 09 23 20 44 65 66 69 6e 65 p {} {..# Define
07f0: 20 6e 61 6d 65 73 20 61 6e 64 20 73 74 72 75 63 names and struc
0800: 74 75 72 65 20 6f 66 20 74 68 65 20 70 65 72 73 ture of the pers
0810: 69 73 74 65 6e 74 20 73 74 61 74 65 20 6f 66 20 istent state of
0820: 74 68 69 73 0a 09 23 20 70 61 73 73 2e 0a 0a 09 this..# pass....
0830: 73 74 61 74 65 20 75 73 65 20 70 72 6f 6a 65 63 state use projec
0840: 74 0a 09 73 74 61 74 65 20 75 73 65 20 66 69 6c t..state use fil
0850: 65 0a 0a 09 23 20 57 65 20 64 65 61 6c 20 77 69 e...# We deal wi
0860: 74 68 20 70 65 72 20 70 72 6f 6a 65 63 74 20 61 th per project a
0870: 6e 64 20 70 65 72 20 66 69 6c 65 20 64 61 74 61 nd per file data
0880: 2c 20 74 68 65 20 66 69 72 73 74 0a 09 23 20 63 , the first..# c
0890: 6f 6c 6c 61 74 65 64 20 66 72 6f 6d 20 74 68 65 ollated from the
08a0: 20 73 65 63 6f 6e 64 2e 0a 0a 09 23 20 50 65 72 second....# Per
08b0: 20 66 69 6c 65 20 77 65 20 68 61 76 65 20 67 65 file we have ge
08c0: 6e 65 72 61 6c 20 69 6e 66 6f 72 6d 61 74 69 6f neral informatio
08d0: 6e 2c 20 2e 2e 2e 2c 20 61 6e 64 20 74 68 65 6e n, ..., and then
08e0: 0a 09 23 20 72 65 76 69 73 69 6f 6e 73 20 61 6e ..# revisions an
08f0: 64 20 73 79 6d 62 6f 6c 73 2e 20 54 68 65 20 6c d symbols. The l
0900: 61 74 74 65 72 20 63 61 6e 20 62 65 20 66 75 72 atter can be fur
0910: 74 68 65 72 20 73 65 70 61 72 61 74 65 64 0a 09 ther separated..
0920: 23 20 69 6e 74 6f 20 74 61 67 73 20 61 6e 64 20 # into tags and
0930: 62 72 61 6e 63 68 65 73 2e 20 41 74 20 70 72 6f branches. At pro
0940: 6a 65 63 74 20 6c 65 76 65 6c 20 74 68 65 20 70 ject level the p
0950: 65 72 2d 66 69 6c 65 0a 09 23 20 73 79 6d 62 6f er-file..# symbo
0960: 6c 73 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 69 ls information i
0970: 73 20 6d 65 72 67 65 64 2e 0a 0a 09 23 20 46 69 s merged....# Fi
0980: 6c 65 20 6c 65 76 65 6c 20 2e 2e 2e 0a 09 23 09 le level .....#.
0990: 52 65 76 69 73 69 6f 6e 73 2c 20 42 72 61 6e 63 Revisions, Branc
09a0: 68 65 73 2c 20 54 61 67 73 0a 09 23 0a 09 23 20 hes, Tags..#..#
09b0: 50 73 65 75 64 6f 20 63 6c 61 73 73 20 68 69 65 Pseudo class hie
09c0: 72 61 72 63 68 79 0a 09 23 09 54 61 67 20 20 20 rarchy..#.Tag
09d0: 20 20 20 3c 2d 20 53 79 6d 62 6f 6c 20 3c 2d 20 <- Symbol <-
09e0: 45 76 65 6e 74 0a 09 23 09 42 72 61 6e 63 68 20 Event..#.Branch
09f0: 20 20 3c 2d 20 53 79 6d 62 6f 6c 20 3c 2d 20 45 <- Symbol <- E
0a00: 76 65 6e 74 0a 09 23 09 52 65 76 69 73 69 6f 6e vent..#.Revision
0a10: 20 20 20 20 20 20 20 20 20 20 20 3c 2d 20 45 76 <- Ev
0a20: 65 6e 74 0a 0a 09 73 74 61 74 65 20 65 78 74 65 ent...state exte
0a30: 6e 64 20 72 65 76 69 73 69 6f 6e 20 7b 0a 09 20 nd revision {..
0a40: 20 20 20 2d 2d 20 52 65 76 69 73 69 6f 6e 73 2e -- Revisions.
0a50: 20 49 64 65 6e 74 69 66 69 65 64 20 62 79 20 61 Identified by a
0a60: 20 67 6c 6f 62 61 6c 20 6e 75 6d 65 72 69 63 20 global numeric
0a70: 69 64 20 65 61 63 68 0a 09 20 20 20 20 2d 2d 20 id each.. --
0a80: 62 65 6c 6f 6e 67 73 20 74 6f 20 61 20 73 69 6e belongs to a sin
0a90: 67 6c 65 20 66 69 6c 65 2c 20 69 64 65 6e 74 69 gle file, identi
0aa0: 66 69 65 64 20 62 79 20 69 74 73 20 69 64 2e 20 fied by its id.
0ab0: 49 74 0a 09 20 20 20 20 2d 2d 20 66 75 72 74 68 It.. -- furth
0ac0: 65 72 20 68 61 73 20 61 20 64 6f 74 74 65 64 20 er has a dotted
0ad0: 72 65 76 69 73 69 6f 6e 20 6e 75 6d 62 65 72 20 revision number
0ae0: 28 44 54 4e 29 2e 0a 09 20 20 20 20 2d 2d 0a 09 (DTN)... --..
0af0: 20 20 20 20 2d 2d 20 43 6f 6e 73 74 72 61 69 6e -- Constrain
0b00: 74 3a 20 54 68 65 20 64 6f 74 74 65 64 20 72 65 t: The dotted re
0b10: 76 69 73 69 6f 6e 20 6e 75 6d 62 65 72 20 69 73 vision number is
0b20: 20 75 6e 69 71 75 65 20 77 69 74 68 69 6e 0a 20 unique within.
0b30: 20 20 20 20 20 20 20 20 20 20 20 2d 2d 20 20 20 --
0b40: 20 20 20 20 20 20 20 20 20 20 74 68 65 20 66 69 the fi
0b50: 6c 65 2e 20 53 65 65 20 65 6e 64 20 6f 66 20 64 le. See end of d
0b60: 65 66 69 6e 69 74 69 6f 6e 2e 0a 0a 09 20 20 20 efinition....
0b70: 20 72 69 64 20 20 49 4e 54 45 47 45 52 20 20 4e rid INTEGER N
0b80: 4f 54 20 4e 55 4c 4c 20 20 50 52 49 4d 41 52 59 OT NULL PRIMARY
0b90: 20 4b 45 59 20 41 55 54 4f 49 4e 43 52 45 4d 45 KEY AUTOINCREME
0ba0: 4e 54 2c 0a 09 20 20 20 20 66 69 64 20 20 49 4e NT,.. fid IN
0bb0: 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c 20 TEGER NOT NULL
0bc0: 20 52 45 46 45 52 45 4e 43 45 53 20 66 69 6c 65 REFERENCES file
0bd0: 2c 20 20 20 2d 2d 20 46 69 6c 65 20 6f 77 6e 69 , -- File owni
0be0: 6e 67 20 72 65 76 69 73 69 6f 6e 2e 0a 09 20 20 ng revision...
0bf0: 20 20 72 65 76 20 20 54 45 58 54 20 20 20 20 20 rev TEXT
0c00: 4e 4f 54 20 4e 55 4c 4c 2c 20 20 20 20 20 20 20 NOT NULL,
0c10: 20 20 20 20 20 20 20 20 20 20 20 20 20 2d 2d 20 --
0c20: 44 6f 74 74 65 64 20 52 65 76 20 4e 75 6d 62 65 Dotted Rev Numbe
0c30: 72 2e 0a 0a 09 20 20 20 20 2d 2d 20 41 6c 6c 20 r.... -- All
0c40: 72 65 76 69 73 69 6f 6e 73 20 62 65 6c 6f 6e 67 revisions belong
0c50: 20 74 6f 20 61 20 6c 69 6e 65 2d 6f 66 2d 64 65 to a line-of-de
0c60: 76 65 6c 6f 70 6d 65 6e 74 2c 0a 09 20 20 20 20 velopment,..
0c70: 2d 2d 20 69 64 65 6e 74 69 66 69 65 64 20 62 79 -- identified by
0c80: 20 61 20 73 79 6d 62 6f 6c 20 28 70 72 6f 6a 65 a symbol (proje
0c90: 63 74 20 6c 65 76 65 6c 29 2e 20 44 75 72 69 6e ct level). Durin
0ca0: 67 20 64 61 74 61 0a 09 20 20 20 20 2d 2d 20 63 g data.. -- c
0cb0: 6f 6c 6c 65 63 74 69 6f 6e 20 69 74 20 77 61 73 ollection it was
0cc0: 20 61 20 66 69 6c 65 2d 6c 65 76 65 6c 20 62 72 a file-level br
0cd0: 61 6e 63 68 20 73 79 6d 62 6f 6c 2e 0a 09 20 20 anch symbol...
0ce0: 20 20 2d 2d 0a 09 20 20 20 20 2d 2d 20 43 6f 6e --.. -- Con
0cf0: 73 74 72 61 69 6e 74 3a 20 41 6c 6c 20 74 68 65 straint: All the
0d00: 20 4c 4f 44 20 73 79 6d 62 6f 6c 73 20 61 72 65 LOD symbols are
0d10: 20 69 6e 20 74 68 65 20 73 61 6d 65 20 70 72 6f in the same pro
0d20: 6a 65 63 74 0a 09 20 20 20 20 2d 2d 20 20 20 20 ject.. --
0d30: 20 20 20 20 20 20 20 20 20 61 73 20 74 68 65 20 as the
0d40: 66 69 6c 65 20 69 74 73 65 6c 66 2e 20 54 68 69 file itself. Thi
0d50: 73 20 63 61 6e 6e 6f 74 20 62 65 0a 09 20 20 20 s cannot be..
0d60: 20 2d 2d 20 20 20 20 20 20 20 20 20 20 20 20 20 --
0d70: 65 78 70 72 65 73 73 65 64 20 69 6e 20 43 52 45 expressed in CRE
0d80: 41 54 45 20 54 41 42 4c 45 20 73 79 6e 74 61 78 ATE TABLE syntax
0d90: 2e 0a 0a 09 20 20 20 20 6c 6f 64 20 20 49 4e 54 .... lod INT
0da0: 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c 20 20 EGER NOT NULL
0db0: 52 45 46 45 52 45 4e 43 45 53 20 73 79 6d 62 6f REFERENCES symbo
0dc0: 6c 2c 20 2d 2d 20 4c 69 6e 65 20 6f 66 20 64 65 l, -- Line of de
0dd0: 76 65 6c 6f 70 6d 65 6e 74 0a 0a 09 20 20 20 20 velopment...
0de0: 2d 2d 20 54 68 65 20 72 65 76 69 73 69 6f 6e 73 -- The revisions
0df0: 20 69 6e 20 61 20 66 69 6c 65 20 61 72 65 20 6f in a file are o
0e00: 72 67 61 6e 69 7a 65 64 20 69 6e 20 61 20 66 6f rganized in a fo
0e10: 72 65 73 74 20 6f 66 0a 09 20 20 20 20 2d 2d 20 rest of.. --
0e20: 74 72 65 65 73 2c 20 77 69 74 68 20 74 68 65 20 trees, with the
0e30: 6d 61 69 6e 20 6c 69 6e 65 73 20 64 65 66 69 6e main lines defin
0e40: 65 64 20 74 68 72 6f 75 67 68 20 74 68 65 20 70 ed through the p
0e50: 61 72 65 6e 74 20 2f 0a 09 20 20 20 20 2d 2d 20 arent /.. --
0e60: 63 68 69 6c 64 20 72 65 66 65 72 65 6e 63 65 73 child references
0e70: 2e 20 41 20 72 65 76 69 73 69 6f 6e 20 77 69 74 . A revision wit
0e80: 68 6f 75 74 20 61 20 70 61 72 65 6e 74 20 69 73 hout a parent is
0e90: 20 74 68 65 0a 09 20 20 20 20 2d 2d 20 72 6f 6f the.. -- roo
0ea0: 74 20 6f 66 20 61 20 74 72 65 65 2c 20 61 6e 64 t of a tree, and
0eb0: 20 61 20 72 65 76 69 73 69 6f 6e 20 77 69 74 68 a revision with
0ec0: 6f 75 74 20 61 20 63 68 69 6c 64 20 69 73 20 61 out a child is a
0ed0: 0a 09 20 20 20 20 2d 2d 20 6c 65 61 66 2e 0a 0a .. -- leaf...
0ee0: 09 20 20 20 20 2d 2d 20 43 6f 6e 73 74 72 61 69 . -- Constrai
0ef0: 6e 74 73 3a 20 41 6c 6c 20 72 65 76 69 73 69 6f nts: All revisio
0f00: 6e 73 20 63 6f 75 70 6c 65 64 20 74 68 72 6f 75 ns coupled throu
0f10: 67 68 20 70 61 72 65 6e 74 2f 63 68 69 6c 64 0a gh parent/child.
0f20: 09 20 20 20 20 2d 2d 20 20 20 20 20 20 20 20 20 . --
0f30: 20 20 20 20 20 72 65 66 65 72 20 74 6f 20 74 68 refer to th
0f40: 65 20 73 61 6d 65 20 4c 4f 44 20 73 79 6d 62 6f e same LOD symbo
0f50: 6c 2e 20 54 68 65 20 70 61 72 65 6e 74 0a 09 20 l. The parent..
0f60: 20 20 20 2d 2d 20 20 20 20 20 20 20 20 20 20 20 --
0f70: 20 20 20 6f 66 20 61 20 63 68 69 6c 64 20 6f 66 of a child of
0f80: 20 58 20 69 73 20 58 2e 20 54 68 65 20 63 68 69 X is X. The chi
0f90: 6c 64 20 6f 66 20 61 0a 09 20 20 20 20 2d 2d 20 ld of a.. --
0fa0: 20 20 20 20 20 20 20 20 20 20 20 20 20 70 61 72 par
0fb0: 65 6e 74 20 6f 66 20 58 20 69 73 20 58 2e 0a 0a ent of X is X...
0fc0: 09 20 20 20 20 70 61 72 65 6e 74 20 20 49 4e 54 . parent INT
0fd0: 45 47 45 52 20 20 20 20 20 20 20 20 20 20 20 20 EGER
0fe0: 52 45 46 45 52 45 4e 43 45 53 20 72 65 76 69 73 REFERENCES revis
0ff0: 69 6f 6e 2c 0a 09 20 20 20 20 63 68 69 6c 64 20 ion,.. child
1000: 20 20 49 4e 54 45 47 45 52 20 20 20 20 20 20 20 INTEGER
1010: 20 20 20 20 20 52 45 46 45 52 45 4e 43 45 53 20 REFERENCES
1020: 72 65 76 69 73 69 6f 6e 2c 0a 0a 09 20 20 20 20 revision,...
1030: 2d 2d 20 54 68 65 20 72 65 70 72 65 73 65 6e 74 -- The represent
1040: 61 74 69 6f 6e 20 6f 66 20 61 20 62 72 61 6e 63 ation of a branc
1050: 68 20 69 6e 20 61 20 74 72 65 65 20 69 73 20 74 h in a tree is t
1060: 68 65 0a 09 20 20 20 20 2d 2d 20 65 78 63 65 70 he.. -- excep
1070: 74 69 6f 6e 20 74 6f 20 74 68 65 20 74 68 72 65 tion to the thre
1080: 65 20 63 6f 6e 73 74 72 61 69 6e 74 73 20 61 62 e constraints ab
1090: 6f 76 65 2e 0a 0a 09 20 20 20 20 2d 2d 20 54 68 ove.... -- Th
10a0: 65 20 62 65 67 69 6e 6e 69 6e 67 20 6f 66 20 61 e beginning of a
10b0: 20 62 72 61 6e 63 68 20 69 73 20 72 65 70 72 65 branch is repre
10c0: 73 65 6e 74 65 64 20 62 79 20 61 20 6e 6f 6e 2d sented by a non-
10d0: 4e 55 4c 4c 0a 09 20 20 20 20 2d 2d 20 62 70 61 NULL.. -- bpa
10e0: 72 65 6e 74 20 6f 66 20 61 20 72 65 76 69 73 69 rent of a revisi
10f0: 6f 6e 2e 20 54 68 69 73 20 72 65 76 69 73 69 6f on. This revisio
1100: 6e 20 42 20 69 73 20 74 68 65 20 66 69 72 73 74 n B is the first
1110: 20 6f 6e 0a 09 20 20 20 20 2d 2d 20 74 68 65 20 on.. -- the
1120: 62 72 61 6e 63 68 2e 20 49 74 73 20 70 61 72 65 branch. Its pare
1130: 6e 74 20 50 20 69 73 20 74 68 65 20 72 65 76 69 nt P is the revi
1140: 73 69 6f 6e 20 74 68 65 20 62 72 61 6e 63 68 20 sion the branch
1150: 69 73 0a 09 20 20 20 20 2d 2d 20 72 6f 6f 74 65 is.. -- roote
1160: 64 20 69 6e 2c 20 61 6e 64 20 69 74 20 69 73 20 d in, and it is
1170: 6e 6f 74 20 74 68 65 20 63 68 69 6c 64 20 6f 66 not the child of
1180: 20 50 2e 20 42 20 61 6e 64 20 50 20 72 65 66 65 P. B and P refe
1190: 72 0a 09 20 20 20 20 2d 2d 20 74 6f 20 64 69 66 r.. -- to dif
11a0: 66 65 72 65 6e 74 20 4c 4f 44 20 73 79 6d 62 6f ferent LOD symbo
11b0: 6c 73 2e 20 54 68 65 20 62 70 61 72 65 6e 74 20 ls. The bparent
11c0: 6f 66 20 42 20 69 73 20 61 6c 73 6f 20 69 74 73 of B is also its
11d0: 0a 09 20 20 20 20 2d 2d 20 4c 4f 44 2c 20 61 6e .. -- LOD, an
11e0: 64 20 74 68 65 20 4c 4f 44 20 6f 66 20 69 74 73 d the LOD of its
11f0: 20 63 68 69 6c 64 72 65 6e 2e 0a 0a 09 20 20 20 children....
1200: 20 62 70 61 72 65 6e 74 20 49 4e 54 45 47 45 52 bparent INTEGER
1210: 20 20 20 20 20 20 20 20 20 20 20 20 52 45 46 45 REFE
1220: 52 45 4e 43 45 53 20 73 79 6d 62 6f 6c 2c 0a 0a RENCES symbol,..
1230: 09 20 20 20 20 2d 2d 20 4c 61 73 74 6c 79 20 77 . -- Lastly w
1240: 65 20 6b 65 65 70 20 69 6e 66 6f 72 6d 61 74 69 e keep informati
1250: 6f 6e 20 69 73 20 61 62 6f 75 74 20 6e 6f 6e 2d on is about non-
1260: 74 72 75 6e 6b 20 64 65 66 61 75 6c 74 0a 09 20 trunk default..
1270: 20 20 20 2d 2d 20 62 72 61 6e 63 68 65 73 20 28 -- branches (
1280: 4e 54 44 42 29 20 69 6e 20 74 68 65 20 72 65 76 NTDB) in the rev
1290: 69 73 69 6f 6e 73 2e 0a 0a 09 20 20 20 20 2d 2d isions.... --
12a0: 20 41 6c 6c 20 72 65 76 69 73 69 6f 6e 73 20 6f All revisions o
12b0: 6e 20 74 68 65 20 4e 54 44 42 20 68 61 76 65 20 n the NTDB have
12c0: 27 69 73 64 65 66 61 75 6c 74 27 20 54 52 55 45 'isdefault' TRUE
12d0: 2c 0a 09 20 20 20 20 2d 2d 20 65 76 65 72 79 6f ,.. -- everyo
12e0: 6e 65 20 65 6c 73 65 20 46 41 4c 53 45 2e 20 54 ne else FALSE. T
12f0: 68 65 20 6c 61 73 74 20 72 65 76 69 73 69 6f 6e he last revision
1300: 20 58 20 6f 6e 20 74 68 65 20 4e 54 44 42 0a 09 X on the NTDB..
1310: 20 20 20 20 2d 2d 20 77 68 69 63 68 20 69 73 20 -- which is
1320: 73 74 69 6c 6c 20 63 6f 6e 73 69 64 65 72 65 64 still considered
1330: 20 74 6f 20 62 65 20 6f 6e 20 74 68 65 20 74 72 to be on the tr
1340: 75 6e 6b 20 61 73 20 77 65 6c 6c 0a 09 20 20 20 unk as well..
1350: 20 2d 2d 20 68 61 73 20 61 20 6e 6f 6e 2d 4e 55 -- has a non-NU
1360: 4c 4c 20 27 64 62 63 68 69 6c 64 27 20 77 68 69 LL 'dbchild' whi
1370: 63 68 20 72 65 66 65 72 73 20 74 6f 20 74 68 65 ch refers to the
1380: 20 72 6f 6f 74 20 6f 66 0a 09 20 20 20 20 2d 2d root of.. --
1390: 20 74 68 65 20 74 72 75 6e 6b 2e 20 54 68 65 20 the trunk. The
13a0: 72 6f 6f 74 20 61 6c 73 6f 20 68 61 73 20 61 20 root also has a
13b0: 6e 6f 6e 2d 4e 55 4c 4c 20 64 62 70 61 72 65 6e non-NULL dbparen
13c0: 74 0a 09 20 20 20 20 2d 2d 20 72 65 66 65 72 69 t.. -- referi
13d0: 6e 67 20 74 6f 20 58 2e 0a 0a 09 20 20 20 20 69 ng to X.... i
13e0: 73 64 65 66 61 75 6c 74 20 49 4e 54 45 47 45 52 sdefault INTEGER
13f0: 20 20 4e 4f 54 20 4e 55 4c 4c 2c 0a 09 20 20 20 NOT NULL,..
1400: 20 64 62 70 61 72 65 6e 74 20 20 49 4e 54 45 47 dbparent INTEG
1410: 45 52 20 20 20 20 20 20 20 20 20 20 20 20 52 45 ER RE
1420: 46 45 52 45 4e 43 45 53 20 72 65 76 69 73 69 6f FERENCES revisio
1430: 6e 2c 0a 09 20 20 20 20 64 62 63 68 69 6c 64 20 n,.. dbchild
1440: 20 20 49 4e 54 45 47 45 52 20 20 20 20 20 20 20 INTEGER
1450: 20 20 20 20 20 52 45 46 45 52 45 4e 43 45 53 20 REFERENCES
1460: 72 65 76 69 73 69 6f 6e 2c 0a 0a 09 20 20 20 20 revision,...
1470: 2d 2d 20 54 68 65 20 6d 61 69 6e 20 70 61 79 6c -- The main payl
1480: 6f 61 64 20 6f 66 20 74 68 65 20 72 65 76 69 73 oad of the revis
1490: 69 6f 6e 20 61 72 65 20 74 68 65 20 64 61 74 65 ion are the date
14a0: 2f 74 69 6d 65 20 69 74 0a 09 20 20 20 20 2d 2d /time it.. --
14b0: 20 77 61 73 20 65 6e 74 65 72 65 64 2c 20 69 74 was entered, it
14c0: 73 20 73 74 61 74 65 2c 20 6f 70 65 72 61 74 69 s state, operati
14d0: 6f 6e 20 28 3d 20 74 79 70 65 2f 63 6c 61 73 73 on (= type/class
14e0: 29 2c 20 74 65 78 74 0a 09 20 20 20 20 2d 2d 20 ), text.. --
14f0: 63 6f 6e 74 65 6e 74 2c 20 61 6e 64 20 6d 65 74 content, and met
1500: 61 20 64 61 74 61 20 28 61 75 74 68 6f 72 2c 20 a data (author,
1510: 6c 6f 67 20 6d 65 73 73 61 67 65 2c 20 62 72 61 log message, bra
1520: 6e 63 68 2c 0a 09 20 20 20 20 2d 2d 20 70 72 6f nch,.. -- pro
1530: 6a 65 63 74 29 2e 20 54 68 65 20 6c 61 73 74 20 ject). The last
1540: 69 73 20 65 6e 63 6f 64 65 64 20 61 73 20 73 69 is encoded as si
1550: 6e 67 6c 65 20 69 64 2c 20 73 65 65 20 74 61 62 ngle id, see tab
1560: 6c 65 0a 09 20 20 20 20 2d 2d 20 27 6d 65 74 61 le.. -- 'meta
1570: 27 2e 20 54 68 65 20 64 61 74 65 2f 74 69 6d 65 '. The date/time
1580: 20 69 73 20 67 69 76 65 6e 20 69 6e 20 73 65 63 is given in sec
1590: 6f 6e 64 73 20 73 69 6e 63 65 20 74 68 65 0a 09 onds since the..
15a0: 20 20 20 20 2d 2d 20 65 70 6f 63 68 2c 20 66 6f -- epoch, fo
15b0: 72 20 65 61 73 79 20 63 6f 6d 70 61 72 69 73 6f r easy compariso
15c0: 6e 2e 20 54 68 65 20 74 65 78 74 20 63 6f 6e 74 n. The text cont
15d0: 65 6e 74 20 69 73 20 61 6e 0a 09 20 20 20 20 2d ent is an.. -
15e0: 2d 20 28 6f 66 66 73 65 74 2c 6c 65 6e 67 74 68 - (offset,length
15f0: 29 20 70 61 69 72 20 69 6e 74 6f 20 74 68 65 20 ) pair into the
1600: 72 63 73 20 61 72 63 68 69 76 65 2e 0a 0a 09 20 rcs archive....
1610: 20 20 20 6f 70 20 20 20 20 49 4e 54 45 47 45 52 op INTEGER
1620: 20 20 4e 4f 54 20 4e 55 4c 4c 20 20 52 45 46 45 NOT NULL REFE
1630: 52 45 4e 43 45 53 20 6f 70 74 79 70 65 2c 0a 09 RENCES optype,..
1640: 20 20 20 20 64 61 74 65 20 20 49 4e 54 45 47 45 date INTEGE
1650: 52 20 20 4e 4f 54 20 4e 55 4c 4c 2c 0a 09 20 20 R NOT NULL,..
1660: 20 20 73 74 61 74 65 20 54 45 58 54 20 20 20 20 state TEXT
1670: 20 4e 4f 54 20 4e 55 4c 4c 2c 0a 09 20 20 20 20 NOT NULL,..
1680: 6d 69 64 20 20 20 49 4e 54 45 47 45 52 20 20 4e mid INTEGER N
1690: 4f 54 20 4e 55 4c 4c 20 20 52 45 46 45 52 45 4e OT NULL REFEREN
16a0: 43 45 53 20 6d 65 74 61 2c 0a 09 20 20 20 20 63 CES meta,.. c
16b0: 6f 66 66 20 20 49 4e 54 45 47 45 52 20 20 4e 4f off INTEGER NO
16c0: 54 20 4e 55 4c 4c 2c 0a 09 20 20 20 20 63 6c 65 T NULL,.. cle
16d0: 6e 20 20 49 4e 54 45 47 45 52 20 20 4e 4f 54 20 n INTEGER NOT
16e0: 4e 55 4c 4c 2c 0a 0a 09 20 20 20 20 55 4e 49 51 NULL,... UNIQ
16f0: 55 45 20 28 66 69 64 2c 20 72 65 76 29 20 2d 2d UE (fid, rev) --
1700: 20 54 68 65 20 44 54 4e 20 69 73 20 75 6e 69 71 The DTN is uniq
1710: 75 65 20 77 69 74 68 69 6e 20 74 68 65 20 72 65 ue within the re
1720: 76 69 73 69 6f 6e 27 73 20 66 69 6c 65 2e 0a 09 vision's file...
1730: 7d 0a 0a 09 73 74 61 74 65 20 65 78 74 65 6e 64 }...state extend
1740: 20 6f 70 74 79 70 65 20 7b 0a 09 20 20 20 20 6f optype {.. o
1750: 69 64 20 20 20 49 4e 54 45 47 45 52 20 20 4e 4f id INTEGER NO
1760: 54 20 4e 55 4c 4c 20 20 50 52 49 4d 41 52 59 20 T NULL PRIMARY
1770: 4b 45 59 2c 0a 09 20 20 20 20 6e 61 6d 65 20 20 KEY,.. name
1780: 54 45 58 54 20 20 20 20 20 4e 4f 54 20 4e 55 4c TEXT NOT NUL
1790: 4c 2c 0a 09 20 20 20 20 55 4e 49 51 55 45 28 6e L,.. UNIQUE(n
17a0: 61 6d 65 29 0a 09 7d 0a 09 73 74 61 74 65 20 72 ame)..}..state r
17b0: 75 6e 20 7b 0a 09 20 20 20 20 49 4e 53 45 52 54 un {.. INSERT
17c0: 20 49 4e 54 4f 20 6f 70 74 79 70 65 20 56 41 4c INTO optype VAL
17d0: 55 45 53 20 28 2d 31 2c 27 64 65 6c 65 74 65 27 UES (-1,'delete'
17e0: 29 3b 20 20 2d 2d 20 54 68 65 20 6f 70 63 6f 64 ); -- The opcod
17f0: 65 20 6e 61 6d 65 73 20 61 72 65 20 74 68 65 0a e names are the.
1800: 09 20 20 20 20 49 4e 53 45 52 54 20 49 4e 54 4f . INSERT INTO
1810: 20 6f 70 74 79 70 65 20 56 41 4c 55 45 53 20 28 optype VALUES (
1820: 20 30 2c 27 6e 6f 74 68 69 6e 67 27 29 3b 20 2d 0,'nothing'); -
1830: 2d 20 66 69 78 65 64 20 70 69 65 63 65 73 2c 20 - fixed pieces,
1840: 73 65 65 20 6d 79 6f 70 73 74 61 74 65 0a 09 20 see myopstate..
1850: 20 20 20 49 4e 53 45 52 54 20 49 4e 54 4f 20 6f INSERT INTO o
1860: 70 74 79 70 65 20 56 41 4c 55 45 53 20 28 20 31 ptype VALUES ( 1
1870: 2c 27 61 64 64 27 29 3b 20 20 20 20 20 2d 2d 20 ,'add'); --
1880: 69 6e 20 66 69 6c 65 3a 3a 72 65 76 2e 20 6d 79 in file::rev. my
1890: 6f 70 63 6f 64 65 20 69 73 0a 09 20 20 20 20 49 opcode is.. I
18a0: 4e 53 45 52 54 20 49 4e 54 4f 20 6f 70 74 79 70 NSERT INTO optyp
18b0: 65 20 56 41 4c 55 45 53 20 28 20 32 2c 27 63 68 e VALUES ( 2,'ch
18c0: 61 6e 67 65 27 29 3b 20 20 2d 2d 20 6c 6f 61 64 ange'); -- load
18d0: 65 64 20 66 72 6f 6d 20 74 68 69 73 2e 0a 09 7d ed from this...}
18e0: 0a 0a 09 73 74 61 74 65 20 65 78 74 65 6e 64 20 ...state extend
18f0: 72 65 76 69 73 69 6f 6e 62 72 61 6e 63 68 63 68 revisionbranchch
1900: 69 6c 64 72 65 6e 20 7b 0a 09 20 20 20 20 2d 2d ildren {.. --
1910: 20 54 68 65 20 6e 6f 6e 2d 70 72 69 6d 61 72 79 The non-primary
1920: 20 63 68 69 6c 64 72 65 6e 20 6f 66 20 61 20 72 children of a r
1930: 65 76 69 73 69 6f 6e 2c 20 61 73 20 72 65 61 63 evision, as reac
1940: 68 61 62 6c 65 0a 09 20 20 20 20 2d 2d 20 74 68 hable.. -- th
1950: 72 6f 75 67 68 20 61 20 62 72 61 6e 63 68 20 73 rough a branch s
1960: 79 6d 62 6f 6c 2c 20 61 72 65 20 6c 69 73 74 65 ymbol, are liste
1970: 64 20 68 65 72 65 2e 20 54 68 69 73 20 69 73 0a d here. This is.
1980: 09 20 20 20 20 2d 2d 20 6e 65 65 64 65 64 20 62 . -- needed b
1990: 79 20 70 61 73 73 20 35 20 74 6f 20 62 72 65 61 y pass 5 to brea
19a0: 6b 20 69 6e 74 65 72 6e 61 6c 20 64 65 70 65 6e k internal depen
19b0: 64 65 6e 63 69 65 73 20 69 6e 20 61 0a 09 20 20 dencies in a..
19c0: 20 20 2d 2d 20 63 68 61 6e 67 65 73 65 74 2e 0a -- changeset..
19d0: 0a 09 20 20 20 20 72 69 64 20 20 20 49 4e 54 45 .. rid INTE
19e0: 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c 20 20 52 GER NOT NULL R
19f0: 45 46 45 52 45 4e 43 45 53 20 72 65 76 69 73 69 EFERENCES revisi
1a00: 6f 6e 2c 0a 09 20 20 20 20 62 72 69 64 20 20 49 on,.. brid I
1a10: 4e 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c NTEGER NOT NULL
1a20: 20 20 52 45 46 45 52 45 4e 43 45 53 20 72 65 76 REFERENCES rev
1a30: 69 73 69 6f 6e 2c 0a 09 20 20 20 20 55 4e 49 51 ision,.. UNIQ
1a40: 55 45 28 72 69 64 2c 62 72 69 64 29 0a 09 7d 0a UE(rid,brid)..}.
1a50: 0a 09 73 74 61 74 65 20 65 78 74 65 6e 64 20 74 ..state extend t
1a60: 61 67 20 7b 0a 09 20 20 20 20 74 69 64 20 20 49 ag {.. tid I
1a70: 4e 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c NTEGER NOT NULL
1a80: 20 20 50 52 49 4d 41 52 59 20 4b 45 59 20 41 55 PRIMARY KEY AU
1a90: 54 4f 49 4e 43 52 45 4d 45 4e 54 2c 0a 09 20 20 TOINCREMENT,..
1aa0: 20 20 66 69 64 20 20 49 4e 54 45 47 45 52 20 20 fid INTEGER
1ab0: 4e 4f 54 20 4e 55 4c 4c 20 20 52 45 46 45 52 45 NOT NULL REFERE
1ac0: 4e 43 45 53 20 66 69 6c 65 2c 20 20 20 20 20 2d NCES file, -
1ad0: 2d 20 46 69 6c 65 20 74 68 65 20 69 74 65 6d 20 - File the item
1ae0: 62 65 6c 6f 6e 67 73 20 74 6f 0a 09 20 20 20 20 belongs to..
1af0: 6c 6f 64 20 20 49 4e 54 45 47 45 52 20 20 20 20 lod INTEGER
1b00: 20 20 20 20 20 20 20 20 52 45 46 45 52 45 4e 43 REFERENC
1b10: 45 53 20 73 79 6d 62 6f 6c 2c 20 20 20 2d 2d 20 ES symbol, --
1b20: 4c 69 6e 65 20 6f 66 20 64 65 76 65 6c 6f 70 6d Line of developm
1b30: 65 6e 74 20 28 4e 55 4c 4c 20 3d 3e 20 54 72 75 ent (NULL => Tru
1b40: 6e 6b 29 0a 09 20 20 20 20 73 69 64 20 20 49 4e nk).. sid IN
1b50: 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c 20 TEGER NOT NULL
1b60: 20 52 45 46 45 52 45 4e 43 45 53 20 73 79 6d 62 REFERENCES symb
1b70: 6f 6c 2c 20 20 20 2d 2d 20 53 79 6d 62 6f 6c 20 ol, -- Symbol
1b80: 63 61 70 74 75 72 69 6e 67 20 74 68 65 20 74 61 capturing the ta
1b90: 67 0a 0a 09 20 20 20 20 72 65 76 20 20 49 4e 54 g... rev INT
1ba0: 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c 20 20 EGER NOT NULL
1bb0: 52 45 46 45 52 45 4e 43 45 53 20 72 65 76 69 73 REFERENCES revis
1bc0: 69 6f 6e 20 20 2d 2d 20 54 68 65 20 72 65 76 69 ion -- The revi
1bd0: 73 69 6f 6e 20 62 65 69 6e 67 20 74 61 67 67 65 sion being tagge
1be0: 64 2e 0a 09 7d 20 7b 20 72 65 76 20 73 69 64 20 d...} { rev sid
1bf0: 7d 0a 09 23 20 49 6e 64 69 63 65 73 20 6f 6e 3a }..# Indices on:
1c00: 20 72 65 76 20 28 72 65 76 69 73 69 6f 6e 20 73 rev (revision s
1c10: 75 63 63 65 73 73 6f 72 73 29 0a 09 23 20 20 20 uccessors)..#
1c20: 20 20 20 20 20 20 20 20 20 20 73 69 64 20 28 74 sid (t
1c30: 61 67 20 70 72 65 64 65 63 65 73 73 6f 72 73 2c ag predecessors,
1c40: 20 62 72 61 6e 63 68 20 73 75 63 63 65 73 73 6f branch successo
1c50: 72 73 2f 70 72 65 64 65 63 65 73 73 6f 72 73 29 rs/predecessors)
1c60: 0a 0a 09 73 74 61 74 65 20 65 78 74 65 6e 64 20 ...state extend
1c70: 62 72 61 6e 63 68 20 7b 0a 09 20 20 20 20 62 69 branch {.. bi
1c80: 64 20 20 20 49 4e 54 45 47 45 52 20 20 4e 4f 54 d INTEGER NOT
1c90: 20 4e 55 4c 4c 20 20 50 52 49 4d 41 52 59 20 4b NULL PRIMARY K
1ca0: 45 59 20 41 55 54 4f 49 4e 43 52 45 4d 45 4e 54 EY AUTOINCREMENT
1cb0: 2c 0a 09 20 20 20 20 66 69 64 20 20 20 49 4e 54 ,.. fid INT
1cc0: 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c 20 20 EGER NOT NULL
1cd0: 52 45 46 45 52 45 4e 43 45 53 20 66 69 6c 65 2c REFERENCES file,
1ce0: 20 20 20 20 20 2d 2d 20 46 69 6c 65 20 74 68 65 -- File the
1cf0: 20 69 74 65 6d 20 62 65 6c 6f 6e 67 73 20 74 6f item belongs to
1d00: 0a 09 20 20 20 20 6c 6f 64 20 20 20 49 4e 54 45 .. lod INTE
1d10: 47 45 52 20 20 20 20 20 20 20 20 20 20 20 20 52 GER R
1d20: 45 46 45 52 45 4e 43 45 53 20 73 79 6d 62 6f 6c EFERENCES symbol
1d30: 2c 20 20 20 2d 2d 20 4c 69 6e 65 20 6f 66 20 64 , -- Line of d
1d40: 65 76 65 6c 6f 70 6d 65 6e 74 20 28 4e 55 4c 4c evelopment (NULL
1d50: 20 3d 3e 20 54 72 75 6e 6b 29 0a 09 20 20 20 20 => Trunk)..
1d60: 73 69 64 20 20 20 49 4e 54 45 47 45 52 20 20 4e sid INTEGER N
1d70: 4f 54 20 4e 55 4c 4c 20 20 52 45 46 45 52 45 4e OT NULL REFEREN
1d80: 43 45 53 20 73 79 6d 62 6f 6c 2c 20 20 20 2d 2d CES symbol, --
1d90: 20 53 79 6d 62 6f 6c 20 63 61 70 74 75 72 69 6e Symbol capturin
1da0: 67 20 74 68 65 20 62 72 61 6e 63 68 0a 0a 09 20 g the branch...
1db0: 20 20 20 72 6f 6f 74 20 20 49 4e 54 45 47 45 52 root INTEGER
1dc0: 20 20 20 20 20 20 20 20 20 20 20 20 52 45 46 45 REFE
1dd0: 52 45 4e 43 45 53 20 72 65 76 69 73 69 6f 6e 2c RENCES revision,
1de0: 20 2d 2d 20 52 65 76 69 73 69 6f 6e 20 74 68 65 -- Revision the
1df0: 20 62 72 61 6e 63 68 20 73 70 72 6f 75 74 73 20 branch sprouts
1e00: 66 72 6f 6d 0a 09 20 20 20 20 66 69 72 73 74 20 from.. first
1e10: 49 4e 54 45 47 45 52 20 20 20 20 20 20 20 20 20 INTEGER
1e20: 20 20 20 52 45 46 45 52 45 4e 43 45 53 20 72 65 REFERENCES re
1e30: 76 69 73 69 6f 6e 2c 20 2d 2d 20 46 69 72 73 74 vision, -- First
1e40: 20 72 65 76 69 73 69 6f 6e 20 63 6f 6d 6d 69 74 revision commit
1e50: 74 65 64 20 74 6f 20 74 68 65 20 62 72 61 6e 63 ted to the branc
1e60: 68 0a 09 20 20 20 20 62 72 61 20 20 20 54 45 58 h.. bra TEX
1e70: 54 20 20 20 20 20 4e 4f 54 20 4e 55 4c 4c 2c 20 T NOT NULL,
1e80: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1e90: 20 20 20 20 20 2d 2d 20 62 72 61 6e 63 68 20 6e -- branch n
1ea0: 75 6d 62 65 72 0a 09 20 20 20 20 70 6f 73 20 20 umber.. pos
1eb0: 20 49 4e 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 INTEGER NOT NU
1ec0: 4c 4c 20 20 20 20 20 20 20 20 20 20 20 20 20 20 LL
1ed0: 20 20 20 20 20 20 20 20 20 2d 2d 20 63 72 65 61 -- crea
1ee0: 74 69 6f 6e 20 6f 72 64 65 72 20 69 6e 20 72 6f tion order in ro
1ef0: 6f 74 2e 0a 0a 09 20 20 20 20 2d 2d 20 41 20 62 ot.... -- A b
1f00: 72 61 6e 63 68 20 63 61 6e 20 65 78 69 73 74 20 ranch can exist
1f10: 77 69 74 68 6f 75 74 20 72 6f 6f 74 2e 20 49 74 without root. It
1f20: 20 68 61 70 70 65 6e 73 20 77 68 65 6e 20 74 68 happens when th
1f30: 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 2d 2d e. --
1f40: 20 6f 6e 6c 79 20 72 65 76 69 73 69 6f 6e 20 6f only revision o
1f50: 6e 20 74 72 75 6e 6b 20 69 73 20 74 68 65 20 75 n trunk is the u
1f60: 6e 6e 65 63 65 73 73 61 72 79 20 64 65 61 64 20 nnecessary dead
1f70: 6f 6e 65 20 74 68 65 0a 20 20 20 20 20 20 20 20 one the.
1f80: 20 20 20 20 2d 2d 20 62 72 61 6e 63 68 20 77 61 -- branch wa
1f90: 73 20 73 70 72 6f 75 74 65 64 20 66 72 6f 6d 20 s sprouted from
1fa0: 61 6e 64 20 69 74 20 68 61 73 20 63 6f 6d 6d 69 and it has commi
1fb0: 74 73 2e 20 54 68 65 20 62 72 61 6e 63 68 0a 20 ts. The branch.
1fc0: 20 20 20 20 20 20 20 20 20 20 20 2d 2d 20 77 69 -- wi
1fd0: 6c 6c 20 65 78 69 73 74 20 74 6f 20 62 65 20 74 ll exist to be t
1fe0: 68 65 20 4c 4f 44 20 6f 66 20 69 74 73 20 72 65 he LOD of its re
1ff0: 76 69 73 69 6f 6e 73 2c 20 6e 6f 74 68 69 6e 67 visions, nothing
2000: 20 74 6f 0a 20 20 20 20 20 20 20 20 20 20 20 20 to.
2010: 2d 2d 20 73 70 72 6f 75 74 20 66 72 6f 6d 2c 20 -- sprout from,
2020: 74 68 65 20 64 65 61 64 20 72 65 76 69 73 69 6f the dead revisio
2030: 6e 20 77 61 73 20 72 65 6d 6f 76 65 64 2c 20 68 n was removed, h
2040: 65 6e 63 65 20 6e 6f 0a 20 20 20 20 20 20 20 20 ence no.
2050: 20 20 20 20 2d 2d 20 72 6f 6f 74 2e 0a 09 7d 20 -- root...}
2060: 7b 20 72 6f 6f 74 20 66 69 72 73 74 20 73 69 64 { root first sid
2070: 20 7d 0a 09 23 20 49 6e 64 69 63 65 73 20 6f 6e }..# Indices on
2080: 3a 20 72 6f 6f 74 20 20 28 72 65 76 69 73 69 6f : root (revisio
2090: 6e 20 73 75 63 63 65 73 73 6f 72 73 29 0a 09 23 n successors)..#
20a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 66 69 72 fir
20b0: 73 74 20 28 72 65 76 69 73 69 6f 6e 20 70 72 65 st (revision pre
20c0: 64 65 63 65 73 73 6f 72 73 29 0a 09 23 20 20 20 decessors)..#
20d0: 20 20 20 20 20 20 20 20 20 20 73 69 64 20 20 20 sid
20e0: 28 74 61 67 20 70 72 65 64 65 63 65 73 73 6f 72 (tag predecessor
20f0: 73 2c 20 62 72 61 6e 63 68 20 73 75 63 63 65 73 s, branch succes
2100: 73 6f 72 73 2f 70 72 65 64 65 63 65 73 73 6f 72 sors/predecessor
2110: 73 29 0a 0a 09 23 20 50 72 6f 6a 65 63 74 20 6c s)...# Project l
2120: 65 76 65 6c 20 2e 2e 2e 0a 09 23 09 70 4c 69 6e evel .....#.pLin
2130: 65 4f 66 44 65 76 65 6c 6f 70 6d 65 6e 74 2c 20 eOfDevelopment,
2140: 70 53 79 6d 62 6f 6c 2c 20 70 42 72 61 6e 63 68 pSymbol, pBranch
2150: 2c 20 70 54 61 67 2c 20 70 54 72 75 6e 6b 0a 09 , pTag, pTrunk..
2160: 23 0a 09 23 09 70 54 72 75 6e 6b 20 20 3c 2d 20 #..#.pTrunk <-
2170: 70 4c 69 6e 65 4f 66 44 65 76 65 6c 6f 70 6d 65 pLineOfDevelopme
2180: 6e 74 0a 09 23 09 70 42 72 61 6e 63 68 20 3c 2d nt..#.pBranch <-
2190: 20 70 53 79 6d 62 6f 6c 2c 20 70 4c 69 6e 65 4f pSymbol, pLineO
21a0: 66 44 65 76 65 6c 6f 70 6d 65 6e 74 0a 09 23 09 fDevelopment..#.
21b0: 70 54 61 67 20 20 20 20 3c 2d 20 70 53 79 6d 62 pTag <- pSymb
21c0: 6f 6c 2c 20 70 4c 69 6e 65 4f 66 44 65 76 65 6c ol, pLineOfDevel
21d0: 6f 70 6d 65 6e 74 0a 0a 09 73 74 61 74 65 20 65 opment...state e
21e0: 78 74 65 6e 64 20 73 79 6d 62 6f 6c 20 7b 0a 09 xtend symbol {..
21f0: 20 20 20 20 73 69 64 20 20 49 4e 54 45 47 45 52 sid INTEGER
2200: 20 20 4e 4f 54 20 4e 55 4c 4c 20 20 50 52 49 4d NOT NULL PRIM
2210: 41 52 59 20 4b 45 59 20 41 55 54 4f 49 4e 43 52 ARY KEY AUTOINCR
2220: 45 4d 45 4e 54 2c 0a 09 20 20 20 20 70 69 64 20 EMENT,.. pid
2230: 20 49 4e 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 INTEGER NOT NU
2240: 4c 4c 20 20 52 45 46 45 52 45 4e 43 45 53 20 70 LL REFERENCES p
2250: 72 6f 6a 65 63 74 2c 20 20 2d 2d 20 50 72 6f 6a roject, -- Proj
2260: 65 63 74 20 74 68 65 20 73 79 6d 62 6f 6c 20 62 ect the symbol b
2270: 65 6c 6f 6e 67 73 20 74 6f 0a 09 20 20 20 20 6e elongs to.. n
2280: 61 6d 65 20 54 45 58 54 20 20 20 20 20 4e 4f 54 ame TEXT NOT
2290: 20 4e 55 4c 4c 2c 0a 09 20 20 20 20 74 79 70 65 NULL,.. type
22a0: 20 49 4e 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 INTEGER NOT NU
22b0: 4c 4c 20 20 52 45 46 45 52 45 4e 43 45 53 20 73 LL REFERENCES s
22c0: 79 6d 74 79 70 65 2c 20 20 2d 2d 20 65 6e 75 6d ymtype, -- enum
22d0: 20 7b 20 65 78 63 6c 75 64 65 64 20 3d 20 30 2c { excluded = 0,
22e0: 20 74 61 67 2c 20 62 72 61 6e 63 68 2c 20 75 6e tag, branch, un
22f0: 64 65 66 69 6e 65 64 20 7d 0a 0a 09 20 20 20 20 defined }...
2300: 74 61 67 5f 63 6f 75 6e 74 20 20 20 20 49 4e 54 tag_count INT
2310: 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c 2c 20 EGER NOT NULL,
2320: 2d 2d 20 48 6f 77 20 6f 66 74 65 6e 20 74 68 65 -- How often the
2330: 20 73 79 6d 62 6f 6c 20 69 73 20 75 73 65 64 20 symbol is used
2340: 61 73 20 74 61 67 2e 0a 09 20 20 20 20 62 72 61 as tag... bra
2350: 6e 63 68 5f 63 6f 75 6e 74 20 49 4e 54 45 47 45 nch_count INTEGE
2360: 52 20 20 4e 4f 54 20 4e 55 4c 4c 2c 20 2d 2d 20 R NOT NULL, --
2370: 48 6f 77 20 6f 66 74 65 6e 20 74 68 65 20 73 79 How often the sy
2380: 6d 62 6f 6c 20 69 73 20 75 73 65 64 20 61 73 20 mbol is used as
2390: 62 72 61 6e 63 68 0a 09 20 20 20 20 63 6f 6d 6d branch.. comm
23a0: 69 74 5f 63 6f 75 6e 74 20 49 4e 54 45 47 45 52 it_count INTEGER
23b0: 20 20 4e 4f 54 20 4e 55 4c 4c 2c 20 2d 2d 20 48 NOT NULL, -- H
23c0: 6f 77 20 6f 66 74 65 6e 20 61 20 66 69 6c 65 20 ow often a file
23d0: 77 61 73 20 63 6f 6d 6d 69 74 74 65 64 20 6f 6e was committed on
23e0: 20 74 68 65 20 73 79 6d 62 6f 6c 0a 0a 09 20 20 the symbol...
23f0: 20 20 55 4e 49 51 55 45 20 28 70 69 64 2c 20 6e UNIQUE (pid, n
2400: 61 6d 65 29 20 2d 2d 20 53 79 6d 62 6f 6c 73 20 ame) -- Symbols
2410: 61 72 65 20 75 6e 69 71 75 65 20 77 69 74 68 69 are unique withi
2420: 6e 20 74 68 65 20 70 72 6f 6a 65 63 74 0a 09 7d n the project..}
2430: 0a 0a 09 73 74 61 74 65 20 65 78 74 65 6e 64 20 ...state extend
2440: 62 6c 6f 63 6b 65 72 20 7b 0a 09 20 20 20 20 2d blocker {.. -
2450: 2d 20 46 6f 72 20 65 61 63 68 20 73 79 6d 62 6f - For each symbo
2460: 6c 20 77 65 20 73 61 76 65 20 77 68 69 63 68 20 l we save which
2470: 6f 74 68 65 72 20 73 79 6d 62 6f 6c 73 20 61 72 other symbols ar
2480: 65 0a 09 20 20 20 20 2d 2d 20 62 6c 6f 63 6b 69 e.. -- blocki
2490: 6e 67 20 69 74 73 20 72 65 6d 6f 76 61 6c 20 28 ng its removal (
24a0: 69 66 20 74 68 65 20 75 73 65 72 20 61 73 6b 73 if the user asks
24b0: 20 66 6f 72 20 69 74 29 2e 0a 0a 09 20 20 20 20 for it)....
24c0: 73 69 64 20 49 4e 54 45 47 45 52 20 20 4e 4f 54 sid INTEGER NOT
24d0: 20 4e 55 4c 4c 20 20 52 45 46 45 52 45 4e 43 45 NULL REFERENCE
24e0: 53 20 73 79 6d 62 6f 6c 2c 20 2d 2d 0a 09 20 20 S symbol, --..
24f0: 20 20 62 69 64 20 49 4e 54 45 47 45 52 20 20 4e bid INTEGER N
2500: 4f 54 20 4e 55 4c 4c 20 20 52 45 46 45 52 45 4e OT NULL REFEREN
2510: 43 45 53 20 73 79 6d 62 6f 6c 2c 20 2d 2d 20 53 CES symbol, -- S
2520: 70 72 6f 75 74 65 64 20 66 72 6f 6d 20 73 69 64 prouted from sid
2530: 2c 20 62 6c 6f 63 6b 73 20 69 74 2e 0a 09 20 20 , blocks it...
2540: 20 20 55 4e 49 51 55 45 20 28 73 69 64 2c 20 62 UNIQUE (sid, b
2550: 69 64 29 0a 09 7d 0a 0a 09 73 74 61 74 65 20 65 id)..}...state e
2560: 78 74 65 6e 64 20 70 61 72 65 6e 74 20 7b 0a 09 xtend parent {..
2570: 20 20 20 20 2d 2d 20 46 6f 72 20 65 61 63 68 20 -- For each
2580: 73 79 6d 62 6f 6c 20 77 65 20 73 61 76 65 20 77 symbol we save w
2590: 68 69 63 68 20 6f 74 68 65 72 20 73 79 6d 62 6f hich other symbo
25a0: 6c 73 20 63 61 6e 20 61 63 74 20 61 73 0a 09 20 ls can act as..
25b0: 20 20 20 2d 2d 20 61 20 70 6f 73 73 69 62 6c 65 -- a possible
25c0: 20 70 61 72 65 6e 74 20 69 6e 20 73 6f 6d 65 20 parent in some
25d0: 66 69 6c 65 2c 20 61 6e 64 20 68 6f 77 20 6f 66 file, and how of
25e0: 74 65 6e 2e 0a 0a 09 20 20 20 20 73 69 64 20 49 ten.... sid I
25f0: 4e 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c NTEGER NOT NULL
2600: 20 20 52 45 46 45 52 45 4e 43 45 53 20 73 79 6d REFERENCES sym
2610: 62 6f 6c 2c 20 2d 2d 0a 09 20 20 20 20 70 69 64 bol, --.. pid
2620: 20 49 4e 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 INTEGER NOT NU
2630: 4c 4c 20 20 52 45 46 45 52 45 4e 43 45 53 20 73 LL REFERENCES s
2640: 79 6d 62 6f 6c 2c 20 2d 2d 20 50 6f 73 73 69 62 ymbol, -- Possib
2650: 6c 65 20 70 61 72 65 6e 74 20 6f 66 20 73 69 64 le parent of sid
2660: 0a 09 20 20 20 20 6e 20 20 20 49 4e 54 45 47 45 .. n INTEGE
2670: 52 20 20 4e 4f 54 20 4e 55 4c 4c 2c 20 20 20 20 R NOT NULL,
2680: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
2690: 2d 2d 20 48 6f 77 20 6f 66 74 65 6e 20 70 69 64 -- How often pid
26a0: 20 63 61 6e 20 61 63 74 20 61 73 20 70 61 72 65 can act as pare
26b0: 6e 74 2e 0a 09 20 20 20 20 55 4e 49 51 55 45 20 nt... UNIQUE
26c0: 28 73 69 64 2c 20 70 69 64 29 0a 09 7d 0a 0a 09 (sid, pid)..}...
26d0: 73 74 61 74 65 20 65 78 74 65 6e 64 20 73 79 6d state extend sym
26e0: 74 79 70 65 20 7b 0a 09 20 20 20 20 74 69 64 20 type {.. tid
26f0: 20 20 20 49 4e 54 45 47 45 52 20 20 4e 4f 54 20 INTEGER NOT
2700: 4e 55 4c 4c 20 20 50 52 49 4d 41 52 59 20 4b 45 NULL PRIMARY KE
2710: 59 2c 0a 09 20 20 20 20 6e 61 6d 65 20 20 20 54 Y,.. name T
2720: 45 58 54 20 20 20 20 20 4e 4f 54 20 4e 55 4c 4c EXT NOT NULL
2730: 2c 0a 09 20 20 20 20 70 6c 75 72 61 6c 20 54 45 ,.. plural TE
2740: 58 54 20 20 20 20 20 4e 4f 54 20 4e 55 4c 4c 2c XT NOT NULL,
2750: 0a 09 20 20 20 20 55 4e 49 51 55 45 20 28 6e 61 .. UNIQUE (na
2760: 6d 65 29 0a 09 20 20 20 20 55 4e 49 51 55 45 20 me).. UNIQUE
2770: 28 70 6c 75 72 61 6c 29 0a 09 7d 0a 09 73 74 61 (plural)..}..sta
2780: 74 65 20 72 75 6e 20 7b 0a 09 20 20 20 20 49 4e te run {.. IN
2790: 53 45 52 54 20 49 4e 54 4f 20 73 79 6d 74 79 70 SERT INTO symtyp
27a0: 65 20 56 41 4c 55 45 53 20 28 30 2c 27 65 78 63 e VALUES (0,'exc
27b0: 6c 75 64 65 64 27 2c 20 27 65 78 63 6c 75 64 65 luded', 'exclude
27c0: 64 27 29 3b 0a 09 20 20 20 20 49 4e 53 45 52 54 d');.. INSERT
27d0: 20 49 4e 54 4f 20 73 79 6d 74 79 70 65 20 56 41 INTO symtype VA
27e0: 4c 55 45 53 20 28 31 2c 27 74 61 67 27 2c 20 20 LUES (1,'tag',
27f0: 20 20 20 20 27 74 61 67 73 27 29 3b 0a 09 20 20 'tags');..
2800: 20 20 49 4e 53 45 52 54 20 49 4e 54 4f 20 73 79 INSERT INTO sy
2810: 6d 74 79 70 65 20 56 41 4c 55 45 53 20 28 32 2c mtype VALUES (2,
2820: 27 62 72 61 6e 63 68 27 2c 20 20 20 27 62 72 61 'branch', 'bra
2830: 6e 63 68 65 73 27 29 3b 0a 09 20 20 20 20 49 4e nches');.. IN
2840: 53 45 52 54 20 49 4e 54 4f 20 73 79 6d 74 79 70 SERT INTO symtyp
2850: 65 20 56 41 4c 55 45 53 20 28 33 2c 27 75 6e 64 e VALUES (3,'und
2860: 65 66 69 6e 65 64 27 2c 27 75 6e 64 65 66 69 6e efined','undefin
2870: 65 64 27 29 3b 0a 09 7d 0a 0a 09 73 74 61 74 65 ed');..}...state
2880: 20 65 78 74 65 6e 64 20 6d 65 74 61 20 7b 0a 09 extend meta {..
2890: 20 20 20 20 2d 2d 20 4d 65 74 61 20 64 61 74 61 -- Meta data
28a0: 20 6f 66 20 72 65 76 69 73 69 6f 6e 73 2e 20 53 of revisions. S
28b0: 65 65 20 72 65 76 69 73 69 6f 6e 2e 6d 69 64 20 ee revision.mid
28c0: 66 6f 72 20 74 68 65 0a 09 20 20 20 20 2d 2d 20 for the.. --
28d0: 72 65 66 65 72 65 6e 63 65 2e 20 4d 61 6e 79 20 reference. Many
28e0: 72 65 76 69 73 69 6f 6e 73 20 63 61 6e 20 73 68 revisions can sh
28f0: 61 72 65 20 6d 65 74 61 20 64 61 74 61 2e 20 54 are meta data. T
2900: 68 69 73 20 69 73 0a 09 20 20 20 20 2d 2d 20 61 his is.. -- a
2910: 63 74 75 61 6c 6c 79 20 6f 6e 65 20 6f 66 20 74 ctually one of t
2920: 68 65 20 63 72 69 74 65 72 69 6f 6e 73 20 75 73 he criterions us
2930: 65 64 20 74 6f 20 73 6f 72 74 20 72 65 76 69 73 ed to sort revis
2940: 69 6f 6e 73 0a 09 20 20 20 20 2d 2d 20 69 6e 74 ions.. -- int
2950: 6f 20 63 68 61 6e 67 65 73 65 74 73 2e 0a 0a 09 o changesets....
2960: 20 20 20 20 6d 69 64 20 49 4e 54 45 47 45 52 20 mid INTEGER
2970: 20 4e 4f 54 20 4e 55 4c 4c 20 20 50 52 49 4d 41 NOT NULL PRIMA
2980: 52 59 20 4b 45 59 20 20 41 55 54 4f 49 4e 43 52 RY KEY AUTOINCR
2990: 45 4d 45 4e 54 2c 0a 0a 09 20 20 20 20 2d 2d 20 EMENT,... --
29a0: 4d 65 74 61 20 64 61 74 61 20 62 65 6c 6f 6e 67 Meta data belong
29b0: 73 20 74 6f 20 61 20 73 70 65 63 69 66 69 63 20 s to a specific
29c0: 70 72 6f 6a 65 63 74 2c 20 73 74 72 6f 6e 67 65 project, stronge
29d0: 72 2c 20 74 6f 20 61 0a 09 20 20 20 20 2d 2d 20 r, to a.. --
29e0: 62 72 61 6e 63 68 20 69 6e 20 74 68 61 74 20 70 branch in that p
29f0: 72 6f 6a 65 63 74 2e 20 49 74 20 66 75 72 74 68 roject. It furth
2a00: 65 72 20 68 61 73 20 61 20 6c 6f 67 20 6d 65 73 er has a log mes
2a10: 73 61 67 65 2c 0a 09 20 20 20 20 2d 2d 20 61 6e sage,.. -- an
2a20: 64 20 69 74 73 20 61 75 74 68 6f 72 2e 20 54 68 d its author. Th
2a30: 69 73 20 69 73 20 75 6e 69 71 75 65 20 77 69 74 is is unique wit
2a40: 68 20 74 68 65 20 70 72 6f 6a 65 63 74 20 61 6e h the project an
2a50: 64 0a 09 20 20 20 20 2d 2d 20 62 72 61 6e 63 68 d.. -- branch
2a60: 2e 0a 0a 09 20 20 20 20 70 69 64 20 49 4e 54 45 .... pid INTE
2a70: 47 45 52 20 20 4e 4f 54 20 4e 55 4c 4c 20 20 52 GER NOT NULL R
2a80: 45 46 45 52 45 4e 43 45 53 20 70 72 6f 6a 65 63 EFERENCES projec
2a90: 74 2c 20 20 2d 2d 0a 09 20 20 20 20 62 69 64 20 t, --.. bid
2aa0: 49 4e 54 45 47 45 52 20 20 4e 4f 54 20 4e 55 4c INTEGER NOT NUL
2ab0: 4c 20 20 52 45 46 45 52 45 4e 43 45 53 20 73 79 L REFERENCES sy
2ac0: 6d 62 6f 6c 2c 20 20 20 2d 2d 0a 09 20 20 20 20 mbol, --..
2ad0: 61 69 64 20 49 4e 54 45 47 45 52 20 20 4e 4f 54 aid INTEGER NOT
2ae0: 20 4e 55 4c 4c 20 20 52 45 46 45 52 45 4e 43 45 NULL REFERENCE
2af0: 53 20 61 75 74 68 6f 72 2c 20 20 20 2d 2d 0a 09 S author, --..
2b00: 20 20 20 20 63 69 64 20 49 4e 54 45 47 45 52 20 cid INTEGER
2b10: 20 4e 4f 54 20 4e 55 4c 4c 20 20 52 45 46 45 52 NOT NULL REFER
2b20: 45 4e 43 45 53 20 63 6d 65 73 73 61 67 65 2c 20 ENCES cmessage,
2b30: 2d 2d 0a 0a 09 20 20 20 20 55 4e 49 51 55 45 20 --... UNIQUE
2b40: 28 70 69 64 2c 20 62 69 64 2c 20 61 69 64 2c 20 (pid, bid, aid,
2b50: 63 69 64 29 0a 0a 09 20 20 20 20 2d 2d 20 43 6f cid)... -- Co
2b60: 6e 73 74 72 61 69 6e 74 73 3a 20 54 68 65 20 70 nstraints: The p
2b70: 72 6f 6a 65 63 74 20 6f 66 20 74 68 65 20 6d 65 roject of the me
2b80: 74 61 20 64 61 74 61 20 6f 66 20 61 20 72 65 76 ta data of a rev
2b90: 69 73 69 6f 6e 0a 09 20 20 20 20 2d 2d 20 20 20 ision.. --
2ba0: 20 20 20 20 20 20 20 20 20 20 20 58 20 69 73 20 X is
2bb0: 74 68 65 20 73 61 6d 65 20 61 73 20 74 68 65 20 the same as the
2bc0: 70 72 6f 6a 65 63 74 20 6f 66 20 58 20 69 74 73 project of X its
2bd0: 65 6c 66 2e 0a 09 20 20 20 20 2d 2d 0a 09 20 20 elf... --..
2be0: 20 20 2d 2d 20 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e -- ...........
2bf0: 2e 20 54 68 65 20 62 72 61 6e 63 68 20 6f 66 20 . The branch of
2c00: 74 68 65 20 6d 65 74 61 20 64 61 74 61 20 6f 66 the meta data of
2c10: 20 61 20 72 65 76 69 73 69 6f 6e 0a 09 20 20 20 a revision..
2c20: 20 2d 2d 20 20 20 20 20 20 20 20 20 20 20 20 20 --
2c30: 20 58 20 69 73 20 74 68 65 20 73 61 6d 65 20 61 X is the same a
2c40: 73 20 74 68 65 20 6c 69 6e 65 20 6f 66 20 64 65 s the line of de
2c50: 76 65 6c 6f 70 6d 65 6e 74 0a 09 20 20 20 20 2d velopment.. -
2c60: 2d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6f - o
2c70: 66 20 58 20 69 74 73 65 6c 66 2e 0a 09 7d 0a 0a f X itself...}..
2c80: 09 23 20 41 75 74 68 6f 72 73 20 61 6e 64 20 63 .# Authors and c
2c90: 6f 6d 6d 69 74 20 6d 65 73 73 61 67 65 73 20 61 ommit messages a
2ca0: 72 65 20 66 75 6c 6c 79 20 67 6c 6f 62 61 6c 2c re fully global,
2cb0: 20 69 2e 65 2e 20 70 65 72 0a 09 23 20 72 65 70 i.e. per..# rep
2cc0: 6f 73 69 74 6f 72 79 2e 0a 0a 09 73 74 61 74 65 ository....state
2cd0: 20 65 78 74 65 6e 64 20 61 75 74 68 6f 72 20 7b extend author {
2ce0: 0a 09 20 20 20 20 61 69 64 20 20 49 4e 54 45 47 .. aid INTEG
2cf0: 45 52 20 20 4e 4f 54 20 4e 55 4c 4c 20 20 50 52 ER NOT NULL PR
2d00: 49 4d 41 52 59 20 4b 45 59 20 20 41 55 54 4f 49 IMARY KEY AUTOI
2d10: 4e 43 52 45 4d 45 4e 54 2c 0a 09 20 20 20 20 6e NCREMENT,.. n
2d20: 61 6d 65 20 54 45 58 54 20 20 20 20 20 4e 4f 54 ame TEXT NOT
2d30: 20 4e 55 4c 4c 20 20 55 4e 49 51 55 45 0a 09 7d NULL UNIQUE..}
2d40: 0a 0a 09 73 74 61 74 65 20 65 78 74 65 6e 64 20 ...state extend
2d50: 63 6d 65 73 73 61 67 65 20 7b 0a 09 20 20 20 20 cmessage {..
2d60: 63 69 64 20 20 49 4e 54 45 47 45 52 20 20 4e 4f cid INTEGER NO
2d70: 54 20 4e 55 4c 4c 20 20 50 52 49 4d 41 52 59 20 T NULL PRIMARY
2d80: 4b 45 59 20 20 41 55 54 4f 49 4e 43 52 45 4d 45 KEY AUTOINCREME
2d90: 4e 54 2c 0a 09 20 20 20 20 74 65 78 74 20 54 45 NT,.. text TE
2da0: 58 54 20 20 20 20 20 4e 4f 54 20 4e 55 4c 4c 20 XT NOT NULL
2db0: 20 55 4e 49 51 55 45 0a 09 7d 0a 0a 09 70 72 6f UNIQUE..}...pro
2dc0: 6a 65 63 74 3a 3a 73 79 6d 20 67 65 74 73 79 6d ject::sym getsym
2dd0: 74 79 70 65 73 0a 09 66 69 6c 65 3a 3a 72 65 76 types..file::rev
2de0: 20 20 20 20 67 65 74 6f 70 63 6f 64 65 73 0a 09 getopcodes..
2df0: 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 return. }..
2e00: 20 20 74 79 70 65 6d 65 74 68 6f 64 20 6c 6f 61 typemethod loa
2e10: 64 20 7b 7d 20 7b 0a 09 73 74 61 74 65 20 75 73 d {} {..state us
2e20: 65 20 73 79 6d 62 6f 6c 0a 09 73 74 61 74 65 20 e symbol..state
2e30: 75 73 65 20 73 79 6d 74 79 70 65 0a 09 73 74 61 use symtype..sta
2e40: 74 65 20 75 73 65 20 6f 70 74 79 70 65 0a 0a 09 te use optype...
2e50: 70 72 6f 6a 65 63 74 3a 3a 73 79 6d 20 67 65 74 project::sym get
2e60: 73 79 6d 74 79 70 65 73 0a 09 66 69 6c 65 3a 3a symtypes..file::
2e70: 72 65 76 20 20 20 20 67 65 74 6f 70 63 6f 64 65 rev getopcode
2e80: 73 0a 09 72 65 70 6f 73 69 74 6f 72 79 20 20 20 s..repository
2e90: 6c 6f 61 64 73 79 6d 62 6f 6c 73 0a 09 72 65 74 loadsymbols..ret
2ea0: 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 20 20 74 urn. }.. t
2eb0: 79 70 65 6d 65 74 68 6f 64 20 72 75 6e 20 7b 7d ypemethod run {}
2ec0: 20 7b 0a 09 23 20 50 61 73 73 20 6d 61 6e 61 67 {..# Pass manag
2ed0: 65 72 20 69 6e 74 65 72 66 61 63 65 2e 20 45 78 er interface. Ex
2ee0: 65 63 75 74 65 64 20 74 6f 20 70 65 72 66 6f 72 ecuted to perfor
2ef0: 6d 20 74 68 65 0a 09 23 20 66 75 6e 63 74 69 6f m the..# functio
2f00: 6e 61 6c 69 74 79 20 6f 66 20 74 68 65 20 70 61 nality of the pa
2f10: 73 73 2e 0a 0a 09 73 65 74 20 72 62 61 73 65 20 ss....set rbase
2f20: 5b 72 65 70 6f 73 69 74 6f 72 79 20 62 61 73 65 [repository base
2f30: 3f 5d 0a 09 66 6f 72 65 61 63 68 20 70 72 6f 6a ?]..foreach proj
2f40: 65 63 74 20 5b 72 65 70 6f 73 69 74 6f 72 79 20 ect [repository
2f50: 70 72 6f 6a 65 63 74 73 5d 20 7b 0a 09 20 20 20 projects] {..
2f60: 20 73 65 74 20 62 61 73 65 20 5b 66 69 6c 65 20 set base [file
2f70: 6a 6f 69 6e 20 24 72 62 61 73 65 20 5b 24 70 72 join $rbase [$pr
2f80: 6f 6a 65 63 74 20 62 61 73 65 5d 5d 0a 09 20 20 oject base]]..
2f90: 20 20 6c 6f 67 20 77 72 69 74 65 20 31 20 63 6f log write 1 co
2fa0: 6c 6c 72 65 76 20 22 50 72 6f 63 65 73 73 69 6e llrev "Processin
2fb0: 67 20 24 62 61 73 65 22 0a 0a 09 20 20 20 20 66 g $base"... f
2fc0: 6f 72 65 61 63 68 20 66 69 6c 65 20 5b 24 70 72 oreach file [$pr
2fd0: 6f 6a 65 63 74 20 66 69 6c 65 73 5d 20 7b 0a 09 oject files] {..
2fe0: 09 73 65 74 20 70 61 74 68 20 5b 24 66 69 6c 65 .set path [$file
2ff0: 20 70 61 74 68 5d 0a 09 09 6c 6f 67 20 77 72 69 path]...log wri
3000: 74 65 20 32 20 63 6f 6c 6c 72 65 76 20 22 50 61 te 2 collrev "Pa
3010: 72 73 69 6e 67 20 24 70 61 74 68 22 0a 09 09 69 rsing $path"...i
3020: 66 20 7b 5b 63 61 74 63 68 20 7b 0a 09 09 20 20 f {[catch {...
3030: 20 20 70 61 72 73 65 72 20 70 72 6f 63 65 73 73 parser process
3040: 20 5b 66 69 6c 65 20 6a 6f 69 6e 20 24 62 61 73 [file join $bas
3050: 65 20 24 70 61 74 68 5d 20 24 66 69 6c 65 0a 09 e $path] $file..
3060: 09 7d 20 6d 73 67 5d 7d 20 7b 0a 09 09 20 20 20 .} msg]} {...
3070: 20 67 6c 6f 62 61 6c 20 65 72 72 6f 72 43 6f 64 global errorCod
3080: 65 0a 09 09 20 20 20 20 69 66 20 7b 24 65 72 72 e... if {$err
3090: 6f 72 43 6f 64 65 20 65 71 20 22 76 63 3a 3a 72 orCode eq "vc::r
30a0: 63 73 3a 3a 70 61 72 73 65 72 22 7d 20 7b 0a 09 cs::parser"} {..
30b0: 09 09 74 72 6f 75 62 6c 65 20 66 61 74 61 6c 20 ..trouble fatal
30c0: 22 24 70 61 74 68 20 69 73 20 6e 6f 74 20 61 20 "$path is not a
30d0: 76 61 6c 69 64 20 52 43 53 20 61 72 63 68 69 76 valid RCS archiv
30e0: 65 20 28 24 6d 73 67 29 22 0a 09 09 20 20 20 20 e ($msg)"...
30f0: 7d 20 65 6c 73 65 20 7b 0a 09 09 09 67 6c 6f 62 } else {....glob
3100: 61 6c 20 65 72 72 6f 72 49 6e 66 6f 0a 09 09 09 al errorInfo....
3110: 74 72 6f 75 62 6c 65 20 69 6e 74 65 72 6e 61 6c trouble internal
3120: 20 24 65 72 72 6f 72 49 6e 66 6f 0a 09 09 20 20 $errorInfo...
3130: 20 20 7d 0a 09 09 7d 20 65 6c 73 65 20 7b 0a 09 }...} else {..
3140: 09 20 20 20 20 23 20 57 65 20 70 65 72 73 69 73 . # We persis
3150: 74 20 74 68 65 20 63 6f 72 65 20 6f 66 20 74 68 t the core of th
3160: 65 20 64 61 74 61 20 63 6f 6c 6c 65 63 74 65 64 e data collected
3170: 20 61 62 6f 75 74 0a 09 09 20 20 20 20 23 20 65 about... # e
3180: 61 63 68 20 66 69 6c 65 20 69 6d 6d 65 64 69 61 ach file immedia
3190: 74 65 6c 79 20 61 66 74 65 72 20 69 74 20 68 61 tely after it ha
31a0: 73 20 62 65 65 6e 20 70 61 72 73 65 64 0a 09 09 s been parsed...
31b0: 20 20 20 20 23 20 61 6e 64 20 77 72 61 6e 67 6c # and wrangl
31c0: 65 64 20 69 6e 74 6f 20 73 68 61 70 65 2c 20 61 ed into shape, a
31d0: 6e 64 20 74 68 65 6e 20 64 72 6f 70 20 69 74 20 nd then drop it
31e0: 66 72 6f 6d 0a 09 09 20 20 20 20 23 20 6d 65 6d from... # mem
31f0: 6f 72 79 2e 20 54 68 69 73 20 69 73 20 64 6f 6e ory. This is don
3200: 65 20 74 6f 20 6b 65 65 70 20 74 68 65 20 61 6d e to keep the am
3210: 6f 75 6e 74 20 6f 66 0a 09 09 20 20 20 20 23 20 ount of... #
3220: 72 65 71 75 69 72 65 64 20 6d 65 6d 6f 72 79 20 required memory
3230: 77 69 74 68 69 6e 20 73 65 6e 73 69 62 6c 65 20 within sensible
3240: 6c 69 6d 69 74 73 2e 20 57 69 74 68 6f 75 74 0a limits. Without.
3250: 09 09 20 20 20 20 23 20 64 6f 69 6e 67 20 69 74 .. # doing it
3260: 20 74 68 69 73 20 77 61 79 20 77 65 20 77 6f 75 this way we wou
3270: 6c 64 20 65 61 73 69 6c 79 20 67 6f 62 62 6c 65 ld easily gobble
3280: 20 75 70 20 31 47 0a 09 09 20 20 20 20 23 20 6f up 1G... # o
3290: 66 20 52 41 4d 20 6f 72 20 6d 6f 72 65 20 77 69 f RAM or more wi
32a0: 74 68 20 61 6c 6c 20 74 68 65 20 6f 62 6a 65 63 th all the objec
32b0: 74 73 20 28 72 65 76 69 73 69 6f 6e 73 0a 09 09 ts (revisions...
32c0: 20 20 20 20 23 20 61 6e 64 20 66 69 6c 65 2d 6c # and file-l
32d0: 65 76 65 6c 20 73 79 6d 62 6f 6c 73 29 2e 0a 0a evel symbols)...
32e0: 09 09 20 20 20 20 24 66 69 6c 65 20 70 65 72 73 .. $file pers
32f0: 69 73 74 0a 09 09 7d 0a 0a 09 09 24 66 69 6c 65 ist...}....$file
3300: 20 64 72 6f 70 0a 09 20 20 20 20 7d 0a 0a 09 20 drop.. }...
3310: 20 20 20 24 70 72 6f 6a 65 63 74 20 70 75 72 67 $project purg
3320: 65 67 68 6f 73 74 73 79 6d 62 6f 6c 73 0a 09 7d eghostsymbols..}
3330: 0a 0a 09 72 65 70 6f 73 69 74 6f 72 79 20 70 65 ...repository pe
3340: 72 73 69 73 74 72 65 76 0a 09 72 65 70 6f 73 69 rsistrev..reposi
3350: 74 6f 72 79 20 70 72 69 6e 74 72 65 76 73 74 61 tory printrevsta
3360: 74 69 73 74 69 63 73 0a 09 69 6e 74 65 67 72 69 tistics..integri
3370: 74 79 20 20 73 74 72 69 63 74 0a 0a 09 6c 6f 67 ty strict...log
3380: 20 77 72 69 74 65 20 31 20 63 6f 6c 6c 72 65 76 write 1 collrev
3390: 20 22 53 63 61 6e 20 63 6f 6d 70 6c 65 74 65 64 "Scan completed
33a0: 22 0a 09 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a "..return. }.
33b0: 0a 20 20 20 20 74 79 70 65 6d 65 74 68 6f 64 20 . typemethod
33c0: 64 69 73 63 61 72 64 20 7b 7d 20 7b 0a 09 23 20 discard {} {..#
33d0: 50 61 73 73 20 6d 61 6e 61 67 65 72 20 69 6e 74 Pass manager int
33e0: 65 72 66 61 63 65 2e 20 45 78 65 63 75 74 65 64 erface. Executed
33f0: 20 66 6f 72 20 61 6c 6c 20 70 61 73 73 65 73 20 for all passes
3400: 61 66 74 65 72 20 74 68 65 0a 09 23 20 72 75 6e after the..# run
3410: 20 70 61 73 73 65 73 2c 20 74 6f 20 72 65 6d 6f passes, to remo
3420: 76 65 20 61 6c 6c 20 64 61 74 61 20 6f 66 20 74 ve all data of t
3430: 68 69 73 20 70 61 73 73 20 66 72 6f 6d 20 74 68 his pass from th
3440: 65 20 73 74 61 74 65 2c 0a 09 23 20 61 73 20 62 e state,..# as b
3450: 65 69 6e 67 20 6f 75 74 20 6f 66 20 64 61 74 65 eing out of date
3460: 2e 0a 0a 09 73 74 61 74 65 20 64 69 73 63 61 72 ....state discar
3470: 64 20 72 65 76 69 73 69 6f 6e 0a 09 73 74 61 74 d revision..stat
3480: 65 20 64 69 73 63 61 72 64 20 74 61 67 0a 09 73 e discard tag..s
3490: 74 61 74 65 20 64 69 73 63 61 72 64 20 62 72 61 tate discard bra
34a0: 6e 63 68 0a 09 73 74 61 74 65 20 64 69 73 63 61 nch..state disca
34b0: 72 64 20 73 79 6d 62 6f 6c 0a 09 73 74 61 74 65 rd symbol..state
34c0: 20 64 69 73 63 61 72 64 20 62 6c 6f 63 6b 65 72 discard blocker
34d0: 0a 09 73 74 61 74 65 20 64 69 73 63 61 72 64 20 ..state discard
34e0: 70 61 72 65 6e 74 0a 09 73 74 61 74 65 20 64 69 parent..state di
34f0: 73 63 61 72 64 20 73 79 6d 74 79 70 65 0a 09 73 scard symtype..s
3500: 74 61 74 65 20 64 69 73 63 61 72 64 20 6d 65 74 tate discard met
3510: 61 0a 09 73 74 61 74 65 20 64 69 73 63 61 72 64 a..state discard
3520: 20 61 75 74 68 6f 72 0a 09 73 74 61 74 65 20 64 author..state d
3530: 69 73 63 61 72 64 20 63 6d 65 73 73 61 67 65 0a iscard cmessage.
3540: 09 72 65 74 75 72 6e 0a 20 20 20 20 7d 0a 0a 20 .return. }..
3550: 20 20 20 23 20 54 4f 44 4f 3a 20 4d 6f 76 65 20 # TODO: Move
3560: 74 68 69 73 20 63 6f 64 65 20 74 6f 20 74 68 65 this code to the
3570: 20 69 6e 74 65 67 72 69 74 79 20 6d 6f 64 75 6c integrity modul
3580: 65 0a 20 20 20 20 70 72 6f 63 20 50 61 72 61 6e e. proc Paran
3590: 6f 69 61 20 7b 7d 20 7b 0a 09 23 20 54 68 69 73 oia {} {..# This
35a0: 20 63 6f 64 65 20 70 65 72 66 6f 72 6d 73 20 61 code performs a
35b0: 20 6e 75 6d 62 65 72 20 6f 66 20 70 61 72 61 6e number of paran
35c0: 6f 69 64 20 63 68 65 63 6b 73 20 6f 66 20 74 68 oid checks of th
35d0: 65 0a 09 23 20 64 61 74 61 62 61 73 65 2c 20 73 e..# database, s
35e0: 65 61 72 63 68 69 6e 67 20 66 6f 72 20 69 6e 63 earching for inc
35f0: 6f 6e 73 69 73 74 65 6e 74 20 63 72 6f 73 73 2d onsistent cross-
3600: 72 65 66 65 72 65 6e 63 65 73 2e 0a 09 6c 6f 67 references...log
3610: 20 77 72 69 74 65 20 34 20 63 6f 6c 6c 72 65 76 write 4 collrev
3620: 20 7b 43 68 65 63 6b 20 64 61 74 61 62 61 73 65 {Check database
3630: 20 63 6f 6e 73 69 73 74 65 6e 63 79 7d 0a 0a 09 consistency}...
3640: 73 65 74 20 6e 20 30 20 3b 20 23 20 43 6f 75 6e set n 0 ; # Coun
3650: 74 65 72 20 66 6f 72 20 74 68 65 20 63 68 65 63 ter for the chec
3660: 6b 73 20 28 77 65 20 70 72 69 6e 74 20 61 6e 20 ks (we print an
3670: 69 64 20 62 65 66 6f 72 65 20 74 68 65 0a 09 09 id before the...
3680: 20 20 23 20 6d 61 69 6e 20 6c 61 62 65 6c 29 2e # main label).
3690: 0a 0a 09 23 20 46 69 6e 64 20 61 6c 6c 20 72 65 ...# Find all re
36a0: 76 69 73 69 6f 6e 73 20 77 68 69 63 68 20 64 69 visions which di
36b0: 73 61 67 72 65 65 20 77 69 74 68 20 74 68 65 69 sagree with thei
36c0: 72 20 6c 69 6e 65 20 6f 66 0a 09 23 20 64 65 76 r line of..# dev
36d0: 65 6c 6f 70 6d 65 6e 74 20 61 62 6f 75 74 20 74 elopment about t
36e0: 68 65 20 70 72 6f 6a 65 63 74 20 74 68 65 79 20 he project they
36f0: 61 72 65 20 6f 77 6e 65 64 20 62 79 2e 0a 09 43 are owned by...C
3700: 68 65 63 6b 20 5c 0a 09 20 20 20 20 7b 52 65 76 heck \.. {Rev
3710: 69 73 69 6f 6e 73 20 61 6e 64 20 74 68 65 69 72 isions and their
3720: 20 4c 4f 44 73 20 68 61 76 65 20 74 6f 20 62 65 LODs have to be
3730: 20 69 6e 20 74 68 65 20 73 61 6d 65 20 70 72 6f in the same pro
3740: 6a 65 63 74 7d 20 5c 0a 09 20 20 20 20 7b 64 69 ject} \.. {di
3750: 73 61 67 72 65 65 73 20 77 69 74 68 20 69 74 73 sagrees with its
3760: 20 4c 4f 44 20 61 62 6f 75 74 20 6f 77 6e 69 6e LOD about ownin
3770: 67 20 70 72 6f 6a 65 63 74 7d 20 7b 0a 09 09 53 g project} {...S
3780: 45 4c 45 43 54 20 46 2e 6e 61 6d 65 2c 20 52 2e ELECT F.name, R.
3790: 72 65 76 0a 09 09 46 52 4f 4d 20 20 20 72 65 76 rev...FROM rev
37a0: 69 73 69 6f 6e 20 52 2c 20 66 69 6c 65 20 46 2c ision R, file F,
37b0: 20 73 79 6d 62 6f 6c 20 53 0a 09 09 57 48 45 52 symbol S...WHER
37c0: 45 20 20 52 2e 66 69 64 20 3d 20 46 2e 66 69 64 E R.fid = F.fid
37d0: 20 20 20 2d 2d 20 47 65 74 20 66 69 6c 65 20 6f -- Get file o
37e0: 66 20 72 65 76 69 73 69 6f 6e 0a 09 09 41 4e 44 f revision...AND
37f0: 20 20 20 20 52 2e 6c 6f 64 20 3d 20 53 2e 73 69 R.lod = S.si
3800: 64 20 20 20 2d 2d 20 47 65 74 20 73 79 6d 62 6f d -- Get symbo
3810: 6c 20 66 6f 72 20 72 65 76 69 73 69 6f 6e 27 73 l for revision's
3820: 20 4c 4f 44 0a 09 09 41 4e 44 20 20 20 20 46 2e LOD...AND F.
3830: 70 69 64 20 21 3d 20 53 2e 70 69 64 20 20 2d 2d pid != S.pid --
3840: 20 62 75 74 20 73 79 6d 62 6f 6c 20 69 73 20 66 but symbol is f
3850: 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 70 or a different p
3860: 72 6f 6a 65 63 74 0a 09 09 3b 0a 09 20 20 20 20 roject...;..
3870: 7d 0a 09 23 20 46 69 6e 64 20 61 6c 6c 20 72 65 }..# Find all re
3880: 76 69 73 69 6f 6e 73 20 77 68 69 63 68 20 64 69 visions which di
3890: 73 67 72 65 65 20 77 69 74 68 20 74 68 65 69 72 sgree with their
38a0: 20 6d 65 74 61 20 64 61 74 61 20 61 62 6f 75 74 meta data about
38b0: 0a 09 23 20 74 68 65 20 70 72 6f 6a 65 63 74 20 ..# the project
38c0: 74 68 65 79 20 61 72 65 20 6f 77 6e 65 64 20 62 they are owned b
38d0: 79 2e 0a 09 43 68 65 63 6b 20 5c 0a 09 20 20 20 y...Check \..
38e0: 20 7b 52 65 76 69 73 69 6f 6e 73 20 61 6e 64 20 {Revisions and
38f0: 74 68 65 69 72 20 6d 65 74 61 20 64 61 74 61 20 their meta data
3900: 68 61 76 65 20 74 6f 20 62 65 20 69 6e 20 74 68 have to be in th
3910: 65 20 73 61 6d 65 20 70 72 6f 6a 65 63 74 7d 20 e same project}
3920: 5c 0a 09 20 20 20 20 7b 64 69 73 61 67 72 65 65 \.. {disagree
3930: 73 20 77 69 74 68 20 69 74 73 20 6d 65 74 61 20 s with its meta
3940: 64 61 74 61 20 61 62 6f 75 74 20 6f 77 6e 69 6e data about ownin
3950: 67 20 70 72 6f 6a 65 63 74 7d 20 7b 0a 09 09 53 g project} {...S
3960: 45 4c 45 43 54 20 46 2e 6e 61 6d 65 2c 20 52 2e ELECT F.name, R.
3970: 72 65 76 0a 09 09 46 52 4f 4d 20 20 20 72 65 76 rev...FROM rev
3980: 69 73 69 6f 6e 20 52 2c 20 66 69 6c 65 20 46 2c ision R, file F,
3990: 20 6d 65 74 61 20 4d 0a 09 09 57 48 45 52 45 20 meta M...WHERE
39a0: 20 52 2e 66 69 64 20 3d 20 46 2e 66 69 64 20 20 R.fid = F.fid
39b0: 20 2d 2d 20 47 65 74 20 66 69 6c 65 20 6f 66 20 -- Get file of
39c0: 72 65 76 69 73 69 6f 6e 0a 09 09 41 4e 44 20 20 revision...AND
39d0: 20 20 52 2e 6d 69 64 20 3d 20 4d 2e 6d 69 64 20 R.mid = M.mid
39e0: 20 20 2d 2d 20 47 65 74 20 6d 65 74 61 20 64 61 -- Get meta da
39f0: 74 61 20 6f 66 20 72 65 76 69 73 69 6f 6e 0a 09 ta of revision..
3a00: 09 41 4e 44 20 20 20 20 46 2e 70 69 64 20 21 3d .AND F.pid !=
3a10: 20 4d 2e 70 69 64 20 20 2d 2d 20 62 75 74 20 69 M.pid -- but i
3a20: 73 20 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e s for a differen
3a30: 74 20 70 72 6f 6a 65 63 74 0a 09 09 3b 0a 09 20 t project...;..
3a40: 20 20 20 7d 0a 09 23 20 46 69 6e 64 20 61 6c 6c }..# Find all
3a50: 20 72 65 76 69 73 69 6f 6e 73 20 77 68 69 63 68 revisions which
3a60: 20 64 69 73 67 72 65 65 20 77 69 74 68 20 74 68 disgree with th
3a70: 65 69 72 20 6d 65 74 61 20 64 61 74 61 20 61 62 eir meta data ab
3a80: 6f 75 74 0a 09 23 20 74 68 65 20 62 72 61 6e 63 out..# the branc
3a90: 68 2f 6c 69 6e 65 20 6f 66 20 64 65 76 65 6c 6f h/line of develo
3aa0: 70 6d 65 6e 74 20 74 68 65 79 20 62 65 6c 6f 6e pment they belon
3ab0: 67 20 74 6f 2e 0a 09 43 68 65 63 6b 20 5c 0a 09 g to...Check \..
3ac0: 20 20 20 20 7b 52 65 76 69 73 69 6f 6e 73 20 61 {Revisions a
3ad0: 6e 64 20 74 68 65 69 72 20 6d 65 74 61 20 64 61 nd their meta da
3ae0: 74 61 20 68 61 76 65 20 74 6f 20 62 65 20 69 6e ta have to be in
3af0: 20 74 68 65 20 73 61 6d 65 20 4c 4f 44 7d 20 5c the same LOD} \
3b00: 0a 09 20 20 20 20 7b 64 69 73 61 67 72 65 65 73 .. {disagrees
3b10: 20 77 69 74 68 20 69 74 73 20 6d 65 74 61 20 64 with its meta d
3b20: 61 74 61 20 61 62 6f 75 74 20 6f 77 6e 69 6e 67 ata about owning
3b30: 20 4c 4f 44 7d 20 7b 0a 09 09 53 45 4c 45 43 54 LOD} {...SELECT
3b40: 20 46 2e 6e 61 6d 65 2c 20 52 2e 72 65 76 0a 09 F.name, R.rev..
3b50: 09 46 52 4f 4d 20 20 20 72 65 76 69 73 69 6f 6e .FROM revision
3b60: 20 52 2c 20 6d 65 74 61 20 4d 2c 20 66 69 6c 65 R, meta M, file
3b70: 20 46 0a 09 09 57 48 45 52 45 20 20 52 2e 6d 69 F...WHERE R.mi
3b80: 64 20 3d 20 4d 2e 6d 69 64 20 20 20 2d 2d 20 47 d = M.mid -- G
3b90: 65 74 20 6d 65 74 61 20 64 61 74 61 20 6f 66 20 et meta data of
3ba0: 72 65 76 69 73 69 6f 6e 0a 09 09 41 4e 44 20 20 revision...AND
3bb0: 20 20 52 2e 6c 6f 64 20 21 3d 20 4d 2e 62 69 64 R.lod != M.bid
3bc0: 20 20 2d 2d 20 62 75 74 20 69 73 20 66 6f 72 20 -- but is for
3bd0: 61 20 64 69 66 66 65 72 65 6e 74 20 4c 4f 44 0a a different LOD.
3be0: 09 09 41 4e 44 20 20 20 20 52 2e 66 69 64 20 3d ..AND R.fid =
3bf0: 20 46 2e 66 69 64 20 20 20 2d 2d 20 47 65 74 20 F.fid -- Get
3c00: 66 69 6c 65 20 6f 66 20 72 65 76 69 73 69 6f 6e file of revision
3c10: 0a 09 09 3b 0a 09 20 20 20 20 7d 0a 09 23 20 46 ...;.. }..# F
3c20: 69 6e 64 20 61 6c 6c 20 72 65 76 69 73 69 6f 6e ind all revision
3c30: 73 20 77 69 74 68 20 61 20 70 72 69 6d 61 72 79 s with a primary
3c40: 20 63 68 69 6c 64 20 77 68 69 63 68 20 64 69 73 child which dis
3c50: 61 67 72 65 65 73 0a 09 23 20 61 62 6f 75 74 20 agrees..# about
3c60: 74 68 65 20 66 69 6c 65 20 74 68 65 79 20 62 65 the file they be
3c70: 6c 6f 6e 67 20 74 6f 2e 0a 09 43 68 65 63 6b 20 long to...Check
3c80: 5c 0a 09 20 20 20 20 7b 52 65 76 69 73 69 6f 6e \.. {Revision
3c90: 73 20 61 6e 64 20 74 68 65 69 72 20 70 72 69 6d s and their prim
3ca0: 61 72 79 20 63 68 69 6c 64 72 65 6e 20 68 61 76 ary children hav
3cb0: 65 20 74 6f 20 62 65 20 69 6e 20 74 68 65 20 73 e to be in the s
3cc0: 61 6d 65 20 66 69 6c 65 7d 20 5c 0a 09 20 20 20 ame file} \..
3cd0: 20 7b 64 69 73 61 67 72 65 65 73 20 77 69 74 68 {disagrees with
3ce0: 20 69 74 73 20 70 72 69 6d 61 72 79 20 63 68 69 its primary chi
3cf0: 6c 64 20 61 62 6f 75 74 20 74 68 65 20 6f 77 6e ld about the own
3d00: 69 6e 67 20 66 69 6c 65 7d 20 7b 0a 09 09 53 45 ing file} {...SE
3d10: 4c 45 43 54 20 46 2e 6e 61 6d 65 2c 20 52 2e 72 LECT F.name, R.r
3d20: 65 76 0a 09 09 46 52 4f 4d 20 20 20 72 65 76 69 ev...FROM revi
3d30: 73 69 6f 6e 20 52 2c 20 72 65 76 69 73 69 6f 6e sion R, revision
3d40: 20 43 2c 20 66 69 6c 65 20 46 0a 09 09 57 48 45 C, file F...WHE
3d50: 52 45 20 20 52 2e 66 69 64 20 3d 20 46 2e 66 69 RE R.fid = F.fi
3d60: 64 20 20 20 20 20 20 20 20 2d 2d 20 47 65 74 20 d -- Get
3d70: 66 69 6c 65 20 6f 66 20 72 65 76 69 73 69 6f 6e file of revision
3d80: 0a 09 09 41 4e 44 20 20 20 20 52 2e 63 68 69 6c ...AND R.chil
3d90: 64 20 49 53 20 4e 4f 54 20 4e 55 4c 4c 20 20 2d d IS NOT NULL -
3da0: 2d 20 52 65 73 74 72 69 63 74 20 74 6f 20 6e 6f - Restrict to no
3db0: 6e 2d 6c 65 61 66 20 72 65 76 69 73 69 6f 6e 73 n-leaf revisions
3dc0: 0a 09 09 41 4e 44 20 20 20 20 52 2e 63 68 69 6c ...AND R.chil
3dd0: 64 20 3d 20 43 2e 72 69 64 20 20 20 20 20 20 2d d = C.rid -
3de0: 2d 20 47 65 74 20 63 68 69 6c 64 20 28 68 61 73 - Get child (has
3df0: 20 74 6f 20 65 78 69 73 74 29 0a 09 09 41 4e 44 to exist)...AND
3e00: 20 20 20 20 43 2e 66 69 64 20 21 3d 20 52 2e 66 C.fid != R.f
3e10: 69 64 20 20 20 20 20 20 20 2d 2d 20 57 68 69 63 id -- Whic
3e20: 20 77 72 6f 6e 67 6c 79 20 69 73 20 69 6e 20 61 wrongly is in a
3e30: 20 64 69 66 66 65 72 65 6e 74 20 66 69 6c 65 0a different file.
3e40: 09 09 3b 0a 09 20 20 20 20 7d 0a 0a 09 23 20 46 ..;.. }...# F
3e50: 69 6e 64 20 61 6c 6c 20 72 65 76 69 73 69 6f 6e ind all revision
3e60: 73 20 77 69 74 68 20 61 20 62 72 61 6e 63 68 20 s with a branch
3e70: 70 61 72 65 6e 74 20 73 79 6d 62 6f 6c 20 77 68 parent symbol wh
3e80: 6f 73 65 20 70 61 72 65 6e 74 0a 09 23 20 64 69 ose parent..# di
3e90: 73 61 67 72 65 65 73 20 61 62 6f 75 74 20 74 68 sagrees about th
3ea0: 65 20 66 69 6c 65 20 74 68 65 79 20 62 65 6c 6f e file they belo
3eb0: 6e 67 20 74 6f 2e 0a 09 43 68 65 63 6b 20 5c 0a ng to...Check \.
3ec0: 09 20 20 20 20 7b 52 65 76 69 73 69 6f 6e 73 20 . {Revisions
3ed0: 61 6e 64 20 74 68 65 69 72 20 62 72 61 6e 63 68 and their branch
3ee0: 20 63 68 69 6c 64 72 65 6e 20 68 61 76 65 20 74 children have t
3ef0: 6f 20 62 65 20 69 6e 20 74 68 65 20 73 61 6d 65 o be in the same
3f00: 20 66 69 6c 65 7d 20 5c 0a 09 20 20 20 20 7b 61 file} \.. {a
3f10: 74 20 74 68 65 20 62 65 67 69 6e 6e 69 6e 67 20 t the beginning
3f20: 6f 66 20 69 74 73 20 62 72 61 6e 63 68 20 61 6e of its branch an
3f30: 64 20 69 74 73 20 70 61 72 65 6e 74 20 64 69 73 d its parent dis
3f40: 61 67 72 65 65 20 61 62 6f 75 74 20 74 68 65 20 agree about the
3f50: 6f 77 6e 69 6e 67 20 66 69 6c 65 7d 20 7b 0a 09 owning file} {..
3f60: 09 53 45 4c 45 43 54 20 46 2e 6e 61 6d 65 2c 20 .SELECT F.name,
3f70: 52 2e 72 65 76 0a 09 09 46 52 4f 4d 20 20 20 72 R.rev...FROM r
3f80: 65 76 69 73 69 6f 6e 20 52 2c 20 72 65 76 69 73 evision R, revis
3f90: 69 6f 6e 20 50 2c 20 66 69 6c 65 20 46 0a 09 09 ion P, file F...
3fa0: 57 48 45 52 45 20 20 52 2e 66 69 64 20 3d 20 46 WHERE R.fid = F
3fb0: 2e 66 69 64 20 20 20 20 20 20 20 20 20 20 2d 2d .fid --
3fc0: 20 47 65 74 20 66 69 6c 65 20 6f 66 20 72 65 76 Get file of rev
3fd0: 69 73 69 6f 6e 0a 09 09 41 4e 44 20 20 20 20 52 ision...AND R
3fe0: 2e 62 70 61 72 65 6e 74 20 49 53 20 4e 4f 54 20 .bparent IS NOT
3ff0: 4e 55 4c 4c 20 20 2d 2d 20 52 65 73 74 72 69 63 NULL -- Restric
4000: 74 20 74 6f 20 66 69 72 73 74 20 6f 6e 20 62 72 t to first on br
4010: 61 6e 63 68 0a 09 09 41 4e 44 20 20 20 20 52 2e anch...AND R.
4020: 70 61 72 65 6e 74 20 3d 20 50 2e 72 69 64 20 20 parent = P.rid
4030: 20 20 20 20 20 2d 2d 20 47 65 74 20 6f 75 74 2d -- Get out-
4040: 6f 66 2d 62 72 61 6e 63 68 20 70 61 72 65 6e 74 of-branch parent
4050: 0a 09 09 41 4e 44 20 20 20 20 52 2e 66 69 64 20 ...AND R.fid
4060: 21 3d 20 50 2e 66 69 64 20 20 20 20 20 20 20 20 != P.fid
4070: 20 2d 2d 20 57 68 69 63 68 20 77 72 6f 6e 67 6c -- Which wrongl
4080: 79 20 69 73 20 69 6e 20 61 20 64 69 66 66 65 72 y is in a differ
4090: 65 6e 74 20 66 69 6c 65 0a 09 09 3b 0a 09 20 20 ent file...;..
40a0: 20 20 7d 0a 09 23 20 46 69 6e 64 20 61 6c 6c 20 }..# Find all
40b0: 72 65 76 69 73 69 6f 6e 73 20 77 69 74 68 20 61 revisions with a
40c0: 20 6e 6f 6e 2d 4e 54 44 42 20 63 68 69 6c 64 20 non-NTDB child
40d0: 77 68 69 63 68 20 64 69 73 61 67 72 65 65 73 0a which disagrees.
40e0: 09 23 20 61 62 6f 75 74 20 74 68 65 20 66 69 6c .# about the fil
40f0: 65 20 74 68 65 79 20 62 65 6c 6f 6e 67 20 74 6f e they belong to
4100: 2e 0a 09 43 68 65 63 6b 20 5c 0a 09 20 20 20 20 ...Check \..
4110: 7b 52 65 76 69 73 69 6f 6e 73 20 61 6e 64 20 74 {Revisions and t
4120: 68 65 69 72 20 6e 6f 6e 2d 4e 54 44 42 20 63 68 heir non-NTDB ch
4130: 69 6c 64 72 65 6e 20 68 61 76 65 20 74 6f 20 62 ildren have to b
4140: 65 20 69 6e 20 74 68 65 20 73 61 6d 65 20 66 69 e in the same fi
4150: 6c 65 7d 20 5c 0a 09 20 20 20 20 7b 64 69 73 61 le} \.. {disa
4160: 67 72 65 65 73 20 77 69 74 68 20 69 74 73 20 6e grees with its n
4170: 6f 6e 2d 4e 54 44 42 20 63 68 69 6c 64 20 61 62 on-NTDB child ab
4180: 6f 75 74 20 74 68 65 20 6f 77 6e 69 6e 67 20 66 out the owning f
4190: 69 6c 65 7d 20 7b 0a 09 09 53 45 4c 45 43 54 20 ile} {...SELECT
41a0: 46 2e 6e 61 6d 65 2c 20 52 2e 72 65 76 0a 09 09 F.name, R.rev...
41b0: 46 52 4f 4d 20 20 20 72 65 76 69 73 69 6f 6e 20 FROM revision
41c0: 52 2c 20 72 65 76 69 73 69 6f 6e 20 43 2c 20 66 R, revision C, f
41d0: 69 6c 65 20 46 0a 09 09 57 48 45 52 45 20 20 52 ile F...WHERE R
41e0: 2e 66 69 64 20 3d 20 46 2e 66 69 64 20 20 20 20 .fid = F.fid
41f0: 20 20 20 20 20 20 2d 2d 20 47 65 74 20 66 69 6c -- Get fil
4200: 65 20 6f 66 20 72 65 76 69 73 69 6f 6e 0a 09 09 e of revision...
4210: 41 4e 44 20 20 20 20 52 2e 64 62 63 68 69 6c 64 AND R.dbchild
4220: 20 49 53 20 4e 4f 54 20 4e 55 4c 4c 20 20 2d 2d IS NOT NULL --
4230: 20 52 65 73 74 72 69 63 74 20 74 6f 20 73 65 6d Restrict to sem
4240: 69 2d 6c 61 73 74 20 4e 54 44 42 20 72 65 76 69 i-last NTDB revi
4250: 73 69 6f 6e 0a 09 09 41 4e 44 20 20 20 20 52 2e sion...AND R.
4260: 64 62 63 68 69 6c 64 20 3d 20 43 2e 72 69 64 20 dbchild = C.rid
4270: 20 20 20 20 20 2d 2d 20 47 6f 74 20 74 6f 20 61 -- Got to a
4280: 73 73 6f 63 69 61 74 65 64 20 74 72 75 6e 6b 20 ssociated trunk
4290: 72 65 76 69 73 69 6f 6e 0a 09 09 41 4e 44 20 20 revision...AND
42a0: 20 20 43 2e 66 69 64 20 21 3d 20 52 2e 66 69 64 C.fid != R.fid
42b0: 20 20 20 20 20 20 20 20 20 2d 2d 20 57 68 69 63 -- Whic
42c0: 68 20 77 72 6f 6e 67 6c 79 20 69 73 20 69 6e 20 h wrongly is in
42d0: 61 20 64 69 66 66 65 72 65 6e 74 20 66 69 6c 65 a different file
42e0: 0a 09 09 3b 0a 09 20 20 20 20 7d 0a 09 23 20 46 ...;.. }..# F
42f0: 69 6e 64 20 61 6c 6c 20 72 65 76 69 73 69 6f 6e ind all revision
4300: 73 20 77 68 69 63 68 20 68 61 76 65 20 61 20 70 s which have a p
4310: 72 69 6d 61 72 79 20 63 68 69 6c 64 2c 20 62 75 rimary child, bu
4320: 74 20 74 68 65 20 63 68 69 6c 64 0a 09 23 20 64 t the child..# d
4330: 6f 65 73 20 6e 6f 74 20 68 61 76 65 20 74 68 65 oes not have the
4340: 6d 20 61 73 20 70 61 72 65 6e 74 2e 0a 09 43 68 m as parent...Ch
4350: 65 63 6b 20 5c 0a 09 20 20 20 20 7b 52 65 76 69 eck \.. {Revi
4360: 73 69 6f 6e 73 20 68 61 76 65 20 74 6f 20 62 65 sions have to be
4370: 20 70 61 72 65 6e 74 73 20 6f 66 20 74 68 65 69 parents of thei
4380: 72 20 70 72 69 6d 61 72 79 20 63 68 69 6c 64 72 r primary childr
4390: 65 6e 7d 20 5c 0a 09 20 20 20 20 7b 69 73 20 6e en} \.. {is n
43a0: 6f 74 20 74 68 65 20 70 61 72 65 6e 74 20 6f 66 ot the parent of
43b0: 20 69 74 73 20 70 72 69 6d 61 72 79 20 63 68 69 its primary chi
43c0: 6c 64 7d 20 7b 0a 09 09 53 45 4c 45 43 54 20 46 ld} {...SELECT F
43d0: 2e 6e 61 6d 65 2c 20 52 2e 72 65 76 0a 09 09 46 .name, R.rev...F
43e0: 52 4f 4d 20 20 20 72 65 76 69 73 69 6f 6e 20 52 ROM revision R
43f0: 2c 20 72 65 76 69 73 69 6f 6e 20 43 2c 20 66 69 , revision C, fi
4400: 6c 65 20 46 0a 09 09 57 48 45 52 45 20 20 52 2e le F...WHERE R.
4410: 66 69 64 20 3d 20 46 2e 66 69 64 20 20 20 20 20 fid = F.fid
4420: 20 20 20 2d 2d 20 47 65 74 20 66 69 6c 65 20 6f -- Get file o
4430: 66 20 72 65 76 69 73 69 6f 6e 0a 09 09 41 4e 44 f revision...AND
4440: 20 20 20 20 52 2e 63 68 69 6c 64 20 49 53 20 4e R.child IS N
4450: 4f 54 20 4e 55 4c 4c 20 20 2d 2d 20 52 65 73 74 OT NULL -- Rest
4460: 72 69 63 74 20 74 6f 20 6e 6f 6e 2d 6c 65 61 76 rict to non-leav
4470: 65 73 0a 09 09 41 4e 44 20 20 20 20 52 2e 63 68 es...AND R.ch
4480: 69 6c 64 20 3d 20 43 2e 72 69 64 20 20 20 20 20 ild = C.rid
4490: 20 2d 2d 20 47 65 74 20 74 68 65 20 63 68 69 6c -- Get the chil
44a0: 64 20 28 68 61 73 20 74 6f 20 65 78 69 73 74 29 d (has to exist)
44b0: 0a 09 09 41 4e 44 20 20 20 20 43 2e 70 61 72 65 ...AND C.pare
44c0: 6e 74 20 21 3d 20 52 2e 72 69 64 20 20 20 20 2d nt != R.rid -
44d0: 2d 20 57 68 69 63 68 20 64 6f 65 73 20 6e 6f 74 - Which does not
44e0: 20 68 61 76 65 20 75 73 20 61 73 20 69 74 73 20 have us as its
44f0: 70 61 72 65 6e 74 2e 0a 09 09 3b 0a 09 20 20 20 parent....;..
4500: 20 7d 0a 09 23 20 46 69 6e 64 20 61 6c 6c 20 72 }..# Find all r
4510: 65 76 69 73 69 6f 6e 73 20 77 68 69 63 68 20 68 evisions which h
4520: 61 76 65 20 61 20 70 72 69 6d 72 61 72 79 20 63 ave a primrary c
4530: 68 69 6c 64 2c 20 62 75 74 20 74 68 65 0a 09 23 hild, but the..#
4540: 20 63 68 69 6c 64 20 68 61 73 20 61 20 62 72 61 child has a bra
4550: 6e 63 68 20 70 61 72 65 6e 74 20 73 79 6d 62 6f nch parent symbo
4560: 6c 20 6d 61 6b 69 6e 67 20 74 68 65 6d 20 62 72 l making them br
4570: 61 63 68 20 73 74 61 72 74 65 72 73 2e 0a 09 43 ach starters...C
4580: 68 65 63 6b 20 5c 0a 09 20 20 20 20 7b 50 72 69 heck \.. {Pri
4590: 6d 61 72 79 20 63 68 69 6c 64 72 65 6e 20 6f 66 mary children of
45a0: 20 72 65 76 69 73 69 6f 6e 73 20 6d 75 73 74 20 revisions must
45b0: 6e 6f 74 20 73 74 61 72 74 20 62 72 61 6e 63 68 not start branch
45c0: 65 73 7d 20 5c 0a 09 20 20 20 20 7b 69 73 20 70 es} \.. {is p
45d0: 61 72 65 6e 74 20 6f 66 20 61 20 70 72 69 6d 61 arent of a prima
45e0: 72 79 20 63 68 69 6c 64 20 77 68 69 63 68 20 69 ry child which i
45f0: 73 20 74 68 65 20 62 65 67 69 6e 6e 69 6e 67 20 s the beginning
4600: 6f 66 20 61 20 62 72 61 6e 63 68 7d 20 7b 0a 09 of a branch} {..
4610: 09 53 45 4c 45 43 54 20 46 2e 6e 61 6d 65 2c 20 .SELECT F.name,
4620: 52 2e 72 65 76 0a 09 09 46 52 4f 4d 20 20 20 72 R.rev...FROM r
4630: 65 76 69 73 69 6f 6e 20 52 2c 20 72 65 76 69 73 evision R, revis
4640: 69 6f 6e 20 43 2c 20 66 69 6c 65 20 46 0a 09 09 ion C, file F...
4650: 57 48 45 52 45 20 20 52 2e 66 69 64 20 3d 20 46 WHERE R.fid = F
4660: 2e 66 69 64 20 20 20 20 20 20 20 20 20 20 20 2d .fid -
4670: 2d 20 47 65 74 20 66 69 6c 65 20 6f 66 20 72 65 - Get file of re
4680: 76 69 73 69 6f 6e 0a 09 09 41 4e 44 20 20 20 20 vision...AND
4690: 52 2e 63 68 69 6c 64 20 49 53 20 4e 4f 54 20 4e R.child IS NOT N
46a0: 55 4c 4c 20 20 20 20 20 2d 2d 20 52 65 73 74 72 ULL -- Restr
46b0: 69 63 74 20 74 6f 20 6e 6f 6e 2d 6c 65 61 76 65 ict to non-leave
46c0: 73 0a 09 09 41 4e 44 20 20 20 20 52 2e 63 68 69 s...AND R.chi
46d0: 6c 64 20 3d 20 43 2e 72 69 64 20 20 20 20 20 20 ld = C.rid
46e0: 20 20 20 2d 2d 20 47 65 74 20 74 68 65 20 63 68 -- Get the ch
46f0: 69 6c 64 20 28 68 61 73 20 74 6f 20 65 78 69 73 ild (has to exis
4700: 74 29 0a 09 09 41 4e 44 20 20 20 20 43 2e 62 70 t)...AND C.bp
4710: 61 72 65 6e 74 20 49 53 20 4e 4f 54 20 4e 55 4c arent IS NOT NUL
4720: 4c 20 20 20 2d 2d 20 77 72 6f 6e 67 6c 79 20 63 L -- wrongly c
4730: 6c 61 69 6d 69 6e 67 20 74 6f 20 62 65 20 66 69 laiming to be fi
4740: 72 73 74 20 6f 6e 20 62 72 61 6e 63 68 0a 09 09 rst on branch...
4750: 3b 0a 09 20 20 20 20 7d 0a 09 23 20 46 69 6e 64 ;.. }..# Find
4760: 20 61 6c 6c 20 72 65 76 69 73 69 6f 6e 73 20 77 all revisions w
4770: 69 74 68 6f 75 74 20 62 72 61 6e 63 68 20 70 61 ithout branch pa
4780: 72 65 6e 74 20 73 79 6d 62 6f 6c 20 77 68 69 63 rent symbol whic
4790: 68 20 68 61 76 65 20 61 0a 09 23 20 70 61 72 65 h have a..# pare
47a0: 6e 74 2c 20 62 75 74 20 74 68 65 20 70 61 72 65 nt, but the pare
47b0: 6e 74 20 64 6f 65 73 20 6e 6f 74 20 68 61 76 65 nt does not have
47c0: 20 74 68 65 6d 20 61 73 20 70 72 69 6d 61 72 79 them as primary
47d0: 20 63 68 69 6c 64 2e 0a 09 43 68 65 63 6b 20 5c child...Check \
47e0: 0a 09 20 20 20 20 7b 52 65 76 69 73 69 6f 6e 73 .. {Revisions
47f0: 20 68 61 76 65 20 74 6f 20 62 65 20 70 72 69 6d have to be prim
4800: 61 72 79 20 63 68 69 6c 64 72 65 6e 20 6f 66 20 ary children of
4810: 74 68 65 69 72 20 70 61 72 65 6e 74 73 2c 20 69 their parents, i
4820: 66 20 61 6e 79 7d 20 5c 0a 09 20 20 20 20 7b 69 f any} \.. {i
4830: 73 20 6e 6f 74 20 74 68 65 20 63 68 69 6c 64 20 s not the child
4840: 6f 66 20 69 74 73 20 70 61 72 65 6e 74 7d 20 7b of its parent} {
4850: 0a 09 09 53 45 4c 45 43 54 20 46 2e 6e 61 6d 65 ...SELECT F.name
4860: 2c 20 52 2e 72 65 76 0a 09 09 46 52 4f 4d 20 20 , R.rev...FROM
4870: 20 72 65 76 69 73 69 6f 6e 20 52 2c 20 72 65 76 revision R, rev
4880: 69 73 69 6f 6e 20 50 2c 20 66 69 6c 65 20 46 0a ision P, file F.
4890: 09 09 57 48 45 52 45 20 20 52 2e 66 69 64 20 3d ..WHERE R.fid =
48a0: 20 46 2e 66 69 64 0a 09 09 41 4e 44 20 20 20 20 F.fid...AND
48b0: 52 2e 62 70 61 72 65 6e 74 20 49 53 20 4e 55 4c R.bparent IS NUL
48c0: 4c 20 20 20 20 20 2d 2d 20 47 65 74 20 66 69 6c L -- Get fil
48d0: 65 20 6f 66 20 72 65 76 69 73 69 6f 6e 0a 09 09 e of revision...
48e0: 41 4e 44 20 20 20 20 52 2e 70 61 72 65 6e 74 20 AND R.parent
48f0: 49 53 20 4e 4f 54 20 4e 55 4c 4c 20 20 2d 2d 20 IS NOT NULL --
4900: 52 65 73 74 72 69 63 74 20 74 6f 20 65 76 65 72 Restrict to ever
4910: 79 74 68 69 6e 67 20 6e 6f 74 20 66 69 72 73 74 ything not first
4920: 20 6f 6e 20 61 20 62 72 61 6e 63 68 0a 09 09 41 on a branch...A
4930: 4e 44 20 20 20 20 52 2e 70 61 72 65 6e 74 20 3d ND R.parent =
4940: 20 50 2e 72 69 64 20 20 20 20 20 20 2d 2d 20 47 P.rid -- G
4950: 65 74 20 74 68 65 20 70 61 72 65 6e 74 20 28 68 et the parent (h
4960: 61 73 20 74 6f 20 65 78 69 73 74 29 0a 09 09 41 as to exist)...A
4970: 4e 44 20 20 20 20 50 2e 63 68 69 6c 64 20 21 3d ND P.child !=
4980: 20 52 2e 72 69 64 20 20 20 20 20 20 2d 2d 20 57 R.rid -- W
4990: 68 69 63 68 20 64 6f 20 6e 6f 74 20 68 61 76 65 hich do not have
49a0: 20 75 73 20 61 73 20 74 68 65 69 72 20 63 68 69 us as their chi
49b0: 6c 64 0a 09 09 3b 0a 09 20 20 20 20 7d 0a 09 23 ld...;.. }..#
49c0: 20 46 69 6e 64 20 61 6c 6c 20 72 65 76 69 73 69 Find all revisi
49d0: 6f 6e 73 20 77 69 74 68 20 61 20 62 72 61 6e 63 ons with a branc
49e0: 68 20 70 61 72 65 6e 74 20 73 79 6d 62 6f 6c 20 h parent symbol
49f0: 77 68 69 63 68 20 64 6f 20 6e 6f 74 0a 09 23 20 which do not..#
4a00: 68 61 76 65 20 61 20 70 61 72 65 6e 74 2e 0a 09 have a parent...
4a10: 43 68 65 63 6b 20 5c 0a 09 20 20 20 20 7b 42 72 Check \.. {Br
4a20: 61 6e 63 68 20 73 74 61 72 74 69 6e 67 20 72 65 anch starting re
4a30: 76 69 73 69 6f 6e 73 20 68 61 76 65 20 74 6f 20 visions have to
4a40: 68 61 76 65 20 61 20 70 61 72 65 6e 74 7d 20 5c have a parent} \
4a50: 0a 09 20 20 20 20 7b 61 74 20 74 68 65 20 62 65 .. {at the be
4a60: 67 69 6e 6e 69 6e 67 20 6f 66 20 69 74 73 20 62 ginning of its b
4a70: 72 61 6e 63 68 20 68 61 73 20 6e 6f 20 70 61 72 ranch has no par
4a80: 65 6e 74 7d 20 7b 0a 09 09 53 45 4c 45 43 54 20 ent} {...SELECT
4a90: 46 2e 6e 61 6d 65 2c 20 52 2e 72 65 76 0a 09 09 F.name, R.rev...
4aa0: 46 52 4f 4d 20 20 20 72 65 76 69 73 69 6f 6e 20 FROM revision
4ab0: 52 2c 20 66 69 6c 65 20 46 0a 09 09 57 48 45 52 R, file F...WHER
4ac0: 45 20 20 52 2e 66 69 64 20 3d 20 46 2e 66 69 64 E R.fid = F.fid
4ad0: 20 20 20 20 20 20 20 20 20 20 2d 2d 20 47 65 74 -- Get
4ae0: 20 66 69 6c 65 20 6f 66 20 72 65 76 69 73 69 6f file of revisio
4af0: 6e 0a 09 09 41 4e 44 20 20 20 20 52 2e 62 70 61 n...AND R.bpa
4b00: 72 65 6e 74 20 49 53 20 4e 4f 54 20 4e 55 4c 4c rent IS NOT NULL
4b10: 20 20 2d 2d 20 52 65 73 74 72 69 63 74 20 74 6f -- Restrict to
4b20: 20 66 69 72 73 74 20 6f 6e 20 61 20 62 72 61 6e first on a bran
4b30: 63 68 0a 09 09 41 4e 44 20 20 20 20 52 2e 70 61 ch...AND R.pa
4b40: 72 65 6e 74 20 49 53 20 4e 55 4c 4c 20 20 20 20 rent IS NULL
4b50: 20 20 20 2d 2d 20 42 75 74 20 74 68 65 72 65 20 -- But there
4b60: 69 73 20 6e 6f 20 6f 75 74 2d 6f 66 2d 62 72 61 is no out-of-bra
4b70: 6e 63 68 20 70 61 72 65 6e 74 0a 09 09 3b 0a 09 nch parent...;..
4b80: 20 20 20 20 7d 0a 09 23 20 46 69 6e 64 20 61 6c }..# Find al
4b90: 6c 20 72 65 76 69 73 69 6f 6e 73 20 77 69 74 68 l revisions with
4ba0: 20 61 20 62 72 61 6e 63 68 20 70 61 72 65 6e 74 a branch parent
4bb0: 20 73 79 6d 62 6f 6c 20 77 68 6f 73 65 20 70 61 symbol whose pa
4bc0: 72 65 6e 74 0a 09 23 20 68 61 73 20 74 68 65 6d rent..# has them
4bd0: 20 61 73 20 70 72 69 6d 61 72 79 20 63 68 69 6c as primary chil
4be0: 64 2e 0a 09 43 68 65 63 6b 20 5c 0a 09 20 20 20 d...Check \..
4bf0: 20 7b 42 72 61 6e 63 68 20 73 74 61 72 74 69 6e {Branch startin
4c00: 67 20 72 65 76 69 73 69 6f 6e 73 20 6d 75 73 74 g revisions must
4c10: 20 6e 6f 74 20 62 65 20 70 72 69 6d 61 72 79 20 not be primary
4c20: 63 68 69 6c 64 72 65 6e 20 6f 66 20 74 68 65 69 children of thei
4c30: 72 20 70 61 72 65 6e 74 73 7d 20 5c 0a 09 20 20 r parents} \..
4c40: 20 20 7b 61 74 20 74 68 65 20 62 65 67 69 6e 6e {at the beginn
4c50: 69 6e 67 20 6f 66 20 69 74 73 20 62 72 61 6e 63 ing of its branc
4c60: 68 20 69 73 20 74 68 65 20 70 72 69 6d 61 72 79 h is the primary
4c70: 20 63 68 69 6c 64 20 6f 66 20 69 74 73 20 70 61 child of its pa
4c80: 72 65 6e 74 7d 20 7b 0a 09 09 53 45 4c 45 43 54 rent} {...SELECT
4c90: 20 46 2e 6e 61 6d 65 2c 20 52 2e 72 65 76 0a 09 F.name, R.rev..
4ca0: 09 46 52 4f 4d 20 20 20 72 65 76 69 73 69 6f 6e .FROM revision
4cb0: 20 52 2c 20 72 65 76 69 73 69 6f 6e 20 50 2c 20 R, revision P,
4cc0: 66 69 6c 65 20 46 0a 09 09 57 48 45 52 45 20 20 file F...WHERE
4cd0: 52 2e 66 69 64 20 3d 20 46 2e 66 69 64 20 20 20 R.fid = F.fid
4ce0: 20 20 20 20 20 20 20 2d 2d 20 47 65 74 20 66 69 -- Get fi
4cf0: 6c 65 20 6f 66 20 72 65 76 69 73 69 6f 6e 0a 09 le of revision..
4d00: 09 41 4e 44 20 20 20 20 52 2e 62 70 61 72 65 6e .AND R.bparen
4d10: 74 20 49 53 20 4e 4f 54 20 4e 55 4c 4c 20 20 2d t IS NOT NULL -
4d20: 2d 20 52 65 73 74 72 69 63 74 20 74 6f 20 66 69 - Restrict to fi
4d30: 72 73 74 20 6f 6e 20 61 20 62 72 61 6e 63 68 0a rst on a branch.
4d40: 09 09 41 4e 44 20 20 20 20 52 2e 70 61 72 65 6e ..AND R.paren
4d50: 74 20 49 53 20 4e 4f 54 20 4e 55 4c 4c 20 20 20 t IS NOT NULL
4d60: 2d 2d 20 57 68 69 63 68 20 61 72 65 20 6e 6f 74 -- Which are not
4d70: 20 64 65 74 61 63 68 65 64 0a 09 09 41 4e 44 20 detached...AND
4d80: 20 20 20 52 2e 70 61 72 65 6e 74 20 3d 20 50 2e R.parent = P.
4d90: 72 69 64 20 20 20 20 20 20 20 2d 2d 20 47 65 74 rid -- Get
4da0: 20 74 68 65 69 72 20 6e 6f 6e 2d 62 72 61 6e 63 their non-branc
4db0: 68 20 70 61 72 65 6e 74 0a 09 09 41 4e 44 20 20 h parent...AND
4dc0: 20 20 50 2e 63 68 69 6c 64 20 3d 20 52 2e 72 69 P.child = R.ri
4dd0: 64 20 20 20 20 20 20 20 20 2d 2d 20 77 68 69 63 d -- whic
4de0: 68 20 69 6d 70 72 6f 70 65 72 6c 79 20 68 61 73 h improperly has
4df0: 20 74 68 65 6d 20 61 73 20 70 72 69 6d 61 72 79 them as primary
4e00: 20 63 68 69 6c 64 0a 09 09 3b 0a 09 20 20 20 20 child...;..
4e10: 7d 0a 09 23 20 46 69 6e 64 20 61 6c 6c 20 72 65 }..# Find all re
4e20: 76 69 73 69 6f 6e 73 20 77 69 74 68 20 61 20 6e visions with a n
4e30: 6f 6e 2d 4e 54 44 42 20 63 68 69 6c 64 20 77 68 on-NTDB child wh
4e40: 69 63 68 20 61 72 65 20 6e 6f 74 20 6f 6e 0a 09 ich are not on..
4e50: 23 20 74 68 65 20 4e 54 44 42 2e 0a 09 43 68 65 # the NTDB...Che
4e60: 63 6b 20 5c 0a 09 20 20 20 20 7b 4e 54 44 42 20 ck \.. {NTDB
4e70: 74 6f 20 74 72 75 6e 6b 20 74 72 61 6e 73 69 74 to trunk transit
4e80: 69 6f 6e 20 68 61 73 20 74 6f 20 62 65 67 69 6e ion has to begin
4e90: 20 6f 6e 20 4e 54 44 42 7d 20 5c 0a 09 20 20 20 on NTDB} \..
4ea0: 20 7b 68 61 73 20 61 20 6e 6f 6e 2d 4e 54 44 42 {has a non-NTDB
4eb0: 20 63 68 69 6c 64 2c 20 79 65 74 20 69 73 20 6e child, yet is n
4ec0: 6f 74 20 6f 6e 20 74 68 65 20 4e 54 44 42 7d 20 ot on the NTDB}
4ed0: 7b 0a 09 09 53 45 4c 45 43 54 20 46 2e 6e 61 6d {...SELECT F.nam
4ee0: 65 2c 20 52 2e 72 65 76 0a 09 09 46 52 4f 4d 20 e, R.rev...FROM
4ef0: 20 20 72 65 76 69 73 69 6f 6e 20 52 2c 20 66 69 revision R, fi
4f00: 6c 65 20 46 0a 09 09 57 48 45 52 45 20 20 52 2e le F...WHERE R.
4f10: 66 69 64 20 3d 20 46 2e 66 69 64 20 20 20 20 20 fid = F.fid
4f20: 20 20 20 20 20 2d 2d 20 47 65 74 20 66 69 6c 65 -- Get file
4f30: 20 6f 66 20 72 65 76 69 73 69 6f 6e 0a 09 09 41 of revision...A
4f40: 4e 44 20 20 20 20 52 2e 64 62 63 68 69 6c 64 20 ND R.dbchild
4f50: 49 53 20 4e 4f 54 20 4e 55 4c 4c 20 20 2d 2d 20 IS NOT NULL --
4f60: 52 65 73 74 72 69 63 74 20 74 6f 20 73 65 6d 69 Restrict to semi
4f70: 2d 6c 61 73 74 20 4e 54 44 42 20 72 65 76 69 73 -last NTDB revis
4f80: 69 6f 6e 0a 09 09 41 4e 44 20 20 20 20 4e 4f 54 ion...AND NOT
4f90: 20 52 2e 69 73 64 65 66 61 75 6c 74 20 20 20 20 R.isdefault
4fa0: 20 20 20 20 2d 2d 20 49 6d 70 72 6f 70 65 72 6c -- Improperl
4fb0: 79 20 63 6c 61 69 6d 69 6e 67 20 74 6f 20 6e 6f y claiming to no
4fc0: 74 20 62 65 20 6f 6e 20 4e 54 44 42 0a 09 09 3b t be on NTDB...;
4fd0: 0a 09 20 20 20 20 7d 0a 09 23 20 46 69 6e 64 20 .. }..# Find
4fe0: 61 6c 6c 20 72 65 76 69 73 69 6f 6e 73 20 77 69 all revisions wi
4ff0: 74 68 20 61 20 4e 54 44 42 20 70 61 72 65 6e 74 th a NTDB parent
5000: 20 77 68 69 63 68 20 61 72 65 20 6f 6e 20 74 68 which are on th
5010: 65 20 4e 54 44 42 2e 0a 09 43 68 65 63 6b 20 5c e NTDB...Check \
5020: 0a 09 20 20 20 20 7b 4e 54 44 42 20 74 6f 20 74 .. {NTDB to t
5030: 72 75 6e 6b 20 74 72 61 6e 73 69 74 69 6f 6e 20 runk transition
5040: 68 61 73 20 74 6f 20 65 6e 64 20 6f 6e 20 6e 6f has to end on no
5050: 6e 2d 4e 54 44 42 7d 20 5c 0a 09 20 20 20 20 7b n-NTDB} \.. {
5060: 68 61 73 20 61 20 4e 54 44 42 20 70 61 72 65 6e has a NTDB paren
5070: 74 2c 20 79 65 74 20 69 73 20 6f 6e 20 74 68 65 t, yet is on the
5080: 20 4e 54 44 42 7d 20 7b 0a 09 09 53 45 4c 45 43 NTDB} {...SELEC
5090: 54 20 46 2e 6e 61 6d 65 2c 20 52 2e 72 65 76 0a T F.name, R.rev.
50a0: 09 09 46 52 4f 4d 20 20 20 72 65 76 69 73 69 6f ..FROM revisio
50b0: 6e 20 52 2c 20 66 69 6c 65 20 46 0a 09 09 57 48 n R, file F...WH
50c0: 45 52 45 20 20 52 2e 66 69 64 20 3d 20 46 2e 66 ERE R.fid = F.f
50d0: 69 64 20 20 20 20 20 20 20 20 20 20 20 2d 2d 20 id --
50e0: 47 65 74 20 66 69 6c 65 20 6f 66 20 72 65 76 69 Get file of revi
50f0: 73 69 6f 6e 0a 09 09 41 4e 44 20 20 20 20 52 2e sion...AND R.
5100: 64 62 70 61 72 65 6e 74 20 49 53 20 4e 4f 54 20 dbparent IS NOT
5110: 4e 55 4c 4c 20 20 2d 2d 20 52 65 73 74 72 69 63 NULL -- Restric
5120: 74 20 74 6f 20 74 72 75 6e 6b 20 72 6f 6f 74 73 t to trunk roots
5130: 20 77 69 74 68 20 4e 54 44 42 20 61 72 6f 75 6e with NTDB aroun
5140: 64 0a 09 09 41 4e 44 20 20 20 20 52 2e 69 73 64 d...AND R.isd
5150: 65 66 61 75 6c 74 20 20 20 20 20 20 20 20 20 20 efault
5160: 20 20 20 2d 2d 20 42 75 74 20 72 6f 6f 74 20 69 -- But root i
5170: 6d 70 72 6f 70 65 72 6c 79 20 63 6c 61 69 6d 73 mproperly claims
5180: 20 74 6f 20 62 65 20 6f 6e 20 4e 54 44 42 0a 09 to be on NTDB..
5190: 09 3b 0a 09 20 20 20 20 7d 0a 09 23 20 46 69 6e .;.. }..# Fin
51a0: 64 20 61 6c 6c 20 72 65 76 69 73 69 6f 6e 73 20 d all revisions
51b0: 77 69 74 68 20 61 20 63 68 69 6c 64 20 77 68 69 with a child whi
51c0: 63 68 20 64 69 73 61 67 72 65 65 73 20 61 62 6f ch disagrees abo
51d0: 75 74 20 74 68 65 0a 09 23 20 6c 69 6e 65 20 6f ut the..# line o
51e0: 66 20 64 65 76 65 6c 6f 70 6d 65 6e 74 20 74 68 f development th
51f0: 65 79 20 62 65 6c 6f 6e 67 20 74 6f 2e 0a 09 43 ey belong to...C
5200: 68 65 63 6b 20 5c 0a 09 20 20 20 20 7b 52 65 76 heck \.. {Rev
5210: 69 73 69 6f 6e 73 20 61 6e 64 20 74 68 65 69 72 isions and their
5220: 20 70 72 69 6d 61 72 79 20 63 68 69 6c 64 72 65 primary childre
5230: 6e 20 68 61 76 65 20 74 6f 20 62 65 20 69 6e 20 n have to be in
5240: 74 68 65 20 73 61 6d 65 20 4c 4f 44 7d 20 5c 0a the same LOD} \.
5250: 09 20 20 20 20 7b 61 6e 64 20 69 74 73 20 70 72 . {and its pr
5260: 69 6d 61 72 79 20 63 68 69 6c 64 20 64 69 73 61 imary child disa
5270: 67 72 65 65 20 61 62 6f 75 74 20 74 68 65 69 72 gree about their
5280: 20 4c 4f 44 7d 20 7b 0a 09 09 53 45 4c 45 43 54 LOD} {...SELECT
5290: 20 46 2e 6e 61 6d 65 2c 20 52 2e 72 65 76 0a 09 F.name, R.rev..
52a0: 09 46 52 4f 4d 20 20 20 72 65 76 69 73 69 6f 6e .FROM revision
52b0: 20 52 2c 20 72 65 76 69 73 69 6f 6e 20 43 2c 20 R, revision C,
52c0: 66 69 6c 65 20 46 0a 09 09 57 48 45 52 45 20 20 file F...WHERE
52d0: 52 2e 66 69 64 20 3d 20 46 2e 66 69 64 20 20 20 R.fid = F.fid
52e0: 20 20 20 20 20 2d 2d 20 47 65 74 20 66 69 6c 65 -- Get file
52f0: 20 6f 66 20 72 65 76 69 73 69 6f 6e 0a 09 09 41 of revision...A
5300: 4e 44 20 20 20 20 52 2e 63 68 69 6c 64 20 49 53 ND R.child IS
5310: 20 4e 4f 54 20 4e 55 4c 4c 20 20 2d 2d 20 52 65 NOT NULL -- Re
5320: 73 74 72 69 63 74 20 74 6f 20 6e 6f 6e 2d 6c 65 strict to non-le
5330: 61 76 65 73 0a 09 09 41 4e 44 20 20 20 20 52 2e aves...AND R.
5340: 63 68 69 6c 64 20 3d 20 43 2e 72 69 64 20 20 20 child = C.rid
5350: 20 20 20 2d 2d 20 47 65 74 20 63 68 69 6c 64 20 -- Get child
5360: 28 68 61 73 20 74 6f 20 65 78 69 73 74 29 0a 09 (has to exist)..
5370: 09 41 4e 44 20 20 20 20 43 2e 6c 6f 64 20 21 3d .AND C.lod !=
5380: 20 52 2e 6c 6f 64 20 20 20 20 20 20 20 2d 2d 20 R.lod --
5390: 77 68 69 63 68 20 69 6d 70 72 6f 70 65 72 6c 79 which improperly
53a0: 20 75 73 65 73 20 61 20 64 69 66 66 65 72 65 6e uses a differen
53b0: 74 20 4c 4f 44 0a 09 09 3b 0a 09 20 20 20 20 7d t LOD...;.. }
53c0: 0a 09 23 20 46 69 6e 64 20 61 6c 6c 20 72 65 76 ..# Find all rev
53d0: 69 73 69 6f 6e 73 20 77 69 74 68 20 61 20 6e 6f isions with a no
53e0: 6e 2d 4e 54 44 42 20 63 68 69 6c 64 20 77 68 69 n-NTDB child whi
53f0: 63 68 20 61 67 72 65 65 73 20 61 62 6f 75 74 0a ch agrees about.
5400: 09 23 20 74 68 65 20 6c 69 6e 65 20 6f 66 20 64 .# the line of d
5410: 65 76 65 6c 6f 70 6d 65 6e 74 20 74 68 65 79 20 evelopment they
5420: 62 65 6c 6f 6e 67 20 74 6f 2e 0a 09 43 68 65 63 belong to...Chec
5430: 6b 20 5c 0a 09 20 20 20 20 7b 4e 54 44 42 20 61 k \.. {NTDB a
5440: 6e 64 20 74 72 75 6e 6b 20 72 65 76 69 73 69 6f nd trunk revisio
5450: 6e 73 20 68 61 76 65 20 74 6f 20 62 65 20 69 6e ns have to be in
5460: 20 64 69 66 66 65 72 65 6e 74 20 4c 4f 44 73 7d different LODs}
5470: 20 5c 0a 09 20 20 20 20 7b 6f 6e 20 4e 54 44 42 \.. {on NTDB
5480: 20 61 6e 64 20 69 74 73 20 6e 6f 6e 2d 4e 54 44 and its non-NTD
5490: 42 20 63 68 69 6c 64 20 77 72 6f 6e 67 6c 79 20 B child wrongly
54a0: 61 67 72 65 65 20 61 62 6f 75 74 20 74 68 65 69 agree about thei
54b0: 72 20 4c 4f 44 7d 20 7b 0a 09 09 53 45 4c 45 43 r LOD} {...SELEC
54c0: 54 20 46 2e 6e 61 6d 65 2c 20 52 2e 72 65 76 0a T F.name, R.rev.
54d0: 09 09 46 52 4f 4d 20 20 20 72 65 76 69 73 69 6f ..FROM revisio
54e0: 6e 20 52 2c 20 72 65 76 69 73 69 6f 6e 20 43 2c n R, revision C,
54f0: 20 66 69 6c 65 20 46 0a 09 09 57 48 45 52 45 20 file F...WHERE
5500: 20 52 2e 66 69 64 20 3d 20 46 2e 66 69 64 20 20 R.fid = F.fid
5510: 20 20 20 20 20 20 20 20 2d 2d 20 47 65 74 20 66 -- Get f
5520: 69 6c 65 20 6f 66 20 72 65 76 69 73 69 6f 6e 0a ile of revision.
5530: 09 09 41 4e 44 20 20 20 20 52 2e 64 62 63 68 69 ..AND R.dbchi
5540: 6c 64 20 49 53 20 4e 4f 54 20 4e 55 4c 4c 20 20 ld IS NOT NULL
5550: 2d 2d 20 52 65 73 74 72 69 63 74 20 74 6f 20 73 -- Restrict to s
5560: 65 6d 69 2d 6c 61 73 74 20 4e 54 44 42 20 72 65 emi-last NTDB re
5570: 76 69 73 69 6f 6e 0a 09 09 41 4e 44 20 20 20 20 vision...AND
5580: 52 2e 64 62 63 68 69 6c 64 20 3d 20 43 2e 72 69 R.dbchild = C.ri
5590: 64 20 20 20 20 20 20 2d 2d 20 47 65 74 20 61 73 d -- Get as
55a0: 73 6f 63 69 61 74 65 64 20 74 72 75 6e 6b 20 72 sociated trunk r
55b0: 6f 6f 74 20 72 65 76 69 73 69 6f 6e 0a 09 09 41 oot revision...A
55c0: 4e 44 20 20 20 20 43 2e 6c 6f 64 20 3d 20 52 2e ND C.lod = R.
55d0: 6c 6f 64 20 20 20 20 20 20 20 20 20 20 2d 2d 20 lod --
55e0: 49 6d 70 72 6f 70 65 72 6c 79 20 75 73 65 73 20 Improperly uses
55f0: 74 68 65 20 73 61 6d 65 20 4c 4f 44 0a 09 09 3b the same LOD...;
5600: 0a 09 20 20 20 20 7d 0a 09 23 20 46 69 6e 64 20 .. }..# Find
5610: 61 6c 6c 20 72 65 76 69 73 69 6f 6e 73 20 77 69 all revisions wi
5620: 74 68 20 61 20 62 72 61 6e 63 68 20 70 61 72 65 th a branch pare
5630: 6e 74 20 73 79 6d 62 6f 6c 20 77 68 69 63 68 20 nt symbol which
5640: 69 73 20 6e 6f 74 0a 09 23 20 74 68 65 69 72 20 is not..# their
5650: 4c 4f 44 2e 0a 09 43 68 65 63 6b 20 5c 0a 09 20 LOD...Check \..
5660: 20 20 20 7b 42 72 61 6e 63 68 20 73 74 61 72 74 {Branch start
5670: 69 6e 67 20 72 65 76 69 73 69 6f 6e 73 20 68 61 ing revisions ha
5680: 76 65 20 74 6f 20 68 61 76 65 20 74 68 65 69 72 ve to have their
5690: 20 4c 4f 44 20 61 73 20 62 72 61 6e 63 68 20 70 LOD as branch p
56a0: 61 72 65 6e 74 20 73 79 6d 62 6f 6c 7d 20 5c 0a arent symbol} \.
56b0: 09 20 20 20 20 7b 61 74 20 74 68 65 20 62 65 67 . {at the beg
56c0: 69 6e 6e 69 6e 67 20 6f 66 20 69 74 73 20 62 72 inning of its br
56d0: 61 6e 63 68 20 64 6f 65 73 20 6e 6f 74 20 68 61 anch does not ha
56e0: 76 65 20 74 68 65 20 62 72 61 6e 63 68 20 73 79 ve the branch sy
56f0: 6d 62 6f 6c 20 61 73 20 69 74 73 20 4c 4f 44 7d mbol as its LOD}
5700: 20 7b 0a 09 09 53 45 4c 45 43 54 20 46 2e 6e 61 {...SELECT F.na
5710: 6d 65 2c 20 52 2e 72 65 76 0a 09 09 46 52 4f 4d me, R.rev...FROM
5720: 20 20 20 72 65 76 69 73 69 6f 6e 20 52 2c 20 66 revision R, f
5730: 69 6c 65 20 46 0a 09 09 57 48 45 52 45 20 20 52 ile F...WHERE R
5740: 2e 66 69 64 20 3d 20 46 2e 66 69 64 20 20 20 20 .fid = F.fid
5750: 20 20 20 20 20 20 2d 2d 20 47 65 74 20 66 69 6c -- Get fil
5760: 65 20 6f 66 20 72 65 76 69 73 69 6f 6e 0a 09 09 e of revision...
5770: 41 4e 44 20 20 20 20 52 2e 62 70 61 72 65 6e 74 AND R.bparent
5780: 20 49 53 20 4e 4f 54 20 4e 55 4c 4c 20 20 2d 2d IS NOT NULL --
5790: 20 52 65 73 74 72 69 63 74 20 74 6f 20 72 65 76 Restrict to rev
57a0: 69 73 69 6f 6e 73 20 66 69 72 73 74 20 6f 6e 20 isions first on
57b0: 61 20 62 72 61 6e 63 68 0a 09 09 41 4e 44 20 20 a branch...AND
57c0: 20 20 52 2e 6c 6f 64 20 21 3d 20 52 2e 62 70 61 R.lod != R.bpa
57d0: 72 65 6e 74 20 20 20 20 20 2d 2d 20 61 6e 64 20 rent -- and
57e0: 74 68 65 69 72 20 62 72 61 6e 63 68 20 69 73 20 their branch is
57f0: 6e 6f 74 20 74 68 65 69 72 20 4c 4f 44 0a 09 09 not their LOD...
5800: 3b 0a 09 20 20 20 20 7d 0a 09 23 20 46 69 6e 64 ;.. }..# Find
5810: 20 61 6c 6c 20 72 65 76 69 73 69 6f 6e 73 20 77 all revisions w
5820: 69 74 68 20 61 20 62 72 61 6e 63 68 20 70 61 72 ith a branch par
5830: 65 6e 74 20 73 79 6d 62 6f 6c 20 77 68 6f 73 65 ent symbol whose
5840: 20 70 61 72 65 6e 74 0a 09 23 20 69 73 20 69 6e parent..# is in
5850: 20 74 68 65 20 73 61 6d 65 20 6c 69 6e 65 20 6f the same line o
5860: 66 20 64 65 76 65 6c 6f 70 6d 65 6e 74 2e 0a 09 f development...
5870: 43 68 65 63 6b 20 5c 0a 09 20 20 20 20 7b 52 65 Check \.. {Re
5880: 76 69 73 69 6f 6e 73 20 61 6e 64 20 74 68 65 69 visions and thei
5890: 72 20 62 72 61 6e 63 68 20 63 68 69 6c 64 72 65 r branch childre
58a0: 6e 20 68 61 76 65 20 74 6f 20 62 65 20 69 6e 20 n have to be in
58b0: 64 69 66 66 65 72 65 6e 74 20 4c 4f 44 73 7d 20 different LODs}
58c0: 5c 0a 09 20 20 20 20 7b 61 74 20 74 68 65 20 62 \.. {at the b
58d0: 65 67 69 6e 6e 69 6e 67 20 6f 66 20 69 74 73 20 eginning of its
58e0: 62 72 61 6e 63 68 20 61 6e 64 20 69 74 73 20 70 branch and its p
58f0: 61 72 65 6e 74 20 77 72 6f 6e 67 6c 79 20 61 67 arent wrongly ag
5900: 72 65 65 20 61 62 6f 75 74 20 74 68 65 69 72 20 ree about their
5910: 4c 4f 44 7d 20 7b 0a 09 09 53 45 4c 45 43 54 20 LOD} {...SELECT
5920: 46 2e 6e 61 6d 65 2c 20 52 2e 72 65 76 0a 09 09 F.name, R.rev...
5930: 46 52 4f 4d 20 20 20 72 65 76 69 73 69 6f 6e 20 FROM revision
5940: 52 2c 20 72 65 76 69 73 69 6f 6e 20 50 2c 20 66 R, revision P, f
5950: 69 6c 65 20 46 0a 09 09 57 48 45 52 45 20 20 52 ile F...WHERE R
5960: 2e 66 69 64 20 3d 20 46 2e 66 69 64 20 20 20 20 .fid = F.fid
5970: 20 20 20 20 20 20 2d 2d 20 47 65 74 20 66 69 6c -- Get fil
5980: 65 20 6f 66 20 72 65 76 69 73 69 6f 6e 0a 09 09 e of revision...
5990: 41 4e 44 20 20 20 20 52 2e 62 70 61 72 65 6e 74 AND R.bparent
59a0: 20 49 53 20 4e 4f 54 20 4e 55 4c 4c 20 20 2d 2d IS NOT NULL --
59b0: 20 52 65 73 74 72 69 63 74 20 74 6f 20 72 65 76 Restrict to rev
59c0: 69 73 69 6f 6e 73 20 66 69 72 73 74 20 6f 6e 20 isions first on
59d0: 61 20 62 72 61 6e 63 68 0a 09 09 41 4e 44 20 20 a branch...AND
59e0: 20 20 52 2e 70 61 72 65 6e 74 20 3d 20 50 2e 72 R.parent = P.r
59f0: 69 64 20 20 20 20 20 20 20 2d 2d 20 47 65 74 20 id -- Get
5a00: 74 68 65 69 72 20 6e 6f 6e 2d 62 72 61 6e 63 68 their non-branch
5a10: 20 70 61 72 65 6e 74 0a 09 09 41 4e 44 20 20 20 parent...AND
5a20: 20 52 2e 6c 6f 64 20 3d 20 50 2e 6c 6f 64 20 20 R.lod = P.lod
5a30: 20 20 20 20 20 20 20 20 2d 2d 20 57 68 69 63 68 -- Which
5a40: 20 69 6d 70 72 6f 70 65 72 6c 79 20 75 73 65 73 improperly uses
5a50: 20 74 68 65 20 73 61 6d 65 20 4c 4f 44 0a 09 09 the same LOD...
5a60: 3b 0a 09 20 20 20 20 7d 0a 09 72 65 74 75 72 6e ;.. }..return
5a70: 0a 20 20 20 20 7d 0a 0a 20 20 20 20 70 72 6f 63 . }.. proc
5a80: 20 43 68 65 63 6b 20 7b 68 65 61 64 65 72 20 6c Check {header l
5a90: 61 62 65 6c 20 73 71 6c 7d 20 7b 0a 09 75 70 76 abel sql} {..upv
5aa0: 61 72 20 31 20 6e 20 6e 0a 09 73 65 74 20 6f 6b ar 1 n n..set ok
5ab0: 20 31 0a 09 66 6f 72 65 61 63 68 20 7b 66 6e 61 1..foreach {fna
5ac0: 6d 65 20 72 65 76 6e 72 7d 20 5b 73 74 61 74 65 me revnr} [state
5ad0: 20 72 75 6e 20 24 73 71 6c 5d 20 7b 0a 09 20 20 run $sql] {..
5ae0: 20 20 73 65 74 20 6f 6b 20 30 0a 09 20 20 20 20 set ok 0..
5af0: 74 72 6f 75 62 6c 65 20 66 61 74 61 6c 20 22 24 trouble fatal "$
5b00: 66 6e 61 6d 65 20 3c 24 72 65 76 6e 72 3e 20 24 fname <$revnr> $
5b10: 6c 61 62 65 6c 22 0a 09 7d 0a 09 6c 6f 67 20 77 label"..}..log w
5b20: 72 69 74 65 20 35 20 63 6f 6c 6c 72 65 76 20 22 rite 5 collrev "
5b30: 5c 5b 5b 66 6f 72 6d 61 74 20 25 30 32 64 20 5b \[[format %02d [
5b40: 69 6e 63 72 20 6e 5d 5d 5c 5d 20 5b 65 78 70 72 incr n]]\] [expr
5b50: 20 7b 24 6f 6b 20 3f 20 22 4f 6b 20 20 20 20 22 {$ok ? "Ok "
5b60: 20 3a 20 22 46 61 69 6c 65 64 22 7d 5d 20 2e 2e : "Failed"}] ..
5b70: 2e 20 24 68 65 61 64 65 72 22 0a 09 72 65 74 75 . $header"..retu
5b80: 72 6e 0a 20 20 20 20 7d 0a 0a 20 20 20 20 23 20 rn. }.. #
5b90: 23 20 23 23 20 23 23 23 20 23 23 23 23 23 20 23 # ## ### ##### #
5ba0: 23 23 23 23 23 23 23 20 23 23 23 23 23 23 23 23 ####### ########
5bb0: 23 23 23 23 23 0a 20 20 20 20 23 23 20 49 6e 74 #####. ## Int
5bc0: 65 72 6e 61 6c 20 6d 65 74 68 6f 64 73 0a 0a 20 ernal methods..
5bd0: 20 20 20 23 20 23 20 23 23 20 23 23 23 20 23 23 # # ## ### ##
5be0: 23 23 23 20 23 23 23 23 23 23 23 23 20 23 23 23 ### ######## ###
5bf0: 23 23 23 23 23 23 23 23 23 23 0a 20 20 20 20 23 ##########. #
5c00: 23 20 43 6f 6e 66 69 67 75 72 61 74 69 6f 6e 0a # Configuration.
5c10: 0a 20 20 20 20 70 72 61 67 6d 61 20 2d 68 61 73 . pragma -has
5c20: 69 6e 73 74 61 6e 63 65 73 20 20 20 6e 6f 20 3b instances no ;
5c30: 20 23 20 73 69 6e 67 6c 65 74 6f 6e 0a 20 20 20 # singleton.
5c40: 20 70 72 61 67 6d 61 20 2d 68 61 73 74 79 70 65 pragma -hastype
5c50: 69 6e 66 6f 20 20 20 20 6e 6f 20 3b 20 23 20 6e info no ; # n
5c60: 6f 20 69 6e 74 72 6f 73 70 65 63 74 69 6f 6e 0a o introspection.
5c70: 20 20 20 20 70 72 61 67 6d 61 20 2d 68 61 73 74 pragma -hast
5c80: 79 70 65 64 65 73 74 72 6f 79 20 6e 6f 20 3b 20 ypedestroy no ;
5c90: 23 20 69 6d 6d 6f 72 74 61 6c 0a 0a 20 20 20 20 # immortal..
5ca0: 23 20 23 20 23 23 20 23 23 23 20 23 23 23 23 23 # # ## ### #####
5cb0: 20 23 23 23 23 23 23 23 23 20 23 23 23 23 23 23 ######## ######
5cc0: 23 23 23 23 23 23 23 0a 7d 0a 0a 6e 61 6d 65 73 #######.}..names
5cd0: 70 61 63 65 20 65 76 61 6c 20 3a 3a 76 63 3a 3a pace eval ::vc::
5ce0: 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a fossil::import::
5cf0: 63 76 73 3a 3a 70 61 73 73 20 7b 0a 20 20 20 20 cvs::pass {.
5d00: 6e 61 6d 65 73 70 61 63 65 20 65 78 70 6f 72 74 namespace export
5d10: 20 63 6f 6c 6c 72 65 76 0a 20 20 20 20 6e 61 6d collrev. nam
5d20: 65 73 70 61 63 65 20 65 76 61 6c 20 63 6f 6c 6c espace eval coll
5d30: 72 65 76 20 7b 0a 09 6e 61 6d 65 73 70 61 63 65 rev {..namespace
5d40: 20 69 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a 72 63 import ::vc::rc
5d50: 73 3a 3a 70 61 72 73 65 72 0a 09 6e 61 6d 65 73 s::parser..names
5d60: 70 61 63 65 20 69 6d 70 6f 72 74 20 3a 3a 76 63 pace import ::vc
5d70: 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 ::fossil::import
5d80: 3a 3a 63 76 73 3a 3a 72 65 70 6f 73 69 74 6f 72 ::cvs::repositor
5d90: 79 0a 09 6e 61 6d 65 73 70 61 63 65 20 69 6d 70 y..namespace imp
5da0: 6f 72 74 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c ort ::vc::fossil
5db0: 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 73 ::import::cvs::s
5dc0: 74 61 74 65 0a 09 6e 61 6d 65 73 70 61 63 65 20 tate..namespace
5dd0: 69 6d 70 6f 72 74 20 3a 3a 76 63 3a 3a 66 6f 73 import ::vc::fos
5de0: 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 sil::import::cvs
5df0: 3a 3a 69 6e 74 65 67 72 69 74 79 0a 09 6e 61 6d ::integrity..nam
5e00: 65 73 70 61 63 65 20 65 76 61 6c 20 70 72 6f 6a espace eval proj
5e10: 65 63 74 20 7b 0a 09 20 20 20 20 6e 61 6d 65 73 ect {.. names
5e20: 70 61 63 65 20 69 6d 70 6f 72 74 20 3a 3a 76 63 pace import ::vc
5e30: 3a 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 ::fossil::import
5e40: 3a 3a 63 76 73 3a 3a 70 72 6f 6a 65 63 74 3a 3a ::cvs::project::
5e50: 73 79 6d 0a 09 7d 0a 09 6e 61 6d 65 73 70 61 63 sym..}..namespac
5e60: 65 20 65 76 61 6c 20 66 69 6c 65 20 7b 0a 09 20 e eval file {..
5e70: 20 20 20 6e 61 6d 65 73 70 61 63 65 20 69 6d 70 namespace imp
5e80: 6f 72 74 20 3a 3a 76 63 3a 3a 66 6f 73 73 69 6c ort ::vc::fossil
5e90: 3a 3a 69 6d 70 6f 72 74 3a 3a 63 76 73 3a 3a 66 ::import::cvs::f
5ea0: 69 6c 65 3a 3a 72 65 76 0a 09 7d 0a 09 6e 61 6d ile::rev..}..nam
5eb0: 65 73 70 61 63 65 20 69 6d 70 6f 72 74 20 3a 3a espace import ::
5ec0: 76 63 3a 3a 74 6f 6f 6c 73 3a 3a 74 72 6f 75 62 vc::tools::troub
5ed0: 6c 65 0a 09 6e 61 6d 65 73 70 61 63 65 20 69 6d le..namespace im
5ee0: 70 6f 72 74 20 3a 3a 76 63 3a 3a 74 6f 6f 6c 73 port ::vc::tools
5ef0: 3a 3a 6c 6f 67 0a 09 6c 6f 67 20 72 65 67 69 73 ::log..log regis
5f00: 74 65 72 20 63 6f 6c 6c 72 65 76 0a 20 20 20 20 ter collrev.
5f10: 7d 0a 7d 0a 0a 23 20 23 20 23 23 20 23 23 23 20 }.}..# # ## ###
5f20: 23 23 23 23 23 20 23 23 23 23 23 23 23 23 20 23 ##### ######## #
5f30: 23 23 23 23 23 23 23 23 23 23 23 23 20 23 23 23 ############ ###
5f40: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
5f50: 23 23 0a 23 23 20 52 65 61 64 79 0a 0a 70 61 63 ##.## Ready..pac
5f60: 6b 61 67 65 20 70 72 6f 76 69 64 65 20 76 63 3a kage provide vc:
5f70: 3a 66 6f 73 73 69 6c 3a 3a 69 6d 70 6f 72 74 3a :fossil::import:
5f80: 3a 63 76 73 3a 3a 70 61 73 73 3a 3a 63 6f 6c 6c :cvs::pass::coll
5f90: 72 65 76 20 31 2e 30 0a 72 65 74 75 72 6e 0a rev 1.0.return.