0000: 3c 6e 6f 77 69 6b 69 3e 0a 3c 68 31 20 61 6c 69 <nowiki>.<h1 ali
0010: 67 6e 3d 22 63 65 6e 74 65 72 22 3e 0a 46 6f 73 gn="center">.Fos
0020: 73 69 6c 20 44 65 6c 74 61 20 46 6f 72 6d 61 74 sil Delta Format
0030: 0a 3c 2f 68 31 3e 0a 0a 3c 70 3e 46 6f 73 73 69 .</h1>..<p>Fossi
0040: 6c 20 61 63 68 69 65 76 65 73 20 65 66 66 69 63 l achieves effic
0050: 69 65 6e 74 20 73 74 6f 72 61 67 65 20 61 6e 64 ient storage and
0060: 20 6c 6f 77 2d 62 61 6e 64 77 69 64 74 68 20 73 low-bandwidth s
0070: 79 6e 63 68 72 6f 6e 69 7a 61 74 69 6f 6e 0a 74 ynchronization.t
0080: 68 72 6f 75 67 68 20 74 68 65 20 75 73 65 20 6f hrough the use o
0090: 66 20 64 65 6c 74 61 2d 63 6f 6d 70 72 65 73 73 f delta-compress
00a0: 69 6f 6e 2e 20 20 49 6e 73 74 65 61 64 20 6f 66 ion. Instead of
00b0: 20 73 74 6f 72 69 6e 67 0a 6f 72 20 74 72 61 6e storing.or tran
00c0: 73 6d 69 74 74 69 6e 67 20 74 68 65 20 63 6f 6d smitting the com
00d0: 70 6c 65 74 65 20 63 6f 6e 74 65 6e 74 20 6f 66 plete content of
00e0: 20 61 6e 20 61 72 74 69 66 61 63 74 2c 20 66 6f an artifact, fo
00f0: 73 73 69 6c 20 73 74 6f 72 65 73 20 6f 72 0a 74 ssil stores or.t
0100: 72 61 6e 73 6d 69 74 73 20 6f 6e 6c 79 20 74 68 ransmits only th
0110: 65 20 63 68 61 6e 67 65 73 20 72 65 6c 61 74 69 e changes relati
0120: 76 65 20 74 6f 20 61 20 72 65 6c 61 74 65 64 20 ve to a related
0130: 61 72 74 69 66 61 63 74 2e 0a 3c 2f 70 3e 0a 0a artifact..</p>..
0140: 3c 70 3e 54 68 69 73 20 64 6f 63 75 6d 65 6e 74 <p>This document
0150: 20 64 65 73 63 72 69 62 65 73 20 74 68 65 20 64 describes the d
0160: 65 6c 74 61 2d 65 6e 63 6f 64 69 6e 67 20 66 6f elta-encoding fo
0170: 72 6d 61 74 20 75 73 65 64 20 62 79 20 66 6f 73 rmat used by fos
0180: 73 69 6c 2e 0a 54 68 65 20 69 6e 74 65 6e 64 65 sil..The intende
0190: 64 20 61 75 64 69 65 6e 63 65 20 69 73 20 64 65 d audience is de
01a0: 76 65 6c 6f 70 65 72 73 20 77 6f 72 6b 69 6e 67 velopers working
01b0: 20 6f 6e 20 65 69 74 68 65 72 0a 3c 61 20 68 72 on either.<a hr
01c0: 65 66 3d 22 69 6e 64 65 78 2e 77 69 6b 69 22 3e ef="index.wiki">
01d0: 66 6f 73 73 69 6c 3c 2f 61 3e 20 69 74 73 65 6c fossil</a> itsel
01e0: 66 2c 20 6f 72 20 6f 6e 20 74 6f 6f 6c 73 20 63 f, or on tools c
01f0: 6f 6d 70 61 74 69 62 6c 65 20 77 69 74 68 0a 66 ompatible with.f
0200: 6f 73 73 69 6c 2e 3c 2f 70 3e 0a 0a 3c 70 3e 4e ossil.</p>..<p>N
0210: 6f 74 65 20 74 68 61 74 20 74 68 65 20 64 65 6c ote that the del
0220: 74 61 2d 65 6e 63 6f 64 69 6e 67 20 69 73 20 6e ta-encoding is n
0230: 6f 74 20 61 20 66 75 6e 64 61 6d 65 6e 74 61 6c ot a fundamental
0240: 20 65 6c 65 6d 65 6e 74 20 6f 66 20 74 68 65 0a element of the.
0250: 73 74 61 74 65 20 6f 66 20 61 20 66 6f 73 73 69 state of a fossi
0260: 6c 20 72 65 70 6f 73 69 74 6f 72 79 2e 20 20 41 l repository. A
0270: 20 73 74 61 74 65 20 6f 66 20 61 20 66 6f 73 73 state of a foss
0280: 69 6c 20 72 65 70 6f 73 69 74 6f 72 79 20 69 73 il repository is
0290: 0a 64 65 66 69 6e 65 64 20 62 79 20 74 68 65 20 .defined by the
02a0: 75 6e 63 6f 6d 70 72 65 73 73 65 64 20 61 6e 64 uncompressed and
02b0: 20 75 6e 64 65 6c 74 61 65 64 20 63 6f 6e 74 65 undeltaed conte
02c0: 6e 74 20 6f 66 20 61 6c 6c 20 61 72 74 69 66 61 nt of all artifa
02d0: 63 74 73 2e 0a 54 68 65 20 66 61 63 74 20 74 68 cts..The fact th
02e0: 65 20 61 72 74 69 66 61 63 74 73 0a 61 72 65 20 e artifacts.are
02f0: 73 74 6f 72 65 64 20 6f 6e 20 64 69 73 6b 20 75 stored on disk u
0300: 73 69 6e 67 20 74 68 69 73 20 64 65 6c 74 61 2d sing this delta-
0310: 65 6e 63 6f 64 69 6e 67 20 66 6f 72 6d 61 74 20 encoding format
0320: 69 73 20 6d 65 72 65 6c 79 20 61 6e 0a 6f 70 74 is merely an.opt
0330: 69 6d 69 7a 61 74 69 6f 6e 2e 20 20 4f 6e 65 20 imization. One
0340: 63 6f 75 6c 64 2c 20 69 6e 20 74 68 65 6f 72 79 could, in theory
0350: 2c 20 63 72 65 61 74 65 20 61 6e 20 65 6e 74 69 , create an enti
0360: 72 65 6c 79 20 6e 65 77 20 61 6e 64 0a 63 6f 6d rely new and.com
0370: 70 61 74 69 62 6c 65 20 69 6d 70 6c 65 6d 65 6e patible implemen
0380: 74 61 74 69 6f 6e 20 6f 66 20 66 6f 73 73 69 6c tation of fossil
0390: 20 74 68 61 74 20 75 73 65 64 20 61 20 64 69 66 that used a dif
03a0: 66 65 72 65 6e 74 20 64 65 6c 74 61 2d 65 6e 63 ferent delta-enc
03b0: 6f 64 69 6e 67 0a 6f 72 20 64 69 64 20 6e 6f 20 oding.or did no
03c0: 64 65 6c 74 61 2d 65 6e 63 6f 64 69 6e 67 20 61 delta-encoding a
03d0: 74 20 61 6c 6c 2e 20 20 48 6f 77 65 76 65 72 2c t all. However,
03e0: 20 65 78 70 65 72 69 65 6e 63 65 20 68 61 73 20 experience has
03f0: 73 68 6f 77 6e 20 74 68 61 74 0a 74 68 65 20 64 shown that.the d
0400: 65 6c 74 61 2d 65 6e 63 6f 64 69 6e 67 20 64 65 elta-encoding de
0410: 73 63 72 69 62 65 64 20 68 65 72 65 20 69 73 20 scribed here is
0420: 62 6f 74 68 20 65 66 66 69 63 69 65 6e 74 20 74 both efficient t
0430: 6f 20 63 6f 6d 70 75 74 65 20 61 6e 64 0a 72 65 o compute and.re
0440: 73 75 6c 74 73 20 69 6e 20 76 65 72 79 20 73 6d sults in very sm
0450: 61 6c 6c 20 64 65 6c 74 61 73 2c 20 73 6f 20 69 all deltas, so i
0460: 74 73 20 63 6f 6e 74 69 6e 75 65 64 20 75 73 65 ts continued use
0470: 20 69 73 20 72 65 63 6f 6d 6d 65 6e 64 65 64 2e is recommended.
0480: 3c 2f 70 3e 0a 0a 3c 61 20 6e 61 6d 65 3d 22 73 </p>..<a name="s
0490: 74 72 75 63 74 75 72 65 22 3e 3c 2f 61 3e 3c 68 tructure"></a><h
04a0: 32 3e 31 2e 30 20 53 74 72 75 63 74 75 72 65 3c 2>1.0 Structure<
04b0: 2f 68 32 3e 0a 3c 69 6d 67 20 73 72 63 3d 22 64 /h2>.<img src="d
04c0: 65 6c 74 61 31 2e 67 69 66 22 20 61 6c 69 67 6e elta1.gif" align
04d0: 3d 22 6c 65 66 74 22 20 68 73 70 61 63 65 3d 22 ="left" hspace="
04e0: 31 30 22 3e 0a 0a 3c 70 3e 41 20 64 65 6c 74 61 10">..<p>A delta
04f0: 20 63 6f 6e 73 69 73 74 73 20 6f 66 20 74 68 72 consists of thr
0500: 65 65 20 70 61 72 74 73 2c 20 61 20 22 68 65 61 ee parts, a "hea
0510: 64 65 72 22 2c 20 61 20 22 74 72 61 69 6c 65 72 der", a "trailer
0520: 22 2c 20 61 6e 64 20 61 0a 22 73 65 67 6d 65 6e ", and a."segmen
0530: 74 2d 6c 69 73 74 22 20 62 65 74 77 65 65 6e 20 t-list" between
0540: 74 68 65 6d 2e 3c 2f 70 3e 0a 0a 3c 70 3e 42 6f them.</p>..<p>Bo
0550: 74 68 20 68 65 61 64 65 72 20 61 6e 64 20 74 72 th header and tr
0560: 61 69 6c 65 72 20 70 72 6f 76 69 64 65 20 69 6e ailer provide in
0570: 66 6f 72 6d 61 74 69 6f 6e 20 61 62 6f 75 74 20 formation about
0580: 74 68 65 20 74 61 72 67 65 74 0a 68 65 6c 70 69 the target.helpi
0590: 6e 67 20 74 68 65 20 64 65 63 6f 64 65 72 2c 20 ng the decoder,
05a0: 61 6e 64 20 74 68 65 20 73 65 67 6d 65 6e 74 2d and the segment-
05b0: 6c 69 73 74 20 64 65 73 63 72 69 62 65 73 20 68 list describes h
05c0: 6f 77 20 74 68 65 20 74 61 72 67 65 74 20 63 61 ow the target ca
05d0: 6e 0a 62 65 20 63 6f 6e 73 74 72 75 63 74 65 64 n.be constructed
05e0: 20 66 72 6f 6d 20 74 68 65 20 6f 72 69 67 69 6e from the origin
05f0: 61 6c 2e 3c 2f 70 3e 0a 0a 3c 61 20 6e 61 6d 65 al.</p>..<a name
0600: 3d 22 68 65 61 64 65 72 22 3e 3c 2f 61 3e 3c 68 ="header"></a><h
0610: 33 3e 31 2e 31 20 48 65 61 64 65 72 3c 2f 68 33 3>1.1 Header</h3
0620: 3e 0a 3c 69 6d 67 20 73 72 63 3d 22 64 65 6c 74 >.<img src="delt
0630: 61 36 2e 67 69 66 22 20 61 6c 69 67 6e 3d 22 6c a6.gif" align="l
0640: 65 66 74 22 20 68 73 70 61 63 65 3d 22 31 30 22 eft" hspace="10"
0650: 3e 0a 0a 3c 70 3e 54 68 65 20 68 65 61 64 65 72 >..<p>The header
0660: 20 63 6f 6e 73 69 73 74 73 20 6f 66 20 61 20 73 consists of a s
0670: 69 6e 67 6c 65 20 6e 75 6d 62 65 72 20 66 6f 6c ingle number fol
0680: 6c 6f 77 65 64 20 62 79 20 61 20 6e 65 77 6c 69 lowed by a newli
0690: 6e 65 0a 63 68 61 72 61 63 74 65 72 20 28 41 53 ne.character (AS
06a0: 43 49 49 20 30 78 30 61 29 2e 20 54 68 65 20 6e CII 0x0a). The n
06b0: 75 6d 62 65 72 20 69 73 20 74 68 65 20 6c 65 6e umber is the len
06c0: 67 74 68 20 6f 66 20 74 68 65 20 74 61 72 67 65 gth of the targe
06d0: 74 20 69 6e 0a 62 79 74 65 73 2e 3c 2f 70 3e 0a t in.bytes.</p>.
06e0: 0a 3c 70 3e 54 68 69 73 20 6d 65 61 6e 73 20 74 .<p>This means t
06f0: 68 61 74 2c 20 67 69 76 65 6e 20 61 20 64 65 6c hat, given a del
0700: 74 61 2c 20 74 68 65 20 64 65 63 6f 64 65 72 20 ta, the decoder
0710: 63 61 6e 20 63 6f 6d 70 75 74 65 20 74 68 65 20 can compute the
0720: 73 69 7a 65 20 6f 66 0a 74 68 65 20 74 61 72 67 size of.the targ
0730: 65 74 20 28 61 6e 64 20 61 6c 6c 6f 63 61 74 65 et (and allocate
0740: 20 61 6e 79 20 6e 65 63 65 73 73 61 72 79 20 6d any necessary m
0750: 65 6d 6f 72 79 20 62 61 73 65 64 20 6f 6e 20 74 emory based on t
0760: 68 61 74 29 20 62 79 20 73 69 6d 70 6c 79 0a 72 hat) by simply.r
0770: 65 61 64 69 6e 67 20 74 68 65 20 66 69 72 73 74 eading the first
0780: 20 6c 69 6e 65 20 6f 66 20 74 68 65 20 64 65 6c line of the del
0790: 74 61 20 61 6e 64 20 64 65 63 6f 64 69 6e 67 20 ta and decoding
07a0: 74 68 65 20 6e 75 6d 62 65 72 20 66 6f 75 6e 64 the number found
07b0: 0a 74 68 65 72 65 2e 20 49 6e 20 6f 74 68 65 72 .there. In other
07c0: 20 77 6f 72 64 73 2c 20 62 65 66 6f 72 65 20 69 words, before i
07d0: 74 20 68 61 73 20 74 6f 20 64 65 63 6f 64 65 20 t has to decode
07e0: 65 76 65 72 79 74 68 69 6e 67 20 65 6c 73 65 2e everything else.
07f0: 3c 2f 70 3e 0a 0a 3c 61 20 6e 61 6d 65 3d 22 74 </p>..<a name="t
0800: 72 61 69 6c 65 72 22 3e 3c 2f 61 3e 3c 68 33 3e railer"></a><h3>
0810: 31 2e 32 20 54 72 61 69 6c 65 72 3c 2f 68 33 3e 1.2 Trailer</h3>
0820: 0a 3c 69 6d 67 20 73 72 63 3d 22 64 65 6c 74 61 .<img src="delta
0830: 35 2e 67 69 66 22 20 61 6c 69 67 6e 3d 22 6c 65 5.gif" align="le
0840: 66 74 22 20 68 73 70 61 63 65 3d 22 31 30 22 3e ft" hspace="10">
0850: 0a 0a 3c 70 3e 54 68 65 20 74 72 61 69 6c 65 72 ..<p>The trailer
0860: 20 63 6f 6e 73 69 73 74 73 20 6f 66 20 61 20 73 consists of a s
0870: 69 6e 67 6c 65 20 6e 75 6d 62 65 72 20 66 6f 6c ingle number fol
0880: 6c 6f 77 65 64 20 62 79 20 61 20 73 65 6d 69 63 lowed by a semic
0890: 6f 6c 6f 6e 20 28 41 53 43 49 49 0a 30 78 33 62 olon (ASCII.0x3b
08a0: 29 2e 20 54 68 69 73 20 6e 75 6d 62 65 72 20 69 ). This number i
08b0: 73 20 61 20 63 68 65 63 6b 73 75 6d 20 6f 66 20 s a checksum of
08c0: 74 68 65 20 74 61 72 67 65 74 20 61 6e 64 20 63 the target and c
08d0: 61 6e 20 62 65 20 75 73 65 64 20 62 79 20 61 0a an be used by a.
08e0: 64 65 63 6f 64 65 72 20 74 6f 20 76 65 72 69 66 decoder to verif
08f0: 79 20 74 68 61 74 20 74 68 65 20 64 65 6c 74 61 y that the delta
0900: 20 61 70 70 6c 69 65 64 20 63 6f 72 72 65 63 74 applied correct
0910: 6c 79 2c 20 72 65 63 6f 6e 73 74 72 75 63 74 69 ly, reconstructi
0920: 6e 67 20 74 68 65 0a 74 61 72 67 65 74 20 66 72 ng the.target fr
0930: 6f 6d 20 74 68 65 20 6f 72 69 67 69 6e 61 6c 2e om the original.
0940: 3c 2f 70 3e 0a 0a 3c 70 3e 54 68 65 20 63 68 65 </p>..<p>The che
0950: 63 6b 73 75 6d 20 69 73 20 63 6f 6d 70 75 74 65 cksum is compute
0960: 64 20 62 79 20 74 72 65 61 74 69 6e 67 20 74 68 d by treating th
0970: 65 20 74 61 72 67 65 74 20 61 73 20 61 20 73 65 e target as a se
0980: 72 69 65 73 20 6f 66 0a 33 32 2d 62 69 74 20 69 ries of.32-bit i
0990: 6e 74 65 67 65 72 20 6e 75 6d 62 65 72 73 20 28 nteger numbers (
09a0: 4d 53 42 20 66 69 72 73 74 29 2c 20 61 6e 64 20 MSB first), and
09b0: 73 75 6d 6d 69 6e 67 20 74 68 65 73 65 20 75 70 summing these up
09c0: 2c 20 6d 6f 64 75 6c 6f 0a 32 5e 33 32 2d 31 2e , modulo.2^32-1.
09d0: 20 41 20 74 61 72 67 65 74 20 77 68 6f 73 65 20 A target whose
09e0: 6c 65 6e 67 74 68 20 69 73 20 6e 6f 74 20 61 20 length is not a
09f0: 6d 75 6c 74 69 70 6c 65 20 6f 66 20 34 20 69 73 multiple of 4 is
0a00: 20 70 61 64 64 65 64 20 77 69 74 68 0a 30 2d 62 padded with.0-b
0a10: 79 74 65 73 20 28 41 53 43 49 49 20 30 78 30 30 ytes (ASCII 0x00
0a20: 29 20 61 74 20 74 68 65 20 65 6e 64 2e 3c 2f 70 ) at the end.</p
0a30: 3e 0a 0a 3c 70 3e 42 79 20 70 75 74 74 69 6e 67 >..<p>By putting
0a40: 20 74 68 69 73 20 69 6e 66 6f 72 6d 61 74 69 6f this informatio
0a50: 6e 20 61 74 20 74 68 65 20 65 6e 64 20 6f 66 20 n at the end of
0a60: 74 68 65 20 64 65 6c 74 61 20 61 20 64 65 63 6f the delta a deco
0a70: 64 65 72 20 68 61 73 0a 69 74 20 61 76 61 69 6c der has.it avail
0a80: 61 62 6c 65 20 69 6d 6d 65 64 69 61 74 65 6c 79 able immediately
0a90: 20 61 66 74 65 72 20 74 68 65 20 74 61 72 67 65 after the targe
0aa0: 74 20 68 61 73 20 62 65 65 6e 20 72 65 63 6f 6e t has been recon
0ab0: 73 74 72 75 63 74 65 64 0a 66 75 6c 6c 79 2e 3c structed.fully.<
0ac0: 2f 70 3e 0a 0a 3c 61 20 6e 61 6d 65 3d 22 73 6c /p>..<a name="sl
0ad0: 69 73 74 22 3e 3c 2f 61 3e 3c 68 33 3e 31 2e 33 ist"></a><h3>1.3
0ae0: 20 53 65 67 6d 65 6e 74 2d 4c 69 73 74 3c 2f 68 Segment-List</h
0af0: 33 3e 0a 3c 69 6d 67 20 73 72 63 3d 22 64 65 6c 3>.<img src="del
0b00: 74 61 32 2e 67 69 66 22 20 61 6c 69 67 6e 3d 22 ta2.gif" align="
0b10: 6c 65 66 74 22 20 68 73 70 61 63 65 3d 22 31 30 left" hspace="10
0b20: 22 3e 0a 0a 3c 70 3e 54 68 65 20 73 65 67 6d 65 ">..<p>The segme
0b30: 6e 74 2d 6c 69 73 74 20 6f 66 20 61 20 64 65 6c nt-list of a del
0b40: 74 61 20 64 65 73 63 72 69 62 65 73 20 68 6f 77 ta describes how
0b50: 20 74 6f 20 63 72 65 61 74 65 20 74 68 65 20 74 to create the t
0b60: 61 72 67 65 74 20 66 72 6f 6d 0a 74 68 65 20 6f arget from.the o
0b70: 72 69 67 69 6e 61 6c 20 62 79 20 61 20 63 6f 6d riginal by a com
0b80: 62 69 6e 61 74 69 6f 6e 20 6f 66 20 69 6e 73 65 bination of inse
0b90: 72 74 69 6e 67 20 6c 69 74 65 72 61 6c 20 62 79 rting literal by
0ba0: 74 65 2d 73 65 71 75 65 6e 63 65 73 20 61 6e 64 te-sequences and
0bb0: 0a 63 6f 70 79 69 6e 67 20 72 61 6e 67 65 73 20 .copying ranges
0bc0: 6f 66 20 62 79 74 65 73 20 66 72 6f 6d 20 74 68 of bytes from th
0bd0: 65 20 6f 72 69 67 69 6e 61 6c 2e 20 54 68 69 73 e original. This
0be0: 20 69 73 20 74 68 65 72 65 20 74 68 65 0a 63 6f is there the.co
0bf0: 6d 70 72 65 73 73 69 6f 6e 20 74 61 6b 65 73 20 mpression takes
0c00: 70 6c 61 63 65 2c 20 62 79 20 65 6e 63 6f 64 69 place, by encodi
0c10: 6e 67 20 74 68 65 20 6c 61 72 67 65 20 63 6f 6d ng the large com
0c20: 6d 6f 6e 20 70 61 72 74 73 20 6f 66 0a 6f 72 69 mon parts of.ori
0c30: 67 69 6e 61 6c 20 61 6e 64 20 74 61 72 67 65 74 ginal and target
0c40: 20 69 6e 20 73 6d 61 6c 6c 20 63 6f 70 79 20 69 in small copy i
0c50: 6e 73 74 72 75 63 74 69 6f 6e 73 2e 3c 2f 70 3e nstructions.</p>
0c60: 0a 0a 3c 70 3e 54 68 65 20 74 61 72 67 65 74 20 ..<p>The target
0c70: 69 73 20 63 6f 6e 73 74 72 75 63 74 65 64 20 66 is constructed f
0c80: 72 6f 6d 20 62 65 67 69 6e 6e 69 6e 67 20 74 6f rom beginning to
0c90: 20 65 6e 64 2c 20 77 69 74 68 20 74 68 65 20 64 end, with the d
0ca0: 61 74 61 0a 67 65 6e 65 72 61 74 65 64 20 62 79 ata.generated by
0cb0: 20 65 61 63 68 20 69 6e 73 74 72 75 63 74 69 6f each instructio
0cc0: 6e 20 61 70 70 65 6e 64 65 64 20 61 66 74 65 72 n appended after
0cd0: 20 74 68 65 20 64 61 74 61 20 6f 66 20 61 6c 6c the data of all
0ce0: 20 70 72 65 76 69 6f 75 73 0a 69 6e 73 74 72 75 previous.instru
0cf0: 63 74 69 6f 6e 73 2c 20 77 69 74 68 20 6e 6f 20 ctions, with no
0d00: 67 61 70 73 2e 3c 2f 70 3e 0a 0a 3c 61 20 6e 61 gaps.</p>..<a na
0d10: 6d 65 3d 22 69 6e 73 65 72 74 6c 69 74 22 3e 3c me="insertlit"><
0d20: 2f 61 3e 3c 68 34 3e 31 2e 33 2e 31 20 49 6e 73 /a><h4>1.3.1 Ins
0d30: 65 72 74 20 4c 69 74 65 72 61 6c 3c 2f 68 34 3e ert Literal</h4>
0d40: 0a 0a 3c 70 3e 41 20 6c 69 74 65 72 61 6c 20 69 ..<p>A literal i
0d50: 73 20 73 70 65 63 69 66 69 65 64 20 62 79 20 74 s specified by t
0d60: 77 6f 20 65 6c 65 6d 65 6e 74 73 2c 20 74 68 65 wo elements, the
0d70: 20 73 69 7a 65 20 6f 66 20 74 68 65 20 6c 69 74 size of the lit
0d80: 65 72 61 6c 20 69 6e 0a 62 79 74 65 73 2c 20 61 eral in.bytes, a
0d90: 6e 64 20 74 68 65 20 62 79 74 65 73 20 6f 66 20 nd the bytes of
0da0: 74 68 65 20 6c 69 74 65 72 61 6c 20 69 74 73 65 the literal itse
0db0: 6c 66 2e 3c 2f 70 3e 0a 0a 3c 69 6d 67 20 73 72 lf.</p>..<img sr
0dc0: 63 3d 22 64 65 6c 74 61 34 2e 67 69 66 22 20 61 c="delta4.gif" a
0dd0: 6c 69 67 6e 3d 22 6c 65 66 74 22 20 68 73 70 61 lign="left" hspa
0de0: 63 65 3d 22 31 30 22 3e 0a 3c 70 3e 54 68 65 20 ce="10">.<p>The
0df0: 6c 65 6e 67 74 68 20 69 73 20 77 72 69 74 74 65 length is writte
0e00: 6e 20 66 69 72 73 74 2c 20 66 6f 6c 6c 6f 77 65 n first, followe
0e10: 64 20 62 79 20 61 20 63 6f 6c 6f 6e 20 63 68 61 d by a colon cha
0e20: 72 61 63 74 65 72 20 28 41 53 43 49 49 0a 30 78 racter (ASCII.0x
0e30: 33 61 29 2c 20 66 6f 6c 6c 6f 77 65 64 20 62 79 3a), followed by
0e40: 20 74 68 65 20 62 79 74 65 73 20 6f 66 20 74 68 the bytes of th
0e50: 65 20 6c 69 74 65 72 61 6c 2e 3c 2f 70 3e 0a 0a e literal.</p>..
0e60: 3c 61 20 6e 61 6d 65 3d 22 63 6f 70 79 72 61 6e <a name="copyran
0e70: 67 65 22 3e 3c 2f 61 3e 3c 68 34 3e 31 2e 33 2e ge"></a><h4>1.3.
0e80: 32 20 43 6f 70 79 20 52 61 6e 67 65 3c 2f 68 34 2 Copy Range</h4
0e90: 3e 0a 0a 3c 70 3e 41 20 72 61 6e 67 65 20 74 6f >..<p>A range to
0ea0: 20 63 6f 70 79 20 69 73 20 73 70 65 63 69 66 69 copy is specifi
0eb0: 65 64 20 62 79 20 74 77 6f 20 6e 75 6d 62 65 72 ed by two number
0ec0: 73 2c 20 74 68 65 20 6f 66 66 73 65 74 20 6f 66 s, the offset of
0ed0: 20 74 68 65 0a 66 69 72 73 74 20 62 79 74 65 20 the.first byte
0ee0: 69 6e 20 74 68 65 20 6f 72 69 67 69 6e 61 6c 20 in the original
0ef0: 74 6f 20 63 6f 70 79 2c 20 61 6e 64 20 74 68 65 to copy, and the
0f00: 20 73 69 7a 65 20 6f 66 20 74 68 65 20 72 61 6e size of the ran
0f10: 67 65 2c 20 69 6e 0a 62 79 74 65 73 2e 20 54 68 ge, in.bytes. Th
0f20: 65 20 73 69 7a 65 20 7a 65 72 6f 20 69 73 20 73 e size zero is s
0f30: 70 65 63 69 61 6c 2c 20 69 74 73 20 75 73 61 67 pecial, its usag
0f40: 65 20 69 6e 64 69 63 61 74 65 73 20 74 68 61 74 e indicates that
0f50: 20 74 68 65 20 72 61 6e 67 65 0a 65 78 74 65 6e the range.exten
0f60: 64 73 20 74 6f 20 74 68 65 20 65 6e 64 20 6f 66 ds to the end of
0f70: 20 74 68 65 20 6f 72 69 67 69 6e 61 6c 2e 3c 2f the original.</
0f80: 70 3e 0a 0a 3c 69 6d 67 20 73 72 63 3d 22 64 65 p>..<img src="de
0f90: 6c 74 61 33 2e 67 69 66 22 20 61 6c 69 67 6e 3d lta3.gif" align=
0fa0: 22 6c 65 66 74 22 20 68 73 70 61 63 65 3d 22 31 "left" hspace="1
0fb0: 30 22 3e 0a 3c 70 3e 54 68 65 20 6c 65 6e 67 74 0">.<p>The lengt
0fc0: 68 20 69 73 20 77 72 69 74 74 65 6e 20 66 69 72 h is written fir
0fd0: 73 74 2c 20 66 6f 6c 6c 6f 77 65 64 20 62 79 20 st, followed by
0fe0: 61 6e 20 22 61 74 22 20 63 68 61 72 61 63 74 65 an "at" characte
0ff0: 72 20 28 41 53 43 49 49 0a 30 78 34 30 29 2c 20 r (ASCII.0x40),
1000: 74 68 65 6e 20 74 68 65 20 6f 66 66 73 65 74 2c then the offset,
1010: 20 66 6f 6c 6c 6f 77 65 64 20 62 79 20 61 20 63 followed by a c
1020: 6f 6d 6d 61 20 28 41 53 43 49 49 20 30 78 32 63 omma (ASCII 0x2c
1030: 29 2e 3c 2f 70 3e 0a 0a 3c 61 20 6e 61 6d 65 3d ).</p>..<a name=
1040: 22 69 6e 74 63 6f 64 69 6e 67 22 3e 3c 2f 61 3e "intcoding"></a>
1050: 3c 68 32 3e 32 2e 30 20 45 6e 63 6f 64 69 6e 67 <h2>2.0 Encoding
1060: 20 6f 66 20 69 6e 74 65 67 65 72 73 3c 2f 68 32 of integers</h2
1070: 3e 0a 0a 3c 70 3e 0a 54 68 65 20 66 6f 72 6d 61 >..<p>.The forma
1080: 74 20 63 75 72 72 65 6e 74 6c 79 20 68 61 6e 64 t currently hand
1090: 6c 65 73 20 6f 6e 6c 79 20 33 32 20 62 69 74 20 les only 32 bit
10a0: 69 6e 74 65 67 65 72 20 6e 75 6d 62 65 72 73 2e integer numbers.
10b0: 20 54 68 65 79 20 61 72 65 0a 77 72 69 74 74 65 They are.writte
10c0: 6e 20 62 61 73 65 2d 36 34 20 65 6e 63 6f 64 65 n base-64 encode
10d0: 64 2c 20 4d 53 42 20 66 69 72 73 74 2c 20 61 6e d, MSB first, an
10e0: 64 20 77 69 74 68 6f 75 74 20 6c 65 61 64 69 6e d without leadin
10f0: 67 0a 22 30 22 2d 63 68 61 72 61 63 74 65 72 73 g."0"-characters
1100: 2c 20 65 78 63 65 70 74 20 69 66 20 74 68 65 79 , except if they
1110: 20 61 72 65 20 73 69 67 6e 69 66 69 63 61 6e 74 are significant
1120: 20 28 69 2e 65 2e 20 30 20 3d 3e 20 22 30 22 29 (i.e. 0 => "0")
1130: 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 54 68 65 20 ..</p>..<p>.The
1140: 62 61 73 65 2d 36 34 20 63 6f 64 69 6e 67 20 69 base-64 coding i
1150: 73 20 64 65 73 63 72 69 62 65 64 20 69 6e 0a 3c s described in.<
1160: 61 20 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77 a href="http://w
1170: 77 77 2e 69 65 74 66 2e 6f 72 67 2f 72 66 63 2f ww.ietf.org/rfc/
1180: 72 66 63 33 35 34 38 2e 74 78 74 22 3e 52 46 43 rfc3548.txt">RFC
1190: 20 33 35 34 38 3c 2f 61 3e 2e 0a 3c 2f 70 3e 0a 3548</a>..</p>.
11a0: 0a 3c 61 20 6e 61 6d 65 3d 22 65 78 61 6d 70 6c .<a name="exampl
11b0: 65 73 22 3e 3c 2f 61 3e 3c 68 32 3e 33 2e 30 20 es"></a><h2>3.0
11c0: 45 78 61 6d 70 6c 65 73 3c 2f 68 32 3e 0a 0a 3c Examples</h2>..<
11d0: 61 20 6e 61 6d 65 3d 22 65 78 61 6d 70 6c 65 73 a name="examples
11e0: 69 6e 74 22 3e 3c 2f 61 3e 3c 68 33 3e 33 2e 31 int"></a><h3>3.1
11f0: 20 49 6e 74 65 67 65 72 20 65 6e 63 6f 64 69 6e Integer encodin
1200: 67 3c 2f 68 33 3e 0a 0a 3c 74 61 62 6c 65 20 62 g</h3>..<table b
1210: 6f 72 64 65 72 3d 31 3e 0a 3c 74 72 3e 0a 3c 74 order=1>.<tr>.<t
1220: 68 3e 56 61 6c 75 65 3c 2f 74 68 3e 0a 3c 74 68 h>Value</th>.<th
1230: 3e 45 6e 63 6f 64 69 6e 67 3c 2f 74 68 3e 0a 3c >Encoding</th>.<
1240: 2f 74 72 3e 0a 3c 74 72 3e 0a 3c 74 64 3e 30 3c /tr>.<tr>.<td>0<
1250: 2f 74 64 3e 0a 3c 74 64 3e 30 3c 2f 74 64 3e 0a /td>.<td>0</td>.
1260: 3c 2f 74 72 3e 0a 3c 74 72 3e 0a 3c 74 64 3e 36 </tr>.<tr>.<td>6
1270: 32 34 36 3c 2f 74 64 3e 0a 3c 74 64 3e 31 58 62 246</td>.<td>1Xb
1280: 3c 2f 74 64 3e 0a 3c 2f 74 72 3e 0a 3c 74 72 3e </td>.</tr>.<tr>
1290: 0a 3c 74 64 3e 2d 31 31 30 31 34 33 38 37 37 30 .<td>-1101438770
12a0: 3c 2f 74 64 3e 0a 3c 74 64 3e 32 7a 4d 4d 33 45 </td>.<td>2zMM3E
12b0: 3c 2f 74 64 3e 0a 3c 2f 74 72 3e 0a 3c 2f 74 61 </td>.</tr>.</ta
12c0: 62 6c 65 3e 0a 0a 3c 61 20 6e 61 6d 65 3d 22 65 ble>..<a name="e
12d0: 78 61 6d 70 6c 65 73 64 65 6c 74 61 22 3e 3c 2f xamplesdelta"></
12e0: 61 3e 3c 68 33 3e 33 2e 32 20 44 65 6c 74 61 20 a><h3>3.2 Delta
12f0: 65 6e 63 6f 64 69 6e 67 3c 2f 68 33 3e 0a 0a 3c encoding</h3>..<
1300: 70 3e 41 6e 20 65 78 61 6d 70 6c 65 20 6f 66 20 p>An example of
1310: 61 20 64 65 6c 74 61 20 75 73 69 6e 67 20 74 68 a delta using th
1320: 65 20 73 70 65 63 69 66 69 65 64 20 65 6e 63 6f e specified enco
1330: 64 69 6e 67 20 69 73 3a 3c 2f 70 3e 0a 0a 3c 74 ding is:</p>..<t
1340: 61 62 6c 65 20 62 6f 72 64 65 72 3d 31 3e 3c 74 able border=1><t
1350: 72 3e 3c 74 64 3e 3c 70 72 65 3e 0a 31 58 62 0a r><td><pre>.1Xb.
1360: 34 45 40 30 2c 32 3a 74 68 46 4e 40 34 43 2c 36 4E@0,2:thFN@4C,6
1370: 3a 73 63 65 6e 64 61 31 42 40 4a 64 2c 36 3a 73 :scenda1B@Jd,6:s
1380: 63 65 6e 64 61 35 78 40 4b 74 2c 36 3a 70 69 65 cenda5x@Kt,6:pie
1390: 63 65 73 37 39 40 51 74 2c 46 3a 20 45 78 61 6d ces79@Qt,F: Exam
13a0: 70 6c 65 3a 20 65 73 6b 69 6c 7e 45 40 59 30 2c ple: eskil~E@Y0,
13b0: 32 7a 4d 4d 33 45 3b 3c 2f 70 72 65 3e 0a 3c 2f 2zMM3E;</pre>.</
13c0: 74 64 3e 3c 2f 74 72 3e 3c 2f 74 61 62 6c 65 3e td></tr></table>
13d0: 0a 0a 3c 70 3e 54 68 69 73 20 63 61 6e 20 62 65 ..<p>This can be
13e0: 20 74 61 6b 65 6e 20 61 70 61 72 74 20 69 6e 74 taken apart int
13f0: 6f 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 o the following
1400: 70 61 72 74 73 3a 3c 2f 70 3e 0a 0a 3c 74 61 62 parts:</p>..<tab
1410: 6c 65 20 62 6f 72 64 65 72 3d 31 3e 0a 3c 74 72 le border=1>.<tr
1420: 3e 3c 74 68 3e 57 68 61 74 20 20 3c 2f 74 68 3e ><th>What </th>
1430: 20 3c 74 68 3e 45 6e 63 6f 64 69 6e 67 20 20 20 <th>Encoding
1440: 20 20 20 20 20 20 3c 2f 74 68 3e 3c 74 68 3e 4d </th><th>M
1450: 65 61 6e 69 6e 67 20 3c 2f 74 68 3e 3c 74 68 3e eaning </th><th>
1460: 44 65 74 61 69 6c 73 3c 2f 74 68 3e 3c 2f 74 72 Details</th></tr
1470: 3e 0a 3c 74 72 3e 3c 74 64 3e 48 65 61 64 65 72 >.<tr><td>Header
1480: 3c 2f 74 64 3e 20 3c 74 64 3e 31 58 62 20 20 20 </td> <td>1Xb
1490: 20 20 20 20 20 20 20 20 20 20 20 3c 2f 74 64 3e </td>
14a0: 3c 74 64 3e 53 69 7a 65 20 20 20 20 3c 2f 74 64 <td>Size </td
14b0: 3e 3c 74 64 3e 20 36 32 34 36 09 20 20 20 20 20 ><td> 6246.
14c0: 3c 2f 74 64 3e 3c 2f 74 72 3e 0a 3c 74 72 3e 3c </td></tr>.<tr><
14d0: 74 64 3e 53 2d 4c 69 73 74 3c 2f 74 64 3e 20 3c td>S-List</td> <
14e0: 74 64 3e 34 45 40 30 2c 09 20 20 20 20 20 20 20 td>4E@0,.
14f0: 20 20 3c 2f 74 64 3e 3c 74 64 3e 43 6f 70 79 20 </td><td>Copy
1500: 20 20 20 3c 2f 74 64 3e 3c 74 64 3e 20 32 37 30 </td><td> 270
1510: 20 40 20 30 09 20 20 20 20 20 3c 2f 74 64 3e 3c @ 0. </td><
1520: 2f 74 72 3e 0a 3c 74 72 3e 3c 74 64 3e 26 6e 62 /tr>.<tr><td>&nb
1530: 73 70 3b 3c 2f 74 64 3e 20 3c 74 64 3e 32 3a 74 sp;</td> <td>2:t
1540: 68 09 20 20 20 20 20 20 20 20 20 3c 2f 74 64 3e h. </td>
1550: 3c 74 64 3e 4c 69 74 65 72 61 6c 20 3c 2f 74 64 <td>Literal </td
1560: 3e 3c 74 64 3e 20 32 20 27 74 68 27 09 20 20 20 ><td> 2 'th'.
1570: 20 20 3c 2f 74 64 3e 3c 2f 74 72 3e 0a 3c 74 72 </td></tr>.<tr
1580: 3e 3c 74 64 3e 26 6e 62 73 70 3b 3c 2f 74 64 3e ><td> </td>
1590: 20 3c 74 64 3e 46 4e 40 34 43 2c 09 20 20 20 20 <td>FN@4C,.
15a0: 20 20 20 20 20 3c 2f 74 64 3e 3c 74 64 3e 43 6f </td><td>Co
15b0: 70 79 20 20 20 20 3c 2f 74 64 3e 3c 74 64 3e 20 py </td><td>
15c0: 39 38 33 20 40 20 32 36 38 09 20 20 20 20 20 3c 983 @ 268. <
15d0: 2f 74 64 3e 3c 2f 74 72 3e 0a 3c 74 72 3e 3c 74 /td></tr>.<tr><t
15e0: 64 3e 26 6e 62 73 70 3b 3c 2f 74 64 3e 20 3c 74 d> </td> <t
15f0: 64 3e 36 3a 73 63 65 6e 64 61 20 20 20 20 20 20 d>6:scenda
1600: 20 20 20 3c 2f 74 64 3e 3c 74 64 3e 4c 69 74 65 </td><td>Lite
1610: 72 61 6c 20 3c 2f 74 64 3e 3c 74 64 3e 20 36 20 ral </td><td> 6
1620: 27 73 63 65 6e 64 61 27 09 20 20 20 20 20 3c 2f 'scenda'. </
1630: 74 64 3e 3c 2f 74 72 3e 0a 3c 74 72 3e 3c 74 64 td></tr>.<tr><td
1640: 3e 26 6e 62 73 70 3b 3c 2f 74 64 3e 20 3c 74 64 > </td> <td
1650: 3e 31 42 40 4a 64 2c 09 20 20 20 20 20 20 20 20 >1B@Jd,.
1660: 20 3c 2f 74 64 3e 3c 74 64 3e 43 6f 70 79 20 20 </td><td>Copy
1670: 20 20 3c 2f 74 64 3e 3c 74 64 3e 20 37 35 20 40 </td><td> 75 @
1680: 20 31 32 35 36 09 20 20 20 20 20 3c 2f 74 64 3e 1256. </td>
1690: 3c 2f 74 72 3e 0a 3c 74 72 3e 3c 74 64 3e 26 6e </tr>.<tr><td>&n
16a0: 62 73 70 3b 3c 2f 74 64 3e 20 3c 74 64 3e 36 3a bsp;</td> <td>6:
16b0: 73 63 65 6e 64 61 20 20 20 20 20 20 20 20 20 3c scenda <
16c0: 2f 74 64 3e 3c 74 64 3e 4c 69 74 65 72 61 6c 20 /td><td>Literal
16d0: 3c 2f 74 64 3e 3c 74 64 3e 20 36 20 27 73 63 65 </td><td> 6 'sce
16e0: 6e 64 61 27 09 20 20 20 20 20 3c 2f 74 64 3e 3c nda'. </td><
16f0: 2f 74 72 3e 0a 3c 74 72 3e 3c 74 64 3e 26 6e 62 /tr>.<tr><td>&nb
1700: 73 70 3b 3c 2f 74 64 3e 20 3c 74 64 3e 35 78 40 sp;</td> <td>5x@
1710: 4b 74 2c 09 20 20 20 20 20 20 20 20 20 3c 2f 74 Kt,. </t
1720: 64 3e 3c 74 64 3e 43 6f 70 79 20 20 20 20 3c 2f d><td>Copy </
1730: 74 64 3e 3c 74 64 3e 20 33 38 30 20 40 20 31 33 td><td> 380 @ 13
1740: 33 36 09 20 20 20 20 20 3c 2f 74 64 3e 3c 2f 74 36. </td></t
1750: 72 3e 0a 3c 74 72 3e 3c 74 64 3e 26 6e 62 73 70 r>.<tr><td> 
1760: 3b 3c 2f 74 64 3e 20 3c 74 64 3e 36 3a 70 69 65 ;</td> <td>6:pie
1770: 63 65 73 09 20 3c 2f 74 64 3e 3c 74 64 3e 4c 69 ces. </td><td>Li
1780: 74 65 72 61 6c 20 3c 2f 74 64 3e 3c 74 64 3e 20 teral </td><td>
1790: 36 20 27 70 69 65 63 65 73 27 09 20 20 20 20 20 6 'pieces'.
17a0: 3c 2f 74 64 3e 3c 2f 74 72 3e 0a 3c 74 72 3e 3c </td></tr>.<tr><
17b0: 74 64 3e 26 6e 62 73 70 3b 3c 2f 74 64 3e 20 3c td> </td> <
17c0: 74 64 3e 37 39 40 51 74 2c 09 20 20 20 20 20 20 td>79@Qt,.
17d0: 20 20 20 3c 2f 74 64 3e 3c 74 64 3e 43 6f 70 79 </td><td>Copy
17e0: 20 20 20 20 3c 2f 74 64 3e 3c 74 64 3e 20 34 35 </td><td> 45
17f0: 37 20 40 20 31 37 32 30 20 20 20 20 20 3c 2f 74 7 @ 1720 </t
1800: 64 3e 3c 2f 74 72 3e 0a 3c 74 72 3e 3c 74 64 3e d></tr>.<tr><td>
1810: 26 6e 62 73 70 3b 3c 2f 74 64 3e 20 3c 74 64 3e </td> <td>
1820: 46 3a 20 45 78 61 6d 70 6c 65 3a 20 65 73 6b 69 F: Example: eski
1830: 6c 3c 2f 74 64 3e 3c 74 64 3e 4c 69 74 65 72 61 l</td><td>Litera
1840: 6c 20 3c 2f 74 64 3e 3c 74 64 3e 20 31 35 20 27 l </td><td> 15 '
1850: 20 45 78 61 6d 70 6c 65 3a 20 65 73 6b 69 6c 27 Example: eskil'
1860: 3c 2f 74 64 3e 3c 2f 74 72 3e 0a 3c 74 72 3e 3c </td></tr>.<tr><
1870: 74 64 3e 26 6e 62 73 70 3b 3c 2f 74 64 3e 20 3c td> </td> <
1880: 74 64 3e 7e 45 40 59 30 2c 20 20 20 20 20 20 20 td>~E@Y0,
1890: 20 20 20 20 3c 2f 74 64 3e 3c 74 64 3e 43 6f 70 </td><td>Cop
18a0: 79 20 20 20 20 3c 2f 74 64 3e 3c 74 64 3e 20 20 y </td><td>
18b0: 34 30 34 36 20 40 20 32 31 37 36 20 20 20 20 20 4046 @ 2176
18c0: 20 20 20 3c 2f 74 64 3e 3c 2f 74 72 3e 0a 3c 74 </td></tr>.<t
18d0: 72 3e 3c 74 64 3e 54 72 61 69 6c 65 72 3c 2f 74 r><td>Trailer</t
18e0: 64 3e 3c 74 64 3e 32 7a 4d 4d 33 45 20 20 20 20 d><td>2zMM3E
18f0: 20 20 20 20 20 20 20 3c 2f 74 64 3e 3c 74 64 3e </td><td>
1900: 43 6b 65 63 6b 73 75 6d 3c 2f 74 64 3e 3c 74 64 Ckecksum</td><td
1910: 3e 20 2d 31 31 30 31 34 33 38 37 37 30 20 20 20 > -1101438770
1920: 20 20 20 20 20 20 3c 2f 74 64 3e 3c 2f 74 72 3e </td></tr>
1930: 0a 3c 2f 74 61 62 6c 65 3e 0a 0a 3c 70 3e 54 68 .</table>..<p>Th
1940: 65 20 75 6e 69 66 69 65 64 20 64 69 66 66 20 62 e unified diff b
1950: 65 68 69 6e 64 20 74 68 65 20 61 62 6f 76 65 20 ehind the above
1960: 64 65 6c 74 61 20 69 73 3c 2f 70 3e 0a 0a 3c 74 delta is</p>..<t
1970: 61 62 6c 65 20 62 6f 72 64 65 72 3d 31 3e 3c 74 able border=1><t
1980: 72 3e 3c 74 64 3e 3c 70 72 65 3e 0a 62 6c 75 65 r><td><pre>.blue
1990: 70 65 61 6b 3a 28 37 36 31 29 20 7e 2f 50 72 6f peak:(761) ~/Pro
19a0: 6a 65 63 74 73 2f 54 63 6c 2f 46 6f 73 73 69 6c jects/Tcl/Fossil
19b0: 2f 44 65 76 65 6c 2f 64 65 76 65 6c 20 3e 20 64 /Devel/devel > d
19c0: 69 66 66 20 2d 75 20 2e 2e 2f 44 45 4c 54 41 2f iff -u ../DELTA/
19d0: 6f 6c 64 20 2e 2e 2f 44 45 4c 54 41 2f 6e 65 77 old ../DELTA/new
19e0: 20 0a 2d 2d 2d 20 2e 2e 2f 44 45 4c 54 41 2f 6f .--- ../DELTA/o
19f0: 6c 64 20 20 20 20 20 20 20 20 32 30 30 37 2d 30 ld 2007-0
1a00: 38 2d 32 33 20 32 31 3a 31 34 3a 34 30 2e 30 30 8-23 21:14:40.00
1a10: 30 30 30 30 30 30 30 20 2d 30 37 30 30 0a 2b 2b 0000000 -0700.++
1a20: 2b 20 2e 2e 2f 44 45 4c 54 41 2f 6e 65 77 20 20 + ../DELTA/new
1a30: 20 20 20 20 20 20 32 30 30 37 2d 30 38 2d 32 33 2007-08-23
1a40: 20 32 31 3a 31 34 3a 33 33 2e 30 30 30 30 30 30 21:14:33.000000
1a50: 30 30 30 20 2d 30 37 30 30 0a 40 40 20 2d 35 2c 000 -0700.@@ -5,
1a60: 37 20 2b 35 2c 37 20 40 40 0a 20 0a 20 20 2a 20 7 +5,7 @@. . *
1a70: 20 49 66 20 74 68 65 20 73 65 72 76 65 72 20 64 If the server d
1a80: 6f 65 73 20 6e 6f 74 20 68 61 76 65 20 77 72 69 oes not have wri
1a90: 74 65 20 70 65 72 6d 69 73 73 69 6f 6e 20 6f 6e te permission on
1aa0: 20 74 68 65 20 64 61 74 61 62 61 73 65 0a 20 20 the database.
1ab0: 20 20 20 66 69 6c 65 2c 20 6f 72 20 6f 6e 20 74 file, or on t
1ac0: 68 65 20 64 69 72 65 63 74 6f 72 79 20 63 6f 6e he directory con
1ad0: 74 61 69 6e 69 6e 67 20 74 68 65 20 64 61 74 61 taining the data
1ae0: 62 61 73 65 20 66 69 6c 65 20 28 61 6e 64 20 0a base file (and .
1af0: 2d 20 20 20 20 69 74 20 69 73 20 74 68 75 73 20 - it is thus
1b00: 75 6e 61 62 6c 65 20 74 6f 20 75 70 64 61 74 65 unable to update
1b10: 20 64 61 74 61 62 61 73 65 20 62 65 63 61 75 73 database becaus
1b20: 65 20 69 74 20 63 61 6e 6e 6f 74 20 63 72 65 61 e it cannot crea
1b30: 74 65 0a 2b 20 20 20 20 69 74 20 69 73 20 74 68 te.+ it is th
1b40: 75 73 20 75 6e 61 62 6c 65 20 74 6f 20 75 70 64 us unable to upd
1b50: 61 74 65 20 74 68 65 20 64 61 74 61 62 61 73 65 ate the database
1b60: 20 62 65 63 61 75 73 65 20 69 74 20 63 61 6e 6e because it cann
1b70: 6f 74 20 63 72 65 61 74 65 0a 20 20 20 20 20 61 ot create. a
1b80: 20 72 6f 6c 6c 62 61 63 6b 20 6a 6f 75 72 6e 61 rollback journa
1b90: 6c 29 20 74 68 65 6e 20 69 74 20 63 75 72 72 65 l) then it curre
1ba0: 6e 74 6c 79 20 66 61 69 6c 73 20 73 69 6c 65 6e ntly fails silen
1bb0: 74 6c 79 20 6f 6e 20 61 20 70 75 73 68 2e 0a 20 tly on a push..
1bc0: 20 20 20 20 49 74 20 6e 65 65 64 73 20 74 6f 20 It needs to
1bd0: 72 65 74 75 72 6e 20 61 20 68 65 6c 70 66 75 6c return a helpful
1be0: 20 65 72 72 6f 72 2e 0a 20 0a 40 40 20 2d 32 37 error.. .@@ -27
1bf0: 2c 38 20 2b 32 37 2c 38 20 40 40 0a 20 20 2a 20 ,8 +27,8 @@. *
1c00: 20 41 64 64 69 74 69 6f 6e 61 6c 20 69 6e 66 6f Additional info
1c10: 72 6d 61 74 69 6f 6e 20 64 69 73 70 6c 61 79 65 rmation displaye
1c20: 64 20 66 6f 72 20 74 68 65 20 22 76 69 6e 66 6f d for the "vinfo
1c30: 22 20 70 61 67 65 3a 0a 20 0a 20 20 20 20 20 20 " page:. .
1c40: 2b 20 20 41 6c 6c 20 6c 65 61 76 65 73 20 6f 66 + All leaves of
1c50: 20 74 68 69 73 20 76 65 72 73 69 6f 6e 20 74 68 this version th
1c60: 61 74 20 61 72 65 20 6e 6f 74 20 69 6e 63 6c 75 at are not inclu
1c70: 64 65 64 20 69 6e 20 74 68 65 0a 2d 20 20 20 20 ded in the.-
1c80: 20 20 20 20 64 65 73 63 65 6e 64 61 6e 74 20 6c descendant l
1c90: 69 73 74 2e 20 20 57 69 74 68 20 64 61 74 65 2c ist. With date,
1ca0: 20 75 73 65 72 2c 20 63 6f 6d 6d 65 6e 74 2c 20 user, comment,
1cb0: 61 6e 64 20 68 79 70 65 72 6c 69 6e 6b 2e 0a 2d and hyperlink..-
1cc0: 20 20 20 20 20 20 20 20 4c 65 61 76 65 73 20 69 Leaves i
1cd0: 6e 20 74 68 65 20 64 65 73 63 65 6e 64 61 6e 74 n the descendant
1ce0: 20 74 61 62 6c 65 20 73 68 6f 75 6c 64 20 62 65 table should be
1cf0: 20 6d 61 72 6b 65 64 20 61 73 20 73 75 63 68 2e marked as such.
1d00: 0a 2b 20 20 20 20 20 20 20 20 64 65 73 63 65 6e .+ descen
1d10: 64 61 6e 74 20 6c 69 73 74 2e 20 20 57 69 74 68 dant list. With
1d20: 20 64 61 74 65 2c 20 75 73 65 72 2c 20 63 6f 6d date, user, com
1d30: 6d 65 6e 74 2c 20 61 6e 64 20 68 79 70 65 72 6c ment, and hyperl
1d40: 69 6e 6b 2e 0a 2b 20 20 20 20 20 20 20 20 4c 65 ink..+ Le
1d50: 61 76 65 73 20 69 6e 20 74 68 65 20 64 65 73 63 aves in the desc
1d60: 65 6e 64 61 6e 74 20 74 61 62 6c 65 20 73 68 6f endant table sho
1d70: 75 6c 64 20 62 65 20 6d 61 72 6b 65 64 20 61 73 uld be marked as
1d80: 20 73 75 63 68 2e 0a 20 20 20 20 20 20 20 20 20 such..
1d90: 53 65 65 20 74 68 65 20 63 6f 6d 70 75 74 65 5f See the compute_
1da0: 6c 65 61 76 65 73 28 29 20 66 75 6e 63 74 69 6f leaves() functio
1db0: 6e 20 74 6f 20 73 65 65 20 68 6f 77 20 74 6f 20 n to see how to
1dc0: 66 69 6e 64 20 61 6c 6c 0a 20 20 20 20 20 20 20 find all.
1dd0: 20 20 6c 65 61 76 65 73 2e 0a 20 20 20 20 20 20 leaves..
1de0: 2b 20 20 41 64 64 20 66 69 6c 65 20 64 69 66 66 + Add file diff
1df0: 20 6c 69 6e 6b 73 20 74 6f 20 74 68 65 20 66 69 links to the fi
1e00: 6c 65 20 63 68 61 6e 67 65 20 6c 69 73 74 2e 0a le change list..
1e10: 40 40 20 2d 33 37 2c 37 20 2b 33 37 2c 37 20 40 @@ -37,7 +37,7 @
1e20: 40 0a 20 0a 20 20 2a 20 20 54 68 65 20 2f 78 66 @. . * The /xf
1e30: 65 72 20 68 61 6e 64 6c 65 72 20 28 66 6f 72 20 er handler (for
1e40: 70 75 73 68 2c 20 70 75 6c 6c 2c 20 61 6e 64 20 push, pull, and
1e50: 63 6c 6f 6e 65 29 20 64 6f 65 73 20 6e 6f 74 20 clone) does not
1e60: 64 6f 0a 20 20 20 20 20 64 65 6c 74 61 20 63 6f do. delta co
1e70: 6d 70 72 65 73 73 69 6f 6e 2e 20 20 54 68 69 73 mpression. This
1e80: 20 72 65 73 75 6c 74 73 20 69 6e 20 65 78 63 65 results in exce
1e90: 73 73 20 62 61 6e 64 77 69 64 74 68 20 75 73 61 ss bandwidth usa
1ea0: 67 65 2e 0a 2d 20 20 20 20 54 68 65 72 65 20 61 ge..- There a
1eb0: 72 65 20 73 6f 6d 65 20 63 6f 64 65 20 69 6e 20 re some code in
1ec0: 78 66 65 72 2e 63 20 74 68 61 74 20 61 72 65 20 xfer.c that are
1ed0: 73 6b 65 74 63 68 65 73 20 6f 66 20 69 64 65 61 sketches of idea
1ee0: 73 20 6f 6e 0a 2b 20 20 20 20 54 68 65 72 65 20 s on.+ There
1ef0: 61 72 65 20 73 6f 6d 65 20 70 69 65 63 65 73 20 are some pieces
1f00: 69 6e 20 78 66 65 72 2e 63 20 74 68 61 74 20 61 in xfer.c that a
1f10: 72 65 20 73 6b 65 74 63 68 65 73 20 6f 66 20 69 re sketches of i
1f20: 64 65 61 73 20 6f 6e 0a 20 20 20 20 20 68 6f 77 deas on. how
1f30: 20 74 6f 20 64 6f 20 64 65 6c 74 61 20 63 6f 6d to do delta com
1f40: 70 72 65 73 73 69 6f 6e 2c 20 62 75 74 20 6e 6f pression, but no
1f50: 74 68 69 6e 67 20 68 61 73 20 62 65 65 6e 20 69 thing has been i
1f60: 6d 70 6c 65 6d 65 6e 74 65 64 2e 0a 20 0a 20 20 mplemented.. .
1f70: 2a 20 20 45 6e 68 61 6e 63 65 6d 65 6e 74 73 20 * Enhancements
1f80: 74 6f 20 74 68 65 20 64 69 66 66 20 61 6e 64 20 to the diff and
1f90: 74 6b 64 69 66 66 20 63 6f 6d 6d 61 6e 64 73 20 tkdiff commands
1fa0: 69 6e 20 74 68 65 20 63 6c 69 2e 0a 40 40 20 2d in the cli..@@ -
1fb0: 34 35 2c 37 20 2b 34 35 2c 37 20 40 40 0a 20 20 45,7 +45,7 @@.
1fc0: 20 20 20 73 69 6e 67 6c 65 20 66 69 6c 65 2e 20 single file.
1fd0: 20 41 6c 6c 6f 77 20 64 69 66 66 73 20 61 67 61 Allow diffs aga
1fe0: 69 6e 73 74 20 61 6e 79 20 74 77 6f 20 61 72 62 inst any two arb
1ff0: 69 74 72 61 72 79 20 76 65 72 73 69 6f 6e 73 2c itrary versions,
2000: 0a 20 20 20 20 20 6e 6f 74 20 6a 75 73 74 20 64 . not just d
2010: 69 66 66 73 20 61 67 61 69 6e 73 74 20 74 68 65 iffs against the
2020: 20 63 75 72 72 65 6e 74 20 63 68 65 63 6b 2d 6f current check-o
2030: 75 74 2e 20 20 41 6c 6c 6f 77 20 0a 20 20 20 20 ut. Allow .
2040: 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 6f configuration o
2050: 70 74 69 6f 6e 73 20 74 6f 20 72 65 70 6c 61 63 ptions to replac
2060: 65 20 74 6b 64 69 66 66 20 77 69 74 68 20 73 6f e tkdiff with so
2070: 6d 65 20 6f 74 68 65 72 0a 2d 20 20 20 20 76 69 me other.- vi
2080: 73 75 61 6c 20 64 69 66 66 65 72 20 6f 66 20 74 sual differ of t
2090: 68 65 20 75 73 65 72 73 20 63 68 6f 69 63 65 2e he users choice.
20a0: 0a 2b 20 20 20 20 76 69 73 75 61 6c 20 64 69 66 .+ visual dif
20b0: 66 65 72 20 6f 66 20 74 68 65 20 75 73 65 72 73 fer of the users
20c0: 20 63 68 6f 69 63 65 2e 20 45 78 61 6d 70 6c 65 choice. Example
20d0: 3a 20 65 73 6b 69 6c 2e 0a 20 0a 20 20 2a 20 20 : eskil.. . *
20e0: 54 69 63 6b 65 74 69 6e 67 20 69 6e 74 65 72 66 Ticketing interf
20f0: 61 63 65 20 28 65 78 70 61 6e 64 20 74 68 69 73 ace (expand this
2100: 20 62 75 6c 6c 65 74 29 0a 0a 3c 2f 70 72 65 3e bullet)..</pre>
2110: 3c 2f 74 64 3e 3c 2f 74 72 3e 3c 2f 74 61 62 6c </td></tr></tabl
2120: 65 3e 0a 0a 0a 0a 3c 61 20 6e 61 6d 65 3d 22 6e e>....<a name="n
2130: 6f 74 65 73 22 3e 3c 2f 61 3e 3c 68 32 3e 4e 6f otes"></a><h2>No
2140: 74 65 73 3c 2f 68 32 3e 0a 0a 3c 75 6c 3e 0a 3c tes</h2>..<ul>.<
2150: 6c 69 3e 50 75 72 65 20 74 65 78 74 20 66 69 6c li>Pure text fil
2160: 65 73 20 67 65 6e 65 72 61 74 65 20 61 20 70 75 es generate a pu
2170: 72 65 20 74 65 78 74 20 64 65 6c 74 61 2e 0a 3c re text delta..<
2180: 2f 6c 69 3e 0a 3c 6c 69 3e 42 69 6e 61 72 79 20 /li>.<li>Binary
2190: 66 69 6c 65 73 20 67 65 6e 65 72 61 74 65 20 61 files generate a
21a0: 20 64 65 6c 74 61 20 74 68 61 74 20 6d 61 79 20 delta that may
21b0: 63 6f 6e 74 61 69 6e 20 73 6f 6d 65 20 62 69 6e contain some bin
21c0: 61 72 79 20 64 61 74 61 2e 0a 3c 2f 6c 69 3e 0a ary data..</li>.
21d0: 3c 6c 69 3e 54 68 65 20 64 65 6c 74 61 20 65 6e <li>The delta en
21e0: 63 6f 64 69 6e 67 20 64 6f 65 73 20 6e 6f 74 20 coding does not
21f0: 61 74 74 65 6d 70 74 20 74 6f 20 63 6f 6d 70 72 attempt to compr
2200: 65 73 73 20 74 68 65 20 63 6f 6e 74 65 6e 74 0a ess the content.
2210: 49 74 20 77 61 73 20 63 6f 6e 73 69 64 65 72 65 It was considere
2220: 64 20 74 6f 20 62 65 20 6d 75 63 68 0a 6d 6f 72 d to be much.mor
2230: 65 20 73 65 6e 73 69 62 6c 65 20 74 6f 20 64 6f e sensible to do
2240: 20 63 6f 6d 70 72 65 73 73 69 6f 6e 20 75 73 69 compression usi
2250: 6e 67 20 61 20 73 65 70 61 72 61 74 65 20 67 65 ng a separate ge
2260: 6e 65 72 61 6c 2d 70 75 72 70 6f 73 65 0a 63 6f neral-purpose.co
2270: 6d 70 72 65 73 73 69 6f 6e 20 6c 69 62 72 61 72 mpression librar
2280: 79 2c 20 6c 69 6b 65 20 3c 61 20 68 72 65 66 3d y, like <a href=
2290: 22 68 74 74 70 3a 2f 2f 77 77 77 2e 7a 6c 69 62 "http://www.zlib
22a0: 2e 6e 65 74 22 3e 7a 6c 69 62 3c 2f 61 3e 2e 0a .net">zlib</a>..
22b0: 3c 2f 6c 69 3e 0a 3c 2f 75 6c 3e 0a </li>.</ul>.