Diff
Not logged in

Differences From:

File src/info.c part of check-in [d5695157d0] - Deal with windows filename aliasing in the "all" command. Ticket 974618fe5a8. Also display the home directory for windows users with the "info" command since the home directory is non-obvious in windows. by drh on 2009-11-11 16:21:19. [view]

To:

File src/info.c part of check-in [6df39e37f2] - Update the "checkin" command so that the template check-in message contains a comment that shows the branch tags that will be associated with the new check-in. by drh on 2009-12-17 14:51:24. [view]

@@ -28,8 +28,26 @@
 #include "config.h"
 #include "info.h"
 #include <assert.h>
 
+/*
+** Return a string (in memory obtained from malloc) holding a
+** comma-separated list of tags that apply to check-in with
+** record-id rid.
+**
+** Return NULL if there are no such tags.
+*/
+char *info_tags_of_checkin(int rid){
+  char *zTags;
+  zTags = db_text(0, "SELECT group_concat(substr(tagname, 5), ', ')"
+                     "  FROM tagxref, tag"
+                     " WHERE tagxref.rid=%d AND tagxref.tagtype>0"
+                     "   AND tag.tagid=tagxref.tagid"
+                     "   AND tag.tagname GLOB 'sym-*'",
+                     rid);
+  return zTags;
+}
+
 
 /*
 ** Print common information about a particular record.
 **
@@ -78,14 +96,9 @@
     printf("child:        %s %s\n", zUuid, zDate);
     free(zDate);
   }
   db_finalize(&q);
-  zTags = db_text(0, "SELECT group_concat(substr(tagname, 5), ', ')"
-                     "  FROM tagxref, tag"
-                     " WHERE tagxref.rid=%d AND tagxref.tagtype>0"
-                     "   AND tag.tagid=tagxref.tagid"
-                     "   AND tag.tagname GLOB 'sym-*'",
-                     rid);
+  zTags = info_tags_of_checkin(rid);
   if( zTags && zTags[0] ){
     printf("tags:         %s\n", zTags);
   }
   free(zTags);