Hex Artifact Content
Not logged in

Artifact 03e4eaca4d0a0d00c4f5c15f16e95f21acceec6b:

File www/delta_format.wiki part of check-in [d87ca60c58] - initial ports of static .html to static /doc .wiki by stephan on 2008-05-15 20:25:46. Also file www/delta_format.wiki part of check-in [f94f7e5f49] - Merge the fork back together. by drh on 2008-05-16 00:27:49.

0000: 3c 68 31 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65  <h1 align="cente
0010: 72 22 3e 0a 46 6f 73 73 69 6c 20 44 65 6c 74 61  r">.Fossil Delta
0020: 20 46 6f 72 6d 61 74 0a 3c 2f 68 31 3e 0a 0a 3c   Format.</h1>..<
0030: 70 3e 41 20 6b 65 79 20 63 6f 6d 70 6f 6e 65 6e  p>A key componen
0040: 74 20 66 6f 72 20 74 68 65 20 65 66 66 69 63 69  t for the effici
0050: 65 6e 74 20 73 74 6f 72 61 67 65 20 6f 66 20 6d  ent storage of m
0060: 75 6c 74 69 70 6c 65 20 72 65 76 69 73 69 6f 6e  ultiple revision
0070: 73 20 6f 66 0a 61 20 66 69 6c 65 20 69 6e 20 66  s of.a file in f
0080: 6f 73 73 69 6c 20 72 65 70 6f 73 69 74 6f 72 69  ossil repositori
0090: 65 73 20 69 73 20 74 68 65 20 75 73 65 20 6f 66  es is the use of
00a0: 20 64 65 6c 74 61 2d 63 6f 6d 70 72 65 73 73 69   delta-compressi
00b0: 6f 6e 2c 20 69 2e 65 2e 20 74 6f 0a 73 74 6f 72  on, i.e. to.stor
00c0: 65 20 6f 6e 6c 79 20 74 68 65 20 63 68 61 6e 67  e only the chang
00d0: 65 73 20 62 65 74 77 65 65 6e 20 72 65 76 69 73  es between revis
00e0: 69 6f 6e 73 20 69 6e 73 74 65 61 64 20 6f 66 20  ions instead of 
00f0: 74 68 65 20 77 68 6f 6c 65 0a 66 69 6c 65 2e 3c  the whole.file.<
0100: 2f 70 3e 0a 0a 3c 70 3e 54 68 69 73 20 64 6f 63  /p>..<p>This doc
0110: 75 6d 65 6e 74 20 64 65 73 63 72 69 62 65 73 20  ument describes 
0120: 74 68 65 20 66 6f 72 6d 61 74 20 75 73 65 64 20  the format used 
0130: 74 6f 20 65 6e 63 6f 64 65 20 73 75 63 68 20 63  to encode such c
0140: 68 61 6e 67 65 73 2c 0a 61 6c 73 6f 20 6b 6e 6f  hanges,.also kno
0150: 77 6e 20 61 73 20 22 64 65 6c 74 61 22 2e 20 49  wn as "delta". I
0160: 74 20 69 73 20 74 61 72 67 65 74 65 64 20 61 74  t is targeted at
0170: 20 64 65 76 65 6c 6f 70 65 72 73 20 77 6f 72 6b   developers work
0180: 69 6e 67 20 6f 6e 20 65 69 74 68 65 72 0a 3c 61  ing on either.<a
0190: 20 68 72 65 66 3d 22 69 6e 64 65 78 2e 68 74 6d   href="index.htm
01a0: 6c 22 3e 66 6f 73 73 69 6c 3c 2f 61 3e 20 69 74  l">fossil</a> it
01b0: 73 65 6c 66 2c 20 6f 72 20 6f 6e 20 74 6f 6f 6c  self, or on tool
01c0: 73 20 63 6f 6d 70 61 74 69 62 6c 65 20 77 69 74  s compatible wit
01d0: 68 0a 69 74 2e 3c 2f 70 3e 0a 0a 3c 61 20 6e 61  h.it.</p>..<a na
01e0: 6d 65 3d 22 73 74 72 75 63 74 75 72 65 22 3e 3c  me="structure"><
01f0: 68 32 3e 31 2e 30 20 53 74 72 75 63 74 75 72 65  h2>1.0 Structure
0200: 3c 2f 68 32 3e 0a 3c 69 6d 67 20 73 72 63 3d 22  </h2>.<img src="
0210: 64 65 6c 74 61 31 2e 67 69 66 22 20 61 6c 69 67  delta1.gif" alig
0220: 6e 3d 22 6c 65 66 74 22 20 68 73 70 61 63 65 3d  n="left" hspace=
0230: 22 31 30 22 3e 0a 0a 3c 70 3e 41 20 64 65 6c 74  "10">..<p>A delt
0240: 61 20 63 6f 6e 73 69 73 74 73 20 6f 66 20 74 68  a consists of th
0250: 72 65 65 20 70 61 72 74 73 2c 20 61 20 22 68 65  ree parts, a "he
0260: 61 64 65 72 22 2c 20 61 20 22 74 72 61 69 6c 65  ader", a "traile
0270: 72 22 2c 20 61 6e 64 20 61 0a 22 73 65 67 6d 65  r", and a."segme
0280: 6e 74 2d 6c 69 73 74 22 20 62 65 74 77 65 65 6e  nt-list" between
0290: 20 74 68 65 6d 2e 3c 2f 70 3e 0a 0a 3c 70 3e 42   them.</p>..<p>B
02a0: 6f 74 68 20 68 65 61 64 65 72 20 61 6e 64 20 74  oth header and t
02b0: 72 61 69 6c 65 72 20 70 72 6f 76 69 64 65 20 69  railer provide i
02c0: 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 62 6f 75 74  nformation about
02d0: 20 74 68 65 20 74 61 72 67 65 74 0a 68 65 6c 70   the target.help
02e0: 69 6e 67 20 74 68 65 20 64 65 63 6f 64 65 72 2c  ing the decoder,
02f0: 20 61 6e 64 20 74 68 65 20 73 65 67 6d 65 6e 74   and the segment
0300: 2d 6c 69 73 74 20 64 65 73 63 72 69 62 65 73 20  -list describes 
0310: 68 6f 77 20 74 68 65 20 74 61 72 67 65 74 20 63  how the target c
0320: 61 6e 0a 62 65 20 63 6f 6e 73 74 72 75 63 74 65  an.be constructe
0330: 64 20 66 72 6f 6d 20 74 68 65 20 6f 72 69 67 69  d from the origi
0340: 6e 61 6c 2e 3c 2f 70 3e 0a 0a 3c 61 20 6e 61 6d  nal.</p>..<a nam
0350: 65 3d 22 68 65 61 64 65 72 22 3e 3c 68 33 3e 31  e="header"><h3>1
0360: 2e 31 20 48 65 61 64 65 72 3c 2f 68 33 3e 0a 3c  .1 Header</h3>.<
0370: 69 6d 67 20 73 72 63 3d 22 64 65 6c 74 61 36 2e  img src="delta6.
0380: 67 69 66 22 20 61 6c 69 67 6e 3d 22 6c 65 66 74  gif" align="left
0390: 22 20 68 73 70 61 63 65 3d 22 31 30 22 3e 0a 0a  " hspace="10">..
03a0: 3c 70 3e 54 68 65 20 68 65 61 64 65 72 20 63 6f  <p>The header co
03b0: 6e 73 69 73 74 73 20 6f 66 20 61 20 73 69 6e 67  nsists of a sing
03c0: 6c 65 20 6e 75 6d 62 65 72 20 66 6f 6c 6c 6f 77  le number follow
03d0: 65 64 20 62 79 20 61 20 6e 65 77 6c 69 6e 65 0a  ed by a newline.
03e0: 63 68 61 72 61 63 74 65 72 20 28 41 53 43 49 49  character (ASCII
03f0: 20 30 78 30 61 29 2e 20 54 68 65 20 6e 75 6d 62   0x0a). The numb
0400: 65 72 20 69 73 20 74 68 65 20 6c 65 6e 67 74 68  er is the length
0410: 20 6f 66 20 74 68 65 20 74 61 72 67 65 74 20 69   of the target i
0420: 6e 0a 62 79 74 65 73 2e 3c 2f 70 3e 0a 0a 3c 70  n.bytes.</p>..<p
0430: 3e 54 68 69 73 20 6d 65 61 6e 73 20 74 68 61 74  >This means that
0440: 2c 20 67 69 76 65 6e 20 61 20 64 65 6c 74 61 2c  , given a delta,
0450: 20 74 68 65 20 64 65 63 6f 64 65 72 20 63 61 6e   the decoder can
0460: 20 63 6f 6d 70 75 74 65 20 74 68 65 20 73 69 7a   compute the siz
0470: 65 20 6f 66 0a 74 68 65 20 74 61 72 67 65 74 20  e of.the target 
0480: 28 61 6e 64 20 61 6c 6c 6f 63 61 74 65 20 61 6e  (and allocate an
0490: 79 20 6e 65 63 65 73 73 61 72 79 20 6d 65 6d 6f  y necessary memo
04a0: 72 79 20 62 61 73 65 64 20 6f 6e 20 74 68 61 74  ry based on that
04b0: 29 20 62 79 20 73 69 6d 70 6c 79 0a 72 65 61 64  ) by simply.read
04c0: 69 6e 67 20 74 68 65 20 66 69 72 73 74 20 6c 69  ing the first li
04d0: 6e 65 20 6f 66 20 74 68 65 20 64 65 6c 74 61 20  ne of the delta 
04e0: 61 6e 64 20 64 65 63 6f 64 69 6e 67 20 74 68 65  and decoding the
04f0: 20 6e 75 6d 62 65 72 20 66 6f 75 6e 64 0a 74 68   number found.th
0500: 65 72 65 2e 20 49 6e 20 6f 74 68 65 72 20 77 6f  ere. In other wo
0510: 72 64 73 2c 20 62 65 66 6f 72 65 20 69 74 20 68  rds, before it h
0520: 61 73 20 74 6f 20 64 65 63 6f 64 65 20 65 76 65  as to decode eve
0530: 72 79 74 68 69 6e 67 20 65 6c 73 65 2e 3c 2f 70  rything else.</p
0540: 3e 0a 0a 3c 61 20 6e 61 6d 65 3d 22 74 72 61 69  >..<a name="trai
0550: 6c 65 72 22 3e 3c 68 33 3e 31 2e 32 20 54 72 61  ler"><h3>1.2 Tra
0560: 69 6c 65 72 3c 2f 68 33 3e 0a 3c 69 6d 67 20 73  iler</h3>.<img s
0570: 72 63 3d 22 64 65 6c 74 61 35 2e 67 69 66 22 20  rc="delta5.gif" 
0580: 61 6c 69 67 6e 3d 22 6c 65 66 74 22 20 68 73 70  align="left" hsp
0590: 61 63 65 3d 22 31 30 22 3e 0a 0a 3c 70 3e 54 68  ace="10">..<p>Th
05a0: 65 20 74 72 61 69 6c 65 72 20 63 6f 6e 73 69 73  e trailer consis
05b0: 74 73 20 6f 66 20 61 20 73 69 6e 67 6c 65 20 6e  ts of a single n
05c0: 75 6d 62 65 72 20 66 6f 6c 6c 6f 77 65 64 20 62  umber followed b
05d0: 79 20 61 20 73 65 6d 69 63 6f 6c 6f 6e 20 28 41  y a semicolon (A
05e0: 53 43 49 49 0a 30 78 33 62 29 2e 20 54 68 69 73  SCII.0x3b). This
05f0: 20 6e 75 6d 62 65 72 20 69 73 20 61 20 63 68 65   number is a che
0600: 63 6b 73 75 6d 20 6f 66 20 74 68 65 20 74 61 72  cksum of the tar
0610: 67 65 74 20 61 6e 64 20 63 61 6e 20 62 65 20 75  get and can be u
0620: 73 65 64 20 62 79 20 61 0a 64 65 63 6f 64 65 72  sed by a.decoder
0630: 20 74 6f 20 76 65 72 69 66 79 20 74 68 61 74 20   to verify that 
0640: 74 68 65 20 64 65 6c 74 61 20 61 70 70 6c 69 65  the delta applie
0650: 64 20 63 6f 72 72 65 63 74 6c 79 2c 20 72 65 63  d correctly, rec
0660: 6f 6e 73 74 72 75 63 74 69 6e 67 20 74 68 65 0a  onstructing the.
0670: 74 61 72 67 65 74 20 66 72 6f 6d 20 74 68 65 20  target from the 
0680: 6f 72 69 67 69 6e 61 6c 2e 3c 2f 70 3e 0a 0a 3c  original.</p>..<
0690: 70 3e 54 68 65 20 63 68 65 63 6b 73 75 6d 20 69  p>The checksum i
06a0: 73 20 63 6f 6d 70 75 74 65 64 20 62 79 20 74 72  s computed by tr
06b0: 65 61 74 69 6e 67 20 74 68 65 20 74 61 72 67 65  eating the targe
06c0: 74 20 61 73 20 61 20 73 65 72 69 65 73 20 6f 66  t as a series of
06d0: 0a 33 32 2d 62 69 74 20 69 6e 74 65 67 65 72 20  .32-bit integer 
06e0: 6e 75 6d 62 65 72 73 20 28 4d 53 42 20 66 69 72  numbers (MSB fir
06f0: 73 74 29 2c 20 61 6e 64 20 73 75 6d 6d 69 6e 67  st), and summing
0700: 20 74 68 65 73 65 20 75 70 2c 20 6d 6f 64 75 6c   these up, modul
0710: 6f 0a 32 5e 33 32 2d 31 2e 20 41 20 74 61 72 67  o.2^32-1. A targ
0720: 65 74 20 77 68 6f 73 65 20 6c 65 6e 67 74 68 20  et whose length 
0730: 69 73 20 6e 6f 74 20 61 20 6d 75 6c 74 69 70 6c  is not a multipl
0740: 65 20 6f 66 20 34 20 69 73 20 70 61 64 64 65 64  e of 4 is padded
0750: 20 77 69 74 68 0a 30 2d 62 79 74 65 73 20 28 41   with.0-bytes (A
0760: 53 43 49 49 20 30 78 30 30 29 20 61 74 20 74 68  SCII 0x00) at th
0770: 65 20 65 6e 64 2e 3c 2f 70 3e 0a 0a 3c 70 3e 42  e end.</p>..<p>B
0780: 79 20 70 75 74 74 69 6e 67 20 74 68 69 73 20 69  y putting this i
0790: 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 74 20 74 68  nformation at th
07a0: 65 20 65 6e 64 20 6f 66 20 74 68 65 20 64 65 6c  e end of the del
07b0: 74 61 20 61 20 64 65 63 6f 64 65 72 20 68 61 73  ta a decoder has
07c0: 0a 69 74 20 61 76 61 69 6c 61 62 6c 65 20 69 6d  .it available im
07d0: 6d 65 64 69 61 74 65 6c 79 20 61 66 74 65 72 20  mediately after 
07e0: 74 68 65 20 74 61 72 67 65 74 20 68 61 73 20 62  the target has b
07f0: 65 65 6e 20 72 65 63 6f 6e 73 74 72 75 63 74 65  een reconstructe
0800: 64 0a 66 75 6c 6c 79 2e 3c 2f 70 3e 0a 0a 3c 61  d.fully.</p>..<a
0810: 20 6e 61 6d 65 3d 22 73 6c 69 73 74 22 3e 3c 68   name="slist"><h
0820: 33 3e 31 2e 33 20 53 65 67 6d 65 6e 74 2d 4c 69  3>1.3 Segment-Li
0830: 73 74 3c 2f 68 33 3e 0a 3c 69 6d 67 20 73 72 63  st</h3>.<img src
0840: 3d 22 64 65 6c 74 61 32 2e 67 69 66 22 20 61 6c  ="delta2.gif" al
0850: 69 67 6e 3d 22 6c 65 66 74 22 20 68 73 70 61 63  ign="left" hspac
0860: 65 3d 22 31 30 22 3e 0a 0a 3c 70 3e 54 68 65 20  e="10">..<p>The 
0870: 73 65 67 6d 65 6e 74 2d 6c 69 73 74 20 6f 66 20  segment-list of 
0880: 61 20 64 65 6c 74 61 20 64 65 73 63 72 69 62 65  a delta describe
0890: 73 20 68 6f 77 20 74 6f 20 63 72 65 61 74 65 20  s how to create 
08a0: 74 68 65 20 74 61 72 67 65 74 20 66 72 6f 6d 0a  the target from.
08b0: 74 68 65 20 6f 72 69 67 69 6e 61 6c 20 62 79 20  the original by 
08c0: 61 20 63 6f 6d 62 69 6e 61 74 69 6f 6e 20 6f 66  a combination of
08d0: 20 69 6e 73 65 72 74 69 6e 67 20 6c 69 74 65 72   inserting liter
08e0: 61 6c 20 62 79 74 65 2d 73 65 71 75 65 6e 63 65  al byte-sequence
08f0: 73 20 61 6e 64 0a 63 6f 70 79 69 6e 67 20 72 61  s and.copying ra
0900: 6e 67 65 73 20 6f 66 20 62 79 74 65 73 20 66 72  nges of bytes fr
0910: 6f 6d 20 74 68 65 20 6f 72 69 67 69 6e 61 6c 2e  om the original.
0920: 20 54 68 69 73 20 69 73 20 74 68 65 72 65 20 74   This is there t
0930: 68 65 0a 63 6f 6d 70 72 65 73 73 69 6f 6e 20 74  he.compression t
0940: 61 6b 65 73 20 70 6c 61 63 65 2c 20 62 79 20 65  akes place, by e
0950: 6e 63 6f 64 69 6e 67 20 74 68 65 20 6c 61 72 67  ncoding the larg
0960: 65 20 63 6f 6d 6d 6f 6e 20 70 61 72 74 73 20 6f  e common parts o
0970: 66 0a 6f 72 69 67 69 6e 61 6c 20 61 6e 64 20 74  f.original and t
0980: 61 72 67 65 74 20 69 6e 20 73 6d 61 6c 6c 20 63  arget in small c
0990: 6f 70 79 20 69 6e 73 74 72 75 63 74 69 6f 6e 73  opy instructions
09a0: 2e 3c 2f 70 3e 0a 0a 3c 70 3e 54 68 65 20 74 61  .</p>..<p>The ta
09b0: 72 67 65 74 20 69 73 20 63 6f 6e 73 74 72 75 63  rget is construc
09c0: 74 65 64 20 66 72 6f 6d 20 62 65 67 69 6e 6e 69  ted from beginni
09d0: 6e 67 20 74 6f 20 65 6e 64 2c 20 77 69 74 68 20  ng to end, with 
09e0: 74 68 65 20 64 61 74 61 0a 67 65 6e 65 72 61 74  the data.generat
09f0: 65 64 20 62 79 20 65 61 63 68 20 69 6e 73 74 72  ed by each instr
0a00: 75 63 74 69 6f 6e 20 61 70 70 65 6e 64 65 64 20  uction appended 
0a10: 61 66 74 65 72 20 74 68 65 20 64 61 74 61 20 6f  after the data o
0a20: 66 20 61 6c 6c 20 70 72 65 76 69 6f 75 73 0a 69  f all previous.i
0a30: 6e 73 74 72 75 63 74 69 6f 6e 73 2c 20 77 69 74  nstructions, wit
0a40: 68 20 6e 6f 20 67 61 70 73 2e 3c 2f 70 3e 0a 0a  h no gaps.</p>..
0a50: 3c 61 20 6e 61 6d 65 3d 22 69 6e 73 65 72 74 6c  <a name="insertl
0a60: 69 74 22 3e 3c 68 34 3e 31 2e 33 2e 31 20 49 6e  it"><h4>1.3.1 In
0a70: 73 65 72 74 20 4c 69 74 65 72 61 6c 3c 2f 68 34  sert Literal</h4
0a80: 3e 0a 0a 3c 70 3e 41 20 6c 69 74 65 72 61 6c 20  >..<p>A literal 
0a90: 69 73 20 73 70 65 63 69 66 69 65 64 20 62 79 20  is specified by 
0aa0: 74 77 6f 20 65 6c 65 6d 65 6e 74 73 2c 20 74 68  two elements, th
0ab0: 65 20 73 69 7a 65 20 6f 66 20 74 68 65 20 6c 69  e size of the li
0ac0: 74 65 72 61 6c 20 69 6e 0a 62 79 74 65 73 2c 20  teral in.bytes, 
0ad0: 61 6e 64 20 74 68 65 20 62 79 74 65 73 20 6f 66  and the bytes of
0ae0: 20 74 68 65 20 6c 69 74 65 72 61 6c 20 69 74 73   the literal its
0af0: 65 6c 66 2e 3c 2f 70 3e 0a 0a 3c 69 6d 67 20 73  elf.</p>..<img s
0b00: 72 63 3d 22 64 65 6c 74 61 34 2e 67 69 66 22 20  rc="delta4.gif" 
0b10: 61 6c 69 67 6e 3d 22 6c 65 66 74 22 20 68 73 70  align="left" hsp
0b20: 61 63 65 3d 22 31 30 22 3e 0a 3c 70 3e 54 68 65  ace="10">.<p>The
0b30: 20 6c 65 6e 67 74 68 20 69 73 20 77 72 69 74 74   length is writt
0b40: 65 6e 20 66 69 72 73 74 2c 20 66 6f 6c 6c 6f 77  en first, follow
0b50: 65 64 20 62 79 20 61 20 63 6f 6c 6f 6e 20 63 68  ed by a colon ch
0b60: 61 72 61 63 74 65 72 20 28 41 53 43 49 49 0a 30  aracter (ASCII.0
0b70: 78 33 61 29 2c 20 66 6f 6c 6c 6f 77 65 64 20 62  x3a), followed b
0b80: 79 20 74 68 65 20 62 79 74 65 73 20 6f 66 20 74  y the bytes of t
0b90: 68 65 20 6c 69 74 65 72 61 6c 2e 3c 2f 70 3e 0a  he literal.</p>.
0ba0: 0a 3c 61 20 6e 61 6d 65 3d 22 63 6f 70 79 72 61  .<a name="copyra
0bb0: 6e 67 65 22 3e 3c 68 34 3e 31 2e 33 2e 32 20 43  nge"><h4>1.3.2 C
0bc0: 6f 70 79 20 52 61 6e 67 65 3c 2f 68 34 3e 0a 0a  opy Range</h4>..
0bd0: 3c 70 3e 41 20 72 61 6e 67 65 20 74 6f 20 63 6f  <p>A range to co
0be0: 70 79 20 69 73 20 73 70 65 63 69 66 69 65 64 20  py is specified 
0bf0: 62 79 20 74 77 6f 20 6e 75 6d 62 65 72 73 2c 20  by two numbers, 
0c00: 74 68 65 20 6f 66 66 73 65 74 20 6f 66 20 74 68  the offset of th
0c10: 65 0a 66 69 72 73 74 20 62 79 74 65 20 69 6e 20  e.first byte in 
0c20: 74 68 65 20 6f 72 69 67 69 6e 61 6c 20 74 6f 20  the original to 
0c30: 63 6f 70 79 2c 20 61 6e 64 20 74 68 65 20 73 69  copy, and the si
0c40: 7a 65 20 6f 66 20 74 68 65 20 72 61 6e 67 65 2c  ze of the range,
0c50: 20 69 6e 0a 62 79 74 65 73 2e 20 54 68 65 20 73   in.bytes. The s
0c60: 69 7a 65 20 7a 65 72 6f 20 69 73 20 73 70 65 63  ize zero is spec
0c70: 69 61 6c 2c 20 69 74 73 20 75 73 61 67 65 20 69  ial, its usage i
0c80: 6e 64 69 63 61 74 65 73 20 74 68 61 74 20 74 68  ndicates that th
0c90: 65 20 72 61 6e 67 65 0a 65 78 74 65 6e 64 73 20  e range.extends 
0ca0: 74 6f 20 74 68 65 20 65 6e 64 20 6f 66 20 74 68  to the end of th
0cb0: 65 20 6f 72 69 67 69 6e 61 6c 2e 3c 2f 70 3e 0a  e original.</p>.
0cc0: 0a 3c 69 6d 67 20 73 72 63 3d 22 64 65 6c 74 61  .<img src="delta
0cd0: 33 2e 67 69 66 22 20 61 6c 69 67 6e 3d 22 6c 65  3.gif" align="le
0ce0: 66 74 22 20 68 73 70 61 63 65 3d 22 31 30 22 3e  ft" hspace="10">
0cf0: 0a 3c 70 3e 54 68 65 20 6c 65 6e 67 74 68 20 69  .<p>The length i
0d00: 73 20 77 72 69 74 74 65 6e 20 66 69 72 73 74 2c  s written first,
0d10: 20 66 6f 6c 6c 6f 77 65 64 20 62 79 20 61 6e 20   followed by an 
0d20: 22 61 74 22 20 63 68 61 72 61 63 74 65 72 20 28  "at" character (
0d30: 41 53 43 49 49 0a 30 78 34 30 29 2c 20 74 68 65  ASCII.0x40), the
0d40: 6e 20 74 68 65 20 6f 66 66 73 65 74 2c 20 66 6f  n the offset, fo
0d50: 6c 6c 6f 77 65 64 20 62 79 20 61 20 63 6f 6d 6d  llowed by a comm
0d60: 61 20 28 41 53 43 49 49 20 30 78 32 63 29 2e 3c  a (ASCII 0x2c).<
0d70: 2f 70 3e 0a 0a 3c 61 20 6e 61 6d 65 3d 22 69 6e  /p>..<a name="in
0d80: 74 63 6f 64 69 6e 67 22 3e 3c 68 32 3e 32 2e 30  tcoding"><h2>2.0
0d90: 20 45 6e 63 6f 64 69 6e 67 20 6f 66 20 69 6e 74   Encoding of int
0da0: 65 67 65 72 73 3c 2f 68 32 3e 0a 0a 3c 70 3e 0a  egers</h2>..<p>.
0db0: 54 68 65 20 66 6f 72 6d 61 74 20 63 75 72 72 65  The format curre
0dc0: 6e 74 6c 79 20 68 61 6e 64 6c 65 73 20 6f 6e 6c  ntly handles onl
0dd0: 79 20 33 32 20 62 69 74 20 69 6e 74 65 67 65 72  y 32 bit integer
0de0: 20 6e 75 6d 62 65 72 73 2e 20 54 68 65 79 20 61   numbers. They a
0df0: 72 65 0a 77 72 69 74 74 65 6e 20 62 61 73 65 2d  re.written base-
0e00: 36 34 20 65 6e 63 6f 64 65 64 2c 20 4d 53 42 20  64 encoded, MSB 
0e10: 66 69 72 73 74 2c 20 61 6e 64 20 77 69 74 68 6f  first, and witho
0e20: 75 74 20 6c 65 61 64 69 6e 67 0a 22 30 22 2d 63  ut leading."0"-c
0e30: 68 61 72 61 63 74 65 72 73 2c 20 65 78 63 65 70  haracters, excep
0e40: 74 20 69 66 20 74 68 65 79 20 61 72 65 20 73 69  t if they are si
0e50: 67 6e 69 66 69 63 61 6e 74 20 28 69 2e 65 2e 20  gnificant (i.e. 
0e60: 30 20 3d 3e 20 22 30 22 29 2e 0a 3c 2f 70 3e 0a  0 => "0")..</p>.
0e70: 0a 3c 70 3e 0a 54 68 65 20 62 61 73 65 2d 36 34  .<p>.The base-64
0e80: 20 63 6f 64 69 6e 67 20 69 73 20 64 65 73 63 72   coding is descr
0e90: 69 62 65 64 20 69 6e 0a 3c 61 20 68 72 65 66 3d  ibed in.<a href=
0ea0: 22 68 74 74 70 3a 2f 2f 77 77 77 2e 69 65 74 66  "http://www.ietf
0eb0: 2e 6f 72 67 2f 72 66 63 2f 72 66 63 33 35 34 38  .org/rfc/rfc3548
0ec0: 2e 74 78 74 22 3e 52 46 43 20 33 35 34 38 3c 2f  .txt">RFC 3548</
0ed0: 61 3e 2e 0a 3c 2f 70 3e 0a 0a 3c 61 20 6e 61 6d  a>..</p>..<a nam
0ee0: 65 3d 22 65 78 61 6d 70 6c 65 73 22 3e 3c 68 32  e="examples"><h2
0ef0: 3e 33 2e 30 20 45 78 61 6d 70 6c 65 73 3c 2f 68  >3.0 Examples</h
0f00: 32 3e 0a 0a 3c 61 20 6e 61 6d 65 3d 22 65 78 61  2>..<a name="exa
0f10: 6d 70 6c 65 73 69 6e 74 22 3e 3c 68 33 3e 33 2e  mplesint"><h3>3.
0f20: 31 20 49 6e 74 65 67 65 72 20 65 6e 63 6f 64 69  1 Integer encodi
0f30: 6e 67 3c 2f 68 33 3e 0a 0a 3c 74 61 62 6c 65 20  ng</h3>..<table 
0f40: 62 6f 72 64 65 72 3d 31 3e 0a 3c 74 72 3e 0a 3c  border=1>.<tr>.<
0f50: 74 68 3e 56 61 6c 75 65 3c 2f 74 68 3e 0a 3c 74  th>Value</th>.<t
0f60: 68 3e 45 6e 63 6f 64 69 6e 67 3c 2f 74 68 3e 0a  h>Encoding</th>.
0f70: 3c 2f 74 72 3e 0a 3c 74 72 3e 0a 3c 74 64 3e 30  </tr>.<tr>.<td>0
0f80: 3c 2f 74 64 3e 0a 3c 74 64 3e 30 3c 2f 74 64 3e  </td>.<td>0</td>
0f90: 0a 3c 2f 74 72 3e 0a 3c 74 72 3e 0a 3c 74 64 3e  .</tr>.<tr>.<td>
0fa0: 36 32 34 36 3c 2f 74 64 3e 0a 3c 74 64 3e 31 58  6246</td>.<td>1X
0fb0: 62 3c 2f 74 64 3e 0a 3c 2f 74 72 3e 0a 3c 74 72  b</td>.</tr>.<tr
0fc0: 3e 0a 3c 74 64 3e 2d 31 31 30 31 34 33 38 37 37  >.<td>-110143877
0fd0: 30 3c 2f 74 64 3e 0a 3c 74 64 3e 32 7a 4d 4d 33  0</td>.<td>2zMM3
0fe0: 45 3c 2f 74 64 3e 0a 3c 2f 74 72 3e 0a 3c 2f 74  E</td>.</tr>.</t
0ff0: 61 62 6c 65 3e 0a 0a 3c 61 20 6e 61 6d 65 3d 22  able>..<a name="
1000: 65 78 61 6d 70 6c 65 73 64 65 6c 74 61 22 3e 3c  examplesdelta"><
1010: 68 33 3e 33 2e 32 20 44 65 6c 74 61 20 65 6e 63  h3>3.2 Delta enc
1020: 6f 64 69 6e 67 3c 2f 68 33 3e 0a 0a 3c 70 3e 41  oding</h3>..<p>A
1030: 6e 20 65 78 61 6d 70 6c 65 20 6f 66 20 61 20 64  n example of a d
1040: 65 6c 74 61 20 75 73 69 6e 67 20 74 68 65 20 73  elta using the s
1050: 70 65 63 69 66 69 65 64 20 65 6e 63 6f 64 69 6e  pecified encodin
1060: 67 20 69 73 3a 3c 2f 70 3e 0a 0a 3c 74 61 62 6c  g is:</p>..<tabl
1070: 65 20 62 6f 72 64 65 72 3d 31 3e 3c 74 72 3e 3c  e border=1><tr><
1080: 74 64 3e 3c 70 72 65 3e 0a 31 58 62 0a 34 45 40  td><pre>.1Xb.4E@
1090: 30 2c 32 3a 74 68 46 4e 40 34 43 2c 36 3a 73 63  0,2:thFN@4C,6:sc
10a0: 65 6e 64 61 31 42 40 4a 64 2c 36 3a 73 63 65 6e  enda1B@Jd,6:scen
10b0: 64 61 35 78 40 4b 74 2c 36 3a 70 69 65 63 65 73  da5x@Kt,6:pieces
10c0: 37 39 40 51 74 2c 46 3a 20 45 78 61 6d 70 6c 65  79@Qt,F: Example
10d0: 3a 20 65 73 6b 69 6c 7e 45 40 59 30 2c 32 7a 4d  : eskil~E@Y0,2zM
10e0: 4d 33 45 3b 3c 2f 70 72 65 3e 0a 3c 2f 74 64 3e  M3E;</pre>.</td>
10f0: 3c 2f 74 72 3e 3c 2f 74 61 62 6c 65 3e 0a 0a 3c  </tr></table>..<
1100: 70 3e 54 68 69 73 20 63 61 6e 20 62 65 20 74 61  p>This can be ta
1110: 6b 65 6e 20 61 70 61 72 74 20 69 6e 74 6f 20 74  ken apart into t
1120: 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 70 61 72  he following par
1130: 74 73 3a 3c 2f 70 3e 0a 0a 3c 74 61 62 6c 65 20  ts:</p>..<table 
1140: 62 6f 72 64 65 72 3d 31 3e 0a 3c 74 72 3e 3c 74  border=1>.<tr><t
1150: 68 3e 57 68 61 74 20 20 3c 2f 74 68 3e 20 3c 74  h>What  </th> <t
1160: 68 3e 45 6e 63 6f 64 69 6e 67 20 20 20 20 20 20  h>Encoding      
1170: 20 20 20 3c 2f 74 68 3e 3c 74 68 3e 4d 65 61 6e     </th><th>Mean
1180: 69 6e 67 20 3c 2f 74 68 3e 3c 74 68 3e 44 65 74  ing </th><th>Det
1190: 61 69 6c 73 3c 2f 74 68 3e 3c 2f 74 72 3e 0a 3c  ails</th></tr>.<
11a0: 74 72 3e 3c 74 64 3e 48 65 61 64 65 72 3c 2f 74  tr><td>Header</t
11b0: 64 3e 20 3c 74 64 3e 31 58 62 20 20 20 20 20 20  d> <td>1Xb      
11c0: 20 20 20 20 20 20 20 20 3c 2f 74 64 3e 3c 74 64          </td><td
11d0: 3e 53 69 7a 65 20 20 20 20 3c 2f 74 64 3e 3c 74  >Size    </td><t
11e0: 64 3e 20 36 32 34 36 09 20 20 20 20 20 3c 2f 74  d> 6246.     </t
11f0: 64 3e 3c 2f 74 72 3e 0a 3c 74 72 3e 3c 74 64 3e  d></tr>.<tr><td>
1200: 53 2d 4c 69 73 74 3c 2f 74 64 3e 20 3c 74 64 3e  S-List</td> <td>
1210: 34 45 40 30 2c 09 20 20 20 20 20 20 20 20 20 3c  4E@0,.         <
1220: 2f 74 64 3e 3c 74 64 3e 43 6f 70 79 20 20 20 20  /td><td>Copy    
1230: 3c 2f 74 64 3e 3c 74 64 3e 20 32 37 30 20 40 20  </td><td> 270 @ 
1240: 30 09 20 20 20 20 20 3c 2f 74 64 3e 3c 2f 74 72  0.     </td></tr
1250: 3e 0a 3c 74 72 3e 3c 74 64 3e 26 6e 62 73 70 3b  >.<tr><td>&nbsp;
1260: 3c 2f 74 64 3e 20 3c 74 64 3e 32 3a 74 68 09 20  </td> <td>2:th. 
1270: 20 20 20 20 20 20 20 20 3c 2f 74 64 3e 3c 74 64          </td><td
1280: 3e 4c 69 74 65 72 61 6c 20 3c 2f 74 64 3e 3c 74  >Literal </td><t
1290: 64 3e 20 32 20 27 74 68 27 09 20 20 20 20 20 3c  d> 2 'th'.     <
12a0: 2f 74 64 3e 3c 2f 74 72 3e 0a 3c 74 72 3e 3c 74  /td></tr>.<tr><t
12b0: 64 3e 26 6e 62 73 70 3b 3c 2f 74 64 3e 20 3c 74  d>&nbsp;</td> <t
12c0: 64 3e 46 4e 40 34 43 2c 09 20 20 20 20 20 20 20  d>FN@4C,.       
12d0: 20 20 3c 2f 74 64 3e 3c 74 64 3e 43 6f 70 79 20    </td><td>Copy 
12e0: 20 20 20 3c 2f 74 64 3e 3c 74 64 3e 20 39 38 33     </td><td> 983
12f0: 20 40 20 32 36 38 09 20 20 20 20 20 3c 2f 74 64   @ 268.     </td
1300: 3e 3c 2f 74 72 3e 0a 3c 74 72 3e 3c 74 64 3e 26  ></tr>.<tr><td>&
1310: 6e 62 73 70 3b 3c 2f 74 64 3e 20 3c 74 64 3e 36  nbsp;</td> <td>6
1320: 3a 73 63 65 6e 64 61 20 20 20 20 20 20 20 20 20  :scenda         
1330: 3c 2f 74 64 3e 3c 74 64 3e 4c 69 74 65 72 61 6c  </td><td>Literal
1340: 20 3c 2f 74 64 3e 3c 74 64 3e 20 36 20 27 73 63   </td><td> 6 'sc
1350: 65 6e 64 61 27 09 20 20 20 20 20 3c 2f 74 64 3e  enda'.     </td>
1360: 3c 2f 74 72 3e 0a 3c 74 72 3e 3c 74 64 3e 26 6e  </tr>.<tr><td>&n
1370: 62 73 70 3b 3c 2f 74 64 3e 20 3c 74 64 3e 31 42  bsp;</td> <td>1B
1380: 40 4a 64 2c 09 20 20 20 20 20 20 20 20 20 3c 2f  @Jd,.         </
1390: 74 64 3e 3c 74 64 3e 43 6f 70 79 20 20 20 20 3c  td><td>Copy    <
13a0: 2f 74 64 3e 3c 74 64 3e 20 37 35 20 40 20 31 32  /td><td> 75 @ 12
13b0: 35 36 09 20 20 20 20 20 3c 2f 74 64 3e 3c 2f 74  56.     </td></t
13c0: 72 3e 0a 3c 74 72 3e 3c 74 64 3e 26 6e 62 73 70  r>.<tr><td>&nbsp
13d0: 3b 3c 2f 74 64 3e 20 3c 74 64 3e 36 3a 73 63 65  ;</td> <td>6:sce
13e0: 6e 64 61 20 20 20 20 20 20 20 20 20 3c 2f 74 64  nda         </td
13f0: 3e 3c 74 64 3e 4c 69 74 65 72 61 6c 20 3c 2f 74  ><td>Literal </t
1400: 64 3e 3c 74 64 3e 20 36 20 27 73 63 65 6e 64 61  d><td> 6 'scenda
1410: 27 09 20 20 20 20 20 3c 2f 74 64 3e 3c 2f 74 72  '.     </td></tr
1420: 3e 0a 3c 74 72 3e 3c 74 64 3e 26 6e 62 73 70 3b  >.<tr><td>&nbsp;
1430: 3c 2f 74 64 3e 20 3c 74 64 3e 35 78 40 4b 74 2c  </td> <td>5x@Kt,
1440: 09 20 20 20 20 20 20 20 20 20 3c 2f 74 64 3e 3c  .         </td><
1450: 74 64 3e 43 6f 70 79 20 20 20 20 3c 2f 74 64 3e  td>Copy    </td>
1460: 3c 74 64 3e 20 33 38 30 20 40 20 31 33 33 36 09  <td> 380 @ 1336.
1470: 20 20 20 20 20 3c 2f 74 64 3e 3c 2f 74 72 3e 0a       </td></tr>.
1480: 3c 74 72 3e 3c 74 64 3e 26 6e 62 73 70 3b 3c 2f  <tr><td>&nbsp;</
1490: 74 64 3e 20 3c 74 64 3e 36 3a 70 69 65 63 65 73  td> <td>6:pieces
14a0: 09 20 3c 2f 74 64 3e 3c 74 64 3e 4c 69 74 65 72  . </td><td>Liter
14b0: 61 6c 20 3c 2f 74 64 3e 3c 74 64 3e 20 36 20 27  al </td><td> 6 '
14c0: 70 69 65 63 65 73 27 09 20 20 20 20 20 3c 2f 74  pieces'.     </t
14d0: 64 3e 3c 2f 74 72 3e 0a 3c 74 72 3e 3c 74 64 3e  d></tr>.<tr><td>
14e0: 26 6e 62 73 70 3b 3c 2f 74 64 3e 20 3c 74 64 3e  &nbsp;</td> <td>
14f0: 37 39 40 51 74 2c 09 20 20 20 20 20 20 20 20 20  79@Qt,.         
1500: 3c 2f 74 64 3e 3c 74 64 3e 43 6f 70 79 20 20 20  </td><td>Copy   
1510: 20 3c 2f 74 64 3e 3c 74 64 3e 20 34 35 37 20 40   </td><td> 457 @
1520: 20 31 37 32 30 20 20 20 20 20 3c 2f 74 64 3e 3c   1720     </td><
1530: 2f 74 72 3e 0a 3c 74 72 3e 3c 74 64 3e 26 6e 62  /tr>.<tr><td>&nb
1540: 73 70 3b 3c 2f 74 64 3e 20 3c 74 64 3e 46 3a 20  sp;</td> <td>F: 
1550: 45 78 61 6d 70 6c 65 3a 20 65 73 6b 69 6c 3c 2f  Example: eskil</
1560: 74 64 3e 3c 74 64 3e 4c 69 74 65 72 61 6c 20 3c  td><td>Literal <
1570: 2f 74 64 3e 3c 74 64 3e 20 31 35 20 27 20 45 78  /td><td> 15 ' Ex
1580: 61 6d 70 6c 65 3a 20 65 73 6b 69 6c 27 3c 2f 74  ample: eskil'</t
1590: 64 3e 3c 2f 74 72 3e 0a 3c 74 72 3e 3c 74 64 3e  d></tr>.<tr><td>
15a0: 26 6e 62 73 70 3b 3c 2f 74 64 3e 20 3c 74 64 3e  &nbsp;</td> <td>
15b0: 7e 45 40 59 30 2c 20 20 20 20 20 20 20 20 20 20  ~E@Y0,          
15c0: 20 3c 2f 74 64 3e 3c 74 64 3e 43 6f 70 79 20 20   </td><td>Copy  
15d0: 20 20 3c 2f 74 64 3e 3c 74 64 3e 20 20 34 30 34    </td><td>  404
15e0: 36 20 40 20 32 31 37 36 20 20 20 20 20 20 20 20  6 @ 2176        
15f0: 3c 2f 74 64 3e 3c 2f 74 72 3e 0a 3c 74 72 3e 3c  </td></tr>.<tr><
1600: 74 64 3e 54 72 61 69 6c 65 72 3c 2f 74 64 3e 3c  td>Trailer</td><
1610: 74 64 3e 32 7a 4d 4d 33 45 20 20 20 20 20 20 20  td>2zMM3E       
1620: 20 20 20 20 3c 2f 74 64 3e 3c 74 64 3e 43 6b 65      </td><td>Cke
1630: 63 6b 73 75 6d 3c 2f 74 64 3e 3c 74 64 3e 20 2d  cksum</td><td> -
1640: 31 31 30 31 34 33 38 37 37 30 20 20 20 20 20 20  1101438770      
1650: 20 20 20 3c 2f 74 64 3e 3c 2f 74 72 3e 0a 3c 2f     </td></tr>.</
1660: 74 61 62 6c 65 3e 0a 0a 3c 70 3e 54 68 65 20 75  table>..<p>The u
1670: 6e 69 66 69 65 64 20 64 69 66 66 20 62 65 68 69  nified diff behi
1680: 6e 64 20 74 68 65 20 61 62 6f 76 65 20 64 65 6c  nd the above del
1690: 74 61 20 69 73 3c 2f 70 3e 0a 0a 3c 74 61 62 6c  ta is</p>..<tabl
16a0: 65 20 62 6f 72 64 65 72 3d 31 3e 3c 74 72 3e 3c  e border=1><tr><
16b0: 74 64 3e 3c 70 72 65 3e 0a 62 6c 75 65 70 65 61  td><pre>.bluepea
16c0: 6b 3a 28 37 36 31 29 20 7e 2f 50 72 6f 6a 65 63  k:(761) ~/Projec
16d0: 74 73 2f 54 63 6c 2f 46 6f 73 73 69 6c 2f 44 65  ts/Tcl/Fossil/De
16e0: 76 65 6c 2f 64 65 76 65 6c 20 3e 20 64 69 66 66  vel/devel > diff
16f0: 20 2d 75 20 2e 2e 2f 44 45 4c 54 41 2f 6f 6c 64   -u ../DELTA/old
1700: 20 2e 2e 2f 44 45 4c 54 41 2f 6e 65 77 20 0a 2d   ../DELTA/new .-
1710: 2d 2d 20 2e 2e 2f 44 45 4c 54 41 2f 6f 6c 64 20  -- ../DELTA/old 
1720: 20 20 20 20 20 20 20 32 30 30 37 2d 30 38 2d 32         2007-08-2
1730: 33 20 32 31 3a 31 34 3a 34 30 2e 30 30 30 30 30  3 21:14:40.00000
1740: 30 30 30 30 20 2d 30 37 30 30 0a 2b 2b 2b 20 2e  0000 -0700.+++ .
1750: 2e 2f 44 45 4c 54 41 2f 6e 65 77 20 20 20 20 20  ./DELTA/new     
1760: 20 20 20 32 30 30 37 2d 30 38 2d 32 33 20 32 31     2007-08-23 21
1770: 3a 31 34 3a 33 33 2e 30 30 30 30 30 30 30 30 30  :14:33.000000000
1780: 20 2d 30 37 30 30 0a 40 40 20 2d 35 2c 37 20 2b   -0700.@@ -5,7 +
1790: 35 2c 37 20 40 40 0a 20 0a 20 20 2a 20 20 49 66  5,7 @@. .  *  If
17a0: 20 74 68 65 20 73 65 72 76 65 72 20 64 6f 65 73   the server does
17b0: 20 6e 6f 74 20 68 61 76 65 20 77 72 69 74 65 20   not have write 
17c0: 70 65 72 6d 69 73 73 69 6f 6e 20 6f 6e 20 74 68  permission on th
17d0: 65 20 64 61 74 61 62 61 73 65 0a 20 20 20 20 20  e database.     
17e0: 66 69 6c 65 2c 20 6f 72 20 6f 6e 20 74 68 65 20  file, or on the 
17f0: 64 69 72 65 63 74 6f 72 79 20 63 6f 6e 74 61 69  directory contai
1800: 6e 69 6e 67 20 74 68 65 20 64 61 74 61 62 61 73  ning the databas
1810: 65 20 66 69 6c 65 20 28 61 6e 64 20 0a 2d 20 20  e file (and .-  
1820: 20 20 69 74 20 69 73 20 74 68 75 73 20 75 6e 61    it is thus una
1830: 62 6c 65 20 74 6f 20 75 70 64 61 74 65 20 64 61  ble to update da
1840: 74 61 62 61 73 65 20 62 65 63 61 75 73 65 20 69  tabase because i
1850: 74 20 63 61 6e 6e 6f 74 20 63 72 65 61 74 65 0a  t cannot create.
1860: 2b 20 20 20 20 69 74 20 69 73 20 74 68 75 73 20  +    it is thus 
1870: 75 6e 61 62 6c 65 20 74 6f 20 75 70 64 61 74 65  unable to update
1880: 20 74 68 65 20 64 61 74 61 62 61 73 65 20 62 65   the database be
1890: 63 61 75 73 65 20 69 74 20 63 61 6e 6e 6f 74 20  cause it cannot 
18a0: 63 72 65 61 74 65 0a 20 20 20 20 20 61 20 72 6f  create.     a ro
18b0: 6c 6c 62 61 63 6b 20 6a 6f 75 72 6e 61 6c 29 20  llback journal) 
18c0: 74 68 65 6e 20 69 74 20 63 75 72 72 65 6e 74 6c  then it currentl
18d0: 79 20 66 61 69 6c 73 20 73 69 6c 65 6e 74 6c 79  y fails silently
18e0: 20 6f 6e 20 61 20 70 75 73 68 2e 0a 20 20 20 20   on a push..    
18f0: 20 49 74 20 6e 65 65 64 73 20 74 6f 20 72 65 74   It needs to ret
1900: 75 72 6e 20 61 20 68 65 6c 70 66 75 6c 20 65 72  urn a helpful er
1910: 72 6f 72 2e 0a 20 0a 40 40 20 2d 32 37 2c 38 20  ror.. .@@ -27,8 
1920: 2b 32 37 2c 38 20 40 40 0a 20 20 2a 20 20 41 64  +27,8 @@.  *  Ad
1930: 64 69 74 69 6f 6e 61 6c 20 69 6e 66 6f 72 6d 61  ditional informa
1940: 74 69 6f 6e 20 64 69 73 70 6c 61 79 65 64 20 66  tion displayed f
1950: 6f 72 20 74 68 65 20 22 76 69 6e 66 6f 22 20 70  or the "vinfo" p
1960: 61 67 65 3a 0a 20 0a 20 20 20 20 20 20 2b 20 20  age:. .      +  
1970: 41 6c 6c 20 6c 65 61 76 65 73 20 6f 66 20 74 68  All leaves of th
1980: 69 73 20 76 65 72 73 69 6f 6e 20 74 68 61 74 20  is version that 
1990: 61 72 65 20 6e 6f 74 20 69 6e 63 6c 75 64 65 64  are not included
19a0: 20 69 6e 20 74 68 65 0a 2d 20 20 20 20 20 20 20   in the.-       
19b0: 20 64 65 63 65 6e 64 61 6e 74 20 6c 69 73 74 2e   decendant list.
19c0: 20 20 57 69 74 68 20 64 61 74 65 2c 20 75 73 65    With date, use
19d0: 72 2c 20 63 6f 6d 6d 65 6e 74 2c 20 61 6e 64 20  r, comment, and 
19e0: 68 79 70 65 72 6c 69 6e 6b 2e 0a 2d 20 20 20 20  hyperlink..-    
19f0: 20 20 20 20 4c 65 61 76 65 73 20 69 6e 20 74 68      Leaves in th
1a00: 65 20 64 65 63 65 6e 64 61 6e 74 20 74 61 62 6c  e decendant tabl
1a10: 65 20 73 68 6f 75 6c 64 20 62 65 20 6d 61 72 6b  e should be mark
1a20: 65 64 20 61 73 20 73 75 63 68 2e 0a 2b 20 20 20  ed as such..+   
1a30: 20 20 20 20 20 64 65 73 63 65 6e 64 61 6e 74 20       descendant 
1a40: 6c 69 73 74 2e 20 20 57 69 74 68 20 64 61 74 65  list.  With date
1a50: 2c 20 75 73 65 72 2c 20 63 6f 6d 6d 65 6e 74 2c  , user, comment,
1a60: 20 61 6e 64 20 68 79 70 65 72 6c 69 6e 6b 2e 0a   and hyperlink..
1a70: 2b 20 20 20 20 20 20 20 20 4c 65 61 76 65 73 20  +        Leaves 
1a80: 69 6e 20 74 68 65 20 64 65 73 63 65 6e 64 61 6e  in the descendan
1a90: 74 20 74 61 62 6c 65 20 73 68 6f 75 6c 64 20 62  t table should b
1aa0: 65 20 6d 61 72 6b 65 64 20 61 73 20 73 75 63 68  e marked as such
1ab0: 2e 0a 20 20 20 20 20 20 20 20 20 53 65 65 20 74  ..         See t
1ac0: 68 65 20 63 6f 6d 70 75 74 65 5f 6c 65 61 76 65  he compute_leave
1ad0: 73 28 29 20 66 75 6e 63 74 69 6f 6e 20 74 6f 20  s() function to 
1ae0: 73 65 65 20 68 6f 77 20 74 6f 20 66 69 6e 64 20  see how to find 
1af0: 61 6c 6c 0a 20 20 20 20 20 20 20 20 20 6c 65 61  all.         lea
1b00: 76 65 73 2e 0a 20 20 20 20 20 20 2b 20 20 41 64  ves..      +  Ad
1b10: 64 20 66 69 6c 65 20 64 69 66 66 20 6c 69 6e 6b  d file diff link
1b20: 73 20 74 6f 20 74 68 65 20 66 69 6c 65 20 63 68  s to the file ch
1b30: 61 6e 67 65 20 6c 69 73 74 2e 0a 40 40 20 2d 33  ange list..@@ -3
1b40: 37 2c 37 20 2b 33 37 2c 37 20 40 40 0a 20 0a 20  7,7 +37,7 @@. . 
1b50: 20 2a 20 20 54 68 65 20 2f 78 66 65 72 20 68 61   *  The /xfer ha
1b60: 6e 64 6c 65 72 20 28 66 6f 72 20 70 75 73 68 2c  ndler (for push,
1b70: 20 70 75 6c 6c 2c 20 61 6e 64 20 63 6c 6f 6e 65   pull, and clone
1b80: 29 20 64 6f 65 73 20 6e 6f 74 20 64 6f 0a 20 20  ) does not do.  
1b90: 20 20 20 64 65 6c 74 61 20 63 6f 6d 70 72 65 73     delta compres
1ba0: 73 69 6f 6e 2e 20 20 54 68 69 73 20 72 65 73 75  sion.  This resu
1bb0: 6c 74 73 20 69 6e 20 65 78 63 65 73 73 20 62 61  lts in excess ba
1bc0: 6e 64 77 69 64 74 68 20 75 73 61 67 65 2e 0a 2d  ndwidth usage..-
1bd0: 20 20 20 20 54 68 65 72 65 20 61 72 65 20 73 6f      There are so
1be0: 6d 65 20 63 6f 64 65 20 69 6e 20 78 66 65 72 2e  me code in xfer.
1bf0: 63 20 74 68 61 74 20 61 72 65 20 73 6b 65 74 63  c that are sketc
1c00: 68 65 73 20 6f 66 20 69 64 65 61 73 20 6f 6e 0a  hes of ideas on.
1c10: 2b 20 20 20 20 54 68 65 72 65 20 61 72 65 20 73  +    There are s
1c20: 6f 6d 65 20 70 69 65 63 65 73 20 69 6e 20 78 66  ome pieces in xf
1c30: 65 72 2e 63 20 74 68 61 74 20 61 72 65 20 73 6b  er.c that are sk
1c40: 65 74 63 68 65 73 20 6f 66 20 69 64 65 61 73 20  etches of ideas 
1c50: 6f 6e 0a 20 20 20 20 20 68 6f 77 20 74 6f 20 64  on.     how to d
1c60: 6f 20 64 65 6c 74 61 20 63 6f 6d 70 72 65 73 73  o delta compress
1c70: 69 6f 6e 2c 20 62 75 74 20 6e 6f 74 68 69 6e 67  ion, but nothing
1c80: 20 68 61 73 20 62 65 65 6e 20 69 6d 70 6c 65 6d   has been implem
1c90: 65 6e 74 65 64 2e 0a 20 0a 20 20 2a 20 20 45 6e  ented.. .  *  En
1ca0: 68 61 6e 63 65 6d 65 6e 74 73 20 74 6f 20 74 68  hancements to th
1cb0: 65 20 64 69 66 66 20 61 6e 64 20 74 6b 64 69 66  e diff and tkdif
1cc0: 66 20 63 6f 6d 6d 61 6e 64 73 20 69 6e 20 74 68  f commands in th
1cd0: 65 20 63 6c 69 2e 0a 40 40 20 2d 34 35 2c 37 20  e cli..@@ -45,7 
1ce0: 2b 34 35 2c 37 20 40 40 0a 20 20 20 20 20 73 69  +45,7 @@.     si
1cf0: 6e 67 6c 65 20 66 69 6c 65 2e 20 20 41 6c 6c 6f  ngle file.  Allo
1d00: 77 20 64 69 66 66 73 20 61 67 61 69 6e 73 74 20  w diffs against 
1d10: 61 6e 79 20 74 77 6f 20 61 72 62 69 74 72 61 72  any two arbitrar
1d20: 79 20 76 65 72 73 69 6f 6e 73 2c 0a 20 20 20 20  y versions,.    
1d30: 20 6e 6f 74 20 6a 75 73 74 20 64 69 66 66 73 20   not just diffs 
1d40: 61 67 61 69 6e 73 74 20 74 68 65 20 63 75 72 72  against the curr
1d50: 65 6e 74 20 63 68 65 63 6b 2d 6f 75 74 2e 20 20  ent check-out.  
1d60: 41 6c 6c 6f 77 20 0a 20 20 20 20 20 63 6f 6e 66  Allow .     conf
1d70: 69 67 75 72 61 74 69 6f 6e 20 6f 70 74 69 6f 6e  iguration option
1d80: 73 20 74 6f 20 72 65 70 6c 61 63 65 20 74 6b 64  s to replace tkd
1d90: 69 66 66 20 77 69 74 68 20 73 6f 6d 65 20 6f 74  iff with some ot
1da0: 68 65 72 0a 2d 20 20 20 20 76 69 73 75 61 6c 20  her.-    visual 
1db0: 64 69 66 66 65 72 20 6f 66 20 74 68 65 20 75 73  differ of the us
1dc0: 65 72 73 20 63 68 6f 69 63 65 2e 0a 2b 20 20 20  ers choice..+   
1dd0: 20 76 69 73 75 61 6c 20 64 69 66 66 65 72 20 6f   visual differ o
1de0: 66 20 74 68 65 20 75 73 65 72 73 20 63 68 6f 69  f the users choi
1df0: 63 65 2e 20 45 78 61 6d 70 6c 65 3a 20 65 73 6b  ce. Example: esk
1e00: 69 6c 2e 0a 20 0a 20 20 2a 20 20 54 69 63 6b 65  il.. .  *  Ticke
1e10: 74 69 6e 67 20 69 6e 74 65 72 66 61 63 65 20 28  ting interface (
1e20: 65 78 70 61 6e 64 20 74 68 69 73 20 62 75 6c 6c  expand this bull
1e30: 65 74 29 0a 0a 3c 2f 70 72 65 3e 3c 2f 74 64 3e  et)..</pre></td>
1e40: 3c 2f 74 72 3e 3c 2f 74 61 62 6c 65 3e 0a 0a 0a  </tr></table>...
1e50: 0a 3c 61 20 6e 61 6d 65 3d 22 6e 6f 74 65 73 22  .<a name="notes"
1e60: 3e 3c 68 32 3e 4e 6f 74 65 73 3c 2f 68 32 3e 0a  ><h2>Notes</h2>.
1e70: 0a 3c 75 6c 3e 0a 3c 6c 69 3e 50 75 72 65 20 74  .<ul>.<li>Pure t
1e80: 65 78 74 20 66 69 6c 65 73 20 67 65 6e 65 72 61  ext files genera
1e90: 74 65 20 61 20 70 75 72 65 20 74 65 78 74 20 64  te a pure text d
1ea0: 65 6c 74 61 2e 0a 3c 2f 6c 69 3e 0a 3c 6c 69 3e  elta..</li>.<li>
1eb0: 42 69 6e 61 72 79 20 66 69 6c 65 73 20 67 65 6e  Binary files gen
1ec0: 65 72 61 74 65 20 61 20 64 65 6c 74 61 20 74 68  erate a delta th
1ed0: 61 74 20 6d 61 79 20 63 6f 6e 74 61 69 6e 20 73  at may contain s
1ee0: 6f 6d 65 20 62 69 6e 61 72 79 20 64 61 74 61 2e  ome binary data.
1ef0: 0a 3c 2f 6c 69 3e 0a 3c 6c 69 3e 49 6e 73 74 65  .</li>.<li>Inste
1f00: 61 64 20 6f 66 20 70 75 74 74 69 6e 67 20 73 70  ad of putting sp
1f10: 65 63 69 61 6c 20 69 6e 73 74 72 75 63 74 69 6f  ecial instructio
1f20: 6e 73 20 66 6f 72 20 67 65 6e 65 72 61 6c 20 63  ns for general c
1f30: 6f 6d 70 72 65 73 73 69 6f 6e 0a 69 6e 74 6f 20  ompression.into 
1f40: 74 68 65 20 64 65 6c 74 61 2d 66 6f 72 6d 61 74  the delta-format
1f50: 20 69 74 73 65 6c 66 2c 20 73 70 65 63 69 66 69   itself, specifi
1f60: 63 61 6c 6c 79 20 74 68 65 20 73 65 67 6d 65 6e  cally the segmen
1f70: 74 2d 6c 69 73 74 2c 20 6c 69 6b 65 0a 72 75 6e  t-list, like.run
1f80: 2d 6c 65 6e 67 74 68 20 65 6e 63 6f 64 69 6e 67  -length encoding
1f90: 20 6f 66 20 6c 69 74 65 72 61 6c 73 2c 20 65 74   of literals, et
1fa0: 63 2e 20 69 74 20 77 61 73 20 63 6f 6e 73 69 64  c. it was consid
1fb0: 65 72 65 64 20 74 6f 20 62 65 20 6d 75 63 68 0a  ered to be much.
1fc0: 6d 6f 72 65 20 73 65 6e 73 69 62 6c 65 20 74 6f  more sensible to
1fd0: 20 6b 65 65 70 20 74 68 65 20 76 61 72 69 6f 75   keep the variou
1fe0: 73 20 63 6f 6e 63 65 72 6e 20 73 65 70 61 72 61  s concern separa
1ff0: 74 65 20 61 6e 64 20 75 73 65 20 61 20 67 65 6e  te and use a gen
2000: 65 72 61 6c 0a 63 6f 6d 70 72 65 73 73 69 6f 6e  eral.compression
2010: 20 6c 69 62 72 61 72 79 2c 20 6c 69 6b 65 20 3c   library, like <
2020: 61 20 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77  a href="http://w
2030: 77 77 2e 7a 6c 69 62 2e 6e 65 74 22 3e 7a 6c 69  ww.zlib.net">zli
2040: 62 3c 2f 61 3e 2c 20 74 6f 0a 63 6f 6d 70 72 65  b</a>, to.compre
2050: 73 73 20 74 68 65 20 66 75 6c 6c 20 64 65 6c 74  ss the full delt
2060: 61 20 61 66 74 65 72 20 69 74 73 20 67 65 6e 65  a after its gene
2070: 72 61 74 69 6f 6e 2e 0a 3c 2f 6c 69 3e 0a 3c 2f  ration..</li>.</
2080: 75 6c 3e 0a                                      ul>.