Fossil SCM

Expand the scope of the new Remark artifact so that it may be attached to either a check-in or a branch.

drh 2017-01-10 19:08 UTC remarks-on-checkins
Commit b78d1a67b732c9200515b9ff973c8518b69c2ec6
2 files changed +6 -8 +14 -8
+6 -8
--- src/manifest.c
+++ src/manifest.c
@@ -78,11 +78,11 @@
7878
char *zRepoCksum; /* MD5 checksum of the baseline content. R card. */
7979
char *zWiki; /* Text of the wiki page. W card. */
8080
char *zWikiTitle; /* Name of the wiki page. L card. */
8181
char *zMimetype; /* Mime type of wiki or comment text. N card. */
8282
double rEventDate; /* Date of an event. E card. */
83
- char *zRemCkin; /* UUID of checkin to which remark attached. G card */
83
+ char *zRemTarget; /* Checkin or branch to which remark attached. G card */
8484
char *zEventId; /* UUID for an event. E card. */
8585
char *zTicketUuid; /* UUID for a ticket. K card. */
8686
char *zAttachName; /* Filename of an attachment. A card. */
8787
char *zAttachSrc; /* UUID of document being attached. A card. */
8888
char *zAttachTarget; /* Ticket or wiki that attachment applies to. A card */
@@ -581,15 +581,13 @@
581581
**
582582
** The G card records the UUID of a check-in to which a remark is
583583
** attached.
584584
*/
585585
case 'G': {
586
- if( p->zRemCkin ) SYNTAX("more than one G-card");
587
- p->zRemCkin = next_token(&x, &sz);
588
- if( sz!=UUID_SIZE || !validate16(p->zRemCkin, UUID_SIZE) ){
589
- SYNTAX("malformed UUID on G-card");
590
- }
586
+ if( p->zRemTarget ) SYNTAX("more than one G-card");
587
+ p->zRemTarget = next_token(&x, &sz);
588
+ defossilize(p->zRemTarget);
591589
break;
592590
}
593591
594592
/*
595593
** J <name> ?<value>?
@@ -897,11 +895,11 @@
897895
if( p->zAttachName
898896
|| p->zBaseline
899897
|| p->zComment
900898
|| p->rDate>0.0
901899
|| p->zEventId
902
- || p->zRemCkin
900
+ || p->zRemTarget
903901
|| p->nFile>0
904902
|| p->nField>0
905903
|| p->zTicketUuid
906904
|| p->zWikiTitle
907905
|| p->zMimetype
@@ -914,11 +912,11 @@
914912
){
915913
SYNTAX("cluster contains a card other than M- or Z-");
916914
}
917915
if( !seenZ ) SYNTAX("missing Z-card on cluster");
918916
p->type = CFTYPE_CLUSTER;
919
- }else if( p->zRemCkin ){
917
+ }else if( p->zRemTarget ){
920918
if( p->zAttachName ) SYNTAX("A-card in remark");
921919
if( p->zBaseline ) SYNTAX("B-card in remark");
922920
if( p->rDate<=0.0 ) SYNTAX("missing date on remark");
923921
if( p->zEventId ) SYNTAX("E-card in remark");
924922
if( p->nFile>0 ) SYNTAX("F-card in remark");
925923
--- src/manifest.c
+++ src/manifest.c
@@ -78,11 +78,11 @@
78 char *zRepoCksum; /* MD5 checksum of the baseline content. R card. */
79 char *zWiki; /* Text of the wiki page. W card. */
80 char *zWikiTitle; /* Name of the wiki page. L card. */
81 char *zMimetype; /* Mime type of wiki or comment text. N card. */
82 double rEventDate; /* Date of an event. E card. */
83 char *zRemCkin; /* UUID of checkin to which remark attached. G card */
84 char *zEventId; /* UUID for an event. E card. */
85 char *zTicketUuid; /* UUID for a ticket. K card. */
86 char *zAttachName; /* Filename of an attachment. A card. */
87 char *zAttachSrc; /* UUID of document being attached. A card. */
88 char *zAttachTarget; /* Ticket or wiki that attachment applies to. A card */
@@ -581,15 +581,13 @@
581 **
582 ** The G card records the UUID of a check-in to which a remark is
583 ** attached.
584 */
585 case 'G': {
586 if( p->zRemCkin ) SYNTAX("more than one G-card");
587 p->zRemCkin = next_token(&x, &sz);
588 if( sz!=UUID_SIZE || !validate16(p->zRemCkin, UUID_SIZE) ){
589 SYNTAX("malformed UUID on G-card");
590 }
591 break;
592 }
593
594 /*
595 ** J <name> ?<value>?
@@ -897,11 +895,11 @@
897 if( p->zAttachName
898 || p->zBaseline
899 || p->zComment
900 || p->rDate>0.0
901 || p->zEventId
902 || p->zRemCkin
903 || p->nFile>0
904 || p->nField>0
905 || p->zTicketUuid
906 || p->zWikiTitle
907 || p->zMimetype
@@ -914,11 +912,11 @@
914 ){
915 SYNTAX("cluster contains a card other than M- or Z-");
916 }
917 if( !seenZ ) SYNTAX("missing Z-card on cluster");
918 p->type = CFTYPE_CLUSTER;
919 }else if( p->zRemCkin ){
920 if( p->zAttachName ) SYNTAX("A-card in remark");
921 if( p->zBaseline ) SYNTAX("B-card in remark");
922 if( p->rDate<=0.0 ) SYNTAX("missing date on remark");
923 if( p->zEventId ) SYNTAX("E-card in remark");
924 if( p->nFile>0 ) SYNTAX("F-card in remark");
925
--- src/manifest.c
+++ src/manifest.c
@@ -78,11 +78,11 @@
78 char *zRepoCksum; /* MD5 checksum of the baseline content. R card. */
79 char *zWiki; /* Text of the wiki page. W card. */
80 char *zWikiTitle; /* Name of the wiki page. L card. */
81 char *zMimetype; /* Mime type of wiki or comment text. N card. */
82 double rEventDate; /* Date of an event. E card. */
83 char *zRemTarget; /* Checkin or branch to which remark attached. G card */
84 char *zEventId; /* UUID for an event. E card. */
85 char *zTicketUuid; /* UUID for a ticket. K card. */
86 char *zAttachName; /* Filename of an attachment. A card. */
87 char *zAttachSrc; /* UUID of document being attached. A card. */
88 char *zAttachTarget; /* Ticket or wiki that attachment applies to. A card */
@@ -581,15 +581,13 @@
581 **
582 ** The G card records the UUID of a check-in to which a remark is
583 ** attached.
584 */
585 case 'G': {
586 if( p->zRemTarget ) SYNTAX("more than one G-card");
587 p->zRemTarget = next_token(&x, &sz);
588 defossilize(p->zRemTarget);
 
 
589 break;
590 }
591
592 /*
593 ** J <name> ?<value>?
@@ -897,11 +895,11 @@
895 if( p->zAttachName
896 || p->zBaseline
897 || p->zComment
898 || p->rDate>0.0
899 || p->zEventId
900 || p->zRemTarget
901 || p->nFile>0
902 || p->nField>0
903 || p->zTicketUuid
904 || p->zWikiTitle
905 || p->zMimetype
@@ -914,11 +912,11 @@
912 ){
913 SYNTAX("cluster contains a card other than M- or Z-");
914 }
915 if( !seenZ ) SYNTAX("missing Z-card on cluster");
916 p->type = CFTYPE_CLUSTER;
917 }else if( p->zRemTarget ){
918 if( p->zAttachName ) SYNTAX("A-card in remark");
919 if( p->zBaseline ) SYNTAX("B-card in remark");
920 if( p->rDate<=0.0 ) SYNTAX("missing date on remark");
921 if( p->zEventId ) SYNTAX("E-card in remark");
922 if( p->nFile>0 ) SYNTAX("F-card in remark");
923
--- www/fileformat.wiki
+++ www/fileformat.wiki
@@ -534,32 +534,38 @@
534534
The Z card is the required checksum over the rest of the artifact.
535535
536536
<a name="remark"></a>
537537
<h2>8.0 Remarks</h2>
538538
539
-A remark artifact holds textual remarks that are added to a check-in.
540
-Remarks can hold expanded commentary about the check-in, notes from
541
-code-reviews, information about problems discovered in the check-in,
542
-or other auxiliary textual information about the check-in.
539
+A remark artifact holds textual remarks that are added to a check-in
540
+or branch.
541
+Remarks can hold expanded commentary about the check-in, a description
542
+about the purpose of a branch, notes from
543
+code-reviews, information about problems discovered in the check-in
544
+or branch, or other auxiliary textual information about the check-ins
545
+and branches.
543546
The remark artifact is a new artifact added to this specification in
544547
early 2017.
545548
The following cards are allowed on a remark artifact:
546549
547550
<blockquote>
548551
<b>D</b> <i>time-and-date-stamp</i><br />
549
-<b>G</b> <i>checkin-uuid</i><br />
552
+<b>G</b> <i>checkin-or-branch</i><br />
550553
<b>N</b> <i>mimetype</i><br />
551554
<b>U</b> <i>user-name</i><br />
552555
<b>W</b> <i>size</i> <b>\n</b> <i>text</i> <b>\n</b><br />
553556
<b>Z</b> <i>checksum</i>
554557
</blockquote>
555558
556559
A single D card is required to give the date and time when the
557560
remark artifact was created.
558561
559
-A single G card specifies the check-in to which the remark is
560
-attached.
562
+A single G card specifies the object to which the remark is attached.
563
+If the argment is a 40-character SHA1 hash, then it identifies a
564
+check-in. Otherwise, the argument is the name of a branch. Since
565
+branch names may whitespace, the argument to the G card is encoded
566
+in the same way as a C-card.
561567
562568
The optional N card specifies the mimetype of the text of the remark
563569
that is contained in the W card. If the N card is omitted, then the
564570
W card text mimetype is assumed to be text/x-fossil, which is the
565571
Fossil wiki format.
@@ -663,11 +669,11 @@
663669
<td>&nbsp;</td>
664670
<td>&nbsp;</td>
665671
<td>&nbsp;</td>
666672
</tr>
667673
<tr>
668
-<td><b>G</b> <i>checkin-uuid</i></td>
674
+<td><b>G</b> <i>checkin-or-branch</i></td>
669675
<td>&nbsp;</td>
670676
<td>&nbsp;</td>
671677
<td>&nbsp;</td>
672678
<td>&nbsp;</td>
673679
<td>&nbsp;</td>
674680
--- www/fileformat.wiki
+++ www/fileformat.wiki
@@ -534,32 +534,38 @@
534 The Z card is the required checksum over the rest of the artifact.
535
536 <a name="remark"></a>
537 <h2>8.0 Remarks</h2>
538
539 A remark artifact holds textual remarks that are added to a check-in.
540 Remarks can hold expanded commentary about the check-in, notes from
541 code-reviews, information about problems discovered in the check-in,
542 or other auxiliary textual information about the check-in.
 
 
 
543 The remark artifact is a new artifact added to this specification in
544 early 2017.
545 The following cards are allowed on a remark artifact:
546
547 <blockquote>
548 <b>D</b> <i>time-and-date-stamp</i><br />
549 <b>G</b> <i>checkin-uuid</i><br />
550 <b>N</b> <i>mimetype</i><br />
551 <b>U</b> <i>user-name</i><br />
552 <b>W</b> <i>size</i> <b>\n</b> <i>text</i> <b>\n</b><br />
553 <b>Z</b> <i>checksum</i>
554 </blockquote>
555
556 A single D card is required to give the date and time when the
557 remark artifact was created.
558
559 A single G card specifies the check-in to which the remark is
560 attached.
 
 
 
561
562 The optional N card specifies the mimetype of the text of the remark
563 that is contained in the W card. If the N card is omitted, then the
564 W card text mimetype is assumed to be text/x-fossil, which is the
565 Fossil wiki format.
@@ -663,11 +669,11 @@
663 <td>&nbsp;</td>
664 <td>&nbsp;</td>
665 <td>&nbsp;</td>
666 </tr>
667 <tr>
668 <td><b>G</b> <i>checkin-uuid</i></td>
669 <td>&nbsp;</td>
670 <td>&nbsp;</td>
671 <td>&nbsp;</td>
672 <td>&nbsp;</td>
673 <td>&nbsp;</td>
674
--- www/fileformat.wiki
+++ www/fileformat.wiki
@@ -534,32 +534,38 @@
534 The Z card is the required checksum over the rest of the artifact.
535
536 <a name="remark"></a>
537 <h2>8.0 Remarks</h2>
538
539 A remark artifact holds textual remarks that are added to a check-in
540 or branch.
541 Remarks can hold expanded commentary about the check-in, a description
542 about the purpose of a branch, notes from
543 code-reviews, information about problems discovered in the check-in
544 or branch, or other auxiliary textual information about the check-ins
545 and branches.
546 The remark artifact is a new artifact added to this specification in
547 early 2017.
548 The following cards are allowed on a remark artifact:
549
550 <blockquote>
551 <b>D</b> <i>time-and-date-stamp</i><br />
552 <b>G</b> <i>checkin-or-branch</i><br />
553 <b>N</b> <i>mimetype</i><br />
554 <b>U</b> <i>user-name</i><br />
555 <b>W</b> <i>size</i> <b>\n</b> <i>text</i> <b>\n</b><br />
556 <b>Z</b> <i>checksum</i>
557 </blockquote>
558
559 A single D card is required to give the date and time when the
560 remark artifact was created.
561
562 A single G card specifies the object to which the remark is attached.
563 If the argment is a 40-character SHA1 hash, then it identifies a
564 check-in. Otherwise, the argument is the name of a branch. Since
565 branch names may whitespace, the argument to the G card is encoded
566 in the same way as a C-card.
567
568 The optional N card specifies the mimetype of the text of the remark
569 that is contained in the W card. If the N card is omitted, then the
570 W card text mimetype is assumed to be text/x-fossil, which is the
571 Fossil wiki format.
@@ -663,11 +669,11 @@
669 <td>&nbsp;</td>
670 <td>&nbsp;</td>
671 <td>&nbsp;</td>
672 </tr>
673 <tr>
674 <td><b>G</b> <i>checkin-or-branch</i></td>
675 <td>&nbsp;</td>
676 <td>&nbsp;</td>
677 <td>&nbsp;</td>
678 <td>&nbsp;</td>
679 <td>&nbsp;</td>
680

Keyboard Shortcuts

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