Hex Artifact Content
Not logged in

Artifact ea7746207cc6bf4b8ba475123e25b52d19864d4c:

Wiki page [Import CVS Repositories] by anonymous on 2007-12-04 21:13:35.

0000: 44 20 32 30 30 37 2d 31 32 2d 30 34 54 32 31 3a  D 2007-12-04T21:
0010: 31 33 3a 33 35 0a 4c 20 49 6d 70 6f 72 74 5c 73  13:35.L Import\s
0020: 43 56 53 5c 73 52 65 70 6f 73 69 74 6f 72 69 65  CVS\sRepositorie
0030: 73 0a 50 20 30 37 38 38 37 62 62 64 61 38 39 66  s.P 07887bbda89f
0040: 36 35 30 61 62 31 62 37 63 37 36 66 64 39 37 62  650ab1b7c76fd97b
0050: 66 36 62 33 33 66 61 30 34 31 65 62 0a 55 20 61  f6b33fa041eb.U a
0060: 6e 6f 6e 79 6d 6f 75 73 0a 57 20 35 31 36 32 0a  nonymous.W 5162.
0070: 53 70 69 72 69 74 75 61 6c 20 61 6e 63 65 73 74  Spiritual ancest
0080: 6f 72 3a 20 5b 68 74 74 70 3a 2f 2f 63 76 73 32  or: [http://cvs2
0090: 73 76 6e 2e 74 69 67 72 69 73 2e 6f 72 67 2f 7c  svn.tigris.org/|
00a0: 63 76 73 32 73 76 6e 5d 2e 0d 0a 0d 0a 53 69 6d  cvs2svn].....Sim
00b0: 69 6c 61 72 69 74 69 65 73 3a 0d 0a 20 20 2a 20  ilarities:..  * 
00c0: 20 55 73 69 6e 67 20 69 64 65 6e 74 69 63 61 6c   Using identical
00d0: 20 68 69 67 68 6c 65 76 65 6c 20 61 72 63 68 69   highlevel archi
00e0: 74 65 63 74 75 72 65 20 28 70 61 73 73 2d 62 61  tecture (pass-ba
00f0: 73 65 64 29 0d 0a 20 20 2a 20 20 55 73 69 6e 67  sed)..  *  Using
0100: 20 73 6f 6d 65 20 73 70 65 63 69 66 69 63 20 61   some specific a
0110: 6c 67 6f 72 69 74 68 6d 73 20 28 67 72 61 70 68  lgorithms (graph
0120: 20 74 72 61 76 65 72 73 61 6c 29 2e 0d 0a 0d 0a   traversal).....
0130: 44 69 66 66 65 72 65 6e 63 65 73 3a 0d 0a 20 20  Differences:..  
0140: 2a 20 20 4e 6f 74 20 75 73 69 6e 67 20 61 6e 79  *  Not using any
0150: 20 6f 66 20 69 74 73 20 63 6f 64 65 20 28 44 69   of its code (Di
0160: 66 66 65 72 65 6e 74 20 6c 61 6e 67 75 61 67 65  fferent language
0170: 73 20 66 6f 72 20 6f 6e 65 20 74 68 69 6e 67 2c  s for one thing,
0180: 20 5b 68 74 74 70 3a 2f 2f 77 77 77 2e 70 79 74   [http://www.pyt
0190: 68 6f 6e 2e 6f 72 67 2f 7c 50 79 74 68 6f 6e 5d  hon.org/|Python]
01a0: 20 74 68 65 72 65 2c 20 5b 68 74 74 70 3a 2f 2f   there, [http://
01b0: 77 77 77 2e 74 63 6c 2e 74 6b 2f 7c 54 63 6c 5d  www.tcl.tk/|Tcl]
01c0: 20 68 65 72 65 29 2e 0d 0a 20 20 2a 20 20 50 65   here)...  *  Pe
01d0: 72 73 69 73 74 65 6e 74 20 73 74 61 74 65 20 63  rsistent state c
01e0: 6f 6d 70 6c 65 74 65 6c 79 20 64 69 66 66 65 72  ompletely differ
01f0: 65 6e 74 2c 20 75 73 69 6e 67 20 5b 68 74 74 70  ent, using [http
0200: 3a 2f 2f 77 77 77 2e 73 71 6c 69 74 65 2e 6f 72  ://www.sqlite.or
0210: 67 2f 7c 73 71 6c 69 74 65 5d 20 64 61 74 61 62  g/|sqlite] datab
0220: 61 73 65 20 66 6f 72 20 61 6c 6c 20 74 68 69 6e  ase for all thin
0230: 67 73 20 77 65 20 77 69 73 68 20 74 6f 20 6b 65  gs we wish to ke
0240: 65 70 20 62 65 74 77 65 65 6e 20 70 61 73 73 65  ep between passe
0250: 73 2e 0d 0a 0d 0a 53 74 61 74 75 73 3a 0d 0a 20  s.....Status:.. 
0260: 20 2a 20 20 50 61 73 73 20 43 6f 6c 6c 41 72 3a   *  Pass CollAr:
0270: 20 43 6f 6c 6c 65 63 74 20 61 72 63 68 69 76 65   Collect archive
0280: 73 20 2d 20 6f 6b 2e 0d 0a 20 20 2a 20 20 50 61  s - ok...  *  Pa
0290: 73 73 20 43 6f 6c 6c 52 65 76 3a 20 43 6f 6c 6c  ss CollRev: Coll
02a0: 65 63 74 20 72 65 76 69 73 69 6f 6e 73 2c 20 74  ect revisions, t
02b0: 61 67 73 2c 20 62 72 61 6e 63 68 65 73 20 28 66  ags, branches (f
02c0: 69 6c 65 20 6c 65 76 65 6c 29 20 2d 20 6f 6b 2e  ile level) - ok.
02d0: 0d 0a 20 20 2a 20 20 50 61 73 73 20 43 6f 6c 6c  ..  *  Pass Coll
02e0: 53 79 6d 3a 20 43 6f 6c 6c 61 74 65 20 73 79 6d  Sym: Collate sym
02f0: 62 6f 6c 20 28 70 72 6f 6a 65 63 74 20 6c 65 76  bol (project lev
0300: 65 6c 29 20 66 72 6f 6d 20 74 68 65 20 66 69 6c  el) from the fil
0310: 65 20 6c 65 76 65 6c 20 64 61 74 61 20 2d 20 6f  e level data - o
0320: 6b 2e 0d 0a 20 20 2a 20 20 50 61 73 73 20 46 69  k...  *  Pass Fi
0330: 6c 74 65 72 53 79 6d 3a 20 46 69 6c 74 65 72 20  lterSym: Filter 
0340: 73 79 6d 62 6f 6c 73 2c 20 65 78 63 6c 75 64 65  symbols, exclude
0350: 20 73 79 6d 62 6f 6c 73 20 61 6e 64 20 6c 69 6e   symbols and lin
0360: 65 73 20 6f 66 20 64 65 76 65 6c 6f 70 6d 65 6e  es of developmen
0370: 74 20 2d 20 6f 6b 2e 0d 0a 20 20 2a 20 20 50 61  t - ok...  *  Pa
0380: 73 73 20 49 6e 69 74 43 73 65 74 73 3a 20 43 72  ss InitCsets: Cr
0390: 65 61 74 65 20 69 6e 69 74 69 61 6c 20 63 68 61  eate initial cha
03a0: 6e 67 65 73 65 74 73 20 2d 20 6f 6b 2e 20 3c 62  ngesets - ok. <b
03b0: 3e 4d 65 6d 6f 72 79 20 48 6f 67 2c 20 53 6c 6f  >Memory Hog, Slo
03c0: 77 20 63 6f 6d 6d 69 74 3c 2f 62 3e 0d 0a 20 20  w commit</b>..  
03d0: 2a 20 20 50 61 73 73 20 43 73 65 74 44 65 70 73  *  Pass CsetDeps
03e0: 3a 20 43 6f 6d 70 75 74 65 20 63 68 61 6e 67 65  : Compute change
03f0: 73 65 74 20 64 65 70 65 6e 64 65 6e 63 69 65 73  set dependencies
0400: 20 66 72 6f 6d 20 72 65 76 69 73 69 6f 6e 20 64   from revision d
0410: 65 70 65 6e 64 65 6e 63 69 65 73 20 2d 20 6f 6b  ependencies - ok
0420: 2e 0d 0a 20 20 2a 20 20 50 61 73 73 20 42 72 65  ...  *  Pass Bre
0430: 61 6b 52 43 79 63 6c 65 3a 20 42 72 65 61 6b 20  akRCycle: Break 
0440: 63 79 63 6c 65 73 20 61 6d 6f 6e 67 20 72 65 76  cycles among rev
0450: 69 73 69 6f 6e 20 63 68 61 6e 67 65 73 65 74 73  ision changesets
0460: 20 2d 20 6f 6b 2e 0d 0a 20 20 2a 20 20 50 61 73   - ok...  *  Pas
0470: 73 20 52 65 76 54 6f 70 53 6f 72 74 3a 20 20 54  s RevTopSort:  T
0480: 6f 70 6f 6c 6f 67 69 63 61 6c 6c 79 20 73 6f 72  opologically sor
0490: 74 20 72 65 76 69 73 69 6f 6e 20 63 68 61 6e 67  t revision chang
04a0: 65 73 65 74 73 20 2d 20 6f 6b 2e 0d 0a 20 20 2a  esets - ok...  *
04b0: 20 20 50 61 73 73 20 42 72 65 61 6b 53 43 79 63    Pass BreakSCyc
04c0: 6c 65 3a 20 42 72 65 61 6b 20 63 79 63 6c 65 73  le: Break cycles
04d0: 20 61 6d 6f 6e 67 20 73 79 6d 62 6f 6c 20 63 68   among symbol ch
04e0: 61 6e 67 65 73 65 74 73 20 2d 20 6f 6b 2e 0d 0a  angesets - ok...
04f0: 20 20 2a 20 20 50 61 73 73 20 42 72 65 61 6b 41    *  Pass BreakA
0500: 43 79 63 6c 65 3a 20 42 72 65 61 6b 20 63 79 63  Cycle: Break cyc
0510: 6c 65 73 20 6f 76 65 72 20 61 6c 6c 20 63 68 61  les over all cha
0520: 6e 67 65 73 65 74 73 20 2d 20 3c 62 3e 4d 61 79  ngesets - <b>May
0530: 20 73 74 69 6c 6c 20 63 68 61 6e 67 65 20 74 68   still change th
0540: 65 20 6f 72 64 65 72 20 6f 66 20 72 65 76 69 73  e order of revis
0550: 69 6f 6e 20 63 68 61 6e 67 65 73 65 74 73 20 6f  ion changesets o
0560: 76 65 72 20 74 68 65 20 72 65 73 75 6c 74 20 6f  ver the result o
0570: 66 20 70 61 73 73 20 37 2e 3c 2f 62 3e 0d 0a 20  f pass 7.</b>.. 
0580: 20 2a 20 20 50 61 73 73 20 41 54 6f 70 53 6f 72   *  Pass ATopSor
0590: 74 3a 20 53 68 6f 75 6c 64 20 62 65 20 6f 6b 2e  t: Should be ok.
05a0: 0d 0a 0d 0a 50 61 73 73 65 73 20 74 6f 20 64 6f  ....Passes to do
05b0: 3a 0d 0a 20 20 2a 20 20 50 75 74 20 63 68 61 6e  :..  *  Put chan
05c0: 67 65 73 65 74 20 6f 72 64 65 72 20 66 72 6f 6d  geset order from
05d0: 20 74 68 65 20 74 6f 70 2e 73 6f 72 74 20 70 61   the top.sort pa
05e0: 73 73 65 73 20 61 6e 64 20 74 72 65 65 20 6f 66  sses and tree of
05f0: 20 73 79 6d 62 6f 6c 73 20 66 72 6f 6d 20 74 68   symbols from th
0600: 65 20 63 6f 6c 6c 7c 46 69 6c 74 65 72 53 79 6d  e coll|FilterSym
0610: 20 70 61 73 73 65 73 20 74 6f 67 65 74 68 65 72   passes together
0620: 20 69 6e 74 6f 20 61 20 74 72 65 65 20 6f 66 20   into a tree of 
0630: 63 68 61 6e 67 65 73 65 74 73 2e 20 4e 6f 74 65  changesets. Note
0640: 20 74 68 61 74 20 69 74 20 6d 69 67 68 74 20 6e   that it might n
0650: 6f 74 20 62 65 20 61 20 74 72 65 65 20 69 66 20  ot be a tree if 
0660: 74 68 65 72 65 20 69 73 20 61 6e 20 4e 54 44 42  there is an NTDB
0670: 20 61 72 6f 75 6e 64 2e 0d 0a 20 20 2a 20 20 50   around...  *  P
0680: 65 72 66 6f 72 6d 20 74 68 65 20 61 63 74 75 61  erform the actua
0690: 6c 20 69 6d 70 6f 72 74 2e 0d 0a 0d 0a 4e 6f 74  l import.....Not
06a0: 65 73 20 72 65 67 61 72 64 69 6e 67 20 74 68 65  es regarding the
06b0: 20 61 63 74 75 61 6c 20 69 6d 70 6f 72 74 3a 0d   actual import:.
06c0: 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 63 76 73 32 73  .<ul>..<li>cvs2s
06d0: 76 6e 20 69 73 20 65 69 74 68 65 72 20 73 6c 6f  vn is either slo
06e0: 77 2c 20 6f 72 20 68 75 6e 67 72 79 20 66 6f 72  w, or hungry for
06f0: 20 64 69 73 6b 73 70 61 63 65 2e 20 54 68 65 20   diskspace. The 
0700: 72 65 61 73 6f 6e 3a 20 49 74 20 69 73 20 69 6d  reason: It is im
0710: 70 6f 72 74 69 6e 67 20 63 68 61 6e 67 65 73 65  porting changese
0720: 74 20 62 79 20 63 68 61 6e 67 65 73 65 74 20 61  t by changeset a
0730: 6e 64 20 73 6f 20 68 61 73 20 74 6f 20 65 69 74  nd so has to eit
0740: 68 65 72 20 72 65 67 65 6e 65 72 61 74 65 20 74  her regenerate t
0750: 68 65 20 6e 65 65 64 65 64 20 72 65 76 69 73 69  he needed revisi
0760: 6f 6e 73 20 6f 66 20 74 68 65 20 66 69 6c 65 73  ons of the files
0770: 20 6f 6e 2d 64 65 6d 61 6e 64 20 6f 76 65 72 20   on-demand over 
0780: 61 6e 64 20 6f 76 65 72 2c 20 6f 72 20 69 74 20  and over, or it 
0790: 63 61 63 68 65 73 20 74 68 65 20 6e 65 65 64 65  caches the neede
07a0: 64 20 72 65 76 69 73 69 6f 6e 73 20 77 68 65 6e  d revisions when
07b0: 20 63 72 65 61 74 65 64 20 75 6e 74 69 6c 20 74   created until t
07c0: 68 65 20 6c 61 73 74 20 75 73 65 72 20 69 73 20  he last user is 
07d0: 67 6f 6e 65 2e 0d 0a 3c 2f 6c 69 3e 0d 0a 3c 6c  gone...</li>..<l
07e0: 69 3e 57 65 20 63 61 6e 20 64 6f 20 62 65 74 74  i>We can do bett
07f0: 65 72 2c 20 69 66 20 77 65 20 67 65 74 20 68 65  er, if we get he
0800: 6c 70 20 66 72 6f 6d 20 66 6f 73 73 69 6c 2e 20  lp from fossil. 
0810: 57 65 20 77 6f 75 6c 64 20 6e 65 65 64 20 63 6f  We would need co
0820: 6d 6d 61 6e 64 73 20 74 6f 20 70 65 72 66 6f 72  mmands to perfor
0830: 6d 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20  m the following 
0840: 61 63 74 69 6f 6e 73 3a 0d 0a 3c 75 6c 3e 0d 0a  actions:..<ul>..
0850: 3c 6c 69 3e 20 49 6d 70 6f 72 74 20 61 20 66 69  <li> Import a fi
0860: 6c 65 20 61 73 20 62 6c 6f 62 2c 20 72 65 74 75  le as blob, retu
0870: 72 6e 20 69 74 73 20 69 6e 74 65 72 6e 61 6c 20  rn its internal 
0880: 69 64 2e 0d 0a 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  id...</li>..<li>
0890: 20 44 65 6c 74 69 66 79 20 61 20 6b 6e 6f 77 6e   Deltify a known
08a0: 20 66 69 6c 65 20 72 65 73 70 65 63 74 69 76 65   file respective
08b0: 20 74 6f 20 61 20 73 65 63 6f 6e 64 20 6b 6e 6f   to a second kno
08c0: 77 6e 20 66 69 6c 65 2e 0d 0a 3c 2f 6c 69 3e 0d  wn file...</li>.
08d0: 0a 3c 6c 69 3e 20 47 65 6e 65 72 61 74 65 20 61  .<li> Generate a
08e0: 20 6d 61 6e 69 66 65 73 74 20 66 69 6c 65 20 66   manifest file f
08f0: 6f 72 20 61 20 6c 69 73 74 20 6f 66 20 66 69 6c  or a list of fil
0900: 65 73 20 28 70 61 74 68 73 2c 20 69 64 73 29 2c  es (paths, ids),
0910: 20 70 61 72 65 6e 74 20 6d 61 6e 69 66 65 73 74   parent manifest
0920: 20 72 65 66 65 72 65 6e 63 65 73 2c 20 75 73 65   references, use
0930: 72 2c 20 74 69 6d 65 73 74 61 6d 70 2c 20 6c 6f  r, timestamp, lo
0940: 67 20 6d 65 73 73 61 67 65 2e 20 43 6f 75 6c 64  g message. Could
0950: 20 62 65 20 73 69 67 6e 65 64 20 6f 72 20 6e 6f   be signed or no
0960: 74 2e 0d 0a 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e  t...</li>..</ul>
0970: 0d 0a 3c 62 72 3e 0d 0a 57 69 74 68 20 74 68 65  ..<br>..With the
0980: 73 65 20 61 63 74 69 6f 6e 73 20 28 70 6f 73 73  se actions (poss
0990: 69 62 6c 65 20 69 6e 20 63 6f 6d 62 69 6e 61 74  ible in combinat
09a0: 69 6f 6e 29 20 77 65 20 63 61 6e 20 69 6d 70 6f  ion) we can impo
09b0: 72 74 20 74 68 65 20 61 72 63 68 69 76 65 20 66  rt the archive f
09c0: 69 6c 65 73 20 66 69 72 73 74 2c 20 6e 65 65 64  iles first, need
09d0: 69 6e 67 20 6f 6e 6c 79 20 73 70 61 63 65 20 66  ing only space f
09e0: 6f 72 20 74 68 65 20 72 65 76 69 73 69 6f 6e 73  or the revisions
09f0: 20 6f 66 20 61 20 73 69 6e 67 6c 65 20 66 69 6c   of a single fil
0a00: 65 20 28 62 6f 75 6e 64 65 64 20 62 79 20 74 68  e (bounded by th
0a10: 65 20 6c 61 72 67 65 73 74 20 66 69 6c 65 20 69  e largest file i
0a20: 6e 20 74 65 72 6d 73 20 6f 66 20 73 69 7a 65 20  n terms of size 
0a30: 61 6e 64 20 68 69 73 74 6f 72 79 29 2c 20 77 69  and history), wi
0a40: 74 68 20 74 68 65 69 72 20 64 65 6c 74 61 2d 6c  th their delta-l
0a50: 69 6e 6b 73 20 6d 69 72 72 6f 72 69 6e 67 20 74  inks mirroring t
0a60: 68 65 20 52 43 53 20 73 74 72 75 63 74 75 72 65  he RCS structure
0a70: 2e 20 41 66 74 65 72 20 74 68 61 74 20 77 65 20  . After that we 
0a80: 63 61 6e 20 69 6e 64 65 70 65 6e 64 65 6e 74 6c  can independentl
0a90: 79 20 67 65 6e 65 72 61 74 65 2c 20 69 6d 70 6f  y generate, impo
0aa0: 72 74 2c 20 61 6e 64 20 64 65 6c 74 69 66 79 20  rt, and deltify 
0ab0: 74 68 65 20 6d 61 6e 69 66 65 73 74 73 20 66 6f  the manifests fo
0ac0: 72 20 63 68 61 6e 67 65 73 65 74 73 2e 20 74 6f  r changesets. to
0ad0: 20 66 69 6e 61 6c 69 7a 65 20 77 65 20 73 69 6d   finalize we sim
0ae0: 70 6c 79 20 27 72 65 62 75 69 6c 64 27 20 74 68  ply 'rebuild' th
0af0: 65 20 72 65 70 6f 73 69 74 6f 72 79 2e 20 54 68  e repository. Th
0b00: 69 73 20 73 68 6f 75 6c 64 20 62 65 20 66 61 73  is should be fas
0b10: 74 20 77 69 74 68 6f 75 74 20 6e 65 65 64 69 6e  t without needin
0b20: 67 20 6d 75 63 68 20 74 65 6d 70 6f 72 61 72 79  g much temporary
0b30: 20 64 69 73 6b 20 73 70 61 63 65 20 65 69 74 68   disk space eith
0b40: 65 72 2e 0d 0a 3c 62 72 3e 0d 0a 43 75 72 72 65  er...<br>..Curre
0b50: 6e 74 6c 79 20 49 20 61 6d 20 74 68 69 6e 6b 69  ntly I am thinki
0b60: 6e 67 20 61 62 6f 75 74 20 77 61 6e 74 69 6e 67  ng about wanting
0b70: 20 61 20 63 6f 6d 6d 61 6e 64 0d 0a 3c 70 72 65   a command..<pre
0b80: 3e 0d 0a 66 6f 73 73 69 6c 20 69 6d 70 6f 72 74  >..fossil import
0b90: 2d 66 69 6c 65 73 20 53 50 45 43 46 49 4c 45 0d  -files SPECFILE.
0ba0: 0a 3c 2f 70 72 65 3e 0d 0a 77 68 69 63 68 20 69  .</pre>..which i
0bb0: 6d 70 6f 72 74 73 20 61 6e 64 20 64 65 6c 74 69  mports and delti
0bc0: 66 69 65 73 20 66 69 6c 65 73 20 61 73 20 62 6c  fies files as bl
0bd0: 6f 62 20 70 65 72 20 74 68 65 20 53 50 45 43 46  ob per the SPECF
0be0: 49 4c 45 2c 20 72 65 74 75 72 6e 69 6e 67 20 6f  ILE, returning o
0bf0: 6e 20 73 74 64 6f 75 74 20 74 68 65 20 61 73 73  n stdout the ass
0c00: 6f 63 69 61 74 65 64 20 6f 66 20 70 61 74 68 73  ociated of paths
0c10: 20 61 6e 64 20 69 6e 74 65 72 6e 61 6c 20 69 64   and internal id
0c20: 73 2e 20 45 78 61 6d 70 6c 65 20 53 50 45 43 46  s. Example SPECF
0c30: 49 4c 45 3a 0d 0a 3c 70 72 65 3e 0d 0a 46 20 70  ILE:..<pre>..F p
0c40: 61 74 68 31 0d 0a 44 20 70 61 74 68 32 20 70 61  ath1..D path2 pa
0c50: 74 68 31 0d 0a 2e 2e 2e 0d 0a 3c 2f 70 72 65 3e  th1.......</pre>
0c60: 0d 0a 54 68 65 20 27 46 27 20 63 61 72 64 20 74  ..The 'F' card t
0c70: 65 6c 6c 73 20 69 74 20 74 6f 20 69 6d 70 6f 72  ells it to impor
0c80: 74 20 27 70 61 74 68 31 27 20 61 73 20 69 73 2e  t 'path1' as is.
0c90: 20 54 68 65 20 27 44 27 20 63 61 72 64 20 74 68   The 'D' card th
0ca0: 65 6e 20 74 65 6c 6c 73 20 69 74 20 74 6f 20 69  en tells it to i
0cb0: 6d 70 6f 72 74 20 27 70 61 74 68 32 27 20 61 73  mport 'path2' as
0cc0: 20 69 73 20 61 6e 64 20 74 68 65 6e 20 64 65 6c   is and then del
0cd0: 74 69 66 79 20 27 70 61 74 68 31 27 20 69 6e 20  tify 'path1' in 
0ce0: 74 65 72 6d 73 20 6f 66 20 27 70 61 74 68 32 27  terms of 'path2'
0cf0: 2e 20 41 6e 64 20 73 6f 20 6f 6e 2e 0d 0a 3c 62  . And so on...<b
0d00: 72 3e 0d 0a 54 6f 20 69 6d 70 6f 72 74 20 61 6e  r>..To import an
0d10: 20 52 43 53 20 61 72 63 68 69 76 65 20 77 65 20   RCS archive we 
0d20: 6e 6f 77 20 6a 75 73 74 20 68 61 76 65 20 74 6f  now just have to
0d30: 20 67 65 6e 65 72 61 74 65 20 74 68 65 20 66 75   generate the fu
0d40: 6c 6c 20 72 65 76 69 73 69 6f 6e 73 20 69 6e 20  ll revisions in 
0d50: 73 6f 6d 65 20 74 65 6d 70 64 69 72 2c 20 74 68  some tempdir, th
0d60: 65 6e 20 63 72 65 61 74 65 20 61 20 53 50 45 43  en create a SPEC
0d70: 20 73 68 6f 77 69 6e 67 20 74 68 65 20 64 65 6c   showing the del
0d80: 74 61 2d 6c 69 6e 6b 73 20 61 6e 64 20 6c 65 74  ta-links and let
0d90: 20 66 6f 73 73 69 6c 20 68 61 76 65 20 74 68 69   fossil have thi
0da0: 73 2e 20 54 68 65 20 72 65 73 75 6c 74 69 6e 67  s. The resulting
0db0: 20 69 64 73 20 74 68 65 6e 20 67 6f 20 69 6e 74   ids then go int
0dc0: 6f 20 74 68 65 20 69 6d 70 6f 72 74 65 72 20 73  o the importer s
0dd0: 74 61 74 65 20 66 6f 72 20 77 68 65 6e 20 77 65  tate for when we
0de0: 20 67 65 6e 65 72 61 74 65 20 74 68 65 20 6d 61   generate the ma
0df0: 6e 69 66 65 73 74 73 2e 0d 0a 3c 62 72 3e 0d 0a  nifests...<br>..
0e00: 54 6f 20 69 6d 70 6f 72 74 20 6d 61 6e 69 66 65  To import manife
0e10: 73 74 73 20 77 65 20 6e 65 65 64 20 73 65 63 6f  sts we need seco
0e20: 6e 64 20 63 6f 6d 6d 61 6e 64 2c 20 77 68 69 63  nd command, whic
0e30: 68 20 67 65 6e 65 72 61 74 65 73 20 69 74 20 66  h generates it f
0e40: 72 6f 6d 20 63 68 61 6e 67 65 73 65 74 20 64 61  rom changeset da
0e50: 74 61 2c 20 61 6e 64 20 69 6d 70 6f 72 74 73 20  ta, and imports 
0e60: 69 74 20 74 6f 6f 2e 0d 0a 3c 70 72 65 3e 0d 0a  it too...<pre>..
0e70: 66 6f 73 73 69 6c 20 69 6d 70 6f 72 74 2d 6d 61  fossil import-ma
0e80: 6e 69 66 65 73 74 20 75 73 65 72 20 74 69 6d 65  nifest user time
0e90: 73 74 61 6d 70 20 4d 45 53 53 41 47 45 46 49 4c  stamp MESSAGEFIL
0ea0: 45 20 46 49 4c 45 46 49 4c 45 20 70 61 72 65 6e  E FILEFILE paren
0eb0: 74 2e 2e 2e 0d 0a 3c 2f 70 72 65 3e 0d 0a 54 68  t.....</pre>..Th
0ec0: 65 20 27 6d 65 73 73 61 67 65 66 69 6c 65 27 20  e 'messagefile' 
0ed0: 63 6f 6e 74 61 69 6e 73 20 74 68 65 20 6c 6f 67  contains the log
0ee0: 20 6d 65 73 73 61 67 65 2c 20 74 68 65 20 27 66   message, the 'f
0ef0: 69 6c 65 66 69 6c 65 27 20 6c 69 73 74 73 20 74  ilefile' lists t
0f00: 68 65 20 72 65 76 69 73 69 6f 6e 73 20 69 6e 20  he revisions in 
0f10: 74 68 65 20 6d 61 6e 69 66 65 73 74 20 62 79 20  the manifest by 
0f20: 69 64 2c 20 61 6e 64 20 77 69 74 68 20 70 61 74  id, and with pat
0f30: 68 20 69 6e 20 74 68 65 20 77 6f 72 6b 73 70 61  h in the workspa
0f40: 63 65 2e 20 54 68 65 20 70 61 72 65 6e 74 73 20  ce. The parents 
0f50: 61 72 65 20 74 68 65 20 69 64 73 20 6f 66 20 74  are the ids of t
0f60: 68 65 20 70 61 72 65 6e 74 20 6d 61 6e 69 66 65  he parent manife
0f70: 73 74 73 2e 20 54 68 65 20 72 65 73 75 6c 74 20  sts. The result 
0f80: 6f 66 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20 69  of the command i
0f90: 73 20 74 68 65 20 69 64 20 6f 66 20 74 68 65 20  s the id of the 
0fa0: 6e 65 77 20 6d 61 6e 69 66 65 73 74 2e 0d 0a 3c  new manifest...<
0fb0: 62 72 3e 0d 0a 4e 6f 74 65 3a 20 57 65 20 68 61  br>..Note: We ha
0fc0: 76 65 20 61 6c 72 65 61 64 79 20 63 6f 6d 6d 61  ve already comma
0fd0: 6e 64 73 20 66 6f 72 20 74 68 65 20 70 75 74 20  nds for the put 
0fe0: 61 6e 64 20 64 65 6c 74 69 66 79 20 6f 70 65 72  and deltify oper
0ff0: 61 74 69 6f 6e 73 2c 20 61 6c 62 65 69 74 20 75  ations, albeit u
1000: 6e 64 6f 63 75 6d 65 6e 74 65 64 2c 20 69 6e 20  ndocumented, in 
1010: 74 68 65 20 73 65 74 20 6f 66 20 74 65 73 74 20  the set of test 
1020: 63 6f 6d 6d 61 6e 64 73 2e 0d 0a 3c 2f 6c 69 3e  commands...</li>
1030: 0d 0a 3c 2f 75 6c 3e 0d 0a 0d 0a 4d 69 73 63 65  ..</ul>....Misce
1040: 6c 6c 61 6e 65 6f 75 73 3a 0d 0a 3c 75 6c 3e 0d  llaneous:..<ul>.
1050: 0a 3c 6c 69 3e 41 64 64 20 6f 70 74 69 6f 6e 20  .<li>Add option 
1060: 74 6f 20 61 6c 6c 6f 77 20 64 69 76 65 72 74 69  to allow diverti
1070: 6e 67 20 74 68 65 20 6c 6f 67 20 6f 75 74 70 75  ng the log outpu
1080: 74 20 69 6e 74 6f 20 61 20 66 69 6c 65 2c 20 65  t into a file, e
1090: 78 63 65 70 74 20 66 6f 72 20 74 68 65 20 70 72  xcept for the pr
10a0: 6f 67 72 65 73 73 20 72 65 70 6f 72 74 69 6e 67  ogress reporting
10b0: 2e 20 52 65 73 75 6c 74 20 69 73 20 6e 69 63 65  . Result is nice
10c0: 20 69 6e 74 65 72 61 63 74 69 76 65 20 6c 6f 67   interactive log
10d0: 20 2b 20 70 72 6f 67 72 65 73 73 2c 20 61 6e 64   + progress, and
10e0: 20 61 20 28 72 65 6c 61 74 69 76 65 6c 79 29 20   a (relatively) 
10f0: 73 6d 61 6c 6c 20 6c 6f 67 20 66 69 6c 65 20 77  small log file w
1100: 69 74 68 6f 75 74 20 61 6c 6c 20 74 68 65 20 75  ithout all the u
1110: 6e 77 61 6e 74 65 64 20 70 72 6f 67 72 65 73 73  nwanted progress
1120: 20 6e 75 6d 62 65 72 73 2e 0d 0a 3c 2f 6c 69 3e   numbers...</li>
1130: 0d 0a 3c 6c 69 3e 47 6f 20 6f 76 65 72 20 74 68  ..<li>Go over th
1140: 65 20 53 51 4c 20 73 74 61 74 65 6d 65 6e 74 73  e SQL statements
1150: 20 61 6e 64 20 63 68 65 63 6b 20 74 68 61 74 20   and check that 
1160: 74 68 65 79 20 68 61 76 65 20 67 6f 6f 64 20 71  they have good q
1170: 75 65 72 79 20 70 6c 61 6e 73 0d 0a 3c 2f 6c 69  uery plans..</li
1180: 3e 0d 0a 3c 6c 69 3e 47 6f 20 6f 76 65 72 20 74  >..<li>Go over t
1190: 68 65 20 53 51 4c 20 73 74 61 74 65 6d 65 6e 74  he SQL statement
11a0: 73 20 61 6e 64 20 61 64 64 20 63 6f 6d 6d 65 6e  s and add commen
11b0: 74 73 20 77 68 65 72 65 20 74 68 65 79 20 61 72  ts where they ar
11c0: 65 20 6e 6f 6e 2d 74 72 69 76 69 61 6c 2e 0d 0a  e non-trivial...
11d0: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 43 75 72 72 65  </li>..<li>Curre
11e0: 6e 74 6c 79 20 73 6f 6d 65 20 70 61 73 73 65 73  ntly some passes
11f0: 20 74 61 6b 65 20 71 75 69 74 65 20 61 20 62 69   take quite a bi
1200: 74 20 6f 66 20 74 69 6d 65 20 77 68 65 6e 20 74  t of time when t
1210: 68 65 69 72 20 61 63 74 75 61 6c 20 6f 70 65 72  heir actual oper
1220: 61 74 69 6f 6e 20 69 73 20 61 6c 72 65 61 64 79  ation is already
1230: 20 63 6f 6d 70 6c 65 74 65 2e 20 49 74 20 73 65   complete. It se
1240: 65 6d 73 20 74 68 61 74 20 73 71 6c 69 74 65 20  ems that sqlite 
1250: 69 73 20 68 65 61 76 69 6c 79 20 77 6f 72 6b 69  is heavily worki
1260: 6e 67 20 6f 6e 20 63 6f 6d 6d 69 74 74 69 6e 67  ng on committing
1270: 20 61 20 6c 6f 74 20 6f 66 20 63 68 61 6e 67 65   a lot of change
1280: 73 20 28 4d 6f 73 74 20 70 61 73 73 65 73 20 61  s (Most passes a
1290: 72 65 20 77 72 61 70 70 65 64 20 69 6e 74 6f 20  re wrapped into 
12a0: 61 20 73 69 6e 67 6c 65 20 74 72 61 6e 73 61 63  a single transac
12b0: 74 69 6f 6e 29 2e 20 43 6f 6e 73 69 64 65 72 20  tion). Consider 
12c0: 77 61 79 73 20 6f 66 20 73 70 65 65 64 69 6e 67  ways of speeding
12d0: 20 74 68 69 73 20 75 70 2e 0d 0a 3c 75 6c 3e 0d   this up...<ul>.
12e0: 0a 3c 6c 69 3e 44 6f 20 6f 75 72 20 6f 77 6e 20  .<li>Do our own 
12f0: 74 72 61 6e 73 61 63 74 69 6f 6e 20 6d 61 6e 61  transaction mana
1300: 67 65 6d 65 6e 74 3f 20 53 6f 20 74 68 61 74 20  gement? So that 
1310: 77 65 20 63 61 6e 20 63 6f 6d 6d 69 74 20 65 76  we can commit ev
1320: 65 72 79 20 58 20 63 68 61 6e 67 65 73 3f 2e 0d  ery X changes?..
1330: 0a 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 53 68 6f 75  .</li>..<li>Shou
1340: 6c 64 20 77 65 20 64 69 73 61 62 6c 65 20 73 79  ld we disable sy
1350: 6e 63 68 72 6f 6e 6f 75 73 20 6f 70 65 72 61 74  nchronous operat
1360: 69 6f 6e 3f 20 54 68 65 20 73 74 61 74 65 20 64  ion? The state d
1370: 61 74 61 62 61 73 65 20 69 73 20 6e 6f 74 20 74  atabase is not t
1380: 68 61 74 20 63 72 69 74 69 63 61 6c 2c 20 69 2e  hat critical, i.
1390: 65 2e 20 69 74 20 63 61 6e 20 61 6c 77 61 79 73  e. it can always
13a0: 20 62 65 20 72 65 67 65 6e 65 72 61 74 65 64 2e   be regenerated.
13b0: 20 4f 6e 20 74 68 65 20 6f 74 68 65 72 20 68 61   On the other ha
13c0: 6e 64 2c 20 62 65 69 6e 67 20 61 62 6c 65 20 74  nd, being able t
13d0: 6f 20 62 65 20 73 75 72 65 20 74 68 61 74 20 77  o be sure that w
13e0: 65 20 63 61 6e 20 72 65 73 74 61 72 74 20 66 72  e can restart fr
13f0: 6f 6d 20 74 68 65 20 69 6e 74 65 72 72 75 70 74  om the interrupt
1400: 65 64 20 70 61 73 73 20 69 73 20 6e 69 63 65 2c  ed pass is nice,
1410: 20 61 6e 64 20 6e 6f 74 20 70 6f 73 73 69 62 6c   and not possibl
1420: 65 20 69 66 20 77 65 20 67 6f 74 20 69 74 20 63  e if we got it c
1430: 6f 72 72 75 70 74 65 64 20 62 79 20 61 73 79 6e  orrupted by asyn
1440: 63 68 72 6f 6e 6f 75 73 20 6f 70 65 72 61 74 69  chronous operati
1450: 6f 6e 2e 20 3c 62 3e 54 61 62 6c 65 64 20 66 6f  on. <b>Tabled fo
1460: 72 20 6e 6f 77 2c 20 74 68 69 73 20 69 73 20 6e  r now, this is n
1470: 6f 74 20 79 65 74 20 63 72 69 74 69 63 61 6c 3c  ot yet critical<
1480: 2f 62 3e 0d 0a 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c  /b>..</li>..</ul
1490: 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 0a 5a 20 37 63 36  >..</ul>...Z 7c6
14a0: 66 39 38 34 38 65 63 62 31 61 64 30 35 34 38 36  f9848ecb1ad05486
14b0: 64 63 63 61 35 33 64 66 39 61 38 38 62 0a        dcca53df9a88b.