Hex Artifact Content
Not logged in

Artifact 55dd24e8cf08f7cf689b2e2726535ca98afbc4bb:

File www/branching.wiki part of check-in [2e275c1420] - First draft of the "branching" document. by drh on 2009-01-23 21:24:00.

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 42 72 61 6e 63 68 69 6e 67 2c 20 46  r">.Branching, F
0020: 6f 72 6b 69 6e 67 2c 20 4d 65 72 67 69 6e 67 2c  orking, Merging,
0030: 20 61 6e 64 20 54 61 67 67 69 6e 67 0a 3c 2f 68   and Tagging.</h
0040: 31 3e 0a 0a 49 6e 20 61 20 73 69 6d 70 6c 65 20  1>..In a simple 
0050: 61 6e 64 20 70 65 72 66 65 63 74 20 77 6f 72 6c  and perfect worl
0060: 64 2c 20 74 68 65 20 64 65 76 65 6c 6f 70 6d 65  d, the developme
0070: 6e 74 20 6f 66 20 61 20 70 72 6f 6a 65 63 74 20  nt of a project 
0080: 77 6f 75 6c 64 20 70 72 6f 63 65 65 64 0a 6c 69  would proceed.li
0090: 6e 65 61 72 6c 79 2c 20 61 73 20 73 68 6f 77 6e  nearly, as shown
00a0: 20 69 6e 20 66 69 67 75 72 65 20 31 2e 0a 0a 3c   in figure 1...<
00b0: 63 65 6e 74 65 72 3e 3c 74 61 62 6c 65 20 62 6f  center><table bo
00c0: 72 64 65 72 3d 31 20 63 65 6c 6c 70 61 64 64 69  rder=1 cellpaddi
00d0: 6e 67 3d 31 30 20 68 73 70 61 63 65 3d 31 30 20  ng=10 hspace=10 
00e0: 76 73 70 61 63 65 3d 31 30 3e 0a 3c 74 72 3e 3c  vspace=10>.<tr><
00f0: 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72  td align="center
0100: 22 3e 0a 3c 69 6d 67 20 73 72 63 3d 22 62 72 61  ">.<img src="bra
0110: 6e 63 68 30 31 2e 67 69 66 22 3e 3c 62 72 3e 0a  nch01.gif"><br>.
0120: 46 69 67 75 72 65 20 31 0a 3c 2f 74 64 3e 3c 2f  Figure 1.</td></
0130: 74 72 3e 3c 2f 74 61 62 6c 65 3e 3c 2f 63 65 6e  tr></table></cen
0140: 74 65 72 3e 0a 0a 45 61 63 68 20 63 69 72 63 6c  ter>..Each circl
0150: 65 20 72 65 70 72 65 73 65 6e 74 73 20 61 20 63  e represents a c
0160: 68 65 63 6b 2d 69 6e 2e 20 20 46 6f 72 20 74 68  heck-in.  For th
0170: 65 20 73 61 6b 65 20 6f 66 20 63 6c 61 72 69 74  e sake of clarit
0180: 79 2c 20 74 68 65 20 63 68 65 63 6b 2d 69 6e 73  y, the check-ins
0190: 0a 61 72 65 20 67 69 76 65 6e 20 73 6d 61 6c 6c  .are given small
01a0: 20 63 6f 6e 73 65 63 75 74 69 76 65 20 6e 75 6d   consecutive num
01b0: 62 65 72 73 2e 20 20 49 6e 20 61 20 72 65 61 6c  bers.  In a real
01c0: 20 73 79 73 74 65 6d 2c 20 6f 66 20 63 6f 75 72   system, of cour
01d0: 73 65 2c 20 74 68 65 0a 63 68 65 63 6b 2d 69 6e  se, the.check-in
01e0: 20 6e 75 6d 62 65 72 73 20 77 6f 75 6c 64 20 62   numbers would b
01f0: 65 20 34 30 2d 63 68 61 72 61 63 74 65 72 20 53  e 40-character S
0200: 48 41 31 20 68 61 73 68 65 73 20 73 69 6e 63 65  HA1 hashes since
0210: 20 69 74 20 69 73 20 6e 6f 74 20 70 6f 73 73 69   it is not possi
0220: 62 6c 65 0a 74 6f 20 61 6c 6c 6f 63 61 74 65 20  ble.to allocate 
0230: 63 6f 6c 6c 69 73 69 6f 6e 2d 66 72 65 65 20 73  collision-free s
0240: 65 71 75 65 6e 74 69 61 6c 20 6e 75 6d 62 65 72  equential number
0250: 73 20 69 73 20 61 20 64 69 73 74 72 69 62 75 74  s is a distribut
0260: 65 64 20 73 79 73 74 65 6d 2e 0a 42 75 74 20 73  ed system..But s
0270: 65 71 75 65 6e 74 69 61 6c 20 6e 75 6d 62 65 72  equential number
0280: 73 20 61 72 65 20 65 61 73 69 65 72 20 74 6f 20  s are easier to 
0290: 72 65 61 64 2c 20 73 6f 20 77 65 20 77 69 6c 6c  read, so we will
02a0: 20 73 75 62 73 74 69 74 75 74 65 20 74 68 65 6d   substitute them
02b0: 20 66 6f 72 0a 74 68 65 20 34 30 2d 63 68 61 72   for.the 40-char
02c0: 61 63 74 65 72 20 53 48 41 31 20 68 61 73 68 65  acter SHA1 hashe
02d0: 73 20 69 6e 20 74 68 69 73 20 64 6f 63 75 6d 65  s in this docume
02e0: 6e 74 2e 0a 0a 54 68 65 20 61 72 72 6f 77 73 20  nt...The arrows 
02f0: 69 6e 20 66 69 67 75 72 65 20 31 20 73 68 6f 77  in figure 1 show
0300: 20 65 76 6f 6c 75 74 69 6f 6e 20 6f 66 20 74 68   evolution of th
0310: 65 20 70 72 6f 6a 65 63 74 2e 20 20 54 68 65 20  e project.  The 
0320: 69 6e 69 74 69 61 6c 0a 63 68 65 63 6b 2d 69 6e  initial.check-in
0330: 20 69 73 20 31 2e 20 20 43 68 65 63 6b 2d 69 6e   is 1.  Check-in
0340: 20 32 20 69 73 20 64 65 72 69 76 65 64 20 66 72   2 is derived fr
0350: 6f 6d 20 31 2e 20 20 49 6e 20 6f 74 68 65 72 20  om 1.  In other 
0360: 77 6f 72 64 73 2c 20 63 68 65 63 6b 2d 69 6e 20  words, check-in 
0370: 32 0a 77 61 73 20 63 72 65 61 74 65 64 20 62 79  2.was created by
0380: 20 6d 61 6b 69 6e 67 20 65 64 69 74 73 20 74 6f   making edits to
0390: 20 63 68 65 63 6b 2d 69 6e 20 31 20 61 6e 64 20   check-in 1 and 
03a0: 74 68 65 6e 20 63 6f 6d 6d 69 74 74 69 6e 67 20  then committing 
03b0: 74 68 6f 73 65 20 65 64 69 74 73 2e 0a 57 65 20  those edits..We 
03c0: 73 61 79 20 74 68 61 74 20 32 20 69 73 20 61 20  say that 2 is a 
03d0: 3c 69 3e 63 68 69 6c 64 3c 2f 69 3e 20 6f 66 20  <i>child</i> of 
03e0: 31 0a 61 6e 64 20 74 68 61 74 20 31 20 69 73 20  1.and that 1 is 
03f0: 61 20 3c 69 3e 70 61 72 65 6e 74 3c 2f 69 3e 20  a <i>parent</i> 
0400: 6f 66 20 32 2e 20 20 0a 43 68 65 63 6b 2d 69 6e  of 2.  .Check-in
0410: 20 33 20 69 73 20 64 65 72 69 76 65 64 20 66 72   3 is derived fr
0420: 6f 6d 20 63 68 65 63 6b 2d 69 6e 20 32 2c 20 6d  om check-in 2, m
0430: 61 6b 69 6e 67 0a 33 20 61 20 63 68 69 6c 64 20  aking.3 a child 
0440: 6f 66 20 32 2e 20 20 57 65 20 73 61 79 20 74 68  of 2.  We say th
0450: 61 74 20 33 20 69 73 20 61 20 3c 69 3e 64 65 73  at 3 is a <i>des
0460: 63 65 6e 64 61 6e 74 3c 2f 69 3e 20 6f 66 20 62  cendant</i> of b
0470: 6f 74 68 20 31 20 61 6e 64 20 32 20 61 6e 64 20  oth 1 and 2 and 
0480: 74 68 61 74 20 31 0a 61 6e 64 20 32 20 61 72 65  that 1.and 2 are
0490: 20 62 6f 74 68 20 3c 69 3e 61 6e 63 65 73 74 6f   both <i>ancesto
04a0: 72 73 3c 2f 69 3e 20 6f 66 20 33 2e 20 20 0a 0a  rs</i> of 3.  ..
04b0: 57 65 20 63 61 6c 6c 20 74 68 65 20 67 72 61 70  We call the grap
04c0: 68 20 6f 66 20 63 68 65 63 6b 2d 69 6e 73 20 61  h of check-ins a
04d0: 20 3c 69 3e 74 72 65 65 3c 2f 69 3e 2e 20 20 43   <i>tree</i>.  C
04e0: 68 65 63 6b 2d 69 6e 20 31 20 69 73 20 74 68 65  heck-in 1 is the
04f0: 20 3c 69 3e 72 6f 6f 74 3c 2f 69 3e 0a 73 69 6e   <i>root</i>.sin
0500: 63 65 20 69 74 20 68 61 73 20 6e 6f 20 61 6e 63  ce it has no anc
0510: 65 73 74 6f 72 73 2e 20 20 43 68 65 63 6b 2d 69  estors.  Check-i
0520: 6e 20 34 20 69 73 20 61 20 3c 69 3e 6c 65 61 66  n 4 is a <i>leaf
0530: 3c 2f 69 3e 20 6f 66 20 74 68 65 20 74 72 65 65  </i> of the tree
0540: 20 73 69 6e 63 65 0a 69 74 20 68 61 73 20 6e 6f   since.it has no
0550: 20 64 65 73 63 65 6e 64 61 6e 74 73 2e 20 20 0a   descendants.  .
0560: 0a 41 6c 61 73 2c 20 72 65 61 6c 69 74 79 20 6f  .Alas, reality o
0570: 66 74 65 6e 20 69 6e 74 65 72 66 65 72 65 73 20  ften interferes 
0580: 77 69 74 68 20 74 68 65 20 73 69 6d 70 6c 65 20  with the simple 
0590: 6c 69 6e 65 61 72 20 64 65 76 65 6c 6f 70 6d 65  linear developme
05a0: 6e 74 20 6f 66 20 61 0a 70 72 6f 6a 65 63 74 2e  nt of a.project.
05b0: 20 20 53 75 70 70 6f 73 65 20 74 77 6f 20 70 72    Suppose two pr
05c0: 6f 67 72 61 6d 6d 65 72 73 20 6d 61 6b 65 20 69  ogrammers make i
05d0: 6e 64 65 70 65 6e 64 65 6e 74 20 6d 6f 64 69 66  ndependent modif
05e0: 69 63 61 74 69 6f 6e 73 20 74 6f 20 63 68 65 63  ications to chec
05f0: 6b 2d 69 6e 20 32 2e 0a 41 66 74 65 72 20 62 6f  k-in 2..After bo
0600: 74 68 20 63 68 61 6e 67 65 73 20 61 72 65 20 63  th changes are c
0610: 68 65 63 6b 65 64 20 69 6e 2c 20 77 65 20 68 61  hecked in, we ha
0620: 76 65 20 61 20 63 68 65 63 6b 2d 69 6e 20 67 72  ve a check-in gr
0630: 61 70 68 20 74 68 61 74 20 6c 6f 6f 6b 73 20 0a  aph that looks .
0640: 6c 69 6b 65 20 66 69 67 75 72 65 20 32 3a 0a 0a  like figure 2:..
0650: 3c 63 65 6e 74 65 72 3e 3c 74 61 62 6c 65 20 62  <center><table b
0660: 6f 72 64 65 72 3d 31 20 63 65 6c 6c 70 61 64 64  order=1 cellpadd
0670: 69 6e 67 3d 31 30 20 68 73 70 61 63 65 3d 31 30  ing=10 hspace=10
0680: 20 76 73 70 61 63 65 3d 31 30 3e 0a 3c 74 72 3e   vspace=10>.<tr>
0690: 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65  <td align="cente
06a0: 72 22 3e 0a 3c 69 6d 67 20 73 72 63 3d 22 62 72  r">.<img src="br
06b0: 61 6e 63 68 30 32 2e 67 69 66 22 3e 3c 62 72 3e  anch02.gif"><br>
06c0: 0a 46 69 67 75 72 65 20 32 0a 3c 2f 74 64 3e 3c  .Figure 2.</td><
06d0: 2f 74 72 3e 3c 2f 74 61 62 6c 65 3e 3c 2f 63 65  /tr></table></ce
06e0: 6e 74 65 72 3e 0a 0a 54 68 65 20 67 72 61 70 68  nter>..The graph
06f0: 20 69 6e 20 66 69 67 75 72 65 20 32 20 68 61 73   in figure 2 has
0700: 20 74 77 6f 20 6c 65 61 76 65 73 3a 20 63 68 65   two leaves: che
0710: 63 6b 2d 69 6e 73 20 33 20 61 6e 64 20 34 2e 20  ck-ins 3 and 4. 
0720: 20 43 68 65 63 6b 2d 69 6e 20 32 20 68 61 73 0a   Check-in 2 has.
0730: 74 77 6f 20 63 68 69 6c 64 72 65 6e 2c 20 63 68  two children, ch
0740: 65 63 6b 2d 69 6e 73 20 33 20 61 6e 64 20 34 2e  eck-ins 3 and 4.
0750: 20 20 57 65 20 63 61 6c 6c 20 74 68 69 73 20 73    We call this s
0760: 74 69 74 75 61 74 69 6f 6e 20 61 20 3c 69 3e 66  tituation a <i>f
0770: 6f 72 6b 3c 2f 69 3e 2e 0a 0a 46 6f 73 73 69 6c  ork</i>...Fossil
0780: 20 74 72 69 65 73 20 74 6f 20 70 72 65 76 65 6e   tries to preven
0790: 74 20 66 6f 72 6b 73 2e 20 20 53 75 70 70 6f 73  t forks.  Suppos
07a0: 65 20 74 68 65 20 74 77 6f 20 70 72 6f 67 72 61  e the two progra
07b0: 6d 6d 65 72 73 20 77 68 6f 20 77 65 72 65 0a 65  mmers who were.e
07c0: 64 69 74 69 6e 67 20 63 68 65 63 6b 2d 69 6e 20  diting check-in 
07d0: 32 20 61 72 65 20 6e 61 6d 65 64 20 41 6c 69 63  2 are named Alic
07e0: 65 20 61 6e 64 20 42 6f 62 2e 20 20 53 75 70 70  e and Bob.  Supp
07f0: 6f 73 65 20 41 6c 69 63 65 20 66 69 6e 69 73 68  ose Alice finish
0800: 65 64 20 68 65 72 0a 65 64 69 74 73 20 66 69 72  ed her.edits fir
0810: 73 74 20 61 6e 64 20 64 69 64 20 61 20 63 6f 6d  st and did a com
0820: 6d 69 74 2c 20 72 65 73 75 6c 74 69 6e 67 20 69  mit, resulting i
0830: 6e 20 63 68 65 63 6b 2d 69 6e 20 33 2e 20 20 4c  n check-in 3.  L
0840: 61 74 65 72 2c 20 77 68 65 6e 20 42 6f 62 0a 74  ater, when Bob.t
0850: 72 69 65 64 20 74 6f 20 63 6f 6d 6d 69 74 20 68  ried to commit h
0860: 69 73 20 63 68 61 6e 67 65 73 2c 20 66 6f 73 73  is changes, foss
0870: 69 6c 20 77 6f 75 6c 64 20 74 72 79 20 74 6f 20  il would try to 
0880: 76 65 72 69 66 79 20 74 68 61 74 20 63 68 65 63  verify that chec
0890: 6b 2d 69 6e 20 32 0a 77 61 73 20 73 74 69 6c 6c  k-in 2.was still
08a0: 20 61 20 6c 65 61 66 2e 20 20 46 6f 73 73 69 6c   a leaf.  Fossil
08b0: 20 77 6f 75 6c 64 20 73 65 65 20 74 68 61 74 20   would see that 
08c0: 63 68 65 63 6b 2d 69 6e 20 33 20 68 61 64 20 6f  check-in 3 had o
08d0: 63 63 75 72 72 65 64 20 61 6e 64 20 77 6f 75 6c  ccurred and woul
08e0: 64 0a 61 62 6f 72 74 20 42 6f 62 27 73 20 63 6f  d.abort Bob's co
08f0: 6d 6d 69 74 20 61 74 74 65 6d 70 74 20 77 69 74  mmit attempt wit
0900: 68 20 61 20 6d 65 73 73 61 67 65 20 22 77 6f 75  h a message "wou
0910: 6c 64 20 66 6f 72 6b 22 2e 20 20 54 68 69 73 20  ld fork".  This 
0920: 61 6c 6c 6f 77 73 20 42 6f 62 0a 74 6f 20 64 6f  allows Bob.to do
0930: 20 61 20 22 66 6f 73 73 69 6c 20 75 70 64 61 74   a "fossil updat
0940: 65 22 20 77 68 69 63 68 20 77 6f 75 6c 64 20 70  e" which would p
0950: 75 6c 6c 20 69 6e 20 41 6c 69 63 65 73 20 63 68  ull in Alices ch
0960: 61 6e 67 65 73 20 61 6e 64 20 6d 65 72 67 65 20  anges and merge 
0970: 74 68 65 6d 0a 74 6f 67 65 74 68 65 72 20 77 69  them.together wi
0980: 74 68 20 68 69 73 20 6f 77 6e 20 63 68 61 6e 67  th his own chang
0990: 65 73 2e 20 20 41 66 74 65 72 20 6d 65 72 67 69  es.  After mergi
09a0: 6e 67 2c 20 42 6f 62 20 63 6f 75 6c 64 20 74 68  ng, Bob could th
09b0: 65 6e 20 63 6f 6d 6d 69 74 0a 63 68 65 63 6b 2d  en commit.check-
09c0: 69 6e 20 34 20 61 73 20 61 20 63 68 69 6c 64 20  in 4 as a child 
09d0: 6f 66 20 63 68 65 63 6b 2d 69 6e 20 33 20 61 6e  of check-in 3 an
09e0: 64 20 74 68 65 20 72 65 73 75 6c 74 20 77 6f 75  d the result wou
09f0: 6c 64 20 62 65 20 61 20 6c 69 6e 65 61 72 20 67  ld be a linear g
0a00: 72 61 70 68 0a 61 73 20 73 68 6f 77 6e 20 69 6e  raph.as shown in
0a10: 20 66 69 67 75 72 65 20 31 2e 20 20 54 68 69 73   figure 1.  This
0a20: 20 69 73 20 68 6f 77 20 43 56 53 20 77 6f 72 6b   is how CVS work
0a30: 73 2e 20 20 54 68 69 73 20 69 73 20 61 6c 73 6f  s.  This is also
0a40: 20 68 6f 77 20 66 6f 73 73 69 6c 0a 77 6f 72 6b   how fossil.work
0a50: 73 20 69 6e 20 22 61 75 74 6f 73 79 6e 63 22 20  s in "autosync" 
0a60: 6d 6f 64 65 2e 0a 0a 42 75 74 20 69 74 20 6d 69  mode...But it mi
0a70: 67 68 74 20 62 65 20 74 68 61 74 20 42 6f 62 20  ght be that Bob 
0a80: 69 73 20 6f 66 66 2d 6e 65 74 77 6f 72 6b 20 77  is off-network w
0a90: 68 65 6e 20 68 65 20 64 6f 65 73 20 68 69 73 20  hen he does his 
0aa0: 63 6f 6d 6d 69 74 2c 20 73 6f 20 68 65 0a 68 61  commit, so he.ha
0ab0: 73 20 6e 6f 20 77 61 79 20 6f 66 20 6b 6e 6f 77  s no way of know
0ac0: 69 6e 67 20 74 68 61 74 20 41 6c 69 63 65 20 68  ing that Alice h
0ad0: 61 73 20 61 6c 72 65 61 64 79 20 63 6f 6d 6d 69  as already commi
0ae0: 74 74 65 64 20 68 65 72 20 63 68 61 6e 67 65 73  tted her changes
0af0: 2e 0a 4f 72 2c 20 69 74 20 63 6f 75 6c 64 20 62  ..Or, it could b
0b00: 65 20 74 68 61 74 20 42 6f 62 20 68 61 73 20 74  e that Bob has t
0b10: 75 72 6e 65 64 20 6f 66 20 22 61 75 74 6f 73 79  urned of "autosy
0b20: 6e 63 22 20 6d 6f 64 65 20 69 6e 20 53 51 4c 69  nc" mode in SQLi
0b30: 74 65 2e 20 20 4f 72 2c 0a 6d 61 79 62 65 20 42  te.  Or,.maybe B
0b40: 6f 62 20 6a 75 73 74 20 64 6f 65 73 6e 27 74 20  ob just doesn't 
0b50: 77 61 6e 74 20 74 6f 20 6d 65 72 67 65 20 69 6e  want to merge in
0b60: 20 41 6c 69 63 65 73 20 63 68 61 6e 67 65 73 20   Alices changes 
0b70: 62 65 66 6f 72 65 20 68 65 20 68 61 73 0a 73 61  before he has.sa
0b80: 76 65 64 20 68 69 73 20 6f 77 6e 2c 20 73 6f 20  ved his own, so 
0b90: 68 65 20 66 6f 72 63 65 73 20 74 68 65 20 63 6f  he forces the co
0ba0: 6d 6d 69 74 20 74 6f 20 6f 63 63 75 72 20 75 73  mmit to occur us
0bb0: 69 6e 67 20 74 68 65 20 22 2d 2d 66 6f 72 63 65  ing the "--force
0bc0: 22 20 6f 70 74 69 6f 6e 0a 74 6f 20 74 68 65 20  " option.to the 
0bd0: 66 6f 73 73 69 6c 20 3c 62 3e 63 6f 6d 6d 69 74  fossil <b>commit
0be0: 3c 2f 62 3e 20 63 6f 6d 6d 61 6e 64 2e 20 20 46  </b> command.  F
0bf0: 6f 72 20 77 68 61 74 65 76 65 72 20 72 65 61 73  or whatever reas
0c00: 6f 6e 2c 20 74 77 6f 20 63 6f 6d 6d 69 74 73 20  on, two commits 
0c10: 61 67 61 69 6e 73 74 0a 63 68 65 63 6b 2d 69 6e  against.check-in
0c20: 20 32 20 68 61 76 65 20 6f 63 63 75 72 72 65 64   2 have occurred
0c30: 20 61 6e 64 20 6e 6f 77 20 74 68 65 20 74 72 65   and now the tre
0c40: 65 20 68 61 73 20 74 77 6f 20 6c 65 61 76 65 73  e has two leaves
0c50: 2e 0a 0a 53 6f 20 77 68 69 63 68 20 76 65 72 73  ...So which vers
0c60: 69 6f 6e 20 6f 66 20 74 68 65 20 70 72 6f 6a 65  ion of the proje
0c70: 63 74 20 69 73 20 74 68 65 20 22 6c 61 74 65 73  ct is the "lates
0c80: 74 22 20 69 6e 20 74 68 65 20 73 65 6e 73 65 20  t" in the sense 
0c90: 6f 66 20 68 61 76 69 6e 67 0a 74 68 65 20 6d 6f  of having.the mo
0ca0: 73 74 20 66 65 61 74 75 72 65 73 20 61 6e 64 20  st features and 
0cb0: 74 68 65 20 6d 6f 73 74 20 62 75 67 20 66 69 78  the most bug fix
0cc0: 65 73 3f 20 20 57 68 65 6e 20 74 68 65 72 65 20  es?  When there 
0cd0: 69 73 20 6d 6f 72 65 20 74 68 61 6e 0a 6f 6e 65  is more than.one
0ce0: 20 6c 65 61 66 20 69 6e 20 74 68 65 20 67 72 61   leaf in the gra
0cf0: 70 68 2c 20 79 6f 75 20 64 6f 6e 27 74 20 72 65  ph, you don't re
0d00: 61 6c 6c 79 20 6b 6e 6f 77 2e 20 20 53 6f 20 77  ally know.  So w
0d10: 65 20 6c 69 6b 65 20 74 6f 20 68 61 76 65 0a 67  e like to have.g
0d20: 72 61 70 68 73 20 77 69 74 68 20 61 20 73 69 6e  raphs with a sin
0d30: 67 6c 65 20 6c 65 61 66 2e 0a 0a 54 6f 20 72 65  gle leaf...To re
0d40: 73 6f 6c 76 65 20 74 68 69 73 20 73 69 74 75 61  solve this situa
0d50: 74 69 6f 6e 2c 20 41 6c 69 63 65 20 63 61 6e 20  tion, Alice can 
0d60: 75 73 65 20 74 68 65 20 66 6f 73 73 69 6c 20 3c  use the fossil <
0d70: 62 3e 6d 65 72 67 65 3c 2f 62 3e 20 63 6f 6d 6d  b>merge</b> comm
0d80: 61 6e 64 0a 74 6f 20 6d 65 20 6d 65 72 67 65 20  and.to me merge 
0d90: 69 6e 20 42 6f 62 27 73 20 63 68 61 6e 67 65 73  in Bob's changes
0da0: 20 69 6e 20 68 65 72 65 20 6c 6f 63 61 6c 20 63   in here local c
0db0: 6f 70 79 20 6f 66 20 63 68 65 63 6b 2d 69 6e 20  opy of check-in 
0dc0: 33 2e 20 20 54 68 65 6e 20 73 68 65 0a 63 61 6e  3.  Then she.can
0dd0: 20 63 6f 6d 6d 69 74 20 74 68 65 20 72 65 73 75   commit the resu
0de0: 6c 74 73 20 61 73 20 63 68 65 63 6b 2d 69 6e 20  lts as check-in 
0df0: 35 2e 20 20 54 68 69 73 20 72 65 73 75 6c 74 73  5.  This results
0e00: 20 69 6e 20 61 20 74 72 65 65 20 61 73 20 73 68   in a tree as sh
0e10: 6f 77 6e 0a 69 6e 20 66 69 67 75 72 65 20 33 2e  own.in figure 3.
0e20: 0a 0a 3c 63 65 6e 74 65 72 3e 3c 74 61 62 6c 65  ..<center><table
0e30: 20 62 6f 72 64 65 72 3d 31 20 63 65 6c 6c 70 61   border=1 cellpa
0e40: 64 64 69 6e 67 3d 31 30 20 68 73 70 61 63 65 3d  dding=10 hspace=
0e50: 31 30 20 76 73 70 61 63 65 3d 31 30 3e 0a 3c 74  10 vspace=10>.<t
0e60: 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e  r><td align="cen
0e70: 74 65 72 22 3e 0a 3c 69 6d 67 20 73 72 63 3d 22  ter">.<img src="
0e80: 62 72 61 6e 63 68 30 33 2e 67 69 66 22 3e 3c 62  branch03.gif"><b
0e90: 72 3e 0a 46 69 67 75 72 65 20 33 0a 3c 2f 74 64  r>.Figure 3.</td
0ea0: 3e 3c 2f 74 72 3e 3c 2f 74 61 62 6c 65 3e 3c 2f  ></tr></table></
0eb0: 63 65 6e 74 65 72 3e 0a 0a 43 68 65 63 6b 2d 69  center>..Check-i
0ec0: 6e 20 35 20 69 73 20 61 20 64 69 72 65 63 74 20  n 5 is a direct 
0ed0: 63 68 69 6c 64 20 6f 66 20 63 68 65 63 6b 2d 69  child of check-i
0ee0: 6e 20 33 20 62 65 63 61 75 73 65 20 69 74 20 77  n 3 because it w
0ef0: 61 73 20 63 72 65 61 74 65 64 20 62 79 20 65 64  as created by ed
0f00: 69 74 69 6e 67 0a 63 68 65 63 6b 2d 69 6e 20 33  iting.check-in 3
0f10: 2e 20 20 42 75 74 20 63 68 65 63 6b 2d 69 6e 20  .  But check-in 
0f20: 35 20 61 6c 73 6f 20 69 6e 68 65 72 69 74 73 20  5 also inherits 
0f30: 74 68 65 20 63 68 61 6e 67 65 73 20 66 72 6f 6d  the changes from
0f40: 20 63 68 65 63 6b 2d 69 6e 20 34 20 62 79 0a 76   check-in 4 by.v
0f50: 69 72 74 75 61 6c 20 6f 66 20 74 68 65 20 6d 65  irtual of the me
0f60: 72 67 65 2e 20 20 53 6f 20 77 65 20 73 61 79 20  rge.  So we say 
0f70: 74 68 61 74 20 63 68 65 63 6b 2d 69 6e 20 35 20  that check-in 5 
0f80: 69 73 20 61 20 3c 69 3e 6d 65 72 67 65 20 63 68  is a <i>merge ch
0f90: 69 6c 64 3c 2f 69 3e 0a 6f 66 20 63 68 65 63 6b  ild</i>.of check
0fa0: 2d 69 6e 20 34 20 61 6e 64 20 74 68 61 74 20 69  -in 4 and that i
0fb0: 74 20 69 73 20 61 20 3c 69 3e 64 69 72 65 63 74  t is a <i>direct
0fc0: 20 63 68 69 6c 64 3c 2f 69 3e 20 6f 66 20 63 68   child</i> of ch
0fd0: 65 63 6b 2d 69 6e 20 33 2e 20 20 0a 54 68 65 20  eck-in 3.  .The 
0fe0: 67 72 61 70 68 20 69 73 20 6e 6f 77 20 62 61 63  graph is now bac
0ff0: 6b 20 74 6f 20 61 20 73 69 6e 67 6c 65 20 6c 65  k to a single le
1000: 61 66 20 28 63 68 65 63 6b 2d 69 6e 20 35 29 2e  af (check-in 5).
1010: 0a 0a 57 65 20 68 61 76 65 20 61 6c 72 65 61 64  ..We have alread
1020: 79 20 73 65 65 6e 20 74 68 61 74 20 69 66 20 66  y seen that if f
1030: 6f 73 73 69 6c 20 69 73 20 69 6e 20 61 75 74 6f  ossil is in auto
1040: 73 79 6e 63 20 6d 6f 64 65 20 74 68 65 6e 20 42  sync mode then B
1050: 6f 62 20 77 6f 75 6c 64 0a 68 61 76 65 20 62 65  ob would.have be
1060: 65 6e 20 77 61 72 6e 65 64 20 61 62 6f 75 74 20  en warned about 
1070: 74 68 65 20 70 6f 74 65 6e 74 69 61 6c 20 66 6f  the potential fo
1080: 72 6b 20 74 68 65 20 66 69 72 73 74 20 74 69 6d  rk the first tim
1090: 65 20 68 65 20 74 72 69 65 64 20 74 6f 0a 63 6f  e he tried to.co
10a0: 6d 6d 69 74 20 63 68 65 63 6b 2d 69 6e 20 34 2e  mmit check-in 4.
10b0: 20 20 49 66 20 42 6f 62 20 68 61 64 20 75 70 64    If Bob had upd
10c0: 61 74 65 64 20 68 69 73 20 6c 6f 63 61 6c 20 63  ated his local c
10d0: 68 65 63 6b 2d 6f 75 74 20 74 6f 20 6d 65 72 67  heck-out to merg
10e0: 65 20 69 6e 0a 41 6c 69 63 65 27 73 20 63 68 65  e in.Alice's che
10f0: 63 6b 2d 69 6e 20 33 20 63 68 61 6e 67 65 73 2c  ck-in 3 changes,
1100: 20 74 68 65 6e 20 63 6f 6d 6d 69 74 74 65 64 2c   then committed,
1110: 20 74 68 65 6e 20 74 68 65 20 66 6f 72 6b 20 77   then the fork w
1120: 6f 75 6c 64 20 68 61 76 65 0a 6e 65 76 65 72 20  ould have.never 
1130: 6f 63 63 75 72 72 65 64 2e 20 20 54 68 65 20 72  occurred.  The r
1140: 65 73 75 6c 74 69 6e 67 20 67 72 61 70 68 20 77  esulting graph w
1150: 6f 75 6c 64 20 68 61 76 65 20 62 65 65 6e 20 6c  ould have been l
1160: 69 6e 65 61 72 2c 20 61 73 20 73 68 6f 77 6e 0a  inear, as shown.
1170: 69 6e 20 66 69 67 75 72 65 20 31 2e 20 20 52 65  in figure 1.  Re
1180: 61 6c 6c 79 20 74 68 65 20 67 72 61 70 68 20 6f  ally the graph o
1190: 66 20 66 69 67 75 72 65 20 31 20 69 73 20 61 20  f figure 1 is a 
11a0: 73 75 62 73 65 74 20 6f 66 20 66 69 67 75 72 65  subset of figure
11b0: 20 33 2e 0a 48 6f 6c 64 20 79 6f 75 72 20 68 61   3..Hold your ha
11c0: 6e 64 20 6f 76 65 72 20 74 68 65 20 63 68 65 63  nd over the chec
11d0: 6b 2d 69 6e 20 34 20 63 69 72 63 6c 65 20 6f 66  k-in 4 circle of
11e0: 20 66 69 67 75 72 65 20 33 20 61 6e 64 20 74 68   figure 3 and th
11f0: 65 6e 20 66 69 67 75 72 65 0a 33 20 6c 6f 6f 6b  en figure.3 look
1200: 73 20 65 78 61 63 74 6c 79 20 6c 69 6b 65 20 66  s exactly like f
1210: 69 67 75 72 65 20 31 20 28 65 78 63 65 70 74 20  igure 1 (except 
1220: 74 68 61 74 20 74 68 65 20 6c 65 61 66 20 68 61  that the leaf ha
1230: 73 20 61 20 64 69 66 66 65 72 65 6e 74 20 63 68  s a different ch
1240: 65 63 6b 2d 69 6e 0a 6e 75 6d 62 65 72 2c 20 62  eck-in.number, b
1250: 75 74 20 74 68 61 74 20 69 73 20 6a 75 73 74 20  ut that is just 
1260: 61 20 6e 6f 74 61 74 69 6f 6e 61 6c 20 64 69 66  a notational dif
1270: 66 65 72 65 6e 63 65 20 2d 20 74 68 65 20 74 77  ference - the tw
1280: 6f 20 63 68 65 63 6b 2d 69 6e 73 20 68 61 76 65  o check-ins have
1290: 0a 65 78 61 63 74 6c 79 20 74 68 65 20 73 61 6d  .exactly the sam
12a0: 65 20 63 6f 6e 74 65 6e 74 29 2e 20 20 49 6e 20  e content).  In 
12b0: 6f 74 68 65 72 20 77 6f 72 64 73 2c 20 66 69 67  other words, fig
12c0: 75 72 65 20 33 20 69 73 20 72 65 61 6c 6c 79 20  ure 3 is really 
12d0: 61 20 73 75 70 65 72 73 65 74 0a 6f 66 20 66 69  a superset.of fi
12e0: 67 75 72 65 20 31 2e 20 20 54 68 65 20 63 68 65  gure 1.  The che
12f0: 63 6b 2d 69 6e 20 34 20 6f 66 20 66 69 67 75 72  ck-in 4 of figur
1300: 65 20 33 20 63 61 70 74 75 72 65 73 20 61 64 64  e 3 captures add
1310: 69 74 69 6f 6e 20 73 74 61 74 65 20 77 68 69 63  ition state whic
1320: 68 0a 69 73 20 6f 6d 69 74 74 65 64 20 66 72 6f  h.is omitted fro
1330: 6d 20 66 69 67 75 72 65 20 31 2e 20 20 49 6e 20  m figure 1.  In 
1340: 63 68 65 63 6b 2d 69 6e 20 34 20 6f 66 20 66 69  check-in 4 of fi
1350: 67 75 72 65 20 33 20 69 73 20 61 20 63 6f 70 79  gure 3 is a copy
1360: 0a 6f 66 20 42 6f 62 27 73 20 6c 6f 63 61 6c 20  .of Bob's local 
1370: 63 68 65 63 6b 6f 75 74 20 62 65 66 6f 72 65 20  checkout before 
1380: 68 65 20 6d 65 72 67 65 64 20 69 6e 20 41 6c 69  he merged in Ali
1390: 63 65 73 20 63 68 61 6e 67 65 73 2e 20 20 54 68  ces changes.  Th
13a0: 61 74 20 73 6e 61 70 73 68 6f 74 0a 6f 66 20 42  at snapshot.of B
13b0: 6f 62 27 73 20 63 68 61 6e 67 65 73 20 69 6e 64  ob's changes ind
13c0: 65 70 65 6e 64 65 6e 74 20 6f 66 20 41 6c 69 63  ependent of Alic
13d0: 65 27 73 20 63 68 61 6e 67 65 73 20 69 73 20 6f  e's changes is o
13e0: 6d 69 74 74 65 64 20 66 72 6f 6d 20 66 69 67 75  mitted from figu
13f0: 72 65 20 31 2e 0a 53 6f 6d 65 20 70 65 6f 70 6c  re 1..Some peopl
1400: 65 20 73 61 79 20 74 68 61 74 20 74 68 65 20 61  e say that the a
1410: 70 70 72 6f 61 63 68 20 74 61 6b 65 6e 20 69 6e  pproach taken in
1420: 20 66 69 67 75 72 65 20 33 20 69 73 20 62 65 74   figure 3 is bet
1430: 74 65 72 20 62 65 63 61 75 73 65 20 69 74 0a 70  ter because it.p
1440: 72 65 73 65 72 76 65 73 20 74 68 69 73 20 65 78  reserves this ex
1450: 74 72 61 20 69 6e 74 65 72 6d 65 64 69 61 74 65  tra intermediate
1460: 20 73 74 61 74 65 2e 20 20 4f 74 68 65 72 73 20   state.  Others 
1470: 73 61 79 20 74 68 61 74 20 74 68 65 20 61 70 70  say that the app
1480: 72 6f 61 63 68 0a 74 61 6b 65 6e 20 69 6e 20 66  roach.taken in f
1490: 69 67 75 72 65 20 31 20 69 73 20 62 65 74 74 65  igure 1 is bette
14a0: 72 20 62 65 63 61 75 73 65 20 69 74 20 69 73 20  r because it is 
14b0: 6d 75 63 68 20 65 61 73 69 65 72 20 74 6f 20 76  much easier to v
14c0: 69 73 75 61 6c 69 7a 65 20 61 0a 6c 69 6e 65 61  isualize a.linea
14d0: 72 20 6c 69 6e 65 20 6f 66 20 64 65 76 65 6c 6f  r line of develo
14e0: 70 6d 65 6e 74 20 61 6e 64 20 62 65 63 61 75 73  pment and becaus
14f0: 65 20 74 68 65 20 74 68 65 20 6d 65 72 67 69 6e  e the the mergin
1500: 67 20 68 61 70 70 65 6e 73 20 61 75 74 6f 6d 61  g happens automa
1510: 74 69 63 61 6c 6c 79 0a 69 6e 73 74 65 61 64 20  tically.instead 
1520: 6f 66 20 61 73 20 61 20 73 65 70 61 72 61 74 65  of as a separate
1530: 20 6d 61 6e 75 61 6c 20 73 74 65 70 2e 20 20 57   manual step.  W
1540: 65 20 77 69 6c 6c 20 6e 6f 74 20 74 61 6b 65 20  e will not take 
1550: 73 69 64 65 73 20 69 6e 20 74 68 69 73 0a 64 65  sides in this.de
1560: 62 61 74 65 2e 20 20 57 65 20 77 69 6c 6c 20 73  bate.  We will s
1570: 69 6d 70 6c 79 20 70 6f 69 6e 74 20 6f 75 74 20  imply point out 
1580: 74 68 61 74 20 66 6f 73 73 69 6c 20 65 6e 61 62  that fossil enab
1590: 6c 65 73 20 79 6f 75 20 74 6f 20 64 6f 20 69 74  les you to do it
15a0: 20 65 69 74 68 65 72 20 77 61 79 2e 0a 0a 3c 68   either way...<h
15b0: 32 3e 46 6f 72 6b 69 6e 67 20 56 65 72 73 75 73  2>Forking Versus
15c0: 20 42 72 61 6e 63 68 69 6e 67 3c 2f 68 32 3e 0a   Branching</h2>.
15d0: 0a 46 6f 72 6b 69 6e 67 20 61 6e 64 20 68 61 76  .Forking and hav
15e0: 69 6e 67 20 6d 6f 72 65 20 74 68 61 6e 20 6f 6e  ing more than on
15f0: 65 20 6c 65 61 66 20 69 6e 20 74 68 65 20 63 68  e leaf in the ch
1600: 65 63 6b 2d 69 6e 20 74 72 65 65 20 69 73 20 75  eck-in tree is u
1610: 73 75 61 6c 6c 79 0a 63 6f 6e 73 69 64 65 72 65  sually.considere
1620: 64 20 75 6e 64 65 73 69 72 61 62 6c 65 2c 20 61  d undesirable, a
1630: 6e 64 20 73 6f 20 66 6f 72 6b 73 20 61 72 65 20  nd so forks are 
1640: 75 73 75 61 6c 6c 79 20 71 75 69 63 6b 6c 79 20  usually quickly 
1650: 72 65 73 6f 6c 76 65 64 20 61 73 20 0a 73 68 6f  resolved as .sho
1660: 77 6e 20 69 6e 20 66 69 67 75 72 65 20 33 20 61  wn in figure 3 a
1670: 62 6f 76 65 2e 0a 42 75 74 20 73 6f 6d 65 74 69  bove..But someti
1680: 6d 65 73 2c 20 6f 6e 65 20 64 6f 65 73 20 77 61  mes, one does wa
1690: 6e 74 20 74 6f 20 68 61 76 65 20 6d 75 6c 74 69  nt to have multi
16a0: 70 6c 65 20 6c 65 61 76 65 73 2e 20 20 46 6f 72  ple leaves.  For
16b0: 20 65 78 61 6d 70 6c 65 2c 20 61 20 70 72 6f 6a   example, a proj
16c0: 65 63 74 0a 6d 69 67 68 74 20 68 61 76 65 20 6f  ect.might have o
16d0: 6e 65 20 6c 65 61 66 20 74 68 61 74 20 69 73 20  ne leaf that is 
16e0: 74 68 65 20 6c 61 74 65 73 74 20 76 65 72 73 69  the latest versi
16f0: 6f 6e 20 6f 66 20 74 68 65 20 70 72 6f 6a 65 63  on of the projec
1700: 74 20 75 6e 64 65 72 0a 64 65 76 65 6c 6f 70 6d  t under.developm
1710: 65 6e 74 20 61 6e 64 20 61 6e 6f 74 68 65 72 20  ent and another 
1720: 6c 65 61 66 20 74 68 61 74 20 69 73 20 74 68 65  leaf that is the
1730: 20 6c 61 74 65 73 74 20 76 65 72 73 69 6f 6e 20   latest version 
1740: 74 68 61 74 20 68 61 73 20 62 65 65 6e 0a 74 65  that has been.te
1750: 73 74 65 64 2e 0a 57 68 65 6e 20 6d 75 6c 74 69  sted..When multi
1760: 70 6c 65 20 6c 65 61 76 65 73 20 61 72 65 20 64  ple leaves are d
1770: 65 73 69 72 61 62 6c 65 2c 20 77 65 20 63 61 6c  esirable, we cal
1780: 6c 20 74 68 65 20 70 68 65 6e 6f 6d 65 6e 6f 6e  l the phenomenon
1790: 20 3c 69 3e 62 72 61 6e 63 68 69 6e 67 3c 2f 69   <i>branching</i
17a0: 3e 0a 69 6e 73 74 65 61 64 20 6f 66 20 3c 69 3e  >.instead of <i>
17b0: 66 6f 72 6b 69 6e 67 3c 2f 69 3e 2e 0a 46 69 67  forking</i>..Fig
17c0: 75 72 65 20 34 20 73 68 6f 77 73 20 61 6e 20 65  ure 4 shows an e
17d0: 78 61 6d 70 6c 65 20 6f 66 20 61 20 70 72 6f 6a  xample of a proj
17e0: 65 63 74 20 77 68 65 72 65 20 74 68 65 72 65 20  ect where there 
17f0: 61 72 65 20 74 77 6f 20 62 72 61 6e 63 68 65 73  are two branches
1800: 2c 20 6f 6e 65 0a 66 6f 72 20 64 65 76 65 6c 6f  , one.for develo
1810: 70 6d 65 6e 74 20 77 6f 72 6b 20 61 6e 64 20 61  pment work and a
1820: 6e 6f 74 68 65 72 20 66 6f 72 20 74 65 73 74 69  nother for testi
1830: 6e 67 2e 0a 0a 3c 63 65 6e 74 65 72 3e 3c 74 61  ng...<center><ta
1840: 62 6c 65 20 62 6f 72 64 65 72 3d 31 20 63 65 6c  ble border=1 cel
1850: 6c 70 61 64 64 69 6e 67 3d 31 30 20 68 73 70 61  lpadding=10 hspa
1860: 63 65 3d 31 30 20 76 73 70 61 63 65 3d 31 30 3e  ce=10 vspace=10>
1870: 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22  .<tr><td align="
1880: 63 65 6e 74 65 72 22 3e 0a 3c 69 6d 67 20 73 72  center">.<img sr
1890: 63 3d 22 62 72 61 6e 63 68 30 34 2e 67 69 66 22  c="branch04.gif"
18a0: 3e 3c 62 72 3e 0a 46 69 67 75 72 65 20 34 0a 3c  ><br>.Figure 4.<
18b0: 2f 74 64 3e 3c 2f 74 72 3e 3c 2f 74 61 62 6c 65  /td></tr></table
18c0: 3e 3c 2f 63 65 6e 74 65 72 3e 0a 0a 54 68 65 20  ></center>..The 
18d0: 68 79 70 6f 74 68 65 74 69 63 61 6c 20 73 63 65  hypothetical sce
18e0: 6e 61 72 69 6f 20 6f 66 20 66 69 67 75 72 65 20  nario of figure 
18f0: 34 20 69 73 20 74 68 69 73 3a 20 20 54 68 65 20  4 is this:  The 
1900: 70 72 6f 6a 65 63 74 20 73 74 61 72 74 73 20 61  project starts a
1910: 6e 64 0a 70 72 6f 67 72 65 73 73 65 73 20 74 6f  nd.progresses to
1920: 20 61 20 70 6f 69 6e 74 20 77 68 65 72 65 20 28   a point where (
1930: 61 74 20 63 68 65 63 6b 2d 69 6e 20 32 29 20 0a  at check-in 2) .
1940: 69 74 20 69 73 20 72 65 61 64 79 20 74 6f 20 65  it is ready to e
1950: 6e 74 65 72 20 74 65 73 74 69 6e 67 20 66 6f 72  nter testing for
1960: 20 69 74 73 20 66 69 72 73 74 20 72 65 6c 65 61   its first relea
1970: 73 65 2e 0a 49 6e 20 61 20 72 65 61 6c 20 70 72  se..In a real pr
1980: 6f 6a 65 63 74 2c 20 6f 66 20 63 6f 75 72 73 65  oject, of course
1990: 2c 20 74 68 65 72 65 20 6d 69 67 68 74 20 62 65  , there might be
19a0: 20 68 75 6e 64 72 65 64 73 20 6f 72 20 74 68 6f   hundreds or tho
19b0: 75 73 61 6e 64 73 20 6f 66 0a 63 68 65 63 6b 2d  usands of.check-
19c0: 69 6e 73 20 62 65 66 6f 72 65 20 61 20 70 72 6f  ins before a pro
19d0: 6a 65 63 74 20 72 65 61 63 68 65 73 20 74 68 69  ject reaches thi
19e0: 73 20 70 6f 69 6e 74 2c 20 62 75 74 20 66 6f 72  s point, but for
19f0: 20 73 69 6d 70 6c 69 63 69 74 79 20 6f 66 0a 70   simplicity of.p
1a00: 72 65 73 65 6e 74 61 74 69 6f 6e 20 77 65 20 77  resentation we w
1a10: 69 6c 6c 20 73 61 79 20 74 68 61 74 20 74 68 65  ill say that the
1a20: 20 70 72 6f 6a 65 63 74 20 69 73 20 72 65 61 64   project is read
1a30: 79 20 61 66 74 65 72 20 63 68 65 63 6b 2d 69 6e  y after check-in
1a40: 20 32 2e 0a 54 68 65 20 70 72 6f 6a 65 63 74 20   2..The project 
1a50: 74 68 65 6e 20 73 70 6c 69 74 73 20 69 6e 74 6f  then splits into
1a60: 20 74 77 6f 20 62 72 61 6e 63 68 65 73 20 74 68   two branches th
1a70: 61 74 20 61 72 65 20 75 73 65 64 20 62 79 20 73  at are used by s
1a80: 65 70 61 72 61 74 65 0a 74 65 61 6d 73 2e 20 20  eparate.teams.  
1a90: 54 68 65 20 74 65 73 74 69 6e 67 20 74 65 61 6d  The testing team
1aa0: 2c 20 75 73 69 6e 67 20 74 68 65 20 62 6c 75 65  , using the blue
1ab0: 20 62 72 61 6e 63 68 2c 20 66 69 6e 64 73 20 61   branch, finds a
1ac0: 6e 64 20 66 69 78 65 73 20 61 20 66 65 77 0a 62  nd fixes a few.b
1ad0: 75 67 73 2e 20 20 54 68 69 73 20 69 73 20 73 68  ugs.  This is sh
1ae0: 6f 77 6e 20 62 79 20 63 68 65 63 6b 2d 69 6e 73  own by check-ins
1af0: 20 36 20 61 6e 64 20 39 2e 20 20 4d 65 61 6e 77   6 and 9.  Meanw
1b00: 68 69 6c 65 20 74 68 65 20 64 65 76 65 6c 6f 70  hile the develop
1b10: 6d 65 6e 74 0a 74 65 61 6d 2c 20 77 6f 72 6b 69  ment.team, worki
1b20: 6e 67 20 6f 6e 20 74 68 65 20 72 65 64 20 62 72  ng on the red br
1b30: 61 6e 63 68 2c 20 69 73 20 62 75 73 79 20 61 64  anch, is busy ad
1b40: 64 69 6e 67 20 66 65 61 74 75 72 65 73 20 66 6f  ding features fo
1b50: 72 20 74 68 65 20 73 65 63 6f 6e 64 0a 72 65 6c  r the second.rel
1b60: 65 61 73 65 2e 20 20 4f 66 20 63 6f 75 72 73 65  ease.  Of course
1b70: 2c 20 74 68 65 20 64 65 76 65 6c 6f 70 6d 65 6e  , the developmen
1b80: 74 20 74 65 61 6d 20 77 6f 75 6c 64 20 6c 69 6b  t team would lik
1b90: 65 20 74 6f 20 74 61 6b 65 20 61 64 76 61 6e 74  e to take advant
1ba0: 61 67 65 20 6f 66 0a 74 68 65 20 62 75 67 20 66  age of.the bug f
1bb0: 69 78 65 73 20 69 6d 70 6c 65 6d 65 6e 74 65 64  ixes implemented
1bc0: 20 62 79 20 74 68 65 20 74 65 73 74 69 6e 67 20   by the testing 
1bd0: 74 65 61 6d 2e 20 20 53 6f 20 70 65 72 69 6f 64  team.  So period
1be0: 69 63 61 6c 6c 79 2c 20 74 68 65 0a 63 68 61 6e  ically, the.chan
1bf0: 67 65 73 20 69 6e 20 74 68 65 20 74 65 73 74 20  ges in the test 
1c00: 62 72 61 6e 63 68 20 61 72 65 20 6d 65 72 67 65  branch are merge
1c10: 64 20 69 6e 74 6f 20 74 68 65 20 64 65 76 20 62  d into the dev b
1c20: 72 61 6e 63 68 2e 20 20 54 68 69 73 20 69 73 0a  ranch.  This is.
1c30: 73 68 6f 77 6e 20 62 79 20 74 68 65 20 64 61 73  shown by the das
1c40: 68 65 64 20 6d 65 72 67 65 20 61 72 72 6f 77 73  hed merge arrows
1c50: 20 62 65 74 77 65 65 6e 20 63 68 65 63 6b 2d 69   between check-i
1c60: 6e 73 20 36 20 61 6e 64 20 37 20 61 6e 64 20 62  ns 6 and 7 and b
1c70: 65 74 77 65 65 6e 0a 63 68 65 63 6b 2d 69 6e 73  etween.check-ins
1c80: 20 39 20 61 6e 64 20 31 30 2e 0a 0a 49 6e 20 62   9 and 10...In b
1c90: 6f 74 68 20 66 69 67 75 72 65 73 20 32 20 61 6e  oth figures 2 an
1ca0: 64 20 34 2c 20 63 68 65 63 6b 2d 69 6e 20 32 20  d 4, check-in 2 
1cb0: 68 61 73 20 74 77 6f 20 63 68 69 6c 64 72 65 6e  has two children
1cc0: 2e 20 20 49 6e 20 66 69 67 75 72 65 20 32 2c 0a  .  In figure 2,.
1cd0: 77 65 20 63 61 6c 6c 65 64 20 74 68 69 73 20 61  we called this a
1ce0: 20 22 66 6f 72 6b 22 2e 20 20 49 6e 20 64 69 61   "fork".  In dia
1cf0: 67 72 61 6d 20 34 2c 20 77 65 20 63 61 6c 6c 20  gram 4, we call 
1d00: 69 74 20 61 20 22 62 72 61 6e 63 68 22 2e 20 20  it a "branch".  
1d10: 57 68 61 74 20 69 73 0a 74 68 65 20 64 69 66 66  What is.the diff
1d20: 65 72 65 6e 63 65 3f 20 20 41 73 20 66 61 72 20  erence?  As far 
1d30: 61 73 20 74 68 65 20 69 6e 74 65 72 6e 61 6c 20  as the internal 
1d40: 66 6f 73 73 69 6c 20 64 61 74 61 20 73 74 72 75  fossil data stru
1d50: 63 74 75 72 65 20 61 72 65 0a 63 6f 6e 63 65 72  cture are.concer
1d60: 6e 65 64 2c 20 74 68 65 72 65 20 69 73 20 6e 6f  ned, there is no
1d70: 20 64 69 66 66 65 72 65 6e 63 65 2e 20 20 54 68   difference.  Th
1d80: 65 20 64 69 73 74 69 6e 63 74 69 6f 6e 20 69 73  e distinction is
1d90: 20 69 6e 20 74 68 65 20 69 6e 74 65 6e 74 2e 0a   in the intent..
1da0: 49 6e 20 66 69 67 75 72 65 20 32 2c 20 74 68 65  In figure 2, the
1db0: 20 66 61 63 74 20 74 68 61 74 20 63 68 65 63 6b   fact that check
1dc0: 2d 69 6e 20 32 20 68 61 73 20 6d 75 6c 74 69 70  -in 2 has multip
1dd0: 6c 65 20 63 68 69 6c 64 72 65 6e 20 69 73 20 61  le children is a
1de0: 6e 0a 61 63 63 69 64 65 6e 74 20 74 68 61 74 20  n.accident that 
1df0: 73 74 65 6d 73 20 66 72 6f 6d 20 63 6f 6e 63 75  stems from concu
1e00: 72 72 65 6e 74 20 64 65 76 65 6c 6f 70 6d 65 6e  rrent developmen
1e10: 74 2e 20 20 49 6e 20 66 69 67 75 72 65 20 34 2c  t.  In figure 4,
1e20: 20 67 69 76 69 6e 67 0a 63 68 65 63 6b 2d 69 6e   giving.check-in
1e30: 20 32 20 6d 75 6c 74 69 70 6c 65 20 63 68 69 6c   2 multiple chil
1e40: 64 72 65 6e 20 69 73 20 61 20 64 65 6c 69 62 65  dren is a delibe
1e50: 72 61 74 65 20 61 63 74 2e 20 20 53 6f 2c 20 74  rate act.  So, t
1e60: 6f 20 61 20 67 6f 6f 64 0a 61 70 70 72 6f 78 69  o a good.approxi
1e70: 6d 61 74 69 6e 67 2c 20 77 65 20 64 65 66 69 6e  mating, we defin
1e80: 65 20 66 6f 72 6b 69 6e 67 20 74 6f 20 62 65 20  e forking to be 
1e90: 62 79 20 61 63 63 69 64 65 6e 74 20 61 6e 64 20  by accident and 
1ea0: 62 72 61 6e 63 68 69 6e 67 20 74 6f 0a 62 65 20  branching to.be 
1eb0: 62 79 20 69 6e 74 65 6e 74 2e 20 20 41 70 61 72  by intent.  Apar
1ec0: 74 20 66 72 6f 6d 20 74 68 61 74 2c 20 74 68 65  t from that, the
1ed0: 79 20 61 72 65 20 74 68 65 20 73 61 6d 65 2e 0a  y are the same..
1ee0: 0a 3c 68 32 3e 54 61 67 73 20 41 6e 64 20 50 72  .<h2>Tags And Pr
1ef0: 6f 70 65 72 74 69 65 73 3c 2f 68 32 3e 0a 0a 54  operties</h2>..T
1f00: 61 67 73 20 61 6e 64 20 70 72 6f 70 65 72 74 69  ags and properti
1f10: 65 73 20 61 72 65 20 75 73 65 64 20 69 6e 20 66  es are used in f
1f20: 6f 73 73 69 6c 20 74 6f 20 68 65 6c 70 20 65 78  ossil to help ex
1f30: 70 72 65 73 73 20 74 68 65 20 69 6e 74 65 6e 74  press the intent
1f40: 2c 20 61 6e 64 0a 74 68 75 73 20 74 6f 20 64 69  , and.thus to di
1f50: 73 74 69 6e 67 75 69 73 68 20 62 65 74 77 65 65  stinguish betwee
1f60: 6e 20 66 6f 72 6b 73 20 61 6e 64 20 62 72 61 6e  n forks and bran
1f70: 63 68 65 73 2e 20 20 46 69 67 75 72 65 20 35 20  ches.  Figure 5 
1f80: 73 68 6f 77 73 20 74 68 65 0a 73 61 6d 65 20 73  shows the.same s
1f90: 63 65 6e 61 72 69 6f 20 61 73 20 66 69 67 75 72  cenario as figur
1fa0: 65 20 34 20 62 75 74 20 77 69 74 68 20 74 61 67  e 4 but with tag
1fb0: 73 20 61 6e 64 20 70 72 6f 70 65 72 74 69 65 73  s and properties
1fc0: 20 61 64 64 65 64 3a 0a 0a 3c 63 65 6e 74 65 72   added:..<center
1fd0: 3e 3c 74 61 62 6c 65 20 62 6f 72 64 65 72 3d 31  ><table border=1
1fe0: 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d 31 30 20   cellpadding=10 
1ff0: 68 73 70 61 63 65 3d 31 30 20 76 73 70 61 63 65  hspace=10 vspace
2000: 3d 31 30 3e 0a 3c 74 72 3e 3c 74 64 20 61 6c 69  =10>.<tr><td ali
2010: 67 6e 3d 22 63 65 6e 74 65 72 22 3e 0a 3c 69 6d  gn="center">.<im
2020: 67 20 73 72 63 3d 22 62 72 61 6e 63 68 30 35 2e  g src="branch05.
2030: 67 69 66 22 3e 3c 62 72 3e 0a 46 69 67 75 72 65  gif"><br>.Figure
2040: 20 35 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 3c 2f 74   5.</td></tr></t
2050: 61 62 6c 65 3e 3c 2f 63 65 6e 74 65 72 3e 0a 0a  able></center>..
2060: 41 20 3c 69 3e 74 61 67 3c 2f 69 3e 20 69 73 20  A <i>tag</i> is 
2070: 61 20 6e 61 6d 65 20 74 68 61 74 20 69 73 20 61  a name that is a
2080: 74 74 61 63 68 65 64 20 74 6f 20 61 20 63 68 65  ttached to a che
2090: 63 6b 2d 69 6e 2e 20 20 41 0a 3c 69 3e 70 72 6f  ck-in.  A.<i>pro
20a0: 70 65 72 74 79 3c 2f 69 3e 20 69 73 20 61 20 6e  perty</i> is a n
20b0: 61 6d 65 2f 76 61 6c 75 65 20 70 61 69 72 2e 20  ame/value pair. 
20c0: 20 49 6e 74 65 72 6e 61 6c 6c 79 2c 20 66 6f 73   Internally, fos
20d0: 73 69 6c 20 69 6d 70 6c 65 6d 65 6e 74 73 0a 74  sil implements.t
20e0: 61 67 73 20 61 73 20 70 72 6f 70 65 72 74 69 65  ags as propertie
20f0: 73 20 77 69 74 68 20 61 20 4e 55 4c 4c 20 76 61  s with a NULL va
2100: 6c 75 65 2e 20 20 53 6f 2c 20 74 61 67 73 20 61  lue.  So, tags a
2110: 6e 64 20 70 72 6f 70 65 72 74 69 65 73 20 72 65  nd properties re
2120: 61 6c 6c 79 0a 61 72 65 20 6d 75 63 68 20 74 68  ally.are much th
2130: 65 20 73 61 6d 65 20 74 68 69 6e 67 2c 20 61 6e  e same thing, an
2140: 64 20 68 65 6e 63 65 66 6f 72 74 68 20 77 65 20  d henceforth we 
2150: 77 69 6c 6c 20 75 73 65 20 74 68 65 20 77 6f 72  will use the wor
2160: 64 20 22 74 61 67 22 0a 74 6f 20 6d 65 61 6e 20  d "tag".to mean 
2170: 65 69 74 68 65 72 20 61 20 74 61 67 20 6f 72 20  either a tag or 
2180: 61 20 70 72 6f 70 65 72 74 79 2e 20 0a 0a 41 20  a property. ..A 
2190: 74 61 67 20 63 61 6e 20 62 65 20 65 69 74 68 65  tag can be eithe
21a0: 72 20 61 20 6f 6e 65 2d 74 69 6d 65 20 74 61 67  r a one-time tag
21b0: 20 6f 72 20 61 6e 20 70 72 6f 70 61 67 61 74 69   or an propagati
21c0: 6e 67 20 74 61 67 20 6f 72 20 61 20 63 61 6e 63  ng tag or a canc
21d0: 65 6c 6c 61 74 69 6f 6e 2e 20 0a 41 20 6f 6e 65  ellation. .A one
21e0: 2d 74 69 6d 65 20 74 61 67 20 6f 6e 6c 79 20 61  -time tag only a
21f0: 70 70 6c 69 65 73 20 74 6f 20 74 68 65 20 63 68  pplies to the ch
2200: 65 63 6b 2d 69 6e 20 74 6f 20 77 68 69 63 68 20  eck-in to which 
2210: 69 74 20 69 73 20 61 74 74 61 63 68 65 64 2e 20  it is attached. 
2220: 20 41 6e 0a 70 72 6f 70 61 67 61 74 69 6e 67 20   An.propagating 
2230: 74 61 67 20 61 70 70 6c 69 65 73 20 74 6f 20 74  tag applies to t
2240: 68 65 20 63 68 65 63 6b 2d 69 6e 20 74 6f 20 77  he check-in to w
2250: 68 69 63 68 20 69 74 20 69 73 20 61 74 74 61 63  hich it is attac
2260: 68 65 64 20 61 6e 64 20 61 6c 73 6f 0a 74 6f 20  hed and also.to 
2270: 61 6c 6c 20 64 69 72 65 63 74 20 64 65 73 63 65  all direct desce
2280: 6e 64 61 6e 74 73 20 6f 66 20 74 68 61 74 20 63  ndants of that c
2290: 68 65 63 6b 2d 69 6e 2e 20 20 41 20 3c 69 3e 64  heck-in.  A <i>d
22a0: 69 72 65 63 74 20 64 65 73 63 65 6e 64 61 6e 74  irect descendant
22b0: 3c 2f 69 3e 0a 69 73 20 61 20 64 65 73 63 65 6e  </i>.is a descen
22c0: 64 61 6e 74 20 74 68 72 6f 75 67 68 20 64 69 72  dant through dir
22d0: 65 63 74 20 63 68 69 6c 64 72 65 6e 2e 20 20 54  ect children.  T
22e0: 61 67 73 20 70 72 6f 70 61 67 61 74 69 6f 6e 20  ags propagation 
22f0: 64 6f 65 73 20 6e 6f 74 0a 63 72 6f 73 73 20 6d  does not.cross m
2300: 65 72 67 65 73 2e 20 20 54 61 67 20 70 72 6f 70  erges.  Tag prop
2310: 61 67 61 74 69 6f 6e 20 61 6c 73 6f 20 73 74 6f  agation also sto
2320: 70 73 20 61 73 20 73 6f 6f 6e 0a 61 73 20 69 74  ps as soon.as it
2330: 20 65 6e 63 6f 75 6e 74 65 72 73 20 61 6e 6f 74   encounters anot
2340: 68 65 72 20 63 68 65 63 6b 2d 69 6e 20 77 69 74  her check-in wit
2350: 68 20 74 68 65 20 73 61 6d 65 20 74 61 67 2e 20  h the same tag. 
2360: 20 41 20 63 61 6e 63 65 6c 6c 61 74 69 6f 6e 20   A cancellation 
2370: 74 61 67 0a 69 73 20 61 74 74 61 63 68 65 64 20  tag.is attached 
2380: 74 6f 20 61 20 73 69 6e 67 6c 65 20 63 68 65 63  to a single chec
2390: 6b 2d 69 6e 20 69 6e 20 6f 72 64 65 72 20 74 6f  k-in in order to
23a0: 20 65 69 74 68 65 72 20 6f 76 65 72 72 69 64 65   either override
23b0: 20 61 20 6f 6e 65 2d 74 69 6d 65 0a 74 61 67 20   a one-time.tag 
23c0: 74 68 61 74 20 77 61 73 20 70 6c 61 63 65 64 20  that was placed 
23d0: 6f 6e 20 74 68 61 74 20 73 61 6d 65 20 63 68 65  on that same che
23e0: 63 6b 2d 69 6e 2c 20 6f 72 20 74 6f 20 62 6c 6f  ck-in, or to blo
23f0: 63 6b 20 74 61 67 20 70 72 6f 70 61 67 61 74 69  ck tag propagati
2400: 6f 6e 2e 0a 0a 45 76 65 72 79 20 72 65 70 6f 73  on...Every repos
2410: 69 74 6f 72 79 20 69 73 20 63 72 65 61 74 65 64  itory is created
2420: 20 77 69 74 68 20 61 20 73 69 6e 67 6c 65 20 65   with a single e
2430: 6d 70 74 79 20 63 68 65 63 6b 2d 69 6e 20 74 68  mpty check-in th
2440: 61 74 20 68 61 73 20 74 77 6f 0a 70 72 6f 70 61  at has two.propa
2450: 67 61 74 69 6e 67 20 74 61 67 73 2e 20 20 49 6e  gating tags.  In
2460: 20 66 69 67 75 72 65 20 35 2c 20 74 68 61 74 20   figure 5, that 
2470: 69 6e 69 74 69 61 6c 20 65 6d 70 74 79 20 63 68  initial empty ch
2480: 65 63 6b 2d 69 6e 20 69 73 20 63 68 65 63 6b 2d  eck-in is check-
2490: 69 6e 20 31 2e 0a 54 68 65 20 3c 62 3e 62 72 61  in 1..The <b>bra
24a0: 6e 63 68 3c 2f 62 3e 20 74 61 67 20 74 65 6c 6c  nch</b> tag tell
24b0: 73 20 28 62 79 20 69 74 73 20 76 61 6c 75 65 29  s (by its value)
24c0: 20 0a 77 68 61 74 20 62 72 61 6e 63 68 20 74 68   .what branch th
24d0: 65 20 63 68 65 63 6b 2d 69 6e 20 69 73 20 61 20  e check-in is a 
24e0: 6d 65 6d 62 65 72 20 6f 66 2e 0a 54 68 65 20 64  member of..The d
24f0: 65 66 61 75 6c 74 20 62 72 61 6e 63 68 20 69 73  efault branch is
2500: 20 63 61 6c 6c 65 64 20 22 74 72 75 6e 6b 22 2e   called "trunk".
2510: 20 20 41 6c 6c 20 74 61 67 73 20 74 68 61 74 20    All tags that 
2520: 62 65 67 69 6e 20 77 69 74 68 20 22 3c 62 3e 73  begin with "<b>s
2530: 79 6d 2d 3c 2f 62 3e 22 0a 61 72 65 20 73 79 6d  ym-</b>".are sym
2540: 62 6f 6c 69 63 20 6e 61 6d 65 20 74 61 67 73 2e  bolic name tags.
2550: 20 20 57 68 65 6e 20 61 20 73 79 6d 62 6f 6c 69    When a symboli
2560: 63 20 6e 61 6d 65 20 74 61 67 20 69 73 20 61 74  c name tag is at
2570: 74 61 63 68 65 64 20 74 6f 20 61 0a 63 68 65 63  tached to a.chec
2580: 6b 2d 69 6e 2c 20 74 68 61 74 20 61 6c 6c 6f 77  k-in, that allow
2590: 73 20 79 6f 75 20 74 6f 20 72 65 66 65 72 20 74  s you to refer t
25a0: 6f 20 74 68 61 74 20 63 68 65 63 6b 2d 69 6e 20  o that check-in 
25b0: 62 79 20 69 74 73 20 73 79 6d 62 6f 6c 69 63 0a  by its symbolic.
25c0: 6e 61 6d 65 20 72 61 74 68 65 72 20 74 68 61 6e  name rather than
25d0: 20 62 79 20 69 74 73 20 34 30 2d 63 68 61 72 61   by its 40-chara
25e0: 63 74 65 72 20 53 48 41 31 20 68 61 73 68 20 6e  cter SHA1 hash n
25f0: 61 6d 65 2e 20 20 57 68 65 6e 20 61 20 73 79 6d  ame.  When a sym
2600: 62 6f 6c 69 63 20 6e 61 6d 65 0a 74 61 67 20 70  bolic name.tag p
2610: 72 6f 70 61 67 61 74 65 73 20 28 61 73 20 64 6f  ropagates (as do
2620: 65 73 20 74 68 65 20 3c 62 3e 73 79 6d 2d 74 72  es the <b>sym-tr
2630: 75 6e 6b 3c 2f 62 3e 20 74 61 67 29 20 74 68 65  unk</b> tag) the
2640: 6e 20 72 65 66 65 72 72 69 6e 67 20 74 6f 20 74  n referring to t
2650: 68 61 74 0a 6e 61 6d 65 20 69 73 20 74 68 65 20  hat.name is the 
2660: 73 61 6d 65 20 61 73 20 72 65 66 65 72 72 69 6e  same as referrin
2670: 67 20 74 6f 20 74 68 65 20 6d 6f 73 74 20 72 65  g to the most re
2680: 63 65 6e 74 20 63 68 65 63 6b 2d 69 6e 20 77 69  cent check-in wi
2690: 74 68 20 74 68 61 74 20 6e 61 6d 65 2e 0a 54 68  th that name..Th
26a0: 75 73 20 74 68 65 20 74 77 6f 20 74 61 67 73 20  us the two tags 
26b0: 6f 6e 20 63 68 65 63 6b 2d 69 6e 20 6f 6e 63 65  on check-in once
26c0: 20 63 61 75 73 65 20 61 6c 6c 20 64 65 63 65 6e   cause all decen
26d0: 64 65 6e 74 73 20 74 6f 20 62 65 20 69 6e 20 74  dents to be in t
26e0: 68 65 0a 22 74 72 75 6e 6b 22 20 62 72 61 6e 63  he."trunk" branc
26f0: 68 20 61 6e 64 20 74 6f 20 68 61 76 65 20 74 68  h and to have th
2700: 65 20 73 79 6d 62 6f 6c 69 63 20 6e 61 6d 65 20  e symbolic name 
2710: 22 74 72 75 6e 6b 22 2e 0a 0a 43 68 65 63 6b 2d  "trunk"...Check-
2720: 69 6e 20 34 20 68 61 73 20 61 20 3c 62 3e 62 72  in 4 has a <b>br
2730: 61 6e 63 68 3c 2f 62 3e 20 74 61 67 20 77 68 69  anch</b> tag whi
2740: 63 68 20 63 68 61 6e 67 65 73 20 74 68 65 20 6e  ch changes the n
2750: 61 6d 65 20 6f 66 20 74 68 65 20 62 72 61 6e 63  ame of the branc
2760: 68 0a 74 6f 20 22 74 65 73 74 22 2e 20 20 54 68  h.to "test".  Th
2770: 65 20 62 72 61 6e 63 68 20 74 61 67 20 6f 6e 20  e branch tag on 
2780: 63 68 65 63 6b 2d 69 6e 20 34 20 70 72 6f 70 61  check-in 4 propa
2790: 67 61 74 65 73 20 74 6f 20 63 68 65 63 6b 2d 69  gates to check-i
27a0: 6e 73 20 36 20 61 6e 64 20 39 2e 0a 42 75 74 20  ns 6 and 9..But 
27b0: 62 65 63 61 75 73 65 20 74 61 67 20 70 72 6f 70  because tag prop
27c0: 61 67 61 74 69 6f 6e 20 64 6f 65 73 20 6e 6f 74  agation does not
27d0: 20 66 6f 6c 6c 6f 77 20 6d 65 72 67 65 20 6c 69   follow merge li
27e0: 6e 6b 73 2c 20 74 68 65 20 3c 62 3e 62 72 61 6e  nks, the <b>bran
27f0: 63 68 3d 74 65 73 74 3c 2f 62 3e 0a 74 61 67 20  ch=test</b>.tag 
2800: 64 6f 65 73 20 6e 6f 74 20 70 72 6f 70 61 67 61  does not propaga
2810: 74 65 20 74 6f 20 63 68 65 63 6b 2d 69 6e 73 20  te to check-ins 
2820: 37 2c 20 38 2c 20 6f 72 20 39 2e 20 20 4e 6f 74  7, 8, or 9.  Not
2830: 65 20 61 6c 73 6f 20 74 68 61 74 20 74 68 65 0a  e also that the.
2840: 3c 62 3e 62 72 61 6e 63 68 3c 2f 62 3e 20 74 61  <b>branch</b> ta
2850: 67 20 6f 6e 20 63 68 65 63 6b 2d 69 6e 20 34 20  g on check-in 4 
2860: 62 6c 6f 63 6b 73 20 74 68 65 20 70 72 6f 70 61  blocks the propa
2870: 67 61 74 69 6f 6e 20 6f 66 20 3c 62 3e 62 72 61  gation of <b>bra
2880: 6e 63 68 3d 74 72 75 6e 6b 3c 2f 62 3e 0a 73 6f  nch=trunk</b>.so
2890: 20 74 68 61 74 20 69 74 20 63 61 6e 6e 6f 74 20   that it cannot 
28a0: 72 65 61 63 68 20 63 68 65 63 6b 2d 69 6e 73 20  reach check-ins 
28b0: 36 20 6f 72 20 39 2e 20 20 54 68 69 73 20 63 61  6 or 9.  This ca
28c0: 75 73 65 73 20 63 68 65 63 6b 2d 69 6e 73 20 34  uses check-ins 4
28d0: 2c 20 36 2c 20 61 6e 64 0a 39 20 74 6f 20 62 65  , 6, and.9 to be
28e0: 20 69 6e 20 74 68 65 20 22 74 65 73 74 22 20 62   in the "test" b
28f0: 72 61 6e 63 68 20 61 6e 64 20 61 6c 6c 20 6f 74  ranch and all ot
2900: 68 65 72 73 20 74 6f 20 62 65 20 69 6e 20 74 68  hers to be in th
2910: 65 20 22 74 72 75 6e 6b 22 20 62 72 61 6e 63 68  e "trunk" branch
2920: 2e 0a 0a 43 68 65 63 6b 2d 69 6e 20 34 20 61 6c  ...Check-in 4 al
2930: 73 6f 20 68 61 73 20 61 20 3c 62 3e 73 79 6d 2d  so has a <b>sym-
2940: 74 65 73 74 3c 2f 62 3e 20 74 61 67 2c 20 77 68  test</b> tag, wh
2950: 69 63 68 20 67 69 76 65 73 20 74 68 65 20 73 79  ich gives the sy
2960: 6d 62 6f 6c 69 63 20 6e 61 6d 65 0a 22 74 65 73  mbolic name."tes
2970: 74 22 20 74 6f 20 63 68 65 63 6b 2d 69 6e 73 20  t" to check-ins 
2980: 34 2c 20 36 2c 20 61 6e 64 20 39 2e 20 20 42 65  4, 6, and 9.  Be
2990: 63 61 75 73 65 20 74 61 67 73 20 64 6f 20 6e 6f  cause tags do no
29a0: 74 20 70 72 6f 70 61 67 61 74 65 20 61 63 72 6f  t propagate acro
29b0: 73 73 0a 6d 65 72 67 65 73 2c 20 63 68 65 63 6b  ss.merges, check
29c0: 2d 69 6e 73 20 37 2c 20 38 2c 20 61 6e 64 20 39  -ins 7, 8, and 9
29d0: 20 64 6f 20 6e 6f 74 20 69 6e 68 65 72 69 74 20   do not inherit 
29e0: 74 68 65 20 3c 62 3e 73 79 6d 2d 74 65 73 74 3c  the <b>sym-test<
29f0: 2f 62 3e 20 74 61 67 20 61 6e 64 0a 61 72 65 20  /b> tag and.are 
2a00: 68 65 6e 63 65 20 6e 6f 74 20 6b 6e 6f 77 6e 20  hence not known 
2a10: 62 79 20 74 68 65 20 6e 61 6d 65 20 22 74 65 73  by the name "tes
2a20: 74 22 2e 0a 54 6f 20 70 72 65 76 65 6e 74 20 74  t"..To prevent t
2a30: 68 65 20 3c 62 3e 73 79 6d 2d 74 72 75 6e 6b 3c  he <b>sym-trunk<
2a40: 2f 62 3e 20 74 61 67 20 66 72 6f 6d 20 70 72 6f  /b> tag from pro
2a50: 70 61 67 61 74 69 6e 67 20 66 72 6f 6d 20 63 68  pagating from ch
2a60: 65 63 6b 2d 69 6e 20 31 20 0a 69 6e 74 6f 20 63  eck-in 1 .into c
2a70: 68 65 63 6b 2d 69 6e 73 20 34 2c 20 36 2c 20 61  heck-ins 4, 6, a
2a80: 6e 64 20 39 2c 20 74 68 65 72 65 20 69 73 20 61  nd 9, there is a
2a90: 20 63 61 6e 63 65 6c 6c 61 74 69 6f 6e 20 74 61   cancellation ta
2aa0: 67 20 66 6f 72 20 0a 3c 62 3e 73 79 6d 2d 74 72  g for .<b>sym-tr
2ab0: 75 6e 6b 3c 2f 62 3e 20 6f 6e 20 63 68 65 63 6b  unk</b> on check
2ac0: 2d 69 6e 20 34 2e 20 20 54 68 65 20 6e 65 74 20  -in 4.  The net 
2ad0: 65 66 66 65 63 74 20 6f 66 20 61 6c 6c 20 6f 66  effect of all of
2ae0: 20 74 68 69 73 20 69 73 20 74 68 61 74 0a 63 68   this is that.ch
2af0: 65 63 6b 2d 69 6e 73 20 6f 6e 20 74 68 65 20 74  eck-ins on the t
2b00: 72 75 6e 6b 20 67 6f 20 62 79 20 74 68 65 20 73  runk go by the s
2b10: 79 6d 62 6f 6c 69 63 20 6e 61 6d 65 20 6f 66 20  ymbolic name of 
2b20: 22 74 72 75 6e 6b 22 20 61 6e 64 20 63 68 65 63  "trunk" and chec
2b30: 6b 2d 69 6e 73 0a 74 68 61 74 20 61 72 65 20 6f  k-ins.that are o
2b40: 6e 20 74 68 65 20 74 65 73 74 20 62 72 61 6e 63  n the test branc
2b50: 68 20 67 6f 20 62 79 20 74 68 65 20 73 79 6d 62  h go by the symb
2b60: 6f 6c 69 63 20 6e 61 6d 65 20 22 74 65 73 74 22  olic name "test"
2b70: 2e 0a 0a 54 68 65 20 3c 62 3e 62 67 63 6f 6c 6f  ...The <b>bgcolo
2b80: 72 3d 62 6c 75 65 3c 2f 62 3e 20 74 61 67 20 6f  r=blue</b> tag o
2b90: 6e 20 63 68 65 63 6b 2d 69 6e 20 34 20 63 61 75  n check-in 4 cau
2ba0: 73 65 73 20 74 68 65 20 62 61 63 6b 67 72 6f 75  ses the backgrou
2bb0: 6e 64 20 63 6f 6c 6f 72 0a 6f 66 20 74 69 6d 65  nd color.of time
2bc0: 6c 69 6e 65 73 20 74 6f 20 62 65 20 62 6c 75 65  lines to be blue
2bd0: 20 66 6f 72 20 63 68 65 63 6b 2d 69 6e 20 34 20   for check-in 4 
2be0: 61 6e 64 20 69 74 73 20 64 65 73 63 65 6e 64 61  and its descenda
2bf0: 6e 74 73 2e 0a 0a 46 69 67 75 72 65 20 35 20 61  nts...Figure 5 a
2c00: 6c 73 6f 20 73 68 6f 77 73 20 74 77 6f 20 6f 6e  lso shows two on
2c10: 65 2d 74 69 6d 65 20 74 61 67 73 20 6f 6e 20 63  e-time tags on c
2c20: 68 65 63 6b 2d 69 6e 20 39 2e 20 20 28 54 68 65  heck-in 9.  (The
2c30: 20 64 69 61 67 72 61 6d 20 64 6f 65 73 0a 6e 6f   diagram does.no
2c40: 74 20 6d 61 6b 65 20 61 20 67 72 61 70 68 69 63  t make a graphic
2c50: 61 6c 20 64 69 73 74 69 6e 63 74 69 6f 6e 20 62  al distinction b
2c60: 65 74 77 65 65 6e 20 6f 6e 65 2d 74 69 6d 65 20  etween one-time 
2c70: 61 6e 64 20 70 72 6f 70 61 67 61 74 69 6e 67 20  and propagating 
2c80: 74 61 67 73 2e 29 0a 54 68 65 20 3c 62 3e 73 79  tags.).The <b>sy
2c90: 6d 2d 72 65 6c 65 61 73 65 2d 31 2e 30 3c 2f 62  m-release-1.0</b
2ca0: 3e 20 74 61 67 20 6d 65 61 6e 73 20 74 68 61 74  > tag means that
2cb0: 20 63 68 65 63 6b 2d 69 6e 20 39 20 63 61 6e 20   check-in 9 can 
2cc0: 62 65 20 72 65 66 65 72 72 65 64 20 74 6f 0a 75  be referred to.u
2cd0: 73 69 6e 67 20 74 68 65 20 6d 6f 72 65 20 6d 65  sing the more me
2ce0: 61 6e 69 6e 67 66 75 6c 20 6e 61 6d 65 20 22 72  aningful name "r
2cf0: 65 6c 65 61 73 65 2d 31 2e 30 22 2e 20 20 54 68  elease-1.0".  Th
2d00: 65 20 3c 62 3e 63 6c 6f 73 65 64 3c 2f 62 3e 20  e <b>closed</b> 
2d10: 74 61 67 20 6d 65 61 6e 73 0a 74 68 61 74 20 63  tag means.that c
2d20: 68 65 63 6b 2d 69 6e 20 39 20 69 73 20 61 20 22  heck-in 9 is a "
2d30: 63 6c 6f 73 65 64 20 6c 65 61 66 22 2e 20 20 41  closed leaf".  A
2d40: 20 63 6c 6f 73 65 64 20 6c 65 61 66 20 69 73 20   closed leaf is 
2d50: 61 20 6c 65 61 66 20 74 68 61 74 20 69 6e 74 65  a leaf that inte
2d60: 6e 64 65 64 0a 74 6f 20 6e 65 76 65 72 20 68 61  nded.to never ha
2d70: 76 65 20 61 6e 79 20 63 68 69 6c 64 72 65 64 2e  ve any childred.
2d80: 0a 0a 3c 68 32 3e 52 65 76 69 65 77 20 4f 66 20  ..<h2>Review Of 
2d90: 54 65 72 6d 69 6e 6f 6c 6f 67 79 3c 2f 68 32 3e  Terminology</h2>
2da0: 0a 0a 48 65 72 65 20 69 73 20 61 20 6c 69 73 74  ..Here is a list
2db0: 20 6f 66 20 64 65 66 69 6e 69 74 69 6f 6e 73 20   of definitions 
2dc0: 6f 66 20 6b 65 79 20 74 65 72 6d 73 3a 0a 0a 0a  of key terms:...
2dd0: 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 3c 64 6c 3e  <blockquote><dl>
2de0: 0a 3c 64 74 3e 3c 62 3e 42 72 61 6e 63 68 3c 2f  .<dt><b>Branch</
2df0: 62 3e 3c 2f 64 74 3e 0a 3c 64 64 3e 3c 70 3e 41  b></dt>.<dd><p>A
2e00: 20 62 72 61 6e 63 68 20 69 73 20 61 20 73 65 74   branch is a set
2e10: 20 6f 66 20 63 68 65 63 6b 2d 69 6e 73 20 74 68   of check-ins th
2e20: 61 74 20 68 61 76 65 20 74 68 65 20 73 61 6d 65  at have the same
2e30: 20 76 61 6c 75 65 20 66 6f 72 20 74 68 65 69 72   value for their
2e40: 0a 3c 64 74 3e 3c 62 3e 4c 65 61 66 3c 2f 62 3e  .<dt><b>Leaf</b>
2e50: 3c 2f 64 74 3e 0a 3c 64 64 3e 3c 70 3e 41 20 6c  </dt>.<dd><p>A l
2e60: 65 61 66 20 69 73 20 61 20 63 68 65 63 6b 2d 69  eaf is a check-i
2e70: 6e 20 74 68 61 74 20 68 61 73 20 6e 6f 20 63 68  n that has no ch
2e80: 69 6c 64 72 65 6e 20 69 6e 20 74 68 65 20 73 61  ildren in the sa
2e90: 6d 65 20 62 72 61 6e 63 68 2e 3c 2f 70 3e 3c 2f  me branch.</p></
2ea0: 64 64 3e 0a 3c 64 74 3e 3c 62 3e 43 6c 6f 73 65  dd>.<dt><b>Close
2eb0: 64 20 4c 65 61 66 3c 2f 62 3e 3c 2f 64 74 3e 0a  d Leaf</b></dt>.
2ec0: 3c 64 64 3e 3c 70 3e 41 20 63 6c 6f 73 65 64 20  <dd><p>A closed 
2ed0: 6c 65 61 66 20 69 73 20 6c 65 61 66 20 74 68 61  leaf is leaf tha
2ee0: 74 20 68 61 73 20 74 68 65 20 3c 62 3e 63 6c 6f  t has the <b>clo
2ef0: 73 65 64 3c 2f 62 3e 20 74 61 67 2e 20 20 53 75  sed</b> tag.  Su
2f00: 63 68 20 6c 65 61 76 65 73 0a 61 72 65 20 69 6e  ch leaves.are in
2f10: 74 65 6e 74 65 64 20 74 6f 20 6e 65 76 65 72 20  tented to never 
2f20: 62 65 20 65 78 74 65 6e 64 65 64 20 77 69 74 68  be extended with
2f30: 20 64 65 73 63 65 6e 64 65 6e 74 73 20 61 6e 64   descendents and
2f40: 20 68 65 6e 63 65 20 61 72 65 20 6f 6d 69 74 74   hence are omitt
2f50: 65 64 0a 66 72 6f 6d 20 6c 69 73 74 73 20 6f 66  ed.from lists of
2f60: 20 6c 65 61 76 65 73 20 69 6e 20 74 68 65 20 63   leaves in the c
2f70: 6f 6d 6d 61 6e 64 2d 6c 69 6e 65 20 61 6e 64 20  ommand-line and 
2f80: 77 65 62 20 69 6e 74 65 72 66 61 63 65 2e 3c 2f  web interface.</
2f90: 70 3e 3c 2f 64 64 3e 0a 3c 64 74 3e 3c 62 3e 4f  p></dd>.<dt><b>O
2fa0: 70 65 6e 20 4c 65 61 66 3c 2f 62 3e 3c 2f 64 74  pen Leaf</b></dt
2fb0: 3e 0a 3c 64 64 3e 3c 70 3e 41 20 6f 70 65 6e 20  >.<dd><p>A open 
2fc0: 6c 65 61 66 20 69 73 20 61 20 6c 65 61 66 20 74  leaf is a leaf t
2fd0: 68 61 74 20 69 73 20 6e 6f 74 20 63 6c 6f 73 65  hat is not close
2fe0: 64 2e 3c 2f 70 3e 3c 2f 64 64 3e 0a 3c 64 74 3e  d.</p></dd>.<dt>
2ff0: 3c 62 3e 46 6f 72 6b 3c 2f 62 3e 3c 2f 64 74 3e  <b>Fork</b></dt>
3000: 0a 3c 64 64 3e 3c 70 3e 41 20 66 6f 72 6b 20 6f  .<dd><p>A fork o
3010: 63 63 75 72 73 20 77 68 65 6e 20 61 20 63 68 65  ccurs when a che
3020: 63 6b 2d 69 6e 20 68 61 73 20 74 77 6f 20 6f 72  ck-in has two or
3030: 20 6d 6f 72 65 20 64 69 72 65 63 74 20 28 6e 6f   more direct (no
3040: 6e 2d 6d 65 72 67 65 29 0a 63 68 69 6c 64 72 65  n-merge).childre
3050: 6e 20 69 6e 20 74 68 65 20 73 61 6d 65 20 62 72  n in the same br
3060: 61 6e 63 68 2e 3c 2f 70 3e 3c 2f 64 64 3e 0a 3c  anch.</p></dd>.<
3070: 64 74 3e 3c 62 3e 42 72 61 6e 63 68 20 50 6f 69  dt><b>Branch Poi
3080: 6e 74 3c 2f 62 3e 3c 2f 64 74 3e 0a 3c 64 64 3e  nt</b></dt>.<dd>
3090: 3c 70 3e 41 20 62 72 61 6e 63 68 20 70 6f 69 6e  <p>A branch poin
30a0: 74 20 6f 63 63 75 72 73 20 77 68 65 6e 20 61 20  t occurs when a 
30b0: 63 68 65 63 6b 2d 69 6e 20 68 61 73 20 74 77 6f  check-in has two
30c0: 20 6f 72 20 6d 6f 72 65 20 64 69 72 65 63 74 20   or more direct 
30d0: 28 6e 6f 6e 2d 6d 65 72 67 65 29 0a 63 68 69 6c  (non-merge).chil
30e0: 64 72 65 6e 20 69 6e 20 74 68 65 20 64 69 66 66  dren in the diff
30f0: 65 72 65 6e 74 20 62 72 61 6e 63 68 65 73 2e 20  erent branches. 
3100: 20 41 20 62 72 61 6e 63 68 20 70 6f 69 6e 74 20   A branch point 
3110: 69 73 20 73 69 6d 69 6c 61 72 20 74 6f 20 61 20  is similar to a 
3120: 66 6f 72 6b 2c 0a 65 78 63 65 70 74 20 74 68 61  fork,.except tha
3130: 74 20 74 68 65 20 63 68 69 6c 64 72 65 6e 20 61  t the children a
3140: 72 65 20 69 6e 20 64 69 66 66 65 72 65 6e 74 20  re in different 
3150: 62 72 61 6e 63 68 65 73 2e 3c 2f 70 3e 3c 2f 64  branches.</p></d
3160: 64 3e 0a 3c 2f 64 6c 3e 3c 2f 62 6c 6f 63 6b 71  d>.</dl></blockq
3170: 75 6f 74 65 3e 0a 0a 43 68 65 63 6b 2d 69 6e 20  uote>..Check-in 
3180: 34 20 6f 66 20 66 69 67 75 72 65 20 33 20 69 73  4 of figure 3 is
3190: 20 6e 6f 74 20 61 20 6c 65 61 66 20 62 65 63 61   not a leaf beca
31a0: 75 73 65 20 69 74 20 68 61 73 20 61 20 63 68 69  use it has a chi
31b0: 6c 64 20 28 63 68 65 63 6b 2d 69 6e 20 35 29 0a  ld (check-in 5).
31c0: 69 6e 20 74 68 65 20 73 61 6d 65 20 62 72 61 6e  in the same bran
31d0: 63 68 2e 20 20 43 68 65 63 6b 2d 69 6e 20 39 20  ch.  Check-in 9 
31e0: 6f 66 20 66 69 67 75 72 65 20 35 20 61 6c 73 6f  of figure 5 also
31f0: 20 68 61 73 20 61 20 63 68 69 6c 64 20 28 63 68   has a child (ch
3200: 65 63 6b 2d 69 6e 20 31 30 29 0a 62 75 74 20 74  eck-in 10).but t
3210: 68 61 74 20 63 68 69 6c 64 20 69 73 20 69 6e 20  hat child is in 
3220: 61 20 64 69 66 66 65 72 65 6e 74 20 62 72 61 6e  a different bran
3230: 63 68 2c 20 73 6f 20 63 68 65 63 6b 2d 69 6e 20  ch, so check-in 
3240: 39 20 69 73 20 61 20 6c 65 61 66 2e 20 20 42 65  9 is a leaf.  Be
3250: 63 61 75 73 65 0a 6f 66 20 74 68 65 20 3c 62 3e  cause.of the <b>
3260: 63 6c 6f 73 65 64 3c 2f 62 3e 20 74 61 67 20 63  closed</b> tag c
3270: 68 65 63 6b 2d 69 6e 20 39 2c 20 69 74 20 69 73  heck-in 9, it is
3280: 20 61 20 63 6c 6f 73 65 64 20 6c 65 61 66 2e 0a   a closed leaf..
3290: 0a 43 68 65 63 6b 2d 69 6e 20 32 20 6f 66 20 66  .Check-in 2 of f
32a0: 69 67 75 72 65 20 33 20 69 73 20 63 6f 6e 73 69  igure 3 is consi
32b0: 64 65 72 65 64 20 61 20 22 66 6f 72 6b 22 0a 62  dered a "fork".b
32c0: 65 63 61 75 73 65 20 69 74 20 68 61 73 20 74 77  ecause it has tw
32d0: 6f 20 63 68 69 6c 64 72 65 6e 20 69 6e 20 74 68  o children in th
32e0: 65 20 73 61 6d 65 20 62 72 61 6e 63 68 2e 20 20  e same branch.  
32f0: 43 68 65 63 6b 2d 69 6e 20 32 20 6f 66 20 66 69  Check-in 2 of fi
3300: 67 75 72 65 20 35 0a 61 6c 73 6f 20 68 61 73 20  gure 5.also has 
3310: 74 77 6f 20 63 68 69 6c 64 72 65 6e 2c 20 62 75  two children, bu
3320: 74 20 65 61 63 68 20 63 68 69 6c 64 20 69 73 20  t each child is 
3330: 69 6e 20 61 20 64 69 66 66 65 72 65 6e 74 20 62  in a different b
3340: 72 61 6e 63 68 2c 20 68 65 6e 63 65 20 69 6e 0a  ranch, hence in.
3350: 66 69 67 75 72 65 20 35 2c 20 63 68 65 63 6b 2d  figure 5, check-
3360: 69 6e 20 32 20 69 73 20 63 6f 6e 73 69 64 65 72  in 2 is consider
3370: 65 64 20 61 20 22 62 72 61 6e 63 68 20 70 6f 69  ed a "branch poi
3380: 6e 74 22 2e 0a                                   nt"..