FossilBook

Check-in [71c9156209]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Initial commit, all content is identical, but moved the book to a main tex file with a chapter listing as \include{}
Timelines: family | ancestors | descendants | both | 2ndEdition
Files: files | file ages | folders
SHA1: 71c9156209de0f1a12ebb9f205a5a6350b40b861
User & Date: frans 2012-11-28 20:09:34
Context
2012-11-28
20:49
Changed main document class to koma script book (scrbook) and added chapter headings to all chapters check-in: 7d50e0d156 user: frans tags: 2ndEdition
20:09
Initial commit, all content is identical, but moved the book to a main tex file with a chapter listing as \include{} check-in: 71c9156209 user: frans tags: 2ndEdition
01:33
Create new branch named "2ndEdition" check-in: 324816f926 user: frans tags: 2ndEdition
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added Chapters/commands.tex.























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835


\section{Fossil Commands}


\subsection{Introduction}

This section will go through the various Fossil command line commands. This will be divided into sections, the first will detail the must know commands. These are the ones you will be using all the time and will probably have memorized in short order. The other commands will be divided into Maintenance, Advanced, and Miscellaneous. These you will probably be checking as reference before use.

The most important command is \textbf{help}. You can always type \textbf{fossil help} at the command line and it will list out all the commands it has. Then typing f\textbf{ossil help <command> }will print out the detailed information on that command. You always have that as your reference. This section of the book will try to supplement the built in help with some examples and further explanation of what a command does. All of the commands will be placed in the index for easy searching

\textbf{NOTE:} Fossil is a moving target, commands might be added and others removed future versions. Type \textbf{fossil help }on your version to get the latest list. The following applies to the fossil I used when I wrote this and your version might be different.


\subsection{Basic Commands}


\subsubsection{help\index{help}}

This command is used to dump the current command set and version of Fossil. It can also be used in the form \textbf{fossil help <command> }to get further information on any command.

\begin{figure}[H]
\noindent \begin{centering}
\includegraphics{Images/Commands/help1}
\par\end{centering}

\caption{Help run}


\end{figure}


Using it to get further information about a particular command

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~add}{\scriptsize \par}

{\scriptsize Usage:~fossil~add~FILE...}{\scriptsize \par}

{\scriptsize Make~arrangements~to~add~one~or~more~files~to~the~current~checkout}{\scriptsize \par}

{\scriptsize at~the~next~commit.}{\scriptsize \par}

{\scriptsize When~adding~files~recursively,~filenames~that~begin~with~\textquotedbl{}.\textquotedbl{}~are}{\scriptsize \par}

{\scriptsize excluded~by~default.~To~include~such~files,~add~the~\textquotedbl{}-{}-dotfiles\textquotedbl{}}{\scriptsize \par}

{\scriptsize option~to~the~command-line.}{\scriptsize \par}
\end{lyxcode}
\caption{Help detail}


\end{figure}



\subsubsection{add\index{add}}

The add command is used to add files into a repository. It is recursive and will pull in all files in subdirectories of the current. Fossil will not overwrite any of the files already present in the repository so it is safe to add all the files at any time. Only new files will be added.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil}{\scriptsize{}~}\textbf{\scriptsize help~add}{\scriptsize \par}

{\scriptsize Usage:~fossil~add~FILE...}{\scriptsize \par}

{\scriptsize Make~arrangements~to~add~one~or~more~files~to~the~current~checkout}{\scriptsize \par}

{\scriptsize at~the~next~commit.}{\scriptsize \par}

{\scriptsize When~adding~files~recursively,~filenames~that~begin~with~\textquotedbl{}.\textquotedbl{}~are}{\scriptsize \par}

{\scriptsize excluded~by~default.~To~include~such~files,~add~the~\textquotedbl{}-{}-dotfiles\textquotedbl{}}{\scriptsize \par}

{\scriptsize option~to~the~command-line.}{\scriptsize \par}
\end{lyxcode}
\caption{add detail}


\end{figure}


Typing:
\begin{lyxcode}
fossil~add~.
\end{lyxcode}
will add all files in the current directory and subdirectories.

Note none of these files are put in the repository untill a commit is done.


\subsubsection{rm\index{rm} or del\index{del}}

The rm command is used to remove files from the repository. The file is not deleted from the file system but it will be dropped from the repository on the next commit. This file will still be available in earlier versions of the repository but not in later ones.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~rm}{\scriptsize \par}

{\scriptsize Usage:~fossil~rm~FILE...}{\scriptsize \par}

{\scriptsize{}~~~or:~fossil~del~FILE...}{\scriptsize \par}

{\scriptsize Remove~one~or~more~files~from~the~tree.}{\scriptsize \par}

{\scriptsize This~command~does~not~remove~the~files~from~disk.~~It~just~marks~the}{\scriptsize \par}

{\scriptsize files~as~no~longer~being~part~of~the~project.~~In~other~words,~future}{\scriptsize \par}

{\scriptsize changes~to~the~named~files~will~not~be~versioned.}{\scriptsize \par}
\end{lyxcode}
\caption{rm detail}


\end{figure}


You can delete groups of files by using wild-cards in their names. Thus if I had a group of files like com\_tr.c, com\_rx.c and com\_mgmt.c I could remove them all with:
\begin{lyxcode}
fossil~rm~com\_{*}.c
\end{lyxcode}
By running a ``fossil status'' you can see what files will be deleted on the next commit.


\subsubsection{rename\index{rename} or mv\index{mv}}

This command is used to rename a file in the repository. This does not rename files on disk so is usually used after you have renamed files on the disk then want to change this in the repository.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~help~rename}{\scriptsize \par}

{\scriptsize Usage:~fossil~mv|rename~OLDNAME~NEWNAME}{\scriptsize \par}

{\scriptsize{}~~~or:~fossil~mv|rename~OLDNAME...~DIR}{\scriptsize \par}

{\scriptsize Move~or~rename~one~or~more~files~within~the~tree}{\scriptsize \par}

{\scriptsize This~command~does~not~rename~the~files~on~disk.~~All~this~command~does~is}{\scriptsize \par}

{\scriptsize record~the~fact~that~filenames~have~changed~so~that~appropriate~notations}{\scriptsize \par}

{\scriptsize can~be~made~at~the~next~commit/checkin.}{\scriptsize \par}
\end{lyxcode}
\caption{rename detail}
\end{figure}


Just like add or rm you can use wild cards in the names and rename groups of files. Like them ``fossil status'' will show you the current state.


\subsubsection{status\index{status}}

The status command is used to show you the current state of your files relative to the repository. It will show you files added, deleted, and changed. This is only the condition of files that are already in the repository or under control of fossil. It also shows from where in the timeline you are checked out and where your repository is kept.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~status}{\scriptsize \par}

{\scriptsize repository:~~~/Users/jschimpf/Public/FOSSIL/FossilBook.fossil}{\scriptsize \par}

{\scriptsize local-root:~~~/Users/jschimpf/Public/FossilBook/}{\scriptsize \par}

{\scriptsize server-code:~~3e67da6d6212494456c69b1c5406a277d7e50430}{\scriptsize \par}

{\scriptsize checkout:~~~~~edd5b5fa4277604f365ec09238422c0aa7a28faf~2010-05-08~14:44:21~UTC}{\scriptsize \par}

{\scriptsize parent:~~~~~~~3f019cbc730db0eb35f20941533a22635856b2b3~2010-05-08~11:15:19~UTC}{\scriptsize \par}

{\scriptsize tags:~~~~~~~~~trunk}{\scriptsize \par}

{\scriptsize EDITED~~~~~fossilbook.lyx}{\scriptsize \par}

{\scriptsize EDITED~~~~~outline.txt}{\scriptsize \par}
\end{lyxcode}
\caption{\label{fig:status-run}status run}


\end{figure}


The listing above shows where my cloned copy of the repository is kept, where I am working, and the tags show me that I am checked out of the trunk. Finally it shows the status of the files: I am working on two of them.


\subsubsection{changes\index{changes}}

This lists the changed files like status but does not show the other information that status does.

\begin{figure}
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~changes}{\scriptsize \par}

{\scriptsize Usage:~fossil~changes}{\scriptsize \par}

{\scriptsize Report~on~the~edit~status~of~all~files~in~the~current~checkout.}{\scriptsize \par}

{\scriptsize See~also~the~\textquotedbl{}status\textquotedbl{}~and~\textquotedbl{}extra\textquotedbl{}~commands.}{\scriptsize \par}
\end{lyxcode}
\caption{changes details}


\end{figure}



\subsubsection{extra\index{extra}}

The extra command is used to find files you have added to your working directory but are not yet under Fossil control. This is important because if you move your working directory or others attempt to use the repository they won't have these files. 

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~extra}{\scriptsize \par}

{\scriptsize Usage:~fossil~extras~?-{}-dotfiles?~?-{}-ignore~GLOBPATTERN?}{\scriptsize \par}

{\scriptsize Print~a~list~of~all~files~in~the~source~tree~that~are~not~part~of}{\scriptsize \par}

{\scriptsize the~current~checkout.~~See~also~the~\textquotedbl{}clean\textquotedbl{}~command.}{\scriptsize \par}

{\scriptsize Files~and~subdirectories~whose~names~begin~with~\textquotedbl{}.\textquotedbl{}~are~normally}{\scriptsize \par}

{\scriptsize ignored~but~can~be~included~by~adding~the~-{}-dotfiles~option.}{\scriptsize \par}
\end{lyxcode}
\caption{extra details}


\end{figure}


The --dotfiles option shows you any files starting with ``.'' that are not under Fossil control. This would be important if you need those files in your repository. The last option --ignore allows you to ignore certain files you know don't belong in the repository. In my case there is a file called fossilbook.lyx\textasciitilde{} that is a \LyX{} backup file that I do not want, as it is temporary. So I can say
\begin{lyxcode}
fossil~extra~-{}-ignore~{*}.lyx\textasciitilde{}~
\end{lyxcode}
and only get:
\begin{lyxcode}
{[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~\textbf{fossil~extra~-{}-ignore~{*}.lyx\textasciitilde{}}

Images/Commands/help1.epsf
\end{lyxcode}
instead of:
\begin{lyxcode}
{[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~\textbf{fossil~extra}

Images/Commands/help1.epsf

fossilbook.lyx\textasciitilde{}
\end{lyxcode}

\subsubsection{revert\index{revert}}

The revert command is used to take a file back to the value in the repository. This is useful when you make a error in editing or other mistake.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~revert}{\scriptsize \par}

{\scriptsize Usage:~fossil~revert~?-r~REVISION?~FILE~...}{\scriptsize \par}

{\scriptsize Revert~to~the~current~repository~version~of~FILE,~or~to}{\scriptsize \par}

{\scriptsize the~version~associated~with~baseline~REVISION~if~the~-r~flag}{\scriptsize \par}

{\scriptsize appears.}{\scriptsize \par}

{\scriptsize If~a~file~is~reverted~accidently,~it~can~be~restored~using}{\scriptsize \par}

{\scriptsize the~\textquotedbl{}fossil~undo\textquotedbl{}~command.}{\scriptsize \par}
\end{lyxcode}
\caption{revert details}


\end{figure}


With no parameters it will revert the file to the current revision, see Figure \vref{fig:status-run}. The -r option allows you to pick any revision from the time line.


\subsubsection{update\index{update}}

The update option will update a file or files to match the repository. With multiple users it should be done before you start working on any files. This ensures you have the latest version of all the files. 

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~update}{\scriptsize \par}

{\scriptsize Usage:~fossil~update~?VERSION?~?FILES...?}{\scriptsize \par}

{\scriptsize Change~the~version~of~the~current~checkout~to~VERSION.~~Any~uncommitted}{\scriptsize \par}

{\scriptsize changes~are~retained~and~applied~to~the~new~checkout.}{\scriptsize \par}



{\scriptsize The~VERSION~argument~can~be~a~specific~version~or~tag~or~branch~name.}{\scriptsize \par}

{\scriptsize If~the~VERSION~argument~is~omitted,~then~the~leaf~of~the~the~subtree}{\scriptsize \par}

{\scriptsize that~begins~at~the~current~version~is~used,~if~there~is~only~a~single}{\scriptsize \par}

{\scriptsize leaf.~~VERSION~can~also~be~\textquotedbl{}current\textquotedbl{}~to~select~the~leaf~of~the~current}{\scriptsize \par}

{\scriptsize version~or~\textquotedbl{}latest\textquotedbl{}~to~select~the~most~recent~check-in.}{\scriptsize \par}



{\scriptsize If~one~or~more~FILES~are~listed~after~the~VERSION~then~only~the}{\scriptsize \par}

{\scriptsize named~files~are~candidates~to~be~updated.~~If~FILES~is~omitted,~all}{\scriptsize \par}

{\scriptsize files~in~the~current~checkout~are~subject~to~be~updated.}{\scriptsize \par}



{\scriptsize The~-n~or~-{}-nochange~option~causes~this~command~to~do~a~\textquotedbl{}dry~run\textquotedbl{}.~~It}{\scriptsize \par}

{\scriptsize prints~out~what~would~have~happened~but~does~not~actually~make~any}{\scriptsize \par}

{\scriptsize changes~to~the~current~checkout~or~the~repository.}{\scriptsize \par}



{\scriptsize The~-v~or~-{}-verbose~option~prints~status~information~about~unchanged}{\scriptsize \par}

{\scriptsize files~in~addition~to~those~file~that~actually~do~change.}{\scriptsize \par}
\end{lyxcode}
\caption{update details}


\end{figure}


Update has a number of options, first you can tie the update to a particular version, if not picked then it just uses the latest. Second it can work on a single files or many files at once. That is you could say
\begin{lyxcode}
fossil~update~{*}.c
\end{lyxcode}
and it would update all C files.

Since this is a rather large set of changes it has a special ``dry run'' mode. If you add -n on the command it will just print out what will be done but not do it. This is very useful to do this trial if you are unsure what might happen. The -v command (which can be used with -n or alone) prints out the action for each file even if it does nothing.


\subsubsection{checkout\index{checkout} or co\index{co}}

This command is similar to update.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~help~checkout}{\scriptsize \par}

{\scriptsize Usage:~fossil~checkout~VERSION~?-f|-{}-force?~?-{}-keep?}{\scriptsize \par}

{\scriptsize Check~out~a~version~specified~on~the~command-line.~~This~command}{\scriptsize \par}

{\scriptsize will~abort~if~there~are~edited~files~in~the~current~checkout~unless}{\scriptsize \par}

{\scriptsize the~-{}-force~option~appears~on~the~command-line.~~The~-{}-keep~option}{\scriptsize \par}

{\scriptsize leaves~files~on~disk~unchanged,~except~the~manifest~and~manifest.uuid}{\scriptsize \par}

{\scriptsize files.}{\scriptsize \par}

{\scriptsize The~-{}-latest~flag~can~be~used~in~place~of~VERSION~to~checkout~the}{\scriptsize \par}

{\scriptsize latest~version~in~the~repository.}{\scriptsize \par}

{\scriptsize See~also~the~\textquotedbl{}update\textquotedbl{}~command.}{\scriptsize \par}
\end{lyxcode}
\caption{checkout or co details}


\end{figure}



\subsubsection{undo\index{undo}}

This is used to undo the last update, merge, or revert operation. 

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~undo}{\scriptsize \par}

{\scriptsize Usage:~fossil~undo~?FILENAME...?}{\scriptsize \par}



{\scriptsize Undo~the~most~recent~update~or~merge~or~revert~operation.~~If~FILENAME~is}{\scriptsize \par}

{\scriptsize specified~then~restore~the~content~of~the~named~file(s)~but~otherwise}{\scriptsize \par}

{\scriptsize leave~the~update~or~merge~or~revert~in~effect.}{\scriptsize \par}



{\scriptsize A~single~level~of~undo/redo~is~supported.~~The~undo/redo~stack}{\scriptsize \par}

{\scriptsize is~cleared~by~the~commit~and~checkout~commands.}{\scriptsize \par}
\end{lyxcode}
\caption{undo details}


\end{figure}


It acts on a single file or files if specified, otherwise if no file given, it undoes all of the last changes.


\subsubsection{diff\index{diff}}

The diff command is used to produce a text listing of the difference of a file in the working directory and that same file in the repository. If you don't specify a file it will show the differences between all the changed files in the working directory vs the repository. If you use the --from and --to options you can specify which versions to check and to compare between two different versions in the repository. Not using the --to means compare with the working directory.

If you have configured an external diff program it will be used unless you use the -i option which uses the diff built into Fossil.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~diff}{\scriptsize \par}

{\scriptsize Usage:~fossil~diff|gdiff~?options?~?FILE?}{\scriptsize \par}



{\scriptsize Show~the~difference~between~the~current~version~of~FILE~(as~it}{\scriptsize \par}

{\scriptsize exists~on~disk)~and~that~same~file~as~it~was~checked~out.~~Or}{\scriptsize \par}

{\scriptsize if~the~FILE~argument~is~omitted,~show~the~unsaved~changed~currently}{\scriptsize \par}

{\scriptsize in~the~working~check-out.}{\scriptsize \par}



{\scriptsize If~the~\textquotedbl{}-{}-from~VERSION\textquotedbl{}~or~\textquotedbl{}-r~VERSION\textquotedbl{}~option~is~used~it~specifies}{\scriptsize \par}

{\scriptsize the~source~check-in~for~the~diff~operation.~~If~not~specified,~the~}{\scriptsize \par}

{\scriptsize source~check-in~is~the~base~check-in~for~the~current~check-out.}{\scriptsize \par}

{\scriptsize If~the~\textquotedbl{}-{}-to~VERSION\textquotedbl{}~option~appears,~it~specifies~the~check-in~from}{\scriptsize \par}

{\scriptsize which~the~second~version~of~the~file~or~files~is~taken.~~If~there~is}{\scriptsize \par}

{\scriptsize no~\textquotedbl{}-{}-to\textquotedbl{}~option~then~the~(possibly~edited)~files~in~the~current~check-out}{\scriptsize \par}

{\scriptsize are~used.}{\scriptsize \par}



{\scriptsize The~\textquotedbl{}-i\textquotedbl{}~command-line~option~forces~the~use~of~the~internal~diff~logic}{\scriptsize \par}

{\scriptsize rather~than~any~external~diff~program~that~might~be~configured~using}{\scriptsize \par}

{\scriptsize the~\textquotedbl{}setting\textquotedbl{}~command.~~If~no~external~diff~program~is~configured,~then}{\scriptsize \par}

{\scriptsize the~\textquotedbl{}-i\textquotedbl{}~option~is~a~no-op.~~The~\textquotedbl{}-i\textquotedbl{}~option~converts~\textquotedbl{}gdiff\textquotedbl{}~into~\textquotedbl{}diff\textquotedbl{}.}{\scriptsize \par}
\end{lyxcode}
\caption{diff details}


\end{figure}



\subsubsection{gdiff\index{gdiff}}

This is the same as the diff command but uses (if configured) a graphical diff program you have on your system. See the settings command for details on how to set the graphical diff program.

\begin{figure}
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~gdiff}{\scriptsize \par}

{\scriptsize Usage:~fossil~diff|gdiff~?options?~?FILE?}{\scriptsize \par}

{\scriptsize Show~the~difference~between~the~current~version~of~FILE~(as~it}{\scriptsize \par}

{\scriptsize exists~on~disk)~and~that~same~file~as~it~was~checked~out.~~Or}{\scriptsize \par}

{\scriptsize if~the~FILE~argument~is~omitted,~show~the~unsaved~changed~currently}{\scriptsize \par}

{\scriptsize in~the~working~check-out.}{\scriptsize \par}

{\scriptsize If~the~\textquotedbl{}-{}-from~VERSION\textquotedbl{}~or~\textquotedbl{}-r~VERSION\textquotedbl{}~option~is~used~it~specifies}{\scriptsize \par}

{\scriptsize the~source~check-in~for~the~diff~operation.~~If~not~specified,~the~}{\scriptsize \par}

{\scriptsize source~check-in~is~the~base~check-in~for~the~current~check-out.}{\scriptsize \par}

{\scriptsize If~the~\textquotedbl{}-{}-to~VERSION\textquotedbl{}~option~appears,~it~specifies~the~check-in~from}{\scriptsize \par}

{\scriptsize which~the~second~version~of~the~file~or~files~is~taken.~~If~there~is}{\scriptsize \par}

{\scriptsize no~\textquotedbl{}-{}-to\textquotedbl{}~option~then~the~(possibly~edited)~files~in~the~current~check-out}{\scriptsize \par}

{\scriptsize are~used.}{\scriptsize \par}

{\scriptsize The~\textquotedbl{}-i\textquotedbl{}~command-line~option~forces~the~use~of~the~internal~diff~logic}{\scriptsize \par}

{\scriptsize rather~than~any~external~diff~program~that~might~be~configured~using}{\scriptsize \par}

{\scriptsize the~\textquotedbl{}setting\textquotedbl{}~command.~~If~no~external~diff~program~is~configured,~then}{\scriptsize \par}

{\scriptsize the~\textquotedbl{}-i\textquotedbl{}~option~is~a~no-op.~~The~\textquotedbl{}-i\textquotedbl{}~option~converts~\textquotedbl{}gdiff\textquotedbl{}~into~\textquotedbl{}diff\textquotedbl{}.}{\scriptsize \par}
\end{lyxcode}
\caption{gdiff details}


\end{figure}



\subsubsection{ui\index{ui} }

The ui command is used to start Fossil in a local webserver. The --port option is used to specify the port it uses, by default it uses 8080. It should automatically start the system's web browser and it will come up with the repository web page. If run within a working directory it will bring up the web page for that repository. If run outside the working directory you can specify the repository on the command line.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~help~ui}{\scriptsize \par}

{\scriptsize Usage:~fossil~server~?-P|-{}-port~TCPPORT?~?REPOSITORY?}{\scriptsize \par}

{\scriptsize{}~~~Or:~fossil~ui~?-P|-{}-port~TCPPORT?~?REPOSITORY?}{\scriptsize \par}



{\scriptsize Open~a~socket~and~begin~listening~and~responding~to~HTTP~requests~on}{\scriptsize \par}

{\scriptsize TCP~port~8080,~or~on~any~other~TCP~port~defined~by~the~-P~or}{\scriptsize \par}

{\scriptsize -{}-port~option.~~The~optional~argument~is~the~name~of~the~repository.}{\scriptsize \par}

{\scriptsize The~repository~argument~may~be~omitted~if~the~working~directory~is}{\scriptsize \par}

{\scriptsize within~an~open~checkout.}{\scriptsize \par}



{\scriptsize The~\textquotedbl{}ui\textquotedbl{}~command~automatically~starts~a~web~browser~after~initializing}{\scriptsize \par}

{\scriptsize the~web~server.}{\scriptsize \par}



{\scriptsize In~the~\textquotedbl{}server\textquotedbl{}~command,~the~REPOSITORY~can~be~a~directory~(aka~folder)}{\scriptsize \par}

{\scriptsize that~contains~one~or~more~repositories~with~names~ending~in~\textquotedbl{}.fossil\textquotedbl{}.}{\scriptsize \par}

{\scriptsize In~that~case,~the~first~element~of~the~URL~is~used~to~select~among~the}{\scriptsize \par}

{\scriptsize various~repositories.}{\scriptsize \par}
\end{lyxcode}
\caption{ui details}
\end{figure}



\subsubsection{server\index{server}}

This is a more powerful version of the ui command. This allows you to have multiple repositories supported by a single running Fossil webserver. This way you start the server and instead of a paricular repository you specify a directory where a number of repositories reside (all having the extension .fossil) then you can open and use any of them.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~server}{\scriptsize \par}

{\scriptsize Usage:~fossil~server~?-P|-{}-port~TCPPORT?~?REPOSITORY?}{\scriptsize \par}

{\scriptsize{}~~~Or:~fossil~ui~?-P|-{}-port~TCPPORT?~?REPOSITORY?}{\scriptsize \par}

{\scriptsize Open~a~socket~and~begin~listening~and~responding~to~HTTP~requests~on}{\scriptsize \par}

{\scriptsize TCP~port~8080,~or~on~any~other~TCP~port~defined~by~the~-P~or}{\scriptsize \par}

{\scriptsize -{}-port~option.~~The~optional~argument~is~the~name~of~the~repository.}{\scriptsize \par}

{\scriptsize The~repository~argument~may~be~omitted~if~the~working~directory~is}{\scriptsize \par}

{\scriptsize within~an~open~checkout.}{\scriptsize \par}

{\scriptsize The~\textquotedbl{}ui\textquotedbl{}~command~automatically~starts~a~web~browser~after~initializing}{\scriptsize \par}

{\scriptsize the~web~server.}{\scriptsize \par}

{\scriptsize In~the~\textquotedbl{}server\textquotedbl{}~command,~the~REPOSITORY~can~be~a~directory~(aka~folder)}{\scriptsize \par}

{\scriptsize that~contains~one~or~more~repositories~with~names~ending~in~\textquotedbl{}.fossil\textquotedbl{}.}{\scriptsize \par}

{\scriptsize In~that~case,~the~first~element~of~the~URL~is~used~to~select~among~the}{\scriptsize \par}

{\scriptsize various~repositories.}{\scriptsize \par}
\end{lyxcode}
\caption{server detail\label{fig:server-detail}}


\end{figure}



\subsubsection{commit\index{commit} or ci\index{ci}}

This is the command used to put the current changes in the working directory into the repository, giving this a new version and updating the timeline.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~help~commit}{\scriptsize \par}

{\scriptsize Usage:~fossil~commit~?OPTIONS?~?FILE...?}{\scriptsize \par}



{\scriptsize Create~a~new~version~containing~all~of~the~changes~in~the~current}{\scriptsize \par}

{\scriptsize checkout.~~You~will~be~prompted~to~enter~a~check-in~comment~unless}{\scriptsize \par}

{\scriptsize one~of~the~\textquotedbl{}-m\textquotedbl{}~or~\textquotedbl{}-M\textquotedbl{}~options~are~used~to~specify~a~comment.}{\scriptsize \par}

{\scriptsize \textquotedbl{}-m\textquotedbl{}~takes~a~single~string~for~the~commit~message~and~\textquotedbl{}-M\textquotedbl{}~requires}{\scriptsize \par}

{\scriptsize a~filename~from~which~to~read~the~commit~message.~If~neither~\textquotedbl{}-m\textquotedbl{}}{\scriptsize \par}

{\scriptsize nor~\textquotedbl{}-M\textquotedbl{}~are~specified~then~the~editor~defined~in~the~\textquotedbl{}editor\textquotedbl{}}{\scriptsize \par}

{\scriptsize fossil~option~(see~fossil~help~set)~will~be~used,~or~from~the}{\scriptsize \par}

{\scriptsize \textquotedbl{}VISUAL\textquotedbl{}~or~\textquotedbl{}EDITOR\textquotedbl{}~environment~variables~(in~that~order)~if~no}{\scriptsize \par}

{\scriptsize editor~is~set.}{\scriptsize \par}



{\scriptsize You~will~be~prompted~for~your~GPG~pass~phrase~in~order~to~sign~the}{\scriptsize \par}

{\scriptsize new~manifest~unless~the~\textquotedbl{}-{}-nosign\textquotedbl{}~options~is~used.~~All~files~that}{\scriptsize \par}

{\scriptsize have~changed~will~be~committed~unless~some~subset~of~files~is}{\scriptsize \par}

{\scriptsize specified~on~the~command~line.}{\scriptsize \par}



{\scriptsize The~-{}-branch~option~followed~by~a~branch~name~cases~the~new~check-in}{\scriptsize \par}

{\scriptsize to~be~placed~in~the~named~branch.~~The~-{}-bgcolor~option~can~be~followed}{\scriptsize \par}

{\scriptsize by~a~color~name~(ex:~~'\#ffc0c0')~to~specify~the~background~color~of}{\scriptsize \par}

{\scriptsize entries~in~the~new~branch~when~shown~in~the~web~timeline~interface.}{\scriptsize \par}

{\scriptsize A~check-in~is~not~permitted~to~fork~unless~the~-{}-force~or~-f}{\scriptsize \par}

{\scriptsize option~appears.~~A~check-in~is~not~allowed~against~a~closed~check-in.}{\scriptsize \par}

{\scriptsize The~-{}-private~option~creates~a~private~check-in~that~is~never~synced.}{\scriptsize \par}

{\scriptsize Children~of~private~check-ins~are~automatically~private.}{\scriptsize \par}



{\scriptsize Options:}{\scriptsize \par}

{\scriptsize{}~~~-{}-comment|-m~COMMENT-TEXT}{\scriptsize \par}

{\scriptsize{}~~~-{}-branch~NEW-BRANCH-NAME}{\scriptsize \par}

{\scriptsize{}~~~-{}-bgcolor~COLOR}{\scriptsize \par}

{\scriptsize{}~~~-{}-nosign}{\scriptsize \par}

{\scriptsize{}~~~-{}-force|-f}{\scriptsize \par}

{\scriptsize{}~~~-{}-private}{\scriptsize \par}

{\scriptsize{}~~~-{}-message-file|-M~COMMENT-FILE}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}{\scriptsize \par}
\end{lyxcode}
\caption{commit details}


\end{figure}


It's a very good idea to always put a comment (-comment or -m) text on any commit. This way you get documentation in the timeline.


\subsection{Maintenance commands}

These commands you will probably use less often since the actions they perform are not needed in normal operation. You will have to use them and referring here or to \textbf{fossil help} will probably be required before use. Some of them like new or clone are only needed when you start a repository. Others like rebuild or reconstruct are only needed to fix or update a repository. 


\subsubsection{new\index{new}}

This command is used to create a new repository. 

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~new}{\scriptsize \par}

{\scriptsize Usage:~fossil~new~?OPTIONS?~FILENAME}{\scriptsize \par}



{\scriptsize Create~a~repository~for~a~new~project~in~the~file~named~FILENAME.}{\scriptsize \par}

{\scriptsize This~command~is~distinct~from~\textquotedbl{}clone\textquotedbl{}.~~The~\textquotedbl{}clone\textquotedbl{}~command~makes}{\scriptsize \par}

{\scriptsize a~copy~of~an~existing~project.~~This~command~starts~a~new~project.}{\scriptsize \par}

{\scriptsize By~default,~your~current~login~name~is~used~to~create~the~default}{\scriptsize \par}

{\scriptsize admin~user.~This~can~be~overridden~using~the~-A|-{}-admin-user}{\scriptsize \par}

{\scriptsize parameter.}{\scriptsize \par}



{\scriptsize Options:}{\scriptsize \par}

{\scriptsize{}~~~-{}-admin-user|-A~USERNAME}{\scriptsize \par}

{\scriptsize{}~~~-{}-date-override~DATETIME}{\scriptsize \par}
\end{lyxcode}
\caption{new details}


\end{figure}


The file name specifies the new repository name. The options provided allow you to specify the admin user name if you want it to be different than your current login and the starting date if you want it to be different than now.


\subsubsection{clone\index{clone}}

The clone command is used to create your own local version of the master repository. If you are supporting multiple users via a network accessible version of the original repository (see Section\vref{sub:Server-Setup}), then this command will copy that repository to your machine. Also it will make a link between your copy and the master, so that changes made in your copy will be propagated to the master.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~help~clone}{\scriptsize \par}

{\scriptsize Usage:~fossil~clone~?OPTIONS?~URL~FILENAME}{\scriptsize \par}



{\scriptsize Make~a~clone~of~a~repository~specified~by~URL~in~the~local}{\scriptsize \par}

{\scriptsize file~named~FILENAME.~}{\scriptsize \par}



{\scriptsize By~default,~your~current~login~name~is~used~to~create~the~default}{\scriptsize \par}

{\scriptsize admin~user.~This~can~be~overridden~using~the~-A|-{}-admin-user}{\scriptsize \par}

{\scriptsize parameter.}{\scriptsize \par}

{\scriptsize Options:}{\scriptsize \par}



{\scriptsize{}~~~-{}-admin-user|-A~USERNAME}{\scriptsize \par}
\end{lyxcode}
\caption{clone details}


\end{figure}


Just like create you can specify the admin user for this clone with an option. The URL for the master repository is of the form:
\begin{lyxcode}
http://<user>:<password>@domain
\end{lyxcode}
Where \textbf{user} and \textbf{password} are for a valid user of the selected repository. It is best to check the path with a browser before doing the clone. Make sure you can reach it, for example the repository for this book is:
\begin{lyxcode}
http://pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi
\end{lyxcode}
Putting that into a browser should get you the home page for this book. (See Figure \vref{fig:Web-access-to}). After you have verified that, then running the clone command should work. 

Don't forget (as I always do) to put in the file name for the local repository, (see FILENAME above)


\subsubsection{open\index{open}}

The open command is used to copy the files in a repository to a working directory. Doing this allows you to build or modify the product. The command also links this working directory to the repository so commits will go into the repository.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~open}{\scriptsize \par}

{\scriptsize Usage:~fossil~open~FILENAME~?VERSION?~?-{}-keep?}{\scriptsize \par}



{\scriptsize Open~a~connection~to~the~local~repository~in~FILENAME.~~A~checkout}{\scriptsize \par}

{\scriptsize for~the~repository~is~created~with~its~root~at~the~working~directory.}{\scriptsize \par}

{\scriptsize If~VERSION~is~specified~then~that~version~is~checked~out.~~Otherwise}{\scriptsize \par}

{\scriptsize the~latest~version~is~checked~out.~~No~files~other~than~\textquotedbl{}manifest\textquotedbl{}}{\scriptsize \par}

{\scriptsize and~\textquotedbl{}manifest.uuid\textquotedbl{}~are~modified~if~the~-{}-keep~option~is~present.}{\scriptsize \par}



{\scriptsize See~also~the~\textquotedbl{}close\textquotedbl{}~command.}{\scriptsize \par}
\end{lyxcode}
\caption{open details}


\end{figure}


If you have multiple users or have a branched repository then it is probably wise to specify the particular version you want. When you run this it will create all the files and directories in the repository in your work area. In addition the files \_FOSSIL\_, manifiest and manifest.uuid will be created by Fossil.


\subsubsection{close\index{close}}

This is the opposite of open, in that it breaks the connection between this working directory and the Fossil repository.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~close}{\scriptsize \par}

{\scriptsize Usage:~fossil~close~?-f|-{}-force?}{\scriptsize \par}



{\scriptsize The~opposite~of~\textquotedbl{}open\textquotedbl{}.~~Close~the~current~database~connection.}{\scriptsize \par}

{\scriptsize Require~a~-f~or~-{}-force~flag~if~there~are~unsaved~changed~in~the}{\scriptsize \par}

{\scriptsize current~check-out.}{\scriptsize \par}
\end{lyxcode}
\caption{close details}


\end{figure}


This is useful if you need to abandon the current working directory. Fossil will not let you do this if there are changes between the current directory and the repository. With the force flag you can explicitly cut the connection even if there are changes.


\subsubsection{version\index{version}}

This command is used to show the current version of fossil.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~version}{\scriptsize \par}

{\scriptsize Usage:~fossil~version}{\scriptsize \par}

{\scriptsize Print~the~source~code~version~number~for~the~fossil~executable.}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~version}{\scriptsize \par}

{\scriptsize This~is~fossil~version~{[}c56af61e5e{]}~2010-04-22~15:48:25~UTC}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}{\scriptsize \par}
\end{lyxcode}
\caption{version details}


\end{figure}


The above figure shows the help and example of running the command. When you have problems with fossil it is very important to have this version information. You can then inquire of the Fossil news group about this problem and with the version information they can easily tell you if the problem is fixed already or is new.


\subsubsection{rebuild\index{rebuild}}

If you update your copy of Fossil you will want to run this command against all the repositories you have. This will automatically update them to the new version of Fossil.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~rebuild}{\scriptsize \par}

{\scriptsize Usage:~fossil~rebuild~?REPOSITORY?}{\scriptsize \par}

{\scriptsize Reconstruct~the~named~repository~database~from~the~core}{\scriptsize \par}

{\scriptsize records.~~Run~this~command~after~updating~the~fossil}{\scriptsize \par}

{\scriptsize executable~in~a~way~that~changes~the~database~schema.}{\scriptsize \par}
\end{lyxcode}
\caption{rebuild details}


\end{figure}



\subsubsection{all\index{all}}

This command is actually a modifier and when used before certain commands will run them on all the repositories.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~all}{\scriptsize \par}

{\scriptsize Usage:~fossil~all~(list|ls|pull|push|rebuild|sync)}{\scriptsize \par}

{\scriptsize The~\textasciitilde{}/.fossil~file~records~the~location~of~all~repositories~for~a}{\scriptsize \par}

{\scriptsize user.~~This~command~performs~certain~operations~on~all~repositories}{\scriptsize \par}

{\scriptsize that~can~be~useful~before~or~after~a~period~of~disconnection~operation.}{\scriptsize \par}

{\scriptsize Available~operations~are:}{\scriptsize \par}

{\scriptsize{}~~~list~~~~~~~Display~the~location~of~all~repositories}{\scriptsize \par}

{\scriptsize{}~~~ls~~~~~~~~~An~alias~for~\textquotedbl{}list\textquotedbl{}}{\scriptsize \par}

{\scriptsize{}~~~pull~~~~~~~Run~a~\textquotedbl{}pull\textquotedbl{}~operation~on~all~repositories}{\scriptsize \par}

{\scriptsize{}~~~push~~~~~~~Run~a~\textquotedbl{}push\textquotedbl{}~on~all~repositories}{\scriptsize \par}

{\scriptsize{}~~~rebuild~~~~Rebuild~on~all~repositories}{\scriptsize \par}

{\scriptsize{}~~~sync~~~~~~~Run~a~\textquotedbl{}sync\textquotedbl{}~on~all~repositories}{\scriptsize \par}

{\scriptsize Repositories~are~automatically~added~to~the~set~of~known~repositories}{\scriptsize \par}

{\scriptsize when~one~of~the~following~commands~against~the~repository:~clone,~info,}{\scriptsize \par}

{\scriptsize pull,~push,~or~sync}{\scriptsize \par}
\end{lyxcode}
\caption{all details}


\end{figure}



\subsubsection{push\index{push}}

This command will push changes in the local repository to the master or remote repository.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~push}{\scriptsize \par}

{\scriptsize Usage:~fossil~push~?URL?~?options?}{\scriptsize \par}

{\scriptsize Push~changes~in~the~local~repository~over~into~a~remote~repository.}{\scriptsize \par}

{\scriptsize Use~the~\textquotedbl{}-R~REPO\textquotedbl{}~or~\textquotedbl{}-{}-repository~REPO\textquotedbl{}~command-line~options}{\scriptsize \par}

{\scriptsize to~specify~an~alternative~repository~file.}{\scriptsize \par}

{\scriptsize If~the~URL~is~not~specified,~then~the~URL~from~the~most~recent}{\scriptsize \par}

{\scriptsize clone,~push,~pull,~remote-url,~or~sync~command~is~used.}{\scriptsize \par}

{\scriptsize The~URL~specified~normally~becomes~the~new~\textquotedbl{}remote-url\textquotedbl{}~used~for}{\scriptsize \par}

{\scriptsize subsequent~push,~pull,~and~sync~operations.~~However,~the~\textquotedbl{}-{}-once\textquotedbl{}}{\scriptsize \par}

{\scriptsize command-line~option~makes~the~URL~a~one-time-use~URL~that~is~not}{\scriptsize \par}

{\scriptsize saved.}{\scriptsize \par}

{\scriptsize See~also:~clone,~pull,~sync,~remote-url}{\scriptsize \par}
\end{lyxcode}
\caption{push details}


\end{figure}



\subsubsection{pull\index{pull}}

This command will copy changes from the remote repository to the local repository. You could then use \textbf{update} to apply these changes to checked out files.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~pull}{\scriptsize \par}

{\scriptsize Usage:~fossil~pull~?URL?~?options?}{\scriptsize \par}

{\scriptsize Pull~changes~from~a~remote~repository~into~the~local~repository.}{\scriptsize \par}

{\scriptsize Use~the~\textquotedbl{}-R~REPO\textquotedbl{}~or~\textquotedbl{}-{}-repository~REPO\textquotedbl{}~command-line~options}{\scriptsize \par}

{\scriptsize to~specify~an~alternative~repository~file.}{\scriptsize \par}

{\scriptsize If~the~URL~is~not~specified,~then~the~URL~from~the~most~recent}{\scriptsize \par}

{\scriptsize clone,~push,~pull,~remote-url,~or~sync~command~is~used.}{\scriptsize \par}

{\scriptsize The~URL~specified~normally~becomes~the~new~\textquotedbl{}remote-url\textquotedbl{}~used~for}{\scriptsize \par}

{\scriptsize subsequent~push,~pull,~and~sync~operations.~~However,~the~\textquotedbl{}-{}-once\textquotedbl{}}{\scriptsize \par}

{\scriptsize command-line~option~makes~the~URL~a~one-time-use~URL~that~is~not}{\scriptsize \par}

{\scriptsize saved.}{\scriptsize \par}

{\scriptsize See~also:~clone,~push,~sync,~remote-url}{\scriptsize \par}


\end{lyxcode}
\caption{pull details}


\end{figure}



\subsubsection{sync\index{sync}}

This command is used to sync a remote copy with the original copy of the repository, it does both a push and pull. This can also be used to switch a local repository to a different main repository by specifying the URL of a remote repository. If you want to run the update command with -n where it does a dry run, this does not do a sync first so doing fossil sync then fossil update -n will do that for you.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~sync}{\scriptsize \par}

{\scriptsize Usage:~fossil~sync~?URL?~?options?}{\scriptsize \par}

{\scriptsize Synchronize~the~local~repository~with~a~remote~repository.~~This~is}{\scriptsize \par}

{\scriptsize the~equivalent~of~running~both~\textquotedbl{}push\textquotedbl{}~and~\textquotedbl{}pull\textquotedbl{}~at~the~same~time.}{\scriptsize \par}

{\scriptsize Use~the~\textquotedbl{}-R~REPO\textquotedbl{}~or~\textquotedbl{}-{}-repository~REPO\textquotedbl{}~command-line~options}{\scriptsize \par}

{\scriptsize to~specify~an~alternative~repository~file.}{\scriptsize \par}

{\scriptsize If~a~user-id~and~password~are~required,~specify~them~as~follows:}{\scriptsize \par}

{\scriptsize{}~~~~http://userid:password@www.domain.com:1234/path}{\scriptsize \par}

{\scriptsize If~the~URL~is~not~specified,~then~the~URL~from~the~most~recent~successful}{\scriptsize \par}

{\scriptsize clone,~push,~pull,~remote-url,~or~sync~command~is~used.}{\scriptsize \par}

{\scriptsize The~URL~specified~normally~becomes~the~new~\textquotedbl{}remote-url\textquotedbl{}~used~for}{\scriptsize \par}

{\scriptsize subsequent~push,~pull,~and~sync~operations.~~However,~the~\textquotedbl{}-{}-once\textquotedbl{}}{\scriptsize \par}

{\scriptsize command-line~option~makes~the~URL~a~one-time-use~URL~that~is~not}{\scriptsize \par}

{\scriptsize saved.}{\scriptsize \par}

{\scriptsize See~also:~~clone,~push,~pull,~remote-url}{\scriptsize \par}
\end{lyxcode}
\caption{sync details}


\end{figure}



\subsubsection{clean\index{clean}}

This call can be used to remove all the ``extra'' files in a source tree. This is useful if you wish to tidy up a source tree or to do a clean build.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~clean}{\scriptsize \par}

{\scriptsize Usage:~fossil~clean~?-{}-force?~?-{}-dotfiles?}{\scriptsize \par}

{\scriptsize Delete~all~\textquotedbl{}extra\textquotedbl{}~files~in~the~source~tree.~~\textquotedbl{}Extra\textquotedbl{}~files~are}{\scriptsize \par}

{\scriptsize files~that~are~not~officially~part~of~the~checkout.~~See~also}{\scriptsize \par}

{\scriptsize the~\textquotedbl{}extra\textquotedbl{}~command.~This~operation~cannot~be~undone.~}{\scriptsize \par}

{\scriptsize You~will~be~prompted~before~removing~each~file.~If~you~are}{\scriptsize \par}

{\scriptsize sure~you~wish~to~remove~all~\textquotedbl{}extra\textquotedbl{}~files~you~can~specify~the}{\scriptsize \par}

{\scriptsize optional~-{}-force~flag~and~no~prompts~will~be~issued.}{\scriptsize \par}

{\scriptsize Files~and~subdirectories~whose~names~begin~with~\textquotedbl{}.\textquotedbl{}~are}{\scriptsize \par}

{\scriptsize normally~ignored.~~They~are~included~if~the~\textquotedbl{}-{}-dotfiles\textquotedbl{}~option}{\scriptsize \par}

{\scriptsize is~used.}{\scriptsize \par}
\end{lyxcode}
\caption{clean details}


\end{figure}



\subsubsection{branch\index{branch}}

This command is used if you want to create or list branches in a repository. Previously we discussed forks ( See Section \vref{sub:Complications}); branches are the same idea but under user control. This would be where you have version 1.0 of something but want to branch off version 2.0 to add new features but want to keep a 1.0 branch for maintenance.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~branch}{\scriptsize \par}

{\scriptsize Usage:~fossil~branch~SUBCOMMAND~...~?-R|-{}-repository~FILE?}{\scriptsize \par}

{\scriptsize Run~various~subcommands~on~the~branches~of~the~open~repository~or}{\scriptsize \par}

{\scriptsize of~the~repository~identified~by~the~-R~or~-{}-repository~option.}{\scriptsize \par}

{\scriptsize{}~~~fossil~branch~new~BRANCH-NAME~BASIS~?-bgcolor~COLOR?~}{\scriptsize \par}

{\scriptsize{}~~~~~~~Create~a~new~branch~BRANCH-NAME~off~of~check-in~BASIS.}{\scriptsize \par}

{\scriptsize{}~~~~~~~You~can~optionally~give~the~branch~a~default~color.}{\scriptsize \par}

{\scriptsize{}~~~fossil~branch~list}{\scriptsize \par}

{\scriptsize{}~~~~~~~List~all~branches}{\scriptsize \par}
\end{lyxcode}
\caption{branch details}


\end{figure}



\subsubsection{merge\index{merge}}

This command does the opposite of branch, it brings two branches together.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~merge}{\scriptsize \par}

{\scriptsize Usage:~fossil~merge~{[}-{}-cherrypick{]}~{[}-{}-backout{]}~VERSION}{\scriptsize \par}

{\scriptsize The~argument~is~a~version~that~should~be~merged~into~the~current}{\scriptsize \par}

{\scriptsize checkout.~~All~changes~from~VERSION~back~to~the~nearest~common}{\scriptsize \par}

{\scriptsize ancestor~are~merged.~~Except,~if~either~of~the~-{}-cherrypick~or}{\scriptsize \par}

{\scriptsize -{}-backout~options~are~used~only~the~changes~associated~with~the}{\scriptsize \par}

{\scriptsize single~check-in~VERSION~are~merged.~~The~-{}-backout~option~causes}{\scriptsize \par}

{\scriptsize the~changes~associated~with~VERSION~to~be~removed~from~the~current}{\scriptsize \par}

{\scriptsize checkout~rather~than~added.}{\scriptsize \par}

{\scriptsize Only~file~content~is~merged.~~The~result~continues~to~use~the}{\scriptsize \par}

{\scriptsize file~and~directory~names~from~the~current~checkout~even~if~those}{\scriptsize \par}

{\scriptsize names~might~have~been~changed~in~the~branch~being~merged~in.}{\scriptsize \par}

{\scriptsize Other~options:}{\scriptsize \par}

{\scriptsize{}~~-{}-detail~~~~~~~~~~~~~~~~Show~additional~details~of~the~merge}{\scriptsize \par}

{\scriptsize{}~~-{}-binary~GLOBPATTERN~~~~Treat~files~that~match~GLOBPATTERN~as~binary}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~~~~~~~and~do~not~try~to~merge~parallel~changes.~~This}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~~~~~~~option~overrides~the~\textquotedbl{}binary-glob\textquotedbl{}~setting.}{\scriptsize \par}
\end{lyxcode}
\caption{merge details}


\end{figure}



\subsubsection{tag\index{tag}}

This command can be used to control ``tags'' which are attributes added to any entry in the time line. You can also add/delete/control these tags from the UI by going into the timeline, picking an entry then doing an edit. See Figure \vref{fig:Remove-Leaf}. 

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~tag}{\scriptsize \par}

{\scriptsize Usage:~fossil~tag~SUBCOMMAND~...}{\scriptsize \par}

{\scriptsize Run~various~subcommands~to~control~tags~and~properties}{\scriptsize \par}

{\scriptsize{}~~~~fossil~tag~add~?-{}-raw?~?-{}-propagate?~TAGNAME~CHECK-IN~?VALUE?}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Add~a~new~tag~or~property~to~CHECK-IN.~The~tag~will}{\scriptsize \par}

{\scriptsize{}~~~~~~~~be~usable~instead~of~a~CHECK-IN~in~commands~such~as}{\scriptsize \par}

{\scriptsize{}~~~~~~~~update~and~merge.~~If~the~-{}-propagate~flag~is~present,}{\scriptsize \par}

{\scriptsize{}~~~~~~~~the~tag~value~propagates~to~all~descendants~of~CHECK-IN}{\scriptsize \par}

{\scriptsize{}~~~~fossil~tag~cancel~?-{}-raw?~TAGNAME~CHECK-IN}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Remove~the~tag~TAGNAME~from~CHECK-IN,~and~also~remove}{\scriptsize \par}

{\scriptsize{}~~~~~~~~the~propagation~of~the~tag~to~any~descendants.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~tag~find~?-{}-raw?~TAGNAME}{\scriptsize \par}

{\scriptsize{}~~~~~~~~List~all~check-ins~that~use~TAGNAME}{\scriptsize \par}

{\scriptsize{}~~~~fossil~tag~list~?-{}-raw?~?CHECK-IN?}{\scriptsize \par}

{\scriptsize{}~~~~~~~~List~all~tags,~or~if~CHECK-IN~is~supplied,~list}{\scriptsize \par}

{\scriptsize{}~~~~~~~~all~tags~and~their~values~for~CHECK-IN.}{\scriptsize \par}

{\scriptsize The~option~-{}-raw~allows~the~manipulation~of~all~types~of~tags}{\scriptsize \par}

{\scriptsize used~for~various~internal~purposes~in~fossil.~It~also~shows}{\scriptsize \par}

{\scriptsize \textquotedbl{}cancel\textquotedbl{}~tags~for~the~\textquotedbl{}find\textquotedbl{}~and~\textquotedbl{}list\textquotedbl{}~subcommands.~You~should}{\scriptsize \par}

{\scriptsize not~use~this~option~to~make~changes~unless~you~are~sure~what}{\scriptsize \par}

{\scriptsize you~are~doing.}{\scriptsize \par}

{\scriptsize If~you~need~to~use~a~tagname~that~might~be~confused~with}{\scriptsize \par}

{\scriptsize a~hexadecimal~baseline~or~artifact~ID,~you~can~explicitly}{\scriptsize \par}

{\scriptsize disambiguate~it~by~prefixing~it~with~\textquotedbl{}tag:\textquotedbl{}.~For~instance:}{\scriptsize \par}

{\scriptsize{}~~fossil~update~decaf}{\scriptsize \par}

{\scriptsize will~be~taken~as~an~artifact~or~baseline~ID~and~fossil~will}{\scriptsize \par}

{\scriptsize probably~complain~that~no~such~revision~was~found.~However}{\scriptsize \par}

{\scriptsize{}~~fossil~update~tag:decaf}{\scriptsize \par}

{\scriptsize will~assume~that~\textquotedbl{}decaf\textquotedbl{}~is~a~tag/branch~name.}{\scriptsize \par}
\end{lyxcode}
\caption{tag details}


\end{figure}



\subsubsection{settings\index{settings}}

This command is used to set or unset a number of properties for fossil.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~settings}{\scriptsize \par}

{\scriptsize COMMAND:~settings}{\scriptsize \par}

{\scriptsize COMMAND:~unset}{\scriptsize \par}

{\scriptsize fossil~setting~?PROPERTY?~?VALUE?~?-global?}{\scriptsize \par}

{\scriptsize fossil~unset~PROPERTY~?-global?}{\scriptsize \par}

{\scriptsize The~\textquotedbl{}setting\textquotedbl{}~command~with~no~arguments~lists~all~properties~and~their}{\scriptsize \par}

{\scriptsize values.~~With~just~a~property~name~it~shows~the~value~of~that~property.}{\scriptsize \par}

{\scriptsize With~a~value~argument~it~changes~the~property~for~the~current~repository.}{\scriptsize \par}

{\scriptsize The~\textquotedbl{}unset\textquotedbl{}~command~clears~a~property~setting.}{\scriptsize \par}

{\scriptsize{}~~~auto-captcha~~~~~If~enabled,~the~Login~page~will~provide~a~button}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~which~uses~JavaScript~to~fill~out~the~captcha~for}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~the~\textquotedbl{}anonymous\textquotedbl{}~user.~(Most~bots~cannot~use~JavaScript.)}{\scriptsize \par}

{\scriptsize{}~~~autosync~~~~~~~~~If~enabled,~automatically~pull~prior~to~commit}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~or~update~and~automatically~push~after~commit~or}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~tag~or~branch~creation.~~If~the~the~value~is~\textquotedbl{}pullonly\textquotedbl{}}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~then~only~pull~operations~occur~automatically.}{\scriptsize \par}

{\scriptsize{}~~~binary-glob~~~~~~The~VALUE~is~a~comma-separated~list~of~GLOB~patterns}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~that~should~be~treated~as~binary~files~for~merging}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~purposes.~~Example:~~~{*}.xml}{\scriptsize \par}

{\scriptsize{}~~~clearsign~~~~~~~~When~enabled,~fossil~will~attempt~to~sign~all~commits}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~with~gpg.~~When~disabled~(the~default),~commits~will}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~be~unsigned.}{\scriptsize \par}

{\scriptsize{}~~~diff-command~~~~~External~command~to~run~when~performing~a~diff.}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~If~undefined,~the~internal~text~diff~will~be~used.}{\scriptsize \par}

{\scriptsize{}~~~dont-push~~~~~~~~Prevent~this~repository~from~pushing~from~client~to}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~server.~~Useful~when~setting~up~a~private~branch.}{\scriptsize \par}

{\scriptsize{}~~~editor~~~~~~~~~~~Text~editor~command~used~for~check-in~comments.}{\scriptsize \par}

{\scriptsize{}~~~gdiff-command~~~~External~command~to~run~when~performing~a~graphical}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~diff.~If~undefined,~text~diff~will~be~used.}{\scriptsize \par}

{\scriptsize{}~~~http-port~~~~~~~~The~TCP/IP~port~number~to~use~by~the~\textquotedbl{}server\textquotedbl{}}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~and~\textquotedbl{}ui\textquotedbl{}~commands.~~Default:~8080}{\scriptsize \par}

{\scriptsize{}~~~ignore-glob~~~~~~The~VALUE~is~a~comma-separated~list~of~GLOB~patterns}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~specifying~files~that~the~\textquotedbl{}extra\textquotedbl{}~command~will~ignore.}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~Example:~~{*}.o,{*}.obj,{*}.exe}{\scriptsize \par}

{\scriptsize{}~~~localauth~~~~~~~~If~enabled,~require~that~HTTP~connections~from}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~127.0.0.1~be~authenticated~by~password.~~If}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~false,~all~HTTP~requests~from~localhost~have}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~unrestricted~access~to~the~repository.}{\scriptsize \par}

{\scriptsize{}~~~mtime-changes~~~~Use~file~modification~times~(mtimes)~to~detect~when}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~files~have~been~modified.~~(Default~\textquotedbl{}on\textquotedbl{}.)}{\scriptsize \par}

{\scriptsize{}~~~pgp-command~~~~~~Command~used~to~clear-sign~manifests~at~check-in.}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~The~default~is~\textquotedbl{}gpg~-{}-clearsign~-o~\textquotedbl{}.}{\scriptsize \par}

{\scriptsize{}~~~proxy~~~~~~~~~~~~URL~of~the~HTTP~proxy.~~If~undefined~or~\textquotedbl{}off\textquotedbl{}~then}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~the~\textquotedbl{}http\_proxy\textquotedbl{}~environment~variable~is~consulted.}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~If~the~http\_proxy~environment~variable~is~undefined}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~then~a~direct~HTTP~connection~is~used.}{\scriptsize \par}

{\scriptsize{}~~~web-browser~~~~~~A~shell~command~used~to~launch~your~preferred}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~web~browser~when~given~a~URL~as~an~argument.}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~Defaults~to~\textquotedbl{}start\textquotedbl{}~on~windows,~\textquotedbl{}open\textquotedbl{}~on~Mac,}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~and~\textquotedbl{}firefox\textquotedbl{}~on~Unix.}{\scriptsize \par}
\end{lyxcode}
\caption{settings details}


\end{figure}



\subsection{Miscellaneous }

These are commands that don't seem to fit in any category but are useful. 


\subsubsection{zip\index{zip}}

You can do what this command does from the web based user interface. In Figure \vref{fig:Timeline-Detail} you can download a ZIP archive of the particular version of the files. This command lets you do it from the command line.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~zip}{\scriptsize \par}

{\scriptsize Usage:~fossil~zip~VERSION~OUTPUTFILE~{[}-{}-name~DIRECTORYNAME{]}}{\scriptsize \par}

{\scriptsize Generate~a~ZIP~archive~for~a~specified~version.~~If~the~-{}-name~option~is}{\scriptsize \par}

{\scriptsize used,~it~argument~becomes~the~name~of~the~top-level~directory~in~the}{\scriptsize \par}

{\scriptsize resulting~ZIP~archive.~~If~-{}-name~is~omitted,~the~top-level~directory}{\scriptsize \par}

{\scriptsize named~is~derived~from~the~project~name,~the~check-in~date~and~time,~and}{\scriptsize \par}

{\scriptsize the~artifact~ID~of~the~check-in.}{\scriptsize \par}
\end{lyxcode}
\caption{zip detail}


\end{figure}



\subsubsection{user\index{user}}

This command lets you modify user information. Again this is a command line duplication of what you can do from the user interface in the browser, see Figure \vref{fig:New-Editor-user}.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~user}{\scriptsize \par}

{\scriptsize Usage:~fossil~user~SUBCOMMAND~...~~?-R|-{}-repository~FILE?}{\scriptsize \par}

{\scriptsize Run~various~subcommands~on~users~of~the~open~repository~or~of}{\scriptsize \par}

{\scriptsize the~repository~identified~by~the~-R~or~-{}-repository~option.}{\scriptsize \par}

{\scriptsize{}~~~fossil~user~capabilities~USERNAME~?STRING?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Query~or~set~the~capabilities~for~user~USERNAME}{\scriptsize \par}

{\scriptsize{}~~~fossil~user~default~?USERNAME?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Query~or~set~the~default~user.~~The~default~user~is~the}{\scriptsize \par}

{\scriptsize{}~~~~~~~user~for~command-line~interaction.}{\scriptsize \par}

{\scriptsize{}~~~fossil~user~list}{\scriptsize \par}

{\scriptsize{}~~~~~~~List~all~users~known~to~the~repository}{\scriptsize \par}

{\scriptsize{}~~~fossil~user~new~?USERNAME?~?CONTACT-INFO?~?PASSWORD?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Create~a~new~user~in~the~repository.~~Users~can~never~be}{\scriptsize \par}

{\scriptsize{}~~~~~~~deleted.~~They~can~be~denied~all~access~but~they~must~continue}{\scriptsize \par}

{\scriptsize{}~~~~~~~to~exist~in~the~database.}{\scriptsize \par}

{\scriptsize{}~~~fossil~user~password~USERNAME~?PASSWORD?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Change~the~web~access~password~for~a~user.}{\scriptsize \par}
\end{lyxcode}
\caption{user detail}


\end{figure}



\subsubsection{finfo\index{finfo}}

This command will print the history of any particular file. This can be useful if you need this history in some other system. You can pass this text file to the other system which can than parse and use the data.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~finfo}{\scriptsize \par}

{\scriptsize Usage:~fossil~finfo~FILENAME}{\scriptsize \par}

{\scriptsize Print~the~change~history~for~a~single~file.}{\scriptsize \par}

{\scriptsize The~\textquotedbl{}-{}-limit~N\textquotedbl{}~and~\textquotedbl{}-{}-offset~P\textquotedbl{}~options~limits~the~output~to~the~first}{\scriptsize \par}

{\scriptsize N~changes~after~skipping~P~changes.}{\scriptsize \par}
\end{lyxcode}
\caption{finfo detail}


\end{figure}


An example would be to run it on the outline.txt file in our book directory:
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~}\textbf{\scriptsize finfo~outline.txt}{\scriptsize \par}

{\scriptsize History~of~outline.txt}{\scriptsize \par}

{\scriptsize 2010-05-17~{[}0272dc0169{]}~Finished~maintenance~commands~(user:~jim,~artifact:}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~{[}25b6e38e97{]})}{\scriptsize \par}

{\scriptsize 2010-05-12~{[}5e5c0f7d55{]}~End~of~day~commit~(user:~jim,~artifact:~{[}d1a1d31fbd{]})}{\scriptsize \par}

{\scriptsize 2010-05-10~{[}e924ca3525{]}~End~of~day~update~(user:~jim,~artifact:~{[}7cd19079a1{]})}{\scriptsize \par}

{\scriptsize 2010-05-09~{[}0abb95b046{]}~Intermediate~commit,~not~done~with~basic~commands}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~(user:~jim,~artifact:~{[}6f7bcd48b9{]})}{\scriptsize \par}

{\scriptsize 2010-05-07~{[}6921e453cd{]}~Update~outline~\&~book~corrections~(user:~jim,}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~artifact:~{[}4eff85c793{]})}{\scriptsize \par}

{\scriptsize 2010-05-03~{[}158492516c{]}~Moved~to~clone~repository~(user:~jim,~artifact:}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~{[}23b729cb66{]})}{\scriptsize \par}

{\scriptsize 2010-05-03~{[}1a403c87fc{]}~Update~before~moving~to~server~(user:~jim,~artifact:}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~{[}706a9d394d{]})}{\scriptsize \par}

{\scriptsize 2010-04-30~{[}fa5b9247bd{]}~Working~on~chapter~1~(user:~jim,~artifact:}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~{[}7bb188f0c6{]})}{\scriptsize \par}

{\scriptsize 2010-04-29~{[}51be6423a3{]}~Update~outline~(user:~jim,~artifact:~{[}7cd39dfa06{]})}{\scriptsize \par}

{\scriptsize 2010-04-27~{[}39bc728527{]}~{[}1665c78d94{]}~Ticket~Use~(user:~jim,~artifact:}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~{[}1f82aaf41c{]})}{\scriptsize \par}

{\scriptsize 2010-04-26~{[}497b93858f{]}~Update~to~catch~changes~in~outline~(user:~jim,}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~artifact:~{[}b870231e48{]})}{\scriptsize \par}

{\scriptsize 2010-04-25~{[}8fa0708186{]}~Initial~Commit~(user:~jim,~artifact:~{[}34a460a468{]})}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}{\scriptsize \par}
\end{lyxcode}

\subsubsection{timeline\index{timeline}}

This prints out the timeline of the project in various ways. The command would be useful if you were building a GUI front end for Fossil and wanted to display the timeline. You could issue this command and get the result back and display it in your UI. There are a number of options in the command to control the listing.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~timeline}{\scriptsize \par}

{\scriptsize Usage:~fossil~timeline~?WHEN?~?BASELINE|DATETIME?~?-n~N?~?-t~TYPE?}{\scriptsize \par}

{\scriptsize Print~a~summary~of~activity~going~backwards~in~date~and~time}{\scriptsize \par}

{\scriptsize specified~or~from~the~current~date~and~time~if~no~arguments}{\scriptsize \par}

{\scriptsize are~given.~~Show~as~many~as~N~(default~20)~check-ins.~~The}{\scriptsize \par}

{\scriptsize WHEN~argument~can~be~any~unique~abbreviation~of~one~of~these}{\scriptsize \par}

{\scriptsize keywords:}{\scriptsize \par}

{\scriptsize{}~~~~before}{\scriptsize \par}

{\scriptsize{}~~~~after}{\scriptsize \par}

{\scriptsize{}~~~~descendants~|~children}{\scriptsize \par}

{\scriptsize{}~~~~ancestors~|~parents}{\scriptsize \par}

{\scriptsize The~BASELINE~can~be~any~unique~prefix~of~4~characters~or~more.}{\scriptsize \par}

{\scriptsize The~DATETIME~should~be~in~the~ISO8601~format.~~For}{\scriptsize \par}

{\scriptsize examples:~\textquotedbl{}2007-08-18~07:21:21\textquotedbl{}.~~You~can~also~say~\textquotedbl{}current\textquotedbl{}}{\scriptsize \par}

{\scriptsize for~the~current~version~or~\textquotedbl{}now\textquotedbl{}~for~the~current~time.}{\scriptsize \par}

{\scriptsize The~optional~TYPE~argument~may~any~types~supported~by~the~/timeline}{\scriptsize \par}

{\scriptsize page.~For~example:}{\scriptsize \par}

{\scriptsize{}~~~~w~~=~wiki~commits~only}{\scriptsize \par}

{\scriptsize{}~~~~ci~=~file~commits~only}{\scriptsize \par}

{\scriptsize{}~~~~t~~=~tickets~only}{\scriptsize \par}
\end{lyxcode}
\caption{timeline detail}


\end{figure}



\subsubsection{wiki\index{wiki}}

This command allows you to have command line control of the wiki. Again this is useful if you were writing a shell to control Fossil or wanted to add a number of computer generated pages to the Wiki.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~wiki}{\scriptsize \par}

{\scriptsize Usage:~fossil~wiki~(export|create|commit|list)~WikiName}{\scriptsize \par}

{\scriptsize Run~various~subcommands~to~work~with~wiki~entries.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~export~PAGENAME~?FILE?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Sends~the~latest~version~of~the~PAGENAME~wiki}{\scriptsize \par}

{\scriptsize{}~~~~~~~entry~to~the~given~file~or~standard~output.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~commit~PAGENAME~?FILE?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Commit~changes~to~a~wiki~page~from~FILE~or~from~standard}{\scriptsize \par}

{\scriptsize{}~~~~~~~input.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~create~PAGENAME~?FILE?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Create~a~new~wiki~page~with~initial~content~taken~from}{\scriptsize \par}

{\scriptsize{}~~~~~~~FILE~or~from~standard~input.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~list}{\scriptsize \par}

{\scriptsize{}~~~~~~~Lists~all~wiki~entries,~one~per~line,~ordered}{\scriptsize \par}

{\scriptsize{}~~~~~~~case-insentively~by~name.}{\scriptsize \par}

{\scriptsize TODOs:}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~export~?-u~ARTIFACT?~WikiName~?FILE?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Outputs~the~selected~version~of~WikiName.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~delete~?-m~MESSAGE?~WikiName}{\scriptsize \par}

{\scriptsize{}~~~~~~~The~same~as~deleting~a~file~entry,~but~i~don't~know~if~fossil}{\scriptsize \par}

{\scriptsize{}~~~~~~~supports~a~commit~message~for~Wiki~entries.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~?-u?~?-d?~?-s={[}|{]}?~list}{\scriptsize \par}

{\scriptsize{}~~~~~~~Lists~the~artifact~ID~and/or~Date~of~last~change~along~with}{\scriptsize \par}

{\scriptsize{}~~~~~~~each~entry~name,~delimited~by~the~-s~char.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~diff~?ARTIFACT?~?-f~infile{[}=stdin{]}?~EntryName}{\scriptsize \par}

{\scriptsize{}~~~~~~~Diffs~the~local~copy~of~a~page~with~a~given~version~(defaulting}{\scriptsize \par}

{\scriptsize{}~~~~~~~to~the~head~version).}{\scriptsize \par}
\end{lyxcode}
\caption{wiki detail}


\end{figure}



\subsection{Advanced}

These are commands that you will rarely have to use. These are functions that are needed to do very complicated things with Fossil. If you have to use these you are probably way beyond the audience for this book.


\subsubsection{scrub\index{scrub}}

This is used to removed sensitive information like passwords from a repository. This allows you to then send the whole repository to someone else for their use.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~scrub}{\scriptsize \par}

{\scriptsize COMMAND:~scrub}{\scriptsize \par}

{\scriptsize fossil~scrub~{[}-{}-verily{]}~{[}-{}-force{]}~{[}REPOSITORY{]}}{\scriptsize \par}

{\scriptsize The~command~removes~sensitive~information~(such~as~passwords)~from~a}{\scriptsize \par}

{\scriptsize repository~so~that~the~repository~can~be~sent~to~an~untrusted~reader.}{\scriptsize \par}

{\scriptsize By~default,~only~passwords~are~removed.~~However,~if~the~-{}-verily~option}{\scriptsize \par}

{\scriptsize is~added,~then~private~branches,~concealed~email~addresses,~IP}{\scriptsize \par}

{\scriptsize addresses~of~correspondents,~and~similar~privacy-sensitive~fields}{\scriptsize \par}

{\scriptsize are~also~purged.}{\scriptsize \par}

{\scriptsize This~command~permanently~deletes~the~scrubbed~information.~~The~effects}{\scriptsize \par}

{\scriptsize of~this~command~are~irreversible.~~Use~with~caution.}{\scriptsize \par}

{\scriptsize The~user~is~prompted~to~confirm~the~scrub~unless~the~-{}-force~option}{\scriptsize \par}

{\scriptsize is~used.}{\scriptsize \par}
\end{lyxcode}
\caption{scrub detail}


\end{figure}



\subsubsection{search\index{search}}

This is used to search the timeline entries for a pattern. This can also be done in your browser on the timeline page.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~search}{\scriptsize \par}

{\scriptsize COMMAND:~search}{\scriptsize \par}

{\scriptsize fossil~search~pattern...}{\scriptsize \par}

{\scriptsize Search~for~timeline~entries~matching~the~pattern.}{\scriptsize \par}
\end{lyxcode}
\caption{search detail}


\end{figure}



\subsubsection{sha1sum\index{sha1sum}}

This can compute the sha1 value for a particular file. These sums are the labels that Fossil uses on all objects and should be unique for any file.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~sha1sum}{\scriptsize \par}

{\scriptsize COMMAND:~sha1sum}{\scriptsize \par}

{\scriptsize fossil~sha1sum~FILE...}{\scriptsize \par}

{\scriptsize Compute~an~SHA1~checksum~of~all~files~named~on~the~command-line.}{\scriptsize \par}

{\scriptsize If~an~file~is~named~\textquotedbl{}-\textquotedbl{}~then~take~its~content~from~standard~input.}{\scriptsize \par}
\end{lyxcode}
\caption{sha1sum detail}


\end{figure}



\subsubsection{rstats\index{rstats}}

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~rstats}{\scriptsize \par}

{\scriptsize Usage:~fossil~rstats}{\scriptsize \par}

{\scriptsize Deliver~a~report~of~the~repository~statistics~for~the}{\scriptsize \par}

{\scriptsize current~checkout.}{\scriptsize \par}
\end{lyxcode}
\caption{rstats detail}


\end{figure}


For example, running it on the Fossil Book checkout:
\begin{lyxcode}
{[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~\textbf{fossil~rstats}

~Number~of~Artifacts:~137

~~59~full~text~+~78~delta~blobs

~278961~bytes~average,~38217738~bytes~total

~~Number~Of~Checkins:~26

~~~~~Number~Of~Files:~37

Number~Of~Wiki~Pages:~2

~~~Number~Of~Tickets:~6

~Duration~Of~Project:~23~days
\end{lyxcode}

\subsubsection{configuration\index{configuration}}

This command allows you to save or load a custom configuration of Fossil.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~}\textbf{\scriptsize help~configuration}{\scriptsize \par}

{\scriptsize Usage:~fossil~configure~METHOD~...}{\scriptsize \par}

{\scriptsize Where~METHOD~is~one~of:~export~import~merge~pull~push~reset.~~All~methods}{\scriptsize \par}

{\scriptsize accept~the~-R~or~-{}-repository~option~to~specific~a~repository.}{\scriptsize \par}

{\scriptsize{}~~~fossil~configuration~export~AREA~FILENAME}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Write~to~FILENAME~exported~configuration~information~for~AREA.}{\scriptsize \par}

{\scriptsize{}~~~~~~~~AREA~can~be~one~of:~~all~ticket~skin~project}{\scriptsize \par}

{\scriptsize{}~~~fossil~configuration~import~FILENAME}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Read~a~configuration~from~FILENAME,~overwriting~the~current}{\scriptsize \par}

{\scriptsize{}~~~~~~~~configuration.}{\scriptsize \par}

{\scriptsize{}~~~fossil~configuration~merge~FILENAME}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Read~a~configuration~from~FILENAME~and~merge~its~values~into}{\scriptsize \par}

{\scriptsize{}~~~~~~~~the~current~configuration.~~Existing~values~take~priority~over}{\scriptsize \par}

{\scriptsize{}~~~~~~~~values~read~from~FILENAME.}{\scriptsize \par}

{\scriptsize{}~~~fossil~configuration~pull~AREA~?URL?}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Pull~and~install~the~configuration~from~a~different~server}{\scriptsize \par}

{\scriptsize{}~~~~~~~~identified~by~URL.~~If~no~URL~is~specified,~then~the~default}{\scriptsize \par}

{\scriptsize{}~~~~~~~~server~is~used.~}{\scriptsize \par}

{\scriptsize{}~~~fossil~configuration~push~AREA~?URL?}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Push~the~local~configuration~into~the~remote~server~identified}{\scriptsize \par}

{\scriptsize{}~~~~~~~~by~URL.~~Admin~privilege~is~required~on~the~remote~server~for}{\scriptsize \par}

{\scriptsize{}~~~~~~~~this~to~work.}{\scriptsize \par}

{\scriptsize{}~~~fossil~configuration~reset~AREA}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Restore~the~configuration~to~the~default.~~AREA~as~above.}{\scriptsize \par}

{\scriptsize WARNING:~Do~not~import,~merge,~or~pull~configurations~from~an~untrusted}{\scriptsize \par}

{\scriptsize source.~~The~inbound~configuration~is~not~checked~for~safety~and~can}{\scriptsize \par}

{\scriptsize introduce~security~vulnerabilities.}{\scriptsize \par}
\end{lyxcode}
\caption{configuration detail}


\end{figure}



\subsubsection{descendants\index{descendants}}

This is used to find where the checked out files are in the time line.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~descendants}{\scriptsize \par}

{\scriptsize Usage:~fossil~descendants~?BASELINE-ID?}{\scriptsize \par}

{\scriptsize Find~all~leaf~descendants~of~the~baseline~specified~or~if~the~argument}{\scriptsize \par}

{\scriptsize is~omitted,~of~the~baseline~currently~checked~out.}{\scriptsize \par}


\end{lyxcode}
\caption{descendants detail}


\end{figure}

Added Chapters/foreword.tex.



>
1
\chapter{Foreword}

Added Chapters/forks_branches.tex.























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667

\section{Forks \& Branches}


\subsection{Introduction}

This chapter will cover forking and branching in Fossil. Forking is where you unintentially create two places to check into a repository. Branching is where you intentially do this because you want to maintain two or more versions of the code in the same repository. We illustrated forking and it's solutions in Section \vref{sub:Complications}. If, instead of fixing (merging) the file then doing the commit, we forced the commit, Fossil would fork the repository.

Forking is something to avoid because it creates two checkin paths for the code. Thus different users will be on different paths and can check in contradictory changes. Branches on the other hand are forks that you desire. These occur when you want to have two different versions of the code base in development at the same time. This was described in \vref{versioning} where you have a production verison of code under maintenance and a development version both served from the same repository. In this case development changes should only be checked into the development branch. Maintanence changes might have to be checked into both.

Instead of using the book repository for these examples we will use a JSON\cite{JSON}parser program that has a number of files and documentation. This will make it simpler to illustrate branching and tagging.

There is a good discussion of these topics on the Fossil Web site \url{http://www.fossil-scm.org/index.html/doc/tip/www/branching.wiki}.


\subsection{Forks, Branch \& Merge}

In this case the JSON code has just been placed in Fossil and two developers check out copies to work on. Jim wants to fix a number of compiler warnings that appear and Marilyn wants to fix the documentation. In both cases they proceeed as shown in Chapter \vref{sec:Multiple-Users}. The JSON code has been placed in a distributed location, each of them clones the repository, and opens a working copy of the code.


\subsubsection{Marilyn's Actions}

She looks through the documentation and finds a number of problems and fixes them (the documentation uses \LyX{} and PDF's). When she is satisfied with what she has done, she checks the current version of the documentation in:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Simple_Merge/sm_Marilyn}

\caption{\label{fig:Marilyn's-work}Marilyn's work}
\end{figure}



\subsubsection{Jim's Actions}

At the same time, Jim gets a working copy of version {[}6edbaf5fa8{]} of the code, puts in a ticket {[}d23bf4bbbb{]} as shown in Figure \ref{fig:Marilyn's-work}. After fixing the warnings, Jim is done and goes to commit. He does this AFTER Marilyn has done her commit.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize 551~jsonp>~}\textbf{\footnotesize fossil~commit~-m~\textquotedbl{}{[}d23bf4bbbb{]}~Remove~warnings\textquotedbl{}}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~~874~~~~~~~~~19~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~339~bytes~sent,~771~bytes~received}{\footnotesize \par}

{\footnotesize fossil:~would~fork.~~\textquotedbl{}update\textquotedbl{}~first~or~use~-f~or~-{}-force.}{\footnotesize \par}

{\footnotesize 552~jsonp>~}{\footnotesize \par}
\end{lyxcode}
\caption{Jim's commit attempt}


\end{figure}


At this point Fossil recognizes that Marilyn has changed the repository (she updated the documentation) but Jim does not have these changes because he checked out an earlier version of the code. Jim says he \textbf{must} get his changes in so he does a FORCE to force fossil to accept the commit.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize 552~jsonp>~}\textbf{\footnotesize fossil}{\footnotesize{}~}\textbf{\footnotesize commit~-m~\textquotedbl{}{[}d23bf4bbbb{]}~Remove~warnings\textquotedbl{}~-f}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~~874~~~~~~~~~19~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~338~bytes~sent,~771~bytes~received}{\footnotesize \par}

{\footnotesize New\_Version:~1beab955418a942ab9953c4865109ff46cbbd691}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~2646~~~~~~~~~25~~~~~~~~~~0~~~~~~~~~~4}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1058~~~~~~~~~23~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1498~bytes~sent,~864~bytes~received}{\footnotesize \par}

{\footnotesize {*}{*}{*}{*}~warning:~a~fork~has~occurred~{*}{*}{*}{*}{*}}{\footnotesize \par}
\end{lyxcode}
\caption{Forcing the commit}


\end{figure}


Looking at the timeline Jim sees this:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Simple_Merge/sm_jim_fork}

\caption{Repository Fork}


\end{figure}


Not good, there are two \textbf{Leaf}'s and Marilyn would commit code to her fork and Jim would be commiting code to his. So Jim must fix this by merging the code. Jim wants to merge versions {[}b72e96832e{]} of Marilyn and his {[}1beab85441{]}.


\subsubsection{Fixing the fork}

So Jim who's checked out code is from Leaf {[}1beab85441{]} does a merge with Marilyn's leaf {[}b72e96832e{]} like so:

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize 556~jsonp>~}\textbf{\footnotesize fossil~merge~b72e96832e}{\footnotesize \par}

{\footnotesize UPDATE~docs/qdj.lyx}{\footnotesize \par}

{\footnotesize UPDATE~docs/qdj.pdf}{\footnotesize \par}

{\footnotesize 557~jsonp>~}\textbf{\footnotesize fossil~status}{\footnotesize \par}

{\footnotesize repository:~~~/Users/jschimpf/Public/FOSSIL/jsonp.fossil}{\footnotesize \par}

{\footnotesize local-root:~~~/Users/jschimpf/Public/jsonp/}{\footnotesize \par}

{\footnotesize server-code:~~d3e7932b0b0f5e704264ba30adeae14978c08bc6}{\footnotesize \par}

{\footnotesize checkout:~~~~~1beab955418a942ab9953c4865109ff46cbbd691~2010-06-08~10:44:56~UTC}{\footnotesize \par}

{\footnotesize parent:~~~~~~~6edbaf5fa8e4d061c2e04e7fd481e7663b090bd3~2010-06-07~10:45:57~UTC}{\footnotesize \par}

{\footnotesize tags:~~~~~~~~~trunk}{\footnotesize \par}

{\footnotesize UPDATED\_BY\_MERGE~docs/qdj.lyx}{\footnotesize \par}

{\footnotesize UPDATED\_BY\_MERGE~docs/qdj.pdf}{\footnotesize \par}

{\footnotesize MERGED\_WITH~b72e96832e024f235696dcd6c5d0ddcc2cb38238}{\footnotesize \par}
\end{lyxcode}
\caption{\label{fig:Merge-Operation}Merge Operation}


\end{figure}


As shown the two documentation files are updated, there are no merge conflicts as Jim didn't touch these files and Marilyn didn't touch the code files.

Next Jim does a commit to make this new merged set of files the new trunk. Rememeber doing the merge shown in Figure \ref{fig:Merge-Operation} just updates your checked out code and does not change the repository till you check it in.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize 558~jsonp>~fossil~}\textbf{\footnotesize commit~-m~\textquotedbl{}After~merging~in~changes\textquotedbl{}}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1058~~~~~~~~~23~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~340~bytes~sent,~864~bytes~received}{\footnotesize \par}

{\footnotesize New\_Version:~3d73c03edee33cdc2e1bd8a47de57b7a6b6d880a}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~1737~~~~~~~~~26~~~~~~~~~~0~~~~~~~~~~1}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1104~~~~~~~~~24~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1101~bytes~sent,~888~bytes~received}{\footnotesize \par}

{\footnotesize 559~jsonp>~}{\footnotesize \par}
\end{lyxcode}
\caption{Commit after merge}


\end{figure}


When we look at the timeline we have a single leaf for future code commits.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Simple_Merge/sm_after_merge}

\caption{After merge timeline}


\end{figure}


The only other thing remaining is that Marilyn does an Update before proceeding so her checked out code matches the repository.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize WhiteBook:jsonp~marilyn\$~}\textbf{\footnotesize fossil~update}{\footnotesize \par}

{\footnotesize Autosync:~~http://Marilyn@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1150~~~~~~~~~25~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~412~~~~~~~~~~7~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~3274~~~~~~~~~31~~~~~~~~~~1~~~~~~~~~~5}{\footnotesize \par}

{\footnotesize Total~network~traffic:~843~bytes~sent,~2709~bytes~received}{\footnotesize \par}

{\footnotesize UPDATE~json-src/qdj\_token.c}{\footnotesize \par}

{\footnotesize UPDATE~json-src/qdj\_util.c}{\footnotesize \par}

{\footnotesize UPDATE~main.c}{\footnotesize \par}
\end{lyxcode}
\caption{Marilyn's Update}


\end{figure}



\subsubsection{Commands used}
\begin{itemize}
\item \textbf{fossil merge <fork>} Used to merge a fork (specified by hash value) to current check out. 
\item \textbf{fossil update <version>} Used to update current check out to specified version, if version not present use default tag for check out (see fossil status)
\end{itemize}

\subsection{Merge without fork}

In this case I will show how to merge in code changes from multiple users without causing a fork. In this case Marilyn has put in a BSD license text into all the code files while Jim is adding a help function to the code. In this case both of them put in tickets saying what they are doing but acting independently.


\subsubsection{Check in attempt}

Marilyn finished first and checks in her changes. Jim builds, tests and tries to check in his code and gets:

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize 502~jsonp>~}\textbf{\footnotesize make}{\footnotesize \par}

{\footnotesize /usr/bin/gcc~~main.c~-c~-I.~-Ijson-src~-o~obj/main.o}{\footnotesize \par}

{\footnotesize /usr/bin/gcc~~\textbackslash{}}{\footnotesize \par}

{\footnotesize 		obj/main.o\textbackslash{}}{\footnotesize \par}

{\footnotesize 		obj/qdj.o\textbackslash{}}{\footnotesize \par}

{\footnotesize 		obj/qdj\_util.o\textbackslash{}}{\footnotesize \par}

{\footnotesize 		obj/qdj\_token.o\textbackslash{}}{\footnotesize \par}

{\footnotesize 		-o~jsonp}{\footnotesize \par}



{\footnotesize 503~jsonp>~}\textbf{\footnotesize ./jsonp~-v}{\footnotesize \par}

{\footnotesize JSON~Test~Program~Ver:~{[}Jun~~9~2010{]}~{[}10:15:00{]}}{\footnotesize \par}

{\footnotesize SYNTAX:~jsonp~-i~<json~text~file>~{[}-v{]}}{\footnotesize \par}

{\footnotesize -i~<json~text~file>~~~Show~parse~of~JSON}{\footnotesize \par}

{\footnotesize -v~~~~~~~~~~~~~~~~~~~~Show~help}{\footnotesize \par}



{\footnotesize 506~jsonp>~}\textbf{\footnotesize fossil~commit~-m~\textquotedbl{}{[}fed383fa1a{]}~Add~help~to~cmd~line\textquotedbl{}}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1656~~~~~~~~~36~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~647~~~~~~~~~12~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~14039~~~~~~~~~47~~~~~~~~~~4~~~~~~~~~~7}{\footnotesize \par}

{\footnotesize Total~network~traffic:~942~bytes~sent,~4537~bytes~received}{\footnotesize \par}

{\footnotesize fossil:~would~fork.~~\textquotedbl{}update\textquotedbl{}~first~or~use~-f~or~-{}-force.}{\footnotesize \par}
\end{lyxcode}
\caption{Jim's check in attempt}


\end{figure}



\subsubsection{Update}

The next action Jim takes is to do the update but without doing changes, using the -n flag which tells it to just show what's going to happen without making any file changes.

\begin{figure}[H]
\begin{lyxcode}
507~jsonp>~\textbf{fossil~update~-n}

UPDATE~json-src/qdj.c

UPDATE~json-src/qdj.h

UPDATE~json-src/qdj\_token.c

UPDATE~json-src/qdj\_token.h

UPDATE~json-src/qdj\_util.c

MERGE~main.c
\end{lyxcode}
\caption{Update dry run}


\end{figure}


This shows some files will be updated, i.e. be replaced by new text from the repository. The main.c file will be merged with the version from the repository. That is text from the repository will be mixed with the text from Jim's modified file. Note that it says \textbf{MERGE} meaning the two sets of text are a disjoint set. This means the merge can all be done by Fossil with no human intervention.

Jim can just do the update for real then commit the merged files to make a new leaf. So now we have Marilyn's and Jim changes combined in the lastest version. 

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/file_merge/merge}

\caption{Merged repository}


\end{figure}



\subsubsection{Commands used}
\begin{itemize}
\item \textbf{fossil update -n} Does a dry run of an update to show what files will changed.

\begin{itemize}
\item UPDATE Implies file will be replaced by repository file
\item MERGE Implies file will be mixed text from repository and check out
\end{itemize}
\end{itemize}

\subsection{Branching}


\subsubsection{Introduction}

We have discussed this before but branching is the intential splitting of the code in the repository into multiple paths. This will usually be done with production code where we have maintenance branch and a development branch. The maintenance branch is in use and would get bug fixes based on experience. The development branch would get those changes if applicable plus be modified to add features.

The JSON code parser has been tested and works so will be released to general use. Also we wish to modify it to add support for UTF-8 characters so it matches the JSON standard. The current version just works with ASCII 7 bit characters which is not standard. We wish to split the code into a VER\_1.0 branch which is the current code in use and VER\_2.0 branch which will add UTF-8 character support.


\subsubsection{Branch the repository}

Before proceeding we will make sure we have the current trunk code in our check out. 

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp{]}~jim\%~}\textbf{\footnotesize fossil~status}{\footnotesize \par}

{\footnotesize repository:~/Users/jschimpf/Public/FOSSIL/jsonp.fossil}{\footnotesize \par}

{\footnotesize local-root:~/Users/jschimpf/Public/jsonp/}{\footnotesize \par}

{\footnotesize server-code:~90c80f1a2da7360dae230ccec65ff82fe2eb160d}{\footnotesize \par}

{\footnotesize checkout:~}\textbf{\footnotesize 462156b283}{\footnotesize b694af0b99c9b446b64d3f77436fbb~2010-06-09~14:16:42~UTC}{\footnotesize \par}

{\footnotesize parent:~fbb16491e2ff9f9ca3a98adffa167de1b6903a44~2010-06-09~14:02:28~UTC}{\footnotesize \par}

\textbf{\footnotesize tags:~trunk}{\footnotesize \par}
\end{lyxcode}
\caption{Checking code status}
\end{figure}


Seeing that matches the latest leaf in the time line we can proceed to branch the code.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp{]}~jim\%~}\textbf{\footnotesize fossil~branch~new~VER\_1.0~trunk~-bgcolor~0xFFC0FF}{\footnotesize \par}

{\footnotesize sh:~gpg:~command~not~found}{\footnotesize \par}

{\footnotesize unable~to~sign~manifest.~~continue~(y/N)?~y}{\footnotesize \par}

{\footnotesize New~branch:~65e1f48633d691a5ea738cd51ccbf9a581dfb3c7}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~2391~~~~~~~~~42~~~~~~~~~~0~~~~~~~~~~1}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1840~~~~~~~~~40~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1524~bytes~sent,~1272~bytes~received}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp{]}~jim\%~}\textbf{\footnotesize fossil~branch~new~VER\_2.0~trunk~-bgcolor~0xC0F0FF}{\footnotesize \par}

{\footnotesize sh:~gpg:~command~not~found}{\footnotesize \par}

{\footnotesize unable~to~sign~manifest.~~continue~(y/N)?~y}{\footnotesize \par}

{\footnotesize New~branch:~a1737916ec2df696a0f3a7e36edf9ba4370e48a7}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~2437~~~~~~~~~43~~~~~~~~~~0~~~~~~~~~~1}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1886~~~~~~~~~41~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1550~bytes~sent,~1271~bytes~received}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp{]}~jim\%~}{\footnotesize \par}
\end{lyxcode}
\caption{Branch commands\label{fig:Branch-commands}}
\end{figure}


What was just done. We used the Fossil branch command to create two branches VER\_1.0 and VER\_2.0 and assigned each of them a color. We can see the timeline is now:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Branching/branch}

\caption{Branch Timeline}
\end{figure}



\subsubsection{Color Setup}

As you see above the two branches have different colors in the timeline. This was due to the \textbf{-bgcolor} option added when we created each branch. (See Figure \ref{fig:Branch-commands}). But we want this color to appear on subsequent checkins of each of these branches. To make that happen we have to set the options using the UI and picking a particular leaf on the timeline.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Branching/color_setup}

\caption{Setting Timeline color}


\end{figure}


Under the \textbf{Background Color} section I have checked \textbf{Propagate color to descendants }so future checkins will have the same color.


\subsubsection{Check out the branches}

Now the the repository is branched we can check out the two sets of code into different directories. We create jsonp1 and jsonp2 and proceed to open the different branches into them.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp1{]}~}\textbf{\footnotesize jim\%~fossil~open~../FOSSIL/jsonp.fossil~VER\_1.0}{\footnotesize \par}

{\footnotesize docs/qdj.lyx}{\footnotesize \par}

{\footnotesize docs/qdj.pdf}{\footnotesize \par}

{\footnotesize json-src/qdj.c}{\footnotesize \par}

{\footnotesize json-src/qdj.h}{\footnotesize \par}

{\footnotesize json-src/qdj\_token.c}{\footnotesize \par}

{\footnotesize json-src/qdj\_token.h}{\footnotesize \par}

{\footnotesize json-src/qdj\_util.c}{\footnotesize \par}

{\footnotesize main.c}{\footnotesize \par}

{\footnotesize makefile}{\footnotesize \par}

{\footnotesize obj/test.txt}{\footnotesize \par}

{\footnotesize test.txt}{\footnotesize \par}

{\footnotesize project-name:~JASONP}{\footnotesize \par}

{\footnotesize repository:~~~/Users/jschimpf/Public/FOSSIL/jsonp.fossil}{\footnotesize \par}

{\footnotesize local-root:~~~/Users/jschimpf/Public/jsonp1/}{\footnotesize \par}

{\footnotesize project-code:~eb6084c8ab115cf2b28a129c7183731002c6143a}{\footnotesize \par}

{\footnotesize server-code:~~90c80f1a2da7360dae230ccec65ff82fe2eb160d}{\footnotesize \par}

{\footnotesize checkout:~~~~~65e1f48633d691a5ea738cd51ccbf9a581dfb3c7~2010-06-13~10:13:55~UTC}{\footnotesize \par}

{\footnotesize parent:~~~~~~~462156b283b694af0b99c9b446b64d3f77436fbb~2010-06-09~14:16:42~UTC}{\footnotesize \par}

{\footnotesize tags:~~~~~~~~~}\textbf{\footnotesize VER\_1.0}{\footnotesize \par}
\end{lyxcode}
\caption{Check out VER\_1.0}
\end{figure}


Checking out VER\_2.0 in the same way

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp2{]}~jim\%~}\textbf{\footnotesize fossil~open~../FOSSIL/jsonp.fossil~VER\_2.0}{\footnotesize \par}

{\footnotesize docs/qdj.lyx}{\footnotesize \par}

{\footnotesize docs/qdj.pdf}{\footnotesize \par}

{\footnotesize json-src/qdj.c}{\footnotesize \par}

{\footnotesize json-src/qdj.h}{\footnotesize \par}

{\footnotesize json-src/qdj\_token.c}{\footnotesize \par}

{\footnotesize json-src/qdj\_token.h}{\footnotesize \par}

{\footnotesize json-src/qdj\_util.c}{\footnotesize \par}

{\footnotesize main.c}{\footnotesize \par}

{\footnotesize makefile}{\footnotesize \par}

{\footnotesize obj/test.txt}{\footnotesize \par}

{\footnotesize test.txt}{\footnotesize \par}

{\footnotesize project-name:~JASONP}{\footnotesize \par}

{\footnotesize repository:~~~/Users/jschimpf/Public/FOSSIL/jsonp.fossil}{\footnotesize \par}

{\footnotesize local-root:~~~/Users/jschimpf/Public/jsonp2/}{\footnotesize \par}

{\footnotesize project-code:~eb6084c8ab115cf2b28a129c7183731002c6143a}{\footnotesize \par}

{\footnotesize server-code:~~90c80f1a2da7360dae230ccec65ff82fe2eb160d}{\footnotesize \par}

{\footnotesize checkout:~~~~~a1737916ec2df696a0f3a7e36edf9ba4370e48a7~2010-06-13~10:14:26~UTC}{\footnotesize \par}

{\footnotesize parent:~~~~~~~462156b283b694af0b99c9b446b64d3f77436fbb~2010-06-09~14:16:42~UTC}{\footnotesize \par}

{\footnotesize tags:~~~~~~~~~}\textbf{\footnotesize VER\_2.0}{\footnotesize \par}
\end{lyxcode}
\caption{VER\_2.0 checkout}
\end{figure}


Notice on both of these the tags show which branch we are attached to.


\subsubsection{Correcting errors (in both)}

After doing this work I found that the main.c file had a warning about an unused variable. I wanted to correct this in both branches. At this point all the files in both branches are the same so correcting the file in either branch and copying it to the other is possible. I put in a ticket for the change and edit main.c. I copy it to both checkouts for the both branches and then check both in.

\begin{figure}
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp1{]}~jim\%~}\textbf{\footnotesize fossil~commit~-m~\textquotedbl{}{[}2795e6c74d{]}~Fix~unused~variable\textquotedbl{}}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~2116~~~~~~~~~46~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~365~~~~~~~~~~6~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~3601~~~~~~~~~51~~~~~~~~~~5~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~805~bytes~sent,~3464~bytes~received}{\footnotesize \par}

{\footnotesize New\_Version:~3b902585d0e8849399286139d27676c5a349de7b}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~3034~~~~~~~~~50~~~~~~~~~~0~~~~~~~~~~2}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~2208~~~~~~~~~48~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1848~bytes~sent,~1444~bytes~received}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp1{]}~jim\%~}\textbf{\footnotesize cd~..}{\footnotesize \par}

{\footnotesize {[}Pandora-2:/Users/jschimpf/Public{]}~jim\%~}\textbf{\footnotesize cd~jsonp2}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp2{]}~jim\%~}\textbf{\footnotesize cp~../jsonp1/main.c~.}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp2{]}~jim\%~}\textbf{\footnotesize fossil~status}{\footnotesize \par}

{\footnotesize repository:~~~/Users/jschimpf/Public/FOSSIL/jsonp.fossil}{\footnotesize \par}

{\footnotesize local-root:~~~/Users/jschimpf/Public/jsonp2/}{\footnotesize \par}

{\footnotesize server-code:~~90c80f1a2da7360dae230ccec65ff82fe2eb160d}{\footnotesize \par}

{\footnotesize checkout:~~~~~a1737916ec2df696a0f3a7e36edf9ba4370e48a7~2010-06-13~10:14:26~UTC}{\footnotesize \par}

{\footnotesize parent:~~~~~~~462156b283b694af0b99c9b446b64d3f77436fbb~2010-06-09~14:16:42~UTC}{\footnotesize \par}

{\footnotesize tags:~~~~~~~~~VER\_2.0}{\footnotesize \par}

{\footnotesize EDITED~~~~~main.c}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp2{]}~jim\%~}\textbf{\footnotesize fossil~commit~-m~\textquotedbl{}{[}2795e6c74d{]}~Fix~unused~variable\textquotedbl{}}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~2392~~~~~~~~~52~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~318~~~~~~~~~~5~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~3320~~~~~~~~~56~~~~~~~~~~4~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~781~bytes~sent,~3508~bytes~received}{\footnotesize \par}

{\footnotesize New\_Version:~762a31854d708080678598c8d4ce28465cbee8c5}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~3253~~~~~~~~~55~~~~~~~~~~0~~~~~~~~~~2}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~2438~~~~~~~~~53~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1972~bytes~sent,~1573~bytes~received}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp2{]}~jim\%~}{\footnotesize \par}
\end{lyxcode}
\caption{Fixing both branches}


\end{figure}


Now the timeline looks like this:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Branching/current_state}

\caption{Correcting both branches}


\end{figure}



\subsubsection{Commands used}
\begin{itemize}
\item \textbf{fossil branch }Used to generate a branch of the repository. The command can optionally color the branch in the display.
\end{itemize}

Added Chapters/introduction.tex.



















































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
\section{Source Control \& Why you need it}


\subsection{What is it}

A source control system is software that manages the files in a project. A project (like this book or a software application) usually has a number of files. You then put all these files in a directory and at times subdivide even that with subdirectories. At any particular time this set of files in their present edited state make up a working version of the project. If other people are using the project you give them this and as is usually the case, they find problems and you fix them. This results in another version of the project slightly changed which goes through the cycle again. (This is why books have editions and software has versions...)

Software developers on large projects with multiple developers could see this cycle and realized they needed a tool to control the changes. With multiple developers sometimes the same file would be edited by two different people changing it in different ways or records of what got changed would be lost. It was hard to bring out a new release of the software and be sure that all the bugs were fixed and enhancements made.

A tool called Source Code Control System \cite{SCCS} was developed at Bell Labs in 1972 to track changes in files. It would remember each of the changes made to a file and store comments about why this was done. It also limited who could edit the file so conflicting edits would not be done. \cite{USE-SCCS}

\label{versioning}This was important but developers could see more was needed. They needed to be able to save the state of all the files in a project and give it a name (i.e., Release 3.14). As software projects mature you will have a released version of the software being used as well as bug reports written against it, while the next release of the software is being developed adding new features. The source control system would have to handle what are now called branches. One branch has say Version 1 which is released but continues to have fixes added to create Version 1.1, 1.2, etc. At the same time you also have another branch which contains Version 2 with new features added under construction. 

In 1986 the open source Concurrent Version Control system CVS \cite{CVS} was developed. This system could label groups of files and allow multiple branches (i.e. versions) simultaneously. There have been many other systems developed since them some open source and some proprietary.

Fossil which was originally released in 2006 \cite{FOSSIL-HOME} is a easy to install version control system that also includes a trouble ticketing system ( Figure\vref{fig:viewticket}), a wiki ( Figure \vref{sub:Wiki-Use}) and self hosted web server ( Figure\vref{fig:Starting-Webserver}). It's home page is here \url{http://www.fossil-scm.org/}.


\subsection{Why do it ?}

Why do you want to use a source control system? To use one restricts your freedom, you won't be able to create files, delete files or, move files between directories at random. Making changes in your code becomes a check list of steps that must be followed carefully.

With all those hassles why do it? The biggest answer is freedom (huh ?). By following the procedures of a source control system you gain the freedom to modify your code any way you want. How does that follow ? One of the most horrible feelings as a developer is the ``It worked yesterday'' syndrome. That is, you had code that worked just fine and now it doesn't. You have a very helpless feeling of how do you get back to working code. With a source control system and careful adherence to procedures you can just go back in time and get yesterday's code. Then, starting from known good code you can figure out what happened.

Having a source control system also gives you the freedom to experiment, ``let's try that radical new technique'', and if it doesn't work it's easy to just go back to the previous state.

The rest of this book is a user manual for the Fossil version control system that does code management and much much more. It runs on multiple OS's and is FREE. It is simple to install as it has only one executable and the repositories it creates are a single file that is easy to back up and are usually only 50\% the size of the original source.


\subsubsection{How to get it}

If this has interested you then you can get a copy of the Fossil executable here \url{http://www.fossil-scm.org/download.html}. There are Linux, Mac, and Windows executable links on this page. Also there is a source Tarball from which you can compile from source. This web site is self-hosted by Fossil itself (see Section\vref{sec:Multiple-Users}). 


\subsection{Source control description}

This next section is useful if you have not used source control systems before. I will define some of the vocabulary and explain the basic ideas of source control.


\subsubsection{Check out systems}

When describing the grandaddy of source control systems, like SCCS I said it managed the changes for a single file and also prevented multiple people from working on the same file at the same time. This is representative of a whole class of source control systems. In these you have the idea of ``checking-out'' a file so you can edit it. At the same time while other people using the system can see who is working on the file they are prevented from touching it. They can get a read-only copy so they can say build software but only the ``owner'' can edit it. When done editing the ``owner'' checks it back in then anyone else could work on on it. At the same time the system has recorded who had it and the changes made to it.

This system works well in small groups with real time communication. A common problem is that a file is checked out by some one else and \textbf{you} have to make a change in it. In a small group setting, just a shout over the cube wall will solve the problem. 


\subsubsection{Merge systems}

In systems represented by CVS or Subversion the barrier is not getting a file to work on but putting it back under version control. In these systems you pull the source code files to a working directory in your area. Then you edit these files making necessary changes. When done you commit or check them back into the repository. At this point they are back under version control and the system knows the changes from the last version to this version.

This gets around the problem mentioned above when others are blocked from working on a file. You now have the opposite problem in that more than one person can edit the same file and make changes. This is handled by the check-in process. There only one person at a time may check in a file. That being the case the system checks the file and if there are changes in repository file that are NOT in the one to be checked in stops the check in process. The system will ask if the user wants to merge these changes into his copy. Once that is done the new version of the file can be checked in.

This type of system is used on large projects like the Linux kernel or other systems where you have a large number of geographically distributed contributors.


\subsubsection{Distributed systems}

The representatives of two major systems we have described thus far are centralized. That is there is only one repository on a single server. When you get a copy of the files or check in files it all goes to just one place. These work and can support many, many users. A distributed system is an extension of this where it allows the repositories to be duplicated and has mechanisms to synchronize them. 

With a single server users of the repository must be able to connect to it to get updates and for check ins of new code. If you are not connected to the server you are stuck and cannot continue working. Distributed systems allow you to have your own copy of the repository then continue working and when back in communication synchronize with the server. This is very useful where people take their work home and cannot access the company network. Each person can have a copy of the repository and continue working and re-sync upon return to the office.


\subsubsection{Common Terms}

The following is a list of terms I will use when talking about version control or Fossil.
\begin{description}
\item [{Repository}] This is the store when the version controlled files are kept. It will be managed by a source control system
\item [{SCS}] Source control system, this is software that manages a group of files keeping track of changes and allowing multiple users to modify them in a controlled fashion
\item [{Commit}] In Fossil to store the current set of new and changed files into the repository.
\item [{Trunk}] The main line of code descent in a Fossil repository.
\item [{Branch}] A user defined split in the files served by an SCS. This allow multiple work points on the same repository. Older branches (versions) might have bug fixes applied and newer branches (versions) can have new features added.
\item [{Fork}] In Fossil an involuntary split in the code path, occurs when a file in the repository has changes not in a file to be committed.
\end{description}

Added Chapters/multiple_user.tex.























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
\section{\label{sec:Multiple-Users}Multiple Users}


\subsection{Introduction}

In the previous chapter I went through using Fossil with just one user (me). In this chapter we will get into using it with multiple users. Thanks to Fossil's distributed design once the set up is done using it is not much different than the single user case with Fossil managing automatically the multiple user details.


\subsection{Setup}

In the previous chapter the Fossil repository was a file on our system and we did commits to it and pulled copies of the source from it. Fossil is a distributed source control system; what this means is that there is a master repository in a place that all users can access. Each user has their own ``cloned'' copy of the repository and Fossil will automatically synchronize the users repository with the master. From a each user's perspective you have your local repository and work with it using the same commands shown in Chapter \ref{sec:Single-User-Fossil}. It's just that now Fossil will keep your repository in sync with the master.


\subsubsection{Server Setup\label{sub:Server-Setup}}

I have the FossilBook.fossil repository and now have to put it in place so multiple users can access it. There are two ways, the first is using fossil's built in webserver to host the file and the second is using the operating systems supported web server (if present) and a cgi type access.


\paragraph{Self hosted}

This is quite simply the easiest way to do it. The downside is that you are responsible for keeping the machine available and the webserver up. That is, don't turn the machine off when you quit for the day or some other user is going to be upset. All I have to do is this:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:/Users/jschimpf/Public{]}~jim\%~cd~FOSSIL/}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FOSSIL{]}~jim\%~}\textbf{\scriptsize fossil~ui~-port~8081~FossilBook.fossil~\&}{\scriptsize{}~}{\scriptsize \par}

{\scriptsize {[}1{]}~310}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FOSSIL{]}~jim\%~}{\scriptsize \par}
\end{lyxcode}
\caption{Self-hosted Fossil repository}


\end{figure}


This is on UNIX system, the ``\&'' at then end of the second line runs the fossil webserver in the background. If I know this machine has an IP address of 192.168.1.200 then from any other machine in the network I can say:

\textbf{http://192.168.1.200:8081} to the browser and I can access the Fossil web server. 

As you can see this is simple and works on any system that runs Fossil. As long as you carefully make sure it's always running and available for others this can be a very easy way to make the master repository available. 

The problems with this method are:
\begin{enumerate}
\item If you have multiple repositories you have to use the \textbf{server} not the \textbf{ui} command, have all your repositories in the same directory, and have them all use the extension .fossil.
\item If the machine goes off line (i.e. for OS update) or other reason it might not automatically restart the Fossil servers.
\item Backup of the repositories might be not be done.
\end{enumerate}
This method does work, and if you only have one repository and a diligent owner of the master machine, it will work and work well.


\paragraph{Server hosted}

If you have a server type machine available (i.e., a Linux or UNIX box) that is running Apache or a Windows machine running IIS you can let it be the webserver for your repository. This has a number of advantages: this machine will be up all the time, it will probably be automatically backed up, and it can easily support multiple Fossil repositories.

I am not going into how to set up the webserver or how to enable (Common Gateway Interface) CGI. See the following sites.
\begin{itemize}
\item For IIS see here \url{http://www.boutell.com/newfaq/creating/iiscgihowto.html} and just ensure that your fossil.exe is in the path to be run by the cgi script.
\item For Apache see here \url{http://httpd.apache.org/docs/2.0/howto/cgi.html} and ensure you know the directory where the CGI scripts are stored.
\end{itemize}
If you are not in control of the webserver you will need the help of the server admin to enable CGI and to copy your CGI scripts to correct location.


\paragraph{CGI Script for hosted server}

If we assume an Apache server and, in my case, the cgi directory path is /Library/Webserver/CGI-Executables, then we have to write a script of the form:

\begin{figure}[H]
\begin{lyxcode}
\#!<Fossil~executable~location>

repository:~<Fossil~repository~location>
\end{lyxcode}
\caption{Fossil CGI script}


\end{figure}


and put it into the cgi script directory. I have put my Fossil executable into /usr/local/bin and I am putting my Fossil shared repository into /Users/Shared/FOSSIL. My script then becomes:

\begin{figure}[H]
\begin{lyxcode}
\#!/usr/local/bin/fossil

\#~Put~the~book~repository~on~the~web

repository:~/Users/Shared/FOSSIL/Fossilbook.fossil
\end{lyxcode}
\caption{My Fossil CGI script}


\end{figure}


After making the script I then copy it to the CGI directory and allow anyone to execute it.
\begin{lyxcode}

\end{lyxcode}
\begin{figure}[H]
\begin{lyxcode}
\textbf{\scriptsize sudo~cp~Book.cgi~/Library/Webserver/CGI-Executables/Book.cgi}{\scriptsize \par}



\textbf{\scriptsize sudo~chmod~a+x~/Library/Webserver/CGI-Executables/Book.cgi}{\scriptsize \par}
\end{lyxcode}
\caption{Copying script into place}


\end{figure}



\subsubsection{The test (either self hosted or server hosted)}

If all is in place then I should be able to access the webserver and get to this:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Multiple_user/test_access}

\caption{\label{fig:Web-access-to}Web access to Fossil CGI hosted site}
\end{figure}



\subsection{User Accounts}

Serving a repository, either self hosting or the more complicated CGI method gets you to the same place as shown in Figure \vref{fig:Web-access-to}. Now I have to set up user accounts for the other contributors to this book. Remember Fossil has automatically created an Anonymous user (see Figure \vref{fig:User-Configuration}) thus others can access the site in a limited way, that is they can download the book but cannot commit changes. In this case I want to create a new account (Marilyn) that can make changes and commit changes as she is my editor.

To accomplish all this first I have to login by going to the log in page and entering my ID (jim) and my password. Now since I'm super-user I then go back to the User-Configuration page, Figure \eqref{fig:User-Configuration} and add a new user:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Multiple_user/mul_new_user}

\caption{New Editor user\label{fig:New-Editor-user}}


\end{figure}


Since she is going to be an editor, this will be similar to a developer if we were doing code, so I picked the Developer privilege level. This way she can get the repository, check-in, check-out, and write and update tickets. I also added the attachments since she might need that to put on an image or other comment on actions she is doing. I also gave her a password so her access can be secured.

I could add other users at this point but don't need any others for this project, but you can see how easily this can be done. When you assign the user privileges just read carefully and don't give them any more than you think they need. If they have problems, you can easily modify their account in the future.


\subsection{Multiple User Operation}

With the server set up and the user established the next thing to do is clone the repository. That is make copy from the webserver repository to my local machine. Once that is done this local repository uses the same commands and is very much like single user use discussed in Section \vref{sec:Single-User-Fossil}. Fossil will synchronize your local repository with the one on the server.


\subsubsection{Cloning}

To clone a Fossil repository you have to know four things:
\begin{enumerate}
\item It's web address, for our repository it is \textbf{http://pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}
\item Your account name in my case it's \textbf{jim}
\item Your password (which I'm keeping to myself thank you...)
\item The local name of the repository, in this case I'm calling it Fossilbook.fossil
\end{enumerate}
You then go to where you want to keep the Repository (in my case the FOSSIL directory) and use the clone command:

\begin{figure}[H]
\begin{lyxcode}
{\tiny {[}Pandora-2:jschimpf/Public/FOSSIL{]}}\textbf{\tiny{}~fossil~clone~http://jim:}{\tiny <passwd>}\textbf{\tiny @pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi~FossilBook.fossil}{\tiny \par}

\textbf{\scriptsize \#\#\#~NOTE:~<passwd>~}{\scriptsize -~Stands~in~for~real~password}{\scriptsize \par}



{\scriptsize{}~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\scriptsize \par}

{\scriptsize Send:~~~~~~~~~~~~~~49~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Received:~~~~~~~~~120~~~~~~~~~~2~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Send:~~~~~~~~~~~~~625~~~~~~~~~25~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Received:~~~~~~~~4704~~~~~~~~~72~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Send:~~~~~~~~~~~~3104~~~~~~~~~72~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Received:~~~~~5129052~~~~~~~~131~~~~~~~~~10~~~~~~~~~~5}{\scriptsize \par}

{\scriptsize Send:~~~~~~~~~~~~2399~~~~~~~~~51~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Received:~~~~~4381170~~~~~~~~116~~~~~~~~~22~~~~~~~~~28}{\scriptsize \par}

{\scriptsize Total~network~traffic:~4117~bytes~sent,~6913068~bytes~received}{\scriptsize \par}

{\scriptsize Rebuilding~repository~meta-data...}{\scriptsize \par}

{\scriptsize 65~(100\%)...}{\scriptsize \par}

{\scriptsize project-id:~2b0d35831c1a5b315d74c4fd8d532b100b822ad7}{\scriptsize \par}

{\scriptsize server-id:~~3e67da6d6212494456c69b1c5406a277d7e50430}{\scriptsize \par}

{\scriptsize admin-user:~jim~(password~is~\textquotedbl{}d07222\textquotedbl{})}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FOSSIL{]}~jim\%~}{\scriptsize \par}
\end{lyxcode}
\caption{Clone command}


\end{figure}


At this point I can go through the steps outlined in Section \vref{sec:Single-User-Fossil} to set my user password and then open the Fossil Repository on a working directory.

Now that I've moved everything to the new cloned repository I do a check in a the end of the day which looks like this:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~commit~-m~\textquotedbl{}Moved~to~clone~repository\textquotedbl{}}{\scriptsize \par}

{\scriptsize Autosync:~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}{\scriptsize \par}

{\scriptsize Bytes~Cards~Artifacts~Deltas}{\scriptsize \par}

{\scriptsize Send:~130~1~0~0}{\scriptsize \par}

{\scriptsize Received:~2990~65~0~0}{\scriptsize \par}

{\scriptsize Total~network~traffic:~334~bytes~sent,~1876~bytes~received}{\scriptsize \par}

{\scriptsize New\_Version:~158492516c640d055bc0720684a05e797b88165a}{\scriptsize \par}

{\scriptsize Autosync:~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}{\scriptsize \par}

{\scriptsize Bytes~Cards~Artifacts~Deltas}{\scriptsize \par}

{\scriptsize Send:~618798~74~1~2}{\scriptsize \par}

{\scriptsize Received:~3222~70~0~0}{\scriptsize \par}

{\scriptsize Send:~268138~73~1~0}{\scriptsize \par}

{\scriptsize Received:~3221~70~0~0}{\scriptsize \par}

{\scriptsize Send:~3977~72~0~1}{\scriptsize \par}

{\scriptsize Received:~3220~70~0~0}{\scriptsize \par}

{\scriptsize Total~network~traffic:~457995~bytes~sent,~6011~bytes~received}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}{\scriptsize \par}
\end{lyxcode}
\caption{\label{fig:Cloned-repository-checkin}Cloned repository checkin}


\end{figure}


As you see the files were committed locally and then the local repository was automatically synchronized with the repository on the server.


\subsubsection{Keeping in sync}

After doing all the setup described above I now have a distributed source control system. My co-worker, Marilyn has also cloned the repository and begun work. She is editing the book correcting my clumsy phrasing and fixing spelling mistakes. She is working independently and on the same files I use. We must use Fossil to prevent us from both modifying FossilBook.lyx but in different ways. Remember Fossil has no file locking, there is nothing to prevent her from editing and changing the file while I work on it.

This is where we both must follow procedures to prevent this sort of problem. Even though she edits files I cannot see the changes till they are committed. Two different versions of the same file won't be a problem till I try to commit with my version and her version is in the current leaf.

\label{There-are-two}There are two problems:
\begin{enumerate}
\item Before I do any work I must be sure I have the current versions of all the files.
\item When I commit I must make sure what I am committing has only my changes and is not stepping on changes she has done.
\end{enumerate}
The first is pretty obvious, make sure you have the latest before you do anything. We do that with the update command. In Figure \ref{fig:Cloned-repository-checkin} I had done my latest check in. Before starting any more work I should ensure that Marilyn hasn't checked in something else. I could check the timeline but instead I'll do an update to my repository and source files. When I do the update I specify it should be updated from the \textbf{trunk. }This ensures I get it from the latest and greatest not some branch.

\begin{figure}
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~update~trunk}{\scriptsize \par}

{\scriptsize Autosync:~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}{\scriptsize \par}

{\scriptsize Bytes~Cards~Artifacts~Deltas}{\scriptsize \par}

{\scriptsize Send:~130~1~0~0}{\scriptsize \par}

{\scriptsize Received:~3588~78~0~0}{\scriptsize \par}

{\scriptsize Send:~365~6~0~0}{\scriptsize \par}

{\scriptsize Received:~136461~83~2~3}{\scriptsize \par}

{\scriptsize Total~network~traffic:~796~bytes~sent,~131582~bytes~received}{\scriptsize \par}

{\scriptsize UPDATE~fossilbook.lyx}{\scriptsize \par}

{\scriptsize UPDATE~fossilbook.pdf}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}~
\end{lyxcode}
\caption{Update action}


\end{figure}


Ah ha ! Marilyn has been at work and updated the book source and pdf. If I check the timeline from the webserver I see she has even documented it:

\begin{figure}[H]
\includegraphics[scale=0.4]{Images/Multiple_user/mul_timeline}

\caption{Updated Timeline}


\end{figure}


Now I know I have the current state of the world and I can proceed to add in new sections.


\subsubsection{Complications\label{sub:Complications}}

In\vref{There-are-two} the second case is much harder. In this case I have diligently done my fossil update and started working. In the mean time Marilyn has also done her update and also started working. Now she is done and checks in her changes. I obviously don't know this since I am happily working on my changes. What happens next....

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}\textbf{\scriptsize fossil~commit~-m~\textquotedbl{}Commit~that~might~fork\textquotedbl{}}{\scriptsize \par}

{\scriptsize Autosync:~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}{\scriptsize \par}

{\scriptsize Bytes~Cards~Artifacts~Deltas}{\scriptsize \par}

{\scriptsize Send:~130~1~0~0}{\scriptsize \par}

{\scriptsize Received:~4002~87~0~0}{\scriptsize \par}

{\scriptsize Send:~365~6~0~0}{\scriptsize \par}

{\scriptsize Received:~110470~92~2~3}{\scriptsize \par}

{\scriptsize Total~network~traffic:~797~bytes~sent,~104567~bytes~received}{\scriptsize \par}

\textbf{\scriptsize fossil:~would~fork.~\textquotedbl{}update\textquotedbl{}~first~or~use~-f~or~-{}-force.}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}{\scriptsize \par}
\end{lyxcode}
\caption{Forking commit}


\end{figure}


Ah ha, that very thing has happened and fossil warned me that my copy of the file differs from the master copy. If I did a --force then the repository would generate a fork and Marilyn's future commits would be to her fork and my commits would be to mine. That would not be what we want since I want her to edit\textbf{ }my copy of the book.

The next step would be to do as Fossil says and do an update. At this point you have to be careful since blindly updating the changed files could overwrite the stuff I've just done. So we do a trial update by using the -n and -v options to say``do a dry run'' and show me the results.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~update~-n~-v}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Multiple\_user/mul\_new\_user.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Multiple\_user/mul\_timeline.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Multiple\_user/test\_access.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/config\_initial.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/initial\_page.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/jim\_setup.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/ticket\_done.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/ticket\_form.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/ticket\_initial.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/ticket\_list.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/ticket\_submit.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/timeline.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/timeline\_detail.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/user\_config.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/wiki\_blankhome.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/wiki\_formating.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/wiki\_home.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/wiki\_homeedit.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/wiki\_page.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Layout/fossil.png}{\scriptsize \par}

{\scriptsize UNCHANGED~Research/History/CVS-grune.pdf}{\scriptsize \par}

{\scriptsize UNCHANGED~Research/History/RCS\textemdash{}A~System~for~Version~Control.webloc}{\scriptsize \par}

{\scriptsize UNCHANGED~Research/History/SCCS-Slideshow.pdf}{\scriptsize \par}

{\scriptsize UNCHANGED~Research/History/VCSHistory~-~pysync~-~A~Brief~History~of~Version~Control~Systems~-~Project~Hosting~on~Google~Code.webloc}{\scriptsize \par}

{\scriptsize UNCHANGED~Research/fossilbib.bib}{\scriptsize \par}

{\scriptsize MERGE~fossilbook.lyx}{\scriptsize \par}

{\scriptsize UPDATE~fossilbook.pdf}{\scriptsize \par}

{\scriptsize UNCHANGED~outline.txt}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}{\scriptsize \par}
\end{lyxcode}
\caption{Update dry run}


\end{figure}


That's a little more than I wanted as you can see almost everything is UNCHANGED but it shows that fossilbook.lyx needs a MERGE and fossilbook.pdf needs an UPDATE. This is what I should expect, Marilyn has done edits to the fossilbook.lyx file and so have I so we have to merge the changes. But she has also updated the fossilbook.pdf which I have not. Before we go on if you are running on Linux or UNIX you can simplify this dry run by doing:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}\textbf{\scriptsize fossil~update~-n~-v~|~grep~-v~UNCHANGED}{\scriptsize \par}

{\scriptsize MERGE~fossilbook.lyx}{\scriptsize \par}

{\scriptsize UPDATE~fossilbook.pdf}{\scriptsize \par}
\end{lyxcode}
\caption{Update dry run, shorter}


\end{figure}


By using the pipe and grep I can eliminate all those extra UNCHANGED lines.


\subsubsection{Fixing the Update file}

First we fix the easy file, the fossilbook.pdf I can just update by itself so it matches the current repository. It doesn't need merged so just replace it. Before I do that I have to look at the repository time line

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Multiple_user/mul_timeline}

\caption{Current Timeline}


\end{figure}


I see that the current\textbf{ Leaf} is {[}d44769cc23{]} and it is tagged as\textbf{ trunk}. I want to update the fossilbook.pdf from there. So I say:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}\textbf{\scriptsize fossil~update~trunk~fossilbook.pdf}{\scriptsize \par}

{\scriptsize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\scriptsize \par}

{\scriptsize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Received:~~~~~~~~4002~~~~~~~~~87~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Total~network~traffic:~334~bytes~sent,~2412~bytes~received}{\scriptsize \par}

{\scriptsize UPDATE~fossilbook.pdf}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}{\scriptsize \par}
\end{lyxcode}
\caption{Update fossilbook.pdf}


\end{figure}


and it's done.


\subsubsection{Fixing the Merge file}

We can use the tools built into Fossil. In this case noticing that commit will cause a fork Jim will use the -force option to cause the fork and will handle the merge later.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize E:\textbackslash{}Profile\textbackslash{}Ratte\textbackslash{}data\textbackslash{}organize\textbackslash{}fossil-w32\textbackslash{}fossil-book>fossil~commit~-m~\textquotedbl{}adding~some~changes~of~jim\textquotedbl{}}{\scriptsize \par}

{\scriptsize fossil:~would~fork.\A0~\textquotedbl{}update\textquotedbl{}~first~or~use~-f~or~-{}-force.}{\scriptsize \par}

{\scriptsize \A0}{\scriptsize \par}

{\scriptsize E:\textbackslash{}Profile\textbackslash{}Ratte\textbackslash{}data\textbackslash{}organize\textbackslash{}fossil-w32\textbackslash{}fossil-book>fossil~commit~-f~-m~\textquotedbl{}adding~some~other~changes~of~jim\textquotedbl{}}{\scriptsize \par}

{\scriptsize New\_Version:~df9f2ff6b14ef65a9dd2162f8bd20c78e1628165}{\scriptsize \par}
\end{lyxcode}
\caption{Forcing a commit under Windows}
\end{figure}


Now the timeline looks like:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Multiple_user/Windows/forked_timeline}

\caption{Windows Forked timeline}
\end{figure}


To remove this fork (i.e. get the changes Marilyn did into the trunk) we use the Fossil merge command. We can use the merge because fossilbook.lyx is a text file and the merge markers are designed to work with text files. If it was a binary file we might have to use an external file or copy and paste between the two file versions using the handler program for the file.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize E:\textbackslash{}Profile\textbackslash{}Ratte\textbackslash{}data\textbackslash{}organize\textbackslash{}fossil-w32\textbackslash{}fossil-book>fossil~merge~a91582b699}{\scriptsize \par}

{\scriptsize MERGE~fossilbook.lyx}{\scriptsize \par}

{\scriptsize {*}{*}{*}{*}{*}~2~merge~conflicts~in~fossilbook.lyx}{\scriptsize \par}
\end{lyxcode}
\caption{Fossil Merge}
\end{figure}


Looking at the file (fossilbook.lyx) in a text editor (not \LyX{}) we find:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize >\textcompwordmark{}>\textcompwordmark{}>\textcompwordmark{}>\textcompwordmark{}>\textcompwordmark{}>\textcompwordmark{}>~BEGIN~MERGE~CONFLICT}{\scriptsize \par}

{\scriptsize \A0Thanks~to~Fossil's~distributed~design~once~the~set~up~is~done~using~it}{\scriptsize \par}

{\scriptsize \A0with~multiple~users~is~not~much~different~than~the~single~user~case.}{\scriptsize \par}

{\scriptsize \A0Fossil~will~automatically~manage~the~most~multiple~user~details.}{\scriptsize \par}

{\scriptsize ============================}{\scriptsize \par}

{\scriptsize \A0}{\scriptsize \par}

{\scriptsize \A0Thanks~to~Fossil's~distributed~design~once~the~set~up~is~done~using~is}{\scriptsize \par}

{\scriptsize \A0not~much~different~than~the~single~user~case~with~Fossil~managing~automatically}{\scriptsize \par}

{\scriptsize \A0the~multiple~user~details.}{\scriptsize \par}

{\scriptsize <\textcompwordmark{}<\textcompwordmark{}<\textcompwordmark{}<\textcompwordmark{}<\textcompwordmark{}<\textcompwordmark{}<~END~MERGE~CONFLICT}{\scriptsize \par}



\textbf{<Here~edit~in~the~changes>}



{\scriptsize E:\textbackslash{}Profile\textbackslash{}Ratte\textbackslash{}data\textbackslash{}organize\textbackslash{}fossil-w32\textbackslash{}fossil-book>fossil~commit~-m~\textquotedbl{}merging~marilyn's~fork~back\textquotedbl{}}{\scriptsize \par}

{\scriptsize New\_Version:~acdd676d3ab157769496f6845ccc7652985c1d03}{\scriptsize \par}
\end{lyxcode}
\caption{Text differences}
\end{figure}


After the commit the timeline shows how the merge brought the fork back into the main trunk. Marilyn will then have to update to this new trunk. (See Section \vref{sub:Updating-by-others})

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Multiple_user/Windows/merged_timeline}

\caption{Merged timeline}
\end{figure}


Added Chapters/single_user.tex.



















































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
\subsection{Introduction}

If you have read this far and are at least persuaded to try, you will want to put one of your projects under software control using Fossil. This chapter is set up to lead you through that task and show you how to adapt your development to using this tool. The assumption is made in this section that you will be the only person using the repository, you are the designer, developer, and maintainer of this project. After you are comfortable using the tool, the next section will show how you use it when you have multiple people working on a project.


\subsection{Creating a repository }


\subsubsection{Introduction}

In the spirit of ``eating one's own dog food'' we will use this book as the project we are going to manage with Fossil. The book is a directory of text files (we are writing it using \LyX{} \cite{LyX}) and my working area looks like this:
\begin{lyxcode}
{\scriptsize FOSSIL/}{\scriptsize \par}
\begin{lyxcode}
{\scriptsize This~directory~holds~all~my~Fossil~repositories}{\scriptsize \par}
\end{lyxcode}
{\scriptsize FossilBook/}{\scriptsize \par}
\begin{lyxcode}
{\scriptsize outline.txt~~~~-~Book~design}{\scriptsize \par}

{\scriptsize fossilbook.lyx~-~The~book}{\scriptsize \par}

{\scriptsize Layout}{\scriptsize \par}
\begin{lyxcode}
{\scriptsize fossil.png~~-~The~Fossil~logo~(image~on~title~page)}{\scriptsize \par}
\end{lyxcode}
{\scriptsize Research}{\scriptsize \par}
\begin{lyxcode}
{\scriptsize fossilbib.bib~-~Working~bibliography}{\scriptsize \par}

{\scriptsize History}{\scriptsize \par}
\begin{lyxcode}
{\scriptsize CVC-grune.pdf~-~Historical~paper~about~CVS}{\scriptsize \par}

{\scriptsize RCS-A~System~for~Version~Control.webloc~-~RCS~bookmark}{\scriptsize \par}

{\scriptsize SCCS-Slideshow.pdf~-~Historical~paper~about~SCCS}{\scriptsize \par}

{\scriptsize VCSHistory~-pysync~...~.webloc~-~History~of~version~control}{\scriptsize \par}
\end{lyxcode}
\end{lyxcode}
\end{lyxcode}
\end{lyxcode}
This took just an hour or so to start preliminary research and build the framework. Since that's about all I'm going to do today I want to build a repository and put all this stuff under Fossil control.


\subsubsection{Create Repository}

I have a directory called FOSSIL in which I keep all my repositories, Fossil doesn't care but it helps me to keep them all in one place so I can back them up. First I need to create a new repository for the book. This is done using the command line after I move into the Fossil book directory.
\begin{lyxcode}
{\scriptsize }
\begin{figure}[H]
\begin{lyxcode}


{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~new~../FOSSIL/FossilBook.fossil}{\scriptsize \par}

{\scriptsize project-id:~2b0d35831c1a5b315d74c4fd8d532b100b822ad7}{\scriptsize \par}

{\scriptsize server-id:~~0149388e5a3109a867332dd8439ac7b454f3f9dd}{\scriptsize \par}

{\scriptsize admin-user:~jim~(initial~password~is~\textquotedbl{}}\textbf{\scriptsize ec3773}{\scriptsize \textquotedbl{})}{\scriptsize \par}
\end{lyxcode}
\caption{Create Repository\label{fig:Create-Repository}}


\end{figure}
{\scriptsize \par}
\end{lyxcode}
I create my repositories with the extension .fossil, this will be useful later with the server command (See Figure \vref{fig:server-detail}). When the create happened it assigned an initial password with an admin user of ``jim'' (i.e., me). 


\subsubsection{Connect Repository}

The repository is created but is empty and has no connection to the book directory. The next step is to open the repository to the book directory with the \textbf{open} command.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~open~../FOSSIL/FossilBook.fossil}{\scriptsize{}~}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~status}{\scriptsize \par}

{\scriptsize repository:~~~/Users/jschimpf/Public/FOSSIL/FossilBook.fossil}{\scriptsize \par}

{\scriptsize local-root:~~~/Users/jschimpf/Public/FossilBook/}{\scriptsize \par}

{\scriptsize server-code:~~0149388e5a3109a867332dd8439ac7b454f3f9dd}{\scriptsize \par}

{\scriptsize checkout:~~~~~279dfecd3f0322f236a92a9a8f3c96acf327d8c1~2010-04-25~12:40:39~UTC}{\scriptsize \par}

{\scriptsize tags:~~~~~~~~~trunk}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~extra}{\scriptsize \par}

{\scriptsize Layout/fossil.png}{\scriptsize \par}

{\scriptsize Research/History/CVS-grune.pdf}{\scriptsize \par}

{\scriptsize Research/History/RCS\textemdash{}A~System~for~Version~Control.webloc}{\scriptsize \par}

{\scriptsize Research/History/SCCS-Slideshow.pdf}{\scriptsize \par}

{\scriptsize Research/History/VCSHistory~-~pysync~-~....webloc}{\scriptsize \par}

{\scriptsize Research/fossilbib.bib}{\scriptsize \par}

{\scriptsize fossilbook.lyx}{\scriptsize \par}

{\scriptsize outline.txt}{\scriptsize \par}
\end{lyxcode}
\caption{Open Repository \& Check}


\end{figure}


The \textbf{open} command seemingly did nothing but checking with the \textbf{status} command shows the repository, the directory it's linked to and that we are hooked to the trunk of the store. 

The \textbf{extra} command shows all the files in the directory that are NOT under control of Fossil. In this case that's all of them since we have not checked in anything.


\subsubsection{Add and Initial Commit}

I must now add all the relevant files into the repository with the \textbf{add} command. The Fossil add is recursive so if I add the top level files it will automatically recurse into the subdirectories like Layout and Research and get those files too. Before you do an add it pays to tidy up your directory so you don't accidentally add a bunch of transient files (like object files from a compile). It's easy to remove them later but a little tidying before hand can save you some work.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~add~.}{\scriptsize \par}

{\scriptsize ADDED~~Layout/fossil.png}{\scriptsize \par}

{\scriptsize ADDED~~Research/History/CVS-grune.pdf}{\scriptsize \par}

{\scriptsize ADDED~~Research/History/RCS\textemdash{}A~System~for~Version~Control.webloc}{\scriptsize \par}

{\scriptsize ADDED~~Research/History/SCCS-Slideshow.pdf}{\scriptsize \par}

{\scriptsize ADDED~~Research/History/VCSHistory~-~pysync~....webloc}{\scriptsize \par}

{\scriptsize ADDED~~Research/fossilbib.bib}{\scriptsize \par}

{\scriptsize fossil:~cannot~add~\_FOSSIL\_}{\scriptsize \par}

{\scriptsize ADDED~~fossilbook.lyx}{\scriptsize \par}

{\scriptsize ADDED~~outline.txt}{\scriptsize \par}
\end{lyxcode}
\caption{Initial file add}
\end{figure}


I simply told fossil to do an add of the current directory (.) so it got all those files and all the files in the subdirectory. Note the \_FOSSIL\_ that it didn't add. This is the tag file that fossil keeps in a directory so it knows what repository it belongs to. Fossil won't add this file since it manages it, but everything else is fair game.

One final thing before I can quit for the day, these files have been added or rather they will be added to the repository when I commit it. That must be done and then we can relax and let Fossil manage things. 

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~commit~-m~\textquotedbl{}Initial~Commit\textquotedbl{}}{\scriptsize \par}

{\scriptsize New\_Version:~8fa070818679e1744374bc5302a621490276d739}{\scriptsize \par}
\end{lyxcode}
\caption{Initial Commit}


\end{figure}


I added a comment on the commit and it's a good idea to always do this. When later we see the timeline of the commits you will have notes to tell you what was done.


\subsubsection{Fossil start up summary}
\begin{itemize}
\item \textbf{fossil new <name> }Creates a new fossil repository
\item \textbf{fossil open <repository> }While in a source directory connects this directory to the fossil repository
\item \textbf{fossil add .} Will add (recursively) all the files in the current directory and all subdirectories to the repository
\item \textbf{fossil commit -m ``Initial Commit''} Will put all the currently added files into the repository.
\end{itemize}

\subsection{Set Up User interface}

One of the surprising features of Fossil is the webserver. This allows it to have a GUI type user interface with no operating system specific code, the GUI is the web browser supplied by your OS. In the previous steps I checked my project in to a Fossil repository, next I have to prep the web interface for production use. 
\begin{description}
\item [{NOTE}] The Fossil web server uses port 8080 instead of the standard port 80 for all HTTP access. When run it will automatically start your Web browser and open the repository home page. Unfortunately my book work is done on a machine that already has Apache running on port 8080 so I will be using port 8081. I will always have to add an extra parameter on the UI command line to do this.
\end{description}
\begin{figure}[H]
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\footnotesize fossil~ui~-port~8081}{\footnotesize \par}
\end{lyxcode}
\caption{\label{fig:Starting-Webserver}Starting Webserver}
\end{figure}

\begin{description}
\item [{NOTE:}] Newer versions of Fossil automatically find an open port and will give a message on the command line telling you what port number is used. You can still use the -port option if you want to control the port \#.
\end{description}
This shows how it's started, as you can see I have picked port 8081 since I am locked out of port 8080. When I do this my browser starts and I am presented with the following home page.

\begin{figure}[H]
\noindent \begin{raggedright}
\includegraphics[scale=0.6]{Images/Single_user/initial_page}
\par\end{raggedright}

\caption{\label{fig:Initial-Webserver-page}Initial Webserver page}


\end{figure}


Following the advice on the page I go to \textbf{setup/config}. I am going to do the minimum setup that you should do on all projects. As you get familiar with Fossil you will probably have many more things that you will customize for your taste but what follows are the only things you HAVE to do.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/config_initial}

\caption{\label{fig:Initial-Configuration}Initial Configuration}


\end{figure}


I have entered in a project name and put in a description, the project name will be the name of the initial Wiki page (see \vref{sub:Wiki-Use}) and the description is useful for others to see what you are doing here. Then I go to the bottom of the page and pick the \textbf{Apply Changes }button.

Next I pick the Admin tab (you can see it in the header bar) and the pick Users from that page. I am presented with the users and will use this to set the password of the project.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/user_config}

\caption{\label{fig:User-Configuration}User Configuration}


\end{figure}


As you can see Fossil automatically configures a number of users beyond just the creator. The anonymous user you have already seen if you went to the Fossil web site to download the code. This user can view and get code but cannot commit code. On the right side of the page are the many options you can give to a user, it's worth reading it all when you set up your repository. The important one is me (jim) which has ``s'' or Super User Capabilities. This means I can do anything with the repository.

I will now edit the user Jim to make sure it has the settings I want. In this case you MUST set the password. Remember way back where Fossil set it during the create (Figure\vref{fig:Create-Repository}), it's a very good idea to change this to something you can remember rather than the original random one.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/jim_setup}

\caption{Super User Setup}


\end{figure}


I have put in my contact information (e-mail address) and while you cannot see it I have typed in a password that I will remember. Then I applied the changes.

Now the repository is ready for further work, it's rather bare bones at this point but the most important things are set up.


\subsubsection{User interface summary}
\begin{itemize}
\item \textbf{fossil ui} run in the source directory will start a browser based user interface to fossil.
\item \textbf{fossil ui -port <IP port \#>} Can be used if port 8080 if already in use on your system.
\item On the first run it is important to configure your project with a name and set the password for yourself.
\end{itemize}

\subsection{Update Repository}

After writing the above section of the book I now have created a bunch of new files and changed some of the existing files in the repository. Before quitting for the day I should add these new files into the repository and commit the changes saving this milestone in the project.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~extra}{\scriptsize \par}

{\scriptsize \#fossilbook.lyx\#}{\scriptsize \par}

{\scriptsize Images/Single\_user/config\_initial.epsf}{\scriptsize \par}

{\scriptsize Images/Single\_user/initial\_page.epsf}{\scriptsize \par}

{\scriptsize Images/Single\_user/jim\_setup.epsf}{\scriptsize \par}

{\scriptsize Images/Single\_user/user\_config.epsf}{\scriptsize \par}

{\scriptsize fossilbook.lyx\textasciitilde{}}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~status}{\scriptsize \par}

{\scriptsize repository:~~~/Users/jschimpf/Public/FOSSIL/FossilBook.fossil}{\scriptsize \par}

{\scriptsize local-root:~~~/Users/jschimpf/Public/FossilBook/}{\scriptsize \par}

{\scriptsize server-code:~~0149388e5a3109a867332dd8439ac7b454f3f9dd}{\scriptsize \par}

{\scriptsize checkout:~~~~~8fa070818679e1744374bc5302a621490276d739~2010-04-25~13:09:02~UTC}{\scriptsize \par}

{\scriptsize parent:~~~~~~~279dfecd3f0322f236a92a9a8f3c96acf327d8c1~2010-04-25~12:40:39~UTC}{\scriptsize \par}

{\scriptsize tags:~~~~~~~~~trunk}{\scriptsize \par}

{\scriptsize EDITED~~~~~fossilbook.lyx}{\scriptsize \par}


\end{lyxcode}
\caption{Project Status}


\end{figure}


I run \textbf{fossil extra} to see these new files. The image files (those in Images/Single\_user) I want to add, the other two files, \#fossilbook.lyx\# and fossilbook.lyx\textasciitilde{}, I don't want to add since they are temporary artifacts of \LyX{}. I also ran \textbf{fossil status}. This shows changes to files that are already in the repository. There the only file changed is the book text itself, \textbf{fossilbook.lyx}.

All I have to do now is add in the directory Images which will add in the image files I want in the repository. Then I commit the changes to the repository and we can move on to other tasks of the day.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~add~Images}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/config\_initial.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/initial\_page.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/jim\_setup.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/user\_config.epsf}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~commit~-m~\textquotedbl{}Initial~setup~with~pictures\textquotedbl{}}{\scriptsize \par}

{\scriptsize New\_Version:~a2d12bf532a089ee53578e3e17c6e732c0442f49}{\scriptsize \par}
\end{lyxcode}
\caption{\label{fig:Update-for-new}Update for new files}


\end{figure}


After doing this commit I can bring up the Fossil ui (see Figure \vref{fig:Starting-Webserver}) and view the project Timeline by picking that tab on the Fossil header. We get this:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/timeline}

\caption{Timeline}


\end{figure}


You can see all my check-ins thus far and you can see after the check-in from Figure \vref{fig:Update-for-new} I did another check-in because I missed some changes in the outline. The check-ins are labeled with the first 10 digits of their hash value and these are active links which you can click to view in detail what was changed in that version. 

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/timeline_detail}

\caption{Timeline Detail\label{fig:Timeline-Detail}}
\end{figure}


I clicked on the very last check-in (the \textbf{LEAF) }and the display is shown above. There are many things you can do at this point. From the list of changed files you can pick the diff link and it will show in text form the changes made in that particular file. The ``Other Links'' section has a very useful ZIP Archive. Clicking this will download a ZIP of this version to your browser. You will find this useful if you want to get a particular version, in fact this is normally how you get a new version of Fossil from the \url{http://www.fossil-scm.org/}. The edit link will be used later to modify a leaf.


\subsubsection{Update Summary}
\begin{itemize}
\item \textbf{fossil status} and \textbf{fossil extra} will tell you the updated files and files not in the repository before you commit.
\item \textbf{fossil commit - m ``Commit comment'' }Commits a change (or changes). It is very important to have a descriptive comment on your commit.
\end{itemize}

\subsection{Tickets}

Besides managing your code Fossil has a trouble ticket system. This means you can create a ticket for a problem or feature you are going to add to your system then track your progress. Also you can tie the tickets to specific check-ins of your files. For software this is very useful for bug fixes and feature additions. For example you can look for a bug in the ticket list then have it take you to the change that fixed the problem. Then you know exactly what you did and not have to be confused by other changes you might have made.

When you pick Tickets it will bring up this window. You can create a new ticket, look at the list, or generate a new report. Keeping things simple I will just use the All Tickets list for now.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/ticket_initial}

\caption{Initial Ticket Window}


\end{figure}


Picking ``New Ticket'' I get a form that I fill out like so:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/ticket_form}

\caption{Ticket Form}


\end{figure}


Pretty simple actually. You can put as much or as little detail in here as you wish, but remember this stuff might be really vital 6 weeks or 6 months from now so think of what you would want to know then. When I press Submit I get this showing what I entered.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/ticket_submit}

\caption{Viewing a Ticket}


\end{figure}


Finally picking Tickets then ``All Tickets'' I can see my new ticket in the list marked as Open and in a distinctive color. 

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/ticket_list}

\caption{\label{fig:viewticket}Ticket List with open ticket}


\end{figure}


I try, in handling tickets, to have links from ticket to the commit that addressed the problem and a link from the commit back to the offending ticket. This way looking at the ticket I can get to the changes made and from the timeline I can get the the ticket and its resolution. To do this I will make sure and put the 10 digit hash label from the ticket into the check-in comment and put a link in the resolved ticket to the check-in.

Since I have now written the chapter and put in all these images of what to do I can now add in all the new images to the repository and check this in as another completed operation. And I do that like this:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~add~Images/Single\_user}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/config\_initial.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/initial\_page.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/jim\_setup.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/ticket\_form.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/ticket\_initial.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/ticket\_list.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/ticket\_submit.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/timeline.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/timeline\_detail.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/user\_config.epsf}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~commit~-m~\textquotedbl{}{[}1665c78d94{]}~Ticket~Use\textquotedbl{}}{\scriptsize \par}
\end{lyxcode}
\caption{\label{fig:checkin}Ticket resolving check-in}


\end{figure}


First I added in all the new image files. I am lazy and just told it to add in all the files in the Single\_user directory. I have previously added some of those like \textbf{config\_initial.epsf} but Fossil is smart and knows this and won't add that one twice. Even though it shows it ADDED, it really didn't.

The commit line is very important, as you can see I put 10 digit hash code for the ticket in brackets in the comment. As we will see in the Wiki section this is a link to the Ticket, so when viewing the comment in the Timeline or elsewhere you can click the bracketed item and you would go to the ticket.

Now that I have the items checked in I have to close the ticket. I do that by clicking on its link in the ticket list, that will go the the View Ticket window as shown in Figure \vref{fig:viewticket}. From there I pick edit and fill it in as shown:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/ticket_done}

\caption{Ticket Finish}


\end{figure}


I mark it as ``Closed''. If you have code you can mark this as fixed, tested, or a number of other choices. Another very important step, I brought up the Timeline and copied the link for the commit I had just done in Figure \vref{fig:checkin}. By doing this my ticket is now cross linked with the commit and the commit has a link back to the ticket.


\subsubsection{Ticket Summary}
\begin{itemize}
\item Tickets are a useful way of reminding you what needs done or bugs fixed
\item When you commit a change that affects a ticket put the 10 digit hash label of the ticket into the commit comment surrounded by brackets, e.g. {[}<10 digit hash>{]} so you can link to the ticket
\item When you close the ticket put in the hash label of the commit that fixed it.
\end{itemize}

\subsection{\label{sub:Wiki-Use}Wiki Use}

As we saw in Figure \vref{fig:Starting-Webserver} Fossil has a browser based user interface. In addition to the pages that are built in you can add pages to web site via a wiki. This allows you to add code descriptions, user manuals, or other documentation. Fossil keeps all that stuff in one place under version control. A wiki is a web site where you can add pages and links from within your browser. You are given an initial page then if you type {[}newpage{]} this text will turn into a link and if clicked will take you to a new blank page. Remember in Figure \vref{fig:Initial-Webserver-page} that is the initial page for your project and from there you can add new pages. These pages are automatically managed by the Fossil version control system; you don't have to add or commit.

Since I did the setup on repository (see Figure \vref{fig:Initial-Configuration}) the home page has changed to this:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/wiki_blankhome}

\caption{Blank Home Page}


\end{figure}


Not very helpful so the in rest of this chapter I will use the Wiki functions of Fossil to make this more useful. If I pick the Wiki item from the menu bar I get:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/wiki_page}

\caption{\label{fig:Wiki-controls}Wiki controls}


\end{figure}


These are the controls that let you control and modify the wiki. Most important for now is the Formatting rules link. This link takes you to a page that describes what you can do to format a wiki page. If you just type text on a page it will appear but be formatted by your browser. You can type HTML commands to control this formating. It's worth your time to carefully read this page and note what you can and cannot do. The page just lists the valid HTML commands, and if you don't know what they mean I would suggest you find a page like this \url{http://www.webmonkey.com/2010/02/html_cheatsheet/} and keep it handy. 

Besides the HTML markup the most powerful command for the Wiki is {[}page{]} where it links to a new page. This is how you add pages and how you build your web site of documentation for the repository.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/wiki_formating}\caption{Wiki Formating}


\end{figure}


I now begin work. What I want to do is change the home page to be non-empty and also put a link on the home page to the PDF of this book. In Figure \vref{fig:Wiki-controls} I click on the first item, the FossilBook home page. This takes me to the home page again but now I have an Edit option. We also have a History option so I could look at older versions of the page. 

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/wiki_homeedit}

\caption{Home page with edit}


\end{figure}


This shows my initial edit and a preview:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/wiki_home}

\caption{Initial Home page}


\end{figure}


The bottom section is an edit window where I type things I want displayed and the top is a preview of what the page will be. As you can see I typed some simple HTML to make a large and centered title. The body of the text I just typed and as you see the browser fits the text to the screen. You can have multiple paragraphs by just putting blank lines between your text. Next I wanted a bulleted list and this is done by typing two spaces, a '{*}' then two more spaces. On each of these lines I have a link to a new (not yet created page). If you look I put these in the form {[} <new page> | <title> {]}. This way I can have a long string that describes the link but have a nice short (no embedded spaces) page name. 

One mistake I usually make at this point is to click one of those new links which takes me to a new blank page. \textbf{OOPS}, if I have not saved this page yet then I find I've lost my changes so far. 

OK, I will save my changes and then go to the new pages. I am doing some complicated things here. The first link is to the book PDF. This will be a file I create in the repository. The \LyX{} program I'm using creates the PDF. I will do that, save it, and add it to the repository. But I don't want to link to a static file, that is I want the most current version of the PDF, the one I save each time I quit for the day. To do this we have to put in a link that looks like this:
\begin{lyxcode}
{[}http:doc/tip/FossilBook.pdf~|~Book~(pdf)~{]}
\end{lyxcode}
This is a special link the Fossil wiki understands, \textbf{doc }says this is documentation. \textbf{tip }says use the most current version; you could put a version link here. And finally since I am going to put the book PDF at the top level I only need the file name. If it was in a subdirectory I would have to say \textbf{doc/tip/subdir/filename. }

The second link is just to a regular page and I can just edit that one just like I did this the main page.


\subsubsection{Wiki Summary}
\begin{itemize}
\item Format your text using HTML commands like <h1>Title</h1> for page headings
\item Create and link pages using {[} <page> | <Link text> {]}
\item The page designation http:doc/tip/<document path relative to repository> will display any document in the repository that your browser can handle (i.e. pdf, http etc)
\item Never click on a link till AFTER you have saved the page
\end{itemize}

Added Chapters/th1_scripting.tex.

Added Chapters/whats_next.tex.

























>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12


\section{What's next ?}

This book so far has covered how to use the many features of Fossil and has, I hope, interested you in using it. The question \textquotedbl{}what's next\textquotedbl{} now comes up. First go to the Fossil website \url{http://www.fossil-scm.org/}. While there you can go to the Wiki link and then list all Wiki pages. There are all sorts of topics covered there in depth. If that still doesn't help, you can join the Fossil mailing list (see Wiki links) and look at the archives or directly ask a question. I have found the list to be very helpful and have had my questions asked very quickly.

On the mailing lists you will see long discussions of changes to be made to Fossil, some of these are accepted very quickly and will appear within hours in the Fossil source code. Others engender long discussions (in particular discussion of changes to the Wiki) and it is interesting to read the pros and cons of suggested changes. 

Fossil is an evolving program but if you get a version that has all the features you need you can stick with that version as long as you like. Going to a new version though is simple and just requires a \textbf{rebuild} of your current repositories. The developers have been very careful to preserve the basic structure so it is easy and safe to switch versions.

Finally if you wish to contribute to the project there are many things to do (See the To Do List in the Wiki). 

Added Images/Advanced/Branching/branch.pdf.

cannot compute difference between binary files

Added Images/Advanced/Branching/color_setup.pdf.

cannot compute difference between binary files

Added Images/Advanced/Branching/current_state.pdf.

cannot compute difference between binary files

Added Images/Advanced/Simple_Merge/sm_Marilyn.pdf.

cannot compute difference between binary files

Added Images/Advanced/Simple_Merge/sm_after_merge.pdf.

cannot compute difference between binary files

Added Images/Advanced/Simple_Merge/sm_jim_fork.pdf.

cannot compute difference between binary files

Added Images/Advanced/file_merge/merge.pdf.

cannot compute difference between binary files

Added Images/Commands/help1.pdf.

cannot compute difference between binary files

Added Images/Multiple_user/Windows/forked_timeline.pdf.

cannot compute difference between binary files

Added Images/Multiple_user/Windows/merged_timeline.pdf.

cannot compute difference between binary files

Added Images/Multiple_user/mul_new_user.pdf.

cannot compute difference between binary files

Added Images/Multiple_user/mul_timeline.pdf.

cannot compute difference between binary files

Added Images/Multiple_user/test_access.pdf.

cannot compute difference between binary files

Added Images/Single_user/config_initial.pdf.

cannot compute difference between binary files

Added Images/Single_user/initial_page.pdf.

cannot compute difference between binary files

Added Images/Single_user/jim_setup.pdf.

cannot compute difference between binary files

Added Images/Single_user/ticket_done.pdf.

cannot compute difference between binary files

Added Images/Single_user/ticket_form.pdf.

cannot compute difference between binary files

Added Images/Single_user/ticket_initial.pdf.

cannot compute difference between binary files

Added Images/Single_user/ticket_list.pdf.

cannot compute difference between binary files

Added Images/Single_user/ticket_submit.pdf.

cannot compute difference between binary files

Added Images/Single_user/timeline.pdf.

cannot compute difference between binary files

Added Images/Single_user/timeline_detail.pdf.

cannot compute difference between binary files

Added Images/Single_user/user_config.pdf.

cannot compute difference between binary files

Added Images/Single_user/wiki_blankhome.pdf.

cannot compute difference between binary files

Added Images/Single_user/wiki_formating.pdf.

cannot compute difference between binary files

Added Images/Single_user/wiki_home.pdf.

cannot compute difference between binary files

Added Images/Single_user/wiki_homeedit.pdf.

cannot compute difference between binary files

Added Images/Single_user/wiki_page.pdf.

cannot compute difference between binary files

Deleted fossilbook.lyx.

more than 10,000 changes

Changes to fossilbook.pdf.

cannot compute difference between binary files

Added fossilbook.tex.



































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
\documentclass[11pt,letterpaper,english]{article}
\usepackage{mathptmx}
\usepackage{helvet}
\usepackage{courier}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\usepackage{array}
\usepackage{varioref}
\usepackage{float}
\usepackage{url}
\usepackage{amsmath}
\usepackage{makeidx}
\makeindex
\usepackage{graphicx}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth

\providecommand{\LyX}{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\newenvironment{lyxcode}
{\par\begin{list}{}{
\setlength{\rightmargin}{\leftmargin}
\setlength{\listparindent}{0pt}% needed for AMS classes
\raggedright
\setlength{\itemsep}{0pt}
\setlength{\parsep}{0pt}
\normalfont\ttfamily}%
 \item[]}
{\end{list}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.

% Include the proper LaTeX packages:
%----------------------------------------------------------------------------------------------------
\usepackage{graphicx}
\usepackage{titling}
\usepackage{ifthen}
\usepackage[absolute]{textpos}
\usepackage[colorlinks=true,
                       pagecolor=black,
                       menucolor=black,
                       linkcolor=black,
                       citecolor=blue,
                       pagebordercolor=1 1 1,
                       urlcolor=red,
                       plainpages=false,
                       pdfpagelabels=true,
                       bookmarksnumbered=true]{hyperref}
\usepackage{lastpage}

\newcommand{\reportTopic}{<reportTopic>}
\newcommand{\revisionNumber}{<rev. no.>}
\newcommand{\documentNumber}{<doc. no.>}


% Setup the right-hand header to display the current doc section:
%----------------------------------------------------------------------------------------------------
\renewcommand{\sectionmark}[1]{\markright{#1}}
\renewcommand{\subsectionmark}[1]{\markright{#1}}

% Setup for roman numeral page numbers until TOC:
%----------------------------------------------------------------------------------------------------
\newboolean{romanpn}

\pagenumbering{roman}
\setboolean{romanpn}{true}
\let\myTOC\tableofcontents

\renewcommand\tableofcontents{%
\myTOC
\clearpage
\pagenumbering{arabic}
\setboolean{romanpn}{false}
}

% Modify titlepage format:
%----------------------------------------------------------------------------------------------------
\setlength{\TPHorizModule}{1in}
\setlength{\TPVertModule}{\TPHorizModule}
\textblockorigin{3.25in}{1in}

\pretitle
 {
    \begin{flushright}\LARGE\sffamily 
    \thispagestyle{empty}
    \begin{textblock}{4}(0,0)
    \includegraphics[width=4in,keepaspectratio=true]{Layout/fossil.png}
    \end{textblock}
    \vspace{2in}
  }

\posttitle{\par\end{flushright}}

\preauthor{\begin{flushright} \large \sffamily \lineskip 0.5em 
\begin{tabular}[t]{c}}
\postauthor{\end{tabular} \par\end{flushright}}

\predate{\begin{flushright}\large \sffamily Document Number: \documentNumber \\ Revision Number: \revisionNumber \\}

\postdate{
\vspace{2in}
\\Pandora Products.
\\215 Uschak Road
\\Derry, PA  15627
\par\end{flushright}}

% Setup "fancy" page layout:
%----------------------------------------------------------------------------------------------------
\fancyhf{}
\setlength{\topmargin}{-1in}
\setlength{\headheight}{1in}
\setlength{\headsep}{0.5in}
\setlength{\oddsidemargin}{0.25in}
\setlength{\evensidemargin}{\oddsidemargin}
\setlength{\textwidth}{6in}
\setlength{\headwidth}{\textwidth}
\setlength{\textheight}{8.375in}
\setlength{\footskip}{0.5in}

% Setup header:
%------------------------------------------------------------------------------------------
\fancyhead[L]{\sffamily \bfseries \large Fossil Version Control\\\mdseries \reportTopic}
%\fancyhead[R]{\sffamily \bfseries \large Pandora Products\\ \mdseries \nouppercase{\rightmark}}

% Setup footer:
%------------------------------------------------------------------------------------------
\renewcommand{\footrulewidth}{0.4pt}
\fancyfoot[L]{\sffamily \bfseries \documentNumber \\ \mdseries Revision:  \revisionNumber}
\fancyfoot[C]{\sffamily \bfseries\thedate \\ }
\fancyfoot[R]{\ifthenelse{\boolean{romanpn}}{\sffamily  \thepage}{\sffamily \bfseries Page \thepage\ of \pageref{LastPage}}}

\makeatother

\usepackage{babel}
\begin{document}
\renewcommand{\documentNumber}{PAN-20100424}

\renewcommand{\reportTopic}{A Users Guide}

\renewcommand{\revisionNumber}{1.75}


\title{Fossil Version Control\\ \reportTopic}


\author{Jim Schimpf}


\date{15 September 2011}

\maketitle
\thispagestyle{empty}

\newpage{}2010 Pandora Products. This work is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License. To view a copy of this license, visit \url{http://creativecommons.org/licenses/by-sa/3.0/us/} or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. 

and\medskip{}
Pandora Products

215 Uschak Road 

Derry, PA 15627 

\medskip{}
Phone: 724.539.1276

Fax: 724.539.1276 

Web: http://www.fossil-scm.org/schimpf-book/index

Email: jim.schimpf@gmail.com

\medskip{}
Pandora Products has carefully checked the information in this document and believes it to be accurate. However, Pandora Products assumes no responsibility for any inaccuracies that this document may contain. In no event will Pandora Products be liable for direct, indirect, special, exemplary, incidental, or consequential damages resulting from any defect or omission in this document, even if advised of the possibility of such damages. 

In the interest of product development, Pandora Products reserves the right to make improvements to the information in this document and the products that it describes at any time, without notice or obligation. 

Additional Contributors
\begin{itemize}
\item Marilyn Noz - Editor
\item Wolfgang Stumvoll - Fossil Merge use and Windows use
\item javalinBCD@gmail.com - found bugs
\item arnel\_legaspi@msn.com - found bugs
\end{itemize}
\newpage{}




\section*{Document Revision History}

\textit{Use the following table to track a history of this documents revisions. An entry should be made into this table for each version of the document}.

\begin{center}
\begin{tabular}{|>{\centering}p{0.5in}|>{\centering}p{0.5in}|p{3in}|>{\centering}p{1in}|}
\hline 
Version & Author & Description & Date\tabularnewline
\hline 
0.1 & js & Initial Version & 24-Apr-2010\tabularnewline
\hline 
0.2 & js & Finishing up Single User Chapter & 27-Apr-2010\tabularnewline
\hline 
0.3 & js & Working on introduction chapter & 30-Apr-2010\tabularnewline
\hline 
0.4 & js & Adding multiuser chapter & 1-May-2010\tabularnewline
\hline 
0.5 & mn & Adding editorial corrections {[}ebf40b842a{]} & 4-May-2010\tabularnewline
\hline 
0.6 & js & Adding Command sections {[}e11399d575{]} & 8-May-2010\tabularnewline
\hline 
0.7 & js & English \& spelling corrections & 19-May-2010\tabularnewline
\hline 
0.8 & js & Spelling fixes & 30-May-2010\tabularnewline
\hline 
0.9 & ws & Using Fossil merge {[}db6c734300{]} & 2-Jun-2010\tabularnewline
\hline 
1.0 & js/ws & Put Fossil merge first in handling fork & 3-Jun-2010\tabularnewline
\hline 
1.1 & mn & Fixes in multiple user chapter {[}e8770d3172{]} & 4-Jun-2010\tabularnewline
\hline 
1.2 & js & Start advanced use chapter {[}2abc23dae5{]} & 4-Jun-2010\tabularnewline
\hline 
1.3 & mn & English corrections Chapter 1 {[}8b324dc900{]} & 5-Jun-2010\tabularnewline
\hline 
1.4 & mn & Sections 2.1 \& 2.2 corrections {[}0b34cb6f04{]} & 7-Jun-2010\tabularnewline
\hline 
1.5 & js & Move close leaf to adv use {[}2abc23dae5{]} & 7-Jun-2010\tabularnewline
\hline 
1.6 & js & Convert Advanced chapter to forks and branching & 13-Jun-2010\tabularnewline
\hline 
1.7 & js/tr & Add note about IP port usage {[}a62efa8eba{]} & 8-Jul-2010\tabularnewline
\hline 
1.71 & javelin & Check on mispelling section 1.1 {[}637d974f62{]} & 15-Sep-2011\tabularnewline
\hline 
1.72 & anon & Fix absolute path in image regs {[}d54868853b{]} & 15-Sep-2011\tabularnewline
\hline 
1.73 & anon & Fix fossil create section 2.2.5 {[}36772d90a5{]} & 15-Sep-2011\tabularnewline
\hline 
1.74 & anon & Push/Pull described incorrectly {[}1b930fced6{]} & 15-Sep-2011\tabularnewline
\hline 
1.75 & arnel & Commands might be changed  {[}4aaf1f78bb{]} & 15-Sep-2011\tabularnewline
\hline 
\end{tabular}
\par\end{center}

\newpage{}\tableofcontents{}

\listoffigures


\newpage{}


\section*{Foreward}

\include{Chapters/foreword}
\include{Chapters/introduction}
\include{Chapters/single_user}
\include{Chapters/multiple_user}
\include{Chapters/forks_branches}
\include{Chapters/commands}
\include{Chapters/th1_scripting}
\include{Chapters/whats_next}






\pagebreak{}

\printindex{}

\bibliographystyle{plain}
\bibliography{Research/fossilbib}

\end{document}

Added fossilbook.tex~.











































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
\documentclass[11pt,letterpaper,english]{article}
\usepackage{mathptmx}
\usepackage{helvet}
\usepackage{courier}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\usepackage{array}
\usepackage{varioref}
\usepackage{float}
\usepackage{url}
\usepackage{amsmath}
\usepackage{makeidx}
\makeindex
\usepackage{graphicx}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth

\providecommand{\LyX}{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\newenvironment{lyxcode}
{\par\begin{list}{}{
\setlength{\rightmargin}{\leftmargin}
\setlength{\listparindent}{0pt}% needed for AMS classes
\raggedright
\setlength{\itemsep}{0pt}
\setlength{\parsep}{0pt}
\normalfont\ttfamily}%
 \item[]}
{\end{list}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.

% Include the proper LaTeX packages:
%----------------------------------------------------------------------------------------------------
\usepackage{graphicx}
\usepackage{titling}
\usepackage{ifthen}
\usepackage[absolute]{textpos}
\usepackage[colorlinks=true,
                       pagecolor=black,
                       menucolor=black,
                       linkcolor=black,
                       citecolor=blue,
                       pagebordercolor=1 1 1,
                       urlcolor=red,
                       plainpages=false,
                       pdfpagelabels=true,
                       bookmarksnumbered=true]{hyperref}
\usepackage{lastpage}

\newcommand{\reportTopic}{<reportTopic>}
\newcommand{\revisionNumber}{<rev. no.>}
\newcommand{\documentNumber}{<doc. no.>}


% Setup the right-hand header to display the current doc section:
%----------------------------------------------------------------------------------------------------
\renewcommand{\sectionmark}[1]{\markright{#1}}
\renewcommand{\subsectionmark}[1]{\markright{#1}}

% Setup for roman numeral page numbers until TOC:
%----------------------------------------------------------------------------------------------------
\newboolean{romanpn}

\pagenumbering{roman}
\setboolean{romanpn}{true}
\let\myTOC\tableofcontents

\renewcommand\tableofcontents{%
\myTOC
\clearpage
\pagenumbering{arabic}
\setboolean{romanpn}{false}
}

% Modify titlepage format:
%----------------------------------------------------------------------------------------------------
\setlength{\TPHorizModule}{1in}
\setlength{\TPVertModule}{\TPHorizModule}
\textblockorigin{3.25in}{1in}

\pretitle
 {
    \begin{flushright}\LARGE\sffamily 
    \thispagestyle{empty}
    \begin{textblock}{4}(0,0)
    \includegraphics[width=4in,keepaspectratio=true]{Layout/fossil.png}
    \end{textblock}
    \vspace{2in}
  }

\posttitle{\par\end{flushright}}

\preauthor{\begin{flushright} \large \sffamily \lineskip 0.5em 
\begin{tabular}[t]{c}}
\postauthor{\end{tabular} \par\end{flushright}}

\predate{\begin{flushright}\large \sffamily Document Number: \documentNumber \\ Revision Number: \revisionNumber \\}

\postdate{
\vspace{2in}
\\Pandora Products.
\\215 Uschak Road
\\Derry, PA  15627
\par\end{flushright}}

% Setup "fancy" page layout:
%----------------------------------------------------------------------------------------------------
\fancyhf{}
\setlength{\topmargin}{-1in}
\setlength{\headheight}{1in}
\setlength{\headsep}{0.5in}
\setlength{\oddsidemargin}{0.25in}
\setlength{\evensidemargin}{\oddsidemargin}
\setlength{\textwidth}{6in}
\setlength{\headwidth}{\textwidth}
\setlength{\textheight}{8.375in}
\setlength{\footskip}{0.5in}

% Setup header:
%------------------------------------------------------------------------------------------
\fancyhead[L]{\sffamily \bfseries \large Fossil Version Control\\\mdseries \reportTopic}
%\fancyhead[R]{\sffamily \bfseries \large Pandora Products\\ \mdseries \nouppercase{\rightmark}}

% Setup footer:
%------------------------------------------------------------------------------------------
\renewcommand{\footrulewidth}{0.4pt}
\fancyfoot[L]{\sffamily \bfseries \documentNumber \\ \mdseries Revision:  \revisionNumber}
\fancyfoot[C]{\sffamily \bfseries\thedate \\ }
\fancyfoot[R]{\ifthenelse{\boolean{romanpn}}{\sffamily  \thepage}{\sffamily \bfseries Page \thepage\ of \pageref{LastPage}}}

\makeatother

\usepackage{babel}
\begin{document}
\renewcommand{\documentNumber}{PAN-20100424}

\renewcommand{\reportTopic}{A Users Guide}

\renewcommand{\revisionNumber}{1.75}


\title{Fossil Version Control\\ \reportTopic}


\author{Jim Schimpf}


\date{15 September 2011}

\maketitle
\thispagestyle{empty}

\newpage{}2010 Pandora Products. This work is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License. To view a copy of this license, visit \url{http://creativecommons.org/licenses/by-sa/3.0/us/} or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. 

and\medskip{}
Pandora Products

215 Uschak Road 

Derry, PA 15627 

\medskip{}
Phone: 724.539.1276

Fax: 724.539.1276 

Web: http://www.fossil-scm.org/schimpf-book/index

Email: jim.schimpf@gmail.com

\medskip{}
Pandora Products has carefully checked the information in this document and believes it to be accurate. However, Pandora Products assumes no responsibility for any inaccuracies that this document may contain. In no event will Pandora Products be liable for direct, indirect, special, exemplary, incidental, or consequential damages resulting from any defect or omission in this document, even if advised of the possibility of such damages. 

In the interest of product development, Pandora Products reserves the right to make improvements to the information in this document and the products that it describes at any time, without notice or obligation. 

Additional Contributors
\begin{itemize}
\item Marilyn Noz - Editor
\item Wolfgang Stumvoll - Fossil Merge use and Windows use
\item javalinBCD@gmail.com - found bugs
\item arnel\_legaspi@msn.com - found bugs
\end{itemize}
\newpage{}


\section*{Document Revision History}

\textit{Use the following table to track a history of this documents revisions. An entry should be made into this table for each version of the document}.

\begin{center}
\begin{tabular}{|>{\centering}p{0.5in}|>{\centering}p{0.5in}|p{3in}|>{\centering}p{1in}|}
\hline 
Version & Author & Description & Date\tabularnewline
\hline 
0.1 & js & Initial Version & 24-Apr-2010\tabularnewline
\hline 
0.2 & js & Finishing up Single User Chapter & 27-Apr-2010\tabularnewline
\hline 
0.3 & js & Working on introduction chapter & 30-Apr-2010\tabularnewline
\hline 
0.4 & js & Adding multiuser chapter & 1-May-2010\tabularnewline
\hline 
0.5 & mn & Adding editorial corrections {[}ebf40b842a{]} & 4-May-2010\tabularnewline
\hline 
0.6 & js & Adding Command sections {[}e11399d575{]} & 8-May-2010\tabularnewline
\hline 
0.7 & js & English \& spelling corrections & 19-May-2010\tabularnewline
\hline 
0.8 & js & Spelling fixes & 30-May-2010\tabularnewline
\hline 
0.9 & ws & Using Fossil merge {[}db6c734300{]} & 2-Jun-2010\tabularnewline
\hline 
1.0 & js/ws & Put Fossil merge first in handling fork & 3-Jun-2010\tabularnewline
\hline 
1.1 & mn & Fixes in multiple user chapter {[}e8770d3172{]} & 4-Jun-2010\tabularnewline
\hline 
1.2 & js & Start advanced use chapter {[}2abc23dae5{]} & 4-Jun-2010\tabularnewline
\hline 
1.3 & mn & English corrections Chapter 1 {[}8b324dc900{]} & 5-Jun-2010\tabularnewline
\hline 
1.4 & mn & Sections 2.1 \& 2.2 corrections {[}0b34cb6f04{]} & 7-Jun-2010\tabularnewline
\hline 
1.5 & js & Move close leaf to adv use {[}2abc23dae5{]} & 7-Jun-2010\tabularnewline
\hline 
1.6 & js & Convert Advanced chapter to forks and branching & 13-Jun-2010\tabularnewline
\hline 
1.7 & js/tr & Add note about IP port usage {[}a62efa8eba{]} & 8-Jul-2010\tabularnewline
\hline 
1.71 & javelin & Check on mispelling section 1.1 {[}637d974f62{]} & 15-Sep-2011\tabularnewline
\hline 
1.72 & anon & Fix absolute path in image regs {[}d54868853b{]} & 15-Sep-2011\tabularnewline
\hline 
1.73 & anon & Fix fossil create section 2.2.5 {[}36772d90a5{]} & 15-Sep-2011\tabularnewline
\hline 
1.74 & anon & Push/Pull described incorrectly {[}1b930fced6{]} & 15-Sep-2011\tabularnewline
\hline 
1.75 & arnel & Commands might be changed  {[}4aaf1f78bb{]} & 15-Sep-2011\tabularnewline
\hline 
\end{tabular}
\par\end{center}

\newpage{}\tableofcontents{}

\listoffigures


\newpage{}


\section*{Foreward}


\section{Source Control \& Why you need it}


\subsection{What is it}

A source control system is software that manages the files in a project. A project (like this book or a software application) usually has a number of files. You then put all these files in a directory and at times subdivide even that with subdirectories. At any particular time this set of files in their present edited state make up a working version of the project. If other people are using the project you give them this and as is usually the case, they find problems and you fix them. This results in another version of the project slightly changed which goes through the cycle again. (This is why books have editions and software has versions...)

Software developers on large projects with multiple developers could see this cycle and realized they needed a tool to control the changes. With multiple developers sometimes the same file would be edited by two different people changing it in different ways or records of what got changed would be lost. It was hard to bring out a new release of the software and be sure that all the bugs were fixed and enhancements made.

A tool called Source Code Control System \cite{SCCS} was developed at Bell Labs in 1972 to track changes in files. It would remember each of the changes made to a file and store comments about why this was done. It also limited who could edit the file so conflicting edits would not be done. \cite{USE-SCCS}

\label{versioning}This was important but developers could see more was needed. They needed to be able to save the state of all the files in a project and give it a name (i.e., Release 3.14). As software projects mature you will have a released version of the software being used as well as bug reports written against it, while the next release of the software is being developed adding new features. The source control system would have to handle what are now called branches. One branch has say Version 1 which is released but continues to have fixes added to create Version 1.1, 1.2, etc. At the same time you also have another branch which contains Version 2 with new features added under construction. 

In 1986 the open source Concurrent Version Control system CVS \cite{CVS} was developed. This system could label groups of files and allow multiple branches (i.e. versions) simultaneously. There have been many other systems developed since them some open source and some proprietary.

Fossil which was originally released in 2006 \cite{FOSSIL-HOME} is a easy to install version control system that also includes a trouble ticketing system ( Figure\vref{fig:viewticket}), a wiki ( Figure \vref{sub:Wiki-Use}) and self hosted web server ( Figure\vref{fig:Starting-Webserver}). It's home page is here \url{http://www.fossil-scm.org/}.


\subsection{Why do it ?}

Why do you want to use a source control system? To use one restricts your freedom, you won't be able to create files, delete files or, move files between directories at random. Making changes in your code becomes a check list of steps that must be followed carefully.

With all those hassles why do it? The biggest answer is freedom (huh ?). By following the procedures of a source control system you gain the freedom to modify your code any way you want. How does that follow ? One of the most horrible feelings as a developer is the ``It worked yesterday'' syndrome. That is, you had code that worked just fine and now it doesn't. You have a very helpless feeling of how do you get back to working code. With a source control system and careful adherence to procedures you can just go back in time and get yesterday's code. Then, starting from known good code you can figure out what happened.

Having a source control system also gives you the freedom to experiment, ``let's try that radical new technique'', and if it doesn't work it's easy to just go back to the previous state.

The rest of this book is a user manual for the Fossil version control system that does code management and much much more. It runs on multiple OS's and is FREE. It is simple to install as it has only one executable and the repositories it creates are a single file that is easy to back up and are usually only 50\% the size of the original source.


\subsubsection{How to get it}

If this has interested you then you can get a copy of the Fossil executable here \url{http://www.fossil-scm.org/download.html}. There are Linux, Mac, and Windows executable links on this page. Also there is a source Tarball from which you can compile from source. This web site is self-hosted by Fossil itself (see Section\vref{sec:Multiple-Users}). 


\subsection{Source control description}

This next section is useful if you have not used source control systems before. I will define some of the vocabulary and explain the basic ideas of source control.


\subsubsection{Check out systems}

When describing the grandaddy of source control systems, like SCCS I said it managed the changes for a single file and also prevented multiple people from working on the same file at the same time. This is representative of a whole class of source control systems. In these you have the idea of ``checking-out'' a file so you can edit it. At the same time while other people using the system can see who is working on the file they are prevented from touching it. They can get a read-only copy so they can say build software but only the ``owner'' can edit it. When done editing the ``owner'' checks it back in then anyone else could work on on it. At the same time the system has recorded who had it and the changes made to it.

This system works well in small groups with real time communication. A common problem is that a file is checked out by some one else and \textbf{you} have to make a change in it. In a small group setting, just a shout over the cube wall will solve the problem. 


\subsubsection{Merge systems}

In systems represented by CVS or Subversion the barrier is not getting a file to work on but putting it back under version control. In these systems you pull the source code files to a working directory in your area. Then you edit these files making necessary changes. When done you commit or check them back into the repository. At this point they are back under version control and the system knows the changes from the last version to this version.

This gets around the problem mentioned above when others are blocked from working on a file. You now have the opposite problem in that more than one person can edit the same file and make changes. This is handled by the check-in process. There only one person at a time may check in a file. That being the case the system checks the file and if there are changes in repository file that are NOT in the one to be checked in stops the check in process. The system will ask if the user wants to merge these changes into his copy. Once that is done the new version of the file can be checked in.

This type of system is used on large projects like the Linux kernel or other systems where you have a large number of geographically distributed contributors.


\subsubsection{Distributed systems}

The representatives of two major systems we have described thus far are centralized. That is there is only one repository on a single server. When you get a copy of the files or check in files it all goes to just one place. These work and can support many, many users. A distributed system is an extension of this where it allows the repositories to be duplicated and has mechanisms to synchronize them. 

With a single server users of the repository must be able to connect to it to get updates and for check ins of new code. If you are not connected to the server you are stuck and cannot continue working. Distributed systems allow you to have your own copy of the repository then continue working and when back in communication synchronize with the server. This is very useful where people take their work home and cannot access the company network. Each person can have a copy of the repository and continue working and re-sync upon return to the office.


\subsubsection{Common Terms}

The following is a list of terms I will use when talking about version control or Fossil.
\begin{description}
\item [{Repository}] This is the store when the version controlled files are kept. It will be managed by a source control system
\item [{SCS}] Source control system, this is software that manages a group of files keeping track of changes and allowing multiple users to modify them in a controlled fashion
\item [{Commit}] In Fossil to store the current set of new and changed files into the repository.
\item [{Trunk}] The main line of code descent in a Fossil repository.
\item [{Branch}] A user defined split in the files served by an SCS. This allow multiple work points on the same repository. Older branches (versions) might have bug fixes applied and newer branches (versions) can have new features added.
\item [{Fork}] In Fossil an involuntary split in the code path, occurs when a file in the repository has changes not in a file to be committed.
\end{description}

\section{\label{sec:Single-User-Fossil}Single User Fossil Use}


\subsection{Introduction}

If you have read this far and are at least persuaded to try, you will want to put one of your projects under software control using Fossil. This chapter is set up to lead you through that task and show you how to adapt your development to using this tool. The assumption is made in this section that you will be the only person using the repository, you are the designer, developer, and maintainer of this project. After you are comfortable using the tool, the next section will show how you use it when you have multiple people working on a project.


\subsection{Creating a repository }


\subsubsection{Introduction}

In the spirit of ``eating one's own dog food'' we will use this book as the project we are going to manage with Fossil. The book is a directory of text files (we are writing it using \LyX{} \cite{LyX}) and my working area looks like this:
\begin{lyxcode}
{\scriptsize FOSSIL/}{\scriptsize \par}
\begin{lyxcode}
{\scriptsize This~directory~holds~all~my~Fossil~repositories}{\scriptsize \par}
\end{lyxcode}
{\scriptsize FossilBook/}{\scriptsize \par}
\begin{lyxcode}
{\scriptsize outline.txt~~~~-~Book~design}{\scriptsize \par}

{\scriptsize fossilbook.lyx~-~The~book}{\scriptsize \par}

{\scriptsize Layout}{\scriptsize \par}
\begin{lyxcode}
{\scriptsize fossil.png~~-~The~Fossil~logo~(image~on~title~page)}{\scriptsize \par}
\end{lyxcode}
{\scriptsize Research}{\scriptsize \par}
\begin{lyxcode}
{\scriptsize fossilbib.bib~-~Working~bibliography}{\scriptsize \par}

{\scriptsize History}{\scriptsize \par}
\begin{lyxcode}
{\scriptsize CVC-grune.pdf~-~Historical~paper~about~CVS}{\scriptsize \par}

{\scriptsize RCS-A~System~for~Version~Control.webloc~-~RCS~bookmark}{\scriptsize \par}

{\scriptsize SCCS-Slideshow.pdf~-~Historical~paper~about~SCCS}{\scriptsize \par}

{\scriptsize VCSHistory~-pysync~...~.webloc~-~History~of~version~control}{\scriptsize \par}
\end{lyxcode}
\end{lyxcode}
\end{lyxcode}
\end{lyxcode}
This took just an hour or so to start preliminary research and build the framework. Since that's about all I'm going to do today I want to build a repository and put all this stuff under Fossil control.


\subsubsection{Create Repository}

I have a directory called FOSSIL in which I keep all my repositories, Fossil doesn't care but it helps me to keep them all in one place so I can back them up. First I need to create a new repository for the book. This is done using the command line after I move into the Fossil book directory.
\begin{lyxcode}
{\scriptsize }
\begin{figure}[H]
\begin{lyxcode}


{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~new~../FOSSIL/FossilBook.fossil}{\scriptsize \par}

{\scriptsize project-id:~2b0d35831c1a5b315d74c4fd8d532b100b822ad7}{\scriptsize \par}

{\scriptsize server-id:~~0149388e5a3109a867332dd8439ac7b454f3f9dd}{\scriptsize \par}

{\scriptsize admin-user:~jim~(initial~password~is~\textquotedbl{}}\textbf{\scriptsize ec3773}{\scriptsize \textquotedbl{})}{\scriptsize \par}
\end{lyxcode}
\caption{Create Repository\label{fig:Create-Repository}}


\end{figure}
{\scriptsize \par}
\end{lyxcode}
I create my repositories with the extension .fossil, this will be useful later with the server command (See Figure \vref{fig:server-detail}). When the create happened it assigned an initial password with an admin user of ``jim'' (i.e., me). 


\subsubsection{Connect Repository}

The repository is created but is empty and has no connection to the book directory. The next step is to open the repository to the book directory with the \textbf{open} command.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~open~../FOSSIL/FossilBook.fossil}{\scriptsize{}~}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~status}{\scriptsize \par}

{\scriptsize repository:~~~/Users/jschimpf/Public/FOSSIL/FossilBook.fossil}{\scriptsize \par}

{\scriptsize local-root:~~~/Users/jschimpf/Public/FossilBook/}{\scriptsize \par}

{\scriptsize server-code:~~0149388e5a3109a867332dd8439ac7b454f3f9dd}{\scriptsize \par}

{\scriptsize checkout:~~~~~279dfecd3f0322f236a92a9a8f3c96acf327d8c1~2010-04-25~12:40:39~UTC}{\scriptsize \par}

{\scriptsize tags:~~~~~~~~~trunk}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~extra}{\scriptsize \par}

{\scriptsize Layout/fossil.png}{\scriptsize \par}

{\scriptsize Research/History/CVS-grune.pdf}{\scriptsize \par}

{\scriptsize Research/History/RCS\textemdash{}A~System~for~Version~Control.webloc}{\scriptsize \par}

{\scriptsize Research/History/SCCS-Slideshow.pdf}{\scriptsize \par}

{\scriptsize Research/History/VCSHistory~-~pysync~-~....webloc}{\scriptsize \par}

{\scriptsize Research/fossilbib.bib}{\scriptsize \par}

{\scriptsize fossilbook.lyx}{\scriptsize \par}

{\scriptsize outline.txt}{\scriptsize \par}
\end{lyxcode}
\caption{Open Repository \& Check}


\end{figure}


The \textbf{open} command seemingly did nothing but checking with the \textbf{status} command shows the repository, the directory it's linked to and that we are hooked to the trunk of the store. 

The \textbf{extra} command shows all the files in the directory that are NOT under control of Fossil. In this case that's all of them since we have not checked in anything.


\subsubsection{Add and Initial Commit}

I must now add all the relevant files into the repository with the \textbf{add} command. The Fossil add is recursive so if I add the top level files it will automatically recurse into the subdirectories like Layout and Research and get those files too. Before you do an add it pays to tidy up your directory so you don't accidentally add a bunch of transient files (like object files from a compile). It's easy to remove them later but a little tidying before hand can save you some work.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~add~.}{\scriptsize \par}

{\scriptsize ADDED~~Layout/fossil.png}{\scriptsize \par}

{\scriptsize ADDED~~Research/History/CVS-grune.pdf}{\scriptsize \par}

{\scriptsize ADDED~~Research/History/RCS\textemdash{}A~System~for~Version~Control.webloc}{\scriptsize \par}

{\scriptsize ADDED~~Research/History/SCCS-Slideshow.pdf}{\scriptsize \par}

{\scriptsize ADDED~~Research/History/VCSHistory~-~pysync~....webloc}{\scriptsize \par}

{\scriptsize ADDED~~Research/fossilbib.bib}{\scriptsize \par}

{\scriptsize fossil:~cannot~add~\_FOSSIL\_}{\scriptsize \par}

{\scriptsize ADDED~~fossilbook.lyx}{\scriptsize \par}

{\scriptsize ADDED~~outline.txt}{\scriptsize \par}
\end{lyxcode}
\caption{Initial file add}
\end{figure}


I simply told fossil to do an add of the current directory (.) so it got all those files and all the files in the subdirectory. Note the \_FOSSIL\_ that it didn't add. This is the tag file that fossil keeps in a directory so it knows what repository it belongs to. Fossil won't add this file since it manages it, but everything else is fair game.

One final thing before I can quit for the day, these files have been added or rather they will be added to the repository when I commit it. That must be done and then we can relax and let Fossil manage things. 

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~commit~-m~\textquotedbl{}Initial~Commit\textquotedbl{}}{\scriptsize \par}

{\scriptsize New\_Version:~8fa070818679e1744374bc5302a621490276d739}{\scriptsize \par}
\end{lyxcode}
\caption{Initial Commit}


\end{figure}


I added a comment on the commit and it's a good idea to always do this. When later we see the timeline of the commits you will have notes to tell you what was done.


\subsubsection{Fossil start up summary}
\begin{itemize}
\item \textbf{fossil new <name> }Creates a new fossil repository
\item \textbf{fossil open <repository> }While in a source directory connects this directory to the fossil repository
\item \textbf{fossil add .} Will add (recursively) all the files in the current directory and all subdirectories to the repository
\item \textbf{fossil commit -m ``Initial Commit''} Will put all the currently added files into the repository.
\end{itemize}

\subsection{Set Up User interface}

One of the surprising features of Fossil is the webserver. This allows it to have a GUI type user interface with no operating system specific code, the GUI is the web browser supplied by your OS. In the previous steps I checked my project in to a Fossil repository, next I have to prep the web interface for production use. 
\begin{description}
\item [{NOTE}] The Fossil web server uses port 8080 instead of the standard port 80 for all HTTP access. When run it will automatically start your Web browser and open the repository home page. Unfortunately my book work is done on a machine that already has Apache running on port 8080 so I will be using port 8081. I will always have to add an extra parameter on the UI command line to do this.
\end{description}
\begin{figure}[H]
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\footnotesize fossil~ui~-port~8081}{\footnotesize \par}
\end{lyxcode}
\caption{\label{fig:Starting-Webserver}Starting Webserver}
\end{figure}

\begin{description}
\item [{NOTE:}] Newer versions of Fossil automatically find an open port and will give a message on the command line telling you what port number is used. You can still use the -port option if you want to control the port \#.
\end{description}
This shows how it's started, as you can see I have picked port 8081 since I am locked out of port 8080. When I do this my browser starts and I am presented with the following home page.

\begin{figure}[H]
\noindent \begin{raggedright}
\includegraphics[scale=0.6]{Images/Single_user/initial_page}
\par\end{raggedright}

\caption{\label{fig:Initial-Webserver-page}Initial Webserver page}


\end{figure}


Following the advice on the page I go to \textbf{setup/config}. I am going to do the minimum setup that you should do on all projects. As you get familiar with Fossil you will probably have many more things that you will customize for your taste but what follows are the only things you HAVE to do.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/config_initial}

\caption{\label{fig:Initial-Configuration}Initial Configuration}


\end{figure}


I have entered in a project name and put in a description, the project name will be the name of the initial Wiki page (see \vref{sub:Wiki-Use}) and the description is useful for others to see what you are doing here. Then I go to the bottom of the page and pick the \textbf{Apply Changes }button.

Next I pick the Admin tab (you can see it in the header bar) and the pick Users from that page. I am presented with the users and will use this to set the password of the project.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/user_config}

\caption{\label{fig:User-Configuration}User Configuration}


\end{figure}


As you can see Fossil automatically configures a number of users beyond just the creator. The anonymous user you have already seen if you went to the Fossil web site to download the code. This user can view and get code but cannot commit code. On the right side of the page are the many options you can give to a user, it's worth reading it all when you set up your repository. The important one is me (jim) which has ``s'' or Super User Capabilities. This means I can do anything with the repository.

I will now edit the user Jim to make sure it has the settings I want. In this case you MUST set the password. Remember way back where Fossil set it during the create (Figure\vref{fig:Create-Repository}), it's a very good idea to change this to something you can remember rather than the original random one.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/jim_setup}

\caption{Super User Setup}


\end{figure}


I have put in my contact information (e-mail address) and while you cannot see it I have typed in a password that I will remember. Then I applied the changes.

Now the repository is ready for further work, it's rather bare bones at this point but the most important things are set up.


\subsubsection{User interface summary}
\begin{itemize}
\item \textbf{fossil ui} run in the source directory will start a browser based user interface to fossil.
\item \textbf{fossil ui -port <IP port \#>} Can be used if port 8080 if already in use on your system.
\item On the first run it is important to configure your project with a name and set the password for yourself.
\end{itemize}

\subsection{Update Repository}

After writing the above section of the book I now have created a bunch of new files and changed some of the existing files in the repository. Before quitting for the day I should add these new files into the repository and commit the changes saving this milestone in the project.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~extra}{\scriptsize \par}

{\scriptsize \#fossilbook.lyx\#}{\scriptsize \par}

{\scriptsize Images/Single\_user/config\_initial.epsf}{\scriptsize \par}

{\scriptsize Images/Single\_user/initial\_page.epsf}{\scriptsize \par}

{\scriptsize Images/Single\_user/jim\_setup.epsf}{\scriptsize \par}

{\scriptsize Images/Single\_user/user\_config.epsf}{\scriptsize \par}

{\scriptsize fossilbook.lyx\textasciitilde{}}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~status}{\scriptsize \par}

{\scriptsize repository:~~~/Users/jschimpf/Public/FOSSIL/FossilBook.fossil}{\scriptsize \par}

{\scriptsize local-root:~~~/Users/jschimpf/Public/FossilBook/}{\scriptsize \par}

{\scriptsize server-code:~~0149388e5a3109a867332dd8439ac7b454f3f9dd}{\scriptsize \par}

{\scriptsize checkout:~~~~~8fa070818679e1744374bc5302a621490276d739~2010-04-25~13:09:02~UTC}{\scriptsize \par}

{\scriptsize parent:~~~~~~~279dfecd3f0322f236a92a9a8f3c96acf327d8c1~2010-04-25~12:40:39~UTC}{\scriptsize \par}

{\scriptsize tags:~~~~~~~~~trunk}{\scriptsize \par}

{\scriptsize EDITED~~~~~fossilbook.lyx}{\scriptsize \par}


\end{lyxcode}
\caption{Project Status}


\end{figure}


I run \textbf{fossil extra} to see these new files. The image files (those in Images/Single\_user) I want to add, the other two files, \#fossilbook.lyx\# and fossilbook.lyx\textasciitilde{}, I don't want to add since they are temporary artifacts of \LyX{}. I also ran \textbf{fossil status}. This shows changes to files that are already in the repository. There the only file changed is the book text itself, \textbf{fossilbook.lyx}.

All I have to do now is add in the directory Images which will add in the image files I want in the repository. Then I commit the changes to the repository and we can move on to other tasks of the day.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~add~Images}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/config\_initial.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/initial\_page.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/jim\_setup.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/user\_config.epsf}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~commit~-m~\textquotedbl{}Initial~setup~with~pictures\textquotedbl{}}{\scriptsize \par}

{\scriptsize New\_Version:~a2d12bf532a089ee53578e3e17c6e732c0442f49}{\scriptsize \par}
\end{lyxcode}
\caption{\label{fig:Update-for-new}Update for new files}


\end{figure}


After doing this commit I can bring up the Fossil ui (see Figure \vref{fig:Starting-Webserver}) and view the project Timeline by picking that tab on the Fossil header. We get this:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/timeline}

\caption{Timeline}


\end{figure}


You can see all my check-ins thus far and you can see after the check-in from Figure \vref{fig:Update-for-new} I did another check-in because I missed some changes in the outline. The check-ins are labeled with the first 10 digits of their hash value and these are active links which you can click to view in detail what was changed in that version. 

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/timeline_detail}

\caption{Timeline Detail\label{fig:Timeline-Detail}}
\end{figure}


I clicked on the very last check-in (the \textbf{LEAF) }and the display is shown above. There are many things you can do at this point. From the list of changed files you can pick the diff link and it will show in text form the changes made in that particular file. The ``Other Links'' section has a very useful ZIP Archive. Clicking this will download a ZIP of this version to your browser. You will find this useful if you want to get a particular version, in fact this is normally how you get a new version of Fossil from the \url{http://www.fossil-scm.org/}. The edit link will be used later to modify a leaf.


\subsubsection{Update Summary}
\begin{itemize}
\item \textbf{fossil status} and \textbf{fossil extra} will tell you the updated files and files not in the repository before you commit.
\item \textbf{fossil commit - m ``Commit comment'' }Commits a change (or changes). It is very important to have a descriptive comment on your commit.
\end{itemize}

\subsection{Tickets}

Besides managing your code Fossil has a trouble ticket system. This means you can create a ticket for a problem or feature you are going to add to your system then track your progress. Also you can tie the tickets to specific check-ins of your files. For software this is very useful for bug fixes and feature additions. For example you can look for a bug in the ticket list then have it take you to the change that fixed the problem. Then you know exactly what you did and not have to be confused by other changes you might have made.

When you pick Tickets it will bring up this window. You can create a new ticket, look at the list, or generate a new report. Keeping things simple I will just use the All Tickets list for now.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/ticket_initial}

\caption{Initial Ticket Window}


\end{figure}


Picking ``New Ticket'' I get a form that I fill out like so:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/ticket_form}

\caption{Ticket Form}


\end{figure}


Pretty simple actually. You can put as much or as little detail in here as you wish, but remember this stuff might be really vital 6 weeks or 6 months from now so think of what you would want to know then. When I press Submit I get this showing what I entered.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/ticket_submit}

\caption{Viewing a Ticket}


\end{figure}


Finally picking Tickets then ``All Tickets'' I can see my new ticket in the list marked as Open and in a distinctive color. 

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/ticket_list}

\caption{\label{fig:viewticket}Ticket List with open ticket}


\end{figure}


I try, in handling tickets, to have links from ticket to the commit that addressed the problem and a link from the commit back to the offending ticket. This way looking at the ticket I can get to the changes made and from the timeline I can get the the ticket and its resolution. To do this I will make sure and put the 10 digit hash label from the ticket into the check-in comment and put a link in the resolved ticket to the check-in.

Since I have now written the chapter and put in all these images of what to do I can now add in all the new images to the repository and check this in as another completed operation. And I do that like this:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~add~Images/Single\_user}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/config\_initial.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/initial\_page.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/jim\_setup.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/ticket\_form.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/ticket\_initial.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/ticket\_list.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/ticket\_submit.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/timeline.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/timeline\_detail.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/user\_config.epsf}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~commit~-m~\textquotedbl{}{[}1665c78d94{]}~Ticket~Use\textquotedbl{}}{\scriptsize \par}
\end{lyxcode}
\caption{\label{fig:checkin}Ticket resolving check-in}


\end{figure}


First I added in all the new image files. I am lazy and just told it to add in all the files in the Single\_user directory. I have previously added some of those like \textbf{config\_initial.epsf} but Fossil is smart and knows this and won't add that one twice. Even though it shows it ADDED, it really didn't.

The commit line is very important, as you can see I put 10 digit hash code for the ticket in brackets in the comment. As we will see in the Wiki section this is a link to the Ticket, so when viewing the comment in the Timeline or elsewhere you can click the bracketed item and you would go to the ticket.

Now that I have the items checked in I have to close the ticket. I do that by clicking on its link in the ticket list, that will go the the View Ticket window as shown in Figure \vref{fig:viewticket}. From there I pick edit and fill it in as shown:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/ticket_done}

\caption{Ticket Finish}


\end{figure}


I mark it as ``Closed''. If you have code you can mark this as fixed, tested, or a number of other choices. Another very important step, I brought up the Timeline and copied the link for the commit I had just done in Figure \vref{fig:checkin}. By doing this my ticket is now cross linked with the commit and the commit has a link back to the ticket.


\subsubsection{Ticket Summary}
\begin{itemize}
\item Tickets are a useful way of reminding you what needs done or bugs fixed
\item When you commit a change that affects a ticket put the 10 digit hash label of the ticket into the commit comment surrounded by brackets, e.g. {[}<10 digit hash>{]} so you can link to the ticket
\item When you close the ticket put in the hash label of the commit that fixed it.
\end{itemize}

\subsection{\label{sub:Wiki-Use}Wiki Use}

As we saw in Figure \vref{fig:Starting-Webserver} Fossil has a browser based user interface. In addition to the pages that are built in you can add pages to web site via a wiki. This allows you to add code descriptions, user manuals, or other documentation. Fossil keeps all that stuff in one place under version control. A wiki is a web site where you can add pages and links from within your browser. You are given an initial page then if you type {[}newpage{]} this text will turn into a link and if clicked will take you to a new blank page. Remember in Figure \vref{fig:Initial-Webserver-page} that is the initial page for your project and from there you can add new pages. These pages are automatically managed by the Fossil version control system; you don't have to add or commit.

Since I did the setup on repository (see Figure \vref{fig:Initial-Configuration}) the home page has changed to this:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/wiki_blankhome}

\caption{Blank Home Page}


\end{figure}


Not very helpful so the in rest of this chapter I will use the Wiki functions of Fossil to make this more useful. If I pick the Wiki item from the menu bar I get:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/wiki_page}

\caption{\label{fig:Wiki-controls}Wiki controls}


\end{figure}


These are the controls that let you control and modify the wiki. Most important for now is the Formatting rules link. This link takes you to a page that describes what you can do to format a wiki page. If you just type text on a page it will appear but be formatted by your browser. You can type HTML commands to control this formating. It's worth your time to carefully read this page and note what you can and cannot do. The page just lists the valid HTML commands, and if you don't know what they mean I would suggest you find a page like this \url{http://www.webmonkey.com/2010/02/html_cheatsheet/} and keep it handy. 

Besides the HTML markup the most powerful command for the Wiki is {[}page{]} where it links to a new page. This is how you add pages and how you build your web site of documentation for the repository.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/wiki_formating}\caption{Wiki Formating}


\end{figure}


I now begin work. What I want to do is change the home page to be non-empty and also put a link on the home page to the PDF of this book. In Figure \vref{fig:Wiki-controls} I click on the first item, the FossilBook home page. This takes me to the home page again but now I have an Edit option. We also have a History option so I could look at older versions of the page. 

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/wiki_homeedit}

\caption{Home page with edit}


\end{figure}


This shows my initial edit and a preview:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/wiki_home}

\caption{Initial Home page}


\end{figure}


The bottom section is an edit window where I type things I want displayed and the top is a preview of what the page will be. As you can see I typed some simple HTML to make a large and centered title. The body of the text I just typed and as you see the browser fits the text to the screen. You can have multiple paragraphs by just putting blank lines between your text. Next I wanted a bulleted list and this is done by typing two spaces, a '{*}' then two more spaces. On each of these lines I have a link to a new (not yet created page). If you look I put these in the form {[} <new page> | <title> {]}. This way I can have a long string that describes the link but have a nice short (no embedded spaces) page name. 

One mistake I usually make at this point is to click one of those new links which takes me to a new blank page. \textbf{OOPS}, if I have not saved this page yet then I find I've lost my changes so far. 

OK, I will save my changes and then go to the new pages. I am doing some complicated things here. The first link is to the book PDF. This will be a file I create in the repository. The \LyX{} program I'm using creates the PDF. I will do that, save it, and add it to the repository. But I don't want to link to a static file, that is I want the most current version of the PDF, the one I save each time I quit for the day. To do this we have to put in a link that looks like this:
\begin{lyxcode}
{[}http:doc/tip/FossilBook.pdf~|~Book~(pdf)~{]}
\end{lyxcode}
This is a special link the Fossil wiki understands, \textbf{doc }says this is documentation. \textbf{tip }says use the most current version; you could put a version link here. And finally since I am going to put the book PDF at the top level I only need the file name. If it was in a subdirectory I would have to say \textbf{doc/tip/subdir/filename. }

The second link is just to a regular page and I can just edit that one just like I did this the main page.


\subsubsection{Wiki Summary}
\begin{itemize}
\item Format your text using HTML commands like <h1>Title</h1> for page headings
\item Create and link pages using {[} <page> | <Link text> {]}
\item The page designation http:doc/tip/<document path relative to repository> will display any document in the repository that your browser can handle (i.e. pdf, http etc)
\item Never click on a link till AFTER you have saved the page
\end{itemize}

\section{\label{sec:Multiple-Users}Multiple Users}


\subsection{Introduction}

In the previous chapter I went through using Fossil with just one user (me). In this chapter we will get into using it with multiple users. Thanks to Fossil's distributed design once the set up is done using it is not much different than the single user case with Fossil managing automatically the multiple user details.


\subsection{Setup}

In the previous chapter the Fossil repository was a file on our system and we did commits to it and pulled copies of the source from it. Fossil is a distributed source control system; what this means is that there is a master repository in a place that all users can access. Each user has their own ``cloned'' copy of the repository and Fossil will automatically synchronize the users repository with the master. From a each user's perspective you have your local repository and work with it using the same commands shown in Chapter \ref{sec:Single-User-Fossil}. It's just that now Fossil will keep your repository in sync with the master.


\subsubsection{Server Setup\label{sub:Server-Setup}}

I have the FossilBook.fossil repository and now have to put it in place so multiple users can access it. There are two ways, the first is using fossil's built in webserver to host the file and the second is using the operating systems supported web server (if present) and a cgi type access.


\paragraph{Self hosted}

This is quite simply the easiest way to do it. The downside is that you are responsible for keeping the machine available and the webserver up. That is, don't turn the machine off when you quit for the day or some other user is going to be upset. All I have to do is this:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:/Users/jschimpf/Public{]}~jim\%~cd~FOSSIL/}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FOSSIL{]}~jim\%~}\textbf{\scriptsize fossil~ui~-port~8081~FossilBook.fossil~\&}{\scriptsize{}~}{\scriptsize \par}

{\scriptsize {[}1{]}~310}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FOSSIL{]}~jim\%~}{\scriptsize \par}
\end{lyxcode}
\caption{Self-hosted Fossil repository}


\end{figure}


This is on UNIX system, the ``\&'' at then end of the second line runs the fossil webserver in the background. If I know this machine has an IP address of 192.168.1.200 then from any other machine in the network I can say:

\textbf{http://192.168.1.200:8081} to the browser and I can access the Fossil web server. 

As you can see this is simple and works on any system that runs Fossil. As long as you carefully make sure it's always running and available for others this can be a very easy way to make the master repository available. 

The problems with this method are:
\begin{enumerate}
\item If you have multiple repositories you have to use the \textbf{server} not the \textbf{ui} command, have all your repositories in the same directory, and have them all use the extension .fossil.
\item If the machine goes off line (i.e. for OS update) or other reason it might not automatically restart the Fossil servers.
\item Backup of the repositories might be not be done.
\end{enumerate}
This method does work, and if you only have one repository and a diligent owner of the master machine, it will work and work well.


\paragraph{Server hosted}

If you have a server type machine available (i.e., a Linux or UNIX box) that is running Apache or a Windows machine running IIS you can let it be the webserver for your repository. This has a number of advantages: this machine will be up all the time, it will probably be automatically backed up, and it can easily support multiple Fossil repositories.

I am not going into how to set up the webserver or how to enable (Common Gateway Interface) CGI. See the following sites.
\begin{itemize}
\item For IIS see here \url{http://www.boutell.com/newfaq/creating/iiscgihowto.html} and just ensure that your fossil.exe is in the path to be run by the cgi script.
\item For Apache see here \url{http://httpd.apache.org/docs/2.0/howto/cgi.html} and ensure you know the directory where the CGI scripts are stored.
\end{itemize}
If you are not in control of the webserver you will need the help of the server admin to enable CGI and to copy your CGI scripts to correct location.


\paragraph{CGI Script for hosted server}

If we assume an Apache server and, in my case, the cgi directory path is /Library/Webserver/CGI-Executables, then we have to write a script of the form:

\begin{figure}[H]
\begin{lyxcode}
\#!<Fossil~executable~location>

repository:~<Fossil~repository~location>
\end{lyxcode}
\caption{Fossil CGI script}


\end{figure}


and put it into the cgi script directory. I have put my Fossil executable into /usr/local/bin and I am putting my Fossil shared repository into /Users/Shared/FOSSIL. My script then becomes:

\begin{figure}[H]
\begin{lyxcode}
\#!/usr/local/bin/fossil

\#~Put~the~book~repository~on~the~web

repository:~/Users/Shared/FOSSIL/Fossilbook.fossil
\end{lyxcode}
\caption{My Fossil CGI script}


\end{figure}


After making the script I then copy it to the CGI directory and allow anyone to execute it.
\begin{lyxcode}

\end{lyxcode}
\begin{figure}[H]
\begin{lyxcode}
\textbf{\scriptsize sudo~cp~Book.cgi~/Library/Webserver/CGI-Executables/Book.cgi}{\scriptsize \par}



\textbf{\scriptsize sudo~chmod~a+x~/Library/Webserver/CGI-Executables/Book.cgi}{\scriptsize \par}
\end{lyxcode}
\caption{Copying script into place}


\end{figure}



\subsubsection{The test (either self hosted or server hosted)}

If all is in place then I should be able to access the webserver and get to this:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Multiple_user/test_access}

\caption{\label{fig:Web-access-to}Web access to Fossil CGI hosted site}
\end{figure}



\subsection{User Accounts}

Serving a repository, either self hosting or the more complicated CGI method gets you to the same place as shown in Figure \vref{fig:Web-access-to}. Now I have to set up user accounts for the other contributors to this book. Remember Fossil has automatically created an Anonymous user (see Figure \vref{fig:User-Configuration}) thus others can access the site in a limited way, that is they can download the book but cannot commit changes. In this case I want to create a new account (Marilyn) that can make changes and commit changes as she is my editor.

To accomplish all this first I have to login by going to the log in page and entering my ID (jim) and my password. Now since I'm super-user I then go back to the User-Configuration page, Figure \eqref{fig:User-Configuration} and add a new user:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Multiple_user/mul_new_user}

\caption{New Editor user\label{fig:New-Editor-user}}


\end{figure}


Since she is going to be an editor, this will be similar to a developer if we were doing code, so I picked the Developer privilege level. This way she can get the repository, check-in, check-out, and write and update tickets. I also added the attachments since she might need that to put on an image or other comment on actions she is doing. I also gave her a password so her access can be secured.

I could add other users at this point but don't need any others for this project, but you can see how easily this can be done. When you assign the user privileges just read carefully and don't give them any more than you think they need. If they have problems, you can easily modify their account in the future.


\subsection{Multiple User Operation}

With the server set up and the user established the next thing to do is clone the repository. That is make copy from the webserver repository to my local machine. Once that is done this local repository uses the same commands and is very much like single user use discussed in Section \vref{sec:Single-User-Fossil}. Fossil will synchronize your local repository with the one on the server.


\subsubsection{Cloning}

To clone a Fossil repository you have to know four things:
\begin{enumerate}
\item It's web address, for our repository it is \textbf{http://pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}
\item Your account name in my case it's \textbf{jim}
\item Your password (which I'm keeping to myself thank you...)
\item The local name of the repository, in this case I'm calling it Fossilbook.fossil
\end{enumerate}
You then go to where you want to keep the Repository (in my case the FOSSIL directory) and use the clone command:

\begin{figure}[H]
\begin{lyxcode}
{\tiny {[}Pandora-2:jschimpf/Public/FOSSIL{]}}\textbf{\tiny{}~fossil~clone~http://jim:}{\tiny <passwd>}\textbf{\tiny @pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi~FossilBook.fossil}{\tiny \par}

\textbf{\scriptsize \#\#\#~NOTE:~<passwd>~}{\scriptsize -~Stands~in~for~real~password}{\scriptsize \par}



{\scriptsize{}~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\scriptsize \par}

{\scriptsize Send:~~~~~~~~~~~~~~49~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Received:~~~~~~~~~120~~~~~~~~~~2~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Send:~~~~~~~~~~~~~625~~~~~~~~~25~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Received:~~~~~~~~4704~~~~~~~~~72~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Send:~~~~~~~~~~~~3104~~~~~~~~~72~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Received:~~~~~5129052~~~~~~~~131~~~~~~~~~10~~~~~~~~~~5}{\scriptsize \par}

{\scriptsize Send:~~~~~~~~~~~~2399~~~~~~~~~51~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Received:~~~~~4381170~~~~~~~~116~~~~~~~~~22~~~~~~~~~28}{\scriptsize \par}

{\scriptsize Total~network~traffic:~4117~bytes~sent,~6913068~bytes~received}{\scriptsize \par}

{\scriptsize Rebuilding~repository~meta-data...}{\scriptsize \par}

{\scriptsize 65~(100\%)...}{\scriptsize \par}

{\scriptsize project-id:~2b0d35831c1a5b315d74c4fd8d532b100b822ad7}{\scriptsize \par}

{\scriptsize server-id:~~3e67da6d6212494456c69b1c5406a277d7e50430}{\scriptsize \par}

{\scriptsize admin-user:~jim~(password~is~\textquotedbl{}d07222\textquotedbl{})}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FOSSIL{]}~jim\%~}{\scriptsize \par}
\end{lyxcode}
\caption{Clone command}


\end{figure}


At this point I can go through the steps outlined in Section \vref{sec:Single-User-Fossil} to set my user password and then open the Fossil Repository on a working directory.

Now that I've moved everything to the new cloned repository I do a check in a the end of the day which looks like this:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~commit~-m~\textquotedbl{}Moved~to~clone~repository\textquotedbl{}}{\scriptsize \par}

{\scriptsize Autosync:~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}{\scriptsize \par}

{\scriptsize Bytes~Cards~Artifacts~Deltas}{\scriptsize \par}

{\scriptsize Send:~130~1~0~0}{\scriptsize \par}

{\scriptsize Received:~2990~65~0~0}{\scriptsize \par}

{\scriptsize Total~network~traffic:~334~bytes~sent,~1876~bytes~received}{\scriptsize \par}

{\scriptsize New\_Version:~158492516c640d055bc0720684a05e797b88165a}{\scriptsize \par}

{\scriptsize Autosync:~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}{\scriptsize \par}

{\scriptsize Bytes~Cards~Artifacts~Deltas}{\scriptsize \par}

{\scriptsize Send:~618798~74~1~2}{\scriptsize \par}

{\scriptsize Received:~3222~70~0~0}{\scriptsize \par}

{\scriptsize Send:~268138~73~1~0}{\scriptsize \par}

{\scriptsize Received:~3221~70~0~0}{\scriptsize \par}

{\scriptsize Send:~3977~72~0~1}{\scriptsize \par}

{\scriptsize Received:~3220~70~0~0}{\scriptsize \par}

{\scriptsize Total~network~traffic:~457995~bytes~sent,~6011~bytes~received}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}{\scriptsize \par}
\end{lyxcode}
\caption{\label{fig:Cloned-repository-checkin}Cloned repository checkin}


\end{figure}


As you see the files were committed locally and then the local repository was automatically synchronized with the repository on the server.


\subsubsection{Keeping in sync}

After doing all the setup described above I now have a distributed source control system. My co-worker, Marilyn has also cloned the repository and begun work. She is editing the book correcting my clumsy phrasing and fixing spelling mistakes. She is working independently and on the same files I use. We must use Fossil to prevent us from both modifying FossilBook.lyx but in different ways. Remember Fossil has no file locking, there is nothing to prevent her from editing and changing the file while I work on it.

This is where we both must follow procedures to prevent this sort of problem. Even though she edits files I cannot see the changes till they are committed. Two different versions of the same file won't be a problem till I try to commit with my version and her version is in the current leaf.

\label{There-are-two}There are two problems:
\begin{enumerate}
\item Before I do any work I must be sure I have the current versions of all the files.
\item When I commit I must make sure what I am committing has only my changes and is not stepping on changes she has done.
\end{enumerate}
The first is pretty obvious, make sure you have the latest before you do anything. We do that with the update command. In Figure \ref{fig:Cloned-repository-checkin} I had done my latest check in. Before starting any more work I should ensure that Marilyn hasn't checked in something else. I could check the timeline but instead I'll do an update to my repository and source files. When I do the update I specify it should be updated from the \textbf{trunk. }This ensures I get it from the latest and greatest not some branch.

\begin{figure}
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~update~trunk}{\scriptsize \par}

{\scriptsize Autosync:~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}{\scriptsize \par}

{\scriptsize Bytes~Cards~Artifacts~Deltas}{\scriptsize \par}

{\scriptsize Send:~130~1~0~0}{\scriptsize \par}

{\scriptsize Received:~3588~78~0~0}{\scriptsize \par}

{\scriptsize Send:~365~6~0~0}{\scriptsize \par}

{\scriptsize Received:~136461~83~2~3}{\scriptsize \par}

{\scriptsize Total~network~traffic:~796~bytes~sent,~131582~bytes~received}{\scriptsize \par}

{\scriptsize UPDATE~fossilbook.lyx}{\scriptsize \par}

{\scriptsize UPDATE~fossilbook.pdf}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}~
\end{lyxcode}
\caption{Update action}


\end{figure}


Ah ha ! Marilyn has been at work and updated the book source and pdf. If I check the timeline from the webserver I see she has even documented it:

\begin{figure}[H]
\includegraphics[scale=0.4]{Images/Multiple_user/mul_timeline}

\caption{Updated Timeline}


\end{figure}


Now I know I have the current state of the world and I can proceed to add in new sections.


\subsubsection{Complications\label{sub:Complications}}

In\vref{There-are-two} the second case is much harder. In this case I have diligently done my fossil update and started working. In the mean time Marilyn has also done her update and also started working. Now she is done and checks in her changes. I obviously don't know this since I am happily working on my changes. What happens next....

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}\textbf{\scriptsize fossil~commit~-m~\textquotedbl{}Commit~that~might~fork\textquotedbl{}}{\scriptsize \par}

{\scriptsize Autosync:~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}{\scriptsize \par}

{\scriptsize Bytes~Cards~Artifacts~Deltas}{\scriptsize \par}

{\scriptsize Send:~130~1~0~0}{\scriptsize \par}

{\scriptsize Received:~4002~87~0~0}{\scriptsize \par}

{\scriptsize Send:~365~6~0~0}{\scriptsize \par}

{\scriptsize Received:~110470~92~2~3}{\scriptsize \par}

{\scriptsize Total~network~traffic:~797~bytes~sent,~104567~bytes~received}{\scriptsize \par}

\textbf{\scriptsize fossil:~would~fork.~\textquotedbl{}update\textquotedbl{}~first~or~use~-f~or~-{}-force.}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}{\scriptsize \par}
\end{lyxcode}
\caption{Forking commit}


\end{figure}


Ah ha, that very thing has happened and fossil warned me that my copy of the file differs from the master copy. If I did a --force then the repository would generate a fork and Marilyn's future commits would be to her fork and my commits would be to mine. That would not be what we want since I want her to edit\textbf{ }my copy of the book.

The next step would be to do as Fossil says and do an update. At this point you have to be careful since blindly updating the changed files could overwrite the stuff I've just done. So we do a trial update by using the -n and -v options to say``do a dry run'' and show me the results.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~update~-n~-v}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Multiple\_user/mul\_new\_user.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Multiple\_user/mul\_timeline.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Multiple\_user/test\_access.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/config\_initial.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/initial\_page.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/jim\_setup.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/ticket\_done.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/ticket\_form.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/ticket\_initial.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/ticket\_list.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/ticket\_submit.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/timeline.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/timeline\_detail.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/user\_config.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/wiki\_blankhome.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/wiki\_formating.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/wiki\_home.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/wiki\_homeedit.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/wiki\_page.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Layout/fossil.png}{\scriptsize \par}

{\scriptsize UNCHANGED~Research/History/CVS-grune.pdf}{\scriptsize \par}

{\scriptsize UNCHANGED~Research/History/RCS\textemdash{}A~System~for~Version~Control.webloc}{\scriptsize \par}

{\scriptsize UNCHANGED~Research/History/SCCS-Slideshow.pdf}{\scriptsize \par}

{\scriptsize UNCHANGED~Research/History/VCSHistory~-~pysync~-~A~Brief~History~of~Version~Control~Systems~-~Project~Hosting~on~Google~Code.webloc}{\scriptsize \par}

{\scriptsize UNCHANGED~Research/fossilbib.bib}{\scriptsize \par}

{\scriptsize MERGE~fossilbook.lyx}{\scriptsize \par}

{\scriptsize UPDATE~fossilbook.pdf}{\scriptsize \par}

{\scriptsize UNCHANGED~outline.txt}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}{\scriptsize \par}
\end{lyxcode}
\caption{Update dry run}


\end{figure}


That's a little more than I wanted as you can see almost everything is UNCHANGED but it shows that fossilbook.lyx needs a MERGE and fossilbook.pdf needs an UPDATE. This is what I should expect, Marilyn has done edits to the fossilbook.lyx file and so have I so we have to merge the changes. But she has also updated the fossilbook.pdf which I have not. Before we go on if you are running on Linux or UNIX you can simplify this dry run by doing:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}\textbf{\scriptsize fossil~update~-n~-v~|~grep~-v~UNCHANGED}{\scriptsize \par}

{\scriptsize MERGE~fossilbook.lyx}{\scriptsize \par}

{\scriptsize UPDATE~fossilbook.pdf}{\scriptsize \par}
\end{lyxcode}
\caption{Update dry run, shorter}


\end{figure}


By using the pipe and grep I can eliminate all those extra UNCHANGED lines.


\subsubsection{Fixing the Update file}

First we fix the easy file, the fossilbook.pdf I can just update by itself so it matches the current repository. It doesn't need merged so just replace it. Before I do that I have to look at the repository time line

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Multiple_user/mul_timeline}

\caption{Current Timeline}


\end{figure}


I see that the current\textbf{ Leaf} is {[}d44769cc23{]} and it is tagged as\textbf{ trunk}. I want to update the fossilbook.pdf from there. So I say:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}\textbf{\scriptsize fossil~update~trunk~fossilbook.pdf}{\scriptsize \par}

{\scriptsize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\scriptsize \par}

{\scriptsize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Received:~~~~~~~~4002~~~~~~~~~87~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Total~network~traffic:~334~bytes~sent,~2412~bytes~received}{\scriptsize \par}

{\scriptsize UPDATE~fossilbook.pdf}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}{\scriptsize \par}
\end{lyxcode}
\caption{Update fossilbook.pdf}


\end{figure}


and it's done.


\subsubsection{Fixing the Merge file}

We can use the tools built into Fossil. In this case noticing that commit will cause a fork Jim will use the -force option to cause the fork and will handle the merge later.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize E:\textbackslash{}Profile\textbackslash{}Ratte\textbackslash{}data\textbackslash{}organize\textbackslash{}fossil-w32\textbackslash{}fossil-book>fossil~commit~-m~\textquotedbl{}adding~some~changes~of~jim\textquotedbl{}}{\scriptsize \par}

{\scriptsize fossil:~would~fork.\A0~\textquotedbl{}update\textquotedbl{}~first~or~use~-f~or~-{}-force.}{\scriptsize \par}

{\scriptsize \A0}{\scriptsize \par}

{\scriptsize E:\textbackslash{}Profile\textbackslash{}Ratte\textbackslash{}data\textbackslash{}organize\textbackslash{}fossil-w32\textbackslash{}fossil-book>fossil~commit~-f~-m~\textquotedbl{}adding~some~other~changes~of~jim\textquotedbl{}}{\scriptsize \par}

{\scriptsize New\_Version:~df9f2ff6b14ef65a9dd2162f8bd20c78e1628165}{\scriptsize \par}
\end{lyxcode}
\caption{Forcing a commit under Windows}
\end{figure}


Now the timeline looks like:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Multiple_user/Windows/forked_timeline}

\caption{Windows Forked timeline}
\end{figure}


To remove this fork (i.e. get the changes Marilyn did into the trunk) we use the Fossil merge command. We can use the merge because fossilbook.lyx is a text file and the merge markers are designed to work with text files. If it was a binary file we might have to use an external file or copy and paste between the two file versions using the handler program for the file.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize E:\textbackslash{}Profile\textbackslash{}Ratte\textbackslash{}data\textbackslash{}organize\textbackslash{}fossil-w32\textbackslash{}fossil-book>fossil~merge~a91582b699}{\scriptsize \par}

{\scriptsize MERGE~fossilbook.lyx}{\scriptsize \par}

{\scriptsize {*}{*}{*}{*}{*}~2~merge~conflicts~in~fossilbook.lyx}{\scriptsize \par}
\end{lyxcode}
\caption{Fossil Merge}
\end{figure}


Looking at the file (fossilbook.lyx) in a text editor (not \LyX{}) we find:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize >\textcompwordmark{}>\textcompwordmark{}>\textcompwordmark{}>\textcompwordmark{}>\textcompwordmark{}>\textcompwordmark{}>~BEGIN~MERGE~CONFLICT}{\scriptsize \par}

{\scriptsize \A0Thanks~to~Fossil's~distributed~design~once~the~set~up~is~done~using~it}{\scriptsize \par}

{\scriptsize \A0with~multiple~users~is~not~much~different~than~the~single~user~case.}{\scriptsize \par}

{\scriptsize \A0Fossil~will~automatically~manage~the~most~multiple~user~details.}{\scriptsize \par}

{\scriptsize ============================}{\scriptsize \par}

{\scriptsize \A0}{\scriptsize \par}

{\scriptsize \A0Thanks~to~Fossil's~distributed~design~once~the~set~up~is~done~using~is}{\scriptsize \par}

{\scriptsize \A0not~much~different~than~the~single~user~case~with~Fossil~managing~automatically}{\scriptsize \par}

{\scriptsize \A0the~multiple~user~details.}{\scriptsize \par}

{\scriptsize <\textcompwordmark{}<\textcompwordmark{}<\textcompwordmark{}<\textcompwordmark{}<\textcompwordmark{}<\textcompwordmark{}<~END~MERGE~CONFLICT}{\scriptsize \par}



\textbf{<Here~edit~in~the~changes>}



{\scriptsize E:\textbackslash{}Profile\textbackslash{}Ratte\textbackslash{}data\textbackslash{}organize\textbackslash{}fossil-w32\textbackslash{}fossil-book>fossil~commit~-m~\textquotedbl{}merging~marilyn's~fork~back\textquotedbl{}}{\scriptsize \par}

{\scriptsize New\_Version:~acdd676d3ab157769496f6845ccc7652985c1d03}{\scriptsize \par}
\end{lyxcode}
\caption{Text differences}
\end{figure}


After the commit the timeline shows how the merge brought the fork back into the main trunk. Marilyn will then have to update to this new trunk. (See Section \vref{sub:Updating-by-others})

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Multiple_user/Windows/merged_timeline}

\caption{Merged timeline}
\end{figure}



\section{Forks \& Branches}


\subsection{Introduction}

This chapter will cover forking and branching in Fossil. Forking is where you unintentially create two places to check into a repository. Branching is where you intentially do this because you want to maintain two or more versions of the code in the same repository. We illustrated forking and it's solutions in Section \vref{sub:Complications}. If, instead of fixing (merging) the file then doing the commit, we forced the commit, Fossil would fork the repository.

Forking is something to avoid because it creates two checkin paths for the code. Thus different users will be on different paths and can check in contradictory changes. Branches on the other hand are forks that you desire. These occur when you want to have two different versions of the code base in development at the same time. This was described in \vref{versioning} where you have a production verison of code under maintenance and a development version both served from the same repository. In this case development changes should only be checked into the development branch. Maintanence changes might have to be checked into both.

Instead of using the book repository for these examples we will use a JSON\cite{JSON}parser program that has a number of files and documentation. This will make it simpler to illustrate branching and tagging.

There is a good discussion of these topics on the Fossil Web site \url{http://www.fossil-scm.org/index.html/doc/tip/www/branching.wiki}.


\subsection{Forks, Branch \& Merge}

In this case the JSON code has just been placed in Fossil and two developers check out copies to work on. Jim wants to fix a number of compiler warnings that appear and Marilyn wants to fix the documentation. In both cases they proceeed as shown in Chapter \vref{sec:Multiple-Users}. The JSON code has been placed in a distributed location, each of them clones the repository, and opens a working copy of the code.


\subsubsection{Marilyn's Actions}

She looks through the documentation and finds a number of problems and fixes them (the documentation uses \LyX{} and PDF's). When she is satisfied with what she has done, she checks the current version of the documentation in:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Simple_Merge/sm_Marilyn}

\caption{\label{fig:Marilyn's-work}Marilyn's work}
\end{figure}



\subsubsection{Jim's Actions}

At the same time, Jim gets a working copy of version {[}6edbaf5fa8{]} of the code, puts in a ticket {[}d23bf4bbbb{]} as shown in Figure \ref{fig:Marilyn's-work}. After fixing the warnings, Jim is done and goes to commit. He does this AFTER Marilyn has done her commit.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize 551~jsonp>~}\textbf{\footnotesize fossil~commit~-m~\textquotedbl{}{[}d23bf4bbbb{]}~Remove~warnings\textquotedbl{}}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~~874~~~~~~~~~19~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~339~bytes~sent,~771~bytes~received}{\footnotesize \par}

{\footnotesize fossil:~would~fork.~~\textquotedbl{}update\textquotedbl{}~first~or~use~-f~or~-{}-force.}{\footnotesize \par}

{\footnotesize 552~jsonp>~}{\footnotesize \par}
\end{lyxcode}
\caption{Jim's commit attempt}


\end{figure}


At this point Fossil recognizes that Marilyn has changed the repository (she updated the documentation) but Jim does not have these changes because he checked out an earlier version of the code. Jim says he \textbf{must} get his changes in so he does a FORCE to force fossil to accept the commit.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize 552~jsonp>~}\textbf{\footnotesize fossil}{\footnotesize{}~}\textbf{\footnotesize commit~-m~\textquotedbl{}{[}d23bf4bbbb{]}~Remove~warnings\textquotedbl{}~-f}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~~874~~~~~~~~~19~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~338~bytes~sent,~771~bytes~received}{\footnotesize \par}

{\footnotesize New\_Version:~1beab955418a942ab9953c4865109ff46cbbd691}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~2646~~~~~~~~~25~~~~~~~~~~0~~~~~~~~~~4}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1058~~~~~~~~~23~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1498~bytes~sent,~864~bytes~received}{\footnotesize \par}

{\footnotesize {*}{*}{*}{*}~warning:~a~fork~has~occurred~{*}{*}{*}{*}{*}}{\footnotesize \par}
\end{lyxcode}
\caption{Forcing the commit}


\end{figure}


Looking at the timeline Jim sees this:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Simple_Merge/sm_jim_fork}

\caption{Repository Fork}


\end{figure}


Not good, there are two \textbf{Leaf}'s and Marilyn would commit code to her fork and Jim would be commiting code to his. So Jim must fix this by merging the code. Jim wants to merge versions {[}b72e96832e{]} of Marilyn and his {[}1beab85441{]}.


\subsubsection{Fixing the fork}

So Jim who's checked out code is from Leaf {[}1beab85441{]} does a merge with Marilyn's leaf {[}b72e96832e{]} like so:

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize 556~jsonp>~}\textbf{\footnotesize fossil~merge~b72e96832e}{\footnotesize \par}

{\footnotesize UPDATE~docs/qdj.lyx}{\footnotesize \par}

{\footnotesize UPDATE~docs/qdj.pdf}{\footnotesize \par}

{\footnotesize 557~jsonp>~}\textbf{\footnotesize fossil~status}{\footnotesize \par}

{\footnotesize repository:~~~/Users/jschimpf/Public/FOSSIL/jsonp.fossil}{\footnotesize \par}

{\footnotesize local-root:~~~/Users/jschimpf/Public/jsonp/}{\footnotesize \par}

{\footnotesize server-code:~~d3e7932b0b0f5e704264ba30adeae14978c08bc6}{\footnotesize \par}

{\footnotesize checkout:~~~~~1beab955418a942ab9953c4865109ff46cbbd691~2010-06-08~10:44:56~UTC}{\footnotesize \par}

{\footnotesize parent:~~~~~~~6edbaf5fa8e4d061c2e04e7fd481e7663b090bd3~2010-06-07~10:45:57~UTC}{\footnotesize \par}

{\footnotesize tags:~~~~~~~~~trunk}{\footnotesize \par}

{\footnotesize UPDATED\_BY\_MERGE~docs/qdj.lyx}{\footnotesize \par}

{\footnotesize UPDATED\_BY\_MERGE~docs/qdj.pdf}{\footnotesize \par}

{\footnotesize MERGED\_WITH~b72e96832e024f235696dcd6c5d0ddcc2cb38238}{\footnotesize \par}
\end{lyxcode}
\caption{\label{fig:Merge-Operation}Merge Operation}


\end{figure}


As shown the two documentation files are updated, there are no merge conflicts as Jim didn't touch these files and Marilyn didn't touch the code files.

Next Jim does a commit to make this new merged set of files the new trunk. Rememeber doing the merge shown in Figure \ref{fig:Merge-Operation} just updates your checked out code and does not change the repository till you check it in.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize 558~jsonp>~fossil~}\textbf{\footnotesize commit~-m~\textquotedbl{}After~merging~in~changes\textquotedbl{}}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1058~~~~~~~~~23~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~340~bytes~sent,~864~bytes~received}{\footnotesize \par}

{\footnotesize New\_Version:~3d73c03edee33cdc2e1bd8a47de57b7a6b6d880a}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~1737~~~~~~~~~26~~~~~~~~~~0~~~~~~~~~~1}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1104~~~~~~~~~24~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1101~bytes~sent,~888~bytes~received}{\footnotesize \par}

{\footnotesize 559~jsonp>~}{\footnotesize \par}
\end{lyxcode}
\caption{Commit after merge}


\end{figure}


When we look at the timeline we have a single leaf for future code commits.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Simple_Merge/sm_after_merge}

\caption{After merge timeline}


\end{figure}


The only other thing remaining is that Marilyn does an Update before proceeding so her checked out code matches the repository.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize WhiteBook:jsonp~marilyn\$~}\textbf{\footnotesize fossil~update}{\footnotesize \par}

{\footnotesize Autosync:~~http://Marilyn@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1150~~~~~~~~~25~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~412~~~~~~~~~~7~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~3274~~~~~~~~~31~~~~~~~~~~1~~~~~~~~~~5}{\footnotesize \par}

{\footnotesize Total~network~traffic:~843~bytes~sent,~2709~bytes~received}{\footnotesize \par}

{\footnotesize UPDATE~json-src/qdj\_token.c}{\footnotesize \par}

{\footnotesize UPDATE~json-src/qdj\_util.c}{\footnotesize \par}

{\footnotesize UPDATE~main.c}{\footnotesize \par}
\end{lyxcode}
\caption{Marilyn's Update}


\end{figure}



\subsubsection{Commands used}
\begin{itemize}
\item \textbf{fossil merge <fork>} Used to merge a fork (specified by hash value) to current check out. 
\item \textbf{fossil update <version>} Used to update current check out to specified version, if version not present use default tag for check out (see fossil status)
\end{itemize}

\subsection{Merge without fork}

In this case I will show how to merge in code changes from multiple users without causing a fork. In this case Marilyn has put in a BSD license text into all the code files while Jim is adding a help function to the code. In this case both of them put in tickets saying what they are doing but acting independently.


\subsubsection{Check in attempt}

Marilyn finished first and checks in her changes. Jim builds, tests and tries to check in his code and gets:

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize 502~jsonp>~}\textbf{\footnotesize make}{\footnotesize \par}

{\footnotesize /usr/bin/gcc~~main.c~-c~-I.~-Ijson-src~-o~obj/main.o}{\footnotesize \par}

{\footnotesize /usr/bin/gcc~~\textbackslash{}}{\footnotesize \par}

{\footnotesize 		obj/main.o\textbackslash{}}{\footnotesize \par}

{\footnotesize 		obj/qdj.o\textbackslash{}}{\footnotesize \par}

{\footnotesize 		obj/qdj\_util.o\textbackslash{}}{\footnotesize \par}

{\footnotesize 		obj/qdj\_token.o\textbackslash{}}{\footnotesize \par}

{\footnotesize 		-o~jsonp}{\footnotesize \par}



{\footnotesize 503~jsonp>~}\textbf{\footnotesize ./jsonp~-v}{\footnotesize \par}

{\footnotesize JSON~Test~Program~Ver:~{[}Jun~~9~2010{]}~{[}10:15:00{]}}{\footnotesize \par}

{\footnotesize SYNTAX:~jsonp~-i~<json~text~file>~{[}-v{]}}{\footnotesize \par}

{\footnotesize -i~<json~text~file>~~~Show~parse~of~JSON}{\footnotesize \par}

{\footnotesize -v~~~~~~~~~~~~~~~~~~~~Show~help}{\footnotesize \par}



{\footnotesize 506~jsonp>~}\textbf{\footnotesize fossil~commit~-m~\textquotedbl{}{[}fed383fa1a{]}~Add~help~to~cmd~line\textquotedbl{}}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1656~~~~~~~~~36~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~647~~~~~~~~~12~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~14039~~~~~~~~~47~~~~~~~~~~4~~~~~~~~~~7}{\footnotesize \par}

{\footnotesize Total~network~traffic:~942~bytes~sent,~4537~bytes~received}{\footnotesize \par}

{\footnotesize fossil:~would~fork.~~\textquotedbl{}update\textquotedbl{}~first~or~use~-f~or~-{}-force.}{\footnotesize \par}
\end{lyxcode}
\caption{Jim's check in attempt}


\end{figure}



\subsubsection{Update}

The next action Jim takes is to do the update but without doing changes, using the -n flag which tells it to just show what's going to happen without making any file changes.

\begin{figure}[H]
\begin{lyxcode}
507~jsonp>~\textbf{fossil~update~-n}

UPDATE~json-src/qdj.c

UPDATE~json-src/qdj.h

UPDATE~json-src/qdj\_token.c

UPDATE~json-src/qdj\_token.h

UPDATE~json-src/qdj\_util.c

MERGE~main.c
\end{lyxcode}
\caption{Update dry run}


\end{figure}


This shows some files will be updated, i.e. be replaced by new text from the repository. The main.c file will be merged with the version from the repository. That is text from the repository will be mixed with the text from Jim's modified file. Note that it says \textbf{MERGE} meaning the two sets of text are a disjoint set. This means the merge can all be done by Fossil with no human intervention.

Jim can just do the update for real then commit the merged files to make a new leaf. So now we have Marilyn's and Jim changes combined in the lastest version. 

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/file_merge/merge}

\caption{Merged repository}


\end{figure}



\subsubsection{Commands used}
\begin{itemize}
\item \textbf{fossil update -n} Does a dry run of an update to show what files will changed.

\begin{itemize}
\item UPDATE Implies file will be replaced by repository file
\item MERGE Implies file will be mixed text from repository and check out
\end{itemize}
\end{itemize}

\subsection{Branching}


\subsubsection{Introduction}

We have discussed this before but branching is the intential splitting of the code in the repository into multiple paths. This will usually be done with production code where we have maintenance branch and a development branch. The maintenance branch is in use and would get bug fixes based on experience. The development branch would get those changes if applicable plus be modified to add features.

The JSON code parser has been tested and works so will be released to general use. Also we wish to modify it to add support for UTF-8 characters so it matches the JSON standard. The current version just works with ASCII 7 bit characters which is not standard. We wish to split the code into a VER\_1.0 branch which is the current code in use and VER\_2.0 branch which will add UTF-8 character support.


\subsubsection{Branch the repository}

Before proceeding we will make sure we have the current trunk code in our check out. 

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp{]}~jim\%~}\textbf{\footnotesize fossil~status}{\footnotesize \par}

{\footnotesize repository:~/Users/jschimpf/Public/FOSSIL/jsonp.fossil}{\footnotesize \par}

{\footnotesize local-root:~/Users/jschimpf/Public/jsonp/}{\footnotesize \par}

{\footnotesize server-code:~90c80f1a2da7360dae230ccec65ff82fe2eb160d}{\footnotesize \par}

{\footnotesize checkout:~}\textbf{\footnotesize 462156b283}{\footnotesize b694af0b99c9b446b64d3f77436fbb~2010-06-09~14:16:42~UTC}{\footnotesize \par}

{\footnotesize parent:~fbb16491e2ff9f9ca3a98adffa167de1b6903a44~2010-06-09~14:02:28~UTC}{\footnotesize \par}

\textbf{\footnotesize tags:~trunk}{\footnotesize \par}
\end{lyxcode}
\caption{Checking code status}
\end{figure}


Seeing that matches the latest leaf in the time line we can proceed to branch the code.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp{]}~jim\%~}\textbf{\footnotesize fossil~branch~new~VER\_1.0~trunk~-bgcolor~0xFFC0FF}{\footnotesize \par}

{\footnotesize sh:~gpg:~command~not~found}{\footnotesize \par}

{\footnotesize unable~to~sign~manifest.~~continue~(y/N)?~y}{\footnotesize \par}

{\footnotesize New~branch:~65e1f48633d691a5ea738cd51ccbf9a581dfb3c7}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~2391~~~~~~~~~42~~~~~~~~~~0~~~~~~~~~~1}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1840~~~~~~~~~40~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1524~bytes~sent,~1272~bytes~received}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp{]}~jim\%~}\textbf{\footnotesize fossil~branch~new~VER\_2.0~trunk~-bgcolor~0xC0F0FF}{\footnotesize \par}

{\footnotesize sh:~gpg:~command~not~found}{\footnotesize \par}

{\footnotesize unable~to~sign~manifest.~~continue~(y/N)?~y}{\footnotesize \par}

{\footnotesize New~branch:~a1737916ec2df696a0f3a7e36edf9ba4370e48a7}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~2437~~~~~~~~~43~~~~~~~~~~0~~~~~~~~~~1}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1886~~~~~~~~~41~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1550~bytes~sent,~1271~bytes~received}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp{]}~jim\%~}{\footnotesize \par}
\end{lyxcode}
\caption{Branch commands\label{fig:Branch-commands}}
\end{figure}


What was just done. We used the Fossil branch command to create two branches VER\_1.0 and VER\_2.0 and assigned each of them a color. We can see the timeline is now:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Branching/branch}

\caption{Branch Timeline}
\end{figure}



\subsubsection{Color Setup}

As you see above the two branches have different colors in the timeline. This was due to the \textbf{-bgcolor} option added when we created each branch. (See Figure \ref{fig:Branch-commands}). But we want this color to appear on subsequent checkins of each of these branches. To make that happen we have to set the options using the UI and picking a particular leaf on the timeline.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Branching/color_setup}

\caption{Setting Timeline color}


\end{figure}


Under the \textbf{Background Color} section I have checked \textbf{Propagate color to descendants }so future checkins will have the same color.


\subsubsection{Check out the branches}

Now the the repository is branched we can check out the two sets of code into different directories. We create jsonp1 and jsonp2 and proceed to open the different branches into them.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp1{]}~}\textbf{\footnotesize jim\%~fossil~open~../FOSSIL/jsonp.fossil~VER\_1.0}{\footnotesize \par}

{\footnotesize docs/qdj.lyx}{\footnotesize \par}

{\footnotesize docs/qdj.pdf}{\footnotesize \par}

{\footnotesize json-src/qdj.c}{\footnotesize \par}

{\footnotesize json-src/qdj.h}{\footnotesize \par}

{\footnotesize json-src/qdj\_token.c}{\footnotesize \par}

{\footnotesize json-src/qdj\_token.h}{\footnotesize \par}

{\footnotesize json-src/qdj\_util.c}{\footnotesize \par}

{\footnotesize main.c}{\footnotesize \par}

{\footnotesize makefile}{\footnotesize \par}

{\footnotesize obj/test.txt}{\footnotesize \par}

{\footnotesize test.txt}{\footnotesize \par}

{\footnotesize project-name:~JASONP}{\footnotesize \par}

{\footnotesize repository:~~~/Users/jschimpf/Public/FOSSIL/jsonp.fossil}{\footnotesize \par}

{\footnotesize local-root:~~~/Users/jschimpf/Public/jsonp1/}{\footnotesize \par}

{\footnotesize project-code:~eb6084c8ab115cf2b28a129c7183731002c6143a}{\footnotesize \par}

{\footnotesize server-code:~~90c80f1a2da7360dae230ccec65ff82fe2eb160d}{\footnotesize \par}

{\footnotesize checkout:~~~~~65e1f48633d691a5ea738cd51ccbf9a581dfb3c7~2010-06-13~10:13:55~UTC}{\footnotesize \par}

{\footnotesize parent:~~~~~~~462156b283b694af0b99c9b446b64d3f77436fbb~2010-06-09~14:16:42~UTC}{\footnotesize \par}

{\footnotesize tags:~~~~~~~~~}\textbf{\footnotesize VER\_1.0}{\footnotesize \par}
\end{lyxcode}
\caption{Check out VER\_1.0}
\end{figure}


Checking out VER\_2.0 in the same way

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp2{]}~jim\%~}\textbf{\footnotesize fossil~open~../FOSSIL/jsonp.fossil~VER\_2.0}{\footnotesize \par}

{\footnotesize docs/qdj.lyx}{\footnotesize \par}

{\footnotesize docs/qdj.pdf}{\footnotesize \par}

{\footnotesize json-src/qdj.c}{\footnotesize \par}

{\footnotesize json-src/qdj.h}{\footnotesize \par}

{\footnotesize json-src/qdj\_token.c}{\footnotesize \par}

{\footnotesize json-src/qdj\_token.h}{\footnotesize \par}

{\footnotesize json-src/qdj\_util.c}{\footnotesize \par}

{\footnotesize main.c}{\footnotesize \par}

{\footnotesize makefile}{\footnotesize \par}

{\footnotesize obj/test.txt}{\footnotesize \par}

{\footnotesize test.txt}{\footnotesize \par}

{\footnotesize project-name:~JASONP}{\footnotesize \par}

{\footnotesize repository:~~~/Users/jschimpf/Public/FOSSIL/jsonp.fossil}{\footnotesize \par}

{\footnotesize local-root:~~~/Users/jschimpf/Public/jsonp2/}{\footnotesize \par}

{\footnotesize project-code:~eb6084c8ab115cf2b28a129c7183731002c6143a}{\footnotesize \par}

{\footnotesize server-code:~~90c80f1a2da7360dae230ccec65ff82fe2eb160d}{\footnotesize \par}

{\footnotesize checkout:~~~~~a1737916ec2df696a0f3a7e36edf9ba4370e48a7~2010-06-13~10:14:26~UTC}{\footnotesize \par}

{\footnotesize parent:~~~~~~~462156b283b694af0b99c9b446b64d3f77436fbb~2010-06-09~14:16:42~UTC}{\footnotesize \par}

{\footnotesize tags:~~~~~~~~~}\textbf{\footnotesize VER\_2.0}{\footnotesize \par}
\end{lyxcode}
\caption{VER\_2.0 checkout}
\end{figure}


Notice on both of these the tags show which branch we are attached to.


\subsubsection{Correcting errors (in both)}

After doing this work I found that the main.c file had a warning about an unused variable. I wanted to correct this in both branches. At this point all the files in both branches are the same so correcting the file in either branch and copying it to the other is possible. I put in a ticket for the change and edit main.c. I copy it to both checkouts for the both branches and then check both in.

\begin{figure}
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp1{]}~jim\%~}\textbf{\footnotesize fossil~commit~-m~\textquotedbl{}{[}2795e6c74d{]}~Fix~unused~variable\textquotedbl{}}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~2116~~~~~~~~~46~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~365~~~~~~~~~~6~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~3601~~~~~~~~~51~~~~~~~~~~5~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~805~bytes~sent,~3464~bytes~received}{\footnotesize \par}

{\footnotesize New\_Version:~3b902585d0e8849399286139d27676c5a349de7b}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~3034~~~~~~~~~50~~~~~~~~~~0~~~~~~~~~~2}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~2208~~~~~~~~~48~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1848~bytes~sent,~1444~bytes~received}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp1{]}~jim\%~}\textbf{\footnotesize cd~..}{\footnotesize \par}

{\footnotesize {[}Pandora-2:/Users/jschimpf/Public{]}~jim\%~}\textbf{\footnotesize cd~jsonp2}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp2{]}~jim\%~}\textbf{\footnotesize cp~../jsonp1/main.c~.}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp2{]}~jim\%~}\textbf{\footnotesize fossil~status}{\footnotesize \par}

{\footnotesize repository:~~~/Users/jschimpf/Public/FOSSIL/jsonp.fossil}{\footnotesize \par}

{\footnotesize local-root:~~~/Users/jschimpf/Public/jsonp2/}{\footnotesize \par}

{\footnotesize server-code:~~90c80f1a2da7360dae230ccec65ff82fe2eb160d}{\footnotesize \par}

{\footnotesize checkout:~~~~~a1737916ec2df696a0f3a7e36edf9ba4370e48a7~2010-06-13~10:14:26~UTC}{\footnotesize \par}

{\footnotesize parent:~~~~~~~462156b283b694af0b99c9b446b64d3f77436fbb~2010-06-09~14:16:42~UTC}{\footnotesize \par}

{\footnotesize tags:~~~~~~~~~VER\_2.0}{\footnotesize \par}

{\footnotesize EDITED~~~~~main.c}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp2{]}~jim\%~}\textbf{\footnotesize fossil~commit~-m~\textquotedbl{}{[}2795e6c74d{]}~Fix~unused~variable\textquotedbl{}}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~2392~~~~~~~~~52~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~318~~~~~~~~~~5~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~3320~~~~~~~~~56~~~~~~~~~~4~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~781~bytes~sent,~3508~bytes~received}{\footnotesize \par}

{\footnotesize New\_Version:~762a31854d708080678598c8d4ce28465cbee8c5}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~3253~~~~~~~~~55~~~~~~~~~~0~~~~~~~~~~2}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~2438~~~~~~~~~53~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1972~bytes~sent,~1573~bytes~received}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp2{]}~jim\%~}{\footnotesize \par}
\end{lyxcode}
\caption{Fixing both branches}


\end{figure}


Now the timeline looks like this:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Branching/current_state}

\caption{Correcting both branches}


\end{figure}



\subsubsection{Commands used}
\begin{itemize}
\item \textbf{fossil branch }Used to generate a branch of the repository. The command can optionally color the branch in the display.
\end{itemize}

\section{Fossil Commands}


\subsection{Introduction}

This section will go through the various Fossil command line commands. This will be divided into sections, the first will detail the must know commands. These are the ones you will be using all the time and will probably have memorized in short order. The other commands will be divided into Maintenance, Advanced, and Miscellaneous. These you will probably be checking as reference before use.

The most important command is \textbf{help}. You can always type \textbf{fossil help} at the command line and it will list out all the commands it has. Then typing f\textbf{ossil help <command> }will print out the detailed information on that command. You always have that as your reference. This section of the book will try to supplement the built in help with some examples and further explanation of what a command does. All of the commands will be placed in the index for easy searching

\textbf{NOTE:} Fossil is a moving target, commands might be added and others removed future versions. Type \textbf{fossil help }on your version to get the latest list. The following applies to the fossil I used when I wrote this and your version might be different.


\subsection{Basic Commands}


\subsubsection{help\index{help}}

This command is used to dump the current command set and version of Fossil. It can also be used in the form \textbf{fossil help <command> }to get further information on any command.

\begin{figure}[H]
\noindent \begin{centering}
\includegraphics{Images/Commands/help1}
\par\end{centering}

\caption{Help run}


\end{figure}


Using it to get further information about a particular command

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~add}{\scriptsize \par}

{\scriptsize Usage:~fossil~add~FILE...}{\scriptsize \par}

{\scriptsize Make~arrangements~to~add~one~or~more~files~to~the~current~checkout}{\scriptsize \par}

{\scriptsize at~the~next~commit.}{\scriptsize \par}

{\scriptsize When~adding~files~recursively,~filenames~that~begin~with~\textquotedbl{}.\textquotedbl{}~are}{\scriptsize \par}

{\scriptsize excluded~by~default.~To~include~such~files,~add~the~\textquotedbl{}-{}-dotfiles\textquotedbl{}}{\scriptsize \par}

{\scriptsize option~to~the~command-line.}{\scriptsize \par}
\end{lyxcode}
\caption{Help detail}


\end{figure}



\subsubsection{add\index{add}}

The add command is used to add files into a repository. It is recursive and will pull in all files in subdirectories of the current. Fossil will not overwrite any of the files already present in the repository so it is safe to add all the files at any time. Only new files will be added.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil}{\scriptsize{}~}\textbf{\scriptsize help~add}{\scriptsize \par}

{\scriptsize Usage:~fossil~add~FILE...}{\scriptsize \par}

{\scriptsize Make~arrangements~to~add~one~or~more~files~to~the~current~checkout}{\scriptsize \par}

{\scriptsize at~the~next~commit.}{\scriptsize \par}

{\scriptsize When~adding~files~recursively,~filenames~that~begin~with~\textquotedbl{}.\textquotedbl{}~are}{\scriptsize \par}

{\scriptsize excluded~by~default.~To~include~such~files,~add~the~\textquotedbl{}-{}-dotfiles\textquotedbl{}}{\scriptsize \par}

{\scriptsize option~to~the~command-line.}{\scriptsize \par}
\end{lyxcode}
\caption{add detail}


\end{figure}


Typing:
\begin{lyxcode}
fossil~add~.
\end{lyxcode}
will add all files in the current directory and subdirectories.

Note none of these files are put in the repository untill a commit is done.


\subsubsection{rm\index{rm} or del\index{del}}

The rm command is used to remove files from the repository. The file is not deleted from the file system but it will be dropped from the repository on the next commit. This file will still be available in earlier versions of the repository but not in later ones.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~rm}{\scriptsize \par}

{\scriptsize Usage:~fossil~rm~FILE...}{\scriptsize \par}

{\scriptsize{}~~~or:~fossil~del~FILE...}{\scriptsize \par}

{\scriptsize Remove~one~or~more~files~from~the~tree.}{\scriptsize \par}

{\scriptsize This~command~does~not~remove~the~files~from~disk.~~It~just~marks~the}{\scriptsize \par}

{\scriptsize files~as~no~longer~being~part~of~the~project.~~In~other~words,~future}{\scriptsize \par}

{\scriptsize changes~to~the~named~files~will~not~be~versioned.}{\scriptsize \par}
\end{lyxcode}
\caption{rm detail}


\end{figure}


You can delete groups of files by using wild-cards in their names. Thus if I had a group of files like com\_tr.c, com\_rx.c and com\_mgmt.c I could remove them all with:
\begin{lyxcode}
fossil~rm~com\_{*}.c
\end{lyxcode}
By running a ``fossil status'' you can see what files will be deleted on the next commit.


\subsubsection{rename\index{rename} or mv\index{mv}}

This command is used to rename a file in the repository. This does not rename files on disk so is usually used after you have renamed files on the disk then want to change this in the repository.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~help~rename}{\scriptsize \par}

{\scriptsize Usage:~fossil~mv|rename~OLDNAME~NEWNAME}{\scriptsize \par}

{\scriptsize{}~~~or:~fossil~mv|rename~OLDNAME...~DIR}{\scriptsize \par}

{\scriptsize Move~or~rename~one~or~more~files~within~the~tree}{\scriptsize \par}

{\scriptsize This~command~does~not~rename~the~files~on~disk.~~All~this~command~does~is}{\scriptsize \par}

{\scriptsize record~the~fact~that~filenames~have~changed~so~that~appropriate~notations}{\scriptsize \par}

{\scriptsize can~be~made~at~the~next~commit/checkin.}{\scriptsize \par}
\end{lyxcode}
\caption{rename detail}
\end{figure}


Just like add or rm you can use wild cards in the names and rename groups of files. Like them ``fossil status'' will show you the current state.


\subsubsection{status\index{status}}

The status command is used to show you the current state of your files relative to the repository. It will show you files added, deleted, and changed. This is only the condition of files that are already in the repository or under control of fossil. It also shows from where in the timeline you are checked out and where your repository is kept.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~status}{\scriptsize \par}

{\scriptsize repository:~~~/Users/jschimpf/Public/FOSSIL/FossilBook.fossil}{\scriptsize \par}

{\scriptsize local-root:~~~/Users/jschimpf/Public/FossilBook/}{\scriptsize \par}

{\scriptsize server-code:~~3e67da6d6212494456c69b1c5406a277d7e50430}{\scriptsize \par}

{\scriptsize checkout:~~~~~edd5b5fa4277604f365ec09238422c0aa7a28faf~2010-05-08~14:44:21~UTC}{\scriptsize \par}

{\scriptsize parent:~~~~~~~3f019cbc730db0eb35f20941533a22635856b2b3~2010-05-08~11:15:19~UTC}{\scriptsize \par}

{\scriptsize tags:~~~~~~~~~trunk}{\scriptsize \par}

{\scriptsize EDITED~~~~~fossilbook.lyx}{\scriptsize \par}

{\scriptsize EDITED~~~~~outline.txt}{\scriptsize \par}
\end{lyxcode}
\caption{\label{fig:status-run}status run}


\end{figure}


The listing above shows where my cloned copy of the repository is kept, where I am working, and the tags show me that I am checked out of the trunk. Finally it shows the status of the files: I am working on two of them.


\subsubsection{changes\index{changes}}

This lists the changed files like status but does not show the other information that status does.

\begin{figure}
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~changes}{\scriptsize \par}

{\scriptsize Usage:~fossil~changes}{\scriptsize \par}

{\scriptsize Report~on~the~edit~status~of~all~files~in~the~current~checkout.}{\scriptsize \par}

{\scriptsize See~also~the~\textquotedbl{}status\textquotedbl{}~and~\textquotedbl{}extra\textquotedbl{}~commands.}{\scriptsize \par}
\end{lyxcode}
\caption{changes details}


\end{figure}



\subsubsection{extra\index{extra}}

The extra command is used to find files you have added to your working directory but are not yet under Fossil control. This is important because if you move your working directory or others attempt to use the repository they won't have these files. 

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~extra}{\scriptsize \par}

{\scriptsize Usage:~fossil~extras~?-{}-dotfiles?~?-{}-ignore~GLOBPATTERN?}{\scriptsize \par}

{\scriptsize Print~a~list~of~all~files~in~the~source~tree~that~are~not~part~of}{\scriptsize \par}

{\scriptsize the~current~checkout.~~See~also~the~\textquotedbl{}clean\textquotedbl{}~command.}{\scriptsize \par}

{\scriptsize Files~and~subdirectories~whose~names~begin~with~\textquotedbl{}.\textquotedbl{}~are~normally}{\scriptsize \par}

{\scriptsize ignored~but~can~be~included~by~adding~the~-{}-dotfiles~option.}{\scriptsize \par}
\end{lyxcode}
\caption{extra details}


\end{figure}


The --dotfiles option shows you any files starting with ``.'' that are not under Fossil control. This would be important if you need those files in your repository. The last option --ignore allows you to ignore certain files you know don't belong in the repository. In my case there is a file called fossilbook.lyx\textasciitilde{} that is a \LyX{} backup file that I do not want, as it is temporary. So I can say
\begin{lyxcode}
fossil~extra~-{}-ignore~{*}.lyx\textasciitilde{}~
\end{lyxcode}
and only get:
\begin{lyxcode}
{[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~\textbf{fossil~extra~-{}-ignore~{*}.lyx\textasciitilde{}}

Images/Commands/help1.epsf
\end{lyxcode}
instead of:
\begin{lyxcode}
{[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~\textbf{fossil~extra}

Images/Commands/help1.epsf

fossilbook.lyx\textasciitilde{}
\end{lyxcode}

\subsubsection{revert\index{revert}}

The revert command is used to take a file back to the value in the repository. This is useful when you make a error in editing or other mistake.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~revert}{\scriptsize \par}

{\scriptsize Usage:~fossil~revert~?-r~REVISION?~FILE~...}{\scriptsize \par}

{\scriptsize Revert~to~the~current~repository~version~of~FILE,~or~to}{\scriptsize \par}

{\scriptsize the~version~associated~with~baseline~REVISION~if~the~-r~flag}{\scriptsize \par}

{\scriptsize appears.}{\scriptsize \par}

{\scriptsize If~a~file~is~reverted~accidently,~it~can~be~restored~using}{\scriptsize \par}

{\scriptsize the~\textquotedbl{}fossil~undo\textquotedbl{}~command.}{\scriptsize \par}
\end{lyxcode}
\caption{revert details}


\end{figure}


With no parameters it will revert the file to the current revision, see Figure \vref{fig:status-run}. The -r option allows you to pick any revision from the time line.


\subsubsection{update\index{update}}

The update option will update a file or files to match the repository. With multiple users it should be done before you start working on any files. This ensures you have the latest version of all the files. 

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~update}{\scriptsize \par}

{\scriptsize Usage:~fossil~update~?VERSION?~?FILES...?}{\scriptsize \par}

{\scriptsize Change~the~version~of~the~current~checkout~to~VERSION.~~Any~uncommitted}{\scriptsize \par}

{\scriptsize changes~are~retained~and~applied~to~the~new~checkout.}{\scriptsize \par}



{\scriptsize The~VERSION~argument~can~be~a~specific~version~or~tag~or~branch~name.}{\scriptsize \par}

{\scriptsize If~the~VERSION~argument~is~omitted,~then~the~leaf~of~the~the~subtree}{\scriptsize \par}

{\scriptsize that~begins~at~the~current~version~is~used,~if~there~is~only~a~single}{\scriptsize \par}

{\scriptsize leaf.~~VERSION~can~also~be~\textquotedbl{}current\textquotedbl{}~to~select~the~leaf~of~the~current}{\scriptsize \par}

{\scriptsize version~or~\textquotedbl{}latest\textquotedbl{}~to~select~the~most~recent~check-in.}{\scriptsize \par}



{\scriptsize If~one~or~more~FILES~are~listed~after~the~VERSION~then~only~the}{\scriptsize \par}

{\scriptsize named~files~are~candidates~to~be~updated.~~If~FILES~is~omitted,~all}{\scriptsize \par}

{\scriptsize files~in~the~current~checkout~are~subject~to~be~updated.}{\scriptsize \par}



{\scriptsize The~-n~or~-{}-nochange~option~causes~this~command~to~do~a~\textquotedbl{}dry~run\textquotedbl{}.~~It}{\scriptsize \par}

{\scriptsize prints~out~what~would~have~happened~but~does~not~actually~make~any}{\scriptsize \par}

{\scriptsize changes~to~the~current~checkout~or~the~repository.}{\scriptsize \par}



{\scriptsize The~-v~or~-{}-verbose~option~prints~status~information~about~unchanged}{\scriptsize \par}

{\scriptsize files~in~addition~to~those~file~that~actually~do~change.}{\scriptsize \par}
\end{lyxcode}
\caption{update details}


\end{figure}


Update has a number of options, first you can tie the update to a particular version, if not picked then it just uses the latest. Second it can work on a single files or many files at once. That is you could say
\begin{lyxcode}
fossil~update~{*}.c
\end{lyxcode}
and it would update all C files.

Since this is a rather large set of changes it has a special ``dry run'' mode. If you add -n on the command it will just print out what will be done but not do it. This is very useful to do this trial if you are unsure what might happen. The -v command (which can be used with -n or alone) prints out the action for each file even if it does nothing.


\subsubsection{checkout\index{checkout} or co\index{co}}

This command is similar to update.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~help~checkout}{\scriptsize \par}

{\scriptsize Usage:~fossil~checkout~VERSION~?-f|-{}-force?~?-{}-keep?}{\scriptsize \par}

{\scriptsize Check~out~a~version~specified~on~the~command-line.~~This~command}{\scriptsize \par}

{\scriptsize will~abort~if~there~are~edited~files~in~the~current~checkout~unless}{\scriptsize \par}

{\scriptsize the~-{}-force~option~appears~on~the~command-line.~~The~-{}-keep~option}{\scriptsize \par}

{\scriptsize leaves~files~on~disk~unchanged,~except~the~manifest~and~manifest.uuid}{\scriptsize \par}

{\scriptsize files.}{\scriptsize \par}

{\scriptsize The~-{}-latest~flag~can~be~used~in~place~of~VERSION~to~checkout~the}{\scriptsize \par}

{\scriptsize latest~version~in~the~repository.}{\scriptsize \par}

{\scriptsize See~also~the~\textquotedbl{}update\textquotedbl{}~command.}{\scriptsize \par}
\end{lyxcode}
\caption{checkout or co details}


\end{figure}



\subsubsection{undo\index{undo}}

This is used to undo the last update, merge, or revert operation. 

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~undo}{\scriptsize \par}

{\scriptsize Usage:~fossil~undo~?FILENAME...?}{\scriptsize \par}



{\scriptsize Undo~the~most~recent~update~or~merge~or~revert~operation.~~If~FILENAME~is}{\scriptsize \par}

{\scriptsize specified~then~restore~the~content~of~the~named~file(s)~but~otherwise}{\scriptsize \par}

{\scriptsize leave~the~update~or~merge~or~revert~in~effect.}{\scriptsize \par}



{\scriptsize A~single~level~of~undo/redo~is~supported.~~The~undo/redo~stack}{\scriptsize \par}

{\scriptsize is~cleared~by~the~commit~and~checkout~commands.}{\scriptsize \par}
\end{lyxcode}
\caption{undo details}


\end{figure}


It acts on a single file or files if specified, otherwise if no file given, it undoes all of the last changes.


\subsubsection{diff\index{diff}}

The diff command is used to produce a text listing of the difference of a file in the working directory and that same file in the repository. If you don't specify a file it will show the differences between all the changed files in the working directory vs the repository. If you use the --from and --to options you can specify which versions to check and to compare between two different versions in the repository. Not using the --to means compare with the working directory.

If you have configured an external diff program it will be used unless you use the -i option which uses the diff built into Fossil.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~diff}{\scriptsize \par}

{\scriptsize Usage:~fossil~diff|gdiff~?options?~?FILE?}{\scriptsize \par}



{\scriptsize Show~the~difference~between~the~current~version~of~FILE~(as~it}{\scriptsize \par}

{\scriptsize exists~on~disk)~and~that~same~file~as~it~was~checked~out.~~Or}{\scriptsize \par}

{\scriptsize if~the~FILE~argument~is~omitted,~show~the~unsaved~changed~currently}{\scriptsize \par}

{\scriptsize in~the~working~check-out.}{\scriptsize \par}



{\scriptsize If~the~\textquotedbl{}-{}-from~VERSION\textquotedbl{}~or~\textquotedbl{}-r~VERSION\textquotedbl{}~option~is~used~it~specifies}{\scriptsize \par}

{\scriptsize the~source~check-in~for~the~diff~operation.~~If~not~specified,~the~}{\scriptsize \par}

{\scriptsize source~check-in~is~the~base~check-in~for~the~current~check-out.}{\scriptsize \par}

{\scriptsize If~the~\textquotedbl{}-{}-to~VERSION\textquotedbl{}~option~appears,~it~specifies~the~check-in~from}{\scriptsize \par}

{\scriptsize which~the~second~version~of~the~file~or~files~is~taken.~~If~there~is}{\scriptsize \par}

{\scriptsize no~\textquotedbl{}-{}-to\textquotedbl{}~option~then~the~(possibly~edited)~files~in~the~current~check-out}{\scriptsize \par}

{\scriptsize are~used.}{\scriptsize \par}



{\scriptsize The~\textquotedbl{}-i\textquotedbl{}~command-line~option~forces~the~use~of~the~internal~diff~logic}{\scriptsize \par}

{\scriptsize rather~than~any~external~diff~program~that~might~be~configured~using}{\scriptsize \par}

{\scriptsize the~\textquotedbl{}setting\textquotedbl{}~command.~~If~no~external~diff~program~is~configured,~then}{\scriptsize \par}

{\scriptsize the~\textquotedbl{}-i\textquotedbl{}~option~is~a~no-op.~~The~\textquotedbl{}-i\textquotedbl{}~option~converts~\textquotedbl{}gdiff\textquotedbl{}~into~\textquotedbl{}diff\textquotedbl{}.}{\scriptsize \par}
\end{lyxcode}
\caption{diff details}


\end{figure}



\subsubsection{gdiff\index{gdiff}}

This is the same as the diff command but uses (if configured) a graphical diff program you have on your system. See the settings command for details on how to set the graphical diff program.

\begin{figure}
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~gdiff}{\scriptsize \par}

{\scriptsize Usage:~fossil~diff|gdiff~?options?~?FILE?}{\scriptsize \par}

{\scriptsize Show~the~difference~between~the~current~version~of~FILE~(as~it}{\scriptsize \par}

{\scriptsize exists~on~disk)~and~that~same~file~as~it~was~checked~out.~~Or}{\scriptsize \par}

{\scriptsize if~the~FILE~argument~is~omitted,~show~the~unsaved~changed~currently}{\scriptsize \par}

{\scriptsize in~the~working~check-out.}{\scriptsize \par}

{\scriptsize If~the~\textquotedbl{}-{}-from~VERSION\textquotedbl{}~or~\textquotedbl{}-r~VERSION\textquotedbl{}~option~is~used~it~specifies}{\scriptsize \par}

{\scriptsize the~source~check-in~for~the~diff~operation.~~If~not~specified,~the~}{\scriptsize \par}

{\scriptsize source~check-in~is~the~base~check-in~for~the~current~check-out.}{\scriptsize \par}

{\scriptsize If~the~\textquotedbl{}-{}-to~VERSION\textquotedbl{}~option~appears,~it~specifies~the~check-in~from}{\scriptsize \par}

{\scriptsize which~the~second~version~of~the~file~or~files~is~taken.~~If~there~is}{\scriptsize \par}

{\scriptsize no~\textquotedbl{}-{}-to\textquotedbl{}~option~then~the~(possibly~edited)~files~in~the~current~check-out}{\scriptsize \par}

{\scriptsize are~used.}{\scriptsize \par}

{\scriptsize The~\textquotedbl{}-i\textquotedbl{}~command-line~option~forces~the~use~of~the~internal~diff~logic}{\scriptsize \par}

{\scriptsize rather~than~any~external~diff~program~that~might~be~configured~using}{\scriptsize \par}

{\scriptsize the~\textquotedbl{}setting\textquotedbl{}~command.~~If~no~external~diff~program~is~configured,~then}{\scriptsize \par}

{\scriptsize the~\textquotedbl{}-i\textquotedbl{}~option~is~a~no-op.~~The~\textquotedbl{}-i\textquotedbl{}~option~converts~\textquotedbl{}gdiff\textquotedbl{}~into~\textquotedbl{}diff\textquotedbl{}.}{\scriptsize \par}
\end{lyxcode}
\caption{gdiff details}


\end{figure}



\subsubsection{ui\index{ui} }

The ui command is used to start Fossil in a local webserver. The --port option is used to specify the port it uses, by default it uses 8080. It should automatically start the system's web browser and it will come up with the repository web page. If run within a working directory it will bring up the web page for that repository. If run outside the working directory you can specify the repository on the command line.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~help~ui}{\scriptsize \par}

{\scriptsize Usage:~fossil~server~?-P|-{}-port~TCPPORT?~?REPOSITORY?}{\scriptsize \par}

{\scriptsize{}~~~Or:~fossil~ui~?-P|-{}-port~TCPPORT?~?REPOSITORY?}{\scriptsize \par}



{\scriptsize Open~a~socket~and~begin~listening~and~responding~to~HTTP~requests~on}{\scriptsize \par}

{\scriptsize TCP~port~8080,~or~on~any~other~TCP~port~defined~by~the~-P~or}{\scriptsize \par}

{\scriptsize -{}-port~option.~~The~optional~argument~is~the~name~of~the~repository.}{\scriptsize \par}

{\scriptsize The~repository~argument~may~be~omitted~if~the~working~directory~is}{\scriptsize \par}

{\scriptsize within~an~open~checkout.}{\scriptsize \par}



{\scriptsize The~\textquotedbl{}ui\textquotedbl{}~command~automatically~starts~a~web~browser~after~initializing}{\scriptsize \par}

{\scriptsize the~web~server.}{\scriptsize \par}



{\scriptsize In~the~\textquotedbl{}server\textquotedbl{}~command,~the~REPOSITORY~can~be~a~directory~(aka~folder)}{\scriptsize \par}

{\scriptsize that~contains~one~or~more~repositories~with~names~ending~in~\textquotedbl{}.fossil\textquotedbl{}.}{\scriptsize \par}

{\scriptsize In~that~case,~the~first~element~of~the~URL~is~used~to~select~among~the}{\scriptsize \par}

{\scriptsize various~repositories.}{\scriptsize \par}
\end{lyxcode}
\caption{ui details}
\end{figure}



\subsubsection{server\index{server}}

This is a more powerful version of the ui command. This allows you to have multiple repositories supported by a single running Fossil webserver. This way you start the server and instead of a paricular repository you specify a directory where a number of repositories reside (all having the extension .fossil) then you can open and use any of them.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~server}{\scriptsize \par}

{\scriptsize Usage:~fossil~server~?-P|-{}-port~TCPPORT?~?REPOSITORY?}{\scriptsize \par}

{\scriptsize{}~~~Or:~fossil~ui~?-P|-{}-port~TCPPORT?~?REPOSITORY?}{\scriptsize \par}

{\scriptsize Open~a~socket~and~begin~listening~and~responding~to~HTTP~requests~on}{\scriptsize \par}

{\scriptsize TCP~port~8080,~or~on~any~other~TCP~port~defined~by~the~-P~or}{\scriptsize \par}

{\scriptsize -{}-port~option.~~The~optional~argument~is~the~name~of~the~repository.}{\scriptsize \par}

{\scriptsize The~repository~argument~may~be~omitted~if~the~working~directory~is}{\scriptsize \par}

{\scriptsize within~an~open~checkout.}{\scriptsize \par}

{\scriptsize The~\textquotedbl{}ui\textquotedbl{}~command~automatically~starts~a~web~browser~after~initializing}{\scriptsize \par}

{\scriptsize the~web~server.}{\scriptsize \par}

{\scriptsize In~the~\textquotedbl{}server\textquotedbl{}~command,~the~REPOSITORY~can~be~a~directory~(aka~folder)}{\scriptsize \par}

{\scriptsize that~contains~one~or~more~repositories~with~names~ending~in~\textquotedbl{}.fossil\textquotedbl{}.}{\scriptsize \par}

{\scriptsize In~that~case,~the~first~element~of~the~URL~is~used~to~select~among~the}{\scriptsize \par}

{\scriptsize various~repositories.}{\scriptsize \par}
\end{lyxcode}
\caption{server detail\label{fig:server-detail}}


\end{figure}



\subsubsection{commit\index{commit} or ci\index{ci}}

This is the command used to put the current changes in the working directory into the repository, giving this a new version and updating the timeline.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~help~commit}{\scriptsize \par}

{\scriptsize Usage:~fossil~commit~?OPTIONS?~?FILE...?}{\scriptsize \par}



{\scriptsize Create~a~new~version~containing~all~of~the~changes~in~the~current}{\scriptsize \par}

{\scriptsize checkout.~~You~will~be~prompted~to~enter~a~check-in~comment~unless}{\scriptsize \par}

{\scriptsize one~of~the~\textquotedbl{}-m\textquotedbl{}~or~\textquotedbl{}-M\textquotedbl{}~options~are~used~to~specify~a~comment.}{\scriptsize \par}

{\scriptsize \textquotedbl{}-m\textquotedbl{}~takes~a~single~string~for~the~commit~message~and~\textquotedbl{}-M\textquotedbl{}~requires}{\scriptsize \par}

{\scriptsize a~filename~from~which~to~read~the~commit~message.~If~neither~\textquotedbl{}-m\textquotedbl{}}{\scriptsize \par}

{\scriptsize nor~\textquotedbl{}-M\textquotedbl{}~are~specified~then~the~editor~defined~in~the~\textquotedbl{}editor\textquotedbl{}}{\scriptsize \par}

{\scriptsize fossil~option~(see~fossil~help~set)~will~be~used,~or~from~the}{\scriptsize \par}

{\scriptsize \textquotedbl{}VISUAL\textquotedbl{}~or~\textquotedbl{}EDITOR\textquotedbl{}~environment~variables~(in~that~order)~if~no}{\scriptsize \par}

{\scriptsize editor~is~set.}{\scriptsize \par}



{\scriptsize You~will~be~prompted~for~your~GPG~pass~phrase~in~order~to~sign~the}{\scriptsize \par}

{\scriptsize new~manifest~unless~the~\textquotedbl{}-{}-nosign\textquotedbl{}~options~is~used.~~All~files~that}{\scriptsize \par}

{\scriptsize have~changed~will~be~committed~unless~some~subset~of~files~is}{\scriptsize \par}

{\scriptsize specified~on~the~command~line.}{\scriptsize \par}



{\scriptsize The~-{}-branch~option~followed~by~a~branch~name~cases~the~new~check-in}{\scriptsize \par}

{\scriptsize to~be~placed~in~the~named~branch.~~The~-{}-bgcolor~option~can~be~followed}{\scriptsize \par}

{\scriptsize by~a~color~name~(ex:~~'\#ffc0c0')~to~specify~the~background~color~of}{\scriptsize \par}

{\scriptsize entries~in~the~new~branch~when~shown~in~the~web~timeline~interface.}{\scriptsize \par}

{\scriptsize A~check-in~is~not~permitted~to~fork~unless~the~-{}-force~or~-f}{\scriptsize \par}

{\scriptsize option~appears.~~A~check-in~is~not~allowed~against~a~closed~check-in.}{\scriptsize \par}

{\scriptsize The~-{}-private~option~creates~a~private~check-in~that~is~never~synced.}{\scriptsize \par}

{\scriptsize Children~of~private~check-ins~are~automatically~private.}{\scriptsize \par}



{\scriptsize Options:}{\scriptsize \par}

{\scriptsize{}~~~-{}-comment|-m~COMMENT-TEXT}{\scriptsize \par}

{\scriptsize{}~~~-{}-branch~NEW-BRANCH-NAME}{\scriptsize \par}

{\scriptsize{}~~~-{}-bgcolor~COLOR}{\scriptsize \par}

{\scriptsize{}~~~-{}-nosign}{\scriptsize \par}

{\scriptsize{}~~~-{}-force|-f}{\scriptsize \par}

{\scriptsize{}~~~-{}-private}{\scriptsize \par}

{\scriptsize{}~~~-{}-message-file|-M~COMMENT-FILE}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}{\scriptsize \par}
\end{lyxcode}
\caption{commit details}


\end{figure}


It's a very good idea to always put a comment (-comment or -m) text on any commit. This way you get documentation in the timeline.


\subsection{Maintenance commands}

These commands you will probably use less often since the actions they perform are not needed in normal operation. You will have to use them and referring here or to \textbf{fossil help} will probably be required before use. Some of them like new or clone are only needed when you start a repository. Others like rebuild or reconstruct are only needed to fix or update a repository. 


\subsubsection{new\index{new}}

This command is used to create a new repository. 

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~new}{\scriptsize \par}

{\scriptsize Usage:~fossil~new~?OPTIONS?~FILENAME}{\scriptsize \par}



{\scriptsize Create~a~repository~for~a~new~project~in~the~file~named~FILENAME.}{\scriptsize \par}

{\scriptsize This~command~is~distinct~from~\textquotedbl{}clone\textquotedbl{}.~~The~\textquotedbl{}clone\textquotedbl{}~command~makes}{\scriptsize \par}

{\scriptsize a~copy~of~an~existing~project.~~This~command~starts~a~new~project.}{\scriptsize \par}

{\scriptsize By~default,~your~current~login~name~is~used~to~create~the~default}{\scriptsize \par}

{\scriptsize admin~user.~This~can~be~overridden~using~the~-A|-{}-admin-user}{\scriptsize \par}

{\scriptsize parameter.}{\scriptsize \par}



{\scriptsize Options:}{\scriptsize \par}

{\scriptsize{}~~~-{}-admin-user|-A~USERNAME}{\scriptsize \par}

{\scriptsize{}~~~-{}-date-override~DATETIME}{\scriptsize \par}
\end{lyxcode}
\caption{new details}


\end{figure}


The file name specifies the new repository name. The options provided allow you to specify the admin user name if you want it to be different than your current login and the starting date if you want it to be different than now.


\subsubsection{clone\index{clone}}

The clone command is used to create your own local version of the master repository. If you are supporting multiple users via a network accessible version of the original repository (see Section\vref{sub:Server-Setup}), then this command will copy that repository to your machine. Also it will make a link between your copy and the master, so that changes made in your copy will be propagated to the master.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~help~clone}{\scriptsize \par}

{\scriptsize Usage:~fossil~clone~?OPTIONS?~URL~FILENAME}{\scriptsize \par}



{\scriptsize Make~a~clone~of~a~repository~specified~by~URL~in~the~local}{\scriptsize \par}

{\scriptsize file~named~FILENAME.~}{\scriptsize \par}



{\scriptsize By~default,~your~current~login~name~is~used~to~create~the~default}{\scriptsize \par}

{\scriptsize admin~user.~This~can~be~overridden~using~the~-A|-{}-admin-user}{\scriptsize \par}

{\scriptsize parameter.}{\scriptsize \par}

{\scriptsize Options:}{\scriptsize \par}



{\scriptsize{}~~~-{}-admin-user|-A~USERNAME}{\scriptsize \par}
\end{lyxcode}
\caption{clone details}


\end{figure}


Just like create you can specify the admin user for this clone with an option. The URL for the master repository is of the form:
\begin{lyxcode}
http://<user>:<password>@domain
\end{lyxcode}
Where \textbf{user} and \textbf{password} are for a valid user of the selected repository. It is best to check the path with a browser before doing the clone. Make sure you can reach it, for example the repository for this book is:
\begin{lyxcode}
http://pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi
\end{lyxcode}
Putting that into a browser should get you the home page for this book. (See Figure \vref{fig:Web-access-to}). After you have verified that, then running the clone command should work. 

Don't forget (as I always do) to put in the file name for the local repository, (see FILENAME above)


\subsubsection{open\index{open}}

The open command is used to copy the files in a repository to a working directory. Doing this allows you to build or modify the product. The command also links this working directory to the repository so commits will go into the repository.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~open}{\scriptsize \par}

{\scriptsize Usage:~fossil~open~FILENAME~?VERSION?~?-{}-keep?}{\scriptsize \par}



{\scriptsize Open~a~connection~to~the~local~repository~in~FILENAME.~~A~checkout}{\scriptsize \par}

{\scriptsize for~the~repository~is~created~with~its~root~at~the~working~directory.}{\scriptsize \par}

{\scriptsize If~VERSION~is~specified~then~that~version~is~checked~out.~~Otherwise}{\scriptsize \par}

{\scriptsize the~latest~version~is~checked~out.~~No~files~other~than~\textquotedbl{}manifest\textquotedbl{}}{\scriptsize \par}

{\scriptsize and~\textquotedbl{}manifest.uuid\textquotedbl{}~are~modified~if~the~-{}-keep~option~is~present.}{\scriptsize \par}



{\scriptsize See~also~the~\textquotedbl{}close\textquotedbl{}~command.}{\scriptsize \par}
\end{lyxcode}
\caption{open details}


\end{figure}


If you have multiple users or have a branched repository then it is probably wise to specify the particular version you want. When you run this it will create all the files and directories in the repository in your work area. In addition the files \_FOSSIL\_, manifiest and manifest.uuid will be created by Fossil.


\subsubsection{close\index{close}}

This is the opposite of open, in that it breaks the connection between this working directory and the Fossil repository.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~close}{\scriptsize \par}

{\scriptsize Usage:~fossil~close~?-f|-{}-force?}{\scriptsize \par}



{\scriptsize The~opposite~of~\textquotedbl{}open\textquotedbl{}.~~Close~the~current~database~connection.}{\scriptsize \par}

{\scriptsize Require~a~-f~or~-{}-force~flag~if~there~are~unsaved~changed~in~the}{\scriptsize \par}

{\scriptsize current~check-out.}{\scriptsize \par}
\end{lyxcode}
\caption{close details}


\end{figure}


This is useful if you need to abandon the current working directory. Fossil will not let you do this if there are changes between the current directory and the repository. With the force flag you can explicitly cut the connection even if there are changes.


\subsubsection{version\index{version}}

This command is used to show the current version of fossil.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~version}{\scriptsize \par}

{\scriptsize Usage:~fossil~version}{\scriptsize \par}

{\scriptsize Print~the~source~code~version~number~for~the~fossil~executable.}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~version}{\scriptsize \par}

{\scriptsize This~is~fossil~version~{[}c56af61e5e{]}~2010-04-22~15:48:25~UTC}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}{\scriptsize \par}
\end{lyxcode}
\caption{version details}


\end{figure}


The above figure shows the help and example of running the command. When you have problems with fossil it is very important to have this version information. You can then inquire of the Fossil news group about this problem and with the version information they can easily tell you if the problem is fixed already or is new.


\subsubsection{rebuild\index{rebuild}}

If you update your copy of Fossil you will want to run this command against all the repositories you have. This will automatically update them to the new version of Fossil.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~rebuild}{\scriptsize \par}

{\scriptsize Usage:~fossil~rebuild~?REPOSITORY?}{\scriptsize \par}

{\scriptsize Reconstruct~the~named~repository~database~from~the~core}{\scriptsize \par}

{\scriptsize records.~~Run~this~command~after~updating~the~fossil}{\scriptsize \par}

{\scriptsize executable~in~a~way~that~changes~the~database~schema.}{\scriptsize \par}
\end{lyxcode}
\caption{rebuild details}


\end{figure}



\subsubsection{all\index{all}}

This command is actually a modifier and when used before certain commands will run them on all the repositories.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~all}{\scriptsize \par}

{\scriptsize Usage:~fossil~all~(list|ls|pull|push|rebuild|sync)}{\scriptsize \par}

{\scriptsize The~\textasciitilde{}/.fossil~file~records~the~location~of~all~repositories~for~a}{\scriptsize \par}

{\scriptsize user.~~This~command~performs~certain~operations~on~all~repositories}{\scriptsize \par}

{\scriptsize that~can~be~useful~before~or~after~a~period~of~disconnection~operation.}{\scriptsize \par}

{\scriptsize Available~operations~are:}{\scriptsize \par}

{\scriptsize{}~~~list~~~~~~~Display~the~location~of~all~repositories}{\scriptsize \par}

{\scriptsize{}~~~ls~~~~~~~~~An~alias~for~\textquotedbl{}list\textquotedbl{}}{\scriptsize \par}

{\scriptsize{}~~~pull~~~~~~~Run~a~\textquotedbl{}pull\textquotedbl{}~operation~on~all~repositories}{\scriptsize \par}

{\scriptsize{}~~~push~~~~~~~Run~a~\textquotedbl{}push\textquotedbl{}~on~all~repositories}{\scriptsize \par}

{\scriptsize{}~~~rebuild~~~~Rebuild~on~all~repositories}{\scriptsize \par}

{\scriptsize{}~~~sync~~~~~~~Run~a~\textquotedbl{}sync\textquotedbl{}~on~all~repositories}{\scriptsize \par}

{\scriptsize Repositories~are~automatically~added~to~the~set~of~known~repositories}{\scriptsize \par}

{\scriptsize when~one~of~the~following~commands~against~the~repository:~clone,~info,}{\scriptsize \par}

{\scriptsize pull,~push,~or~sync}{\scriptsize \par}
\end{lyxcode}
\caption{all details}


\end{figure}



\subsubsection{push\index{push}}

This command will push changes in the local repository to the master or remote repository.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~push}{\scriptsize \par}

{\scriptsize Usage:~fossil~push~?URL?~?options?}{\scriptsize \par}

{\scriptsize Push~changes~in~the~local~repository~over~into~a~remote~repository.}{\scriptsize \par}

{\scriptsize Use~the~\textquotedbl{}-R~REPO\textquotedbl{}~or~\textquotedbl{}-{}-repository~REPO\textquotedbl{}~command-line~options}{\scriptsize \par}

{\scriptsize to~specify~an~alternative~repository~file.}{\scriptsize \par}

{\scriptsize If~the~URL~is~not~specified,~then~the~URL~from~the~most~recent}{\scriptsize \par}

{\scriptsize clone,~push,~pull,~remote-url,~or~sync~command~is~used.}{\scriptsize \par}

{\scriptsize The~URL~specified~normally~becomes~the~new~\textquotedbl{}remote-url\textquotedbl{}~used~for}{\scriptsize \par}

{\scriptsize subsequent~push,~pull,~and~sync~operations.~~However,~the~\textquotedbl{}-{}-once\textquotedbl{}}{\scriptsize \par}

{\scriptsize command-line~option~makes~the~URL~a~one-time-use~URL~that~is~not}{\scriptsize \par}

{\scriptsize saved.}{\scriptsize \par}

{\scriptsize See~also:~clone,~pull,~sync,~remote-url}{\scriptsize \par}
\end{lyxcode}
\caption{push details}


\end{figure}



\subsubsection{pull\index{pull}}

This command will copy changes from the remote repository to the local repository. You could then use \textbf{update} to apply these changes to checked out files.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~pull}{\scriptsize \par}

{\scriptsize Usage:~fossil~pull~?URL?~?options?}{\scriptsize \par}

{\scriptsize Pull~changes~from~a~remote~repository~into~the~local~repository.}{\scriptsize \par}

{\scriptsize Use~the~\textquotedbl{}-R~REPO\textquotedbl{}~or~\textquotedbl{}-{}-repository~REPO\textquotedbl{}~command-line~options}{\scriptsize \par}

{\scriptsize to~specify~an~alternative~repository~file.}{\scriptsize \par}

{\scriptsize If~the~URL~is~not~specified,~then~the~URL~from~the~most~recent}{\scriptsize \par}

{\scriptsize clone,~push,~pull,~remote-url,~or~sync~command~is~used.}{\scriptsize \par}

{\scriptsize The~URL~specified~normally~becomes~the~new~\textquotedbl{}remote-url\textquotedbl{}~used~for}{\scriptsize \par}

{\scriptsize subsequent~push,~pull,~and~sync~operations.~~However,~the~\textquotedbl{}-{}-once\textquotedbl{}}{\scriptsize \par}

{\scriptsize command-line~option~makes~the~URL~a~one-time-use~URL~that~is~not}{\scriptsize \par}

{\scriptsize saved.}{\scriptsize \par}

{\scriptsize See~also:~clone,~push,~sync,~remote-url}{\scriptsize \par}


\end{lyxcode}
\caption{pull details}


\end{figure}



\subsubsection{sync\index{sync}}

This command is used to sync a remote copy with the original copy of the repository, it does both a push and pull. This can also be used to switch a local repository to a different main repository by specifying the URL of a remote repository. If you want to run the update command with -n where it does a dry run, this does not do a sync first so doing fossil sync then fossil update -n will do that for you.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~sync}{\scriptsize \par}

{\scriptsize Usage:~fossil~sync~?URL?~?options?}{\scriptsize \par}

{\scriptsize Synchronize~the~local~repository~with~a~remote~repository.~~This~is}{\scriptsize \par}

{\scriptsize the~equivalent~of~running~both~\textquotedbl{}push\textquotedbl{}~and~\textquotedbl{}pull\textquotedbl{}~at~the~same~time.}{\scriptsize \par}

{\scriptsize Use~the~\textquotedbl{}-R~REPO\textquotedbl{}~or~\textquotedbl{}-{}-repository~REPO\textquotedbl{}~command-line~options}{\scriptsize \par}

{\scriptsize to~specify~an~alternative~repository~file.}{\scriptsize \par}

{\scriptsize If~a~user-id~and~password~are~required,~specify~them~as~follows:}{\scriptsize \par}

{\scriptsize{}~~~~http://userid:password@www.domain.com:1234/path}{\scriptsize \par}

{\scriptsize If~the~URL~is~not~specified,~then~the~URL~from~the~most~recent~successful}{\scriptsize \par}

{\scriptsize clone,~push,~pull,~remote-url,~or~sync~command~is~used.}{\scriptsize \par}

{\scriptsize The~URL~specified~normally~becomes~the~new~\textquotedbl{}remote-url\textquotedbl{}~used~for}{\scriptsize \par}

{\scriptsize subsequent~push,~pull,~and~sync~operations.~~However,~the~\textquotedbl{}-{}-once\textquotedbl{}}{\scriptsize \par}

{\scriptsize command-line~option~makes~the~URL~a~one-time-use~URL~that~is~not}{\scriptsize \par}

{\scriptsize saved.}{\scriptsize \par}

{\scriptsize See~also:~~clone,~push,~pull,~remote-url}{\scriptsize \par}
\end{lyxcode}
\caption{sync details}


\end{figure}



\subsubsection{clean\index{clean}}

This call can be used to remove all the ``extra'' files in a source tree. This is useful if you wish to tidy up a source tree or to do a clean build.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~clean}{\scriptsize \par}

{\scriptsize Usage:~fossil~clean~?-{}-force?~?-{}-dotfiles?}{\scriptsize \par}

{\scriptsize Delete~all~\textquotedbl{}extra\textquotedbl{}~files~in~the~source~tree.~~\textquotedbl{}Extra\textquotedbl{}~files~are}{\scriptsize \par}

{\scriptsize files~that~are~not~officially~part~of~the~checkout.~~See~also}{\scriptsize \par}

{\scriptsize the~\textquotedbl{}extra\textquotedbl{}~command.~This~operation~cannot~be~undone.~}{\scriptsize \par}

{\scriptsize You~will~be~prompted~before~removing~each~file.~If~you~are}{\scriptsize \par}

{\scriptsize sure~you~wish~to~remove~all~\textquotedbl{}extra\textquotedbl{}~files~you~can~specify~the}{\scriptsize \par}

{\scriptsize optional~-{}-force~flag~and~no~prompts~will~be~issued.}{\scriptsize \par}

{\scriptsize Files~and~subdirectories~whose~names~begin~with~\textquotedbl{}.\textquotedbl{}~are}{\scriptsize \par}

{\scriptsize normally~ignored.~~They~are~included~if~the~\textquotedbl{}-{}-dotfiles\textquotedbl{}~option}{\scriptsize \par}

{\scriptsize is~used.}{\scriptsize \par}
\end{lyxcode}
\caption{clean details}


\end{figure}



\subsubsection{branch\index{branch}}

This command is used if you want to create or list branches in a repository. Previously we discussed forks ( See Section \vref{sub:Complications}); branches are the same idea but under user control. This would be where you have version 1.0 of something but want to branch off version 2.0 to add new features but want to keep a 1.0 branch for maintenance.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~branch}{\scriptsize \par}

{\scriptsize Usage:~fossil~branch~SUBCOMMAND~...~?-R|-{}-repository~FILE?}{\scriptsize \par}

{\scriptsize Run~various~subcommands~on~the~branches~of~the~open~repository~or}{\scriptsize \par}

{\scriptsize of~the~repository~identified~by~the~-R~or~-{}-repository~option.}{\scriptsize \par}

{\scriptsize{}~~~fossil~branch~new~BRANCH-NAME~BASIS~?-bgcolor~COLOR?~}{\scriptsize \par}

{\scriptsize{}~~~~~~~Create~a~new~branch~BRANCH-NAME~off~of~check-in~BASIS.}{\scriptsize \par}

{\scriptsize{}~~~~~~~You~can~optionally~give~the~branch~a~default~color.}{\scriptsize \par}

{\scriptsize{}~~~fossil~branch~list}{\scriptsize \par}

{\scriptsize{}~~~~~~~List~all~branches}{\scriptsize \par}
\end{lyxcode}
\caption{branch details}


\end{figure}



\subsubsection{merge\index{merge}}

This command does the opposite of branch, it brings two branches together.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~merge}{\scriptsize \par}

{\scriptsize Usage:~fossil~merge~{[}-{}-cherrypick{]}~{[}-{}-backout{]}~VERSION}{\scriptsize \par}

{\scriptsize The~argument~is~a~version~that~should~be~merged~into~the~current}{\scriptsize \par}

{\scriptsize checkout.~~All~changes~from~VERSION~back~to~the~nearest~common}{\scriptsize \par}

{\scriptsize ancestor~are~merged.~~Except,~if~either~of~the~-{}-cherrypick~or}{\scriptsize \par}

{\scriptsize -{}-backout~options~are~used~only~the~changes~associated~with~the}{\scriptsize \par}

{\scriptsize single~check-in~VERSION~are~merged.~~The~-{}-backout~option~causes}{\scriptsize \par}

{\scriptsize the~changes~associated~with~VERSION~to~be~removed~from~the~current}{\scriptsize \par}

{\scriptsize checkout~rather~than~added.}{\scriptsize \par}

{\scriptsize Only~file~content~is~merged.~~The~result~continues~to~use~the}{\scriptsize \par}

{\scriptsize file~and~directory~names~from~the~current~checkout~even~if~those}{\scriptsize \par}

{\scriptsize names~might~have~been~changed~in~the~branch~being~merged~in.}{\scriptsize \par}

{\scriptsize Other~options:}{\scriptsize \par}

{\scriptsize{}~~-{}-detail~~~~~~~~~~~~~~~~Show~additional~details~of~the~merge}{\scriptsize \par}

{\scriptsize{}~~-{}-binary~GLOBPATTERN~~~~Treat~files~that~match~GLOBPATTERN~as~binary}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~~~~~~~and~do~not~try~to~merge~parallel~changes.~~This}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~~~~~~~option~overrides~the~\textquotedbl{}binary-glob\textquotedbl{}~setting.}{\scriptsize \par}
\end{lyxcode}
\caption{merge details}


\end{figure}



\subsubsection{tag\index{tag}}

This command can be used to control ``tags'' which are attributes added to any entry in the time line. You can also add/delete/control these tags from the UI by going into the timeline, picking an entry then doing an edit. See Figure \vref{fig:Remove-Leaf}. 

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~tag}{\scriptsize \par}

{\scriptsize Usage:~fossil~tag~SUBCOMMAND~...}{\scriptsize \par}

{\scriptsize Run~various~subcommands~to~control~tags~and~properties}{\scriptsize \par}

{\scriptsize{}~~~~fossil~tag~add~?-{}-raw?~?-{}-propagate?~TAGNAME~CHECK-IN~?VALUE?}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Add~a~new~tag~or~property~to~CHECK-IN.~The~tag~will}{\scriptsize \par}

{\scriptsize{}~~~~~~~~be~usable~instead~of~a~CHECK-IN~in~commands~such~as}{\scriptsize \par}

{\scriptsize{}~~~~~~~~update~and~merge.~~If~the~-{}-propagate~flag~is~present,}{\scriptsize \par}

{\scriptsize{}~~~~~~~~the~tag~value~propagates~to~all~descendants~of~CHECK-IN}{\scriptsize \par}

{\scriptsize{}~~~~fossil~tag~cancel~?-{}-raw?~TAGNAME~CHECK-IN}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Remove~the~tag~TAGNAME~from~CHECK-IN,~and~also~remove}{\scriptsize \par}

{\scriptsize{}~~~~~~~~the~propagation~of~the~tag~to~any~descendants.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~tag~find~?-{}-raw?~TAGNAME}{\scriptsize \par}

{\scriptsize{}~~~~~~~~List~all~check-ins~that~use~TAGNAME}{\scriptsize \par}

{\scriptsize{}~~~~fossil~tag~list~?-{}-raw?~?CHECK-IN?}{\scriptsize \par}

{\scriptsize{}~~~~~~~~List~all~tags,~or~if~CHECK-IN~is~supplied,~list}{\scriptsize \par}

{\scriptsize{}~~~~~~~~all~tags~and~their~values~for~CHECK-IN.}{\scriptsize \par}

{\scriptsize The~option~-{}-raw~allows~the~manipulation~of~all~types~of~tags}{\scriptsize \par}

{\scriptsize used~for~various~internal~purposes~in~fossil.~It~also~shows}{\scriptsize \par}

{\scriptsize \textquotedbl{}cancel\textquotedbl{}~tags~for~the~\textquotedbl{}find\textquotedbl{}~and~\textquotedbl{}list\textquotedbl{}~subcommands.~You~should}{\scriptsize \par}

{\scriptsize not~use~this~option~to~make~changes~unless~you~are~sure~what}{\scriptsize \par}

{\scriptsize you~are~doing.}{\scriptsize \par}

{\scriptsize If~you~need~to~use~a~tagname~that~might~be~confused~with}{\scriptsize \par}

{\scriptsize a~hexadecimal~baseline~or~artifact~ID,~you~can~explicitly}{\scriptsize \par}

{\scriptsize disambiguate~it~by~prefixing~it~with~\textquotedbl{}tag:\textquotedbl{}.~For~instance:}{\scriptsize \par}

{\scriptsize{}~~fossil~update~decaf}{\scriptsize \par}

{\scriptsize will~be~taken~as~an~artifact~or~baseline~ID~and~fossil~will}{\scriptsize \par}

{\scriptsize probably~complain~that~no~such~revision~was~found.~However}{\scriptsize \par}

{\scriptsize{}~~fossil~update~tag:decaf}{\scriptsize \par}

{\scriptsize will~assume~that~\textquotedbl{}decaf\textquotedbl{}~is~a~tag/branch~name.}{\scriptsize \par}
\end{lyxcode}
\caption{tag details}


\end{figure}



\subsubsection{settings\index{settings}}

This command is used to set or unset a number of properties for fossil.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~settings}{\scriptsize \par}

{\scriptsize COMMAND:~settings}{\scriptsize \par}

{\scriptsize COMMAND:~unset}{\scriptsize \par}

{\scriptsize fossil~setting~?PROPERTY?~?VALUE?~?-global?}{\scriptsize \par}

{\scriptsize fossil~unset~PROPERTY~?-global?}{\scriptsize \par}

{\scriptsize The~\textquotedbl{}setting\textquotedbl{}~command~with~no~arguments~lists~all~properties~and~their}{\scriptsize \par}

{\scriptsize values.~~With~just~a~property~name~it~shows~the~value~of~that~property.}{\scriptsize \par}

{\scriptsize With~a~value~argument~it~changes~the~property~for~the~current~repository.}{\scriptsize \par}

{\scriptsize The~\textquotedbl{}unset\textquotedbl{}~command~clears~a~property~setting.}{\scriptsize \par}

{\scriptsize{}~~~auto-captcha~~~~~If~enabled,~the~Login~page~will~provide~a~button}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~which~uses~JavaScript~to~fill~out~the~captcha~for}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~the~\textquotedbl{}anonymous\textquotedbl{}~user.~(Most~bots~cannot~use~JavaScript.)}{\scriptsize \par}

{\scriptsize{}~~~autosync~~~~~~~~~If~enabled,~automatically~pull~prior~to~commit}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~or~update~and~automatically~push~after~commit~or}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~tag~or~branch~creation.~~If~the~the~value~is~\textquotedbl{}pullonly\textquotedbl{}}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~then~only~pull~operations~occur~automatically.}{\scriptsize \par}

{\scriptsize{}~~~binary-glob~~~~~~The~VALUE~is~a~comma-separated~list~of~GLOB~patterns}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~that~should~be~treated~as~binary~files~for~merging}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~purposes.~~Example:~~~{*}.xml}{\scriptsize \par}

{\scriptsize{}~~~clearsign~~~~~~~~When~enabled,~fossil~will~attempt~to~sign~all~commits}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~with~gpg.~~When~disabled~(the~default),~commits~will}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~be~unsigned.}{\scriptsize \par}

{\scriptsize{}~~~diff-command~~~~~External~command~to~run~when~performing~a~diff.}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~If~undefined,~the~internal~text~diff~will~be~used.}{\scriptsize \par}

{\scriptsize{}~~~dont-push~~~~~~~~Prevent~this~repository~from~pushing~from~client~to}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~server.~~Useful~when~setting~up~a~private~branch.}{\scriptsize \par}

{\scriptsize{}~~~editor~~~~~~~~~~~Text~editor~command~used~for~check-in~comments.}{\scriptsize \par}

{\scriptsize{}~~~gdiff-command~~~~External~command~to~run~when~performing~a~graphical}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~diff.~If~undefined,~text~diff~will~be~used.}{\scriptsize \par}

{\scriptsize{}~~~http-port~~~~~~~~The~TCP/IP~port~number~to~use~by~the~\textquotedbl{}server\textquotedbl{}}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~and~\textquotedbl{}ui\textquotedbl{}~commands.~~Default:~8080}{\scriptsize \par}

{\scriptsize{}~~~ignore-glob~~~~~~The~VALUE~is~a~comma-separated~list~of~GLOB~patterns}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~specifying~files~that~the~\textquotedbl{}extra\textquotedbl{}~command~will~ignore.}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~Example:~~{*}.o,{*}.obj,{*}.exe}{\scriptsize \par}

{\scriptsize{}~~~localauth~~~~~~~~If~enabled,~require~that~HTTP~connections~from}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~127.0.0.1~be~authenticated~by~password.~~If}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~false,~all~HTTP~requests~from~localhost~have}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~unrestricted~access~to~the~repository.}{\scriptsize \par}

{\scriptsize{}~~~mtime-changes~~~~Use~file~modification~times~(mtimes)~to~detect~when}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~files~have~been~modified.~~(Default~\textquotedbl{}on\textquotedbl{}.)}{\scriptsize \par}

{\scriptsize{}~~~pgp-command~~~~~~Command~used~to~clear-sign~manifests~at~check-in.}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~The~default~is~\textquotedbl{}gpg~-{}-clearsign~-o~\textquotedbl{}.}{\scriptsize \par}

{\scriptsize{}~~~proxy~~~~~~~~~~~~URL~of~the~HTTP~proxy.~~If~undefined~or~\textquotedbl{}off\textquotedbl{}~then}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~the~\textquotedbl{}http\_proxy\textquotedbl{}~environment~variable~is~consulted.}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~If~the~http\_proxy~environment~variable~is~undefined}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~then~a~direct~HTTP~connection~is~used.}{\scriptsize \par}

{\scriptsize{}~~~web-browser~~~~~~A~shell~command~used~to~launch~your~preferred}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~web~browser~when~given~a~URL~as~an~argument.}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~Defaults~to~\textquotedbl{}start\textquotedbl{}~on~windows,~\textquotedbl{}open\textquotedbl{}~on~Mac,}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~and~\textquotedbl{}firefox\textquotedbl{}~on~Unix.}{\scriptsize \par}
\end{lyxcode}
\caption{settings details}


\end{figure}



\subsection{Miscellaneous }

These are commands that don't seem to fit in any category but are useful. 


\subsubsection{zip\index{zip}}

You can do what this command does from the web based user interface. In Figure \vref{fig:Timeline-Detail} you can download a ZIP archive of the particular version of the files. This command lets you do it from the command line.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~zip}{\scriptsize \par}

{\scriptsize Usage:~fossil~zip~VERSION~OUTPUTFILE~{[}-{}-name~DIRECTORYNAME{]}}{\scriptsize \par}

{\scriptsize Generate~a~ZIP~archive~for~a~specified~version.~~If~the~-{}-name~option~is}{\scriptsize \par}

{\scriptsize used,~it~argument~becomes~the~name~of~the~top-level~directory~in~the}{\scriptsize \par}

{\scriptsize resulting~ZIP~archive.~~If~-{}-name~is~omitted,~the~top-level~directory}{\scriptsize \par}

{\scriptsize named~is~derived~from~the~project~name,~the~check-in~date~and~time,~and}{\scriptsize \par}

{\scriptsize the~artifact~ID~of~the~check-in.}{\scriptsize \par}
\end{lyxcode}
\caption{zip detail}


\end{figure}



\subsubsection{user\index{user}}

This command lets you modify user information. Again this is a command line duplication of what you can do from the user interface in the browser, see Figure \vref{fig:New-Editor-user}.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~user}{\scriptsize \par}

{\scriptsize Usage:~fossil~user~SUBCOMMAND~...~~?-R|-{}-repository~FILE?}{\scriptsize \par}

{\scriptsize Run~various~subcommands~on~users~of~the~open~repository~or~of}{\scriptsize \par}

{\scriptsize the~repository~identified~by~the~-R~or~-{}-repository~option.}{\scriptsize \par}

{\scriptsize{}~~~fossil~user~capabilities~USERNAME~?STRING?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Query~or~set~the~capabilities~for~user~USERNAME}{\scriptsize \par}

{\scriptsize{}~~~fossil~user~default~?USERNAME?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Query~or~set~the~default~user.~~The~default~user~is~the}{\scriptsize \par}

{\scriptsize{}~~~~~~~user~for~command-line~interaction.}{\scriptsize \par}

{\scriptsize{}~~~fossil~user~list}{\scriptsize \par}

{\scriptsize{}~~~~~~~List~all~users~known~to~the~repository}{\scriptsize \par}

{\scriptsize{}~~~fossil~user~new~?USERNAME?~?CONTACT-INFO?~?PASSWORD?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Create~a~new~user~in~the~repository.~~Users~can~never~be}{\scriptsize \par}

{\scriptsize{}~~~~~~~deleted.~~They~can~be~denied~all~access~but~they~must~continue}{\scriptsize \par}

{\scriptsize{}~~~~~~~to~exist~in~the~database.}{\scriptsize \par}

{\scriptsize{}~~~fossil~user~password~USERNAME~?PASSWORD?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Change~the~web~access~password~for~a~user.}{\scriptsize \par}
\end{lyxcode}
\caption{user detail}


\end{figure}



\subsubsection{finfo\index{finfo}}

This command will print the history of any particular file. This can be useful if you need this history in some other system. You can pass this text file to the other system which can than parse and use the data.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~finfo}{\scriptsize \par}

{\scriptsize Usage:~fossil~finfo~FILENAME}{\scriptsize \par}

{\scriptsize Print~the~change~history~for~a~single~file.}{\scriptsize \par}

{\scriptsize The~\textquotedbl{}-{}-limit~N\textquotedbl{}~and~\textquotedbl{}-{}-offset~P\textquotedbl{}~options~limits~the~output~to~the~first}{\scriptsize \par}

{\scriptsize N~changes~after~skipping~P~changes.}{\scriptsize \par}
\end{lyxcode}
\caption{finfo detail}


\end{figure}


An example would be to run it on the outline.txt file in our book directory:
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~}\textbf{\scriptsize finfo~outline.txt}{\scriptsize \par}

{\scriptsize History~of~outline.txt}{\scriptsize \par}

{\scriptsize 2010-05-17~{[}0272dc0169{]}~Finished~maintenance~commands~(user:~jim,~artifact:}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~{[}25b6e38e97{]})}{\scriptsize \par}

{\scriptsize 2010-05-12~{[}5e5c0f7d55{]}~End~of~day~commit~(user:~jim,~artifact:~{[}d1a1d31fbd{]})}{\scriptsize \par}

{\scriptsize 2010-05-10~{[}e924ca3525{]}~End~of~day~update~(user:~jim,~artifact:~{[}7cd19079a1{]})}{\scriptsize \par}

{\scriptsize 2010-05-09~{[}0abb95b046{]}~Intermediate~commit,~not~done~with~basic~commands}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~(user:~jim,~artifact:~{[}6f7bcd48b9{]})}{\scriptsize \par}

{\scriptsize 2010-05-07~{[}6921e453cd{]}~Update~outline~\&~book~corrections~(user:~jim,}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~artifact:~{[}4eff85c793{]})}{\scriptsize \par}

{\scriptsize 2010-05-03~{[}158492516c{]}~Moved~to~clone~repository~(user:~jim,~artifact:}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~{[}23b729cb66{]})}{\scriptsize \par}

{\scriptsize 2010-05-03~{[}1a403c87fc{]}~Update~before~moving~to~server~(user:~jim,~artifact:}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~{[}706a9d394d{]})}{\scriptsize \par}

{\scriptsize 2010-04-30~{[}fa5b9247bd{]}~Working~on~chapter~1~(user:~jim,~artifact:}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~{[}7bb188f0c6{]})}{\scriptsize \par}

{\scriptsize 2010-04-29~{[}51be6423a3{]}~Update~outline~(user:~jim,~artifact:~{[}7cd39dfa06{]})}{\scriptsize \par}

{\scriptsize 2010-04-27~{[}39bc728527{]}~{[}1665c78d94{]}~Ticket~Use~(user:~jim,~artifact:}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~{[}1f82aaf41c{]})}{\scriptsize \par}

{\scriptsize 2010-04-26~{[}497b93858f{]}~Update~to~catch~changes~in~outline~(user:~jim,}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~artifact:~{[}b870231e48{]})}{\scriptsize \par}

{\scriptsize 2010-04-25~{[}8fa0708186{]}~Initial~Commit~(user:~jim,~artifact:~{[}34a460a468{]})}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}{\scriptsize \par}
\end{lyxcode}

\subsubsection{timeline\index{timeline}}

This prints out the timeline of the project in various ways. The command would be useful if you were building a GUI front end for Fossil and wanted to display the timeline. You could issue this command and get the result back and display it in your UI. There are a number of options in the command to control the listing.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~timeline}{\scriptsize \par}

{\scriptsize Usage:~fossil~timeline~?WHEN?~?BASELINE|DATETIME?~?-n~N?~?-t~TYPE?}{\scriptsize \par}

{\scriptsize Print~a~summary~of~activity~going~backwards~in~date~and~time}{\scriptsize \par}

{\scriptsize specified~or~from~the~current~date~and~time~if~no~arguments}{\scriptsize \par}

{\scriptsize are~given.~~Show~as~many~as~N~(default~20)~check-ins.~~The}{\scriptsize \par}

{\scriptsize WHEN~argument~can~be~any~unique~abbreviation~of~one~of~these}{\scriptsize \par}

{\scriptsize keywords:}{\scriptsize \par}

{\scriptsize{}~~~~before}{\scriptsize \par}

{\scriptsize{}~~~~after}{\scriptsize \par}

{\scriptsize{}~~~~descendants~|~children}{\scriptsize \par}

{\scriptsize{}~~~~ancestors~|~parents}{\scriptsize \par}

{\scriptsize The~BASELINE~can~be~any~unique~prefix~of~4~characters~or~more.}{\scriptsize \par}

{\scriptsize The~DATETIME~should~be~in~the~ISO8601~format.~~For}{\scriptsize \par}

{\scriptsize examples:~\textquotedbl{}2007-08-18~07:21:21\textquotedbl{}.~~You~can~also~say~\textquotedbl{}current\textquotedbl{}}{\scriptsize \par}

{\scriptsize for~the~current~version~or~\textquotedbl{}now\textquotedbl{}~for~the~current~time.}{\scriptsize \par}

{\scriptsize The~optional~TYPE~argument~may~any~types~supported~by~the~/timeline}{\scriptsize \par}

{\scriptsize page.~For~example:}{\scriptsize \par}

{\scriptsize{}~~~~w~~=~wiki~commits~only}{\scriptsize \par}

{\scriptsize{}~~~~ci~=~file~commits~only}{\scriptsize \par}

{\scriptsize{}~~~~t~~=~tickets~only}{\scriptsize \par}
\end{lyxcode}
\caption{timeline detail}


\end{figure}



\subsubsection{wiki\index{wiki}}

This command allows you to have command line control of the wiki. Again this is useful if you were writing a shell to control Fossil or wanted to add a number of computer generated pages to the Wiki.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~wiki}{\scriptsize \par}

{\scriptsize Usage:~fossil~wiki~(export|create|commit|list)~WikiName}{\scriptsize \par}

{\scriptsize Run~various~subcommands~to~work~with~wiki~entries.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~export~PAGENAME~?FILE?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Sends~the~latest~version~of~the~PAGENAME~wiki}{\scriptsize \par}

{\scriptsize{}~~~~~~~entry~to~the~given~file~or~standard~output.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~commit~PAGENAME~?FILE?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Commit~changes~to~a~wiki~page~from~FILE~or~from~standard}{\scriptsize \par}

{\scriptsize{}~~~~~~~input.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~create~PAGENAME~?FILE?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Create~a~new~wiki~page~with~initial~content~taken~from}{\scriptsize \par}

{\scriptsize{}~~~~~~~FILE~or~from~standard~input.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~list}{\scriptsize \par}

{\scriptsize{}~~~~~~~Lists~all~wiki~entries,~one~per~line,~ordered}{\scriptsize \par}

{\scriptsize{}~~~~~~~case-insentively~by~name.}{\scriptsize \par}

{\scriptsize TODOs:}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~export~?-u~ARTIFACT?~WikiName~?FILE?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Outputs~the~selected~version~of~WikiName.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~delete~?-m~MESSAGE?~WikiName}{\scriptsize \par}

{\scriptsize{}~~~~~~~The~same~as~deleting~a~file~entry,~but~i~don't~know~if~fossil}{\scriptsize \par}

{\scriptsize{}~~~~~~~supports~a~commit~message~for~Wiki~entries.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~?-u?~?-d?~?-s={[}|{]}?~list}{\scriptsize \par}

{\scriptsize{}~~~~~~~Lists~the~artifact~ID~and/or~Date~of~last~change~along~with}{\scriptsize \par}

{\scriptsize{}~~~~~~~each~entry~name,~delimited~by~the~-s~char.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~diff~?ARTIFACT?~?-f~infile{[}=stdin{]}?~EntryName}{\scriptsize \par}

{\scriptsize{}~~~~~~~Diffs~the~local~copy~of~a~page~with~a~given~version~(defaulting}{\scriptsize \par}

{\scriptsize{}~~~~~~~to~the~head~version).}{\scriptsize \par}
\end{lyxcode}
\caption{wiki detail}


\end{figure}



\subsection{Advanced}

These are commands that you will rarely have to use. These are functions that are needed to do very complicated things with Fossil. If you have to use these you are probably way beyond the audience for this book.


\subsubsection{scrub\index{scrub}}

This is used to removed sensitive information like passwords from a repository. This allows you to then send the whole repository to someone else for their use.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~scrub}{\scriptsize \par}

{\scriptsize COMMAND:~scrub}{\scriptsize \par}

{\scriptsize fossil~scrub~{[}-{}-verily{]}~{[}-{}-force{]}~{[}REPOSITORY{]}}{\scriptsize \par}

{\scriptsize The~command~removes~sensitive~information~(such~as~passwords)~from~a}{\scriptsize \par}

{\scriptsize repository~so~that~the~repository~can~be~sent~to~an~untrusted~reader.}{\scriptsize \par}

{\scriptsize By~default,~only~passwords~are~removed.~~However,~if~the~-{}-verily~option}{\scriptsize \par}

{\scriptsize is~added,~then~private~branches,~concealed~email~addresses,~IP}{\scriptsize \par}

{\scriptsize addresses~of~correspondents,~and~similar~privacy-sensitive~fields}{\scriptsize \par}

{\scriptsize are~also~purged.}{\scriptsize \par}

{\scriptsize This~command~permanently~deletes~the~scrubbed~information.~~The~effects}{\scriptsize \par}

{\scriptsize of~this~command~are~irreversible.~~Use~with~caution.}{\scriptsize \par}

{\scriptsize The~user~is~prompted~to~confirm~the~scrub~unless~the~-{}-force~option}{\scriptsize \par}

{\scriptsize is~used.}{\scriptsize \par}
\end{lyxcode}
\caption{scrub detail}


\end{figure}



\subsubsection{search\index{search}}

This is used to search the timeline entries for a pattern. This can also be done in your browser on the timeline page.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~search}{\scriptsize \par}

{\scriptsize COMMAND:~search}{\scriptsize \par}

{\scriptsize fossil~search~pattern...}{\scriptsize \par}

{\scriptsize Search~for~timeline~entries~matching~the~pattern.}{\scriptsize \par}
\end{lyxcode}
\caption{search detail}


\end{figure}



\subsubsection{sha1sum\index{sha1sum}}

This can compute the sha1 value for a particular file. These sums are the labels that Fossil uses on all objects and should be unique for any file.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~sha1sum}{\scriptsize \par}

{\scriptsize COMMAND:~sha1sum}{\scriptsize \par}

{\scriptsize fossil~sha1sum~FILE...}{\scriptsize \par}

{\scriptsize Compute~an~SHA1~checksum~of~all~files~named~on~the~command-line.}{\scriptsize \par}

{\scriptsize If~an~file~is~named~\textquotedbl{}-\textquotedbl{}~then~take~its~content~from~standard~input.}{\scriptsize \par}
\end{lyxcode}
\caption{sha1sum detail}


\end{figure}



\subsubsection{rstats\index{rstats}}

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~rstats}{\scriptsize \par}

{\scriptsize Usage:~fossil~rstats}{\scriptsize \par}

{\scriptsize Deliver~a~report~of~the~repository~statistics~for~the}{\scriptsize \par}

{\scriptsize current~checkout.}{\scriptsize \par}
\end{lyxcode}
\caption{rstats detail}


\end{figure}


For example, running it on the Fossil Book checkout:
\begin{lyxcode}
{[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~\textbf{fossil~rstats}

~Number~of~Artifacts:~137

~~59~full~text~+~78~delta~blobs

~278961~bytes~average,~38217738~bytes~total

~~Number~Of~Checkins:~26

~~~~~Number~Of~Files:~37

Number~Of~Wiki~Pages:~2

~~~Number~Of~Tickets:~6

~Duration~Of~Project:~23~days
\end{lyxcode}

\subsubsection{configuration\index{configuration}}

This command allows you to save or load a custom configuration of Fossil.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~}\textbf{\scriptsize help~configuration}{\scriptsize \par}

{\scriptsize Usage:~fossil~configure~METHOD~...}{\scriptsize \par}

{\scriptsize Where~METHOD~is~one~of:~export~import~merge~pull~push~reset.~~All~methods}{\scriptsize \par}

{\scriptsize accept~the~-R~or~-{}-repository~option~to~specific~a~repository.}{\scriptsize \par}

{\scriptsize{}~~~fossil~configuration~export~AREA~FILENAME}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Write~to~FILENAME~exported~configuration~information~for~AREA.}{\scriptsize \par}

{\scriptsize{}~~~~~~~~AREA~can~be~one~of:~~all~ticket~skin~project}{\scriptsize \par}

{\scriptsize{}~~~fossil~configuration~import~FILENAME}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Read~a~configuration~from~FILENAME,~overwriting~the~current}{\scriptsize \par}

{\scriptsize{}~~~~~~~~configuration.}{\scriptsize \par}

{\scriptsize{}~~~fossil~configuration~merge~FILENAME}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Read~a~configuration~from~FILENAME~and~merge~its~values~into}{\scriptsize \par}

{\scriptsize{}~~~~~~~~the~current~configuration.~~Existing~values~take~priority~over}{\scriptsize \par}

{\scriptsize{}~~~~~~~~values~read~from~FILENAME.}{\scriptsize \par}

{\scriptsize{}~~~fossil~configuration~pull~AREA~?URL?}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Pull~and~install~the~configuration~from~a~different~server}{\scriptsize \par}

{\scriptsize{}~~~~~~~~identified~by~URL.~~If~no~URL~is~specified,~then~the~default}{\scriptsize \par}

{\scriptsize{}~~~~~~~~server~is~used.~}{\scriptsize \par}

{\scriptsize{}~~~fossil~configuration~push~AREA~?URL?}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Push~the~local~configuration~into~the~remote~server~identified}{\scriptsize \par}

{\scriptsize{}~~~~~~~~by~URL.~~Admin~privilege~is~required~on~the~remote~server~for}{\scriptsize \par}

{\scriptsize{}~~~~~~~~this~to~work.}{\scriptsize \par}

{\scriptsize{}~~~fossil~configuration~reset~AREA}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Restore~the~configuration~to~the~default.~~AREA~as~above.}{\scriptsize \par}

{\scriptsize WARNING:~Do~not~import,~merge,~or~pull~configurations~from~an~untrusted}{\scriptsize \par}

{\scriptsize source.~~The~inbound~configuration~is~not~checked~for~safety~and~can}{\scriptsize \par}

{\scriptsize introduce~security~vulnerabilities.}{\scriptsize \par}
\end{lyxcode}
\caption{configuration detail}


\end{figure}



\subsubsection{descendants\index{descendants}}

This is used to find where the checked out files are in the time line.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~descendants}{\scriptsize \par}

{\scriptsize Usage:~fossil~descendants~?BASELINE-ID?}{\scriptsize \par}

{\scriptsize Find~all~leaf~descendants~of~the~baseline~specified~or~if~the~argument}{\scriptsize \par}

{\scriptsize is~omitted,~of~the~baseline~currently~checked~out.}{\scriptsize \par}


\end{lyxcode}
\caption{descendants detail}


\end{figure}



\section{What's next ?}

This book so far has covered how to use the many features of Fossil and has, I hope, interested you in using it. The question \textquotedbl{}what's next\textquotedbl{} now comes up. First go to the Fossil website \url{http://www.fossil-scm.org/}. While there you can go to the Wiki link and then list all Wiki pages. There are all sorts of topics covered there in depth. If that still doesn't help, you can join the Fossil mailing list (see Wiki links) and look at the archives or directly ask a question. I have found the list to be very helpful and have had my questions asked very quickly.

On the mailing lists you will see long discussions of changes to be made to Fossil, some of these are accepted very quickly and will appear within hours in the Fossil source code. Others engender long discussions (in particular discussion of changes to the Wiki) and it is interesting to read the pros and cons of suggested changes. 

Fossil is an evolving program but if you get a version that has all the features you need you can stick with that version as long as you like. Going to a new version though is simple and just requires a \textbf{rebuild} of your current repositories. The developers have been very careful to preserve the basic structure so it is easy and safe to switch versions.

Finally if you wish to contribute to the project there are many things to do (See the To Do List in the Wiki). 

\pagebreak{}

\printindex{}

\bibliographystyle{plain}
\bibliography{Research/fossilbib}

\end{document}

Added fossilbook_pdflatex.tex~.















































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
%% LyX 2.0.2 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[11pt,letterpaper,english]{article}
\usepackage{mathptmx}
\usepackage{helvet}
\usepackage{courier}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\usepackage{array}
\usepackage{varioref}
\usepackage{float}
\usepackage{url}
\usepackage{amsmath}
\usepackage{makeidx}
\makeindex
\usepackage{graphicx}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth

\providecommand{\LyX}{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\newenvironment{lyxcode}
{\par\begin{list}{}{
\setlength{\rightmargin}{\leftmargin}
\setlength{\listparindent}{0pt}% needed for AMS classes
\raggedright
\setlength{\itemsep}{0pt}
\setlength{\parsep}{0pt}
\normalfont\ttfamily}%
 \item[]}
{\end{list}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.

% Include the proper LaTeX packages:
%----------------------------------------------------------------------------------------------------
\usepackage{graphicx}
\usepackage{titling}
\usepackage{ifthen}
\usepackage[absolute]{textpos}
\usepackage[colorlinks=true,
                       pagecolor=black,
                       menucolor=black,
                       linkcolor=black,
                       citecolor=blue,
                       pagebordercolor=1 1 1,
                       urlcolor=red,
                       plainpages=false,
                       pdfpagelabels=true,
                       bookmarksnumbered=true]{hyperref}
\usepackage{lastpage}

\newcommand{\reportTopic}{<reportTopic>}
\newcommand{\revisionNumber}{<rev. no.>}
\newcommand{\documentNumber}{<doc. no.>}


% Setup the right-hand header to display the current doc section:
%----------------------------------------------------------------------------------------------------
\renewcommand{\sectionmark}[1]{\markright{#1}}
\renewcommand{\subsectionmark}[1]{\markright{#1}}

% Setup for roman numeral page numbers until TOC:
%----------------------------------------------------------------------------------------------------
\newboolean{romanpn}

\pagenumbering{roman}
\setboolean{romanpn}{true}
\let\myTOC\tableofcontents

\renewcommand\tableofcontents{%
\myTOC
\clearpage
\pagenumbering{arabic}
\setboolean{romanpn}{false}
}

% Modify titlepage format:
%----------------------------------------------------------------------------------------------------
\setlength{\TPHorizModule}{1in}
\setlength{\TPVertModule}{\TPHorizModule}
\textblockorigin{3.25in}{1in}

\pretitle
 {
    \begin{flushright}\LARGE\sffamily 
    \thispagestyle{empty}
    \begin{textblock}{4}(0,0)
    \includegraphics[width=4in,keepaspectratio=true]{Layout/fossil.png}
    \end{textblock}
    \vspace{2in}
  }

\posttitle{\par\end{flushright}}

\preauthor{\begin{flushright} \large \sffamily \lineskip 0.5em 
\begin{tabular}[t]{c}}
\postauthor{\end{tabular} \par\end{flushright}}

\predate{\begin{flushright}\large \sffamily Document Number: \documentNumber \\ Revision Number: \revisionNumber \\}

\postdate{
\vspace{2in}
\\Pandora Products.
\\215 Uschak Road
\\Derry, PA  15627
\par\end{flushright}}

% Setup "fancy" page layout:
%----------------------------------------------------------------------------------------------------
\fancyhf{}
\setlength{\topmargin}{-1in}
\setlength{\headheight}{1in}
\setlength{\headsep}{0.5in}
\setlength{\oddsidemargin}{0.25in}
\setlength{\evensidemargin}{\oddsidemargin}
\setlength{\textwidth}{6in}
\setlength{\headwidth}{\textwidth}
\setlength{\textheight}{8.375in}
\setlength{\footskip}{0.5in}

% Setup header:
%------------------------------------------------------------------------------------------
\fancyhead[L]{\sffamily \bfseries \large Fossil Version Control\\\mdseries \reportTopic}
%\fancyhead[R]{\sffamily \bfseries \large Pandora Products\\ \mdseries \nouppercase{\rightmark}}

% Setup footer:
%------------------------------------------------------------------------------------------
\renewcommand{\footrulewidth}{0.4pt}
\fancyfoot[L]{\sffamily \bfseries \documentNumber \\ \mdseries Revision:  \revisionNumber}
\fancyfoot[C]{\sffamily \bfseries\thedate \\ }
\fancyfoot[R]{\ifthenelse{\boolean{romanpn}}{\sffamily  \thepage}{\sffamily \bfseries Page \thepage\ of \pageref{LastPage}}}

\makeatother

\usepackage{babel}
\begin{document}
\renewcommand{\documentNumber}{PAN-20100424}

\renewcommand{\reportTopic}{A Users Guide}

\renewcommand{\revisionNumber}{1.75}


\title{Fossil Version Control\\ \reportTopic}


\author{Jim Schimpf}


\date{15 September 2011}

\maketitle
\thispagestyle{empty}

\newpage{}2010 Pandora Products. This work is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License. To view a copy of this license, visit \url{http://creativecommons.org/licenses/by-sa/3.0/us/} or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. 

and\medskip{}
Pandora Products

215 Uschak Road 

Derry, PA 15627 

\medskip{}
Phone: 724.539.1276

Fax: 724.539.1276 

Web: http://www.fossil-scm.org/schimpf-book/index

Email: jim.schimpf@gmail.com

\medskip{}
Pandora Products has carefully checked the information in this document and believes it to be accurate. However, Pandora Products assumes no responsibility for any inaccuracies that this document may contain. In no event will Pandora Products be liable for direct, indirect, special, exemplary, incidental, or consequential damages resulting from any defect or omission in this document, even if advised of the possibility of such damages. 

In the interest of product development, Pandora Products reserves the right to make improvements to the information in this document and the products that it describes at any time, without notice or obligation. 

Additional Contributors
\begin{itemize}
\item Marilyn Noz - Editor
\item Wolfgang Stumvoll - Fossil Merge use and Windows use
\item javalinBCD@gmail.com - found bugs
\item arnel\_legaspi@msn.com - found bugs
\end{itemize}
\newpage{}


\section*{Document Revision History}

\textit{Use the following table to track a history of this documents revisions. An entry should be made into this table for each version of the document}.

\begin{center}
\begin{tabular}{|>{\centering}p{0.5in}|>{\centering}p{0.5in}|p{3in}|>{\centering}p{1in}|}
\hline 
Version & Author & Description & Date\tabularnewline
\hline 
0.1 & js & Initial Version & 24-Apr-2010\tabularnewline
\hline 
0.2 & js & Finishing up Single User Chapter & 27-Apr-2010\tabularnewline
\hline 
0.3 & js & Working on introduction chapter & 30-Apr-2010\tabularnewline
\hline 
0.4 & js & Adding multiuser chapter & 1-May-2010\tabularnewline
\hline 
0.5 & mn & Adding editorial corrections {[}ebf40b842a{]} & 4-May-2010\tabularnewline
\hline 
0.6 & js & Adding Command sections {[}e11399d575{]} & 8-May-2010\tabularnewline
\hline 
0.7 & js & English \& spelling corrections & 19-May-2010\tabularnewline
\hline 
0.8 & js & Spelling fixes & 30-May-2010\tabularnewline
\hline 
0.9 & ws & Using Fossil merge {[}db6c734300{]} & 2-Jun-2010\tabularnewline
\hline 
1.0 & js/ws & Put Fossil merge first in handling fork & 3-Jun-2010\tabularnewline
\hline 
1.1 & mn & Fixes in multiple user chapter {[}e8770d3172{]} & 4-Jun-2010\tabularnewline
\hline 
1.2 & js & Start advanced use chapter {[}2abc23dae5{]} & 4-Jun-2010\tabularnewline
\hline 
1.3 & mn & English corrections Chapter 1 {[}8b324dc900{]} & 5-Jun-2010\tabularnewline
\hline 
1.4 & mn & Sections 2.1 \& 2.2 corrections {[}0b34cb6f04{]} & 7-Jun-2010\tabularnewline
\hline 
1.5 & js & Move close leaf to adv use {[}2abc23dae5{]} & 7-Jun-2010\tabularnewline
\hline 
1.6 & js & Convert Advanced chapter to forks and branching & 13-Jun-2010\tabularnewline
\hline 
1.7 & js/tr & Add note about IP port usage {[}a62efa8eba{]} & 8-Jul-2010\tabularnewline
\hline 
1.71 & javelin & Check on mispelling section 1.1 {[}637d974f62{]} & 15-Sep-2011\tabularnewline
\hline 
1.72 & anon & Fix absolute path in image regs {[}d54868853b{]} & 15-Sep-2011\tabularnewline
\hline 
1.73 & anon & Fix fossil create section 2.2.5 {[}36772d90a5{]} & 15-Sep-2011\tabularnewline
\hline 
1.74 & anon & Push/Pull described incorrectly {[}1b930fced6{]} & 15-Sep-2011\tabularnewline
\hline 
1.75 & arnel & Commands might be changed  {[}4aaf1f78bb{]} & 15-Sep-2011\tabularnewline
\hline 
\end{tabular}
\par\end{center}

\newpage{}\tableofcontents{}

\listoffigures


\newpage{}


\section*{Foreward}


\section{Source Control \& Why you need it}


\subsection{What is it}

A source control system is software that manages the files in a project. A project (like this book or a software application) usually has a number of files. You then put all these files in a directory and at times subdivide even that with subdirectories. At any particular time this set of files in their present edited state make up a working version of the project. If other people are using the project you give them this and as is usually the case, they find problems and you fix them. This results in another version of the project slightly changed which goes through the cycle again. (This is why books have editions and software has versions...)

Software developers on large projects with multiple developers could see this cycle and realized they needed a tool to control the changes. With multiple developers sometimes the same file would be edited by two different people changing it in different ways or records of what got changed would be lost. It was hard to bring out a new release of the software and be sure that all the bugs were fixed and enhancements made.

A tool called Source Code Control System \cite{SCCS} was developed at Bell Labs in 1972 to track changes in files. It would remember each of the changes made to a file and store comments about why this was done. It also limited who could edit the file so conflicting edits would not be done. \cite{USE-SCCS}

\label{versioning}This was important but developers could see more was needed. They needed to be able to save the state of all the files in a project and give it a name (i.e., Release 3.14). As software projects mature you will have a released version of the software being used as well as bug reports written against it, while the next release of the software is being developed adding new features. The source control system would have to handle what are now called branches. One branch has say Version 1 which is released but continues to have fixes added to create Version 1.1, 1.2, etc. At the same time you also have another branch which contains Version 2 with new features added under construction. 

In 1986 the open source Concurrent Version Control system CVS \cite{CVS} was developed. This system could label groups of files and allow multiple branches (i.e. versions) simultaneously. There have been many other systems developed since them some open source and some proprietary.

Fossil which was originally released in 2006 \cite{FOSSIL-HOME} is a easy to install version control system that also includes a trouble ticketing system ( Figure\vref{fig:viewticket}), a wiki ( Figure \vref{sub:Wiki-Use}) and self hosted web server ( Figure\vref{fig:Starting-Webserver}). It's home page is here \url{http://www.fossil-scm.org/}.


\subsection{Why do it ?}

Why do you want to use a source control system? To use one restricts your freedom, you won't be able to create files, delete files or, move files between directories at random. Making changes in your code becomes a check list of steps that must be followed carefully.

With all those hassles why do it? The biggest answer is freedom (huh ?). By following the procedures of a source control system you gain the freedom to modify your code any way you want. How does that follow ? One of the most horrible feelings as a developer is the ``It worked yesterday'' syndrome. That is, you had code that worked just fine and now it doesn't. You have a very helpless feeling of how do you get back to working code. With a source control system and careful adherence to procedures you can just go back in time and get yesterday's code. Then, starting from known good code you can figure out what happened.

Having a source control system also gives you the freedom to experiment, ``let's try that radical new technique'', and if it doesn't work it's easy to just go back to the previous state.

The rest of this book is a user manual for the Fossil version control system that does code management and much much more. It runs on multiple OS's and is FREE. It is simple to install as it has only one executable and the repositories it creates are a single file that is easy to back up and are usually only 50\% the size of the original source.


\subsubsection{How to get it}

If this has interested you then you can get a copy of the Fossil executable here \url{http://www.fossil-scm.org/download.html}. There are Linux, Mac, and Windows executable links on this page. Also there is a source Tarball from which you can compile from source. This web site is self-hosted by Fossil itself (see Section\vref{sec:Multiple-Users}). 


\subsection{Source control description}

This next section is useful if you have not used source control systems before. I will define some of the vocabulary and explain the basic ideas of source control.


\subsubsection{Check out systems}

When describing the grandaddy of source control systems, like SCCS I said it managed the changes for a single file and also prevented multiple people from working on the same file at the same time. This is representative of a whole class of source control systems. In these you have the idea of ``checking-out'' a file so you can edit it. At the same time while other people using the system can see who is working on the file they are prevented from touching it. They can get a read-only copy so they can say build software but only the ``owner'' can edit it. When done editing the ``owner'' checks it back in then anyone else could work on on it. At the same time the system has recorded who had it and the changes made to it.

This system works well in small groups with real time communication. A common problem is that a file is checked out by some one else and \textbf{you} have to make a change in it. In a small group setting, just a shout over the cube wall will solve the problem. 


\subsubsection{Merge systems}

In systems represented by CVS or Subversion the barrier is not getting a file to work on but putting it back under version control. In these systems you pull the source code files to a working directory in your area. Then you edit these files making necessary changes. When done you commit or check them back into the repository. At this point they are back under version control and the system knows the changes from the last version to this version.

This gets around the problem mentioned above when others are blocked from working on a file. You now have the opposite problem in that more than one person can edit the same file and make changes. This is handled by the check-in process. There only one person at a time may check in a file. That being the case the system checks the file and if there are changes in repository file that are NOT in the one to be checked in stops the check in process. The system will ask if the user wants to merge these changes into his copy. Once that is done the new version of the file can be checked in.

This type of system is used on large projects like the Linux kernel or other systems where you have a large number of geographically distributed contributors.


\subsubsection{Distributed systems}

The representatives of two major systems we have described thus far are centralized. That is there is only one repository on a single server. When you get a copy of the files or check in files it all goes to just one place. These work and can support many, many users. A distributed system is an extension of this where it allows the repositories to be duplicated and has mechanisms to synchronize them. 

With a single server users of the repository must be able to connect to it to get updates and for check ins of new code. If you are not connected to the server you are stuck and cannot continue working. Distributed systems allow you to have your own copy of the repository then continue working and when back in communication synchronize with the server. This is very useful where people take their work home and cannot access the company network. Each person can have a copy of the repository and continue working and re-sync upon return to the office.


\subsubsection{Common Terms}

The following is a list of terms I will use when talking about version control or Fossil.
\begin{description}
\item [{Repository}] This is the store when the version controlled files are kept. It will be managed by a source control system
\item [{SCS}] Source control system, this is software that manages a group of files keeping track of changes and allowing multiple users to modify them in a controlled fashion
\item [{Commit}] In Fossil to store the current set of new and changed files into the repository.
\item [{Trunk}] The main line of code descent in a Fossil repository.
\item [{Branch}] A user defined split in the files served by an SCS. This allow multiple work points on the same repository. Older branches (versions) might have bug fixes applied and newer branches (versions) can have new features added.
\item [{Fork}] In Fossil an involuntary split in the code path, occurs when a file in the repository has changes not in a file to be committed.
\end{description}

\section{\label{sec:Single-User-Fossil}Single User Fossil Use}


\subsection{Introduction}

If you have read this far and are at least persuaded to try, you will want to put one of your projects under software control using Fossil. This chapter is set up to lead you through that task and show you how to adapt your development to using this tool. The assumption is made in this section that you will be the only person using the repository, you are the designer, developer, and maintainer of this project. After you are comfortable using the tool, the next section will show how you use it when you have multiple people working on a project.


\subsection{Creating a repository }


\subsubsection{Introduction}

In the spirit of ``eating one's own dog food'' we will use this book as the project we are going to manage with Fossil. The book is a directory of text files (we are writing it using \LyX{} \cite{LyX}) and my working area looks like this:
\begin{lyxcode}
{\scriptsize FOSSIL/}{\scriptsize \par}
\begin{lyxcode}
{\scriptsize This~directory~holds~all~my~Fossil~repositories}{\scriptsize \par}
\end{lyxcode}
{\scriptsize FossilBook/}{\scriptsize \par}
\begin{lyxcode}
{\scriptsize outline.txt~~~~-~Book~design}{\scriptsize \par}

{\scriptsize fossilbook.lyx~-~The~book}{\scriptsize \par}

{\scriptsize Layout}{\scriptsize \par}
\begin{lyxcode}
{\scriptsize fossil.png~~-~The~Fossil~logo~(image~on~title~page)}{\scriptsize \par}
\end{lyxcode}
{\scriptsize Research}{\scriptsize \par}
\begin{lyxcode}
{\scriptsize fossilbib.bib~-~Working~bibliography}{\scriptsize \par}

{\scriptsize History}{\scriptsize \par}
\begin{lyxcode}
{\scriptsize CVC-grune.pdf~-~Historical~paper~about~CVS}{\scriptsize \par}

{\scriptsize RCS-A~System~for~Version~Control.webloc~-~RCS~bookmark}{\scriptsize \par}

{\scriptsize SCCS-Slideshow.pdf~-~Historical~paper~about~SCCS}{\scriptsize \par}

{\scriptsize VCSHistory~-pysync~...~.webloc~-~History~of~version~control}{\scriptsize \par}
\end{lyxcode}
\end{lyxcode}
\end{lyxcode}
\end{lyxcode}
This took just an hour or so to start preliminary research and build the framework. Since that's about all I'm going to do today I want to build a repository and put all this stuff under Fossil control.


\subsubsection{Create Repository}

I have a directory called FOSSIL in which I keep all my repositories, Fossil doesn't care but it helps me to keep them all in one place so I can back them up. First I need to create a new repository for the book. This is done using the command line after I move into the Fossil book directory.
\begin{lyxcode}
{\scriptsize }
\begin{figure}[H]
\begin{lyxcode}


{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~new~../FOSSIL/FossilBook.fossil}{\scriptsize \par}

{\scriptsize project-id:~2b0d35831c1a5b315d74c4fd8d532b100b822ad7}{\scriptsize \par}

{\scriptsize server-id:~~0149388e5a3109a867332dd8439ac7b454f3f9dd}{\scriptsize \par}

{\scriptsize admin-user:~jim~(initial~password~is~\textquotedbl{}}\textbf{\scriptsize ec3773}{\scriptsize \textquotedbl{})}{\scriptsize \par}
\end{lyxcode}
\caption{Create Repository\label{fig:Create-Repository}}


\end{figure}
{\scriptsize \par}
\end{lyxcode}
I create my repositories with the extension .fossil, this will be useful later with the server command (See Figure \vref{fig:server-detail}). When the create happened it assigned an initial password with an admin user of ``jim'' (i.e., me). 


\subsubsection{Connect Repository}

The repository is created but is empty and has no connection to the book directory. The next step is to open the repository to the book directory with the \textbf{open} command.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~open~../FOSSIL/FossilBook.fossil}{\scriptsize{}~}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~status}{\scriptsize \par}

{\scriptsize repository:~~~/Users/jschimpf/Public/FOSSIL/FossilBook.fossil}{\scriptsize \par}

{\scriptsize local-root:~~~/Users/jschimpf/Public/FossilBook/}{\scriptsize \par}

{\scriptsize server-code:~~0149388e5a3109a867332dd8439ac7b454f3f9dd}{\scriptsize \par}

{\scriptsize checkout:~~~~~279dfecd3f0322f236a92a9a8f3c96acf327d8c1~2010-04-25~12:40:39~UTC}{\scriptsize \par}

{\scriptsize tags:~~~~~~~~~trunk}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~extra}{\scriptsize \par}

{\scriptsize Layout/fossil.png}{\scriptsize \par}

{\scriptsize Research/History/CVS-grune.pdf}{\scriptsize \par}

{\scriptsize Research/History/RCS\textemdash{}A~System~for~Version~Control.webloc}{\scriptsize \par}

{\scriptsize Research/History/SCCS-Slideshow.pdf}{\scriptsize \par}

{\scriptsize Research/History/VCSHistory~-~pysync~-~....webloc}{\scriptsize \par}

{\scriptsize Research/fossilbib.bib}{\scriptsize \par}

{\scriptsize fossilbook.lyx}{\scriptsize \par}

{\scriptsize outline.txt}{\scriptsize \par}
\end{lyxcode}
\caption{Open Repository \& Check}


\end{figure}


The \textbf{open} command seemingly did nothing but checking with the \textbf{status} command shows the repository, the directory it's linked to and that we are hooked to the trunk of the store. 

The \textbf{extra} command shows all the files in the directory that are NOT under control of Fossil. In this case that's all of them since we have not checked in anything.


\subsubsection{Add and Initial Commit}

I must now add all the relevant files into the repository with the \textbf{add} command. The Fossil add is recursive so if I add the top level files it will automatically recurse into the subdirectories like Layout and Research and get those files too. Before you do an add it pays to tidy up your directory so you don't accidentally add a bunch of transient files (like object files from a compile). It's easy to remove them later but a little tidying before hand can save you some work.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~add~.}{\scriptsize \par}

{\scriptsize ADDED~~Layout/fossil.png}{\scriptsize \par}

{\scriptsize ADDED~~Research/History/CVS-grune.pdf}{\scriptsize \par}

{\scriptsize ADDED~~Research/History/RCS\textemdash{}A~System~for~Version~Control.webloc}{\scriptsize \par}

{\scriptsize ADDED~~Research/History/SCCS-Slideshow.pdf}{\scriptsize \par}

{\scriptsize ADDED~~Research/History/VCSHistory~-~pysync~....webloc}{\scriptsize \par}

{\scriptsize ADDED~~Research/fossilbib.bib}{\scriptsize \par}

{\scriptsize fossil:~cannot~add~\_FOSSIL\_}{\scriptsize \par}

{\scriptsize ADDED~~fossilbook.lyx}{\scriptsize \par}

{\scriptsize ADDED~~outline.txt}{\scriptsize \par}
\end{lyxcode}
\caption{Initial file add}
\end{figure}


I simply told fossil to do an add of the current directory (.) so it got all those files and all the files in the subdirectory. Note the \_FOSSIL\_ that it didn't add. This is the tag file that fossil keeps in a directory so it knows what repository it belongs to. Fossil won't add this file since it manages it, but everything else is fair game.

One final thing before I can quit for the day, these files have been added or rather they will be added to the repository when I commit it. That must be done and then we can relax and let Fossil manage things. 

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~commit~-m~\textquotedbl{}Initial~Commit\textquotedbl{}}{\scriptsize \par}

{\scriptsize New\_Version:~8fa070818679e1744374bc5302a621490276d739}{\scriptsize \par}
\end{lyxcode}
\caption{Initial Commit}


\end{figure}


I added a comment on the commit and it's a good idea to always do this. When later we see the timeline of the commits you will have notes to tell you what was done.


\subsubsection{Fossil start up summary}
\begin{itemize}
\item \textbf{fossil new <name> }Creates a new fossil repository
\item \textbf{fossil open <repository> }While in a source directory connects this directory to the fossil repository
\item \textbf{fossil add .} Will add (recursively) all the files in the current directory and all subdirectories to the repository
\item \textbf{fossil commit -m ``Initial Commit''} Will put all the currently added files into the repository.
\end{itemize}

\subsection{Set Up User interface}

One of the surprising features of Fossil is the webserver. This allows it to have a GUI type user interface with no operating system specific code, the GUI is the web browser supplied by your OS. In the previous steps I checked my project in to a Fossil repository, next I have to prep the web interface for production use. 
\begin{description}
\item [{NOTE}] The Fossil web server uses port 8080 instead of the standard port 80 for all HTTP access. When run it will automatically start your Web browser and open the repository home page. Unfortunately my book work is done on a machine that already has Apache running on port 8080 so I will be using port 8081. I will always have to add an extra parameter on the UI command line to do this.
\end{description}
\begin{figure}[H]
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\footnotesize fossil~ui~-port~8081}{\footnotesize \par}
\end{lyxcode}
\caption{\label{fig:Starting-Webserver}Starting Webserver}
\end{figure}

\begin{description}
\item [{NOTE:}] Newer versions of Fossil automatically find an open port and will give a message on the command line telling you what port number is used. You can still use the -port option if you want to control the port \#.
\end{description}
This shows how it's started, as you can see I have picked port 8081 since I am locked out of port 8080. When I do this my browser starts and I am presented with the following home page.

\begin{figure}[H]
\noindent \begin{raggedright}
\includegraphics[scale=0.6]{Images/Single_user/initial_page}
\par\end{raggedright}

\caption{\label{fig:Initial-Webserver-page}Initial Webserver page}


\end{figure}


Following the advice on the page I go to \textbf{setup/config}. I am going to do the minimum setup that you should do on all projects. As you get familiar with Fossil you will probably have many more things that you will customize for your taste but what follows are the only things you HAVE to do.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/config_initial}

\caption{\label{fig:Initial-Configuration}Initial Configuration}


\end{figure}


I have entered in a project name and put in a description, the project name will be the name of the initial Wiki page (see \vref{sub:Wiki-Use}) and the description is useful for others to see what you are doing here. Then I go to the bottom of the page and pick the \textbf{Apply Changes }button.

Next I pick the Admin tab (you can see it in the header bar) and the pick Users from that page. I am presented with the users and will use this to set the password of the project.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/user_config}

\caption{\label{fig:User-Configuration}User Configuration}


\end{figure}


As you can see Fossil automatically configures a number of users beyond just the creator. The anonymous user you have already seen if you went to the Fossil web site to download the code. This user can view and get code but cannot commit code. On the right side of the page are the many options you can give to a user, it's worth reading it all when you set up your repository. The important one is me (jim) which has ``s'' or Super User Capabilities. This means I can do anything with the repository.

I will now edit the user Jim to make sure it has the settings I want. In this case you MUST set the password. Remember way back where Fossil set it during the create (Figure\vref{fig:Create-Repository}), it's a very good idea to change this to something you can remember rather than the original random one.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/jim_setup}

\caption{Super User Setup}


\end{figure}


I have put in my contact information (e-mail address) and while you cannot see it I have typed in a password that I will remember. Then I applied the changes.

Now the repository is ready for further work, it's rather bare bones at this point but the most important things are set up.


\subsubsection{User interface summary}
\begin{itemize}
\item \textbf{fossil ui} run in the source directory will start a browser based user interface to fossil.
\item \textbf{fossil ui -port <IP port \#>} Can be used if port 8080 if already in use on your system.
\item On the first run it is important to configure your project with a name and set the password for yourself.
\end{itemize}

\subsection{Update Repository}

After writing the above section of the book I now have created a bunch of new files and changed some of the existing files in the repository. Before quitting for the day I should add these new files into the repository and commit the changes saving this milestone in the project.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~extra}{\scriptsize \par}

{\scriptsize \#fossilbook.lyx\#}{\scriptsize \par}

{\scriptsize Images/Single\_user/config\_initial.epsf}{\scriptsize \par}

{\scriptsize Images/Single\_user/initial\_page.epsf}{\scriptsize \par}

{\scriptsize Images/Single\_user/jim\_setup.epsf}{\scriptsize \par}

{\scriptsize Images/Single\_user/user\_config.epsf}{\scriptsize \par}

{\scriptsize fossilbook.lyx\textasciitilde{}}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~status}{\scriptsize \par}

{\scriptsize repository:~~~/Users/jschimpf/Public/FOSSIL/FossilBook.fossil}{\scriptsize \par}

{\scriptsize local-root:~~~/Users/jschimpf/Public/FossilBook/}{\scriptsize \par}

{\scriptsize server-code:~~0149388e5a3109a867332dd8439ac7b454f3f9dd}{\scriptsize \par}

{\scriptsize checkout:~~~~~8fa070818679e1744374bc5302a621490276d739~2010-04-25~13:09:02~UTC}{\scriptsize \par}

{\scriptsize parent:~~~~~~~279dfecd3f0322f236a92a9a8f3c96acf327d8c1~2010-04-25~12:40:39~UTC}{\scriptsize \par}

{\scriptsize tags:~~~~~~~~~trunk}{\scriptsize \par}

{\scriptsize EDITED~~~~~fossilbook.lyx}{\scriptsize \par}


\end{lyxcode}
\caption{Project Status}


\end{figure}


I run \textbf{fossil extra} to see these new files. The image files (those in Images/Single\_user) I want to add, the other two files, \#fossilbook.lyx\# and fossilbook.lyx\textasciitilde{}, I don't want to add since they are temporary artifacts of \LyX{}. I also ran \textbf{fossil status}. This shows changes to files that are already in the repository. There the only file changed is the book text itself, \textbf{fossilbook.lyx}.

All I have to do now is add in the directory Images which will add in the image files I want in the repository. Then I commit the changes to the repository and we can move on to other tasks of the day.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~add~Images}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/config\_initial.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/initial\_page.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/jim\_setup.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/user\_config.epsf}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~commit~-m~\textquotedbl{}Initial~setup~with~pictures\textquotedbl{}}{\scriptsize \par}

{\scriptsize New\_Version:~a2d12bf532a089ee53578e3e17c6e732c0442f49}{\scriptsize \par}
\end{lyxcode}
\caption{\label{fig:Update-for-new}Update for new files}


\end{figure}


After doing this commit I can bring up the Fossil ui (see Figure \vref{fig:Starting-Webserver}) and view the project Timeline by picking that tab on the Fossil header. We get this:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/timeline}

\caption{Timeline}


\end{figure}


You can see all my check-ins thus far and you can see after the check-in from Figure \vref{fig:Update-for-new} I did another check-in because I missed some changes in the outline. The check-ins are labeled with the first 10 digits of their hash value and these are active links which you can click to view in detail what was changed in that version. 

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/timeline_detail}

\caption{Timeline Detail\label{fig:Timeline-Detail}}
\end{figure}


I clicked on the very last check-in (the \textbf{LEAF) }and the display is shown above. There are many things you can do at this point. From the list of changed files you can pick the diff link and it will show in text form the changes made in that particular file. The ``Other Links'' section has a very useful ZIP Archive. Clicking this will download a ZIP of this version to your browser. You will find this useful if you want to get a particular version, in fact this is normally how you get a new version of Fossil from the \url{http://www.fossil-scm.org/}. The edit link will be used later to modify a leaf.


\subsubsection{Update Summary}
\begin{itemize}
\item \textbf{fossil status} and \textbf{fossil extra} will tell you the updated files and files not in the repository before you commit.
\item \textbf{fossil commit - m ``Commit comment'' }Commits a change (or changes). It is very important to have a descriptive comment on your commit.
\end{itemize}

\subsection{Tickets}

Besides managing your code Fossil has a trouble ticket system. This means you can create a ticket for a problem or feature you are going to add to your system then track your progress. Also you can tie the tickets to specific check-ins of your files. For software this is very useful for bug fixes and feature additions. For example you can look for a bug in the ticket list then have it take you to the change that fixed the problem. Then you know exactly what you did and not have to be confused by other changes you might have made.

When you pick Tickets it will bring up this window. You can create a new ticket, look at the list, or generate a new report. Keeping things simple I will just use the All Tickets list for now.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/ticket_initial}

\caption{Initial Ticket Window}


\end{figure}


Picking ``New Ticket'' I get a form that I fill out like so:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/ticket_form}

\caption{Ticket Form}


\end{figure}


Pretty simple actually. You can put as much or as little detail in here as you wish, but remember this stuff might be really vital 6 weeks or 6 months from now so think of what you would want to know then. When I press Submit I get this showing what I entered.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/ticket_submit}

\caption{Viewing a Ticket}


\end{figure}


Finally picking Tickets then ``All Tickets'' I can see my new ticket in the list marked as Open and in a distinctive color. 

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/ticket_list}

\caption{\label{fig:viewticket}Ticket List with open ticket}


\end{figure}


I try, in handling tickets, to have links from ticket to the commit that addressed the problem and a link from the commit back to the offending ticket. This way looking at the ticket I can get to the changes made and from the timeline I can get the the ticket and its resolution. To do this I will make sure and put the 10 digit hash label from the ticket into the check-in comment and put a link in the resolved ticket to the check-in.

Since I have now written the chapter and put in all these images of what to do I can now add in all the new images to the repository and check this in as another completed operation. And I do that like this:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~add~Images/Single\_user}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/config\_initial.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/initial\_page.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/jim\_setup.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/ticket\_form.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/ticket\_initial.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/ticket\_list.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/ticket\_submit.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/timeline.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/timeline\_detail.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/user\_config.epsf}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~commit~-m~\textquotedbl{}{[}1665c78d94{]}~Ticket~Use\textquotedbl{}}{\scriptsize \par}
\end{lyxcode}
\caption{\label{fig:checkin}Ticket resolving check-in}


\end{figure}


First I added in all the new image files. I am lazy and just told it to add in all the files in the Single\_user directory. I have previously added some of those like \textbf{config\_initial.epsf} but Fossil is smart and knows this and won't add that one twice. Even though it shows it ADDED, it really didn't.

The commit line is very important, as you can see I put 10 digit hash code for the ticket in brackets in the comment. As we will see in the Wiki section this is a link to the Ticket, so when viewing the comment in the Timeline or elsewhere you can click the bracketed item and you would go to the ticket.

Now that I have the items checked in I have to close the ticket. I do that by clicking on its link in the ticket list, that will go the the View Ticket window as shown in Figure \vref{fig:viewticket}. From there I pick edit and fill it in as shown:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/ticket_done}

\caption{Ticket Finish}


\end{figure}


I mark it as ``Closed''. If you have code you can mark this as fixed, tested, or a number of other choices. Another very important step, I brought up the Timeline and copied the link for the commit I had just done in Figure \vref{fig:checkin}. By doing this my ticket is now cross linked with the commit and the commit has a link back to the ticket.


\subsubsection{Ticket Summary}
\begin{itemize}
\item Tickets are a useful way of reminding you what needs done or bugs fixed
\item When you commit a change that affects a ticket put the 10 digit hash label of the ticket into the commit comment surrounded by brackets, e.g. {[}<10 digit hash>{]} so you can link to the ticket
\item When you close the ticket put in the hash label of the commit that fixed it.
\end{itemize}

\subsection{\label{sub:Wiki-Use}Wiki Use}

As we saw in Figure \vref{fig:Starting-Webserver} Fossil has a browser based user interface. In addition to the pages that are built in you can add pages to web site via a wiki. This allows you to add code descriptions, user manuals, or other documentation. Fossil keeps all that stuff in one place under version control. A wiki is a web site where you can add pages and links from within your browser. You are given an initial page then if you type {[}newpage{]} this text will turn into a link and if clicked will take you to a new blank page. Remember in Figure \vref{fig:Initial-Webserver-page} that is the initial page for your project and from there you can add new pages. These pages are automatically managed by the Fossil version control system; you don't have to add or commit.

Since I did the setup on repository (see Figure \vref{fig:Initial-Configuration}) the home page has changed to this:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/wiki_blankhome}

\caption{Blank Home Page}


\end{figure}


Not very helpful so the in rest of this chapter I will use the Wiki functions of Fossil to make this more useful. If I pick the Wiki item from the menu bar I get:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/wiki_page}

\caption{\label{fig:Wiki-controls}Wiki controls}


\end{figure}


These are the controls that let you control and modify the wiki. Most important for now is the Formatting rules link. This link takes you to a page that describes what you can do to format a wiki page. If you just type text on a page it will appear but be formatted by your browser. You can type HTML commands to control this formating. It's worth your time to carefully read this page and note what you can and cannot do. The page just lists the valid HTML commands, and if you don't know what they mean I would suggest you find a page like this \url{http://www.webmonkey.com/2010/02/html_cheatsheet/} and keep it handy. 

Besides the HTML markup the most powerful command for the Wiki is {[}page{]} where it links to a new page. This is how you add pages and how you build your web site of documentation for the repository.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/wiki_formating}\caption{Wiki Formating}


\end{figure}


I now begin work. What I want to do is change the home page to be non-empty and also put a link on the home page to the PDF of this book. In Figure \vref{fig:Wiki-controls} I click on the first item, the FossilBook home page. This takes me to the home page again but now I have an Edit option. We also have a History option so I could look at older versions of the page. 

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/wiki_homeedit}

\caption{Home page with edit}


\end{figure}


This shows my initial edit and a preview:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/wiki_home}

\caption{Initial Home page}


\end{figure}


The bottom section is an edit window where I type things I want displayed and the top is a preview of what the page will be. As you can see I typed some simple HTML to make a large and centered title. The body of the text I just typed and as you see the browser fits the text to the screen. You can have multiple paragraphs by just putting blank lines between your text. Next I wanted a bulleted list and this is done by typing two spaces, a '{*}' then two more spaces. On each of these lines I have a link to a new (not yet created page). If you look I put these in the form {[} <new page> | <title> {]}. This way I can have a long string that describes the link but have a nice short (no embedded spaces) page name. 

One mistake I usually make at this point is to click one of those new links which takes me to a new blank page. \textbf{OOPS}, if I have not saved this page yet then I find I've lost my changes so far. 

OK, I will save my changes and then go to the new pages. I am doing some complicated things here. The first link is to the book PDF. This will be a file I create in the repository. The \LyX{} program I'm using creates the PDF. I will do that, save it, and add it to the repository. But I don't want to link to a static file, that is I want the most current version of the PDF, the one I save each time I quit for the day. To do this we have to put in a link that looks like this:
\begin{lyxcode}
{[}http:doc/tip/FossilBook.pdf~|~Book~(pdf)~{]}
\end{lyxcode}
This is a special link the Fossil wiki understands, \textbf{doc }says this is documentation. \textbf{tip }says use the most current version; you could put a version link here. And finally since I am going to put the book PDF at the top level I only need the file name. If it was in a subdirectory I would have to say \textbf{doc/tip/subdir/filename. }

The second link is just to a regular page and I can just edit that one just like I did this the main page.


\subsubsection{Wiki Summary}
\begin{itemize}
\item Format your text using HTML commands like <h1>Title</h1> for page headings
\item Create and link pages using {[} <page> | <Link text> {]}
\item The page designation http:doc/tip/<document path relative to repository> will display any document in the repository that your browser can handle (i.e. pdf, http etc)
\item Never click on a link till AFTER you have saved the page
\end{itemize}

\section{\label{sec:Multiple-Users}Multiple Users}


\subsection{Introduction}

In the previous chapter I went through using Fossil with just one user (me). In this chapter we will get into using it with multiple users. Thanks to Fossil's distributed design once the set up is done using it is not much different than the single user case with Fossil managing automatically the multiple user details.


\subsection{Setup}

In the previous chapter the Fossil repository was a file on our system and we did commits to it and pulled copies of the source from it. Fossil is a distributed source control system; what this means is that there is a master repository in a place that all users can access. Each user has their own ``cloned'' copy of the repository and Fossil will automatically synchronize the users repository with the master. From a each user's perspective you have your local repository and work with it using the same commands shown in Chapter \ref{sec:Single-User-Fossil}. It's just that now Fossil will keep your repository in sync with the master.


\subsubsection{Server Setup\label{sub:Server-Setup}}

I have the FossilBook.fossil repository and now have to put it in place so multiple users can access it. There are two ways, the first is using fossil's built in webserver to host the file and the second is using the operating systems supported web server (if present) and a cgi type access.


\paragraph{Self hosted}

This is quite simply the easiest way to do it. The downside is that you are responsible for keeping the machine available and the webserver up. That is, don't turn the machine off when you quit for the day or some other user is going to be upset. All I have to do is this:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:/Users/jschimpf/Public{]}~jim\%~cd~FOSSIL/}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FOSSIL{]}~jim\%~}\textbf{\scriptsize fossil~ui~-port~8081~FossilBook.fossil~\&}{\scriptsize{}~}{\scriptsize \par}

{\scriptsize {[}1{]}~310}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FOSSIL{]}~jim\%~}{\scriptsize \par}
\end{lyxcode}
\caption{Self-hosted Fossil repository}


\end{figure}


This is on UNIX system, the ``\&'' at then end of the second line runs the fossil webserver in the background. If I know this machine has an IP address of 192.168.1.200 then from any other machine in the network I can say:

\textbf{http://192.168.1.200:8081} to the browser and I can access the Fossil web server. 

As you can see this is simple and works on any system that runs Fossil. As long as you carefully make sure it's always running and available for others this can be a very easy way to make the master repository available. 

The problems with this method are:
\begin{enumerate}
\item If you have multiple repositories you have to use the \textbf{server} not the \textbf{ui} command, have all your repositories in the same directory, and have them all use the extension .fossil.
\item If the machine goes off line (i.e. for OS update) or other reason it might not automatically restart the Fossil servers.
\item Backup of the repositories might be not be done.
\end{enumerate}
This method does work, and if you only have one repository and a diligent owner of the master machine, it will work and work well.


\paragraph{Server hosted}

If you have a server type machine available (i.e., a Linux or UNIX box) that is running Apache or a Windows machine running IIS you can let it be the webserver for your repository. This has a number of advantages: this machine will be up all the time, it will probably be automatically backed up, and it can easily support multiple Fossil repositories.

I am not going into how to set up the webserver or how to enable (Common Gateway Interface) CGI. See the following sites.
\begin{itemize}
\item For IIS see here \url{http://www.boutell.com/newfaq/creating/iiscgihowto.html} and just ensure that your fossil.exe is in the path to be run by the cgi script.
\item For Apache see here \url{http://httpd.apache.org/docs/2.0/howto/cgi.html} and ensure you know the directory where the CGI scripts are stored.
\end{itemize}
If you are not in control of the webserver you will need the help of the server admin to enable CGI and to copy your CGI scripts to correct location.


\paragraph{CGI Script for hosted server}

If we assume an Apache server and, in my case, the cgi directory path is /Library/Webserver/CGI-Executables, then we have to write a script of the form:

\begin{figure}[H]
\begin{lyxcode}
\#!<Fossil~executable~location>

repository:~<Fossil~repository~location>
\end{lyxcode}
\caption{Fossil CGI script}


\end{figure}


and put it into the cgi script directory. I have put my Fossil executable into /usr/local/bin and I am putting my Fossil shared repository into /Users/Shared/FOSSIL. My script then becomes:

\begin{figure}[H]
\begin{lyxcode}
\#!/usr/local/bin/fossil

\#~Put~the~book~repository~on~the~web

repository:~/Users/Shared/FOSSIL/Fossilbook.fossil
\end{lyxcode}
\caption{My Fossil CGI script}


\end{figure}


After making the script I then copy it to the CGI directory and allow anyone to execute it.
\begin{lyxcode}

\end{lyxcode}
\begin{figure}[H]
\begin{lyxcode}
\textbf{\scriptsize sudo~cp~Book.cgi~/Library/Webserver/CGI-Executables/Book.cgi}{\scriptsize \par}



\textbf{\scriptsize sudo~chmod~a+x~/Library/Webserver/CGI-Executables/Book.cgi}{\scriptsize \par}
\end{lyxcode}
\caption{Copying script into place}


\end{figure}



\subsubsection{The test (either self hosted or server hosted)}

If all is in place then I should be able to access the webserver and get to this:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Multiple_user/test_access}

\caption{\label{fig:Web-access-to}Web access to Fossil CGI hosted site}
\end{figure}



\subsection{User Accounts}

Serving a repository, either self hosting or the more complicated CGI method gets you to the same place as shown in Figure \vref{fig:Web-access-to}. Now I have to set up user accounts for the other contributors to this book. Remember Fossil has automatically created an Anonymous user (see Figure \vref{fig:User-Configuration}) thus others can access the site in a limited way, that is they can download the book but cannot commit changes. In this case I want to create a new account (Marilyn) that can make changes and commit changes as she is my editor.

To accomplish all this first I have to login by going to the log in page and entering my ID (jim) and my password. Now since I'm super-user I then go back to the User-Configuration page, Figure \eqref{fig:User-Configuration} and add a new user:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Multiple_user/mul_new_user}

\caption{New Editor user\label{fig:New-Editor-user}}


\end{figure}


Since she is going to be an editor, this will be similar to a developer if we were doing code, so I picked the Developer privilege level. This way she can get the repository, check-in, check-out, and write and update tickets. I also added the attachments since she might need that to put on an image or other comment on actions she is doing. I also gave her a password so her access can be secured.

I could add other users at this point but don't need any others for this project, but you can see how easily this can be done. When you assign the user privileges just read carefully and don't give them any more than you think they need. If they have problems, you can easily modify their account in the future.


\subsection{Multiple User Operation}

With the server set up and the user established the next thing to do is clone the repository. That is make copy from the webserver repository to my local machine. Once that is done this local repository uses the same commands and is very much like single user use discussed in Section \vref{sec:Single-User-Fossil}. Fossil will synchronize your local repository with the one on the server.


\subsubsection{Cloning}

To clone a Fossil repository you have to know four things:
\begin{enumerate}
\item It's web address, for our repository it is \textbf{http://pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}
\item Your account name in my case it's \textbf{jim}
\item Your password (which I'm keeping to myself thank you...)
\item The local name of the repository, in this case I'm calling it Fossilbook.fossil
\end{enumerate}
You then go to where you want to keep the Repository (in my case the FOSSIL directory) and use the clone command:

\begin{figure}[H]
\begin{lyxcode}
{\tiny {[}Pandora-2:jschimpf/Public/FOSSIL{]}}\textbf{\tiny{}~fossil~clone~http://jim:}{\tiny <passwd>}\textbf{\tiny @pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi~FossilBook.fossil}{\tiny \par}

\textbf{\scriptsize \#\#\#~NOTE:~<passwd>~}{\scriptsize -~Stands~in~for~real~password}{\scriptsize \par}



{\scriptsize{}~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\scriptsize \par}

{\scriptsize Send:~~~~~~~~~~~~~~49~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Received:~~~~~~~~~120~~~~~~~~~~2~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Send:~~~~~~~~~~~~~625~~~~~~~~~25~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Received:~~~~~~~~4704~~~~~~~~~72~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Send:~~~~~~~~~~~~3104~~~~~~~~~72~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Received:~~~~~5129052~~~~~~~~131~~~~~~~~~10~~~~~~~~~~5}{\scriptsize \par}

{\scriptsize Send:~~~~~~~~~~~~2399~~~~~~~~~51~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Received:~~~~~4381170~~~~~~~~116~~~~~~~~~22~~~~~~~~~28}{\scriptsize \par}

{\scriptsize Total~network~traffic:~4117~bytes~sent,~6913068~bytes~received}{\scriptsize \par}

{\scriptsize Rebuilding~repository~meta-data...}{\scriptsize \par}

{\scriptsize 65~(100\%)...}{\scriptsize \par}

{\scriptsize project-id:~2b0d35831c1a5b315d74c4fd8d532b100b822ad7}{\scriptsize \par}

{\scriptsize server-id:~~3e67da6d6212494456c69b1c5406a277d7e50430}{\scriptsize \par}

{\scriptsize admin-user:~jim~(password~is~\textquotedbl{}d07222\textquotedbl{})}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FOSSIL{]}~jim\%~}{\scriptsize \par}
\end{lyxcode}
\caption{Clone command}


\end{figure}


At this point I can go through the steps outlined in Section \vref{sec:Single-User-Fossil} to set my user password and then open the Fossil Repository on a working directory.

Now that I've moved everything to the new cloned repository I do a check in a the end of the day which looks like this:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~commit~-m~\textquotedbl{}Moved~to~clone~repository\textquotedbl{}}{\scriptsize \par}

{\scriptsize Autosync:~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}{\scriptsize \par}

{\scriptsize Bytes~Cards~Artifacts~Deltas}{\scriptsize \par}

{\scriptsize Send:~130~1~0~0}{\scriptsize \par}

{\scriptsize Received:~2990~65~0~0}{\scriptsize \par}

{\scriptsize Total~network~traffic:~334~bytes~sent,~1876~bytes~received}{\scriptsize \par}

{\scriptsize New\_Version:~158492516c640d055bc0720684a05e797b88165a}{\scriptsize \par}

{\scriptsize Autosync:~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}{\scriptsize \par}

{\scriptsize Bytes~Cards~Artifacts~Deltas}{\scriptsize \par}

{\scriptsize Send:~618798~74~1~2}{\scriptsize \par}

{\scriptsize Received:~3222~70~0~0}{\scriptsize \par}

{\scriptsize Send:~268138~73~1~0}{\scriptsize \par}

{\scriptsize Received:~3221~70~0~0}{\scriptsize \par}

{\scriptsize Send:~3977~72~0~1}{\scriptsize \par}

{\scriptsize Received:~3220~70~0~0}{\scriptsize \par}

{\scriptsize Total~network~traffic:~457995~bytes~sent,~6011~bytes~received}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}{\scriptsize \par}
\end{lyxcode}
\caption{\label{fig:Cloned-repository-checkin}Cloned repository checkin}


\end{figure}


As you see the files were committed locally and then the local repository was automatically synchronized with the repository on the server.


\subsubsection{Keeping in sync}

After doing all the setup described above I now have a distributed source control system. My co-worker, Marilyn has also cloned the repository and begun work. She is editing the book correcting my clumsy phrasing and fixing spelling mistakes. She is working independently and on the same files I use. We must use Fossil to prevent us from both modifying FossilBook.lyx but in different ways. Remember Fossil has no file locking, there is nothing to prevent her from editing and changing the file while I work on it.

This is where we both must follow procedures to prevent this sort of problem. Even though she edits files I cannot see the changes till they are committed. Two different versions of the same file won't be a problem till I try to commit with my version and her version is in the current leaf.

\label{There-are-two}There are two problems:
\begin{enumerate}
\item Before I do any work I must be sure I have the current versions of all the files.
\item When I commit I must make sure what I am committing has only my changes and is not stepping on changes she has done.
\end{enumerate}
The first is pretty obvious, make sure you have the latest before you do anything. We do that with the update command. In Figure \ref{fig:Cloned-repository-checkin} I had done my latest check in. Before starting any more work I should ensure that Marilyn hasn't checked in something else. I could check the timeline but instead I'll do an update to my repository and source files. When I do the update I specify it should be updated from the \textbf{trunk. }This ensures I get it from the latest and greatest not some branch.

\begin{figure}
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~update~trunk}{\scriptsize \par}

{\scriptsize Autosync:~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}{\scriptsize \par}

{\scriptsize Bytes~Cards~Artifacts~Deltas}{\scriptsize \par}

{\scriptsize Send:~130~1~0~0}{\scriptsize \par}

{\scriptsize Received:~3588~78~0~0}{\scriptsize \par}

{\scriptsize Send:~365~6~0~0}{\scriptsize \par}

{\scriptsize Received:~136461~83~2~3}{\scriptsize \par}

{\scriptsize Total~network~traffic:~796~bytes~sent,~131582~bytes~received}{\scriptsize \par}

{\scriptsize UPDATE~fossilbook.lyx}{\scriptsize \par}

{\scriptsize UPDATE~fossilbook.pdf}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}~
\end{lyxcode}
\caption{Update action}


\end{figure}


Ah ha ! Marilyn has been at work and updated the book source and pdf. If I check the timeline from the webserver I see she has even documented it:

\begin{figure}[H]
\includegraphics[scale=0.4]{Images/Multiple_user/mul_timeline}

\caption{Updated Timeline}


\end{figure}


Now I know I have the current state of the world and I can proceed to add in new sections.


\subsubsection{Complications\label{sub:Complications}}

In\vref{There-are-two} the second case is much harder. In this case I have diligently done my fossil update and started working. In the mean time Marilyn has also done her update and also started working. Now she is done and checks in her changes. I obviously don't know this since I am happily working on my changes. What happens next....

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}\textbf{\scriptsize fossil~commit~-m~\textquotedbl{}Commit~that~might~fork\textquotedbl{}}{\scriptsize \par}

{\scriptsize Autosync:~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}{\scriptsize \par}

{\scriptsize Bytes~Cards~Artifacts~Deltas}{\scriptsize \par}

{\scriptsize Send:~130~1~0~0}{\scriptsize \par}

{\scriptsize Received:~4002~87~0~0}{\scriptsize \par}

{\scriptsize Send:~365~6~0~0}{\scriptsize \par}

{\scriptsize Received:~110470~92~2~3}{\scriptsize \par}

{\scriptsize Total~network~traffic:~797~bytes~sent,~104567~bytes~received}{\scriptsize \par}

\textbf{\scriptsize fossil:~would~fork.~\textquotedbl{}update\textquotedbl{}~first~or~use~-f~or~-{}-force.}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}{\scriptsize \par}
\end{lyxcode}
\caption{Forking commit}


\end{figure}


Ah ha, that very thing has happened and fossil warned me that my copy of the file differs from the master copy. If I did a --force then the repository would generate a fork and Marilyn's future commits would be to her fork and my commits would be to mine. That would not be what we want since I want her to edit\textbf{ }my copy of the book.

The next step would be to do as Fossil says and do an update. At this point you have to be careful since blindly updating the changed files could overwrite the stuff I've just done. So we do a trial update by using the -n and -v options to say``do a dry run'' and show me the results.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~update~-n~-v}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Multiple\_user/mul\_new\_user.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Multiple\_user/mul\_timeline.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Multiple\_user/test\_access.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/config\_initial.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/initial\_page.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/jim\_setup.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/ticket\_done.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/ticket\_form.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/ticket\_initial.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/ticket\_list.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/ticket\_submit.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/timeline.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/timeline\_detail.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/user\_config.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/wiki\_blankhome.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/wiki\_formating.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/wiki\_home.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/wiki\_homeedit.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/wiki\_page.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Layout/fossil.png}{\scriptsize \par}

{\scriptsize UNCHANGED~Research/History/CVS-grune.pdf}{\scriptsize \par}

{\scriptsize UNCHANGED~Research/History/RCS\textemdash{}A~System~for~Version~Control.webloc}{\scriptsize \par}

{\scriptsize UNCHANGED~Research/History/SCCS-Slideshow.pdf}{\scriptsize \par}

{\scriptsize UNCHANGED~Research/History/VCSHistory~-~pysync~-~A~Brief~History~of~Version~Control~Systems~-~Project~Hosting~on~Google~Code.webloc}{\scriptsize \par}

{\scriptsize UNCHANGED~Research/fossilbib.bib}{\scriptsize \par}

{\scriptsize MERGE~fossilbook.lyx}{\scriptsize \par}

{\scriptsize UPDATE~fossilbook.pdf}{\scriptsize \par}

{\scriptsize UNCHANGED~outline.txt}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}{\scriptsize \par}
\end{lyxcode}
\caption{Update dry run}


\end{figure}


That's a little more than I wanted as you can see almost everything is UNCHANGED but it shows that fossilbook.lyx needs a MERGE and fossilbook.pdf needs an UPDATE. This is what I should expect, Marilyn has done edits to the fossilbook.lyx file and so have I so we have to merge the changes. But she has also updated the fossilbook.pdf which I have not. Before we go on if you are running on Linux or UNIX you can simplify this dry run by doing:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}\textbf{\scriptsize fossil~update~-n~-v~|~grep~-v~UNCHANGED}{\scriptsize \par}

{\scriptsize MERGE~fossilbook.lyx}{\scriptsize \par}

{\scriptsize UPDATE~fossilbook.pdf}{\scriptsize \par}
\end{lyxcode}
\caption{Update dry run, shorter}


\end{figure}


By using the pipe and grep I can eliminate all those extra UNCHANGED lines.


\subsubsection{Fixing the Update file}

First we fix the easy file, the fossilbook.pdf I can just update by itself so it matches the current repository. It doesn't need merged so just replace it. Before I do that I have to look at the repository time line

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Multiple_user/mul_timeline}

\caption{Current Timeline}


\end{figure}


I see that the current\textbf{ Leaf} is {[}d44769cc23{]} and it is tagged as\textbf{ trunk}. I want to update the fossilbook.pdf from there. So I say:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}\textbf{\scriptsize fossil~update~trunk~fossilbook.pdf}{\scriptsize \par}

{\scriptsize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\scriptsize \par}

{\scriptsize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Received:~~~~~~~~4002~~~~~~~~~87~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Total~network~traffic:~334~bytes~sent,~2412~bytes~received}{\scriptsize \par}

{\scriptsize UPDATE~fossilbook.pdf}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}{\scriptsize \par}
\end{lyxcode}
\caption{Update fossilbook.pdf}


\end{figure}


and it's done.


\subsubsection{Fixing the Merge file}

We can use the tools built into Fossil. In this case noticing that commit will cause a fork Jim will use the -force option to cause the fork and will handle the merge later.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize E:\textbackslash{}Profile\textbackslash{}Ratte\textbackslash{}data\textbackslash{}organize\textbackslash{}fossil-w32\textbackslash{}fossil-book>fossil~commit~-m~\textquotedbl{}adding~some~changes~of~jim\textquotedbl{}}{\scriptsize \par}

{\scriptsize fossil:~would~fork. ~\textquotedbl{}update\textquotedbl{}~first~or~use~-f~or~-{}-force.}{\scriptsize \par}

{\scriptsize  }{\scriptsize \par}

{\scriptsize E:\textbackslash{}Profile\textbackslash{}Ratte\textbackslash{}data\textbackslash{}organize\textbackslash{}fossil-w32\textbackslash{}fossil-book>fossil~commit~-f~-m~\textquotedbl{}adding~some~other~changes~of~jim\textquotedbl{}}{\scriptsize \par}

{\scriptsize New\_Version:~df9f2ff6b14ef65a9dd2162f8bd20c78e1628165}{\scriptsize \par}
\end{lyxcode}
\caption{Forcing a commit under Windows}
\end{figure}


Now the timeline looks like:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Multiple_user/Windows/forked_timeline}

\caption{Windows Forked timeline}
\end{figure}


To remove this fork (i.e. get the changes Marilyn did into the trunk) we use the Fossil merge command. We can use the merge because fossilbook.lyx is a text file and the merge markers are designed to work with text files. If it was a binary file we might have to use an external file or copy and paste between the two file versions using the handler program for the file.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize E:\textbackslash{}Profile\textbackslash{}Ratte\textbackslash{}data\textbackslash{}organize\textbackslash{}fossil-w32\textbackslash{}fossil-book>fossil~merge~a91582b699}{\scriptsize \par}

{\scriptsize MERGE~fossilbook.lyx}{\scriptsize \par}

{\scriptsize {*}{*}{*}{*}{*}~2~merge~conflicts~in~fossilbook.lyx}{\scriptsize \par}
\end{lyxcode}
\caption{Fossil Merge}
\end{figure}


Looking at the file (fossilbook.lyx) in a text editor (not \LyX{}) we find:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize >\textcompwordmark{}>\textcompwordmark{}>\textcompwordmark{}>\textcompwordmark{}>\textcompwordmark{}>\textcompwordmark{}>~BEGIN~MERGE~CONFLICT}{\scriptsize \par}

{\scriptsize  Thanks~to~Fossil's~distributed~design~once~the~set~up~is~done~using~it}{\scriptsize \par}

{\scriptsize  with~multiple~users~is~not~much~different~than~the~single~user~case.}{\scriptsize \par}

{\scriptsize  Fossil~will~automatically~manage~the~most~multiple~user~details.}{\scriptsize \par}

{\scriptsize ============================}{\scriptsize \par}

{\scriptsize  }{\scriptsize \par}

{\scriptsize  Thanks~to~Fossil's~distributed~design~once~the~set~up~is~done~using~is}{\scriptsize \par}

{\scriptsize  not~much~different~than~the~single~user~case~with~Fossil~managing~automatically}{\scriptsize \par}

{\scriptsize  the~multiple~user~details.}{\scriptsize \par}

{\scriptsize <\textcompwordmark{}<\textcompwordmark{}<\textcompwordmark{}<\textcompwordmark{}<\textcompwordmark{}<\textcompwordmark{}<~END~MERGE~CONFLICT}{\scriptsize \par}



\textbf{<Here~edit~in~the~changes>}



{\scriptsize E:\textbackslash{}Profile\textbackslash{}Ratte\textbackslash{}data\textbackslash{}organize\textbackslash{}fossil-w32\textbackslash{}fossil-book>fossil~commit~-m~\textquotedbl{}merging~marilyn's~fork~back\textquotedbl{}}{\scriptsize \par}

{\scriptsize New\_Version:~acdd676d3ab157769496f6845ccc7652985c1d03}{\scriptsize \par}
\end{lyxcode}
\caption{Text differences}
\end{figure}


After the commit the timeline shows how the merge brought the fork back into the main trunk. Marilyn will then have to update to this new trunk. (See Section \vref{sub:Updating-by-others})

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Multiple_user/Windows/merged_timeline}

\caption{Merged timeline}
\end{figure}



\section{Forks \& Branches}


\subsection{Introduction}

This chapter will cover forking and branching in Fossil. Forking is where you unintentially create two places to check into a repository. Branching is where you intentially do this because you want to maintain two or more versions of the code in the same repository. We illustrated forking and it's solutions in Section \vref{sub:Complications}. If, instead of fixing (merging) the file then doing the commit, we forced the commit, Fossil would fork the repository.

Forking is something to avoid because it creates two checkin paths for the code. Thus different users will be on different paths and can check in contradictory changes. Branches on the other hand are forks that you desire. These occur when you want to have two different versions of the code base in development at the same time. This was described in \vref{versioning} where you have a production verison of code under maintenance and a development version both served from the same repository. In this case development changes should only be checked into the development branch. Maintanence changes might have to be checked into both.

Instead of using the book repository for these examples we will use a JSON\cite{JSON}parser program that has a number of files and documentation. This will make it simpler to illustrate branching and tagging.

There is a good discussion of these topics on the Fossil Web site \url{http://www.fossil-scm.org/index.html/doc/tip/www/branching.wiki}.


\subsection{Forks, Branch \& Merge}

In this case the JSON code has just been placed in Fossil and two developers check out copies to work on. Jim wants to fix a number of compiler warnings that appear and Marilyn wants to fix the documentation. In both cases they proceeed as shown in Chapter \vref{sec:Multiple-Users}. The JSON code has been placed in a distributed location, each of them clones the repository, and opens a working copy of the code.


\subsubsection{Marilyn's Actions}

She looks through the documentation and finds a number of problems and fixes them (the documentation uses \LyX{} and PDF's). When she is satisfied with what she has done, she checks the current version of the documentation in:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Simple_Merge/sm_Marilyn}

\caption{\label{fig:Marilyn's-work}Marilyn's work}
\end{figure}



\subsubsection{Jim's Actions}

At the same time, Jim gets a working copy of version {[}6edbaf5fa8{]} of the code, puts in a ticket {[}d23bf4bbbb{]} as shown in Figure \ref{fig:Marilyn's-work}. After fixing the warnings, Jim is done and goes to commit. He does this AFTER Marilyn has done her commit.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize 551~jsonp>~}\textbf{\footnotesize fossil~commit~-m~\textquotedbl{}{[}d23bf4bbbb{]}~Remove~warnings\textquotedbl{}}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~~874~~~~~~~~~19~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~339~bytes~sent,~771~bytes~received}{\footnotesize \par}

{\footnotesize fossil:~would~fork.~~\textquotedbl{}update\textquotedbl{}~first~or~use~-f~or~-{}-force.}{\footnotesize \par}

{\footnotesize 552~jsonp>~}{\footnotesize \par}
\end{lyxcode}
\caption{Jim's commit attempt}


\end{figure}


At this point Fossil recognizes that Marilyn has changed the repository (she updated the documentation) but Jim does not have these changes because he checked out an earlier version of the code. Jim says he \textbf{must} get his changes in so he does a FORCE to force fossil to accept the commit.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize 552~jsonp>~}\textbf{\footnotesize fossil}{\footnotesize{}~}\textbf{\footnotesize commit~-m~\textquotedbl{}{[}d23bf4bbbb{]}~Remove~warnings\textquotedbl{}~-f}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~~874~~~~~~~~~19~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~338~bytes~sent,~771~bytes~received}{\footnotesize \par}

{\footnotesize New\_Version:~1beab955418a942ab9953c4865109ff46cbbd691}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~2646~~~~~~~~~25~~~~~~~~~~0~~~~~~~~~~4}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1058~~~~~~~~~23~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1498~bytes~sent,~864~bytes~received}{\footnotesize \par}

{\footnotesize {*}{*}{*}{*}~warning:~a~fork~has~occurred~{*}{*}{*}{*}{*}}{\footnotesize \par}
\end{lyxcode}
\caption{Forcing the commit}


\end{figure}


Looking at the timeline Jim sees this:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Simple_Merge/sm_jim_fork}

\caption{Repository Fork}


\end{figure}


Not good, there are two \textbf{Leaf}'s and Marilyn would commit code to her fork and Jim would be commiting code to his. So Jim must fix this by merging the code. Jim wants to merge versions {[}b72e96832e{]} of Marilyn and his {[}1beab85441{]}.


\subsubsection{Fixing the fork}

So Jim who's checked out code is from Leaf {[}1beab85441{]} does a merge with Marilyn's leaf {[}b72e96832e{]} like so:

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize 556~jsonp>~}\textbf{\footnotesize fossil~merge~b72e96832e}{\footnotesize \par}

{\footnotesize UPDATE~docs/qdj.lyx}{\footnotesize \par}

{\footnotesize UPDATE~docs/qdj.pdf}{\footnotesize \par}

{\footnotesize 557~jsonp>~}\textbf{\footnotesize fossil~status}{\footnotesize \par}

{\footnotesize repository:~~~/Users/jschimpf/Public/FOSSIL/jsonp.fossil}{\footnotesize \par}

{\footnotesize local-root:~~~/Users/jschimpf/Public/jsonp/}{\footnotesize \par}

{\footnotesize server-code:~~d3e7932b0b0f5e704264ba30adeae14978c08bc6}{\footnotesize \par}

{\footnotesize checkout:~~~~~1beab955418a942ab9953c4865109ff46cbbd691~2010-06-08~10:44:56~UTC}{\footnotesize \par}

{\footnotesize parent:~~~~~~~6edbaf5fa8e4d061c2e04e7fd481e7663b090bd3~2010-06-07~10:45:57~UTC}{\footnotesize \par}

{\footnotesize tags:~~~~~~~~~trunk}{\footnotesize \par}

{\footnotesize UPDATED\_BY\_MERGE~docs/qdj.lyx}{\footnotesize \par}

{\footnotesize UPDATED\_BY\_MERGE~docs/qdj.pdf}{\footnotesize \par}

{\footnotesize MERGED\_WITH~b72e96832e024f235696dcd6c5d0ddcc2cb38238}{\footnotesize \par}
\end{lyxcode}
\caption{\label{fig:Merge-Operation}Merge Operation}


\end{figure}


As shown the two documentation files are updated, there are no merge conflicts as Jim didn't touch these files and Marilyn didn't touch the code files.

Next Jim does a commit to make this new merged set of files the new trunk. Rememeber doing the merge shown in Figure \ref{fig:Merge-Operation} just updates your checked out code and does not change the repository till you check it in.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize 558~jsonp>~fossil~}\textbf{\footnotesize commit~-m~\textquotedbl{}After~merging~in~changes\textquotedbl{}}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1058~~~~~~~~~23~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~340~bytes~sent,~864~bytes~received}{\footnotesize \par}

{\footnotesize New\_Version:~3d73c03edee33cdc2e1bd8a47de57b7a6b6d880a}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~1737~~~~~~~~~26~~~~~~~~~~0~~~~~~~~~~1}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1104~~~~~~~~~24~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1101~bytes~sent,~888~bytes~received}{\footnotesize \par}

{\footnotesize 559~jsonp>~}{\footnotesize \par}
\end{lyxcode}
\caption{Commit after merge}


\end{figure}


When we look at the timeline we have a single leaf for future code commits.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Simple_Merge/sm_after_merge}

\caption{After merge timeline}


\end{figure}


The only other thing remaining is that Marilyn does an Update before proceeding so her checked out code matches the repository.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize WhiteBook:jsonp~marilyn\$~}\textbf{\footnotesize fossil~update}{\footnotesize \par}

{\footnotesize Autosync:~~http://Marilyn@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1150~~~~~~~~~25~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~412~~~~~~~~~~7~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~3274~~~~~~~~~31~~~~~~~~~~1~~~~~~~~~~5}{\footnotesize \par}

{\footnotesize Total~network~traffic:~843~bytes~sent,~2709~bytes~received}{\footnotesize \par}

{\footnotesize UPDATE~json-src/qdj\_token.c}{\footnotesize \par}

{\footnotesize UPDATE~json-src/qdj\_util.c}{\footnotesize \par}

{\footnotesize UPDATE~main.c}{\footnotesize \par}
\end{lyxcode}
\caption{Marilyn's Update}


\end{figure}



\subsubsection{Commands used}
\begin{itemize}
\item \textbf{fossil merge <fork>} Used to merge a fork (specified by hash value) to current check out. 
\item \textbf{fossil update <version>} Used to update current check out to specified version, if version not present use default tag for check out (see fossil status)
\end{itemize}

\subsection{Merge without fork}

In this case I will show how to merge in code changes from multiple users without causing a fork. In this case Marilyn has put in a BSD license text into all the code files while Jim is adding a help function to the code. In this case both of them put in tickets saying what they are doing but acting independently.


\subsubsection{Check in attempt}

Marilyn finished first and checks in her changes. Jim builds, tests and tries to check in his code and gets:

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize 502~jsonp>~}\textbf{\footnotesize make}{\footnotesize \par}

{\footnotesize /usr/bin/gcc~~main.c~-c~-I.~-Ijson-src~-o~obj/main.o}{\footnotesize \par}

{\footnotesize /usr/bin/gcc~~\textbackslash{}}{\footnotesize \par}

{\footnotesize 		obj/main.o\textbackslash{}}{\footnotesize \par}

{\footnotesize 		obj/qdj.o\textbackslash{}}{\footnotesize \par}

{\footnotesize 		obj/qdj\_util.o\textbackslash{}}{\footnotesize \par}

{\footnotesize 		obj/qdj\_token.o\textbackslash{}}{\footnotesize \par}

{\footnotesize 		-o~jsonp}{\footnotesize \par}



{\footnotesize 503~jsonp>~}\textbf{\footnotesize ./jsonp~-v}{\footnotesize \par}

{\footnotesize JSON~Test~Program~Ver:~{[}Jun~~9~2010{]}~{[}10:15:00{]}}{\footnotesize \par}

{\footnotesize SYNTAX:~jsonp~-i~<json~text~file>~{[}-v{]}}{\footnotesize \par}

{\footnotesize -i~<json~text~file>~~~Show~parse~of~JSON}{\footnotesize \par}

{\footnotesize -v~~~~~~~~~~~~~~~~~~~~Show~help}{\footnotesize \par}



{\footnotesize 506~jsonp>~}\textbf{\footnotesize fossil~commit~-m~\textquotedbl{}{[}fed383fa1a{]}~Add~help~to~cmd~line\textquotedbl{}}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1656~~~~~~~~~36~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~647~~~~~~~~~12~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~14039~~~~~~~~~47~~~~~~~~~~4~~~~~~~~~~7}{\footnotesize \par}

{\footnotesize Total~network~traffic:~942~bytes~sent,~4537~bytes~received}{\footnotesize \par}

{\footnotesize fossil:~would~fork.~~\textquotedbl{}update\textquotedbl{}~first~or~use~-f~or~-{}-force.}{\footnotesize \par}
\end{lyxcode}
\caption{Jim's check in attempt}


\end{figure}



\subsubsection{Update}

The next action Jim takes is to do the update but without doing changes, using the -n flag which tells it to just show what's going to happen without making any file changes.

\begin{figure}[H]
\begin{lyxcode}
507~jsonp>~\textbf{fossil~update~-n}

UPDATE~json-src/qdj.c

UPDATE~json-src/qdj.h

UPDATE~json-src/qdj\_token.c

UPDATE~json-src/qdj\_token.h

UPDATE~json-src/qdj\_util.c

MERGE~main.c
\end{lyxcode}
\caption{Update dry run}


\end{figure}


This shows some files will be updated, i.e. be replaced by new text from the repository. The main.c file will be merged with the version from the repository. That is text from the repository will be mixed with the text from Jim's modified file. Note that it says \textbf{MERGE} meaning the two sets of text are a disjoint set. This means the merge can all be done by Fossil with no human intervention.

Jim can just do the update for real then commit the merged files to make a new leaf. So now we have Marilyn's and Jim changes combined in the lastest version. 

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/file_merge/merge}

\caption{Merged repository}


\end{figure}



\subsubsection{Commands used}
\begin{itemize}
\item \textbf{fossil update -n} Does a dry run of an update to show what files will changed.

\begin{itemize}
\item UPDATE Implies file will be replaced by repository file
\item MERGE Implies file will be mixed text from repository and check out
\end{itemize}
\end{itemize}

\subsection{Branching}


\subsubsection{Introduction}

We have discussed this before but branching is the intential splitting of the code in the repository into multiple paths. This will usually be done with production code where we have maintenance branch and a development branch. The maintenance branch is in use and would get bug fixes based on experience. The development branch would get those changes if applicable plus be modified to add features.

The JSON code parser has been tested and works so will be released to general use. Also we wish to modify it to add support for UTF-8 characters so it matches the JSON standard. The current version just works with ASCII 7 bit characters which is not standard. We wish to split the code into a VER\_1.0 branch which is the current code in use and VER\_2.0 branch which will add UTF-8 character support.


\subsubsection{Branch the repository}

Before proceeding we will make sure we have the current trunk code in our check out. 

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp{]}~jim\%~}\textbf{\footnotesize fossil~status}{\footnotesize \par}

{\footnotesize repository:~/Users/jschimpf/Public/FOSSIL/jsonp.fossil}{\footnotesize \par}

{\footnotesize local-root:~/Users/jschimpf/Public/jsonp/}{\footnotesize \par}

{\footnotesize server-code:~90c80f1a2da7360dae230ccec65ff82fe2eb160d}{\footnotesize \par}

{\footnotesize checkout:~}\textbf{\footnotesize 462156b283}{\footnotesize b694af0b99c9b446b64d3f77436fbb~2010-06-09~14:16:42~UTC}{\footnotesize \par}

{\footnotesize parent:~fbb16491e2ff9f9ca3a98adffa167de1b6903a44~2010-06-09~14:02:28~UTC}{\footnotesize \par}

\textbf{\footnotesize tags:~trunk}{\footnotesize \par}
\end{lyxcode}
\caption{Checking code status}
\end{figure}


Seeing that matches the latest leaf in the time line we can proceed to branch the code.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp{]}~jim\%~}\textbf{\footnotesize fossil~branch~new~VER\_1.0~trunk~-bgcolor~0xFFC0FF}{\footnotesize \par}

{\footnotesize sh:~gpg:~command~not~found}{\footnotesize \par}

{\footnotesize unable~to~sign~manifest.~~continue~(y/N)?~y}{\footnotesize \par}

{\footnotesize New~branch:~65e1f48633d691a5ea738cd51ccbf9a581dfb3c7}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~2391~~~~~~~~~42~~~~~~~~~~0~~~~~~~~~~1}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1840~~~~~~~~~40~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1524~bytes~sent,~1272~bytes~received}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp{]}~jim\%~}\textbf{\footnotesize fossil~branch~new~VER\_2.0~trunk~-bgcolor~0xC0F0FF}{\footnotesize \par}

{\footnotesize sh:~gpg:~command~not~found}{\footnotesize \par}

{\footnotesize unable~to~sign~manifest.~~continue~(y/N)?~y}{\footnotesize \par}

{\footnotesize New~branch:~a1737916ec2df696a0f3a7e36edf9ba4370e48a7}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~2437~~~~~~~~~43~~~~~~~~~~0~~~~~~~~~~1}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1886~~~~~~~~~41~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1550~bytes~sent,~1271~bytes~received}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp{]}~jim\%~}{\footnotesize \par}
\end{lyxcode}
\caption{Branch commands\label{fig:Branch-commands}}
\end{figure}


What was just done. We used the Fossil branch command to create two branches VER\_1.0 and VER\_2.0 and assigned each of them a color. We can see the timeline is now:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Branching/branch}

\caption{Branch Timeline}
\end{figure}



\subsubsection{Color Setup}

As you see above the two branches have different colors in the timeline. This was due to the \textbf{-bgcolor} option added when we created each branch. (See Figure \ref{fig:Branch-commands}). But we want this color to appear on subsequent checkins of each of these branches. To make that happen we have to set the options using the UI and picking a particular leaf on the timeline.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Branching/color_setup}

\caption{Setting Timeline color}


\end{figure}


Under the \textbf{Background Color} section I have checked \textbf{Propagate color to descendants }so future checkins will have the same color.


\subsubsection{Check out the branches}

Now the the repository is branched we can check out the two sets of code into different directories. We create jsonp1 and jsonp2 and proceed to open the different branches into them.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp1{]}~}\textbf{\footnotesize jim\%~fossil~open~../FOSSIL/jsonp.fossil~VER\_1.0}{\footnotesize \par}

{\footnotesize docs/qdj.lyx}{\footnotesize \par}

{\footnotesize docs/qdj.pdf}{\footnotesize \par}

{\footnotesize json-src/qdj.c}{\footnotesize \par}

{\footnotesize json-src/qdj.h}{\footnotesize \par}

{\footnotesize json-src/qdj\_token.c}{\footnotesize \par}

{\footnotesize json-src/qdj\_token.h}{\footnotesize \par}

{\footnotesize json-src/qdj\_util.c}{\footnotesize \par}

{\footnotesize main.c}{\footnotesize \par}

{\footnotesize makefile}{\footnotesize \par}

{\footnotesize obj/test.txt}{\footnotesize \par}

{\footnotesize test.txt}{\footnotesize \par}

{\footnotesize project-name:~JASONP}{\footnotesize \par}

{\footnotesize repository:~~~/Users/jschimpf/Public/FOSSIL/jsonp.fossil}{\footnotesize \par}

{\footnotesize local-root:~~~/Users/jschimpf/Public/jsonp1/}{\footnotesize \par}

{\footnotesize project-code:~eb6084c8ab115cf2b28a129c7183731002c6143a}{\footnotesize \par}

{\footnotesize server-code:~~90c80f1a2da7360dae230ccec65ff82fe2eb160d}{\footnotesize \par}

{\footnotesize checkout:~~~~~65e1f48633d691a5ea738cd51ccbf9a581dfb3c7~2010-06-13~10:13:55~UTC}{\footnotesize \par}

{\footnotesize parent:~~~~~~~462156b283b694af0b99c9b446b64d3f77436fbb~2010-06-09~14:16:42~UTC}{\footnotesize \par}

{\footnotesize tags:~~~~~~~~~}\textbf{\footnotesize VER\_1.0}{\footnotesize \par}
\end{lyxcode}
\caption{Check out VER\_1.0}
\end{figure}


Checking out VER\_2.0 in the same way

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp2{]}~jim\%~}\textbf{\footnotesize fossil~open~../FOSSIL/jsonp.fossil~VER\_2.0}{\footnotesize \par}

{\footnotesize docs/qdj.lyx}{\footnotesize \par}

{\footnotesize docs/qdj.pdf}{\footnotesize \par}

{\footnotesize json-src/qdj.c}{\footnotesize \par}

{\footnotesize json-src/qdj.h}{\footnotesize \par}

{\footnotesize json-src/qdj\_token.c}{\footnotesize \par}

{\footnotesize json-src/qdj\_token.h}{\footnotesize \par}

{\footnotesize json-src/qdj\_util.c}{\footnotesize \par}

{\footnotesize main.c}{\footnotesize \par}

{\footnotesize makefile}{\footnotesize \par}

{\footnotesize obj/test.txt}{\footnotesize \par}

{\footnotesize test.txt}{\footnotesize \par}

{\footnotesize project-name:~JASONP}{\footnotesize \par}

{\footnotesize repository:~~~/Users/jschimpf/Public/FOSSIL/jsonp.fossil}{\footnotesize \par}

{\footnotesize local-root:~~~/Users/jschimpf/Public/jsonp2/}{\footnotesize \par}

{\footnotesize project-code:~eb6084c8ab115cf2b28a129c7183731002c6143a}{\footnotesize \par}

{\footnotesize server-code:~~90c80f1a2da7360dae230ccec65ff82fe2eb160d}{\footnotesize \par}

{\footnotesize checkout:~~~~~a1737916ec2df696a0f3a7e36edf9ba4370e48a7~2010-06-13~10:14:26~UTC}{\footnotesize \par}

{\footnotesize parent:~~~~~~~462156b283b694af0b99c9b446b64d3f77436fbb~2010-06-09~14:16:42~UTC}{\footnotesize \par}

{\footnotesize tags:~~~~~~~~~}\textbf{\footnotesize VER\_2.0}{\footnotesize \par}
\end{lyxcode}
\caption{VER\_2.0 checkout}
\end{figure}


Notice on both of these the tags show which branch we are attached to.


\subsubsection{Correcting errors (in both)}

After doing this work I found that the main.c file had a warning about an unused variable. I wanted to correct this in both branches. At this point all the files in both branches are the same so correcting the file in either branch and copying it to the other is possible. I put in a ticket for the change and edit main.c. I copy it to both checkouts for the both branches and then check both in.

\begin{figure}
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp1{]}~jim\%~}\textbf{\footnotesize fossil~commit~-m~\textquotedbl{}{[}2795e6c74d{]}~Fix~unused~variable\textquotedbl{}}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~2116~~~~~~~~~46~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~365~~~~~~~~~~6~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~3601~~~~~~~~~51~~~~~~~~~~5~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~805~bytes~sent,~3464~bytes~received}{\footnotesize \par}

{\footnotesize New\_Version:~3b902585d0e8849399286139d27676c5a349de7b}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~3034~~~~~~~~~50~~~~~~~~~~0~~~~~~~~~~2}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~2208~~~~~~~~~48~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1848~bytes~sent,~1444~bytes~received}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp1{]}~jim\%~}\textbf{\footnotesize cd~..}{\footnotesize \par}

{\footnotesize {[}Pandora-2:/Users/jschimpf/Public{]}~jim\%~}\textbf{\footnotesize cd~jsonp2}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp2{]}~jim\%~}\textbf{\footnotesize cp~../jsonp1/main.c~.}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp2{]}~jim\%~}\textbf{\footnotesize fossil~status}{\footnotesize \par}

{\footnotesize repository:~~~/Users/jschimpf/Public/FOSSIL/jsonp.fossil}{\footnotesize \par}

{\footnotesize local-root:~~~/Users/jschimpf/Public/jsonp2/}{\footnotesize \par}

{\footnotesize server-code:~~90c80f1a2da7360dae230ccec65ff82fe2eb160d}{\footnotesize \par}

{\footnotesize checkout:~~~~~a1737916ec2df696a0f3a7e36edf9ba4370e48a7~2010-06-13~10:14:26~UTC}{\footnotesize \par}

{\footnotesize parent:~~~~~~~462156b283b694af0b99c9b446b64d3f77436fbb~2010-06-09~14:16:42~UTC}{\footnotesize \par}

{\footnotesize tags:~~~~~~~~~VER\_2.0}{\footnotesize \par}

{\footnotesize EDITED~~~~~main.c}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp2{]}~jim\%~}\textbf{\footnotesize fossil~commit~-m~\textquotedbl{}{[}2795e6c74d{]}~Fix~unused~variable\textquotedbl{}}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~2392~~~~~~~~~52~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~318~~~~~~~~~~5~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~3320~~~~~~~~~56~~~~~~~~~~4~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~781~bytes~sent,~3508~bytes~received}{\footnotesize \par}

{\footnotesize New\_Version:~762a31854d708080678598c8d4ce28465cbee8c5}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~3253~~~~~~~~~55~~~~~~~~~~0~~~~~~~~~~2}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~2438~~~~~~~~~53~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1972~bytes~sent,~1573~bytes~received}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp2{]}~jim\%~}{\footnotesize \par}
\end{lyxcode}
\caption{Fixing both branches}


\end{figure}


Now the timeline looks like this:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Branching/current_state}

\caption{Correcting both branches}


\end{figure}



\subsubsection{Commands used}
\begin{itemize}
\item \textbf{fossil branch }Used to generate a branch of the repository. The command can optionally color the branch in the display.
\end{itemize}

\section{Fossil Commands}


\subsection{Introduction}

This section will go through the various Fossil command line commands. This will be divided into sections, the first will detail the must know commands. These are the ones you will be using all the time and will probably have memorized in short order. The other commands will be divided into Maintenance, Advanced, and Miscellaneous. These you will probably be checking as reference before use.

The most important command is \textbf{help}. You can always type \textbf{fossil help} at the command line and it will list out all the commands it has. Then typing f\textbf{ossil help <command> }will print out the detailed information on that command. You always have that as your reference. This section of the book will try to supplement the built in help with some examples and further explanation of what a command does. All of the commands will be placed in the index for easy searching

\textbf{NOTE:} Fossil is a moving target, commands might be added and others removed future versions. Type \textbf{fossil help }on your version to get the latest list. The following applies to the fossil I used when I wrote this and your version might be different.


\subsection{Basic Commands}


\subsubsection{help\index{help}}

This command is used to dump the current command set and version of Fossil. It can also be used in the form \textbf{fossil help <command> }to get further information on any command.

\begin{figure}[H]
\noindent \begin{centering}
\includegraphics{Images/Commands/help1}
\par\end{centering}

\caption{Help run}


\end{figure}


Using it to get further information about a particular command

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~add}{\scriptsize \par}

{\scriptsize Usage:~fossil~add~FILE...}{\scriptsize \par}

{\scriptsize Make~arrangements~to~add~one~or~more~files~to~the~current~checkout}{\scriptsize \par}

{\scriptsize at~the~next~commit.}{\scriptsize \par}

{\scriptsize When~adding~files~recursively,~filenames~that~begin~with~\textquotedbl{}.\textquotedbl{}~are}{\scriptsize \par}

{\scriptsize excluded~by~default.~To~include~such~files,~add~the~\textquotedbl{}-{}-dotfiles\textquotedbl{}}{\scriptsize \par}

{\scriptsize option~to~the~command-line.}{\scriptsize \par}
\end{lyxcode}
\caption{Help detail}


\end{figure}



\subsubsection{add\index{add}}

The add command is used to add files into a repository. It is recursive and will pull in all files in subdirectories of the current. Fossil will not overwrite any of the files already present in the repository so it is safe to add all the files at any time. Only new files will be added.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil}{\scriptsize{}~}\textbf{\scriptsize help~add}{\scriptsize \par}

{\scriptsize Usage:~fossil~add~FILE...}{\scriptsize \par}

{\scriptsize Make~arrangements~to~add~one~or~more~files~to~the~current~checkout}{\scriptsize \par}

{\scriptsize at~the~next~commit.}{\scriptsize \par}

{\scriptsize When~adding~files~recursively,~filenames~that~begin~with~\textquotedbl{}.\textquotedbl{}~are}{\scriptsize \par}

{\scriptsize excluded~by~default.~To~include~such~files,~add~the~\textquotedbl{}-{}-dotfiles\textquotedbl{}}{\scriptsize \par}

{\scriptsize option~to~the~command-line.}{\scriptsize \par}
\end{lyxcode}
\caption{add detail}


\end{figure}


Typing:
\begin{lyxcode}
fossil~add~.
\end{lyxcode}
will add all files in the current directory and subdirectories.

Note none of these files are put in the repository untill a commit is done.


\subsubsection{rm\index{rm} or del\index{del}}

The rm command is used to remove files from the repository. The file is not deleted from the file system but it will be dropped from the repository on the next commit. This file will still be available in earlier versions of the repository but not in later ones.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~rm}{\scriptsize \par}

{\scriptsize Usage:~fossil~rm~FILE...}{\scriptsize \par}

{\scriptsize{}~~~or:~fossil~del~FILE...}{\scriptsize \par}

{\scriptsize Remove~one~or~more~files~from~the~tree.}{\scriptsize \par}

{\scriptsize This~command~does~not~remove~the~files~from~disk.~~It~just~marks~the}{\scriptsize \par}

{\scriptsize files~as~no~longer~being~part~of~the~project.~~In~other~words,~future}{\scriptsize \par}

{\scriptsize changes~to~the~named~files~will~not~be~versioned.}{\scriptsize \par}
\end{lyxcode}
\caption{rm detail}


\end{figure}


You can delete groups of files by using wild-cards in their names. Thus if I had a group of files like com\_tr.c, com\_rx.c and com\_mgmt.c I could remove them all with:
\begin{lyxcode}
fossil~rm~com\_{*}.c
\end{lyxcode}
By running a ``fossil status'' you can see what files will be deleted on the next commit.


\subsubsection{rename\index{rename} or mv\index{mv}}

This command is used to rename a file in the repository. This does not rename files on disk so is usually used after you have renamed files on the disk then want to change this in the repository.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~help~rename}{\scriptsize \par}

{\scriptsize Usage:~fossil~mv|rename~OLDNAME~NEWNAME}{\scriptsize \par}

{\scriptsize{}~~~or:~fossil~mv|rename~OLDNAME...~DIR}{\scriptsize \par}

{\scriptsize Move~or~rename~one~or~more~files~within~the~tree}{\scriptsize \par}

{\scriptsize This~command~does~not~rename~the~files~on~disk.~~All~this~command~does~is}{\scriptsize \par}

{\scriptsize record~the~fact~that~filenames~have~changed~so~that~appropriate~notations}{\scriptsize \par}

{\scriptsize can~be~made~at~the~next~commit/checkin.}{\scriptsize \par}
\end{lyxcode}
\caption{rename detail}
\end{figure}


Just like add or rm you can use wild cards in the names and rename groups of files. Like them ``fossil status'' will show you the current state.


\subsubsection{status\index{status}}

The status command is used to show you the current state of your files relative to the repository. It will show you files added, deleted, and changed. This is only the condition of files that are already in the repository or under control of fossil. It also shows from where in the timeline you are checked out and where your repository is kept.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~status}{\scriptsize \par}

{\scriptsize repository:~~~/Users/jschimpf/Public/FOSSIL/FossilBook.fossil}{\scriptsize \par}

{\scriptsize local-root:~~~/Users/jschimpf/Public/FossilBook/}{\scriptsize \par}

{\scriptsize server-code:~~3e67da6d6212494456c69b1c5406a277d7e50430}{\scriptsize \par}

{\scriptsize checkout:~~~~~edd5b5fa4277604f365ec09238422c0aa7a28faf~2010-05-08~14:44:21~UTC}{\scriptsize \par}

{\scriptsize parent:~~~~~~~3f019cbc730db0eb35f20941533a22635856b2b3~2010-05-08~11:15:19~UTC}{\scriptsize \par}

{\scriptsize tags:~~~~~~~~~trunk}{\scriptsize \par}

{\scriptsize EDITED~~~~~fossilbook.lyx}{\scriptsize \par}

{\scriptsize EDITED~~~~~outline.txt}{\scriptsize \par}
\end{lyxcode}
\caption{\label{fig:status-run}status run}


\end{figure}


The listing above shows where my cloned copy of the repository is kept, where I am working, and the tags show me that I am checked out of the trunk. Finally it shows the status of the files: I am working on two of them.


\subsubsection{changes\index{changes}}

This lists the changed files like status but does not show the other information that status does.

\begin{figure}
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~changes}{\scriptsize \par}

{\scriptsize Usage:~fossil~changes}{\scriptsize \par}

{\scriptsize Report~on~the~edit~status~of~all~files~in~the~current~checkout.}{\scriptsize \par}

{\scriptsize See~also~the~\textquotedbl{}status\textquotedbl{}~and~\textquotedbl{}extra\textquotedbl{}~commands.}{\scriptsize \par}
\end{lyxcode}
\caption{changes details}


\end{figure}



\subsubsection{extra\index{extra}}

The extra command is used to find files you have added to your working directory but are not yet under Fossil control. This is important because if you move your working directory or others attempt to use the repository they won't have these files. 

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~extra}{\scriptsize \par}

{\scriptsize Usage:~fossil~extras~?-{}-dotfiles?~?-{}-ignore~GLOBPATTERN?}{\scriptsize \par}

{\scriptsize Print~a~list~of~all~files~in~the~source~tree~that~are~not~part~of}{\scriptsize \par}

{\scriptsize the~current~checkout.~~See~also~the~\textquotedbl{}clean\textquotedbl{}~command.}{\scriptsize \par}

{\scriptsize Files~and~subdirectories~whose~names~begin~with~\textquotedbl{}.\textquotedbl{}~are~normally}{\scriptsize \par}

{\scriptsize ignored~but~can~be~included~by~adding~the~-{}-dotfiles~option.}{\scriptsize \par}
\end{lyxcode}
\caption{extra details}


\end{figure}


The --dotfiles option shows you any files starting with ``.'' that are not under Fossil control. This would be important if you need those files in your repository. The last option --ignore allows you to ignore certain files you know don't belong in the repository. In my case there is a file called fossilbook.lyx\textasciitilde{} that is a \LyX{} backup file that I do not want, as it is temporary. So I can say
\begin{lyxcode}
fossil~extra~-{}-ignore~{*}.lyx\textasciitilde{}~
\end{lyxcode}
and only get:
\begin{lyxcode}
{[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~\textbf{fossil~extra~-{}-ignore~{*}.lyx\textasciitilde{}}

Images/Commands/help1.epsf
\end{lyxcode}
instead of:
\begin{lyxcode}
{[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~\textbf{fossil~extra}

Images/Commands/help1.epsf

fossilbook.lyx\textasciitilde{}
\end{lyxcode}

\subsubsection{revert\index{revert}}

The revert command is used to take a file back to the value in the repository. This is useful when you make a error in editing or other mistake.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~revert}{\scriptsize \par}

{\scriptsize Usage:~fossil~revert~?-r~REVISION?~FILE~...}{\scriptsize \par}

{\scriptsize Revert~to~the~current~repository~version~of~FILE,~or~to}{\scriptsize \par}

{\scriptsize the~version~associated~with~baseline~REVISION~if~the~-r~flag}{\scriptsize \par}

{\scriptsize appears.}{\scriptsize \par}

{\scriptsize If~a~file~is~reverted~accidently,~it~can~be~restored~using}{\scriptsize \par}

{\scriptsize the~\textquotedbl{}fossil~undo\textquotedbl{}~command.}{\scriptsize \par}
\end{lyxcode}
\caption{revert details}


\end{figure}


With no parameters it will revert the file to the current revision, see Figure \vref{fig:status-run}. The -r option allows you to pick any revision from the time line.


\subsubsection{update\index{update}}

The update option will update a file or files to match the repository. With multiple users it should be done before you start working on any files. This ensures you have the latest version of all the files. 

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~update}{\scriptsize \par}

{\scriptsize Usage:~fossil~update~?VERSION?~?FILES...?}{\scriptsize \par}

{\scriptsize Change~the~version~of~the~current~checkout~to~VERSION.~~Any~uncommitted}{\scriptsize \par}

{\scriptsize changes~are~retained~and~applied~to~the~new~checkout.}{\scriptsize \par}



{\scriptsize The~VERSION~argument~can~be~a~specific~version~or~tag~or~branch~name.}{\scriptsize \par}

{\scriptsize If~the~VERSION~argument~is~omitted,~then~the~leaf~of~the~the~subtree}{\scriptsize \par}

{\scriptsize that~begins~at~the~current~version~is~used,~if~there~is~only~a~single}{\scriptsize \par}

{\scriptsize leaf.~~VERSION~can~also~be~\textquotedbl{}current\textquotedbl{}~to~select~the~leaf~of~the~current}{\scriptsize \par}

{\scriptsize version~or~\textquotedbl{}latest\textquotedbl{}~to~select~the~most~recent~check-in.}{\scriptsize \par}



{\scriptsize If~one~or~more~FILES~are~listed~after~the~VERSION~then~only~the}{\scriptsize \par}

{\scriptsize named~files~are~candidates~to~be~updated.~~If~FILES~is~omitted,~all}{\scriptsize \par}

{\scriptsize files~in~the~current~checkout~are~subject~to~be~updated.}{\scriptsize \par}



{\scriptsize The~-n~or~-{}-nochange~option~causes~this~command~to~do~a~\textquotedbl{}dry~run\textquotedbl{}.~~It}{\scriptsize \par}

{\scriptsize prints~out~what~would~have~happened~but~does~not~actually~make~any}{\scriptsize \par}

{\scriptsize changes~to~the~current~checkout~or~the~repository.}{\scriptsize \par}



{\scriptsize The~-v~or~-{}-verbose~option~prints~status~information~about~unchanged}{\scriptsize \par}

{\scriptsize files~in~addition~to~those~file~that~actually~do~change.}{\scriptsize \par}
\end{lyxcode}
\caption{update details}


\end{figure}


Update has a number of options, first you can tie the update to a particular version, if not picked then it just uses the latest. Second it can work on a single files or many files at once. That is you could say
\begin{lyxcode}
fossil~update~{*}.c
\end{lyxcode}
and it would update all C files.

Since this is a rather large set of changes it has a special ``dry run'' mode. If you add -n on the command it will just print out what will be done but not do it. This is very useful to do this trial if you are unsure what might happen. The -v command (which can be used with -n or alone) prints out the action for each file even if it does nothing.


\subsubsection{checkout\index{checkout} or co\index{co}}

This command is similar to update.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~help~checkout}{\scriptsize \par}

{\scriptsize Usage:~fossil~checkout~VERSION~?-f|-{}-force?~?-{}-keep?}{\scriptsize \par}

{\scriptsize Check~out~a~version~specified~on~the~command-line.~~This~command}{\scriptsize \par}

{\scriptsize will~abort~if~there~are~edited~files~in~the~current~checkout~unless}{\scriptsize \par}

{\scriptsize the~-{}-force~option~appears~on~the~command-line.~~The~-{}-keep~option}{\scriptsize \par}

{\scriptsize leaves~files~on~disk~unchanged,~except~the~manifest~and~manifest.uuid}{\scriptsize \par}

{\scriptsize files.}{\scriptsize \par}

{\scriptsize The~-{}-latest~flag~can~be~used~in~place~of~VERSION~to~checkout~the}{\scriptsize \par}

{\scriptsize latest~version~in~the~repository.}{\scriptsize \par}

{\scriptsize See~also~the~\textquotedbl{}update\textquotedbl{}~command.}{\scriptsize \par}
\end{lyxcode}
\caption{checkout or co details}


\end{figure}



\subsubsection{undo\index{undo}}

This is used to undo the last update, merge, or revert operation. 

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~undo}{\scriptsize \par}

{\scriptsize Usage:~fossil~undo~?FILENAME...?}{\scriptsize \par}



{\scriptsize Undo~the~most~recent~update~or~merge~or~revert~operation.~~If~FILENAME~is}{\scriptsize \par}

{\scriptsize specified~then~restore~the~content~of~the~named~file(s)~but~otherwise}{\scriptsize \par}

{\scriptsize leave~the~update~or~merge~or~revert~in~effect.}{\scriptsize \par}



{\scriptsize A~single~level~of~undo/redo~is~supported.~~The~undo/redo~stack}{\scriptsize \par}

{\scriptsize is~cleared~by~the~commit~and~checkout~commands.}{\scriptsize \par}
\end{lyxcode}
\caption{undo details}


\end{figure}


It acts on a single file or files if specified, otherwise if no file given, it undoes all of the last changes.


\subsubsection{diff\index{diff}}

The diff command is used to produce a text listing of the difference of a file in the working directory and that same file in the repository. If you don't specify a file it will show the differences between all the changed files in the working directory vs the repository. If you use the --from and --to options you can specify which versions to check and to compare between two different versions in the repository. Not using the --to means compare with the working directory.

If you have configured an external diff program it will be used unless you use the -i option which uses the diff built into Fossil.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~diff}{\scriptsize \par}

{\scriptsize Usage:~fossil~diff|gdiff~?options?~?FILE?}{\scriptsize \par}



{\scriptsize Show~the~difference~between~the~current~version~of~FILE~(as~it}{\scriptsize \par}

{\scriptsize exists~on~disk)~and~that~same~file~as~it~was~checked~out.~~Or}{\scriptsize \par}

{\scriptsize if~the~FILE~argument~is~omitted,~show~the~unsaved~changed~currently}{\scriptsize \par}

{\scriptsize in~the~working~check-out.}{\scriptsize \par}



{\scriptsize If~the~\textquotedbl{}-{}-from~VERSION\textquotedbl{}~or~\textquotedbl{}-r~VERSION\textquotedbl{}~option~is~used~it~specifies}{\scriptsize \par}

{\scriptsize the~source~check-in~for~the~diff~operation.~~If~not~specified,~the~}{\scriptsize \par}

{\scriptsize source~check-in~is~the~base~check-in~for~the~current~check-out.}{\scriptsize \par}

{\scriptsize If~the~\textquotedbl{}-{}-to~VERSION\textquotedbl{}~option~appears,~it~specifies~the~check-in~from}{\scriptsize \par}

{\scriptsize which~the~second~version~of~the~file~or~files~is~taken.~~If~there~is}{\scriptsize \par}

{\scriptsize no~\textquotedbl{}-{}-to\textquotedbl{}~option~then~the~(possibly~edited)~files~in~the~current~check-out}{\scriptsize \par}

{\scriptsize are~used.}{\scriptsize \par}



{\scriptsize The~\textquotedbl{}-i\textquotedbl{}~command-line~option~forces~the~use~of~the~internal~diff~logic}{\scriptsize \par}

{\scriptsize rather~than~any~external~diff~program~that~might~be~configured~using}{\scriptsize \par}

{\scriptsize the~\textquotedbl{}setting\textquotedbl{}~command.~~If~no~external~diff~program~is~configured,~then}{\scriptsize \par}

{\scriptsize the~\textquotedbl{}-i\textquotedbl{}~option~is~a~no-op.~~The~\textquotedbl{}-i\textquotedbl{}~option~converts~\textquotedbl{}gdiff\textquotedbl{}~into~\textquotedbl{}diff\textquotedbl{}.}{\scriptsize \par}
\end{lyxcode}
\caption{diff details}


\end{figure}



\subsubsection{gdiff\index{gdiff}}

This is the same as the diff command but uses (if configured) a graphical diff program you have on your system. See the settings command for details on how to set the graphical diff program.

\begin{figure}
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~gdiff}{\scriptsize \par}

{\scriptsize Usage:~fossil~diff|gdiff~?options?~?FILE?}{\scriptsize \par}

{\scriptsize Show~the~difference~between~the~current~version~of~FILE~(as~it}{\scriptsize \par}

{\scriptsize exists~on~disk)~and~that~same~file~as~it~was~checked~out.~~Or}{\scriptsize \par}

{\scriptsize if~the~FILE~argument~is~omitted,~show~the~unsaved~changed~currently}{\scriptsize \par}

{\scriptsize in~the~working~check-out.}{\scriptsize \par}

{\scriptsize If~the~\textquotedbl{}-{}-from~VERSION\textquotedbl{}~or~\textquotedbl{}-r~VERSION\textquotedbl{}~option~is~used~it~specifies}{\scriptsize \par}

{\scriptsize the~source~check-in~for~the~diff~operation.~~If~not~specified,~the~}{\scriptsize \par}

{\scriptsize source~check-in~is~the~base~check-in~for~the~current~check-out.}{\scriptsize \par}

{\scriptsize If~the~\textquotedbl{}-{}-to~VERSION\textquotedbl{}~option~appears,~it~specifies~the~check-in~from}{\scriptsize \par}

{\scriptsize which~the~second~version~of~the~file~or~files~is~taken.~~If~there~is}{\scriptsize \par}

{\scriptsize no~\textquotedbl{}-{}-to\textquotedbl{}~option~then~the~(possibly~edited)~files~in~the~current~check-out}{\scriptsize \par}

{\scriptsize are~used.}{\scriptsize \par}

{\scriptsize The~\textquotedbl{}-i\textquotedbl{}~command-line~option~forces~the~use~of~the~internal~diff~logic}{\scriptsize \par}

{\scriptsize rather~than~any~external~diff~program~that~might~be~configured~using}{\scriptsize \par}

{\scriptsize the~\textquotedbl{}setting\textquotedbl{}~command.~~If~no~external~diff~program~is~configured,~then}{\scriptsize \par}

{\scriptsize the~\textquotedbl{}-i\textquotedbl{}~option~is~a~no-op.~~The~\textquotedbl{}-i\textquotedbl{}~option~converts~\textquotedbl{}gdiff\textquotedbl{}~into~\textquotedbl{}diff\textquotedbl{}.}{\scriptsize \par}
\end{lyxcode}
\caption{gdiff details}


\end{figure}



\subsubsection{ui\index{ui} }

The ui command is used to start Fossil in a local webserver. The --port option is used to specify the port it uses, by default it uses 8080. It should automatically start the system's web browser and it will come up with the repository web page. If run within a working directory it will bring up the web page for that repository. If run outside the working directory you can specify the repository on the command line.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~help~ui}{\scriptsize \par}

{\scriptsize Usage:~fossil~server~?-P|-{}-port~TCPPORT?~?REPOSITORY?}{\scriptsize \par}

{\scriptsize{}~~~Or:~fossil~ui~?-P|-{}-port~TCPPORT?~?REPOSITORY?}{\scriptsize \par}



{\scriptsize Open~a~socket~and~begin~listening~and~responding~to~HTTP~requests~on}{\scriptsize \par}

{\scriptsize TCP~port~8080,~or~on~any~other~TCP~port~defined~by~the~-P~or}{\scriptsize \par}

{\scriptsize -{}-port~option.~~The~optional~argument~is~the~name~of~the~repository.}{\scriptsize \par}

{\scriptsize The~repository~argument~may~be~omitted~if~the~working~directory~is}{\scriptsize \par}

{\scriptsize within~an~open~checkout.}{\scriptsize \par}



{\scriptsize The~\textquotedbl{}ui\textquotedbl{}~command~automatically~starts~a~web~browser~after~initializing}{\scriptsize \par}

{\scriptsize the~web~server.}{\scriptsize \par}



{\scriptsize In~the~\textquotedbl{}server\textquotedbl{}~command,~the~REPOSITORY~can~be~a~directory~(aka~folder)}{\scriptsize \par}

{\scriptsize that~contains~one~or~more~repositories~with~names~ending~in~\textquotedbl{}.fossil\textquotedbl{}.}{\scriptsize \par}

{\scriptsize In~that~case,~the~first~element~of~the~URL~is~used~to~select~among~the}{\scriptsize \par}

{\scriptsize various~repositories.}{\scriptsize \par}
\end{lyxcode}
\caption{ui details}
\end{figure}



\subsubsection{server\index{server}}

This is a more powerful version of the ui command. This allows you to have multiple repositories supported by a single running Fossil webserver. This way you start the server and instead of a paricular repository you specify a directory where a number of repositories reside (all having the extension .fossil) then you can open and use any of them.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~server}{\scriptsize \par}

{\scriptsize Usage:~fossil~server~?-P|-{}-port~TCPPORT?~?REPOSITORY?}{\scriptsize \par}

{\scriptsize{}~~~Or:~fossil~ui~?-P|-{}-port~TCPPORT?~?REPOSITORY?}{\scriptsize \par}

{\scriptsize Open~a~socket~and~begin~listening~and~responding~to~HTTP~requests~on}{\scriptsize \par}

{\scriptsize TCP~port~8080,~or~on~any~other~TCP~port~defined~by~the~-P~or}{\scriptsize \par}

{\scriptsize -{}-port~option.~~The~optional~argument~is~the~name~of~the~repository.}{\scriptsize \par}

{\scriptsize The~repository~argument~may~be~omitted~if~the~working~directory~is}{\scriptsize \par}

{\scriptsize within~an~open~checkout.}{\scriptsize \par}

{\scriptsize The~\textquotedbl{}ui\textquotedbl{}~command~automatically~starts~a~web~browser~after~initializing}{\scriptsize \par}

{\scriptsize the~web~server.}{\scriptsize \par}

{\scriptsize In~the~\textquotedbl{}server\textquotedbl{}~command,~the~REPOSITORY~can~be~a~directory~(aka~folder)}{\scriptsize \par}

{\scriptsize that~contains~one~or~more~repositories~with~names~ending~in~\textquotedbl{}.fossil\textquotedbl{}.}{\scriptsize \par}

{\scriptsize In~that~case,~the~first~element~of~the~URL~is~used~to~select~among~the}{\scriptsize \par}

{\scriptsize various~repositories.}{\scriptsize \par}
\end{lyxcode}
\caption{server detail\label{fig:server-detail}}


\end{figure}



\subsubsection{commit\index{commit} or ci\index{ci}}

This is the command used to put the current changes in the working directory into the repository, giving this a new version and updating the timeline.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~help~commit}{\scriptsize \par}

{\scriptsize Usage:~fossil~commit~?OPTIONS?~?FILE...?}{\scriptsize \par}



{\scriptsize Create~a~new~version~containing~all~of~the~changes~in~the~current}{\scriptsize \par}

{\scriptsize checkout.~~You~will~be~prompted~to~enter~a~check-in~comment~unless}{\scriptsize \par}

{\scriptsize one~of~the~\textquotedbl{}-m\textquotedbl{}~or~\textquotedbl{}-M\textquotedbl{}~options~are~used~to~specify~a~comment.}{\scriptsize \par}

{\scriptsize \textquotedbl{}-m\textquotedbl{}~takes~a~single~string~for~the~commit~message~and~\textquotedbl{}-M\textquotedbl{}~requires}{\scriptsize \par}

{\scriptsize a~filename~from~which~to~read~the~commit~message.~If~neither~\textquotedbl{}-m\textquotedbl{}}{\scriptsize \par}

{\scriptsize nor~\textquotedbl{}-M\textquotedbl{}~are~specified~then~the~editor~defined~in~the~\textquotedbl{}editor\textquotedbl{}}{\scriptsize \par}

{\scriptsize fossil~option~(see~fossil~help~set)~will~be~used,~or~from~the}{\scriptsize \par}

{\scriptsize \textquotedbl{}VISUAL\textquotedbl{}~or~\textquotedbl{}EDITOR\textquotedbl{}~environment~variables~(in~that~order)~if~no}{\scriptsize \par}

{\scriptsize editor~is~set.}{\scriptsize \par}



{\scriptsize You~will~be~prompted~for~your~GPG~pass~phrase~in~order~to~sign~the}{\scriptsize \par}

{\scriptsize new~manifest~unless~the~\textquotedbl{}-{}-nosign\textquotedbl{}~options~is~used.~~All~files~that}{\scriptsize \par}

{\scriptsize have~changed~will~be~committed~unless~some~subset~of~files~is}{\scriptsize \par}

{\scriptsize specified~on~the~command~line.}{\scriptsize \par}



{\scriptsize The~-{}-branch~option~followed~by~a~branch~name~cases~the~new~check-in}{\scriptsize \par}

{\scriptsize to~be~placed~in~the~named~branch.~~The~-{}-bgcolor~option~can~be~followed}{\scriptsize \par}

{\scriptsize by~a~color~name~(ex:~~'\#ffc0c0')~to~specify~the~background~color~of}{\scriptsize \par}

{\scriptsize entries~in~the~new~branch~when~shown~in~the~web~timeline~interface.}{\scriptsize \par}

{\scriptsize A~check-in~is~not~permitted~to~fork~unless~the~-{}-force~or~-f}{\scriptsize \par}

{\scriptsize option~appears.~~A~check-in~is~not~allowed~against~a~closed~check-in.}{\scriptsize \par}

{\scriptsize The~-{}-private~option~creates~a~private~check-in~that~is~never~synced.}{\scriptsize \par}

{\scriptsize Children~of~private~check-ins~are~automatically~private.}{\scriptsize \par}



{\scriptsize Options:}{\scriptsize \par}

{\scriptsize{}~~~-{}-comment|-m~COMMENT-TEXT}{\scriptsize \par}

{\scriptsize{}~~~-{}-branch~NEW-BRANCH-NAME}{\scriptsize \par}

{\scriptsize{}~~~-{}-bgcolor~COLOR}{\scriptsize \par}

{\scriptsize{}~~~-{}-nosign}{\scriptsize \par}

{\scriptsize{}~~~-{}-force|-f}{\scriptsize \par}

{\scriptsize{}~~~-{}-private}{\scriptsize \par}

{\scriptsize{}~~~-{}-message-file|-M~COMMENT-FILE}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}{\scriptsize \par}
\end{lyxcode}
\caption{commit details}


\end{figure}


It's a very good idea to always put a comment (-comment or -m) text on any commit. This way you get documentation in the timeline.


\subsection{Maintenance commands}

These commands you will probably use less often since the actions they perform are not needed in normal operation. You will have to use them and referring here or to \textbf{fossil help} will probably be required before use. Some of them like new or clone are only needed when you start a repository. Others like rebuild or reconstruct are only needed to fix or update a repository. 


\subsubsection{new\index{new}}

This command is used to create a new repository. 

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~new}{\scriptsize \par}

{\scriptsize Usage:~fossil~new~?OPTIONS?~FILENAME}{\scriptsize \par}



{\scriptsize Create~a~repository~for~a~new~project~in~the~file~named~FILENAME.}{\scriptsize \par}

{\scriptsize This~command~is~distinct~from~\textquotedbl{}clone\textquotedbl{}.~~The~\textquotedbl{}clone\textquotedbl{}~command~makes}{\scriptsize \par}

{\scriptsize a~copy~of~an~existing~project.~~This~command~starts~a~new~project.}{\scriptsize \par}

{\scriptsize By~default,~your~current~login~name~is~used~to~create~the~default}{\scriptsize \par}

{\scriptsize admin~user.~This~can~be~overridden~using~the~-A|-{}-admin-user}{\scriptsize \par}

{\scriptsize parameter.}{\scriptsize \par}



{\scriptsize Options:}{\scriptsize \par}

{\scriptsize{}~~~-{}-admin-user|-A~USERNAME}{\scriptsize \par}

{\scriptsize{}~~~-{}-date-override~DATETIME}{\scriptsize \par}
\end{lyxcode}
\caption{new details}


\end{figure}


The file name specifies the new repository name. The options provided allow you to specify the admin user name if you want it to be different than your current login and the starting date if you want it to be different than now.


\subsubsection{clone\index{clone}}

The clone command is used to create your own local version of the master repository. If you are supporting multiple users via a network accessible version of the original repository (see Section\vref{sub:Server-Setup}), then this command will copy that repository to your machine. Also it will make a link between your copy and the master, so that changes made in your copy will be propagated to the master.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~help~clone}{\scriptsize \par}

{\scriptsize Usage:~fossil~clone~?OPTIONS?~URL~FILENAME}{\scriptsize \par}



{\scriptsize Make~a~clone~of~a~repository~specified~by~URL~in~the~local}{\scriptsize \par}

{\scriptsize file~named~FILENAME.~}{\scriptsize \par}



{\scriptsize By~default,~your~current~login~name~is~used~to~create~the~default}{\scriptsize \par}

{\scriptsize admin~user.~This~can~be~overridden~using~the~-A|-{}-admin-user}{\scriptsize \par}

{\scriptsize parameter.}{\scriptsize \par}

{\scriptsize Options:}{\scriptsize \par}



{\scriptsize{}~~~-{}-admin-user|-A~USERNAME}{\scriptsize \par}
\end{lyxcode}
\caption{clone details}


\end{figure}


Just like create you can specify the admin user for this clone with an option. The URL for the master repository is of the form:
\begin{lyxcode}
http://<user>:<password>@domain
\end{lyxcode}
Where \textbf{user} and \textbf{password} are for a valid user of the selected repository. It is best to check the path with a browser before doing the clone. Make sure you can reach it, for example the repository for this book is:
\begin{lyxcode}
http://pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi
\end{lyxcode}
Putting that into a browser should get you the home page for this book. (See Figure \vref{fig:Web-access-to}). After you have verified that, then running the clone command should work. 

Don't forget (as I always do) to put in the file name for the local repository, (see FILENAME above)


\subsubsection{open\index{open}}

The open command is used to copy the files in a repository to a working directory. Doing this allows you to build or modify the product. The command also links this working directory to the repository so commits will go into the repository.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~open}{\scriptsize \par}

{\scriptsize Usage:~fossil~open~FILENAME~?VERSION?~?-{}-keep?}{\scriptsize \par}



{\scriptsize Open~a~connection~to~the~local~repository~in~FILENAME.~~A~checkout}{\scriptsize \par}

{\scriptsize for~the~repository~is~created~with~its~root~at~the~working~directory.}{\scriptsize \par}

{\scriptsize If~VERSION~is~specified~then~that~version~is~checked~out.~~Otherwise}{\scriptsize \par}

{\scriptsize the~latest~version~is~checked~out.~~No~files~other~than~\textquotedbl{}manifest\textquotedbl{}}{\scriptsize \par}

{\scriptsize and~\textquotedbl{}manifest.uuid\textquotedbl{}~are~modified~if~the~-{}-keep~option~is~present.}{\scriptsize \par}



{\scriptsize See~also~the~\textquotedbl{}close\textquotedbl{}~command.}{\scriptsize \par}
\end{lyxcode}
\caption{open details}


\end{figure}


If you have multiple users or have a branched repository then it is probably wise to specify the particular version you want. When you run this it will create all the files and directories in the repository in your work area. In addition the files \_FOSSIL\_, manifiest and manifest.uuid will be created by Fossil.


\subsubsection{close\index{close}}

This is the opposite of open, in that it breaks the connection between this working directory and the Fossil repository.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~close}{\scriptsize \par}

{\scriptsize Usage:~fossil~close~?-f|-{}-force?}{\scriptsize \par}



{\scriptsize The~opposite~of~\textquotedbl{}open\textquotedbl{}.~~Close~the~current~database~connection.}{\scriptsize \par}

{\scriptsize Require~a~-f~or~-{}-force~flag~if~there~are~unsaved~changed~in~the}{\scriptsize \par}

{\scriptsize current~check-out.}{\scriptsize \par}
\end{lyxcode}
\caption{close details}


\end{figure}


This is useful if you need to abandon the current working directory. Fossil will not let you do this if there are changes between the current directory and the repository. With the force flag you can explicitly cut the connection even if there are changes.


\subsubsection{version\index{version}}

This command is used to show the current version of fossil.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~version}{\scriptsize \par}

{\scriptsize Usage:~fossil~version}{\scriptsize \par}

{\scriptsize Print~the~source~code~version~number~for~the~fossil~executable.}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~version}{\scriptsize \par}

{\scriptsize This~is~fossil~version~{[}c56af61e5e{]}~2010-04-22~15:48:25~UTC}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}{\scriptsize \par}
\end{lyxcode}
\caption{version details}


\end{figure}


The above figure shows the help and example of running the command. When you have problems with fossil it is very important to have this version information. You can then inquire of the Fossil news group about this problem and with the version information they can easily tell you if the problem is fixed already or is new.


\subsubsection{rebuild\index{rebuild}}

If you update your copy of Fossil you will want to run this command against all the repositories you have. This will automatically update them to the new version of Fossil.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~rebuild}{\scriptsize \par}

{\scriptsize Usage:~fossil~rebuild~?REPOSITORY?}{\scriptsize \par}

{\scriptsize Reconstruct~the~named~repository~database~from~the~core}{\scriptsize \par}

{\scriptsize records.~~Run~this~command~after~updating~the~fossil}{\scriptsize \par}

{\scriptsize executable~in~a~way~that~changes~the~database~schema.}{\scriptsize \par}
\end{lyxcode}
\caption{rebuild details}


\end{figure}



\subsubsection{all\index{all}}

This command is actually a modifier and when used before certain commands will run them on all the repositories.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~all}{\scriptsize \par}

{\scriptsize Usage:~fossil~all~(list|ls|pull|push|rebuild|sync)}{\scriptsize \par}

{\scriptsize The~\textasciitilde{}/.fossil~file~records~the~location~of~all~repositories~for~a}{\scriptsize \par}

{\scriptsize user.~~This~command~performs~certain~operations~on~all~repositories}{\scriptsize \par}

{\scriptsize that~can~be~useful~before~or~after~a~period~of~disconnection~operation.}{\scriptsize \par}

{\scriptsize Available~operations~are:}{\scriptsize \par}

{\scriptsize{}~~~list~~~~~~~Display~the~location~of~all~repositories}{\scriptsize \par}

{\scriptsize{}~~~ls~~~~~~~~~An~alias~for~\textquotedbl{}list\textquotedbl{}}{\scriptsize \par}

{\scriptsize{}~~~pull~~~~~~~Run~a~\textquotedbl{}pull\textquotedbl{}~operation~on~all~repositories}{\scriptsize \par}

{\scriptsize{}~~~push~~~~~~~Run~a~\textquotedbl{}push\textquotedbl{}~on~all~repositories}{\scriptsize \par}

{\scriptsize{}~~~rebuild~~~~Rebuild~on~all~repositories}{\scriptsize \par}

{\scriptsize{}~~~sync~~~~~~~Run~a~\textquotedbl{}sync\textquotedbl{}~on~all~repositories}{\scriptsize \par}

{\scriptsize Repositories~are~automatically~added~to~the~set~of~known~repositories}{\scriptsize \par}

{\scriptsize when~one~of~the~following~commands~against~the~repository:~clone,~info,}{\scriptsize \par}

{\scriptsize pull,~push,~or~sync}{\scriptsize \par}
\end{lyxcode}
\caption{all details}


\end{figure}



\subsubsection{push\index{push}}

This command will push changes in the local repository to the master or remote repository.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~push}{\scriptsize \par}

{\scriptsize Usage:~fossil~push~?URL?~?options?}{\scriptsize \par}

{\scriptsize Push~changes~in~the~local~repository~over~into~a~remote~repository.}{\scriptsize \par}

{\scriptsize Use~the~\textquotedbl{}-R~REPO\textquotedbl{}~or~\textquotedbl{}-{}-repository~REPO\textquotedbl{}~command-line~options}{\scriptsize \par}

{\scriptsize to~specify~an~alternative~repository~file.}{\scriptsize \par}

{\scriptsize If~the~URL~is~not~specified,~then~the~URL~from~the~most~recent}{\scriptsize \par}

{\scriptsize clone,~push,~pull,~remote-url,~or~sync~command~is~used.}{\scriptsize \par}

{\scriptsize The~URL~specified~normally~becomes~the~new~\textquotedbl{}remote-url\textquotedbl{}~used~for}{\scriptsize \par}

{\scriptsize subsequent~push,~pull,~and~sync~operations.~~However,~the~\textquotedbl{}-{}-once\textquotedbl{}}{\scriptsize \par}

{\scriptsize command-line~option~makes~the~URL~a~one-time-use~URL~that~is~not}{\scriptsize \par}

{\scriptsize saved.}{\scriptsize \par}

{\scriptsize See~also:~clone,~pull,~sync,~remote-url}{\scriptsize \par}
\end{lyxcode}
\caption{push details}


\end{figure}



\subsubsection{pull\index{pull}}

This command will copy changes from the remote repository to the local repository. You could then use \textbf{update} to apply these changes to checked out files.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~pull}{\scriptsize \par}

{\scriptsize Usage:~fossil~pull~?URL?~?options?}{\scriptsize \par}

{\scriptsize Pull~changes~from~a~remote~repository~into~the~local~repository.}{\scriptsize \par}

{\scriptsize Use~the~\textquotedbl{}-R~REPO\textquotedbl{}~or~\textquotedbl{}-{}-repository~REPO\textquotedbl{}~command-line~options}{\scriptsize \par}

{\scriptsize to~specify~an~alternative~repository~file.}{\scriptsize \par}

{\scriptsize If~the~URL~is~not~specified,~then~the~URL~from~the~most~recent}{\scriptsize \par}

{\scriptsize clone,~push,~pull,~remote-url,~or~sync~command~is~used.}{\scriptsize \par}

{\scriptsize The~URL~specified~normally~becomes~the~new~\textquotedbl{}remote-url\textquotedbl{}~used~for}{\scriptsize \par}

{\scriptsize subsequent~push,~pull,~and~sync~operations.~~However,~the~\textquotedbl{}-{}-once\textquotedbl{}}{\scriptsize \par}

{\scriptsize command-line~option~makes~the~URL~a~one-time-use~URL~that~is~not}{\scriptsize \par}

{\scriptsize saved.}{\scriptsize \par}

{\scriptsize See~also:~clone,~push,~sync,~remote-url}{\scriptsize \par}


\end{lyxcode}
\caption{pull details}


\end{figure}



\subsubsection{sync\index{sync}}

This command is used to sync a remote copy with the original copy of the repository, it does both a push and pull. This can also be used to switch a local repository to a different main repository by specifying the URL of a remote repository. If you want to run the update command with -n where it does a dry run, this does not do a sync first so doing fossil sync then fossil update -n will do that for you.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~sync}{\scriptsize \par}

{\scriptsize Usage:~fossil~sync~?URL?~?options?}{\scriptsize \par}

{\scriptsize Synchronize~the~local~repository~with~a~remote~repository.~~This~is}{\scriptsize \par}

{\scriptsize the~equivalent~of~running~both~\textquotedbl{}push\textquotedbl{}~and~\textquotedbl{}pull\textquotedbl{}~at~the~same~time.}{\scriptsize \par}

{\scriptsize Use~the~\textquotedbl{}-R~REPO\textquotedbl{}~or~\textquotedbl{}-{}-repository~REPO\textquotedbl{}~command-line~options}{\scriptsize \par}

{\scriptsize to~specify~an~alternative~repository~file.}{\scriptsize \par}

{\scriptsize If~a~user-id~and~password~are~required,~specify~them~as~follows:}{\scriptsize \par}

{\scriptsize{}~~~~http://userid:password@www.domain.com:1234/path}{\scriptsize \par}

{\scriptsize If~the~URL~is~not~specified,~then~the~URL~from~the~most~recent~successful}{\scriptsize \par}

{\scriptsize clone,~push,~pull,~remote-url,~or~sync~command~is~used.}{\scriptsize \par}

{\scriptsize The~URL~specified~normally~becomes~the~new~\textquotedbl{}remote-url\textquotedbl{}~used~for}{\scriptsize \par}

{\scriptsize subsequent~push,~pull,~and~sync~operations.~~However,~the~\textquotedbl{}-{}-once\textquotedbl{}}{\scriptsize \par}

{\scriptsize command-line~option~makes~the~URL~a~one-time-use~URL~that~is~not}{\scriptsize \par}

{\scriptsize saved.}{\scriptsize \par}

{\scriptsize See~also:~~clone,~push,~pull,~remote-url}{\scriptsize \par}
\end{lyxcode}
\caption{sync details}


\end{figure}



\subsubsection{clean\index{clean}}

This call can be used to remove all the ``extra'' files in a source tree. This is useful if you wish to tidy up a source tree or to do a clean build.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~clean}{\scriptsize \par}

{\scriptsize Usage:~fossil~clean~?-{}-force?~?-{}-dotfiles?}{\scriptsize \par}

{\scriptsize Delete~all~\textquotedbl{}extra\textquotedbl{}~files~in~the~source~tree.~~\textquotedbl{}Extra\textquotedbl{}~files~are}{\scriptsize \par}

{\scriptsize files~that~are~not~officially~part~of~the~checkout.~~See~also}{\scriptsize \par}

{\scriptsize the~\textquotedbl{}extra\textquotedbl{}~command.~This~operation~cannot~be~undone.~}{\scriptsize \par}

{\scriptsize You~will~be~prompted~before~removing~each~file.~If~you~are}{\scriptsize \par}

{\scriptsize sure~you~wish~to~remove~all~\textquotedbl{}extra\textquotedbl{}~files~you~can~specify~the}{\scriptsize \par}

{\scriptsize optional~-{}-force~flag~and~no~prompts~will~be~issued.}{\scriptsize \par}

{\scriptsize Files~and~subdirectories~whose~names~begin~with~\textquotedbl{}.\textquotedbl{}~are}{\scriptsize \par}

{\scriptsize normally~ignored.~~They~are~included~if~the~\textquotedbl{}-{}-dotfiles\textquotedbl{}~option}{\scriptsize \par}

{\scriptsize is~used.}{\scriptsize \par}
\end{lyxcode}
\caption{clean details}


\end{figure}



\subsubsection{branch\index{branch}}

This command is used if you want to create or list branches in a repository. Previously we discussed forks ( See Section \vref{sub:Complications}); branches are the same idea but under user control. This would be where you have version 1.0 of something but want to branch off version 2.0 to add new features but want to keep a 1.0 branch for maintenance.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~branch}{\scriptsize \par}

{\scriptsize Usage:~fossil~branch~SUBCOMMAND~...~?-R|-{}-repository~FILE?}{\scriptsize \par}

{\scriptsize Run~various~subcommands~on~the~branches~of~the~open~repository~or}{\scriptsize \par}

{\scriptsize of~the~repository~identified~by~the~-R~or~-{}-repository~option.}{\scriptsize \par}

{\scriptsize{}~~~fossil~branch~new~BRANCH-NAME~BASIS~?-bgcolor~COLOR?~}{\scriptsize \par}

{\scriptsize{}~~~~~~~Create~a~new~branch~BRANCH-NAME~off~of~check-in~BASIS.}{\scriptsize \par}

{\scriptsize{}~~~~~~~You~can~optionally~give~the~branch~a~default~color.}{\scriptsize \par}

{\scriptsize{}~~~fossil~branch~list}{\scriptsize \par}

{\scriptsize{}~~~~~~~List~all~branches}{\scriptsize \par}
\end{lyxcode}
\caption{branch details}


\end{figure}



\subsubsection{merge\index{merge}}

This command does the opposite of branch, it brings two branches together.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~merge}{\scriptsize \par}

{\scriptsize Usage:~fossil~merge~{[}-{}-cherrypick{]}~{[}-{}-backout{]}~VERSION}{\scriptsize \par}

{\scriptsize The~argument~is~a~version~that~should~be~merged~into~the~current}{\scriptsize \par}

{\scriptsize checkout.~~All~changes~from~VERSION~back~to~the~nearest~common}{\scriptsize \par}

{\scriptsize ancestor~are~merged.~~Except,~if~either~of~the~-{}-cherrypick~or}{\scriptsize \par}

{\scriptsize -{}-backout~options~are~used~only~the~changes~associated~with~the}{\scriptsize \par}

{\scriptsize single~check-in~VERSION~are~merged.~~The~-{}-backout~option~causes}{\scriptsize \par}

{\scriptsize the~changes~associated~with~VERSION~to~be~removed~from~the~current}{\scriptsize \par}

{\scriptsize checkout~rather~than~added.}{\scriptsize \par}

{\scriptsize Only~file~content~is~merged.~~The~result~continues~to~use~the}{\scriptsize \par}

{\scriptsize file~and~directory~names~from~the~current~checkout~even~if~those}{\scriptsize \par}

{\scriptsize names~might~have~been~changed~in~the~branch~being~merged~in.}{\scriptsize \par}

{\scriptsize Other~options:}{\scriptsize \par}

{\scriptsize{}~~-{}-detail~~~~~~~~~~~~~~~~Show~additional~details~of~the~merge}{\scriptsize \par}

{\scriptsize{}~~-{}-binary~GLOBPATTERN~~~~Treat~files~that~match~GLOBPATTERN~as~binary}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~~~~~~~and~do~not~try~to~merge~parallel~changes.~~This}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~~~~~~~option~overrides~the~\textquotedbl{}binary-glob\textquotedbl{}~setting.}{\scriptsize \par}
\end{lyxcode}
\caption{merge details}


\end{figure}



\subsubsection{tag\index{tag}}

This command can be used to control ``tags'' which are attributes added to any entry in the time line. You can also add/delete/control these tags from the UI by going into the timeline, picking an entry then doing an edit. See Figure \vref{fig:Remove-Leaf}. 

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~tag}{\scriptsize \par}

{\scriptsize Usage:~fossil~tag~SUBCOMMAND~...}{\scriptsize \par}

{\scriptsize Run~various~subcommands~to~control~tags~and~properties}{\scriptsize \par}

{\scriptsize{}~~~~fossil~tag~add~?-{}-raw?~?-{}-propagate?~TAGNAME~CHECK-IN~?VALUE?}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Add~a~new~tag~or~property~to~CHECK-IN.~The~tag~will}{\scriptsize \par}

{\scriptsize{}~~~~~~~~be~usable~instead~of~a~CHECK-IN~in~commands~such~as}{\scriptsize \par}

{\scriptsize{}~~~~~~~~update~and~merge.~~If~the~-{}-propagate~flag~is~present,}{\scriptsize \par}

{\scriptsize{}~~~~~~~~the~tag~value~propagates~to~all~descendants~of~CHECK-IN}{\scriptsize \par}

{\scriptsize{}~~~~fossil~tag~cancel~?-{}-raw?~TAGNAME~CHECK-IN}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Remove~the~tag~TAGNAME~from~CHECK-IN,~and~also~remove}{\scriptsize \par}

{\scriptsize{}~~~~~~~~the~propagation~of~the~tag~to~any~descendants.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~tag~find~?-{}-raw?~TAGNAME}{\scriptsize \par}

{\scriptsize{}~~~~~~~~List~all~check-ins~that~use~TAGNAME}{\scriptsize \par}

{\scriptsize{}~~~~fossil~tag~list~?-{}-raw?~?CHECK-IN?}{\scriptsize \par}

{\scriptsize{}~~~~~~~~List~all~tags,~or~if~CHECK-IN~is~supplied,~list}{\scriptsize \par}

{\scriptsize{}~~~~~~~~all~tags~and~their~values~for~CHECK-IN.}{\scriptsize \par}

{\scriptsize The~option~-{}-raw~allows~the~manipulation~of~all~types~of~tags}{\scriptsize \par}

{\scriptsize used~for~various~internal~purposes~in~fossil.~It~also~shows}{\scriptsize \par}

{\scriptsize \textquotedbl{}cancel\textquotedbl{}~tags~for~the~\textquotedbl{}find\textquotedbl{}~and~\textquotedbl{}list\textquotedbl{}~subcommands.~You~should}{\scriptsize \par}

{\scriptsize not~use~this~option~to~make~changes~unless~you~are~sure~what}{\scriptsize \par}

{\scriptsize you~are~doing.}{\scriptsize \par}

{\scriptsize If~you~need~to~use~a~tagname~that~might~be~confused~with}{\scriptsize \par}

{\scriptsize a~hexadecimal~baseline~or~artifact~ID,~you~can~explicitly}{\scriptsize \par}

{\scriptsize disambiguate~it~by~prefixing~it~with~\textquotedbl{}tag:\textquotedbl{}.~For~instance:}{\scriptsize \par}

{\scriptsize{}~~fossil~update~decaf}{\scriptsize \par}

{\scriptsize will~be~taken~as~an~artifact~or~baseline~ID~and~fossil~will}{\scriptsize \par}

{\scriptsize probably~complain~that~no~such~revision~was~found.~However}{\scriptsize \par}

{\scriptsize{}~~fossil~update~tag:decaf}{\scriptsize \par}

{\scriptsize will~assume~that~\textquotedbl{}decaf\textquotedbl{}~is~a~tag/branch~name.}{\scriptsize \par}
\end{lyxcode}
\caption{tag details}


\end{figure}



\subsubsection{settings\index{settings}}

This command is used to set or unset a number of properties for fossil.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~settings}{\scriptsize \par}

{\scriptsize COMMAND:~settings}{\scriptsize \par}

{\scriptsize COMMAND:~unset}{\scriptsize \par}

{\scriptsize fossil~setting~?PROPERTY?~?VALUE?~?-global?}{\scriptsize \par}

{\scriptsize fossil~unset~PROPERTY~?-global?}{\scriptsize \par}

{\scriptsize The~\textquotedbl{}setting\textquotedbl{}~command~with~no~arguments~lists~all~properties~and~their}{\scriptsize \par}

{\scriptsize values.~~With~just~a~property~name~it~shows~the~value~of~that~property.}{\scriptsize \par}

{\scriptsize With~a~value~argument~it~changes~the~property~for~the~current~repository.}{\scriptsize \par}

{\scriptsize The~\textquotedbl{}unset\textquotedbl{}~command~clears~a~property~setting.}{\scriptsize \par}

{\scriptsize{}~~~auto-captcha~~~~~If~enabled,~the~Login~page~will~provide~a~button}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~which~uses~JavaScript~to~fill~out~the~captcha~for}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~the~\textquotedbl{}anonymous\textquotedbl{}~user.~(Most~bots~cannot~use~JavaScript.)}{\scriptsize \par}

{\scriptsize{}~~~autosync~~~~~~~~~If~enabled,~automatically~pull~prior~to~commit}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~or~update~and~automatically~push~after~commit~or}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~tag~or~branch~creation.~~If~the~the~value~is~\textquotedbl{}pullonly\textquotedbl{}}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~then~only~pull~operations~occur~automatically.}{\scriptsize \par}

{\scriptsize{}~~~binary-glob~~~~~~The~VALUE~is~a~comma-separated~list~of~GLOB~patterns}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~that~should~be~treated~as~binary~files~for~merging}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~purposes.~~Example:~~~{*}.xml}{\scriptsize \par}

{\scriptsize{}~~~clearsign~~~~~~~~When~enabled,~fossil~will~attempt~to~sign~all~commits}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~with~gpg.~~When~disabled~(the~default),~commits~will}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~be~unsigned.}{\scriptsize \par}

{\scriptsize{}~~~diff-command~~~~~External~command~to~run~when~performing~a~diff.}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~If~undefined,~the~internal~text~diff~will~be~used.}{\scriptsize \par}

{\scriptsize{}~~~dont-push~~~~~~~~Prevent~this~repository~from~pushing~from~client~to}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~server.~~Useful~when~setting~up~a~private~branch.}{\scriptsize \par}

{\scriptsize{}~~~editor~~~~~~~~~~~Text~editor~command~used~for~check-in~comments.}{\scriptsize \par}

{\scriptsize{}~~~gdiff-command~~~~External~command~to~run~when~performing~a~graphical}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~diff.~If~undefined,~text~diff~will~be~used.}{\scriptsize \par}

{\scriptsize{}~~~http-port~~~~~~~~The~TCP/IP~port~number~to~use~by~the~\textquotedbl{}server\textquotedbl{}}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~and~\textquotedbl{}ui\textquotedbl{}~commands.~~Default:~8080}{\scriptsize \par}

{\scriptsize{}~~~ignore-glob~~~~~~The~VALUE~is~a~comma-separated~list~of~GLOB~patterns}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~specifying~files~that~the~\textquotedbl{}extra\textquotedbl{}~command~will~ignore.}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~Example:~~{*}.o,{*}.obj,{*}.exe}{\scriptsize \par}

{\scriptsize{}~~~localauth~~~~~~~~If~enabled,~require~that~HTTP~connections~from}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~127.0.0.1~be~authenticated~by~password.~~If}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~false,~all~HTTP~requests~from~localhost~have}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~unrestricted~access~to~the~repository.}{\scriptsize \par}

{\scriptsize{}~~~mtime-changes~~~~Use~file~modification~times~(mtimes)~to~detect~when}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~files~have~been~modified.~~(Default~\textquotedbl{}on\textquotedbl{}.)}{\scriptsize \par}

{\scriptsize{}~~~pgp-command~~~~~~Command~used~to~clear-sign~manifests~at~check-in.}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~The~default~is~\textquotedbl{}gpg~-{}-clearsign~-o~\textquotedbl{}.}{\scriptsize \par}

{\scriptsize{}~~~proxy~~~~~~~~~~~~URL~of~the~HTTP~proxy.~~If~undefined~or~\textquotedbl{}off\textquotedbl{}~then}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~the~\textquotedbl{}http\_proxy\textquotedbl{}~environment~variable~is~consulted.}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~If~the~http\_proxy~environment~variable~is~undefined}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~then~a~direct~HTTP~connection~is~used.}{\scriptsize \par}

{\scriptsize{}~~~web-browser~~~~~~A~shell~command~used~to~launch~your~preferred}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~web~browser~when~given~a~URL~as~an~argument.}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~Defaults~to~\textquotedbl{}start\textquotedbl{}~on~windows,~\textquotedbl{}open\textquotedbl{}~on~Mac,}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~~~~~and~\textquotedbl{}firefox\textquotedbl{}~on~Unix.}{\scriptsize \par}
\end{lyxcode}
\caption{settings details}


\end{figure}



\subsection{Miscellaneous }

These are commands that don't seem to fit in any category but are useful. 


\subsubsection{zip\index{zip}}

You can do what this command does from the web based user interface. In Figure \vref{fig:Timeline-Detail} you can download a ZIP archive of the particular version of the files. This command lets you do it from the command line.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~zip}{\scriptsize \par}

{\scriptsize Usage:~fossil~zip~VERSION~OUTPUTFILE~{[}-{}-name~DIRECTORYNAME{]}}{\scriptsize \par}

{\scriptsize Generate~a~ZIP~archive~for~a~specified~version.~~If~the~-{}-name~option~is}{\scriptsize \par}

{\scriptsize used,~it~argument~becomes~the~name~of~the~top-level~directory~in~the}{\scriptsize \par}

{\scriptsize resulting~ZIP~archive.~~If~-{}-name~is~omitted,~the~top-level~directory}{\scriptsize \par}

{\scriptsize named~is~derived~from~the~project~name,~the~check-in~date~and~time,~and}{\scriptsize \par}

{\scriptsize the~artifact~ID~of~the~check-in.}{\scriptsize \par}
\end{lyxcode}
\caption{zip detail}


\end{figure}



\subsubsection{user\index{user}}

This command lets you modify user information. Again this is a command line duplication of what you can do from the user interface in the browser, see Figure \vref{fig:New-Editor-user}.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~user}{\scriptsize \par}

{\scriptsize Usage:~fossil~user~SUBCOMMAND~...~~?-R|-{}-repository~FILE?}{\scriptsize \par}

{\scriptsize Run~various~subcommands~on~users~of~the~open~repository~or~of}{\scriptsize \par}

{\scriptsize the~repository~identified~by~the~-R~or~-{}-repository~option.}{\scriptsize \par}

{\scriptsize{}~~~fossil~user~capabilities~USERNAME~?STRING?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Query~or~set~the~capabilities~for~user~USERNAME}{\scriptsize \par}

{\scriptsize{}~~~fossil~user~default~?USERNAME?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Query~or~set~the~default~user.~~The~default~user~is~the}{\scriptsize \par}

{\scriptsize{}~~~~~~~user~for~command-line~interaction.}{\scriptsize \par}

{\scriptsize{}~~~fossil~user~list}{\scriptsize \par}

{\scriptsize{}~~~~~~~List~all~users~known~to~the~repository}{\scriptsize \par}

{\scriptsize{}~~~fossil~user~new~?USERNAME?~?CONTACT-INFO?~?PASSWORD?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Create~a~new~user~in~the~repository.~~Users~can~never~be}{\scriptsize \par}

{\scriptsize{}~~~~~~~deleted.~~They~can~be~denied~all~access~but~they~must~continue}{\scriptsize \par}

{\scriptsize{}~~~~~~~to~exist~in~the~database.}{\scriptsize \par}

{\scriptsize{}~~~fossil~user~password~USERNAME~?PASSWORD?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Change~the~web~access~password~for~a~user.}{\scriptsize \par}
\end{lyxcode}
\caption{user detail}


\end{figure}



\subsubsection{finfo\index{finfo}}

This command will print the history of any particular file. This can be useful if you need this history in some other system. You can pass this text file to the other system which can than parse and use the data.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~finfo}{\scriptsize \par}

{\scriptsize Usage:~fossil~finfo~FILENAME}{\scriptsize \par}

{\scriptsize Print~the~change~history~for~a~single~file.}{\scriptsize \par}

{\scriptsize The~\textquotedbl{}-{}-limit~N\textquotedbl{}~and~\textquotedbl{}-{}-offset~P\textquotedbl{}~options~limits~the~output~to~the~first}{\scriptsize \par}

{\scriptsize N~changes~after~skipping~P~changes.}{\scriptsize \par}
\end{lyxcode}
\caption{finfo detail}


\end{figure}


An example would be to run it on the outline.txt file in our book directory:
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~}\textbf{\scriptsize finfo~outline.txt}{\scriptsize \par}

{\scriptsize History~of~outline.txt}{\scriptsize \par}

{\scriptsize 2010-05-17~{[}0272dc0169{]}~Finished~maintenance~commands~(user:~jim,~artifact:}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~{[}25b6e38e97{]})}{\scriptsize \par}

{\scriptsize 2010-05-12~{[}5e5c0f7d55{]}~End~of~day~commit~(user:~jim,~artifact:~{[}d1a1d31fbd{]})}{\scriptsize \par}

{\scriptsize 2010-05-10~{[}e924ca3525{]}~End~of~day~update~(user:~jim,~artifact:~{[}7cd19079a1{]})}{\scriptsize \par}

{\scriptsize 2010-05-09~{[}0abb95b046{]}~Intermediate~commit,~not~done~with~basic~commands}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~(user:~jim,~artifact:~{[}6f7bcd48b9{]})}{\scriptsize \par}

{\scriptsize 2010-05-07~{[}6921e453cd{]}~Update~outline~\&~book~corrections~(user:~jim,}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~artifact:~{[}4eff85c793{]})}{\scriptsize \par}

{\scriptsize 2010-05-03~{[}158492516c{]}~Moved~to~clone~repository~(user:~jim,~artifact:}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~{[}23b729cb66{]})}{\scriptsize \par}

{\scriptsize 2010-05-03~{[}1a403c87fc{]}~Update~before~moving~to~server~(user:~jim,~artifact:}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~{[}706a9d394d{]})}{\scriptsize \par}

{\scriptsize 2010-04-30~{[}fa5b9247bd{]}~Working~on~chapter~1~(user:~jim,~artifact:}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~{[}7bb188f0c6{]})}{\scriptsize \par}

{\scriptsize 2010-04-29~{[}51be6423a3{]}~Update~outline~(user:~jim,~artifact:~{[}7cd39dfa06{]})}{\scriptsize \par}

{\scriptsize 2010-04-27~{[}39bc728527{]}~{[}1665c78d94{]}~Ticket~Use~(user:~jim,~artifact:}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~{[}1f82aaf41c{]})}{\scriptsize \par}

{\scriptsize 2010-04-26~{[}497b93858f{]}~Update~to~catch~changes~in~outline~(user:~jim,}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~artifact:~{[}b870231e48{]})}{\scriptsize \par}

{\scriptsize 2010-04-25~{[}8fa0708186{]}~Initial~Commit~(user:~jim,~artifact:~{[}34a460a468{]})}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}{\scriptsize \par}
\end{lyxcode}

\subsubsection{timeline\index{timeline}}

This prints out the timeline of the project in various ways. The command would be useful if you were building a GUI front end for Fossil and wanted to display the timeline. You could issue this command and get the result back and display it in your UI. There are a number of options in the command to control the listing.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~timeline}{\scriptsize \par}

{\scriptsize Usage:~fossil~timeline~?WHEN?~?BASELINE|DATETIME?~?-n~N?~?-t~TYPE?}{\scriptsize \par}

{\scriptsize Print~a~summary~of~activity~going~backwards~in~date~and~time}{\scriptsize \par}

{\scriptsize specified~or~from~the~current~date~and~time~if~no~arguments}{\scriptsize \par}

{\scriptsize are~given.~~Show~as~many~as~N~(default~20)~check-ins.~~The}{\scriptsize \par}

{\scriptsize WHEN~argument~can~be~any~unique~abbreviation~of~one~of~these}{\scriptsize \par}

{\scriptsize keywords:}{\scriptsize \par}

{\scriptsize{}~~~~before}{\scriptsize \par}

{\scriptsize{}~~~~after}{\scriptsize \par}

{\scriptsize{}~~~~descendants~|~children}{\scriptsize \par}

{\scriptsize{}~~~~ancestors~|~parents}{\scriptsize \par}

{\scriptsize The~BASELINE~can~be~any~unique~prefix~of~4~characters~or~more.}{\scriptsize \par}

{\scriptsize The~DATETIME~should~be~in~the~ISO8601~format.~~For}{\scriptsize \par}

{\scriptsize examples:~\textquotedbl{}2007-08-18~07:21:21\textquotedbl{}.~~You~can~also~say~\textquotedbl{}current\textquotedbl{}}{\scriptsize \par}

{\scriptsize for~the~current~version~or~\textquotedbl{}now\textquotedbl{}~for~the~current~time.}{\scriptsize \par}

{\scriptsize The~optional~TYPE~argument~may~any~types~supported~by~the~/timeline}{\scriptsize \par}

{\scriptsize page.~For~example:}{\scriptsize \par}

{\scriptsize{}~~~~w~~=~wiki~commits~only}{\scriptsize \par}

{\scriptsize{}~~~~ci~=~file~commits~only}{\scriptsize \par}

{\scriptsize{}~~~~t~~=~tickets~only}{\scriptsize \par}
\end{lyxcode}
\caption{timeline detail}


\end{figure}



\subsubsection{wiki\index{wiki}}

This command allows you to have command line control of the wiki. Again this is useful if you were writing a shell to control Fossil or wanted to add a number of computer generated pages to the Wiki.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~wiki}{\scriptsize \par}

{\scriptsize Usage:~fossil~wiki~(export|create|commit|list)~WikiName}{\scriptsize \par}

{\scriptsize Run~various~subcommands~to~work~with~wiki~entries.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~export~PAGENAME~?FILE?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Sends~the~latest~version~of~the~PAGENAME~wiki}{\scriptsize \par}

{\scriptsize{}~~~~~~~entry~to~the~given~file~or~standard~output.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~commit~PAGENAME~?FILE?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Commit~changes~to~a~wiki~page~from~FILE~or~from~standard}{\scriptsize \par}

{\scriptsize{}~~~~~~~input.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~create~PAGENAME~?FILE?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Create~a~new~wiki~page~with~initial~content~taken~from}{\scriptsize \par}

{\scriptsize{}~~~~~~~FILE~or~from~standard~input.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~list}{\scriptsize \par}

{\scriptsize{}~~~~~~~Lists~all~wiki~entries,~one~per~line,~ordered}{\scriptsize \par}

{\scriptsize{}~~~~~~~case-insentively~by~name.}{\scriptsize \par}

{\scriptsize TODOs:}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~export~?-u~ARTIFACT?~WikiName~?FILE?}{\scriptsize \par}

{\scriptsize{}~~~~~~~Outputs~the~selected~version~of~WikiName.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~delete~?-m~MESSAGE?~WikiName}{\scriptsize \par}

{\scriptsize{}~~~~~~~The~same~as~deleting~a~file~entry,~but~i~don't~know~if~fossil}{\scriptsize \par}

{\scriptsize{}~~~~~~~supports~a~commit~message~for~Wiki~entries.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~?-u?~?-d?~?-s={[}|{]}?~list}{\scriptsize \par}

{\scriptsize{}~~~~~~~Lists~the~artifact~ID~and/or~Date~of~last~change~along~with}{\scriptsize \par}

{\scriptsize{}~~~~~~~each~entry~name,~delimited~by~the~-s~char.}{\scriptsize \par}

{\scriptsize{}~~~~fossil~wiki~diff~?ARTIFACT?~?-f~infile{[}=stdin{]}?~EntryName}{\scriptsize \par}

{\scriptsize{}~~~~~~~Diffs~the~local~copy~of~a~page~with~a~given~version~(defaulting}{\scriptsize \par}

{\scriptsize{}~~~~~~~to~the~head~version).}{\scriptsize \par}
\end{lyxcode}
\caption{wiki detail}


\end{figure}



\subsection{Advanced}

These are commands that you will rarely have to use. These are functions that are needed to do very complicated things with Fossil. If you have to use these you are probably way beyond the audience for this book.


\subsubsection{scrub\index{scrub}}

This is used to removed sensitive information like passwords from a repository. This allows you to then send the whole repository to someone else for their use.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~scrub}{\scriptsize \par}

{\scriptsize COMMAND:~scrub}{\scriptsize \par}

{\scriptsize fossil~scrub~{[}-{}-verily{]}~{[}-{}-force{]}~{[}REPOSITORY{]}}{\scriptsize \par}

{\scriptsize The~command~removes~sensitive~information~(such~as~passwords)~from~a}{\scriptsize \par}

{\scriptsize repository~so~that~the~repository~can~be~sent~to~an~untrusted~reader.}{\scriptsize \par}

{\scriptsize By~default,~only~passwords~are~removed.~~However,~if~the~-{}-verily~option}{\scriptsize \par}

{\scriptsize is~added,~then~private~branches,~concealed~email~addresses,~IP}{\scriptsize \par}

{\scriptsize addresses~of~correspondents,~and~similar~privacy-sensitive~fields}{\scriptsize \par}

{\scriptsize are~also~purged.}{\scriptsize \par}

{\scriptsize This~command~permanently~deletes~the~scrubbed~information.~~The~effects}{\scriptsize \par}

{\scriptsize of~this~command~are~irreversible.~~Use~with~caution.}{\scriptsize \par}

{\scriptsize The~user~is~prompted~to~confirm~the~scrub~unless~the~-{}-force~option}{\scriptsize \par}

{\scriptsize is~used.}{\scriptsize \par}
\end{lyxcode}
\caption{scrub detail}


\end{figure}



\subsubsection{search\index{search}}

This is used to search the timeline entries for a pattern. This can also be done in your browser on the timeline page.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~search}{\scriptsize \par}

{\scriptsize COMMAND:~search}{\scriptsize \par}

{\scriptsize fossil~search~pattern...}{\scriptsize \par}

{\scriptsize Search~for~timeline~entries~matching~the~pattern.}{\scriptsize \par}
\end{lyxcode}
\caption{search detail}


\end{figure}



\subsubsection{sha1sum\index{sha1sum}}

This can compute the sha1 value for a particular file. These sums are the labels that Fossil uses on all objects and should be unique for any file.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~sha1sum}{\scriptsize \par}

{\scriptsize COMMAND:~sha1sum}{\scriptsize \par}

{\scriptsize fossil~sha1sum~FILE...}{\scriptsize \par}

{\scriptsize Compute~an~SHA1~checksum~of~all~files~named~on~the~command-line.}{\scriptsize \par}

{\scriptsize If~an~file~is~named~\textquotedbl{}-\textquotedbl{}~then~take~its~content~from~standard~input.}{\scriptsize \par}
\end{lyxcode}
\caption{sha1sum detail}


\end{figure}



\subsubsection{rstats\index{rstats}}

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~rstats}{\scriptsize \par}

{\scriptsize Usage:~fossil~rstats}{\scriptsize \par}

{\scriptsize Deliver~a~report~of~the~repository~statistics~for~the}{\scriptsize \par}

{\scriptsize current~checkout.}{\scriptsize \par}
\end{lyxcode}
\caption{rstats detail}


\end{figure}


For example, running it on the Fossil Book checkout:
\begin{lyxcode}
{[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~\textbf{fossil~rstats}

~Number~of~Artifacts:~137

~~59~full~text~+~78~delta~blobs

~278961~bytes~average,~38217738~bytes~total

~~Number~Of~Checkins:~26

~~~~~Number~Of~Files:~37

Number~Of~Wiki~Pages:~2

~~~Number~Of~Tickets:~6

~Duration~Of~Project:~23~days
\end{lyxcode}

\subsubsection{configuration\index{configuration}}

This command allows you to save or load a custom configuration of Fossil.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~}\textbf{\scriptsize help~configuration}{\scriptsize \par}

{\scriptsize Usage:~fossil~configure~METHOD~...}{\scriptsize \par}

{\scriptsize Where~METHOD~is~one~of:~export~import~merge~pull~push~reset.~~All~methods}{\scriptsize \par}

{\scriptsize accept~the~-R~or~-{}-repository~option~to~specific~a~repository.}{\scriptsize \par}

{\scriptsize{}~~~fossil~configuration~export~AREA~FILENAME}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Write~to~FILENAME~exported~configuration~information~for~AREA.}{\scriptsize \par}

{\scriptsize{}~~~~~~~~AREA~can~be~one~of:~~all~ticket~skin~project}{\scriptsize \par}

{\scriptsize{}~~~fossil~configuration~import~FILENAME}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Read~a~configuration~from~FILENAME,~overwriting~the~current}{\scriptsize \par}

{\scriptsize{}~~~~~~~~configuration.}{\scriptsize \par}

{\scriptsize{}~~~fossil~configuration~merge~FILENAME}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Read~a~configuration~from~FILENAME~and~merge~its~values~into}{\scriptsize \par}

{\scriptsize{}~~~~~~~~the~current~configuration.~~Existing~values~take~priority~over}{\scriptsize \par}

{\scriptsize{}~~~~~~~~values~read~from~FILENAME.}{\scriptsize \par}

{\scriptsize{}~~~fossil~configuration~pull~AREA~?URL?}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Pull~and~install~the~configuration~from~a~different~server}{\scriptsize \par}

{\scriptsize{}~~~~~~~~identified~by~URL.~~If~no~URL~is~specified,~then~the~default}{\scriptsize \par}

{\scriptsize{}~~~~~~~~server~is~used.~}{\scriptsize \par}

{\scriptsize{}~~~fossil~configuration~push~AREA~?URL?}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Push~the~local~configuration~into~the~remote~server~identified}{\scriptsize \par}

{\scriptsize{}~~~~~~~~by~URL.~~Admin~privilege~is~required~on~the~remote~server~for}{\scriptsize \par}

{\scriptsize{}~~~~~~~~this~to~work.}{\scriptsize \par}

{\scriptsize{}~~~fossil~configuration~reset~AREA}{\scriptsize \par}

{\scriptsize{}~~~~~~~~Restore~the~configuration~to~the~default.~~AREA~as~above.}{\scriptsize \par}

{\scriptsize WARNING:~Do~not~import,~merge,~or~pull~configurations~from~an~untrusted}{\scriptsize \par}

{\scriptsize source.~~The~inbound~configuration~is~not~checked~for~safety~and~can}{\scriptsize \par}

{\scriptsize introduce~security~vulnerabilities.}{\scriptsize \par}
\end{lyxcode}
\caption{configuration detail}


\end{figure}



\subsubsection{descendants\index{descendants}}

This is used to find where the checked out files are in the time line.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~help~descendants}{\scriptsize \par}

{\scriptsize Usage:~fossil~descendants~?BASELINE-ID?}{\scriptsize \par}

{\scriptsize Find~all~leaf~descendants~of~the~baseline~specified~or~if~the~argument}{\scriptsize \par}

{\scriptsize is~omitted,~of~the~baseline~currently~checked~out.}{\scriptsize \par}


\end{lyxcode}
\caption{descendants detail}


\end{figure}



\section{What's next ?}

This book so far has covered how to use the many features of Fossil and has, I hope, interested you in using it. The question \textquotedbl{}what's next\textquotedbl{} now comes up. First go to the Fossil website \url{http://www.fossil-scm.org/}. While there you can go to the Wiki link and then list all Wiki pages. There are all sorts of topics covered there in depth. If that still doesn't help, you can join the Fossil mailing list (see Wiki links) and look at the archives or directly ask a question. I have found the list to be very helpful and have had my questions asked very quickly.

On the mailing lists you will see long discussions of changes to be made to Fossil, some of these are accepted very quickly and will appear within hours in the Fossil source code. Others engender long discussions (in particular discussion of changes to the Wiki) and it is interesting to read the pros and cons of suggested changes. 

Fossil is an evolving program but if you get a version that has all the features you need you can stick with that version as long as you like. Going to a new version though is simple and just requires a \textbf{rebuild} of your current repositories. The developers have been very careful to preserve the basic structure so it is easy and safe to switch versions.

Finally if you wish to contribute to the project there are many things to do (See the To Do List in the Wiki). 

\pagebreak{}

\printindex{}

\bibliographystyle{plain}
\bibliography{Research/fossilbib}

\end{document}

Added fossilbook_plain.tex~.













































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
%% LyX 2.0.2 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[11pt,letterpaper,english]{article}
\usepackage{mathptmx}
\usepackage{helvet}
\usepackage{courier}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\usepackage{array}
\usepackage{varioref}
\usepackage{float}
\usepackage{url}
\usepackage{amsmath}
\usepackage{makeidx}
\makeindex
\usepackage{graphicx}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\special{papersize=\the\paperwidth,\the\paperheight}

\providecommand{\LyX}{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\newenvironment{lyxcode}
{\par\begin{list}{}{
\setlength{\rightmargin}{\leftmargin}
\setlength{\listparindent}{0pt}% needed for AMS classes
\raggedright
\setlength{\itemsep}{0pt}
\setlength{\parsep}{0pt}
\normalfont\ttfamily}%
 \item[]}
{\end{list}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.

% Include the proper LaTeX packages:
%----------------------------------------------------------------------------------------------------
\usepackage{graphicx}
\usepackage{titling}
\usepackage{ifthen}
\usepackage[absolute]{textpos}
\usepackage[colorlinks=true,
                       pagecolor=black,
                       menucolor=black,
                       linkcolor=black,
                       citecolor=blue,
                       pagebordercolor=1 1 1,
                       urlcolor=red,
                       plainpages=false,
                       pdfpagelabels=true,
                       bookmarksnumbered=true]{hyperref}
\usepackage{lastpage}

\newcommand{\reportTopic}{<reportTopic>}
\newcommand{\revisionNumber}{<rev. no.>}
\newcommand{\documentNumber}{<doc. no.>}


% Setup the right-hand header to display the current doc section:
%----------------------------------------------------------------------------------------------------
\renewcommand{\sectionmark}[1]{\markright{#1}}
\renewcommand{\subsectionmark}[1]{\markright{#1}}

% Setup for roman numeral page numbers until TOC:
%----------------------------------------------------------------------------------------------------
\newboolean{romanpn}

\pagenumbering{roman}
\setboolean{romanpn}{true}
\let\myTOC\tableofcontents

\renewcommand\tableofcontents{%
\myTOC
\clearpage
\pagenumbering{arabic}
\setboolean{romanpn}{false}
}

% Modify titlepage format:
%----------------------------------------------------------------------------------------------------
\setlength{\TPHorizModule}{1in}
\setlength{\TPVertModule}{\TPHorizModule}
\textblockorigin{3.25in}{1in}

\pretitle
 {
    \begin{flushright}\LARGE\sffamily 
    \thispagestyle{empty}
    \begin{textblock}{4}(0,0)
    \includegraphics[width=4in,keepaspectratio=true]{Layout/fossil.png}
    \end{textblock}
    \vspace{2in}
  }

\posttitle{\par\end{flushright}}

\preauthor{\begin{flushright} \large \sffamily \lineskip 0.5em 
\begin{tabular}[t]{c}}
\postauthor{\end{tabular} \par\end{flushright}}

\predate{\begin{flushright}\large \sffamily Document Number: \documentNumber \\ Revision Number: \revisionNumber \\}

\postdate{
\vspace{2in}
\\Pandora Products.
\\215 Uschak Road
\\Derry, PA  15627
\par\end{flushright}}

% Setup "fancy" page layout:
%----------------------------------------------------------------------------------------------------
\fancyhf{}
\setlength{\topmargin}{-1in}
\setlength{\headheight}{1in}
\setlength{\headsep}{0.5in}
\setlength{\oddsidemargin}{0.25in}
\setlength{\evensidemargin}{\oddsidemargin}
\setlength{\textwidth}{6in}
\setlength{\headwidth}{\textwidth}
\setlength{\textheight}{8.375in}
\setlength{\footskip}{0.5in}

% Setup header:
%------------------------------------------------------------------------------------------
\fancyhead[L]{\sffamily \bfseries \large Fossil Version Control\\\mdseries \reportTopic}
%\fancyhead[R]{\sffamily \bfseries \large Pandora Products\\ \mdseries \nouppercase{\rightmark}}

% Setup footer:
%------------------------------------------------------------------------------------------
\renewcommand{\footrulewidth}{0.4pt}
\fancyfoot[L]{\sffamily \bfseries \documentNumber \\ \mdseries Revision:  \revisionNumber}
\fancyfoot[C]{\sffamily \bfseries\thedate \\ }
\fancyfoot[R]{\ifthenelse{\boolean{romanpn}}{\sffamily  \thepage}{\sffamily \bfseries Page \thepage\ of \pageref{LastPage}}}

\makeatother

\usepackage{babel}
\begin{document}
\renewcommand{\documentNumber}{PAN-20100424}

\renewcommand{\reportTopic}{A Users Guide}

\renewcommand{\revisionNumber}{1.75}


\title{Fossil Version Control\\ \reportTopic}


\author{Jim Schimpf}


\date{15 September 2011}

\maketitle
\thispagestyle{empty}

\newpage{}2010 Pandora Products. This work is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License. To view a copy of this license, visit \url{http://creativecommons.org/licenses/by-sa/3.0/us/} or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. 

and\medskip{}
Pandora Products

215 Uschak Road 

Derry, PA 15627 

\medskip{}
Phone: 724.539.1276

Fax: 724.539.1276 

Web: http://www.fossil-scm.org/schimpf-book/index

Email: jim.schimpf@gmail.com

\medskip{}
Pandora Products has carefully checked the information in this document and believes it to be accurate. However, Pandora Products assumes no responsibility for any inaccuracies that this document may contain. In no event will Pandora Products be liable for direct, indirect, special, exemplary, incidental, or consequential damages resulting from any defect or omission in this document, even if advised of the possibility of such damages. 

In the interest of product development, Pandora Products reserves the right to make improvements to the information in this document and the products that it describes at any time, without notice or obligation. 

Additional Contributors
\begin{itemize}
\item Marilyn Noz - Editor
\item Wolfgang Stumvoll - Fossil Merge use and Windows use
\item javalinBCD@gmail.com - found bugs
\item arnel\_legaspi@msn.com - found bugs
\end{itemize}
\newpage{}


\section*{Document Revision History}

\textit{Use the following table to track a history of this documents revisions. An entry should be made into this table for each version of the document}.

\begin{center}
\begin{tabular}{|>{\centering}p{0.5in}|>{\centering}p{0.5in}|p{3in}|>{\centering}p{1in}|}
\hline 
Version & Author & Description & Date\tabularnewline
\hline 
0.1 & js & Initial Version & 24-Apr-2010\tabularnewline
\hline 
0.2 & js & Finishing up Single User Chapter & 27-Apr-2010\tabularnewline
\hline 
0.3 & js & Working on introduction chapter & 30-Apr-2010\tabularnewline
\hline 
0.4 & js & Adding multiuser chapter & 1-May-2010\tabularnewline
\hline 
0.5 & mn & Adding editorial corrections {[}ebf40b842a{]} & 4-May-2010\tabularnewline
\hline 
0.6 & js & Adding Command sections {[}e11399d575{]} & 8-May-2010\tabularnewline
\hline 
0.7 & js & English \& spelling corrections & 19-May-2010\tabularnewline
\hline 
0.8 & js & Spelling fixes & 30-May-2010\tabularnewline
\hline 
0.9 & ws & Using Fossil merge {[}db6c734300{]} & 2-Jun-2010\tabularnewline
\hline 
1.0 & js/ws & Put Fossil merge first in handling fork & 3-Jun-2010\tabularnewline
\hline 
1.1 & mn & Fixes in multiple user chapter {[}e8770d3172{]} & 4-Jun-2010\tabularnewline
\hline 
1.2 & js & Start advanced use chapter {[}2abc23dae5{]} & 4-Jun-2010\tabularnewline
\hline 
1.3 & mn & English corrections Chapter 1 {[}8b324dc900{]} & 5-Jun-2010\tabularnewline
\hline 
1.4 & mn & Sections 2.1 \& 2.2 corrections {[}0b34cb6f04{]} & 7-Jun-2010\tabularnewline
\hline 
1.5 & js & Move close leaf to adv use {[}2abc23dae5{]} & 7-Jun-2010\tabularnewline
\hline 
1.6 & js & Convert Advanced chapter to forks and branching & 13-Jun-2010\tabularnewline
\hline 
1.7 & js/tr & Add note about IP port usage {[}a62efa8eba{]} & 8-Jul-2010\tabularnewline
\hline 
1.71 & javelin & Check on mispelling section 1.1 {[}637d974f62{]} & 15-Sep-2011\tabularnewline
\hline 
1.72 & anon & Fix absolute path in image regs {[}d54868853b{]} & 15-Sep-2011\tabularnewline
\hline 
1.73 & anon & Fix fossil create section 2.2.5 {[}36772d90a5{]} & 15-Sep-2011\tabularnewline
\hline 
1.74 & anon & Push/Pull described incorrectly {[}1b930fced6{]} & 15-Sep-2011\tabularnewline
\hline 
1.75 & arnel & Commands might be changed  {[}4aaf1f78bb{]} & 15-Sep-2011\tabularnewline
\hline 
\end{tabular}
\par\end{center}

\newpage{}\tableofcontents{}

\listoffigures


\newpage{}


\section*{Foreward}


\section{Source Control \& Why you need it}


\subsection{What is it}

A source control system is software that manages the files in a project. A project (like this book or a software application) usually has a number of files. You then put all these files in a directory and at times subdivide even that with subdirectories. At any particular time this set of files in their present edited state make up a working version of the project. If other people are using the project you give them this and as is usually the case, they find problems and you fix them. This results in another version of the project slightly changed which goes through the cycle again. (This is why books have editions and software has versions...)

Software developers on large projects with multiple developers could see this cycle and realized they needed a tool to control the changes. With multiple developers sometimes the same file would be edited by two different people changing it in different ways or records of what got changed would be lost. It was hard to bring out a new release of the software and be sure that all the bugs were fixed and enhancements made.

A tool called Source Code Control System \cite{SCCS} was developed at Bell Labs in 1972 to track changes in files. It would remember each of the changes made to a file and store comments about why this was done. It also limited who could edit the file so conflicting edits would not be done. \cite{USE-SCCS}

\label{versioning}This was important but developers could see more was needed. They needed to be able to save the state of all the files in a project and give it a name (i.e., Release 3.14). As software projects mature you will have a released version of the software being used as well as bug reports written against it, while the next release of the software is being developed adding new features. The source control system would have to handle what are now called branches. One branch has say Version 1 which is released but continues to have fixes added to create Version 1.1, 1.2, etc. At the same time you also have another branch which contains Version 2 with new features added under construction. 

In 1986 the open source Concurrent Version Control system CVS \cite{CVS} was developed. This system could label groups of files and allow multiple branches (i.e. versions) simultaneously. There have been many other systems developed since them some open source and some proprietary.

Fossil which was originally released in 2006 \cite{FOSSIL-HOME} is a easy to install version control system that also includes a trouble ticketing system ( Figure\vref{fig:viewticket}), a wiki ( Figure \vref{sub:Wiki-Use}) and self hosted web server ( Figure\vref{fig:Starting-Webserver}). It's home page is here \url{http://www.fossil-scm.org/}.


\subsection{Why do it ?}

Why do you want to use a source control system? To use one restricts your freedom, you won't be able to create files, delete files or, move files between directories at random. Making changes in your code becomes a check list of steps that must be followed carefully.

With all those hassles why do it? The biggest answer is freedom (huh ?). By following the procedures of a source control system you gain the freedom to modify your code any way you want. How does that follow ? One of the most horrible feelings as a developer is the ``It worked yesterday'' syndrome. That is, you had code that worked just fine and now it doesn't. You have a very helpless feeling of how do you get back to working code. With a source control system and careful adherence to procedures you can just go back in time and get yesterday's code. Then, starting from known good code you can figure out what happened.

Having a source control system also gives you the freedom to experiment, ``let's try that radical new technique'', and if it doesn't work it's easy to just go back to the previous state.

The rest of this book is a user manual for the Fossil version control system that does code management and much much more. It runs on multiple OS's and is FREE. It is simple to install as it has only one executable and the repositories it creates are a single file that is easy to back up and are usually only 50\% the size of the original source.


\subsubsection{How to get it}

If this has interested you then you can get a copy of the Fossil executable here \url{http://www.fossil-scm.org/download.html}. There are Linux, Mac, and Windows executable links on this page. Also there is a source Tarball from which you can compile from source. This web site is self-hosted by Fossil itself (see Section\vref{sec:Multiple-Users}). 


\subsection{Source control description}

This next section is useful if you have not used source control systems before. I will define some of the vocabulary and explain the basic ideas of source control.


\subsubsection{Check out systems}

When describing the grandaddy of source control systems, like SCCS I said it managed the changes for a single file and also prevented multiple people from working on the same file at the same time. This is representative of a whole class of source control systems. In these you have the idea of ``checking-out'' a file so you can edit it. At the same time while other people using the system can see who is working on the file they are prevented from touching it. They can get a read-only copy so they can say build software but only the ``owner'' can edit it. When done editing the ``owner'' checks it back in then anyone else could work on on it. At the same time the system has recorded who had it and the changes made to it.

This system works well in small groups with real time communication. A common problem is that a file is checked out by some one else and \textbf{you} have to make a change in it. In a small group setting, just a shout over the cube wall will solve the problem. 


\subsubsection{Merge systems}

In systems represented by CVS or Subversion the barrier is not getting a file to work on but putting it back under version control. In these systems you pull the source code files to a working directory in your area. Then you edit these files making necessary changes. When done you commit or check them back into the repository. At this point they are back under version control and the system knows the changes from the last version to this version.

This gets around the problem mentioned above when others are blocked from working on a file. You now have the opposite problem in that more than one person can edit the same file and make changes. This is handled by the check-in process. There only one person at a time may check in a file. That being the case the system checks the file and if there are changes in repository file that are NOT in the one to be checked in stops the check in process. The system will ask if the user wants to merge these changes into his copy. Once that is done the new version of the file can be checked in.

This type of system is used on large projects like the Linux kernel or other systems where you have a large number of geographically distributed contributors.


\subsubsection{Distributed systems}

The representatives of two major systems we have described thus far are centralized. That is there is only one repository on a single server. When you get a copy of the files or check in files it all goes to just one place. These work and can support many, many users. A distributed system is an extension of this where it allows the repositories to be duplicated and has mechanisms to synchronize them. 

With a single server users of the repository must be able to connect to it to get updates and for check ins of new code. If you are not connected to the server you are stuck and cannot continue working. Distributed systems allow you to have your own copy of the repository then continue working and when back in communication synchronize with the server. This is very useful where people take their work home and cannot access the company network. Each person can have a copy of the repository and continue working and re-sync upon return to the office.


\subsubsection{Common Terms}

The following is a list of terms I will use when talking about version control or Fossil.
\begin{description}
\item [{Repository}] This is the store when the version controlled files are kept. It will be managed by a source control system
\item [{SCS}] Source control system, this is software that manages a group of files keeping track of changes and allowing multiple users to modify them in a controlled fashion
\item [{Commit}] In Fossil to store the current set of new and changed files into the repository.
\item [{Trunk}] The main line of code descent in a Fossil repository.
\item [{Branch}] A user defined split in the files served by an SCS. This allow multiple work points on the same repository. Older branches (versions) might have bug fixes applied and newer branches (versions) can have new features added.
\item [{Fork}] In Fossil an involuntary split in the code path, occurs when a file in the repository has changes not in a file to be committed.
\end{description}

\section{\label{sec:Single-User-Fossil}Single User Fossil Use}


\subsection{Introduction}

If you have read this far and are at least persuaded to try, you will want to put one of your projects under software control using Fossil. This chapter is set up to lead you through that task and show you how to adapt your development to using this tool. The assumption is made in this section that you will be the only person using the repository, you are the designer, developer, and maintainer of this project. After you are comfortable using the tool, the next section will show how you use it when you have multiple people working on a project.


\subsection{Creating a repository }


\subsubsection{Introduction}

In the spirit of ``eating one's own dog food'' we will use this book as the project we are going to manage with Fossil. The book is a directory of text files (we are writing it using \LyX{} \cite{LyX}) and my working area looks like this:
\begin{lyxcode}
{\scriptsize FOSSIL/}{\scriptsize \par}
\begin{lyxcode}
{\scriptsize This~directory~holds~all~my~Fossil~repositories}{\scriptsize \par}
\end{lyxcode}
{\scriptsize FossilBook/}{\scriptsize \par}
\begin{lyxcode}
{\scriptsize outline.txt~~~~-~Book~design}{\scriptsize \par}

{\scriptsize fossilbook.lyx~-~The~book}{\scriptsize \par}

{\scriptsize Layout}{\scriptsize \par}
\begin{lyxcode}
{\scriptsize fossil.png~~-~The~Fossil~logo~(image~on~title~page)}{\scriptsize \par}
\end{lyxcode}
{\scriptsize Research}{\scriptsize \par}
\begin{lyxcode}
{\scriptsize fossilbib.bib~-~Working~bibliography}{\scriptsize \par}

{\scriptsize History}{\scriptsize \par}
\begin{lyxcode}
{\scriptsize CVC-grune.pdf~-~Historical~paper~about~CVS}{\scriptsize \par}

{\scriptsize RCS-A~System~for~Version~Control.webloc~-~RCS~bookmark}{\scriptsize \par}

{\scriptsize SCCS-Slideshow.pdf~-~Historical~paper~about~SCCS}{\scriptsize \par}

{\scriptsize VCSHistory~-pysync~...~.webloc~-~History~of~version~control}{\scriptsize \par}
\end{lyxcode}
\end{lyxcode}
\end{lyxcode}
\end{lyxcode}
This took just an hour or so to start preliminary research and build the framework. Since that's about all I'm going to do today I want to build a repository and put all this stuff under Fossil control.


\subsubsection{Create Repository}

I have a directory called FOSSIL in which I keep all my repositories, Fossil doesn't care but it helps me to keep them all in one place so I can back them up. First I need to create a new repository for the book. This is done using the command line after I move into the Fossil book directory.
\begin{lyxcode}
{\scriptsize }
\begin{figure}[H]
\begin{lyxcode}


{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~new~../FOSSIL/FossilBook.fossil}{\scriptsize \par}

{\scriptsize project-id:~2b0d35831c1a5b315d74c4fd8d532b100b822ad7}{\scriptsize \par}

{\scriptsize server-id:~~0149388e5a3109a867332dd8439ac7b454f3f9dd}{\scriptsize \par}

{\scriptsize admin-user:~jim~(initial~password~is~\textquotedbl{}}\textbf{\scriptsize ec3773}{\scriptsize \textquotedbl{})}{\scriptsize \par}
\end{lyxcode}
\caption{Create Repository\label{fig:Create-Repository}}


\end{figure}
{\scriptsize \par}
\end{lyxcode}
I create my repositories with the extension .fossil, this will be useful later with the server command (See Figure \vref{fig:server-detail}). When the create happened it assigned an initial password with an admin user of ``jim'' (i.e., me). 


\subsubsection{Connect Repository}

The repository is created but is empty and has no connection to the book directory. The next step is to open the repository to the book directory with the \textbf{open} command.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~open~../FOSSIL/FossilBook.fossil}{\scriptsize{}~}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~status}{\scriptsize \par}

{\scriptsize repository:~~~/Users/jschimpf/Public/FOSSIL/FossilBook.fossil}{\scriptsize \par}

{\scriptsize local-root:~~~/Users/jschimpf/Public/FossilBook/}{\scriptsize \par}

{\scriptsize server-code:~~0149388e5a3109a867332dd8439ac7b454f3f9dd}{\scriptsize \par}

{\scriptsize checkout:~~~~~279dfecd3f0322f236a92a9a8f3c96acf327d8c1~2010-04-25~12:40:39~UTC}{\scriptsize \par}

{\scriptsize tags:~~~~~~~~~trunk}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~extra}{\scriptsize \par}

{\scriptsize Layout/fossil.png}{\scriptsize \par}

{\scriptsize Research/History/CVS-grune.pdf}{\scriptsize \par}

{\scriptsize Research/History/RCS\textemdash{}A~System~for~Version~Control.webloc}{\scriptsize \par}

{\scriptsize Research/History/SCCS-Slideshow.pdf}{\scriptsize \par}

{\scriptsize Research/History/VCSHistory~-~pysync~-~....webloc}{\scriptsize \par}

{\scriptsize Research/fossilbib.bib}{\scriptsize \par}

{\scriptsize fossilbook.lyx}{\scriptsize \par}

{\scriptsize outline.txt}{\scriptsize \par}
\end{lyxcode}
\caption{Open Repository \& Check}


\end{figure}


The \textbf{open} command seemingly did nothing but checking with the \textbf{status} command shows the repository, the directory it's linked to and that we are hooked to the trunk of the store. 

The \textbf{extra} command shows all the files in the directory that are NOT under control of Fossil. In this case that's all of them since we have not checked in anything.


\subsubsection{Add and Initial Commit}

I must now add all the relevant files into the repository with the \textbf{add} command. The Fossil add is recursive so if I add the top level files it will automatically recurse into the subdirectories like Layout and Research and get those files too. Before you do an add it pays to tidy up your directory so you don't accidentally add a bunch of transient files (like object files from a compile). It's easy to remove them later but a little tidying before hand can save you some work.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~add~.}{\scriptsize \par}

{\scriptsize ADDED~~Layout/fossil.png}{\scriptsize \par}

{\scriptsize ADDED~~Research/History/CVS-grune.pdf}{\scriptsize \par}

{\scriptsize ADDED~~Research/History/RCS\textemdash{}A~System~for~Version~Control.webloc}{\scriptsize \par}

{\scriptsize ADDED~~Research/History/SCCS-Slideshow.pdf}{\scriptsize \par}

{\scriptsize ADDED~~Research/History/VCSHistory~-~pysync~....webloc}{\scriptsize \par}

{\scriptsize ADDED~~Research/fossilbib.bib}{\scriptsize \par}

{\scriptsize fossil:~cannot~add~\_FOSSIL\_}{\scriptsize \par}

{\scriptsize ADDED~~fossilbook.lyx}{\scriptsize \par}

{\scriptsize ADDED~~outline.txt}{\scriptsize \par}
\end{lyxcode}
\caption{Initial file add}
\end{figure}


I simply told fossil to do an add of the current directory (.) so it got all those files and all the files in the subdirectory. Note the \_FOSSIL\_ that it didn't add. This is the tag file that fossil keeps in a directory so it knows what repository it belongs to. Fossil won't add this file since it manages it, but everything else is fair game.

One final thing before I can quit for the day, these files have been added or rather they will be added to the repository when I commit it. That must be done and then we can relax and let Fossil manage things. 

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~commit~-m~\textquotedbl{}Initial~Commit\textquotedbl{}}{\scriptsize \par}

{\scriptsize New\_Version:~8fa070818679e1744374bc5302a621490276d739}{\scriptsize \par}
\end{lyxcode}
\caption{Initial Commit}


\end{figure}


I added a comment on the commit and it's a good idea to always do this. When later we see the timeline of the commits you will have notes to tell you what was done.


\subsubsection{Fossil start up summary}
\begin{itemize}
\item \textbf{fossil new <name> }Creates a new fossil repository
\item \textbf{fossil open <repository> }While in a source directory connects this directory to the fossil repository
\item \textbf{fossil add .} Will add (recursively) all the files in the current directory and all subdirectories to the repository
\item \textbf{fossil commit -m ``Initial Commit''} Will put all the currently added files into the repository.
\end{itemize}

\subsection{Set Up User interface}

One of the surprising features of Fossil is the webserver. This allows it to have a GUI type user interface with no operating system specific code, the GUI is the web browser supplied by your OS. In the previous steps I checked my project in to a Fossil repository, next I have to prep the web interface for production use. 
\begin{description}
\item [{NOTE}] The Fossil web server uses port 8080 instead of the standard port 80 for all HTTP access. When run it will automatically start your Web browser and open the repository home page. Unfortunately my book work is done on a machine that already has Apache running on port 8080 so I will be using port 8081. I will always have to add an extra parameter on the UI command line to do this.
\end{description}
\begin{figure}[H]
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\footnotesize fossil~ui~-port~8081}{\footnotesize \par}
\end{lyxcode}
\caption{\label{fig:Starting-Webserver}Starting Webserver}
\end{figure}

\begin{description}
\item [{NOTE:}] Newer versions of Fossil automatically find an open port and will give a message on the command line telling you what port number is used. You can still use the -port option if you want to control the port \#.
\end{description}
This shows how it's started, as you can see I have picked port 8081 since I am locked out of port 8080. When I do this my browser starts and I am presented with the following home page.

\begin{figure}[H]
\noindent \begin{raggedright}
\includegraphics[scale=0.6]{Images/Single_user/initial_page.epsf}
\par\end{raggedright}

\caption{\label{fig:Initial-Webserver-page}Initial Webserver page}


\end{figure}


Following the advice on the page I go to \textbf{setup/config}. I am going to do the minimum setup that you should do on all projects. As you get familiar with Fossil you will probably have many more things that you will customize for your taste but what follows are the only things you HAVE to do.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/config_initial.epsf}

\caption{\label{fig:Initial-Configuration}Initial Configuration}


\end{figure}


I have entered in a project name and put in a description, the project name will be the name of the initial Wiki page (see \vref{sub:Wiki-Use}) and the description is useful for others to see what you are doing here. Then I go to the bottom of the page and pick the \textbf{Apply Changes }button.

Next I pick the Admin tab (you can see it in the header bar) and the pick Users from that page. I am presented with the users and will use this to set the password of the project.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/user_config.epsf}

\caption{\label{fig:User-Configuration}User Configuration}


\end{figure}


As you can see Fossil automatically configures a number of users beyond just the creator. The anonymous user you have already seen if you went to the Fossil web site to download the code. This user can view and get code but cannot commit code. On the right side of the page are the many options you can give to a user, it's worth reading it all when you set up your repository. The important one is me (jim) which has ``s'' or Super User Capabilities. This means I can do anything with the repository.

I will now edit the user Jim to make sure it has the settings I want. In this case you MUST set the password. Remember way back where Fossil set it during the create (Figure\vref{fig:Create-Repository}), it's a very good idea to change this to something you can remember rather than the original random one.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/jim_setup.epsf}

\caption{Super User Setup}


\end{figure}


I have put in my contact information (e-mail address) and while you cannot see it I have typed in a password that I will remember. Then I applied the changes.

Now the repository is ready for further work, it's rather bare bones at this point but the most important things are set up.


\subsubsection{User interface summary}
\begin{itemize}
\item \textbf{fossil ui} run in the source directory will start a browser based user interface to fossil.
\item \textbf{fossil ui -port <IP port \#>} Can be used if port 8080 if already in use on your system.
\item On the first run it is important to configure your project with a name and set the password for yourself.
\end{itemize}

\subsection{Update Repository}

After writing the above section of the book I now have created a bunch of new files and changed some of the existing files in the repository. Before quitting for the day I should add these new files into the repository and commit the changes saving this milestone in the project.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~extra}{\scriptsize \par}

{\scriptsize \#fossilbook.lyx\#}{\scriptsize \par}

{\scriptsize Images/Single\_user/config\_initial.epsf}{\scriptsize \par}

{\scriptsize Images/Single\_user/initial\_page.epsf}{\scriptsize \par}

{\scriptsize Images/Single\_user/jim\_setup.epsf}{\scriptsize \par}

{\scriptsize Images/Single\_user/user\_config.epsf}{\scriptsize \par}

{\scriptsize fossilbook.lyx\textasciitilde{}}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~status}{\scriptsize \par}

{\scriptsize repository:~~~/Users/jschimpf/Public/FOSSIL/FossilBook.fossil}{\scriptsize \par}

{\scriptsize local-root:~~~/Users/jschimpf/Public/FossilBook/}{\scriptsize \par}

{\scriptsize server-code:~~0149388e5a3109a867332dd8439ac7b454f3f9dd}{\scriptsize \par}

{\scriptsize checkout:~~~~~8fa070818679e1744374bc5302a621490276d739~2010-04-25~13:09:02~UTC}{\scriptsize \par}

{\scriptsize parent:~~~~~~~279dfecd3f0322f236a92a9a8f3c96acf327d8c1~2010-04-25~12:40:39~UTC}{\scriptsize \par}

{\scriptsize tags:~~~~~~~~~trunk}{\scriptsize \par}

{\scriptsize EDITED~~~~~fossilbook.lyx}{\scriptsize \par}


\end{lyxcode}
\caption{Project Status}


\end{figure}


I run \textbf{fossil extra} to see these new files. The image files (those in Images/Single\_user) I want to add, the other two files, \#fossilbook.lyx\# and fossilbook.lyx\textasciitilde{}, I don't want to add since they are temporary artifacts of \LyX{}. I also ran \textbf{fossil status}. This shows changes to files that are already in the repository. There the only file changed is the book text itself, \textbf{fossilbook.lyx}.

All I have to do now is add in the directory Images which will add in the image files I want in the repository. Then I commit the changes to the repository and we can move on to other tasks of the day.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~add~Images}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/config\_initial.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/initial\_page.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/jim\_setup.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/user\_config.epsf}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~commit~-m~\textquotedbl{}Initial~setup~with~pictures\textquotedbl{}}{\scriptsize \par}

{\scriptsize New\_Version:~a2d12bf532a089ee53578e3e17c6e732c0442f49}{\scriptsize \par}
\end{lyxcode}
\caption{\label{fig:Update-for-new}Update for new files}


\end{figure}


After doing this commit I can bring up the Fossil ui (see Figure \vref{fig:Starting-Webserver}) and view the project Timeline by picking that tab on the Fossil header. We get this:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/timeline.epsf}

\caption{Timeline}


\end{figure}


You can see all my check-ins thus far and you can see after the check-in from Figure \vref{fig:Update-for-new} I did another check-in because I missed some changes in the outline. The check-ins are labeled with the first 10 digits of their hash value and these are active links which you can click to view in detail what was changed in that version. 

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/timeline_detail.epsf}

\caption{Timeline Detail\label{fig:Timeline-Detail}}
\end{figure}


I clicked on the very last check-in (the \textbf{LEAF) }and the display is shown above. There are many things you can do at this point. From the list of changed files you can pick the diff link and it will show in text form the changes made in that particular file. The ``Other Links'' section has a very useful ZIP Archive. Clicking this will download a ZIP of this version to your browser. You will find this useful if you want to get a particular version, in fact this is normally how you get a new version of Fossil from the \url{http://www.fossil-scm.org/}. The edit link will be used later to modify a leaf.


\subsubsection{Update Summary}
\begin{itemize}
\item \textbf{fossil status} and \textbf{fossil extra} will tell you the updated files and files not in the repository before you commit.
\item \textbf{fossil commit - m ``Commit comment'' }Commits a change (or changes). It is very important to have a descriptive comment on your commit.
\end{itemize}

\subsection{Tickets}

Besides managing your code Fossil has a trouble ticket system. This means you can create a ticket for a problem or feature you are going to add to your system then track your progress. Also you can tie the tickets to specific check-ins of your files. For software this is very useful for bug fixes and feature additions. For example you can look for a bug in the ticket list then have it take you to the change that fixed the problem. Then you know exactly what you did and not have to be confused by other changes you might have made.

When you pick Tickets it will bring up this window. You can create a new ticket, look at the list, or generate a new report. Keeping things simple I will just use the All Tickets list for now.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/ticket_initial.epsf}

\caption{Initial Ticket Window}


\end{figure}


Picking ``New Ticket'' I get a form that I fill out like so:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/ticket_form.epsf}

\caption{Ticket Form}


\end{figure}


Pretty simple actually. You can put as much or as little detail in here as you wish, but remember this stuff might be really vital 6 weeks or 6 months from now so think of what you would want to know then. When I press Submit I get this showing what I entered.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/ticket_submit.epsf}

\caption{Viewing a Ticket}


\end{figure}


Finally picking Tickets then ``All Tickets'' I can see my new ticket in the list marked as Open and in a distinctive color. 

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/ticket_list.epsf}

\caption{\label{fig:viewticket}Ticket List with open ticket}


\end{figure}


I try, in handling tickets, to have links from ticket to the commit that addressed the problem and a link from the commit back to the offending ticket. This way looking at the ticket I can get to the changes made and from the timeline I can get the the ticket and its resolution. To do this I will make sure and put the 10 digit hash label from the ticket into the check-in comment and put a link in the resolved ticket to the check-in.

Since I have now written the chapter and put in all these images of what to do I can now add in all the new images to the repository and check this in as another completed operation. And I do that like this:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~add~Images/Single\_user}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/config\_initial.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/initial\_page.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/jim\_setup.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/ticket\_form.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/ticket\_initial.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/ticket\_list.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/ticket\_submit.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/timeline.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/timeline\_detail.epsf}{\scriptsize \par}

{\scriptsize ADDED~~Images/Single\_user/user\_config.epsf}{\scriptsize \par}



{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~commit~-m~\textquotedbl{}{[}1665c78d94{]}~Ticket~Use\textquotedbl{}}{\scriptsize \par}
\end{lyxcode}
\caption{\label{fig:checkin}Ticket resolving check-in}


\end{figure}


First I added in all the new image files. I am lazy and just told it to add in all the files in the Single\_user directory. I have previously added some of those like \textbf{config\_initial.epsf} but Fossil is smart and knows this and won't add that one twice. Even though it shows it ADDED, it really didn't.

The commit line is very important, as you can see I put 10 digit hash code for the ticket in brackets in the comment. As we will see in the Wiki section this is a link to the Ticket, so when viewing the comment in the Timeline or elsewhere you can click the bracketed item and you would go to the ticket.

Now that I have the items checked in I have to close the ticket. I do that by clicking on its link in the ticket list, that will go the the View Ticket window as shown in Figure \vref{fig:viewticket}. From there I pick edit and fill it in as shown:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/ticket_done.epsf}

\caption{Ticket Finish}


\end{figure}


I mark it as ``Closed''. If you have code you can mark this as fixed, tested, or a number of other choices. Another very important step, I brought up the Timeline and copied the link for the commit I had just done in Figure \vref{fig:checkin}. By doing this my ticket is now cross linked with the commit and the commit has a link back to the ticket.


\subsubsection{Ticket Summary}
\begin{itemize}
\item Tickets are a useful way of reminding you what needs done or bugs fixed
\item When you commit a change that affects a ticket put the 10 digit hash label of the ticket into the commit comment surrounded by brackets, e.g. {[}<10 digit hash>{]} so you can link to the ticket
\item When you close the ticket put in the hash label of the commit that fixed it.
\end{itemize}

\subsection{\label{sub:Wiki-Use}Wiki Use}

As we saw in Figure \vref{fig:Starting-Webserver} Fossil has a browser based user interface. In addition to the pages that are built in you can add pages to web site via a wiki. This allows you to add code descriptions, user manuals, or other documentation. Fossil keeps all that stuff in one place under version control. A wiki is a web site where you can add pages and links from within your browser. You are given an initial page then if you type {[}newpage{]} this text will turn into a link and if clicked will take you to a new blank page. Remember in Figure \vref{fig:Initial-Webserver-page} that is the initial page for your project and from there you can add new pages. These pages are automatically managed by the Fossil version control system; you don't have to add or commit.

Since I did the setup on repository (see Figure \vref{fig:Initial-Configuration}) the home page has changed to this:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/wiki_blankhome.epsf}

\caption{Blank Home Page}


\end{figure}


Not very helpful so the in rest of this chapter I will use the Wiki functions of Fossil to make this more useful. If I pick the Wiki item from the menu bar I get:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/wiki_page.epsf}

\caption{\label{fig:Wiki-controls}Wiki controls}


\end{figure}


These are the controls that let you control and modify the wiki. Most important for now is the Formatting rules link. This link takes you to a page that describes what you can do to format a wiki page. If you just type text on a page it will appear but be formatted by your browser. You can type HTML commands to control this formating. It's worth your time to carefully read this page and note what you can and cannot do. The page just lists the valid HTML commands, and if you don't know what they mean I would suggest you find a page like this \url{http://www.webmonkey.com/2010/02/html_cheatsheet/} and keep it handy. 

Besides the HTML markup the most powerful command for the Wiki is {[}page{]} where it links to a new page. This is how you add pages and how you build your web site of documentation for the repository.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/wiki_formating.epsf}\caption{Wiki Formating}


\end{figure}


I now begin work. What I want to do is change the home page to be non-empty and also put a link on the home page to the PDF of this book. In Figure \vref{fig:Wiki-controls} I click on the first item, the FossilBook home page. This takes me to the home page again but now I have an Edit option. We also have a History option so I could look at older versions of the page. 

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/wiki_homeedit.epsf}

\caption{Home page with edit}


\end{figure}


This shows my initial edit and a preview:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Single_user/wiki_home.epsf}

\caption{Initial Home page}


\end{figure}


The bottom section is an edit window where I type things I want displayed and the top is a preview of what the page will be. As you can see I typed some simple HTML to make a large and centered title. The body of the text I just typed and as you see the browser fits the text to the screen. You can have multiple paragraphs by just putting blank lines between your text. Next I wanted a bulleted list and this is done by typing two spaces, a '{*}' then two more spaces. On each of these lines I have a link to a new (not yet created page). If you look I put these in the form {[} <new page> | <title> {]}. This way I can have a long string that describes the link but have a nice short (no embedded spaces) page name. 

One mistake I usually make at this point is to click one of those new links which takes me to a new blank page. \textbf{OOPS}, if I have not saved this page yet then I find I've lost my changes so far. 

OK, I will save my changes and then go to the new pages. I am doing some complicated things here. The first link is to the book PDF. This will be a file I create in the repository. The \LyX{} program I'm using creates the PDF. I will do that, save it, and add it to the repository. But I don't want to link to a static file, that is I want the most current version of the PDF, the one I save each time I quit for the day. To do this we have to put in a link that looks like this:
\begin{lyxcode}
{[}http:doc/tip/FossilBook.pdf~|~Book~(pdf)~{]}
\end{lyxcode}
This is a special link the Fossil wiki understands, \textbf{doc }says this is documentation. \textbf{tip }says use the most current version; you could put a version link here. And finally since I am going to put the book PDF at the top level I only need the file name. If it was in a subdirectory I would have to say \textbf{doc/tip/subdir/filename. }

The second link is just to a regular page and I can just edit that one just like I did this the main page.


\subsubsection{Wiki Summary}
\begin{itemize}
\item Format your text using HTML commands like <h1>Title</h1> for page headings
\item Create and link pages using {[} <page> | <Link text> {]}
\item The page designation http:doc/tip/<document path relative to repository> will display any document in the repository that your browser can handle (i.e. pdf, http etc)
\item Never click on a link till AFTER you have saved the page
\end{itemize}

\section{\label{sec:Multiple-Users}Multiple Users}


\subsection{Introduction}

In the previous chapter I went through using Fossil with just one user (me). In this chapter we will get into using it with multiple users. Thanks to Fossil's distributed design once the set up is done using it is not much different than the single user case with Fossil managing automatically the multiple user details.


\subsection{Setup}

In the previous chapter the Fossil repository was a file on our system and we did commits to it and pulled copies of the source from it. Fossil is a distributed source control system; what this means is that there is a master repository in a place that all users can access. Each user has their own ``cloned'' copy of the repository and Fossil will automatically synchronize the users repository with the master. From a each user's perspective you have your local repository and work with it using the same commands shown in Chapter \ref{sec:Single-User-Fossil}. It's just that now Fossil will keep your repository in sync with the master.


\subsubsection{Server Setup\label{sub:Server-Setup}}

I have the FossilBook.fossil repository and now have to put it in place so multiple users can access it. There are two ways, the first is using fossil's built in webserver to host the file and the second is using the operating systems supported web server (if present) and a cgi type access.


\paragraph{Self hosted}

This is quite simply the easiest way to do it. The downside is that you are responsible for keeping the machine available and the webserver up. That is, don't turn the machine off when you quit for the day or some other user is going to be upset. All I have to do is this:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:/Users/jschimpf/Public{]}~jim\%~cd~FOSSIL/}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FOSSIL{]}~jim\%~}\textbf{\scriptsize fossil~ui~-port~8081~FossilBook.fossil~\&}{\scriptsize{}~}{\scriptsize \par}

{\scriptsize {[}1{]}~310}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FOSSIL{]}~jim\%~}{\scriptsize \par}
\end{lyxcode}
\caption{Self-hosted Fossil repository}


\end{figure}


This is on UNIX system, the ``\&'' at then end of the second line runs the fossil webserver in the background. If I know this machine has an IP address of 192.168.1.200 then from any other machine in the network I can say:

\textbf{http://192.168.1.200:8081} to the browser and I can access the Fossil web server. 

As you can see this is simple and works on any system that runs Fossil. As long as you carefully make sure it's always running and available for others this can be a very easy way to make the master repository available. 

The problems with this method are:
\begin{enumerate}
\item If you have multiple repositories you have to use the \textbf{server} not the \textbf{ui} command, have all your repositories in the same directory, and have them all use the extension .fossil.
\item If the machine goes off line (i.e. for OS update) or other reason it might not automatically restart the Fossil servers.
\item Backup of the repositories might be not be done.
\end{enumerate}
This method does work, and if you only have one repository and a diligent owner of the master machine, it will work and work well.


\paragraph{Server hosted}

If you have a server type machine available (i.e., a Linux or UNIX box) that is running Apache or a Windows machine running IIS you can let it be the webserver for your repository. This has a number of advantages: this machine will be up all the time, it will probably be automatically backed up, and it can easily support multiple Fossil repositories.

I am not going into how to set up the webserver or how to enable (Common Gateway Interface) CGI. See the following sites.
\begin{itemize}
\item For IIS see here \url{http://www.boutell.com/newfaq/creating/iiscgihowto.html} and just ensure that your fossil.exe is in the path to be run by the cgi script.
\item For Apache see here \url{http://httpd.apache.org/docs/2.0/howto/cgi.html} and ensure you know the directory where the CGI scripts are stored.
\end{itemize}
If you are not in control of the webserver you will need the help of the server admin to enable CGI and to copy your CGI scripts to correct location.


\paragraph{CGI Script for hosted server}

If we assume an Apache server and, in my case, the cgi directory path is /Library/Webserver/CGI-Executables, then we have to write a script of the form:

\begin{figure}[H]
\begin{lyxcode}
\#!<Fossil~executable~location>

repository:~<Fossil~repository~location>
\end{lyxcode}
\caption{Fossil CGI script}


\end{figure}


and put it into the cgi script directory. I have put my Fossil executable into /usr/local/bin and I am putting my Fossil shared repository into /Users/Shared/FOSSIL. My script then becomes:

\begin{figure}[H]
\begin{lyxcode}
\#!/usr/local/bin/fossil

\#~Put~the~book~repository~on~the~web

repository:~/Users/Shared/FOSSIL/Fossilbook.fossil
\end{lyxcode}
\caption{My Fossil CGI script}


\end{figure}


After making the script I then copy it to the CGI directory and allow anyone to execute it.
\begin{lyxcode}

\end{lyxcode}
\begin{figure}[H]
\begin{lyxcode}
\textbf{\scriptsize sudo~cp~Book.cgi~/Library/Webserver/CGI-Executables/Book.cgi}{\scriptsize \par}



\textbf{\scriptsize sudo~chmod~a+x~/Library/Webserver/CGI-Executables/Book.cgi}{\scriptsize \par}
\end{lyxcode}
\caption{Copying script into place}


\end{figure}



\subsubsection{The test (either self hosted or server hosted)}

If all is in place then I should be able to access the webserver and get to this:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Multiple_user/test_access.epsf}

\caption{\label{fig:Web-access-to}Web access to Fossil CGI hosted site}
\end{figure}



\subsection{User Accounts}

Serving a repository, either self hosting or the more complicated CGI method gets you to the same place as shown in Figure \vref{fig:Web-access-to}. Now I have to set up user accounts for the other contributors to this book. Remember Fossil has automatically created an Anonymous user (see Figure \vref{fig:User-Configuration}) thus others can access the site in a limited way, that is they can download the book but cannot commit changes. In this case I want to create a new account (Marilyn) that can make changes and commit changes as she is my editor.

To accomplish all this first I have to login by going to the log in page and entering my ID (jim) and my password. Now since I'm super-user I then go back to the User-Configuration page, Figure \eqref{fig:User-Configuration} and add a new user:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Multiple_user/mul_new_user.epsf}

\caption{New Editor user\label{fig:New-Editor-user}}


\end{figure}


Since she is going to be an editor, this will be similar to a developer if we were doing code, so I picked the Developer privilege level. This way she can get the repository, check-in, check-out, and write and update tickets. I also added the attachments since she might need that to put on an image or other comment on actions she is doing. I also gave her a password so her access can be secured.

I could add other users at this point but don't need any others for this project, but you can see how easily this can be done. When you assign the user privileges just read carefully and don't give them any more than you think they need. If they have problems, you can easily modify their account in the future.


\subsection{Multiple User Operation}

With the server set up and the user established the next thing to do is clone the repository. That is make copy from the webserver repository to my local machine. Once that is done this local repository uses the same commands and is very much like single user use discussed in Section \vref{sec:Single-User-Fossil}. Fossil will synchronize your local repository with the one on the server.


\subsubsection{Cloning}

To clone a Fossil repository you have to know four things:
\begin{enumerate}
\item It's web address, for our repository it is \textbf{http://pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}
\item Your account name in my case it's \textbf{jim}
\item Your password (which I'm keeping to myself thank you...)
\item The local name of the repository, in this case I'm calling it Fossilbook.fossil
\end{enumerate}
You then go to where you want to keep the Repository (in my case the FOSSIL directory) and use the clone command:

\begin{figure}[H]
\begin{lyxcode}
{\tiny {[}Pandora-2:jschimpf/Public/FOSSIL{]}}\textbf{\tiny{}~fossil~clone~http://jim:}{\tiny <passwd>}\textbf{\tiny @pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi~FossilBook.fossil}{\tiny \par}

\textbf{\scriptsize \#\#\#~NOTE:~<passwd>~}{\scriptsize -~Stands~in~for~real~password}{\scriptsize \par}



{\scriptsize{}~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\scriptsize \par}

{\scriptsize Send:~~~~~~~~~~~~~~49~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Received:~~~~~~~~~120~~~~~~~~~~2~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Send:~~~~~~~~~~~~~625~~~~~~~~~25~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Received:~~~~~~~~4704~~~~~~~~~72~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Send:~~~~~~~~~~~~3104~~~~~~~~~72~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Received:~~~~~5129052~~~~~~~~131~~~~~~~~~10~~~~~~~~~~5}{\scriptsize \par}

{\scriptsize Send:~~~~~~~~~~~~2399~~~~~~~~~51~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Received:~~~~~4381170~~~~~~~~116~~~~~~~~~22~~~~~~~~~28}{\scriptsize \par}

{\scriptsize Total~network~traffic:~4117~bytes~sent,~6913068~bytes~received}{\scriptsize \par}

{\scriptsize Rebuilding~repository~meta-data...}{\scriptsize \par}

{\scriptsize 65~(100\%)...}{\scriptsize \par}

{\scriptsize project-id:~2b0d35831c1a5b315d74c4fd8d532b100b822ad7}{\scriptsize \par}

{\scriptsize server-id:~~3e67da6d6212494456c69b1c5406a277d7e50430}{\scriptsize \par}

{\scriptsize admin-user:~jim~(password~is~\textquotedbl{}d07222\textquotedbl{})}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FOSSIL{]}~jim\%~}{\scriptsize \par}
\end{lyxcode}
\caption{Clone command}


\end{figure}


At this point I can go through the steps outlined in Section \vref{sec:Single-User-Fossil} to set my user password and then open the Fossil Repository on a working directory.

Now that I've moved everything to the new cloned repository I do a check in a the end of the day which looks like this:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~commit~-m~\textquotedbl{}Moved~to~clone~repository\textquotedbl{}}{\scriptsize \par}

{\scriptsize Autosync:~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}{\scriptsize \par}

{\scriptsize Bytes~Cards~Artifacts~Deltas}{\scriptsize \par}

{\scriptsize Send:~130~1~0~0}{\scriptsize \par}

{\scriptsize Received:~2990~65~0~0}{\scriptsize \par}

{\scriptsize Total~network~traffic:~334~bytes~sent,~1876~bytes~received}{\scriptsize \par}

{\scriptsize New\_Version:~158492516c640d055bc0720684a05e797b88165a}{\scriptsize \par}

{\scriptsize Autosync:~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}{\scriptsize \par}

{\scriptsize Bytes~Cards~Artifacts~Deltas}{\scriptsize \par}

{\scriptsize Send:~618798~74~1~2}{\scriptsize \par}

{\scriptsize Received:~3222~70~0~0}{\scriptsize \par}

{\scriptsize Send:~268138~73~1~0}{\scriptsize \par}

{\scriptsize Received:~3221~70~0~0}{\scriptsize \par}

{\scriptsize Send:~3977~72~0~1}{\scriptsize \par}

{\scriptsize Received:~3220~70~0~0}{\scriptsize \par}

{\scriptsize Total~network~traffic:~457995~bytes~sent,~6011~bytes~received}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}{\scriptsize \par}
\end{lyxcode}
\caption{\label{fig:Cloned-repository-checkin}Cloned repository checkin}


\end{figure}


As you see the files were committed locally and then the local repository was automatically synchronized with the repository on the server.


\subsubsection{Keeping in sync}

After doing all the setup described above I now have a distributed source control system. My co-worker, Marilyn has also cloned the repository and begun work. She is editing the book correcting my clumsy phrasing and fixing spelling mistakes. She is working independently and on the same files I use. We must use Fossil to prevent us from both modifying FossilBook.lyx but in different ways. Remember Fossil has no file locking, there is nothing to prevent her from editing and changing the file while I work on it.

This is where we both must follow procedures to prevent this sort of problem. Even though she edits files I cannot see the changes till they are committed. Two different versions of the same file won't be a problem till I try to commit with my version and her version is in the current leaf.

\label{There-are-two}There are two problems:
\begin{enumerate}
\item Before I do any work I must be sure I have the current versions of all the files.
\item When I commit I must make sure what I am committing has only my changes and is not stepping on changes she has done.
\end{enumerate}
The first is pretty obvious, make sure you have the latest before you do anything. We do that with the update command. In Figure \ref{fig:Cloned-repository-checkin} I had done my latest check in. Before starting any more work I should ensure that Marilyn hasn't checked in something else. I could check the timeline but instead I'll do an update to my repository and source files. When I do the update I specify it should be updated from the \textbf{trunk. }This ensures I get it from the latest and greatest not some branch.

\begin{figure}
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~}\textbf{\scriptsize fossil~update~trunk}{\scriptsize \par}

{\scriptsize Autosync:~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}{\scriptsize \par}

{\scriptsize Bytes~Cards~Artifacts~Deltas}{\scriptsize \par}

{\scriptsize Send:~130~1~0~0}{\scriptsize \par}

{\scriptsize Received:~3588~78~0~0}{\scriptsize \par}

{\scriptsize Send:~365~6~0~0}{\scriptsize \par}

{\scriptsize Received:~136461~83~2~3}{\scriptsize \par}

{\scriptsize Total~network~traffic:~796~bytes~sent,~131582~bytes~received}{\scriptsize \par}

{\scriptsize UPDATE~fossilbook.lyx}{\scriptsize \par}

{\scriptsize UPDATE~fossilbook.pdf}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}~
\end{lyxcode}
\caption{Update action}


\end{figure}


Ah ha ! Marilyn has been at work and updated the book source and pdf. If I check the timeline from the webserver I see she has even documented it:

\begin{figure}[H]
\includegraphics[scale=0.4]{Images/Multiple_user/mul_timeline.epsf}

\caption{Updated Timeline}


\end{figure}


Now I know I have the current state of the world and I can proceed to add in new sections.


\subsubsection{Complications\label{sub:Complications}}

In\vref{There-are-two} the second case is much harder. In this case I have diligently done my fossil update and started working. In the mean time Marilyn has also done her update and also started working. Now she is done and checks in her changes. I obviously don't know this since I am happily working on my changes. What happens next....

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}\textbf{\scriptsize fossil~commit~-m~\textquotedbl{}Commit~that~might~fork\textquotedbl{}}{\scriptsize \par}

{\scriptsize Autosync:~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}{\scriptsize \par}

{\scriptsize Bytes~Cards~Artifacts~Deltas}{\scriptsize \par}

{\scriptsize Send:~130~1~0~0}{\scriptsize \par}

{\scriptsize Received:~4002~87~0~0}{\scriptsize \par}

{\scriptsize Send:~365~6~0~0}{\scriptsize \par}

{\scriptsize Received:~110470~92~2~3}{\scriptsize \par}

{\scriptsize Total~network~traffic:~797~bytes~sent,~104567~bytes~received}{\scriptsize \par}

\textbf{\scriptsize fossil:~would~fork.~\textquotedbl{}update\textquotedbl{}~first~or~use~-f~or~-{}-force.}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}{\scriptsize \par}
\end{lyxcode}
\caption{Forking commit}


\end{figure}


Ah ha, that very thing has happened and fossil warned me that my copy of the file differs from the master copy. If I did a --force then the repository would generate a fork and Marilyn's future commits would be to her fork and my commits would be to mine. That would not be what we want since I want her to edit\textbf{ }my copy of the book.

The next step would be to do as Fossil says and do an update. At this point you have to be careful since blindly updating the changed files could overwrite the stuff I've just done. So we do a trial update by using the -n and -v options to say``do a dry run'' and show me the results.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%~fossil~update~-n~-v}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Multiple\_user/mul\_new\_user.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Multiple\_user/mul\_timeline.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Multiple\_user/test\_access.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/config\_initial.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/initial\_page.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/jim\_setup.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/ticket\_done.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/ticket\_form.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/ticket\_initial.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/ticket\_list.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/ticket\_submit.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/timeline.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/timeline\_detail.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/user\_config.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/wiki\_blankhome.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/wiki\_formating.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/wiki\_home.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/wiki\_homeedit.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Images/Single\_user/wiki\_page.epsf}{\scriptsize \par}

{\scriptsize UNCHANGED~Layout/fossil.png}{\scriptsize \par}

{\scriptsize UNCHANGED~Research/History/CVS-grune.pdf}{\scriptsize \par}

{\scriptsize UNCHANGED~Research/History/RCS\textemdash{}A~System~for~Version~Control.webloc}{\scriptsize \par}

{\scriptsize UNCHANGED~Research/History/SCCS-Slideshow.pdf}{\scriptsize \par}

{\scriptsize UNCHANGED~Research/History/VCSHistory~-~pysync~-~A~Brief~History~of~Version~Control~Systems~-~Project~Hosting~on~Google~Code.webloc}{\scriptsize \par}

{\scriptsize UNCHANGED~Research/fossilbib.bib}{\scriptsize \par}

{\scriptsize MERGE~fossilbook.lyx}{\scriptsize \par}

{\scriptsize UPDATE~fossilbook.pdf}{\scriptsize \par}

{\scriptsize UNCHANGED~outline.txt}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}{\scriptsize \par}
\end{lyxcode}
\caption{Update dry run}


\end{figure}


That's a little more than I wanted as you can see almost everything is UNCHANGED but it shows that fossilbook.lyx needs a MERGE and fossilbook.pdf needs an UPDATE. This is what I should expect, Marilyn has done edits to the fossilbook.lyx file and so have I so we have to merge the changes. But she has also updated the fossilbook.pdf which I have not. Before we go on if you are running on Linux or UNIX you can simplify this dry run by doing:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}\textbf{\scriptsize fossil~update~-n~-v~|~grep~-v~UNCHANGED}{\scriptsize \par}

{\scriptsize MERGE~fossilbook.lyx}{\scriptsize \par}

{\scriptsize UPDATE~fossilbook.pdf}{\scriptsize \par}
\end{lyxcode}
\caption{Update dry run, shorter}


\end{figure}


By using the pipe and grep I can eliminate all those extra UNCHANGED lines.


\subsubsection{Fixing the Update file}

First we fix the easy file, the fossilbook.pdf I can just update by itself so it matches the current repository. It doesn't need merged so just replace it. Before I do that I have to look at the repository time line

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Multiple_user/mul_timeline.epsf}

\caption{Current Timeline}


\end{figure}


I see that the current\textbf{ Leaf} is {[}d44769cc23{]} and it is tagged as\textbf{ trunk}. I want to update the fossilbook.pdf from there. So I say:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}\textbf{\scriptsize fossil~update~trunk~fossilbook.pdf}{\scriptsize \par}

{\scriptsize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/Book.cgi}{\scriptsize \par}

{\scriptsize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\scriptsize \par}

{\scriptsize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Received:~~~~~~~~4002~~~~~~~~~87~~~~~~~~~~0~~~~~~~~~~0}{\scriptsize \par}

{\scriptsize Total~network~traffic:~334~bytes~sent,~2412~bytes~received}{\scriptsize \par}

{\scriptsize UPDATE~fossilbook.pdf}{\scriptsize \par}

{\scriptsize {[}Pandora-2:jschimpf/Public/FossilBook{]}~jim\%}{\scriptsize \par}
\end{lyxcode}
\caption{Update fossilbook.pdf}


\end{figure}


and it's done.


\subsubsection{Fixing the Merge file}

We can use the tools built into Fossil. In this case noticing that commit will cause a fork Jim will use the -force option to cause the fork and will handle the merge later.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize E:\textbackslash{}Profile\textbackslash{}Ratte\textbackslash{}data\textbackslash{}organize\textbackslash{}fossil-w32\textbackslash{}fossil-book>fossil~commit~-m~\textquotedbl{}adding~some~changes~of~jim\textquotedbl{}}{\scriptsize \par}

{\scriptsize fossil:~would~fork. ~\textquotedbl{}update\textquotedbl{}~first~or~use~-f~or~-{}-force.}{\scriptsize \par}

{\scriptsize  }{\scriptsize \par}

{\scriptsize E:\textbackslash{}Profile\textbackslash{}Ratte\textbackslash{}data\textbackslash{}organize\textbackslash{}fossil-w32\textbackslash{}fossil-book>fossil~commit~-f~-m~\textquotedbl{}adding~some~other~changes~of~jim\textquotedbl{}}{\scriptsize \par}

{\scriptsize New\_Version:~df9f2ff6b14ef65a9dd2162f8bd20c78e1628165}{\scriptsize \par}
\end{lyxcode}
\caption{Forcing a commit under Windows}
\end{figure}


Now the timeline looks like:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Multiple_user/Windows/forked_timeline.epsf}

\caption{Windows Forked timeline}
\end{figure}


To remove this fork (i.e. get the changes Marilyn did into the trunk) we use the Fossil merge command. We can use the merge because fossilbook.lyx is a text file and the merge markers are designed to work with text files. If it was a binary file we might have to use an external file or copy and paste between the two file versions using the handler program for the file.

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize E:\textbackslash{}Profile\textbackslash{}Ratte\textbackslash{}data\textbackslash{}organize\textbackslash{}fossil-w32\textbackslash{}fossil-book>fossil~merge~a91582b699}{\scriptsize \par}

{\scriptsize MERGE~fossilbook.lyx}{\scriptsize \par}

{\scriptsize {*}{*}{*}{*}{*}~2~merge~conflicts~in~fossilbook.lyx}{\scriptsize \par}
\end{lyxcode}
\caption{Fossil Merge}
\end{figure}


Looking at the file (fossilbook.lyx) in a text editor (not \LyX{}) we find:

\begin{figure}[H]
\begin{lyxcode}
{\scriptsize >\textcompwordmark{}>\textcompwordmark{}>\textcompwordmark{}>\textcompwordmark{}>\textcompwordmark{}>\textcompwordmark{}>~BEGIN~MERGE~CONFLICT}{\scriptsize \par}

{\scriptsize  Thanks~to~Fossil's~distributed~design~once~the~set~up~is~done~using~it}{\scriptsize \par}

{\scriptsize  with~multiple~users~is~not~much~different~than~the~single~user~case.}{\scriptsize \par}

{\scriptsize  Fossil~will~automatically~manage~the~most~multiple~user~details.}{\scriptsize \par}

{\scriptsize ============================}{\scriptsize \par}

{\scriptsize  }{\scriptsize \par}

{\scriptsize  Thanks~to~Fossil's~distributed~design~once~the~set~up~is~done~using~is}{\scriptsize \par}

{\scriptsize  not~much~different~than~the~single~user~case~with~Fossil~managing~automatically}{\scriptsize \par}

{\scriptsize  the~multiple~user~details.}{\scriptsize \par}

{\scriptsize <\textcompwordmark{}<\textcompwordmark{}<\textcompwordmark{}<\textcompwordmark{}<\textcompwordmark{}<\textcompwordmark{}<~END~MERGE~CONFLICT}{\scriptsize \par}



\textbf{<Here~edit~in~the~changes>}



{\scriptsize E:\textbackslash{}Profile\textbackslash{}Ratte\textbackslash{}data\textbackslash{}organize\textbackslash{}fossil-w32\textbackslash{}fossil-book>fossil~commit~-m~\textquotedbl{}merging~marilyn's~fork~back\textquotedbl{}}{\scriptsize \par}

{\scriptsize New\_Version:~acdd676d3ab157769496f6845ccc7652985c1d03}{\scriptsize \par}
\end{lyxcode}
\caption{Text differences}
\end{figure}


After the commit the timeline shows how the merge brought the fork back into the main trunk. Marilyn will then have to update to this new trunk. (See Section \vref{sub:Updating-by-others})

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Multiple_user/Windows/merged_timeline.epsf}

\caption{Merged timeline}
\end{figure}



\section{Forks \& Branches}


\subsection{Introduction}

This chapter will cover forking and branching in Fossil. Forking is where you unintentially create two places to check into a repository. Branching is where you intentially do this because you want to maintain two or more versions of the code in the same repository. We illustrated forking and it's solutions in Section \vref{sub:Complications}. If, instead of fixing (merging) the file then doing the commit, we forced the commit, Fossil would fork the repository.

Forking is something to avoid because it creates two checkin paths for the code. Thus different users will be on different paths and can check in contradictory changes. Branches on the other hand are forks that you desire. These occur when you want to have two different versions of the code base in development at the same time. This was described in \vref{versioning} where you have a production verison of code under maintenance and a development version both served from the same repository. In this case development changes should only be checked into the development branch. Maintanence changes might have to be checked into both.

Instead of using the book repository for these examples we will use a JSON\cite{JSON}parser program that has a number of files and documentation. This will make it simpler to illustrate branching and tagging.

There is a good discussion of these topics on the Fossil Web site \url{http://www.fossil-scm.org/index.html/doc/tip/www/branching.wiki}.


\subsection{Forks, Branch \& Merge}

In this case the JSON code has just been placed in Fossil and two developers check out copies to work on. Jim wants to fix a number of compiler warnings that appear and Marilyn wants to fix the documentation. In both cases they proceeed as shown in Chapter \vref{sec:Multiple-Users}. The JSON code has been placed in a distributed location, each of them clones the repository, and opens a working copy of the code.


\subsubsection{Marilyn's Actions}

She looks through the documentation and finds a number of problems and fixes them (the documentation uses \LyX{} and PDF's). When she is satisfied with what she has done, she checks the current version of the documentation in:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Simple_Merge/sm_Marilyn.epsf}

\caption{\label{fig:Marilyn's-work}Marilyn's work}
\end{figure}



\subsubsection{Jim's Actions}

At the same time, Jim gets a working copy of version {[}6edbaf5fa8{]} of the code, puts in a ticket {[}d23bf4bbbb{]} as shown in Figure \ref{fig:Marilyn's-work}. After fixing the warnings, Jim is done and goes to commit. He does this AFTER Marilyn has done her commit.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize 551~jsonp>~}\textbf{\footnotesize fossil~commit~-m~\textquotedbl{}{[}d23bf4bbbb{]}~Remove~warnings\textquotedbl{}}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~~874~~~~~~~~~19~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~339~bytes~sent,~771~bytes~received}{\footnotesize \par}

{\footnotesize fossil:~would~fork.~~\textquotedbl{}update\textquotedbl{}~first~or~use~-f~or~-{}-force.}{\footnotesize \par}

{\footnotesize 552~jsonp>~}{\footnotesize \par}
\end{lyxcode}
\caption{Jim's commit attempt}


\end{figure}


At this point Fossil recognizes that Marilyn has changed the repository (she updated the documentation) but Jim does not have these changes because he checked out an earlier version of the code. Jim says he \textbf{must} get his changes in so he does a FORCE to force fossil to accept the commit.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize 552~jsonp>~}\textbf{\footnotesize fossil}{\footnotesize{}~}\textbf{\footnotesize commit~-m~\textquotedbl{}{[}d23bf4bbbb{]}~Remove~warnings\textquotedbl{}~-f}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~~874~~~~~~~~~19~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~338~bytes~sent,~771~bytes~received}{\footnotesize \par}

{\footnotesize New\_Version:~1beab955418a942ab9953c4865109ff46cbbd691}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~2646~~~~~~~~~25~~~~~~~~~~0~~~~~~~~~~4}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1058~~~~~~~~~23~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1498~bytes~sent,~864~bytes~received}{\footnotesize \par}

{\footnotesize {*}{*}{*}{*}~warning:~a~fork~has~occurred~{*}{*}{*}{*}{*}}{\footnotesize \par}
\end{lyxcode}
\caption{Forcing the commit}


\end{figure}


Looking at the timeline Jim sees this:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Simple_Merge/sm_jim_fork.epsf}

\caption{Repository Fork}


\end{figure}


Not good, there are two \textbf{Leaf}'s and Marilyn would commit code to her fork and Jim would be commiting code to his. So Jim must fix this by merging the code. Jim wants to merge versions {[}b72e96832e{]} of Marilyn and his {[}1beab85441{]}.


\subsubsection{Fixing the fork}

So Jim who's checked out code is from Leaf {[}1beab85441{]} does a merge with Marilyn's leaf {[}b72e96832e{]} like so:

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize 556~jsonp>~}\textbf{\footnotesize fossil~merge~b72e96832e}{\footnotesize \par}

{\footnotesize UPDATE~docs/qdj.lyx}{\footnotesize \par}

{\footnotesize UPDATE~docs/qdj.pdf}{\footnotesize \par}

{\footnotesize 557~jsonp>~}\textbf{\footnotesize fossil~status}{\footnotesize \par}

{\footnotesize repository:~~~/Users/jschimpf/Public/FOSSIL/jsonp.fossil}{\footnotesize \par}

{\footnotesize local-root:~~~/Users/jschimpf/Public/jsonp/}{\footnotesize \par}

{\footnotesize server-code:~~d3e7932b0b0f5e704264ba30adeae14978c08bc6}{\footnotesize \par}

{\footnotesize checkout:~~~~~1beab955418a942ab9953c4865109ff46cbbd691~2010-06-08~10:44:56~UTC}{\footnotesize \par}

{\footnotesize parent:~~~~~~~6edbaf5fa8e4d061c2e04e7fd481e7663b090bd3~2010-06-07~10:45:57~UTC}{\footnotesize \par}

{\footnotesize tags:~~~~~~~~~trunk}{\footnotesize \par}

{\footnotesize UPDATED\_BY\_MERGE~docs/qdj.lyx}{\footnotesize \par}

{\footnotesize UPDATED\_BY\_MERGE~docs/qdj.pdf}{\footnotesize \par}

{\footnotesize MERGED\_WITH~b72e96832e024f235696dcd6c5d0ddcc2cb38238}{\footnotesize \par}
\end{lyxcode}
\caption{\label{fig:Merge-Operation}Merge Operation}


\end{figure}


As shown the two documentation files are updated, there are no merge conflicts as Jim didn't touch these files and Marilyn didn't touch the code files.

Next Jim does a commit to make this new merged set of files the new trunk. Rememeber doing the merge shown in Figure \ref{fig:Merge-Operation} just updates your checked out code and does not change the repository till you check it in.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize 558~jsonp>~fossil~}\textbf{\footnotesize commit~-m~\textquotedbl{}After~merging~in~changes\textquotedbl{}}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1058~~~~~~~~~23~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~340~bytes~sent,~864~bytes~received}{\footnotesize \par}

{\footnotesize New\_Version:~3d73c03edee33cdc2e1bd8a47de57b7a6b6d880a}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~1737~~~~~~~~~26~~~~~~~~~~0~~~~~~~~~~1}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1104~~~~~~~~~24~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1101~bytes~sent,~888~bytes~received}{\footnotesize \par}

{\footnotesize 559~jsonp>~}{\footnotesize \par}
\end{lyxcode}
\caption{Commit after merge}


\end{figure}


When we look at the timeline we have a single leaf for future code commits.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Simple_Merge/sm_after_merge.epsf}

\caption{After merge timeline}


\end{figure}


The only other thing remaining is that Marilyn does an Update before proceeding so her checked out code matches the repository.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize WhiteBook:jsonp~marilyn\$~}\textbf{\footnotesize fossil~update}{\footnotesize \par}

{\footnotesize Autosync:~~http://Marilyn@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1150~~~~~~~~~25~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~412~~~~~~~~~~7~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~3274~~~~~~~~~31~~~~~~~~~~1~~~~~~~~~~5}{\footnotesize \par}

{\footnotesize Total~network~traffic:~843~bytes~sent,~2709~bytes~received}{\footnotesize \par}

{\footnotesize UPDATE~json-src/qdj\_token.c}{\footnotesize \par}

{\footnotesize UPDATE~json-src/qdj\_util.c}{\footnotesize \par}

{\footnotesize UPDATE~main.c}{\footnotesize \par}
\end{lyxcode}
\caption{Marilyn's Update}


\end{figure}



\subsubsection{Commands used}
\begin{itemize}
\item \textbf{fossil merge <fork>} Used to merge a fork (specified by hash value) to current check out. 
\item \textbf{fossil update <version>} Used to update current check out to specified version, if version not present use default tag for check out (see fossil status)
\end{itemize}

\subsection{Merge without fork}

In this case I will show how to merge in code changes from multiple users without causing a fork. In this case Marilyn has put in a BSD license text into all the code files while Jim is adding a help function to the code. In this case both of them put in tickets saying what they are doing but acting independently.


\subsubsection{Check in attempt}

Marilyn finished first and checks in her changes. Jim builds, tests and tries to check in his code and gets:

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize 502~jsonp>~}\textbf{\footnotesize make}{\footnotesize \par}

{\footnotesize /usr/bin/gcc~~main.c~-c~-I.~-Ijson-src~-o~obj/main.o}{\footnotesize \par}

{\footnotesize /usr/bin/gcc~~\textbackslash{}}{\footnotesize \par}

{\footnotesize 		obj/main.o\textbackslash{}}{\footnotesize \par}

{\footnotesize 		obj/qdj.o\textbackslash{}}{\footnotesize \par}

{\footnotesize 		obj/qdj\_util.o\textbackslash{}}{\footnotesize \par}

{\footnotesize 		obj/qdj\_token.o\textbackslash{}}{\footnotesize \par}

{\footnotesize 		-o~jsonp}{\footnotesize \par}



{\footnotesize 503~jsonp>~}\textbf{\footnotesize ./jsonp~-v}{\footnotesize \par}

{\footnotesize JSON~Test~Program~Ver:~{[}Jun~~9~2010{]}~{[}10:15:00{]}}{\footnotesize \par}

{\footnotesize SYNTAX:~jsonp~-i~<json~text~file>~{[}-v{]}}{\footnotesize \par}

{\footnotesize -i~<json~text~file>~~~Show~parse~of~JSON}{\footnotesize \par}

{\footnotesize -v~~~~~~~~~~~~~~~~~~~~Show~help}{\footnotesize \par}



{\footnotesize 506~jsonp>~}\textbf{\footnotesize fossil~commit~-m~\textquotedbl{}{[}fed383fa1a{]}~Add~help~to~cmd~line\textquotedbl{}}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1656~~~~~~~~~36~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~647~~~~~~~~~12~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~14039~~~~~~~~~47~~~~~~~~~~4~~~~~~~~~~7}{\footnotesize \par}

{\footnotesize Total~network~traffic:~942~bytes~sent,~4537~bytes~received}{\footnotesize \par}

{\footnotesize fossil:~would~fork.~~\textquotedbl{}update\textquotedbl{}~first~or~use~-f~or~-{}-force.}{\footnotesize \par}
\end{lyxcode}
\caption{Jim's check in attempt}


\end{figure}



\subsubsection{Update}

The next action Jim takes is to do the update but without doing changes, using the -n flag which tells it to just show what's going to happen without making any file changes.

\begin{figure}[H]
\begin{lyxcode}
507~jsonp>~\textbf{fossil~update~-n}

UPDATE~json-src/qdj.c

UPDATE~json-src/qdj.h

UPDATE~json-src/qdj\_token.c

UPDATE~json-src/qdj\_token.h

UPDATE~json-src/qdj\_util.c

MERGE~main.c
\end{lyxcode}
\caption{Update dry run}


\end{figure}


This shows some files will be updated, i.e. be replaced by new text from the repository. The main.c file will be merged with the version from the repository. That is text from the repository will be mixed with the text from Jim's modified file. Note that it says \textbf{MERGE} meaning the two sets of text are a disjoint set. This means the merge can all be done by Fossil with no human intervention.

Jim can just do the update for real then commit the merged files to make a new leaf. So now we have Marilyn's and Jim changes combined in the lastest version. 

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/file_merge/merge.epsf}

\caption{Merged repository}


\end{figure}



\subsubsection{Commands used}
\begin{itemize}
\item \textbf{fossil update -n} Does a dry run of an update to show what files will changed.

\begin{itemize}
\item UPDATE Implies file will be replaced by repository file
\item MERGE Implies file will be mixed text from repository and check out
\end{itemize}
\end{itemize}

\subsection{Branching}


\subsubsection{Introduction}

We have discussed this before but branching is the intential splitting of the code in the repository into multiple paths. This will usually be done with production code where we have maintenance branch and a development branch. The maintenance branch is in use and would get bug fixes based on experience. The development branch would get those changes if applicable plus be modified to add features.

The JSON code parser has been tested and works so will be released to general use. Also we wish to modify it to add support for UTF-8 characters so it matches the JSON standard. The current version just works with ASCII 7 bit characters which is not standard. We wish to split the code into a VER\_1.0 branch which is the current code in use and VER\_2.0 branch which will add UTF-8 character support.


\subsubsection{Branch the repository}

Before proceeding we will make sure we have the current trunk code in our check out. 

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp{]}~jim\%~}\textbf{\footnotesize fossil~status}{\footnotesize \par}

{\footnotesize repository:~/Users/jschimpf/Public/FOSSIL/jsonp.fossil}{\footnotesize \par}

{\footnotesize local-root:~/Users/jschimpf/Public/jsonp/}{\footnotesize \par}

{\footnotesize server-code:~90c80f1a2da7360dae230ccec65ff82fe2eb160d}{\footnotesize \par}

{\footnotesize checkout:~}\textbf{\footnotesize 462156b283}{\footnotesize b694af0b99c9b446b64d3f77436fbb~2010-06-09~14:16:42~UTC}{\footnotesize \par}

{\footnotesize parent:~fbb16491e2ff9f9ca3a98adffa167de1b6903a44~2010-06-09~14:02:28~UTC}{\footnotesize \par}

\textbf{\footnotesize tags:~trunk}{\footnotesize \par}
\end{lyxcode}
\caption{Checking code status}
\end{figure}


Seeing that matches the latest leaf in the time line we can proceed to branch the code.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp{]}~jim\%~}\textbf{\footnotesize fossil~branch~new~VER\_1.0~trunk~-bgcolor~0xFFC0FF}{\footnotesize \par}

{\footnotesize sh:~gpg:~command~not~found}{\footnotesize \par}

{\footnotesize unable~to~sign~manifest.~~continue~(y/N)?~y}{\footnotesize \par}

{\footnotesize New~branch:~65e1f48633d691a5ea738cd51ccbf9a581dfb3c7}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~2391~~~~~~~~~42~~~~~~~~~~0~~~~~~~~~~1}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1840~~~~~~~~~40~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1524~bytes~sent,~1272~bytes~received}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp{]}~jim\%~}\textbf{\footnotesize fossil~branch~new~VER\_2.0~trunk~-bgcolor~0xC0F0FF}{\footnotesize \par}

{\footnotesize sh:~gpg:~command~not~found}{\footnotesize \par}

{\footnotesize unable~to~sign~manifest.~~continue~(y/N)?~y}{\footnotesize \par}

{\footnotesize New~branch:~a1737916ec2df696a0f3a7e36edf9ba4370e48a7}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~2437~~~~~~~~~43~~~~~~~~~~0~~~~~~~~~~1}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~1886~~~~~~~~~41~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1550~bytes~sent,~1271~bytes~received}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp{]}~jim\%~}{\footnotesize \par}
\end{lyxcode}
\caption{Branch commands\label{fig:Branch-commands}}
\end{figure}


What was just done. We used the Fossil branch command to create two branches VER\_1.0 and VER\_2.0 and assigned each of them a color. We can see the timeline is now:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Branching/branch.epsf}

\caption{Branch Timeline}
\end{figure}



\subsubsection{Color Setup}

As you see above the two branches have different colors in the timeline. This was due to the \textbf{-bgcolor} option added when we created each branch. (See Figure \ref{fig:Branch-commands}). But we want this color to appear on subsequent checkins of each of these branches. To make that happen we have to set the options using the UI and picking a particular leaf on the timeline.

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Branching/color_setup.epsf}

\caption{Setting Timeline color}


\end{figure}


Under the \textbf{Background Color} section I have checked \textbf{Propagate color to descendants }so future checkins will have the same color.


\subsubsection{Check out the branches}

Now the the repository is branched we can check out the two sets of code into different directories. We create jsonp1 and jsonp2 and proceed to open the different branches into them.

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp1{]}~}\textbf{\footnotesize jim\%~fossil~open~../FOSSIL/jsonp.fossil~VER\_1.0}{\footnotesize \par}

{\footnotesize docs/qdj.lyx}{\footnotesize \par}

{\footnotesize docs/qdj.pdf}{\footnotesize \par}

{\footnotesize json-src/qdj.c}{\footnotesize \par}

{\footnotesize json-src/qdj.h}{\footnotesize \par}

{\footnotesize json-src/qdj\_token.c}{\footnotesize \par}

{\footnotesize json-src/qdj\_token.h}{\footnotesize \par}

{\footnotesize json-src/qdj\_util.c}{\footnotesize \par}

{\footnotesize main.c}{\footnotesize \par}

{\footnotesize makefile}{\footnotesize \par}

{\footnotesize obj/test.txt}{\footnotesize \par}

{\footnotesize test.txt}{\footnotesize \par}

{\footnotesize project-name:~JASONP}{\footnotesize \par}

{\footnotesize repository:~~~/Users/jschimpf/Public/FOSSIL/jsonp.fossil}{\footnotesize \par}

{\footnotesize local-root:~~~/Users/jschimpf/Public/jsonp1/}{\footnotesize \par}

{\footnotesize project-code:~eb6084c8ab115cf2b28a129c7183731002c6143a}{\footnotesize \par}

{\footnotesize server-code:~~90c80f1a2da7360dae230ccec65ff82fe2eb160d}{\footnotesize \par}

{\footnotesize checkout:~~~~~65e1f48633d691a5ea738cd51ccbf9a581dfb3c7~2010-06-13~10:13:55~UTC}{\footnotesize \par}

{\footnotesize parent:~~~~~~~462156b283b694af0b99c9b446b64d3f77436fbb~2010-06-09~14:16:42~UTC}{\footnotesize \par}

{\footnotesize tags:~~~~~~~~~}\textbf{\footnotesize VER\_1.0}{\footnotesize \par}
\end{lyxcode}
\caption{Check out VER\_1.0}
\end{figure}


Checking out VER\_2.0 in the same way

\begin{figure}[H]
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp2{]}~jim\%~}\textbf{\footnotesize fossil~open~../FOSSIL/jsonp.fossil~VER\_2.0}{\footnotesize \par}

{\footnotesize docs/qdj.lyx}{\footnotesize \par}

{\footnotesize docs/qdj.pdf}{\footnotesize \par}

{\footnotesize json-src/qdj.c}{\footnotesize \par}

{\footnotesize json-src/qdj.h}{\footnotesize \par}

{\footnotesize json-src/qdj\_token.c}{\footnotesize \par}

{\footnotesize json-src/qdj\_token.h}{\footnotesize \par}

{\footnotesize json-src/qdj\_util.c}{\footnotesize \par}

{\footnotesize main.c}{\footnotesize \par}

{\footnotesize makefile}{\footnotesize \par}

{\footnotesize obj/test.txt}{\footnotesize \par}

{\footnotesize test.txt}{\footnotesize \par}

{\footnotesize project-name:~JASONP}{\footnotesize \par}

{\footnotesize repository:~~~/Users/jschimpf/Public/FOSSIL/jsonp.fossil}{\footnotesize \par}

{\footnotesize local-root:~~~/Users/jschimpf/Public/jsonp2/}{\footnotesize \par}

{\footnotesize project-code:~eb6084c8ab115cf2b28a129c7183731002c6143a}{\footnotesize \par}

{\footnotesize server-code:~~90c80f1a2da7360dae230ccec65ff82fe2eb160d}{\footnotesize \par}

{\footnotesize checkout:~~~~~a1737916ec2df696a0f3a7e36edf9ba4370e48a7~2010-06-13~10:14:26~UTC}{\footnotesize \par}

{\footnotesize parent:~~~~~~~462156b283b694af0b99c9b446b64d3f77436fbb~2010-06-09~14:16:42~UTC}{\footnotesize \par}

{\footnotesize tags:~~~~~~~~~}\textbf{\footnotesize VER\_2.0}{\footnotesize \par}
\end{lyxcode}
\caption{VER\_2.0 checkout}
\end{figure}


Notice on both of these the tags show which branch we are attached to.


\subsubsection{Correcting errors (in both)}

After doing this work I found that the main.c file had a warning about an unused variable. I wanted to correct this in both branches. At this point all the files in both branches are the same so correcting the file in either branch and copying it to the other is possible. I put in a ticket for the change and edit main.c. I copy it to both checkouts for the both branches and then check both in.

\begin{figure}
\begin{lyxcode}
{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp1{]}~jim\%~}\textbf{\footnotesize fossil~commit~-m~\textquotedbl{}{[}2795e6c74d{]}~Fix~unused~variable\textquotedbl{}}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~2116~~~~~~~~~46~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~365~~~~~~~~~~6~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~3601~~~~~~~~~51~~~~~~~~~~5~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~805~bytes~sent,~3464~bytes~received}{\footnotesize \par}

{\footnotesize New\_Version:~3b902585d0e8849399286139d27676c5a349de7b}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~3034~~~~~~~~~50~~~~~~~~~~0~~~~~~~~~~2}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~2208~~~~~~~~~48~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1848~bytes~sent,~1444~bytes~received}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp1{]}~jim\%~}\textbf{\footnotesize cd~..}{\footnotesize \par}

{\footnotesize {[}Pandora-2:/Users/jschimpf/Public{]}~jim\%~}\textbf{\footnotesize cd~jsonp2}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp2{]}~jim\%~}\textbf{\footnotesize cp~../jsonp1/main.c~.}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp2{]}~jim\%~}\textbf{\footnotesize fossil~status}{\footnotesize \par}

{\footnotesize repository:~~~/Users/jschimpf/Public/FOSSIL/jsonp.fossil}{\footnotesize \par}

{\footnotesize local-root:~~~/Users/jschimpf/Public/jsonp2/}{\footnotesize \par}

{\footnotesize server-code:~~90c80f1a2da7360dae230ccec65ff82fe2eb160d}{\footnotesize \par}

{\footnotesize checkout:~~~~~a1737916ec2df696a0f3a7e36edf9ba4370e48a7~2010-06-13~10:14:26~UTC}{\footnotesize \par}

{\footnotesize parent:~~~~~~~462156b283b694af0b99c9b446b64d3f77436fbb~2010-06-09~14:16:42~UTC}{\footnotesize \par}

{\footnotesize tags:~~~~~~~~~VER\_2.0}{\footnotesize \par}

{\footnotesize EDITED~~~~~main.c}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp2{]}~jim\%~}\textbf{\footnotesize fossil~commit~-m~\textquotedbl{}{[}2795e6c74d{]}~Fix~unused~variable\textquotedbl{}}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~130~~~~~~~~~~1~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~2392~~~~~~~~~52~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~~318~~~~~~~~~~5~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~3320~~~~~~~~~56~~~~~~~~~~4~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~781~bytes~sent,~3508~bytes~received}{\footnotesize \par}

{\footnotesize New\_Version:~762a31854d708080678598c8d4ce28465cbee8c5}{\footnotesize \par}

{\footnotesize Autosync:~~http://jim@pandora.dyn-o-saur.com:8080/cgi-bin/jsonp.cgi}{\footnotesize \par}

{\footnotesize{}~~~~~~~~~~~~~~~~Bytes~~~~~~Cards~~Artifacts~~~~~Deltas}{\footnotesize \par}

{\footnotesize Send:~~~~~~~~~~~~3253~~~~~~~~~55~~~~~~~~~~0~~~~~~~~~~2}{\footnotesize \par}

{\footnotesize Received:~~~~~~~~2438~~~~~~~~~53~~~~~~~~~~0~~~~~~~~~~0}{\footnotesize \par}

{\footnotesize Total~network~traffic:~1972~bytes~sent,~1573~bytes~received}{\footnotesize \par}

{\footnotesize {[}Pandora-2:jschimpf/Public/jsonp2{]}~jim\%~}{\footnotesize \par}
\end{lyxcode}
\caption{Fixing both branches}


\end{figure}


Now the timeline looks like this:

\begin{figure}[H]
\includegraphics[scale=0.6]{Images/Advanced/Branching/current_state.epsf}

\caption{Correcting both branches}


\end{figure}



\subsubsection{Commands used}
\begin{itemize}
\item \textbf{fossil branch }Used to generate a branch of the repository. The command can optionally color the branch in the display.
\end{itemize}

\section{Fossil Commands}


\subsection{Introduction}

This section will go through the various Fossil command line commands. This will be divided into sections, the first will detail the must know commands. These are the ones you will be using all the time and will probably have memorized in short order. The other commands will be divided into Maintenance, Advanced, and Miscellaneous. These you will probably be checking as reference before use.

The most important command is \textbf{help}. You can always type \textbf{fossil help} at the command line and it will list out all the commands it has. Then typing f\textbf{ossil help <command> }will print out the detailed information on that command. You always have that as your reference. This section of the book will try to supplement the built in help with some examples and further explanation of what a command does. All of the commands will be placed in the index for easy searching

\textbf{NOTE:} Fossil is a moving target, commands might be added and others removed future versions. Type \textbf{fossil help }on your version to get the latest list. The following applies to the fossil I used when I wrote this and your version might be different.


\subsection{Basic Commands}


\subsubsection{help\index{help}}

This command is used to dump the current command set and version of Fossil. It can also be used in the form \textbf{fossil help <command> }to get further information on any command.

\begin{figure}[H]
\noindent \begin{centering}
\includegraphics{Images/Commands/help1.epsf}
\par\end{centering}

\caption{Help run}


\end{figure}


Using it to get further information about a particular command

\begin{figure}[H]