Check-in [f73c0e792b]
Not logged in
Overview

SHA1 Hash:f73c0e792b242e97c5cdd79ea3afc488bcf70551
Date: 2007-09-22 02:22:06
User: drh
Comment:More work on tags and properties. Getting late. Need to check-in changes before stopping for the day...
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified ideas.txt from [b490c09161] to [880f1290f0].

@@ -1,5 +1,21 @@
+Properties:
+
+   * Started out as tags.  AKU suggests adding a value.  That
+     seems to work well.
+   * If the name begins with "br" then it propagates to non-merge
+     children.
+   * Special tags and properties:
+      +  br-bg-color=COLOR and bg-color=COLOR  -- Set timeline BG color
+      +  comment=TEXT         -- Revise the check-in comment text
+      +  user=TEXT            -- Revise the check-in username
+      +  closed               -- Do not display as a leaf
+   * Tags and properties initially live in the tagxref table.
+   * Separate operation captured tags and properites as artifacts
+     so that they can be synced.
+
+
 Possible ticket file format:
 
    "Ticket"
    title: TEXT
    ticketid: TEXT

Modified src/manifest.c from [c80b767d9a] to [f007901442].

@@ -52,10 +52,11 @@
   int nTag;             /* Number of T lines */
   int nTagAlloc;        /* Slots allocated in aTag[] */
   struct {
     char *zName;           /* Name of the tag */
     char *zUuid;           /* UUID that the tag is applied to */
+    char *zValue;          /* Value if the tag is really a property */
   } *aTag;
 };
 #endif
 
 
@@ -216,24 +217,31 @@
         }
         break;
       }
 
       /*
-      **    T (+|-)<tagname> <uuid>
+      **    T (+|-)<tagname> <uuid> ?<value>?
       **
-      ** Create or cancel a tag.  The tagname is fossil-encoded.  The
-      ** first character must be either "+" to create or "-" to delete.
+      ** Create or cancel a tag or property.  The tagname is fossil-encoded.
+      ** The first character of the name must be either "+" to create or
+      ** "-" to cancel. The tag is applied to <uuid>.  If <value> is
+      ** provided then the tag is really a property with the given value.
       ** Tags are not allowed in clusters.  Multiple T lines are allowed.
       */
       case 'T': {
-        char *zName, *zUuid;
+        char *zName, *zUuid, *zValue;
         md5sum_step_text(blob_buffer(&line), blob_size(&line));
         if( blob_token(&line, &a1)==0 ) goto manifest_syntax_error;
         if( blob_token(&line, &a2)==0 ) goto manifest_syntax_error;
-        if( blob_token(&line, &a3)!=0 ) goto manifest_syntax_error;
         zName = blob_terminate(&a1);
         zUuid = blob_terminate(&a2);
+        if( blob_token(&line, &a3)==0 ){
+          zValue = 0;
+        }else{
+          zValue = blob_terminate(&a3);
+          defossilize(zValue);
+        }
         if( blob_size(&a2)!=UUID_SIZE ) goto manifest_syntax_error;
         if( !validate16(zUuid, UUID_SIZE) ) goto manifest_syntax_error;
         defossilize(zName);
         if( zName[0]!='-' && zName[0]!='+' ){
           goto manifest_syntax_error;
@@ -244,10 +252,11 @@
           if( p->aTag==0 ) fossil_panic("out of memory");
         }
         i = p->nTag++;
         p->aTag[i].zName = zName;
         p->aTag[i].zUuid = zUuid;
+        p->aTag[i].zValue = zValue;
         if( i>0 && strcmp(p->aTag[i-1].zName, zName)>=0 ){
           goto manifest_syntax_error;
         }
         break;
       }