Fossil SCM

The markdown formatter is now always turned on and cannot be omitted. Add the ability to store mimetype information in control artifacts. Add the --mimetype option to the "commit" command. As the new N-cards used to store mimetype will not be recognized by older fossils, it is recommended that no use be made of mimetype until all users have upgraded.

drh 2013-04-01 13:59 trunk merge
Commit 4dcea802366a8af81679fb86db16b62d2469b35c
+1 -3
--- auto.def
+++ auto.def
@@ -11,11 +11,10 @@
1111
internal-sqlite=1 => {Don't use the internal sqlite, use the system one}
1212
static=0 => {Link a static executable}
1313
lineedit=1 => {Disable line editing}
1414
fossil-debug=0 => {Build with fossil debugging enabled}
1515
json=0 => {Build with fossil JSON API enabled}
16
- markdown=0 => {Build with markdown engine enabled}
1716
}
1817
1918
# sqlite wants these types if possible
2019
cc-with {-includes {stdint.h inttypes.h}} {
2120
cc-check-types uint32_t uint16_t int16_t uint8_t
@@ -76,12 +75,11 @@
7675
define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON
7776
define FOSSIL_ENABLE_JSON
7877
}
7978
8079
if {[opt-bool markdown]} {
81
- define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_MARKDOWN
82
- define FOSSIL_ENABLE_MARKDOWN
80
+ # no-op. Markdown is now enabled by default.
8381
}
8482
8583
if {[opt-bool static]} {
8684
# XXX: This will not work on all systems.
8785
define-append EXTRA_LDFLAGS -static
8886
--- auto.def
+++ auto.def
@@ -11,11 +11,10 @@
11 internal-sqlite=1 => {Don't use the internal sqlite, use the system one}
12 static=0 => {Link a static executable}
13 lineedit=1 => {Disable line editing}
14 fossil-debug=0 => {Build with fossil debugging enabled}
15 json=0 => {Build with fossil JSON API enabled}
16 markdown=0 => {Build with markdown engine enabled}
17 }
18
19 # sqlite wants these types if possible
20 cc-with {-includes {stdint.h inttypes.h}} {
21 cc-check-types uint32_t uint16_t int16_t uint8_t
@@ -76,12 +75,11 @@
76 define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON
77 define FOSSIL_ENABLE_JSON
78 }
79
80 if {[opt-bool markdown]} {
81 define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_MARKDOWN
82 define FOSSIL_ENABLE_MARKDOWN
83 }
84
85 if {[opt-bool static]} {
86 # XXX: This will not work on all systems.
87 define-append EXTRA_LDFLAGS -static
88
--- auto.def
+++ auto.def
@@ -11,11 +11,10 @@
11 internal-sqlite=1 => {Don't use the internal sqlite, use the system one}
12 static=0 => {Link a static executable}
13 lineedit=1 => {Disable line editing}
14 fossil-debug=0 => {Build with fossil debugging enabled}
15 json=0 => {Build with fossil JSON API enabled}
 
16 }
17
18 # sqlite wants these types if possible
19 cc-with {-includes {stdint.h inttypes.h}} {
20 cc-check-types uint32_t uint16_t int16_t uint8_t
@@ -76,12 +75,11 @@
75 define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON
76 define FOSSIL_ENABLE_JSON
77 }
78
79 if {[opt-bool markdown]} {
80 # no-op. Markdown is now enabled by default.
 
81 }
82
83 if {[opt-bool static]} {
84 # XXX: This will not work on all systems.
85 define-append EXTRA_LDFLAGS -static
86
+76 -52
--- src/checkin.c
+++ src/checkin.c
@@ -565,13 +565,12 @@
565565
** parent_rid is the recordid of the parent check-in.
566566
*/
567567
static void prepare_commit_comment(
568568
Blob *pComment,
569569
char *zInit,
570
- const char *zBranch,
571
- int parent_rid,
572
- const char *zUserOvrd
570
+ CheckinInfo *p,
571
+ int parent_rid
573572
){
574573
Blob prompt;
575574
#ifdef _WIN32
576575
int bomSize;
577576
const unsigned char *bom = get_utf8_bom(&bomSize);
@@ -585,13 +584,13 @@
585584
blob_append(&prompt,
586585
"\n"
587586
"# Enter comments on this check-in. Lines beginning with # are ignored.\n"
588587
"#\n", -1
589588
);
590
- blob_appendf(&prompt, "# user: %s\n", zUserOvrd ? zUserOvrd : g.zLogin);
591
- if( zBranch && zBranch[0] ){
592
- blob_appendf(&prompt, "# tags: %s\n#\n", zBranch);
589
+ blob_appendf(&prompt, "# user: %s\n", p->zUserOvrd ? p->zUserOvrd : g.zLogin);
590
+ if( p->zBranch && p->zBranch[0] ){
591
+ blob_appendf(&prompt, "# tags: %s\n#\n", p->zBranch);
593592
}else{
594593
char *zTags = info_tags_of_checkin(parent_rid, 1);
595594
if( zTags ) blob_appendf(&prompt, "# tags: %z\n#\n", zTags);
596595
}
597596
status_report(&prompt, "# ", 1, 0);
@@ -706,28 +705,39 @@
706705
for(i=2; i<g.argc; i++){
707706
fossil_print("%s -> %s\n", g.argv[i], date_in_standard_format(g.argv[i]));
708707
}
709708
}
710709
710
+#if INTERFACE
711
+/*
712
+** The following structure holds some of the information needed to construct a
713
+** check-in manifest.
714
+*/
715
+struct CheckinInfo {
716
+ Blob *pComment; /* Check-in comment text */
717
+ const char *zMimetype; /* Mimetype of check-in command. May be NULL */
718
+ int verifyDate; /* Verify that child is younger */
719
+ Blob *pCksum; /* Repository checksum. May be 0 */
720
+ const char *zDateOvrd; /* Date override. If 0 then use 'now' */
721
+ const char *zUserOvrd; /* User override. If 0 then use g.zLogin */
722
+ const char *zBranch; /* Branch name. May be 0 */
723
+ const char *zColor; /* One-time background color. May be 0 */
724
+ const char *zBrClr; /* Persistent branch color. May be 0 */
725
+ const char **azTag; /* Tags to apply to this check-in */
726
+};
727
+#endif /* INTERFACE */
728
+
711729
/*
712730
** Create a manifest.
713731
*/
714732
static void create_manifest(
715733
Blob *pOut, /* Write the manifest here */
716734
const char *zBaselineUuid, /* UUID of baseline, or zero */
717735
Manifest *pBaseline, /* Make it a delta manifest if not zero */
718
- Blob *pComment, /* Check-in comment text */
719
- int vid, /* blob-id of the parent manifest */
720
- int verifyDate, /* Verify that child is younger */
721
- Blob *pCksum, /* Repository checksum. May be 0 */
722
- const char *zDateOvrd, /* Date override. If 0 then use 'now' */
723
- const char *zUserOvrd, /* User override. If 0 then use g.zLogin */
724
- const char *zBranch, /* Branch name. May be 0 */
725
- const char *zColor, /* One-time background color. May be 0 */
726
- const char *zBrClr, /* Persistent branch color. May be 0 */
727
- const char **azTag, /* Tags to apply to this check-in */
728
- int *pnFBcard /* Number of generated B- and F-cards */
736
+ int vid, /* BLOB.id for the parent check-in */
737
+ CheckinInfo *p, /* Information about the check-in */
738
+ int *pnFBcard /* OUT: Number of generated B- and F-cards */
729739
){
730740
char *zDate; /* Date of the check-in */
731741
char *zParentUuid; /* UUID of parent check-in */
732742
Blob filename; /* A single filename */
733743
int nBasename; /* Size of base filename */
@@ -735,10 +745,11 @@
735745
Stmt q2; /* Query of merge parents */
736746
Blob mcksum; /* Manifest checksum */
737747
ManifestFile *pFile; /* File from the baseline */
738748
int nFBcard = 0; /* Number of B-cards and F-cards */
739749
int i; /* Loop counter */
750
+ const char *zColor; /* Modified value of p->zColor */
740751
741752
assert( pBaseline==0 || pBaseline->zBaseline==0 );
742753
assert( pBaseline==0 || zBaselineUuid!=0 );
743754
blob_zero(pOut);
744755
zParentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
@@ -748,12 +759,12 @@
748759
pFile = manifest_file_next(pBaseline, 0);
749760
nFBcard++;
750761
}else{
751762
pFile = 0;
752763
}
753
- blob_appendf(pOut, "C %F\n", blob_str(pComment));
754
- zDate = date_in_standard_format(zDateOvrd ? zDateOvrd : "now");
764
+ blob_appendf(pOut, "C %F\n", blob_str(p->pComment));
765
+ zDate = date_in_standard_format(p->zDateOvrd ? p->zDateOvrd : "now");
755766
blob_appendf(pOut, "D %s\n", zDate);
756767
zDate[10] = ' ';
757768
db_prepare(&q,
758769
"SELECT pathname, uuid, origname, blob.rid, isexe, islink,"
759770
" is_selected(vfile.id)"
@@ -827,67 +838,72 @@
827838
while( pFile ){
828839
blob_appendf(pOut, "F %F\n", pFile->zName);
829840
pFile = manifest_file_next(pBaseline, 0);
830841
nFBcard++;
831842
}
843
+ if( p->zMimetype && p->zMimetype[0] ){
844
+ blob_appendf(pOut, "N %F\n", p->zMimetype);
845
+ }
832846
blob_appendf(pOut, "P %s", zParentUuid);
833
- if( verifyDate ) checkin_verify_younger(vid, zParentUuid, zDate);
847
+ if( p->verifyDate ) checkin_verify_younger(vid, zParentUuid, zDate);
834848
free(zParentUuid);
835849
db_prepare(&q2, "SELECT merge FROM vmerge WHERE id=0");
836850
while( db_step(&q2)==SQLITE_ROW ){
837851
char *zMergeUuid;
838852
int mid = db_column_int(&q2, 0);
839853
if( !g.markPrivate && content_is_private(mid) ) continue;
840854
zMergeUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", mid);
841855
if( zMergeUuid ){
842856
blob_appendf(pOut, " %s", zMergeUuid);
843
- if( verifyDate ) checkin_verify_younger(mid, zMergeUuid, zDate);
857
+ if( p->verifyDate ) checkin_verify_younger(mid, zMergeUuid, zDate);
844858
free(zMergeUuid);
845859
}
846860
}
847861
db_finalize(&q2);
848862
free(zDate);
849863
850864
blob_appendf(pOut, "\n");
851
- if( pCksum ) blob_appendf(pOut, "R %b\n", pCksum);
852
- if( zBranch && zBranch[0] ){
865
+ if( p->pCksum ) blob_appendf(pOut, "R %b\n", p->pCksum);
866
+ zColor = p->zColor;
867
+ if( p->zBranch && p->zBranch[0] ){
853868
/* Set tags for the new branch */
854
- if( zBrClr && zBrClr[0] ){
869
+ if( p->zBrClr && p->zBrClr[0] ){
855870
zColor = 0;
856
- blob_appendf(pOut, "T *bgcolor * %F\n", zBrClr);
871
+ blob_appendf(pOut, "T *bgcolor * %F\n", p->zBrClr);
857872
}
858
- blob_appendf(pOut, "T *branch * %F\n", zBranch);
859
- blob_appendf(pOut, "T *sym-%F *\n", zBranch);
873
+ blob_appendf(pOut, "T *branch * %F\n", p->zBranch);
874
+ blob_appendf(pOut, "T *sym-%F *\n", p->zBranch);
860875
}
861876
if( zColor && zColor[0] ){
862877
/* One-time background color */
863878
blob_appendf(pOut, "T +bgcolor * %F\n", zColor);
864879
}
865
- if( azTag ){
866
- for(i=0; azTag[i]; i++){
880
+ if( p->azTag ){
881
+ for(i=0; p->azTag[i]; i++){
867882
/* Add a symbolic tag to this check-in. The tag names have already
868883
** been sorted and converted using the %F format */
869
- blob_appendf(pOut, "T +sym-%s *\n", azTag[i]);
884
+ assert( i==0 || strcmp(p->azTag[i-1], p->azTag[i])<=0 );
885
+ blob_appendf(pOut, "T +sym-%s *\n", p->azTag[i]);
870886
}
871887
}
872
- if( zBranch && zBranch[0] ){
888
+ if( p->zBranch && p->zBranch[0] ){
873889
/* For a new branch, cancel all prior propagating tags */
874890
Stmt q;
875891
db_prepare(&q,
876892
"SELECT tagname FROM tagxref, tag"
877893
" WHERE tagxref.rid=%d AND tagxref.tagid=tag.tagid"
878894
" AND tagtype==2 AND tagname GLOB 'sym-*'"
879895
" AND tagname!='sym-'||%Q"
880896
" ORDER BY tagname",
881
- vid, zBranch);
897
+ vid, p->zBranch);
882898
while( db_step(&q)==SQLITE_ROW ){
883899
const char *zBrTag = db_column_text(&q, 0);
884900
blob_appendf(pOut, "T -%F *\n", zBrTag);
885901
}
886902
db_finalize(&q);
887903
}
888
- blob_appendf(pOut, "U %F\n", zUserOvrd ? zUserOvrd : g.zLogin);
904
+ blob_appendf(pOut, "U %F\n", p->zUserOvrd ? p->zUserOvrd : g.zLogin);
889905
md5sum_blob(pOut, &mcksum);
890906
blob_appendf(pOut, "Z %b\n", &mcksum);
891907
if( pnFBcard ) *pnFBcard = nFBcard;
892908
}
893909
@@ -1092,10 +1108,11 @@
10921108
** --branch NEW-BRANCH-NAME check in to this new branch
10931109
** --branchcolor COLOR apply given COLOR to the branch
10941110
** --comment|-m COMMENT-TEXT use COMMENT-TEXT as commit comment
10951111
** --delta use a delta manifest in the commit process
10961112
** --message-file|-M FILE read the commit comment from given file
1113
+** --mimetype MIMETYPE mimetype of check-in comment
10971114
** --no-warnings omit all warnings about file contents
10981115
** --nosign do not attempt to sign this commit with gpg
10991116
** --private do not sync changes and their descendants
11001117
** --tag TAG-NAME assign given tag TAG-NAME to the checkin
11011118
**
@@ -1122,15 +1139,11 @@
11221139
int allowOlder = 0; /* Allow a commit older than its ancestor */
11231140
char *zManifestFile; /* Name of the manifest file */
11241141
int useCksum; /* True if checksums should be computed and verified */
11251142
int outputManifest; /* True to output "manifest" and "manifest.uuid" */
11261143
int testRun; /* True for a test run. Debugging only */
1127
- const char *zBranch; /* Create a new branch with this name */
1128
- const char *zBrClr; /* Set background color when branching */
1129
- const char *zColor; /* One-time check-in color */
1130
- const char *zDateOvrd; /* Override date string */
1131
- const char *zUserOvrd; /* Override user name */
1144
+ CheckinInfo sCiInfo; /* Information about this check-in */
11321145
const char *zComFile; /* Read commit message from this file */
11331146
int nTag = 0; /* Number of --tag arguments */
11341147
const char *zTag; /* A single --tag argument */
11351148
const char **azTag = 0;/* Array of all --tag arguments */
11361149
Blob manifest; /* Manifest in baseline form */
@@ -1142,10 +1155,11 @@
11421155
int nConflict = 0; /* Number of unresolved merge conflicts */
11431156
int abortCommit = 0;
11441157
Blob ans;
11451158
char cReply;
11461159
1160
+ memset(&sCiInfo, 0, sizeof(sCiInfo));
11471161
url_proxy_options();
11481162
noSign = find_option("nosign",0,0)!=0;
11491163
forceDelta = find_option("delta",0,0)!=0;
11501164
forceBaseline = find_option("baseline",0,0)!=0;
11511165
if( forceDelta && forceBaseline ){
@@ -1157,27 +1171,30 @@
11571171
allowConflict = find_option("allow-conflict",0,0)!=0;
11581172
allowEmpty = find_option("allow-empty",0,0)!=0;
11591173
allowFork = find_option("allow-fork",0,0)!=0;
11601174
allowOlder = find_option("allow-older",0,0)!=0;
11611175
noWarningFlag = find_option("no-warnings", 0, 0)!=0;
1162
- zBranch = find_option("branch","b",1);
1163
- zColor = find_option("bgcolor",0,1);
1164
- zBrClr = find_option("branchcolor",0,1);
1176
+ sCiInfo.zBranch = find_option("branch","b",1);
1177
+ sCiInfo.zColor = find_option("bgcolor",0,1);
1178
+ sCiInfo.zBrClr = find_option("branchcolor",0,1);
1179
+ sCiInfo.zMimetype = find_option("mimetype",0,1);
11651180
while( (zTag = find_option("tag",0,1))!=0 ){
11661181
if( zTag[0]==0 ) continue;
1167
- azTag = fossil_realloc((void *)azTag, sizeof(char*)*(nTag+2));
1168
- azTag[nTag++] = zTag;
1169
- azTag[nTag] = 0;
1182
+ sCiInfo.azTag = fossil_realloc((void*)sCiInfo.azTag, sizeof(char*)*(nTag+2));
1183
+ sCiInfo.azTag[nTag++] = zTag;
1184
+ sCiInfo.azTag[nTag] = 0;
11701185
}
11711186
zComFile = find_option("message-file", "M", 1);
11721187
if( find_option("private",0,0) ){
11731188
g.markPrivate = 1;
1174
- if( zBranch==0 ) zBranch = "private";
1175
- if( zBrClr==0 && zColor==0 ) zBrClr = "#fec084"; /* Orange */
1189
+ if( sCiInfo.zBranch==0 ) sCiInfo.zBranch = "private";
1190
+ if( sCiInfo.zBrClr==0 && sCiInfo.zColor==0 ){
1191
+ sCiInfo.zBrClr = "#fec084"; /* Orange */
1192
+ }
11761193
}
1177
- zDateOvrd = find_option("date-override",0,1);
1178
- zUserOvrd = find_option("user-override",0,1);
1194
+ sCiInfo.zDateOvrd = find_option("date-override",0,1);
1195
+ sCiInfo.zUserOvrd = find_option("user-override",0,1);
11791196
db_must_be_within_tree();
11801197
noSign = db_get_boolean("omitsign", 0)|noSign;
11811198
if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
11821199
useCksum = db_get_boolean("repo-cksum", 1);
11831200
outputManifest = db_get_boolean("manifest", 0);
@@ -1309,11 +1326,11 @@
13091326
13101327
/*
13111328
** Do not allow a commit that will cause a fork unless the --allow-fork
13121329
** or --force flags is used, or unless this is a private check-in.
13131330
*/
1314
- if( zBranch==0 && allowFork==0 && forceFlag==0
1331
+ if( sCiInfo.zBranch==0 && allowFork==0 && forceFlag==0
13151332
&& g.markPrivate==0 && !is_a_leaf(vid)
13161333
){
13171334
fossil_fatal("would fork. \"update\" first or use --allow-fork.");
13181335
}
13191336
@@ -1334,11 +1351,11 @@
13341351
blob_zero(&comment);
13351352
blob_read_from_file(&comment, zComFile);
13361353
blob_to_utf8_no_bom(&comment, 1);
13371354
}else{
13381355
char *zInit = db_text(0, "SELECT value FROM vvar WHERE name='ci-comment'");
1339
- prepare_commit_comment(&comment, zInit, zBranch, vid, zUserOvrd);
1356
+ prepare_commit_comment(&comment, zInit, &sCiInfo, vid);
13401357
if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){
13411358
blob_zero(&ans);
13421359
prompt_user("unchanged check-in comment. continue (y/N)? ", &ans);
13431360
cReply = blob_str(&ans)[0];
13441361
if( cReply!='y' && cReply!='Y' ) fossil_exit(1);;
@@ -1424,17 +1441,21 @@
14241441
14251442
/* Create the new manifest */
14261443
if( blob_size(&comment)==0 ){
14271444
blob_append(&comment, "(no comment)", -1);
14281445
}
1446
+ sCiInfo.pComment = &comment;
1447
+ sCiInfo.pCksum = useCksum ? &cksum1 : 0;
14291448
if( forceDelta ){
14301449
blob_zero(&manifest);
14311450
}else{
1432
- create_manifest(&manifest, 0, 0, &comment, vid,
1451
+ create_manifest(&manifest, 0, 0, vid, &sCiInfo, &szB);
1452
+#if 0
14331453
!allowOlder && !forceFlag, useCksum ? &cksum1 : 0,
14341454
zDateOvrd, zUserOvrd, zBranch, zColor, zBrClr,
14351455
azTag, &szB);
1456
+#endif
14361457
}
14371458
14381459
/* See if a delta-manifest would be more appropriate */
14391460
if( !forceBaseline ){
14401461
const char *zBaselineUuid;
@@ -1448,14 +1469,17 @@
14481469
zBaselineUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
14491470
pBaseline = pParent;
14501471
}
14511472
if( pBaseline ){
14521473
Blob delta;
1453
- create_manifest(&delta, zBaselineUuid, pBaseline, &comment, vid,
1474
+ create_manifest(&delta, zBaselineUuid, pBaseline, vid, &sCiInfo, &szD);
1475
+
1476
+#if 0
14541477
!allowOlder && !forceFlag, useCksum ? &cksum1 : 0,
14551478
zDateOvrd, zUserOvrd, zBranch, zColor, zBrClr,
14561479
azTag, &szD);
1480
+#endif
14571481
/*
14581482
** At this point, two manifests have been constructed, either of
14591483
** which would work for this checkin. The first manifest (held
14601484
** in the "manifest" variable) is a baseline manifest and the second
14611485
** (held in variable named "delta") is a delta manifest. The
14621486
--- src/checkin.c
+++ src/checkin.c
@@ -565,13 +565,12 @@
565 ** parent_rid is the recordid of the parent check-in.
566 */
567 static void prepare_commit_comment(
568 Blob *pComment,
569 char *zInit,
570 const char *zBranch,
571 int parent_rid,
572 const char *zUserOvrd
573 ){
574 Blob prompt;
575 #ifdef _WIN32
576 int bomSize;
577 const unsigned char *bom = get_utf8_bom(&bomSize);
@@ -585,13 +584,13 @@
585 blob_append(&prompt,
586 "\n"
587 "# Enter comments on this check-in. Lines beginning with # are ignored.\n"
588 "#\n", -1
589 );
590 blob_appendf(&prompt, "# user: %s\n", zUserOvrd ? zUserOvrd : g.zLogin);
591 if( zBranch && zBranch[0] ){
592 blob_appendf(&prompt, "# tags: %s\n#\n", zBranch);
593 }else{
594 char *zTags = info_tags_of_checkin(parent_rid, 1);
595 if( zTags ) blob_appendf(&prompt, "# tags: %z\n#\n", zTags);
596 }
597 status_report(&prompt, "# ", 1, 0);
@@ -706,28 +705,39 @@
706 for(i=2; i<g.argc; i++){
707 fossil_print("%s -> %s\n", g.argv[i], date_in_standard_format(g.argv[i]));
708 }
709 }
710
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
711 /*
712 ** Create a manifest.
713 */
714 static void create_manifest(
715 Blob *pOut, /* Write the manifest here */
716 const char *zBaselineUuid, /* UUID of baseline, or zero */
717 Manifest *pBaseline, /* Make it a delta manifest if not zero */
718 Blob *pComment, /* Check-in comment text */
719 int vid, /* blob-id of the parent manifest */
720 int verifyDate, /* Verify that child is younger */
721 Blob *pCksum, /* Repository checksum. May be 0 */
722 const char *zDateOvrd, /* Date override. If 0 then use 'now' */
723 const char *zUserOvrd, /* User override. If 0 then use g.zLogin */
724 const char *zBranch, /* Branch name. May be 0 */
725 const char *zColor, /* One-time background color. May be 0 */
726 const char *zBrClr, /* Persistent branch color. May be 0 */
727 const char **azTag, /* Tags to apply to this check-in */
728 int *pnFBcard /* Number of generated B- and F-cards */
729 ){
730 char *zDate; /* Date of the check-in */
731 char *zParentUuid; /* UUID of parent check-in */
732 Blob filename; /* A single filename */
733 int nBasename; /* Size of base filename */
@@ -735,10 +745,11 @@
735 Stmt q2; /* Query of merge parents */
736 Blob mcksum; /* Manifest checksum */
737 ManifestFile *pFile; /* File from the baseline */
738 int nFBcard = 0; /* Number of B-cards and F-cards */
739 int i; /* Loop counter */
 
740
741 assert( pBaseline==0 || pBaseline->zBaseline==0 );
742 assert( pBaseline==0 || zBaselineUuid!=0 );
743 blob_zero(pOut);
744 zParentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
@@ -748,12 +759,12 @@
748 pFile = manifest_file_next(pBaseline, 0);
749 nFBcard++;
750 }else{
751 pFile = 0;
752 }
753 blob_appendf(pOut, "C %F\n", blob_str(pComment));
754 zDate = date_in_standard_format(zDateOvrd ? zDateOvrd : "now");
755 blob_appendf(pOut, "D %s\n", zDate);
756 zDate[10] = ' ';
757 db_prepare(&q,
758 "SELECT pathname, uuid, origname, blob.rid, isexe, islink,"
759 " is_selected(vfile.id)"
@@ -827,67 +838,72 @@
827 while( pFile ){
828 blob_appendf(pOut, "F %F\n", pFile->zName);
829 pFile = manifest_file_next(pBaseline, 0);
830 nFBcard++;
831 }
 
 
 
832 blob_appendf(pOut, "P %s", zParentUuid);
833 if( verifyDate ) checkin_verify_younger(vid, zParentUuid, zDate);
834 free(zParentUuid);
835 db_prepare(&q2, "SELECT merge FROM vmerge WHERE id=0");
836 while( db_step(&q2)==SQLITE_ROW ){
837 char *zMergeUuid;
838 int mid = db_column_int(&q2, 0);
839 if( !g.markPrivate && content_is_private(mid) ) continue;
840 zMergeUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", mid);
841 if( zMergeUuid ){
842 blob_appendf(pOut, " %s", zMergeUuid);
843 if( verifyDate ) checkin_verify_younger(mid, zMergeUuid, zDate);
844 free(zMergeUuid);
845 }
846 }
847 db_finalize(&q2);
848 free(zDate);
849
850 blob_appendf(pOut, "\n");
851 if( pCksum ) blob_appendf(pOut, "R %b\n", pCksum);
852 if( zBranch && zBranch[0] ){
 
853 /* Set tags for the new branch */
854 if( zBrClr && zBrClr[0] ){
855 zColor = 0;
856 blob_appendf(pOut, "T *bgcolor * %F\n", zBrClr);
857 }
858 blob_appendf(pOut, "T *branch * %F\n", zBranch);
859 blob_appendf(pOut, "T *sym-%F *\n", zBranch);
860 }
861 if( zColor && zColor[0] ){
862 /* One-time background color */
863 blob_appendf(pOut, "T +bgcolor * %F\n", zColor);
864 }
865 if( azTag ){
866 for(i=0; azTag[i]; i++){
867 /* Add a symbolic tag to this check-in. The tag names have already
868 ** been sorted and converted using the %F format */
869 blob_appendf(pOut, "T +sym-%s *\n", azTag[i]);
 
870 }
871 }
872 if( zBranch && zBranch[0] ){
873 /* For a new branch, cancel all prior propagating tags */
874 Stmt q;
875 db_prepare(&q,
876 "SELECT tagname FROM tagxref, tag"
877 " WHERE tagxref.rid=%d AND tagxref.tagid=tag.tagid"
878 " AND tagtype==2 AND tagname GLOB 'sym-*'"
879 " AND tagname!='sym-'||%Q"
880 " ORDER BY tagname",
881 vid, zBranch);
882 while( db_step(&q)==SQLITE_ROW ){
883 const char *zBrTag = db_column_text(&q, 0);
884 blob_appendf(pOut, "T -%F *\n", zBrTag);
885 }
886 db_finalize(&q);
887 }
888 blob_appendf(pOut, "U %F\n", zUserOvrd ? zUserOvrd : g.zLogin);
889 md5sum_blob(pOut, &mcksum);
890 blob_appendf(pOut, "Z %b\n", &mcksum);
891 if( pnFBcard ) *pnFBcard = nFBcard;
892 }
893
@@ -1092,10 +1108,11 @@
1092 ** --branch NEW-BRANCH-NAME check in to this new branch
1093 ** --branchcolor COLOR apply given COLOR to the branch
1094 ** --comment|-m COMMENT-TEXT use COMMENT-TEXT as commit comment
1095 ** --delta use a delta manifest in the commit process
1096 ** --message-file|-M FILE read the commit comment from given file
 
1097 ** --no-warnings omit all warnings about file contents
1098 ** --nosign do not attempt to sign this commit with gpg
1099 ** --private do not sync changes and their descendants
1100 ** --tag TAG-NAME assign given tag TAG-NAME to the checkin
1101 **
@@ -1122,15 +1139,11 @@
1122 int allowOlder = 0; /* Allow a commit older than its ancestor */
1123 char *zManifestFile; /* Name of the manifest file */
1124 int useCksum; /* True if checksums should be computed and verified */
1125 int outputManifest; /* True to output "manifest" and "manifest.uuid" */
1126 int testRun; /* True for a test run. Debugging only */
1127 const char *zBranch; /* Create a new branch with this name */
1128 const char *zBrClr; /* Set background color when branching */
1129 const char *zColor; /* One-time check-in color */
1130 const char *zDateOvrd; /* Override date string */
1131 const char *zUserOvrd; /* Override user name */
1132 const char *zComFile; /* Read commit message from this file */
1133 int nTag = 0; /* Number of --tag arguments */
1134 const char *zTag; /* A single --tag argument */
1135 const char **azTag = 0;/* Array of all --tag arguments */
1136 Blob manifest; /* Manifest in baseline form */
@@ -1142,10 +1155,11 @@
1142 int nConflict = 0; /* Number of unresolved merge conflicts */
1143 int abortCommit = 0;
1144 Blob ans;
1145 char cReply;
1146
 
1147 url_proxy_options();
1148 noSign = find_option("nosign",0,0)!=0;
1149 forceDelta = find_option("delta",0,0)!=0;
1150 forceBaseline = find_option("baseline",0,0)!=0;
1151 if( forceDelta && forceBaseline ){
@@ -1157,27 +1171,30 @@
1157 allowConflict = find_option("allow-conflict",0,0)!=0;
1158 allowEmpty = find_option("allow-empty",0,0)!=0;
1159 allowFork = find_option("allow-fork",0,0)!=0;
1160 allowOlder = find_option("allow-older",0,0)!=0;
1161 noWarningFlag = find_option("no-warnings", 0, 0)!=0;
1162 zBranch = find_option("branch","b",1);
1163 zColor = find_option("bgcolor",0,1);
1164 zBrClr = find_option("branchcolor",0,1);
 
1165 while( (zTag = find_option("tag",0,1))!=0 ){
1166 if( zTag[0]==0 ) continue;
1167 azTag = fossil_realloc((void *)azTag, sizeof(char*)*(nTag+2));
1168 azTag[nTag++] = zTag;
1169 azTag[nTag] = 0;
1170 }
1171 zComFile = find_option("message-file", "M", 1);
1172 if( find_option("private",0,0) ){
1173 g.markPrivate = 1;
1174 if( zBranch==0 ) zBranch = "private";
1175 if( zBrClr==0 && zColor==0 ) zBrClr = "#fec084"; /* Orange */
 
 
1176 }
1177 zDateOvrd = find_option("date-override",0,1);
1178 zUserOvrd = find_option("user-override",0,1);
1179 db_must_be_within_tree();
1180 noSign = db_get_boolean("omitsign", 0)|noSign;
1181 if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
1182 useCksum = db_get_boolean("repo-cksum", 1);
1183 outputManifest = db_get_boolean("manifest", 0);
@@ -1309,11 +1326,11 @@
1309
1310 /*
1311 ** Do not allow a commit that will cause a fork unless the --allow-fork
1312 ** or --force flags is used, or unless this is a private check-in.
1313 */
1314 if( zBranch==0 && allowFork==0 && forceFlag==0
1315 && g.markPrivate==0 && !is_a_leaf(vid)
1316 ){
1317 fossil_fatal("would fork. \"update\" first or use --allow-fork.");
1318 }
1319
@@ -1334,11 +1351,11 @@
1334 blob_zero(&comment);
1335 blob_read_from_file(&comment, zComFile);
1336 blob_to_utf8_no_bom(&comment, 1);
1337 }else{
1338 char *zInit = db_text(0, "SELECT value FROM vvar WHERE name='ci-comment'");
1339 prepare_commit_comment(&comment, zInit, zBranch, vid, zUserOvrd);
1340 if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){
1341 blob_zero(&ans);
1342 prompt_user("unchanged check-in comment. continue (y/N)? ", &ans);
1343 cReply = blob_str(&ans)[0];
1344 if( cReply!='y' && cReply!='Y' ) fossil_exit(1);;
@@ -1424,17 +1441,21 @@
1424
1425 /* Create the new manifest */
1426 if( blob_size(&comment)==0 ){
1427 blob_append(&comment, "(no comment)", -1);
1428 }
 
 
1429 if( forceDelta ){
1430 blob_zero(&manifest);
1431 }else{
1432 create_manifest(&manifest, 0, 0, &comment, vid,
 
1433 !allowOlder && !forceFlag, useCksum ? &cksum1 : 0,
1434 zDateOvrd, zUserOvrd, zBranch, zColor, zBrClr,
1435 azTag, &szB);
 
1436 }
1437
1438 /* See if a delta-manifest would be more appropriate */
1439 if( !forceBaseline ){
1440 const char *zBaselineUuid;
@@ -1448,14 +1469,17 @@
1448 zBaselineUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
1449 pBaseline = pParent;
1450 }
1451 if( pBaseline ){
1452 Blob delta;
1453 create_manifest(&delta, zBaselineUuid, pBaseline, &comment, vid,
 
 
1454 !allowOlder && !forceFlag, useCksum ? &cksum1 : 0,
1455 zDateOvrd, zUserOvrd, zBranch, zColor, zBrClr,
1456 azTag, &szD);
 
1457 /*
1458 ** At this point, two manifests have been constructed, either of
1459 ** which would work for this checkin. The first manifest (held
1460 ** in the "manifest" variable) is a baseline manifest and the second
1461 ** (held in variable named "delta") is a delta manifest. The
1462
--- src/checkin.c
+++ src/checkin.c
@@ -565,13 +565,12 @@
565 ** parent_rid is the recordid of the parent check-in.
566 */
567 static void prepare_commit_comment(
568 Blob *pComment,
569 char *zInit,
570 CheckinInfo *p,
571 int parent_rid
 
572 ){
573 Blob prompt;
574 #ifdef _WIN32
575 int bomSize;
576 const unsigned char *bom = get_utf8_bom(&bomSize);
@@ -585,13 +584,13 @@
584 blob_append(&prompt,
585 "\n"
586 "# Enter comments on this check-in. Lines beginning with # are ignored.\n"
587 "#\n", -1
588 );
589 blob_appendf(&prompt, "# user: %s\n", p->zUserOvrd ? p->zUserOvrd : g.zLogin);
590 if( p->zBranch && p->zBranch[0] ){
591 blob_appendf(&prompt, "# tags: %s\n#\n", p->zBranch);
592 }else{
593 char *zTags = info_tags_of_checkin(parent_rid, 1);
594 if( zTags ) blob_appendf(&prompt, "# tags: %z\n#\n", zTags);
595 }
596 status_report(&prompt, "# ", 1, 0);
@@ -706,28 +705,39 @@
705 for(i=2; i<g.argc; i++){
706 fossil_print("%s -> %s\n", g.argv[i], date_in_standard_format(g.argv[i]));
707 }
708 }
709
710 #if INTERFACE
711 /*
712 ** The following structure holds some of the information needed to construct a
713 ** check-in manifest.
714 */
715 struct CheckinInfo {
716 Blob *pComment; /* Check-in comment text */
717 const char *zMimetype; /* Mimetype of check-in command. May be NULL */
718 int verifyDate; /* Verify that child is younger */
719 Blob *pCksum; /* Repository checksum. May be 0 */
720 const char *zDateOvrd; /* Date override. If 0 then use 'now' */
721 const char *zUserOvrd; /* User override. If 0 then use g.zLogin */
722 const char *zBranch; /* Branch name. May be 0 */
723 const char *zColor; /* One-time background color. May be 0 */
724 const char *zBrClr; /* Persistent branch color. May be 0 */
725 const char **azTag; /* Tags to apply to this check-in */
726 };
727 #endif /* INTERFACE */
728
729 /*
730 ** Create a manifest.
731 */
732 static void create_manifest(
733 Blob *pOut, /* Write the manifest here */
734 const char *zBaselineUuid, /* UUID of baseline, or zero */
735 Manifest *pBaseline, /* Make it a delta manifest if not zero */
736 int vid, /* BLOB.id for the parent check-in */
737 CheckinInfo *p, /* Information about the check-in */
738 int *pnFBcard /* OUT: Number of generated B- and F-cards */
 
 
 
 
 
 
 
 
739 ){
740 char *zDate; /* Date of the check-in */
741 char *zParentUuid; /* UUID of parent check-in */
742 Blob filename; /* A single filename */
743 int nBasename; /* Size of base filename */
@@ -735,10 +745,11 @@
745 Stmt q2; /* Query of merge parents */
746 Blob mcksum; /* Manifest checksum */
747 ManifestFile *pFile; /* File from the baseline */
748 int nFBcard = 0; /* Number of B-cards and F-cards */
749 int i; /* Loop counter */
750 const char *zColor; /* Modified value of p->zColor */
751
752 assert( pBaseline==0 || pBaseline->zBaseline==0 );
753 assert( pBaseline==0 || zBaselineUuid!=0 );
754 blob_zero(pOut);
755 zParentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
@@ -748,12 +759,12 @@
759 pFile = manifest_file_next(pBaseline, 0);
760 nFBcard++;
761 }else{
762 pFile = 0;
763 }
764 blob_appendf(pOut, "C %F\n", blob_str(p->pComment));
765 zDate = date_in_standard_format(p->zDateOvrd ? p->zDateOvrd : "now");
766 blob_appendf(pOut, "D %s\n", zDate);
767 zDate[10] = ' ';
768 db_prepare(&q,
769 "SELECT pathname, uuid, origname, blob.rid, isexe, islink,"
770 " is_selected(vfile.id)"
@@ -827,67 +838,72 @@
838 while( pFile ){
839 blob_appendf(pOut, "F %F\n", pFile->zName);
840 pFile = manifest_file_next(pBaseline, 0);
841 nFBcard++;
842 }
843 if( p->zMimetype && p->zMimetype[0] ){
844 blob_appendf(pOut, "N %F\n", p->zMimetype);
845 }
846 blob_appendf(pOut, "P %s", zParentUuid);
847 if( p->verifyDate ) checkin_verify_younger(vid, zParentUuid, zDate);
848 free(zParentUuid);
849 db_prepare(&q2, "SELECT merge FROM vmerge WHERE id=0");
850 while( db_step(&q2)==SQLITE_ROW ){
851 char *zMergeUuid;
852 int mid = db_column_int(&q2, 0);
853 if( !g.markPrivate && content_is_private(mid) ) continue;
854 zMergeUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", mid);
855 if( zMergeUuid ){
856 blob_appendf(pOut, " %s", zMergeUuid);
857 if( p->verifyDate ) checkin_verify_younger(mid, zMergeUuid, zDate);
858 free(zMergeUuid);
859 }
860 }
861 db_finalize(&q2);
862 free(zDate);
863
864 blob_appendf(pOut, "\n");
865 if( p->pCksum ) blob_appendf(pOut, "R %b\n", p->pCksum);
866 zColor = p->zColor;
867 if( p->zBranch && p->zBranch[0] ){
868 /* Set tags for the new branch */
869 if( p->zBrClr && p->zBrClr[0] ){
870 zColor = 0;
871 blob_appendf(pOut, "T *bgcolor * %F\n", p->zBrClr);
872 }
873 blob_appendf(pOut, "T *branch * %F\n", p->zBranch);
874 blob_appendf(pOut, "T *sym-%F *\n", p->zBranch);
875 }
876 if( zColor && zColor[0] ){
877 /* One-time background color */
878 blob_appendf(pOut, "T +bgcolor * %F\n", zColor);
879 }
880 if( p->azTag ){
881 for(i=0; p->azTag[i]; i++){
882 /* Add a symbolic tag to this check-in. The tag names have already
883 ** been sorted and converted using the %F format */
884 assert( i==0 || strcmp(p->azTag[i-1], p->azTag[i])<=0 );
885 blob_appendf(pOut, "T +sym-%s *\n", p->azTag[i]);
886 }
887 }
888 if( p->zBranch && p->zBranch[0] ){
889 /* For a new branch, cancel all prior propagating tags */
890 Stmt q;
891 db_prepare(&q,
892 "SELECT tagname FROM tagxref, tag"
893 " WHERE tagxref.rid=%d AND tagxref.tagid=tag.tagid"
894 " AND tagtype==2 AND tagname GLOB 'sym-*'"
895 " AND tagname!='sym-'||%Q"
896 " ORDER BY tagname",
897 vid, p->zBranch);
898 while( db_step(&q)==SQLITE_ROW ){
899 const char *zBrTag = db_column_text(&q, 0);
900 blob_appendf(pOut, "T -%F *\n", zBrTag);
901 }
902 db_finalize(&q);
903 }
904 blob_appendf(pOut, "U %F\n", p->zUserOvrd ? p->zUserOvrd : g.zLogin);
905 md5sum_blob(pOut, &mcksum);
906 blob_appendf(pOut, "Z %b\n", &mcksum);
907 if( pnFBcard ) *pnFBcard = nFBcard;
908 }
909
@@ -1092,10 +1108,11 @@
1108 ** --branch NEW-BRANCH-NAME check in to this new branch
1109 ** --branchcolor COLOR apply given COLOR to the branch
1110 ** --comment|-m COMMENT-TEXT use COMMENT-TEXT as commit comment
1111 ** --delta use a delta manifest in the commit process
1112 ** --message-file|-M FILE read the commit comment from given file
1113 ** --mimetype MIMETYPE mimetype of check-in comment
1114 ** --no-warnings omit all warnings about file contents
1115 ** --nosign do not attempt to sign this commit with gpg
1116 ** --private do not sync changes and their descendants
1117 ** --tag TAG-NAME assign given tag TAG-NAME to the checkin
1118 **
@@ -1122,15 +1139,11 @@
1139 int allowOlder = 0; /* Allow a commit older than its ancestor */
1140 char *zManifestFile; /* Name of the manifest file */
1141 int useCksum; /* True if checksums should be computed and verified */
1142 int outputManifest; /* True to output "manifest" and "manifest.uuid" */
1143 int testRun; /* True for a test run. Debugging only */
1144 CheckinInfo sCiInfo; /* Information about this check-in */
 
 
 
 
1145 const char *zComFile; /* Read commit message from this file */
1146 int nTag = 0; /* Number of --tag arguments */
1147 const char *zTag; /* A single --tag argument */
1148 const char **azTag = 0;/* Array of all --tag arguments */
1149 Blob manifest; /* Manifest in baseline form */
@@ -1142,10 +1155,11 @@
1155 int nConflict = 0; /* Number of unresolved merge conflicts */
1156 int abortCommit = 0;
1157 Blob ans;
1158 char cReply;
1159
1160 memset(&sCiInfo, 0, sizeof(sCiInfo));
1161 url_proxy_options();
1162 noSign = find_option("nosign",0,0)!=0;
1163 forceDelta = find_option("delta",0,0)!=0;
1164 forceBaseline = find_option("baseline",0,0)!=0;
1165 if( forceDelta && forceBaseline ){
@@ -1157,27 +1171,30 @@
1171 allowConflict = find_option("allow-conflict",0,0)!=0;
1172 allowEmpty = find_option("allow-empty",0,0)!=0;
1173 allowFork = find_option("allow-fork",0,0)!=0;
1174 allowOlder = find_option("allow-older",0,0)!=0;
1175 noWarningFlag = find_option("no-warnings", 0, 0)!=0;
1176 sCiInfo.zBranch = find_option("branch","b",1);
1177 sCiInfo.zColor = find_option("bgcolor",0,1);
1178 sCiInfo.zBrClr = find_option("branchcolor",0,1);
1179 sCiInfo.zMimetype = find_option("mimetype",0,1);
1180 while( (zTag = find_option("tag",0,1))!=0 ){
1181 if( zTag[0]==0 ) continue;
1182 sCiInfo.azTag = fossil_realloc((void*)sCiInfo.azTag, sizeof(char*)*(nTag+2));
1183 sCiInfo.azTag[nTag++] = zTag;
1184 sCiInfo.azTag[nTag] = 0;
1185 }
1186 zComFile = find_option("message-file", "M", 1);
1187 if( find_option("private",0,0) ){
1188 g.markPrivate = 1;
1189 if( sCiInfo.zBranch==0 ) sCiInfo.zBranch = "private";
1190 if( sCiInfo.zBrClr==0 && sCiInfo.zColor==0 ){
1191 sCiInfo.zBrClr = "#fec084"; /* Orange */
1192 }
1193 }
1194 sCiInfo.zDateOvrd = find_option("date-override",0,1);
1195 sCiInfo.zUserOvrd = find_option("user-override",0,1);
1196 db_must_be_within_tree();
1197 noSign = db_get_boolean("omitsign", 0)|noSign;
1198 if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
1199 useCksum = db_get_boolean("repo-cksum", 1);
1200 outputManifest = db_get_boolean("manifest", 0);
@@ -1309,11 +1326,11 @@
1326
1327 /*
1328 ** Do not allow a commit that will cause a fork unless the --allow-fork
1329 ** or --force flags is used, or unless this is a private check-in.
1330 */
1331 if( sCiInfo.zBranch==0 && allowFork==0 && forceFlag==0
1332 && g.markPrivate==0 && !is_a_leaf(vid)
1333 ){
1334 fossil_fatal("would fork. \"update\" first or use --allow-fork.");
1335 }
1336
@@ -1334,11 +1351,11 @@
1351 blob_zero(&comment);
1352 blob_read_from_file(&comment, zComFile);
1353 blob_to_utf8_no_bom(&comment, 1);
1354 }else{
1355 char *zInit = db_text(0, "SELECT value FROM vvar WHERE name='ci-comment'");
1356 prepare_commit_comment(&comment, zInit, &sCiInfo, vid);
1357 if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){
1358 blob_zero(&ans);
1359 prompt_user("unchanged check-in comment. continue (y/N)? ", &ans);
1360 cReply = blob_str(&ans)[0];
1361 if( cReply!='y' && cReply!='Y' ) fossil_exit(1);;
@@ -1424,17 +1441,21 @@
1441
1442 /* Create the new manifest */
1443 if( blob_size(&comment)==0 ){
1444 blob_append(&comment, "(no comment)", -1);
1445 }
1446 sCiInfo.pComment = &comment;
1447 sCiInfo.pCksum = useCksum ? &cksum1 : 0;
1448 if( forceDelta ){
1449 blob_zero(&manifest);
1450 }else{
1451 create_manifest(&manifest, 0, 0, vid, &sCiInfo, &szB);
1452 #if 0
1453 !allowOlder && !forceFlag, useCksum ? &cksum1 : 0,
1454 zDateOvrd, zUserOvrd, zBranch, zColor, zBrClr,
1455 azTag, &szB);
1456 #endif
1457 }
1458
1459 /* See if a delta-manifest would be more appropriate */
1460 if( !forceBaseline ){
1461 const char *zBaselineUuid;
@@ -1448,14 +1469,17 @@
1469 zBaselineUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
1470 pBaseline = pParent;
1471 }
1472 if( pBaseline ){
1473 Blob delta;
1474 create_manifest(&delta, zBaselineUuid, pBaseline, vid, &sCiInfo, &szD);
1475
1476 #if 0
1477 !allowOlder && !forceFlag, useCksum ? &cksum1 : 0,
1478 zDateOvrd, zUserOvrd, zBranch, zColor, zBrClr,
1479 azTag, &szD);
1480 #endif
1481 /*
1482 ** At this point, two manifests have been constructed, either of
1483 ** which would work for this checkin. The first manifest (held
1484 ** in the "manifest" variable) is a baseline manifest and the second
1485 ** (held in variable named "delta") is a delta manifest. The
1486
-3
--- src/db.c
+++ src/db.c
@@ -2104,13 +2104,10 @@
21042104
{ "https-login", 0, 0, 0, "off" },
21052105
{ "ignore-glob", 0, 40, 1, "" },
21062106
{ "localauth", 0, 0, 0, "off" },
21072107
{ "main-branch", 0, 40, 0, "trunk" },
21082108
{ "manifest", 0, 0, 1, "off" },
2109
-#ifdef FOSSIL_ENABLE_MARKDOWN
2110
- { "markdown", 0, 0, 0, "off" },
2111
-#endif
21122109
{ "max-upload", 0, 25, 0, "250000" },
21132110
{ "mtime-changes", 0, 0, 0, "on" },
21142111
{ "pgp-command", 0, 40, 0, "gpg --clearsign -o " },
21152112
{ "proxy", 0, 32, 0, "off" },
21162113
{ "relative-paths",0, 0, 0, "on" },
21172114
--- src/db.c
+++ src/db.c
@@ -2104,13 +2104,10 @@
2104 { "https-login", 0, 0, 0, "off" },
2105 { "ignore-glob", 0, 40, 1, "" },
2106 { "localauth", 0, 0, 0, "off" },
2107 { "main-branch", 0, 40, 0, "trunk" },
2108 { "manifest", 0, 0, 1, "off" },
2109 #ifdef FOSSIL_ENABLE_MARKDOWN
2110 { "markdown", 0, 0, 0, "off" },
2111 #endif
2112 { "max-upload", 0, 25, 0, "250000" },
2113 { "mtime-changes", 0, 0, 0, "on" },
2114 { "pgp-command", 0, 40, 0, "gpg --clearsign -o " },
2115 { "proxy", 0, 32, 0, "off" },
2116 { "relative-paths",0, 0, 0, "on" },
2117
--- src/db.c
+++ src/db.c
@@ -2104,13 +2104,10 @@
2104 { "https-login", 0, 0, 0, "off" },
2105 { "ignore-glob", 0, 40, 1, "" },
2106 { "localauth", 0, 0, 0, "off" },
2107 { "main-branch", 0, 40, 0, "trunk" },
2108 { "manifest", 0, 0, 1, "off" },
 
 
 
2109 { "max-upload", 0, 25, 0, "250000" },
2110 { "mtime-changes", 0, 0, 0, "on" },
2111 { "pgp-command", 0, 40, 0, "gpg --clearsign -o " },
2112 { "proxy", 0, 32, 0, "off" },
2113 { "relative-paths",0, 0, 0, "on" },
2114
+2 -4
--- src/doc.c
+++ src/doc.c
@@ -169,10 +169,11 @@
169169
{ "lzh", 3, "application/octet-stream" },
170170
{ "m", 1, "text/plain" },
171171
{ "m3u", 3, "audio/x-mpegurl" },
172172
{ "man", 3, "application/x-troff-man" },
173173
{ "markdown", 8, "text/x-markdown" },
174
+ { "md", 2, "text/x-markdown" },
174175
{ "me", 2, "application/x-troff-me" },
175176
{ "mesh", 4, "model/mesh" },
176177
{ "mid", 3, "audio/midi" },
177178
{ "midi", 4, "audio/midi" },
178179
{ "mif", 3, "application/x-mif" },
@@ -504,13 +505,11 @@
504505
}else{
505506
style_header("Documentation");
506507
wiki_convert(&filebody, 0, WIKI_BUTTONS);
507508
}
508509
style_footer();
509
-#ifdef FOSSIL_ENABLE_MARKDOWN
510
- }else if( fossil_strcmp(zMime, "text/x-markdown")==0
511
- && db_get_boolean("markdown", 0) ){
510
+ }else if( fossil_strcmp(zMime, "text/x-markdown")==0 ){
512511
Blob title = BLOB_INITIALIZER;
513512
Blob tail = BLOB_INITIALIZER;
514513
markdown_to_html(&filebody, &title, &tail);
515514
if( blob_size(&title)>0 ){
516515
style_header(blob_str(&title));
@@ -517,11 +516,10 @@
517516
}else{
518517
style_header("Documentation");
519518
}
520519
blob_append(cgi_output_blob(), blob_buffer(&tail), blob_size(&tail));
521520
style_footer();
522
-#endif
523521
}else if( fossil_strcmp(zMime, "text/plain")==0 ){
524522
style_header("Documentation");
525523
@ <blockquote><pre>
526524
@ %h(blob_str(&filebody))
527525
@ </pre></blockquote>
528526
--- src/doc.c
+++ src/doc.c
@@ -169,10 +169,11 @@
169 { "lzh", 3, "application/octet-stream" },
170 { "m", 1, "text/plain" },
171 { "m3u", 3, "audio/x-mpegurl" },
172 { "man", 3, "application/x-troff-man" },
173 { "markdown", 8, "text/x-markdown" },
 
174 { "me", 2, "application/x-troff-me" },
175 { "mesh", 4, "model/mesh" },
176 { "mid", 3, "audio/midi" },
177 { "midi", 4, "audio/midi" },
178 { "mif", 3, "application/x-mif" },
@@ -504,13 +505,11 @@
504 }else{
505 style_header("Documentation");
506 wiki_convert(&filebody, 0, WIKI_BUTTONS);
507 }
508 style_footer();
509 #ifdef FOSSIL_ENABLE_MARKDOWN
510 }else if( fossil_strcmp(zMime, "text/x-markdown")==0
511 && db_get_boolean("markdown", 0) ){
512 Blob title = BLOB_INITIALIZER;
513 Blob tail = BLOB_INITIALIZER;
514 markdown_to_html(&filebody, &title, &tail);
515 if( blob_size(&title)>0 ){
516 style_header(blob_str(&title));
@@ -517,11 +516,10 @@
517 }else{
518 style_header("Documentation");
519 }
520 blob_append(cgi_output_blob(), blob_buffer(&tail), blob_size(&tail));
521 style_footer();
522 #endif
523 }else if( fossil_strcmp(zMime, "text/plain")==0 ){
524 style_header("Documentation");
525 @ <blockquote><pre>
526 @ %h(blob_str(&filebody))
527 @ </pre></blockquote>
528
--- src/doc.c
+++ src/doc.c
@@ -169,10 +169,11 @@
169 { "lzh", 3, "application/octet-stream" },
170 { "m", 1, "text/plain" },
171 { "m3u", 3, "audio/x-mpegurl" },
172 { "man", 3, "application/x-troff-man" },
173 { "markdown", 8, "text/x-markdown" },
174 { "md", 2, "text/x-markdown" },
175 { "me", 2, "application/x-troff-me" },
176 { "mesh", 4, "model/mesh" },
177 { "mid", 3, "audio/midi" },
178 { "midi", 4, "audio/midi" },
179 { "mif", 3, "application/x-mif" },
@@ -504,13 +505,11 @@
505 }else{
506 style_header("Documentation");
507 wiki_convert(&filebody, 0, WIKI_BUTTONS);
508 }
509 style_footer();
510 }else if( fossil_strcmp(zMime, "text/x-markdown")==0 ){
 
 
511 Blob title = BLOB_INITIALIZER;
512 Blob tail = BLOB_INITIALIZER;
513 markdown_to_html(&filebody, &title, &tail);
514 if( blob_size(&title)>0 ){
515 style_header(blob_str(&title));
@@ -517,11 +516,10 @@
516 }else{
517 style_header("Documentation");
518 }
519 blob_append(cgi_output_blob(), blob_buffer(&tail), blob_size(&tail));
520 style_footer();
 
521 }else if( fossil_strcmp(zMime, "text/plain")==0 ){
522 style_header("Documentation");
523 @ <blockquote><pre>
524 @ %h(blob_str(&filebody))
525 @ </pre></blockquote>
526
-4
--- src/main.c
+++ src/main.c
@@ -780,14 +780,10 @@
780780
#endif
781781
#if defined(FOSSIL_ENABLE_JSON)
782782
++count;
783783
fossil_print("\tJSON (API %s)\n", FOSSIL_JSON_API_VERSION);
784784
#endif
785
-#if defined(FOSSIL_ENABLE_MARKDOWN)
786
- ++count;
787
- fossil_print("\tMARKDOWN\n");
788
-#endif
789785
if( !count ){
790786
fossil_print("\tNo optional features were enabled.\n");
791787
}
792788
}
793789
}
794790
--- src/main.c
+++ src/main.c
@@ -780,14 +780,10 @@
780 #endif
781 #if defined(FOSSIL_ENABLE_JSON)
782 ++count;
783 fossil_print("\tJSON (API %s)\n", FOSSIL_JSON_API_VERSION);
784 #endif
785 #if defined(FOSSIL_ENABLE_MARKDOWN)
786 ++count;
787 fossil_print("\tMARKDOWN\n");
788 #endif
789 if( !count ){
790 fossil_print("\tNo optional features were enabled.\n");
791 }
792 }
793 }
794
--- src/main.c
+++ src/main.c
@@ -780,14 +780,10 @@
780 #endif
781 #if defined(FOSSIL_ENABLE_JSON)
782 ++count;
783 fossil_print("\tJSON (API %s)\n", FOSSIL_JSON_API_VERSION);
784 #endif
 
 
 
 
785 if( !count ){
786 fossil_print("\tNo optional features were enabled.\n");
787 }
788 }
789 }
790
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -380,14 +380,10 @@
380380
381381
#### Enable JSON (http://www.json.org) support using "cson"
382382
#
383383
# FOSSIL_ENABLE_JSON = 1
384384
385
-#### Enable markdown support
386
-#
387
-# FOSSIL_ENABLE_MARKDOWN = 1
388
-
389385
#### Enable HTTPS support via OpenSSL (links to libssl and libcrypto)
390386
#
391387
# FOSSIL_ENABLE_SSL = 1
392388
393389
#### Enable scripting support via Tcl/Tk
@@ -525,16 +521,10 @@
525521
ifdef FOSSIL_ENABLE_JSON
526522
TCC += -DFOSSIL_ENABLE_JSON=1
527523
RCC += -DFOSSIL_ENABLE_JSON=1
528524
endif
529525
530
-# With markdown support
531
-ifdef FOSSIL_ENABLE_MARKDOWN
532
-TCC += -DFOSSIL_ENABLE_MARKDOWN=1
533
-RCC += -DFOSSIL_ENABLE_MARKDOWN=1
534
-endif
535
-
536526
#### We add the -static option here so that we can build a static
537527
# executable that will run in a chroot jail.
538528
#
539529
LIB = -static
540530
@@ -966,13 +956,10 @@
966956
ZLIB = zlib.lib
967957
968958
# Uncomment to enable JSON API
969959
# FOSSIL_ENABLE_JSON = 1
970960
971
-# Uncomment to enable markdown support
972
-# FOSSIL_ENABLE_MARKDOWN = 1
973
-
974961
INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR)
975962
976963
CFLAGS = -nologo -MT -O2
977964
BCC = $(CC) $(CFLAGS)
978965
TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL)
@@ -982,15 +969,10 @@
982969
983970
!ifdef FOSSIL_ENABLE_JSON
984971
TCC = $(TCC) -DFOSSIL_ENABLE_JSON
985972
RCC = $(RCC) -DFOSSIL_ENABLE_JSON
986973
!endif
987
-
988
-!ifdef FOSSIL_ENABLE_MARKDOWN
989
-TCC = $(TCC) -DFOSSIL_ENABLE_MARKDOWN
990
-RCC = $(RCC) -DFOSSIL_ENABLE_MARKDOWN
991
-!endif
992974
}
993975
regsub -all {[-]D} $SQLITE_OPTIONS {/D} MSC_SQLITE_OPTIONS
994976
set j " \\\n "
995977
writeln "SQLITE_OPTIONS = [join $MSC_SQLITE_OPTIONS $j]\n"
996978
writeln -nonewline "SRC = "
997979
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -380,14 +380,10 @@
380
381 #### Enable JSON (http://www.json.org) support using "cson"
382 #
383 # FOSSIL_ENABLE_JSON = 1
384
385 #### Enable markdown support
386 #
387 # FOSSIL_ENABLE_MARKDOWN = 1
388
389 #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto)
390 #
391 # FOSSIL_ENABLE_SSL = 1
392
393 #### Enable scripting support via Tcl/Tk
@@ -525,16 +521,10 @@
525 ifdef FOSSIL_ENABLE_JSON
526 TCC += -DFOSSIL_ENABLE_JSON=1
527 RCC += -DFOSSIL_ENABLE_JSON=1
528 endif
529
530 # With markdown support
531 ifdef FOSSIL_ENABLE_MARKDOWN
532 TCC += -DFOSSIL_ENABLE_MARKDOWN=1
533 RCC += -DFOSSIL_ENABLE_MARKDOWN=1
534 endif
535
536 #### We add the -static option here so that we can build a static
537 # executable that will run in a chroot jail.
538 #
539 LIB = -static
540
@@ -966,13 +956,10 @@
966 ZLIB = zlib.lib
967
968 # Uncomment to enable JSON API
969 # FOSSIL_ENABLE_JSON = 1
970
971 # Uncomment to enable markdown support
972 # FOSSIL_ENABLE_MARKDOWN = 1
973
974 INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR)
975
976 CFLAGS = -nologo -MT -O2
977 BCC = $(CC) $(CFLAGS)
978 TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL)
@@ -982,15 +969,10 @@
982
983 !ifdef FOSSIL_ENABLE_JSON
984 TCC = $(TCC) -DFOSSIL_ENABLE_JSON
985 RCC = $(RCC) -DFOSSIL_ENABLE_JSON
986 !endif
987
988 !ifdef FOSSIL_ENABLE_MARKDOWN
989 TCC = $(TCC) -DFOSSIL_ENABLE_MARKDOWN
990 RCC = $(RCC) -DFOSSIL_ENABLE_MARKDOWN
991 !endif
992 }
993 regsub -all {[-]D} $SQLITE_OPTIONS {/D} MSC_SQLITE_OPTIONS
994 set j " \\\n "
995 writeln "SQLITE_OPTIONS = [join $MSC_SQLITE_OPTIONS $j]\n"
996 writeln -nonewline "SRC = "
997
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -380,14 +380,10 @@
380
381 #### Enable JSON (http://www.json.org) support using "cson"
382 #
383 # FOSSIL_ENABLE_JSON = 1
384
 
 
 
 
385 #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto)
386 #
387 # FOSSIL_ENABLE_SSL = 1
388
389 #### Enable scripting support via Tcl/Tk
@@ -525,16 +521,10 @@
521 ifdef FOSSIL_ENABLE_JSON
522 TCC += -DFOSSIL_ENABLE_JSON=1
523 RCC += -DFOSSIL_ENABLE_JSON=1
524 endif
525
 
 
 
 
 
 
526 #### We add the -static option here so that we can build a static
527 # executable that will run in a chroot jail.
528 #
529 LIB = -static
530
@@ -966,13 +956,10 @@
956 ZLIB = zlib.lib
957
958 # Uncomment to enable JSON API
959 # FOSSIL_ENABLE_JSON = 1
960
 
 
 
961 INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR)
962
963 CFLAGS = -nologo -MT -O2
964 BCC = $(CC) $(CFLAGS)
965 TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL)
@@ -982,15 +969,10 @@
969
970 !ifdef FOSSIL_ENABLE_JSON
971 TCC = $(TCC) -DFOSSIL_ENABLE_JSON
972 RCC = $(RCC) -DFOSSIL_ENABLE_JSON
973 !endif
 
 
 
 
 
974 }
975 regsub -all {[-]D} $SQLITE_OPTIONS {/D} MSC_SQLITE_OPTIONS
976 set j " \\\n "
977 writeln "SQLITE_OPTIONS = [join $MSC_SQLITE_OPTIONS $j]\n"
978 writeln -nonewline "SRC = "
979
--- src/manifest.c
+++ src/manifest.c
@@ -68,10 +68,11 @@
6868
double rDate; /* Date and time from D card. 0.0 if no D card. */
6969
char *zUser; /* Name of the user from the U card. */
7070
char *zRepoCksum; /* MD5 checksum of the baseline content. R card. */
7171
char *zWiki; /* Text of the wiki page. W card. */
7272
char *zWikiTitle; /* Name of the wiki page. L card. */
73
+ char *zMimetype; /* Mime type of wiki or comment text. N card. */
7374
double rEventDate; /* Date of an event. E card. */
7475
char *zEventId; /* UUID for an event. E card. */
7576
char *zTicketUuid; /* UUID for a ticket. K card. */
7677
char *zAttachName; /* Filename of an attachment. A card. */
7778
char *zAttachSrc; /* UUID of document being attached. A card. */
@@ -642,10 +643,23 @@
642643
if( i>0 && fossil_strcmp(p->azCChild[i-1], zUuid)>=0 ){
643644
SYNTAX("M-card in the wrong order");
644645
}
645646
break;
646647
}
648
+
649
+ /*
650
+ ** N <uuid>
651
+ **
652
+ ** An N-line identifies the mimetype of wiki or comment text.
653
+ */
654
+ case 'N': {
655
+ if( p->zMimetype!=0 ) SYNTAX("more than one N-card");
656
+ p->zMimetype = next_token(&x,0);
657
+ if( p->zMimetype==0 ) SYNTAX("missing mimetype on N-card");
658
+ defossilize(p->zMimetype);
659
+ break;
660
+ }
647661
648662
/*
649663
** P <uuid> ...
650664
**
651665
** Specify one or more other artifacts where are the parents of
@@ -858,10 +872,11 @@
858872
|| p->zTicketUuid
859873
|| p->zWiki
860874
|| p->zWikiTitle
861875
|| p->zEventId
862876
|| p->zAttachName
877
+ || p->zMimetype
863878
){
864879
SYNTAX("cluster contains a card other than M- or Z-");
865880
}
866881
if( !seenZ ) SYNTAX("missing Z-card on cluster");
867882
p->type = CFTYPE_CLUSTER;
@@ -873,10 +888,11 @@
873888
if( p->nCChild>0 ) SYNTAX("M-card in ticket");
874889
if( p->nTag>0 ) SYNTAX("T-card in ticket");
875890
if( p->zTicketUuid==0 ) SYNTAX("missing K-card in ticket");
876891
if( p->zUser==0 ) SYNTAX("missing U-card in ticket");
877892
if( p->zAttachName ) SYNTAX("A-card in ticket");
893
+ if( p->zMimetype) SYNTAX("N-card in ticket");
878894
if( !seenZ ) SYNTAX("missing Z-card in ticket");
879895
p->type = CFTYPE_TICKET;
880896
}else if( p->zEventId ){
881897
if( p->rDate<=0.0 ) SYNTAX("missing date for event");
882898
if( p->nCChild>0 ) SYNTAX("M-card in event");
@@ -903,10 +919,11 @@
903919
if( p->rDate<=0.0 ) SYNTAX("date missing on tag");
904920
if( p->nParent>0 ) SYNTAX("P-card on tag");
905921
if( p->zWikiTitle ) SYNTAX("L-card on tag");
906922
if( p->zTicketUuid ) SYNTAX("K-card in tag");
907923
if( p->zAttachName ) SYNTAX("A-card in tag");
924
+ if( p->zMimetype ) SYNTAX("N-card in tag");
908925
if( !seenZ ) SYNTAX("missing Z-card on tag");
909926
p->type = CFTYPE_CONTROL;
910927
}else if( p->zAttachName ){
911928
if( p->nCChild>0 ) SYNTAX("M-card in attachment");
912929
if( p->rDate<=0.0 ) SYNTAX("missing date in attachment");
913930
--- src/manifest.c
+++ src/manifest.c
@@ -68,10 +68,11 @@
68 double rDate; /* Date and time from D card. 0.0 if no D card. */
69 char *zUser; /* Name of the user from the U card. */
70 char *zRepoCksum; /* MD5 checksum of the baseline content. R card. */
71 char *zWiki; /* Text of the wiki page. W card. */
72 char *zWikiTitle; /* Name of the wiki page. L card. */
 
73 double rEventDate; /* Date of an event. E card. */
74 char *zEventId; /* UUID for an event. E card. */
75 char *zTicketUuid; /* UUID for a ticket. K card. */
76 char *zAttachName; /* Filename of an attachment. A card. */
77 char *zAttachSrc; /* UUID of document being attached. A card. */
@@ -642,10 +643,23 @@
642 if( i>0 && fossil_strcmp(p->azCChild[i-1], zUuid)>=0 ){
643 SYNTAX("M-card in the wrong order");
644 }
645 break;
646 }
 
 
 
 
 
 
 
 
 
 
 
 
 
647
648 /*
649 ** P <uuid> ...
650 **
651 ** Specify one or more other artifacts where are the parents of
@@ -858,10 +872,11 @@
858 || p->zTicketUuid
859 || p->zWiki
860 || p->zWikiTitle
861 || p->zEventId
862 || p->zAttachName
 
863 ){
864 SYNTAX("cluster contains a card other than M- or Z-");
865 }
866 if( !seenZ ) SYNTAX("missing Z-card on cluster");
867 p->type = CFTYPE_CLUSTER;
@@ -873,10 +888,11 @@
873 if( p->nCChild>0 ) SYNTAX("M-card in ticket");
874 if( p->nTag>0 ) SYNTAX("T-card in ticket");
875 if( p->zTicketUuid==0 ) SYNTAX("missing K-card in ticket");
876 if( p->zUser==0 ) SYNTAX("missing U-card in ticket");
877 if( p->zAttachName ) SYNTAX("A-card in ticket");
 
878 if( !seenZ ) SYNTAX("missing Z-card in ticket");
879 p->type = CFTYPE_TICKET;
880 }else if( p->zEventId ){
881 if( p->rDate<=0.0 ) SYNTAX("missing date for event");
882 if( p->nCChild>0 ) SYNTAX("M-card in event");
@@ -903,10 +919,11 @@
903 if( p->rDate<=0.0 ) SYNTAX("date missing on tag");
904 if( p->nParent>0 ) SYNTAX("P-card on tag");
905 if( p->zWikiTitle ) SYNTAX("L-card on tag");
906 if( p->zTicketUuid ) SYNTAX("K-card in tag");
907 if( p->zAttachName ) SYNTAX("A-card in tag");
 
908 if( !seenZ ) SYNTAX("missing Z-card on tag");
909 p->type = CFTYPE_CONTROL;
910 }else if( p->zAttachName ){
911 if( p->nCChild>0 ) SYNTAX("M-card in attachment");
912 if( p->rDate<=0.0 ) SYNTAX("missing date in attachment");
913
--- src/manifest.c
+++ src/manifest.c
@@ -68,10 +68,11 @@
68 double rDate; /* Date and time from D card. 0.0 if no D card. */
69 char *zUser; /* Name of the user from the U card. */
70 char *zRepoCksum; /* MD5 checksum of the baseline content. R card. */
71 char *zWiki; /* Text of the wiki page. W card. */
72 char *zWikiTitle; /* Name of the wiki page. L card. */
73 char *zMimetype; /* Mime type of wiki or comment text. N card. */
74 double rEventDate; /* Date of an event. E card. */
75 char *zEventId; /* UUID for an event. E card. */
76 char *zTicketUuid; /* UUID for a ticket. K card. */
77 char *zAttachName; /* Filename of an attachment. A card. */
78 char *zAttachSrc; /* UUID of document being attached. A card. */
@@ -642,10 +643,23 @@
643 if( i>0 && fossil_strcmp(p->azCChild[i-1], zUuid)>=0 ){
644 SYNTAX("M-card in the wrong order");
645 }
646 break;
647 }
648
649 /*
650 ** N <uuid>
651 **
652 ** An N-line identifies the mimetype of wiki or comment text.
653 */
654 case 'N': {
655 if( p->zMimetype!=0 ) SYNTAX("more than one N-card");
656 p->zMimetype = next_token(&x,0);
657 if( p->zMimetype==0 ) SYNTAX("missing mimetype on N-card");
658 defossilize(p->zMimetype);
659 break;
660 }
661
662 /*
663 ** P <uuid> ...
664 **
665 ** Specify one or more other artifacts where are the parents of
@@ -858,10 +872,11 @@
872 || p->zTicketUuid
873 || p->zWiki
874 || p->zWikiTitle
875 || p->zEventId
876 || p->zAttachName
877 || p->zMimetype
878 ){
879 SYNTAX("cluster contains a card other than M- or Z-");
880 }
881 if( !seenZ ) SYNTAX("missing Z-card on cluster");
882 p->type = CFTYPE_CLUSTER;
@@ -873,10 +888,11 @@
888 if( p->nCChild>0 ) SYNTAX("M-card in ticket");
889 if( p->nTag>0 ) SYNTAX("T-card in ticket");
890 if( p->zTicketUuid==0 ) SYNTAX("missing K-card in ticket");
891 if( p->zUser==0 ) SYNTAX("missing U-card in ticket");
892 if( p->zAttachName ) SYNTAX("A-card in ticket");
893 if( p->zMimetype) SYNTAX("N-card in ticket");
894 if( !seenZ ) SYNTAX("missing Z-card in ticket");
895 p->type = CFTYPE_TICKET;
896 }else if( p->zEventId ){
897 if( p->rDate<=0.0 ) SYNTAX("missing date for event");
898 if( p->nCChild>0 ) SYNTAX("M-card in event");
@@ -903,10 +919,11 @@
919 if( p->rDate<=0.0 ) SYNTAX("date missing on tag");
920 if( p->nParent>0 ) SYNTAX("P-card on tag");
921 if( p->zWikiTitle ) SYNTAX("L-card on tag");
922 if( p->zTicketUuid ) SYNTAX("K-card in tag");
923 if( p->zAttachName ) SYNTAX("A-card in tag");
924 if( p->zMimetype ) SYNTAX("N-card in tag");
925 if( !seenZ ) SYNTAX("missing Z-card on tag");
926 p->type = CFTYPE_CONTROL;
927 }else if( p->zAttachName ){
928 if( p->nCChild>0 ) SYNTAX("M-card in attachment");
929 if( p->rDate<=0.0 ) SYNTAX("missing date in attachment");
930
--- src/markdown.c
+++ src/markdown.c
@@ -17,12 +17,10 @@
1717
**
1818
** This file contains code to parse a blob containing markdown text,
1919
** using an external renderer.
2020
*/
2121
22
-#ifdef FOSSIL_ENABLE_MARKDOWN
23
-
2422
#include "config.h"
2523
#include "markdown.h"
2624
2725
#include <assert.h>
2826
#include <string.h>
@@ -2238,7 +2236,5 @@
22382236
}
22392237
blob_zero(&rndr.refs);
22402238
blobarray_zero(rndr.work, rndr.make.max_work_stack);
22412239
fossil_free(rndr.work);
22422240
}
2243
-
2244
-#endif /* def FOSSIL_ENABLE_MARKDOWN */
22452241
--- src/markdown.c
+++ src/markdown.c
@@ -17,12 +17,10 @@
17 **
18 ** This file contains code to parse a blob containing markdown text,
19 ** using an external renderer.
20 */
21
22 #ifdef FOSSIL_ENABLE_MARKDOWN
23
24 #include "config.h"
25 #include "markdown.h"
26
27 #include <assert.h>
28 #include <string.h>
@@ -2238,7 +2236,5 @@
2238 }
2239 blob_zero(&rndr.refs);
2240 blobarray_zero(rndr.work, rndr.make.max_work_stack);
2241 fossil_free(rndr.work);
2242 }
2243
2244 #endif /* def FOSSIL_ENABLE_MARKDOWN */
2245
--- src/markdown.c
+++ src/markdown.c
@@ -17,12 +17,10 @@
17 **
18 ** This file contains code to parse a blob containing markdown text,
19 ** using an external renderer.
20 */
21
 
 
22 #include "config.h"
23 #include "markdown.h"
24
25 #include <assert.h>
26 #include <string.h>
@@ -2238,7 +2236,5 @@
2236 }
2237 blob_zero(&rndr.refs);
2238 blobarray_zero(rndr.work, rndr.make.max_work_stack);
2239 fossil_free(rndr.work);
2240 }
 
 
2241
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -17,12 +17,10 @@
1717
**
1818
** This file contains callbacks for the markdown parser that generate
1919
** XHTML output.
2020
*/
2121
22
-#ifdef FOSSIL_ENABLE_MARKDOWN
23
-
2422
#include "config.h"
2523
#include "markdown_html.h"
2624
2725
#if INTERFACE
2826
@@ -405,7 +403,5 @@
405403
};
406404
blob_reset(output_title);
407405
blob_reset(output_body);
408406
markdown(output_body, input_markdown, &html_renderer);
409407
}
410
-
411
-#endif /* def FOSSIL_ENABLE_MARKDOWN */
412408
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -17,12 +17,10 @@
17 **
18 ** This file contains callbacks for the markdown parser that generate
19 ** XHTML output.
20 */
21
22 #ifdef FOSSIL_ENABLE_MARKDOWN
23
24 #include "config.h"
25 #include "markdown_html.h"
26
27 #if INTERFACE
28
@@ -405,7 +403,5 @@
405 };
406 blob_reset(output_title);
407 blob_reset(output_body);
408 markdown(output_body, input_markdown, &html_renderer);
409 }
410
411 #endif /* def FOSSIL_ENABLE_MARKDOWN */
412
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -17,12 +17,10 @@
17 **
18 ** This file contains callbacks for the markdown parser that generate
19 ** XHTML output.
20 */
21
 
 
22 #include "config.h"
23 #include "markdown_html.h"
24
25 #if INTERFACE
26
@@ -405,7 +403,5 @@
403 };
404 blob_reset(output_title);
405 blob_reset(output_body);
406 markdown(output_body, input_markdown, &html_renderer);
407 }
 
 
408
--- src/th_main.c
+++ src/th_main.c
@@ -304,15 +304,13 @@
304304
#if defined(FOSSIL_ENABLE_JSON)
305305
else if( 0 == fossil_strnicmp( zArg, "json", 4 ) ){
306306
rc = 1;
307307
}
308308
#endif
309
-#if defined(FOSSIL_ENABLE_MARKDOWN)
310309
else if( 0 == fossil_strnicmp( zArg, "markdown", 8 ) ){
311310
rc = 1;
312311
}
313
-#endif
314312
if( g.thTrace ){
315313
Th_Trace("[hasfeature %#h] => %d<br />\n", argl[1], zArg, rc);
316314
}
317315
Th_SetResultInt(interp, rc);
318316
return TH_OK;
319317
320318
ADDED test/markdown-test1.md
--- src/th_main.c
+++ src/th_main.c
@@ -304,15 +304,13 @@
304 #if defined(FOSSIL_ENABLE_JSON)
305 else if( 0 == fossil_strnicmp( zArg, "json", 4 ) ){
306 rc = 1;
307 }
308 #endif
309 #if defined(FOSSIL_ENABLE_MARKDOWN)
310 else if( 0 == fossil_strnicmp( zArg, "markdown", 8 ) ){
311 rc = 1;
312 }
313 #endif
314 if( g.thTrace ){
315 Th_Trace("[hasfeature %#h] => %d<br />\n", argl[1], zArg, rc);
316 }
317 Th_SetResultInt(interp, rc);
318 return TH_OK;
319
320 DDED test/markdown-test1.md
--- src/th_main.c
+++ src/th_main.c
@@ -304,15 +304,13 @@
304 #if defined(FOSSIL_ENABLE_JSON)
305 else if( 0 == fossil_strnicmp( zArg, "json", 4 ) ){
306 rc = 1;
307 }
308 #endif
 
309 else if( 0 == fossil_strnicmp( zArg, "markdown", 8 ) ){
310 rc = 1;
311 }
 
312 if( g.thTrace ){
313 Th_Trace("[hasfeature %#h] => %d<br />\n", argl[1], zArg, rc);
314 }
315 Th_SetResultInt(interp, rc);
316 return TH_OK;
317
318 DDED test/markdown-test1.md
--- a/test/markdown-test1.md
+++ b/test/markdown-test1.md
@@ -0,0 +1,25 @@
1
+
2
+Markdown Formatter Test Document
3
+================================
4
+
5
+This document is designed to test the markdown formatter.
6
+
7
+ * A bullet item.
8
+ * A subitem
9
+ * Second bullet
10
+
11
+More text
12
+
13
+ 1. Enumeration
14
+ 1.1. Subitem 1
15
+ 1.2. Subitem 2
16
+ 2. Second enumeration.
17
+
18
+Another paragraph.
19
+
20
+
21
+
22
+Other Features
23
+--------------
24
+
25
+Text can show *emphasis* or _emphasis_ or **strong emphassis**.
--- a/test/markdown-test1.md
+++ b/test/markdown-test1.md
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/test/markdown-test1.md
+++ b/test/markdown-test1.md
@@ -0,0 +1,25 @@
1
2 Markdown Formatter Test Document
3 ================================
4
5 This document is designed to test the markdown formatter.
6
7 * A bullet item.
8 * A subitem
9 * Second bullet
10
11 More text
12
13 1. Enumeration
14 1.1. Subitem 1
15 1.2. Subitem 2
16 2. Second enumeration.
17
18 Another paragraph.
19
20
21
22 Other Features
23 --------------
24
25 Text can show *emphasis* or _emphasis_ or **strong emphassis**.
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -44,14 +44,10 @@
4444
4545
#### Enable JSON (http://www.json.org) support using "cson"
4646
#
4747
# FOSSIL_ENABLE_JSON = 1
4848
49
-#### Enable markdown support
50
-#
51
-# FOSSIL_ENABLE_MARKDOWN = 1
52
-
5349
#### Enable HTTPS support via OpenSSL (links to libssl and libcrypto)
5450
#
5551
# FOSSIL_ENABLE_SSL = 1
5652
5753
#### Enable scripting support via Tcl/Tk
@@ -189,16 +185,10 @@
189185
ifdef FOSSIL_ENABLE_JSON
190186
TCC += -DFOSSIL_ENABLE_JSON=1
191187
RCC += -DFOSSIL_ENABLE_JSON=1
192188
endif
193189
194
-# With markdown support
195
-ifdef FOSSIL_ENABLE_MARKDOWN
196
-TCC += -DFOSSIL_ENABLE_MARKDOWN=1
197
-RCC += -DFOSSIL_ENABLE_MARKDOWN=1
198
-endif
199
-
200190
#### We add the -static option here so that we can build a static
201191
# executable that will run in a chroot jail.
202192
#
203193
LIB = -static
204194
205195
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -44,14 +44,10 @@
44
45 #### Enable JSON (http://www.json.org) support using "cson"
46 #
47 # FOSSIL_ENABLE_JSON = 1
48
49 #### Enable markdown support
50 #
51 # FOSSIL_ENABLE_MARKDOWN = 1
52
53 #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto)
54 #
55 # FOSSIL_ENABLE_SSL = 1
56
57 #### Enable scripting support via Tcl/Tk
@@ -189,16 +185,10 @@
189 ifdef FOSSIL_ENABLE_JSON
190 TCC += -DFOSSIL_ENABLE_JSON=1
191 RCC += -DFOSSIL_ENABLE_JSON=1
192 endif
193
194 # With markdown support
195 ifdef FOSSIL_ENABLE_MARKDOWN
196 TCC += -DFOSSIL_ENABLE_MARKDOWN=1
197 RCC += -DFOSSIL_ENABLE_MARKDOWN=1
198 endif
199
200 #### We add the -static option here so that we can build a static
201 # executable that will run in a chroot jail.
202 #
203 LIB = -static
204
205
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -44,14 +44,10 @@
44
45 #### Enable JSON (http://www.json.org) support using "cson"
46 #
47 # FOSSIL_ENABLE_JSON = 1
48
 
 
 
 
49 #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto)
50 #
51 # FOSSIL_ENABLE_SSL = 1
52
53 #### Enable scripting support via Tcl/Tk
@@ -189,16 +185,10 @@
185 ifdef FOSSIL_ENABLE_JSON
186 TCC += -DFOSSIL_ENABLE_JSON=1
187 RCC += -DFOSSIL_ENABLE_JSON=1
188 endif
189
 
 
 
 
 
 
190 #### We add the -static option here so that we can build a static
191 # executable that will run in a chroot jail.
192 #
193 LIB = -static
194
195
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -26,13 +26,10 @@
2626
ZLIB = zlib.lib
2727
2828
# Uncomment to enable JSON API
2929
# FOSSIL_ENABLE_JSON = 1
3030
31
-# Uncomment to enable markdown support
32
-# FOSSIL_ENABLE_MARKDOWN = 1
33
-
3431
INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR)
3532
3633
CFLAGS = -nologo -MT -O2
3734
BCC = $(CC) $(CFLAGS)
3835
TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL)
@@ -43,15 +40,10 @@
4340
!ifdef FOSSIL_ENABLE_JSON
4441
TCC = $(TCC) -DFOSSIL_ENABLE_JSON
4542
RCC = $(RCC) -DFOSSIL_ENABLE_JSON
4643
!endif
4744
48
-!ifdef FOSSIL_ENABLE_MARKDOWN
49
-TCC = $(TCC) -DFOSSIL_ENABLE_MARKDOWN
50
-RCC = $(RCC) -DFOSSIL_ENABLE_MARKDOWN
51
-!endif
52
-
5345
SQLITE_OPTIONS = /DSQLITE_OMIT_LOAD_EXTENSION=1 \
5446
/DSQLITE_THREADSAFE=0 \
5547
/DSQLITE_DEFAULT_FILE_FORMAT=4 \
5648
/DSQLITE_ENABLE_STAT3 \
5749
/Dlocaltime=fossil_localtime \
5850
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -26,13 +26,10 @@
26 ZLIB = zlib.lib
27
28 # Uncomment to enable JSON API
29 # FOSSIL_ENABLE_JSON = 1
30
31 # Uncomment to enable markdown support
32 # FOSSIL_ENABLE_MARKDOWN = 1
33
34 INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR)
35
36 CFLAGS = -nologo -MT -O2
37 BCC = $(CC) $(CFLAGS)
38 TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL)
@@ -43,15 +40,10 @@
43 !ifdef FOSSIL_ENABLE_JSON
44 TCC = $(TCC) -DFOSSIL_ENABLE_JSON
45 RCC = $(RCC) -DFOSSIL_ENABLE_JSON
46 !endif
47
48 !ifdef FOSSIL_ENABLE_MARKDOWN
49 TCC = $(TCC) -DFOSSIL_ENABLE_MARKDOWN
50 RCC = $(RCC) -DFOSSIL_ENABLE_MARKDOWN
51 !endif
52
53 SQLITE_OPTIONS = /DSQLITE_OMIT_LOAD_EXTENSION=1 \
54 /DSQLITE_THREADSAFE=0 \
55 /DSQLITE_DEFAULT_FILE_FORMAT=4 \
56 /DSQLITE_ENABLE_STAT3 \
57 /Dlocaltime=fossil_localtime \
58
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -26,13 +26,10 @@
26 ZLIB = zlib.lib
27
28 # Uncomment to enable JSON API
29 # FOSSIL_ENABLE_JSON = 1
30
 
 
 
31 INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR)
32
33 CFLAGS = -nologo -MT -O2
34 BCC = $(CC) $(CFLAGS)
35 TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL)
@@ -43,15 +40,10 @@
40 !ifdef FOSSIL_ENABLE_JSON
41 TCC = $(TCC) -DFOSSIL_ENABLE_JSON
42 RCC = $(RCC) -DFOSSIL_ENABLE_JSON
43 !endif
44
 
 
 
 
 
45 SQLITE_OPTIONS = /DSQLITE_OMIT_LOAD_EXTENSION=1 \
46 /DSQLITE_THREADSAFE=0 \
47 /DSQLITE_DEFAULT_FILE_FORMAT=4 \
48 /DSQLITE_ENABLE_STAT3 \
49 /Dlocaltime=fossil_localtime \
50
--- www/fileformat.wiki
+++ www/fileformat.wiki
@@ -99,10 +99,11 @@
9999
<blockquote>
100100
<b>B</b> <i>baseline-manifest</i><br>
101101
<b>C</b> <i>checkin-comment</i><br>
102102
<b>D</b> <i>time-and-date-stamp</i><br>
103103
<b>F</b> <i>filename</i> <i>SHA1-hash</i> <i>permissions</i> <i>old-name</i><br>
104
+<b>N</b> <i>mimetype</i><br>
104105
<b>P</b> <i>SHA1-hash</i>+<br>
105106
<b>Q</b> (<b>+</b>|<b>-</b>)<i>SHA1-hash ?SHA1-hash?</i><br>
106107
<b>R</b> <i>repository-checksum</i><br>
107108
<b>T</b> (<b>+</b>|<b>-</b>|<b>*</b>)<i>tag-name <b>*</b> ?value?</i><br>
108109
<b>U</b> <i>user-login</i><br>
@@ -158,10 +159,14 @@
158159
if desired but is optional. The file format might be extended with
159160
new permission letters in the future.
160161
The optional 4th argument is the name of the same file as it existed in
161162
the parent check-in. If the name of the file is unchanged from its
162163
parent, then the 4th argument is omitted.
164
+
165
+A manifest has zero or one N-cards. The N-card specifies the mimetype for the
166
+text in the comment of the C-card. If the N-card is omitted, a default mimetype
167
+is used.
163168
164169
A manifest has zero or one P-cards. Most manifests have one P-card.
165170
The P-card has a varying number of arguments that
166171
defines other manifests from which the current manifest
167172
is derived. Each argument is an 40-character lowercase
@@ -343,19 +348,23 @@
343348
the following card types:
344349
345350
<blockquote>
346351
<b>D</b> <i>time-and-date-stamp</i><br />
347352
<b>L</b> <i>wiki-title</i><br />
353
+<b>N</b> <i>mimetype</i><br />
348354
<b>P</b> <i>parent-artifact-id</i>+<br />
349355
<b>U</b> <i>user-name</i><br />
350356
<b>W</b> <i>size</i> <b>\n</b> <i>text</i> <b>\n</b><br />
351357
<b>Z</b> <i>checksum</i>
352358
</blockquote>
353359
354360
The D card is the date and time when the wiki page was edited.
355361
The P card specifies the parent wiki pages, if any. The L card
356
-gives the name of the wiki page. The U card specifies the login
362
+gives the name of the wiki page. The optional N card specifies
363
+the mimetype of the wiki text. If the N card is omitted, the
364
+mimetype is assumed to be text/x-fossil.
365
+The U card specifies the login
357366
of the user who made this edit to the wiki page. The Z card is
358367
the usual checksum over the either artifact and is required.
359368
360369
The W card is used to specify the text of the wiki page. The
361370
argument to the W card is an integer which is the number of bytes
@@ -422,10 +431,11 @@
422431
423432
<blockquote>
424433
<b>A</b> <i>filename target</i> ?<i>source</i>?<br />
425434
<b>C</b> <i>comment</i><br />
426435
<b>D</b> <i>time-and-date-stamp</i><br />
436
+<b>N</b> <i>mimetype</i><br />
427437
<b>U</b> <i>user-name</i><br />
428438
<b>Z</b> <i>checksum</i>
429439
</blockquote>
430440
431441
The A card specifies a filename for the attachment in its first argument.
@@ -438,10 +448,14 @@
438448
The C card is an optional comment describing what the attachment is about.
439449
The C card is optional, but there can only be one.
440450
441451
A single D card is required to give the date and time when the attachment
442452
was applied.
453
+
454
+There may be zero or one N cards. The N card specifies the mimetype of the
455
+comment text provided in the C card. If the N card is omitted, the C card
456
+mimetype is taken to be text/plain.
443457
444458
A single U card gives the name of the user to added the attachment.
445459
If an attachment is added anonymously, then the U card may be omitted.
446460
447461
The Z card is the usual checksum over the rest of the attachment artifact.
@@ -459,10 +473,11 @@
459473
460474
<blockquote>
461475
<b>C</b> <i>comment</i><br>
462476
<b>D</b> <i>time-and-date-stamp</i><br />
463477
<b>E</b> <i>event-time</i> <i>event-id</i><br />
478
+<b>N</b> <i>mimetype</i><br />
464479
<b>P</b> <i>parent-artifact-id</i>+<br />
465480
<b>T</b> <b>+</b><i>tag-name</i> <b>*</b> <i>value</i><br />
466481
<b>U</b> <i>user-name</i><br />
467482
<b>W</b> <i>size</i> <b>\n</b> <i>text</i> <b>\n</b><br />
468483
<b>Z</b> <i>checksum</i>
@@ -478,10 +493,15 @@
478493
A single E card gives the time of the event (the point on the timeline
479494
where the event is displayed) and a unique identifier for the event.
480495
When there are multiple artifacts with the same event-id, the one with
481496
the most recent D card is the only one used. The event-id must be a
482497
40-character lower-case hexadecimal string.
498
+
499
+The optional N card specifies the mimetype of the text of the event
500
+that is contained in the W card. If the N card is omitted, then the
501
+W card text mimetype is assumed to be text/x-fossil, which is the
502
+Fossil wiki format.
483503
484504
The option P card specifies a prior event with the same event-id from
485505
which the current event is an edit. The P card is a hint to the system
486506
that it might be space efficient to store one event as a delta of the
487507
other.
@@ -628,10 +648,20 @@
628648
<td align=center>&nbsp;</td>
629649
<td align=center>&nbsp;</td>
630650
<td align=center>&nbsp;</td>
631651
<td align=center>&nbsp;</td>
632652
</tr>
653
+<tr>
654
+<td><b>N</b> <i>mimetype</i></td>
655
+<td align=center><b>X</b></td>
656
+<td align=center>&nbsp;</td>
657
+<td align=center>&nbsp;</td>
658
+<td align=center><b>X</b></td>
659
+<td align=center>&nbsp;</td>
660
+<td align=center><b>X</b></td>
661
+<td align=center><b>X</b></td>
662
+</tr>
633663
<tr>
634664
<td><b>P</b> <i>uuid ...</i></td>
635665
<td align=center><b>X</b></td>
636666
<td align=center>&nbsp;</td>
637667
<td align=center>&nbsp;</td>
638668
--- www/fileformat.wiki
+++ www/fileformat.wiki
@@ -99,10 +99,11 @@
99 <blockquote>
100 <b>B</b> <i>baseline-manifest</i><br>
101 <b>C</b> <i>checkin-comment</i><br>
102 <b>D</b> <i>time-and-date-stamp</i><br>
103 <b>F</b> <i>filename</i> <i>SHA1-hash</i> <i>permissions</i> <i>old-name</i><br>
 
104 <b>P</b> <i>SHA1-hash</i>+<br>
105 <b>Q</b> (<b>+</b>|<b>-</b>)<i>SHA1-hash ?SHA1-hash?</i><br>
106 <b>R</b> <i>repository-checksum</i><br>
107 <b>T</b> (<b>+</b>|<b>-</b>|<b>*</b>)<i>tag-name <b>*</b> ?value?</i><br>
108 <b>U</b> <i>user-login</i><br>
@@ -158,10 +159,14 @@
158 if desired but is optional. The file format might be extended with
159 new permission letters in the future.
160 The optional 4th argument is the name of the same file as it existed in
161 the parent check-in. If the name of the file is unchanged from its
162 parent, then the 4th argument is omitted.
 
 
 
 
163
164 A manifest has zero or one P-cards. Most manifests have one P-card.
165 The P-card has a varying number of arguments that
166 defines other manifests from which the current manifest
167 is derived. Each argument is an 40-character lowercase
@@ -343,19 +348,23 @@
343 the following card types:
344
345 <blockquote>
346 <b>D</b> <i>time-and-date-stamp</i><br />
347 <b>L</b> <i>wiki-title</i><br />
 
348 <b>P</b> <i>parent-artifact-id</i>+<br />
349 <b>U</b> <i>user-name</i><br />
350 <b>W</b> <i>size</i> <b>\n</b> <i>text</i> <b>\n</b><br />
351 <b>Z</b> <i>checksum</i>
352 </blockquote>
353
354 The D card is the date and time when the wiki page was edited.
355 The P card specifies the parent wiki pages, if any. The L card
356 gives the name of the wiki page. The U card specifies the login
 
 
 
357 of the user who made this edit to the wiki page. The Z card is
358 the usual checksum over the either artifact and is required.
359
360 The W card is used to specify the text of the wiki page. The
361 argument to the W card is an integer which is the number of bytes
@@ -422,10 +431,11 @@
422
423 <blockquote>
424 <b>A</b> <i>filename target</i> ?<i>source</i>?<br />
425 <b>C</b> <i>comment</i><br />
426 <b>D</b> <i>time-and-date-stamp</i><br />
 
427 <b>U</b> <i>user-name</i><br />
428 <b>Z</b> <i>checksum</i>
429 </blockquote>
430
431 The A card specifies a filename for the attachment in its first argument.
@@ -438,10 +448,14 @@
438 The C card is an optional comment describing what the attachment is about.
439 The C card is optional, but there can only be one.
440
441 A single D card is required to give the date and time when the attachment
442 was applied.
 
 
 
 
443
444 A single U card gives the name of the user to added the attachment.
445 If an attachment is added anonymously, then the U card may be omitted.
446
447 The Z card is the usual checksum over the rest of the attachment artifact.
@@ -459,10 +473,11 @@
459
460 <blockquote>
461 <b>C</b> <i>comment</i><br>
462 <b>D</b> <i>time-and-date-stamp</i><br />
463 <b>E</b> <i>event-time</i> <i>event-id</i><br />
 
464 <b>P</b> <i>parent-artifact-id</i>+<br />
465 <b>T</b> <b>+</b><i>tag-name</i> <b>*</b> <i>value</i><br />
466 <b>U</b> <i>user-name</i><br />
467 <b>W</b> <i>size</i> <b>\n</b> <i>text</i> <b>\n</b><br />
468 <b>Z</b> <i>checksum</i>
@@ -478,10 +493,15 @@
478 A single E card gives the time of the event (the point on the timeline
479 where the event is displayed) and a unique identifier for the event.
480 When there are multiple artifacts with the same event-id, the one with
481 the most recent D card is the only one used. The event-id must be a
482 40-character lower-case hexadecimal string.
 
 
 
 
 
483
484 The option P card specifies a prior event with the same event-id from
485 which the current event is an edit. The P card is a hint to the system
486 that it might be space efficient to store one event as a delta of the
487 other.
@@ -628,10 +648,20 @@
628 <td align=center>&nbsp;</td>
629 <td align=center>&nbsp;</td>
630 <td align=center>&nbsp;</td>
631 <td align=center>&nbsp;</td>
632 </tr>
 
 
 
 
 
 
 
 
 
 
633 <tr>
634 <td><b>P</b> <i>uuid ...</i></td>
635 <td align=center><b>X</b></td>
636 <td align=center>&nbsp;</td>
637 <td align=center>&nbsp;</td>
638
--- www/fileformat.wiki
+++ www/fileformat.wiki
@@ -99,10 +99,11 @@
99 <blockquote>
100 <b>B</b> <i>baseline-manifest</i><br>
101 <b>C</b> <i>checkin-comment</i><br>
102 <b>D</b> <i>time-and-date-stamp</i><br>
103 <b>F</b> <i>filename</i> <i>SHA1-hash</i> <i>permissions</i> <i>old-name</i><br>
104 <b>N</b> <i>mimetype</i><br>
105 <b>P</b> <i>SHA1-hash</i>+<br>
106 <b>Q</b> (<b>+</b>|<b>-</b>)<i>SHA1-hash ?SHA1-hash?</i><br>
107 <b>R</b> <i>repository-checksum</i><br>
108 <b>T</b> (<b>+</b>|<b>-</b>|<b>*</b>)<i>tag-name <b>*</b> ?value?</i><br>
109 <b>U</b> <i>user-login</i><br>
@@ -158,10 +159,14 @@
159 if desired but is optional. The file format might be extended with
160 new permission letters in the future.
161 The optional 4th argument is the name of the same file as it existed in
162 the parent check-in. If the name of the file is unchanged from its
163 parent, then the 4th argument is omitted.
164
165 A manifest has zero or one N-cards. The N-card specifies the mimetype for the
166 text in the comment of the C-card. If the N-card is omitted, a default mimetype
167 is used.
168
169 A manifest has zero or one P-cards. Most manifests have one P-card.
170 The P-card has a varying number of arguments that
171 defines other manifests from which the current manifest
172 is derived. Each argument is an 40-character lowercase
@@ -343,19 +348,23 @@
348 the following card types:
349
350 <blockquote>
351 <b>D</b> <i>time-and-date-stamp</i><br />
352 <b>L</b> <i>wiki-title</i><br />
353 <b>N</b> <i>mimetype</i><br />
354 <b>P</b> <i>parent-artifact-id</i>+<br />
355 <b>U</b> <i>user-name</i><br />
356 <b>W</b> <i>size</i> <b>\n</b> <i>text</i> <b>\n</b><br />
357 <b>Z</b> <i>checksum</i>
358 </blockquote>
359
360 The D card is the date and time when the wiki page was edited.
361 The P card specifies the parent wiki pages, if any. The L card
362 gives the name of the wiki page. The optional N card specifies
363 the mimetype of the wiki text. If the N card is omitted, the
364 mimetype is assumed to be text/x-fossil.
365 The U card specifies the login
366 of the user who made this edit to the wiki page. The Z card is
367 the usual checksum over the either artifact and is required.
368
369 The W card is used to specify the text of the wiki page. The
370 argument to the W card is an integer which is the number of bytes
@@ -422,10 +431,11 @@
431
432 <blockquote>
433 <b>A</b> <i>filename target</i> ?<i>source</i>?<br />
434 <b>C</b> <i>comment</i><br />
435 <b>D</b> <i>time-and-date-stamp</i><br />
436 <b>N</b> <i>mimetype</i><br />
437 <b>U</b> <i>user-name</i><br />
438 <b>Z</b> <i>checksum</i>
439 </blockquote>
440
441 The A card specifies a filename for the attachment in its first argument.
@@ -438,10 +448,14 @@
448 The C card is an optional comment describing what the attachment is about.
449 The C card is optional, but there can only be one.
450
451 A single D card is required to give the date and time when the attachment
452 was applied.
453
454 There may be zero or one N cards. The N card specifies the mimetype of the
455 comment text provided in the C card. If the N card is omitted, the C card
456 mimetype is taken to be text/plain.
457
458 A single U card gives the name of the user to added the attachment.
459 If an attachment is added anonymously, then the U card may be omitted.
460
461 The Z card is the usual checksum over the rest of the attachment artifact.
@@ -459,10 +473,11 @@
473
474 <blockquote>
475 <b>C</b> <i>comment</i><br>
476 <b>D</b> <i>time-and-date-stamp</i><br />
477 <b>E</b> <i>event-time</i> <i>event-id</i><br />
478 <b>N</b> <i>mimetype</i><br />
479 <b>P</b> <i>parent-artifact-id</i>+<br />
480 <b>T</b> <b>+</b><i>tag-name</i> <b>*</b> <i>value</i><br />
481 <b>U</b> <i>user-name</i><br />
482 <b>W</b> <i>size</i> <b>\n</b> <i>text</i> <b>\n</b><br />
483 <b>Z</b> <i>checksum</i>
@@ -478,10 +493,15 @@
493 A single E card gives the time of the event (the point on the timeline
494 where the event is displayed) and a unique identifier for the event.
495 When there are multiple artifacts with the same event-id, the one with
496 the most recent D card is the only one used. The event-id must be a
497 40-character lower-case hexadecimal string.
498
499 The optional N card specifies the mimetype of the text of the event
500 that is contained in the W card. If the N card is omitted, then the
501 W card text mimetype is assumed to be text/x-fossil, which is the
502 Fossil wiki format.
503
504 The option P card specifies a prior event with the same event-id from
505 which the current event is an edit. The P card is a hint to the system
506 that it might be space efficient to store one event as a delta of the
507 other.
@@ -628,10 +648,20 @@
648 <td align=center>&nbsp;</td>
649 <td align=center>&nbsp;</td>
650 <td align=center>&nbsp;</td>
651 <td align=center>&nbsp;</td>
652 </tr>
653 <tr>
654 <td><b>N</b> <i>mimetype</i></td>
655 <td align=center><b>X</b></td>
656 <td align=center>&nbsp;</td>
657 <td align=center>&nbsp;</td>
658 <td align=center><b>X</b></td>
659 <td align=center>&nbsp;</td>
660 <td align=center><b>X</b></td>
661 <td align=center><b>X</b></td>
662 </tr>
663 <tr>
664 <td><b>P</b> <i>uuid ...</i></td>
665 <td align=center><b>X</b></td>
666 <td align=center>&nbsp;</td>
667 <td align=center>&nbsp;</td>
668

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button