Diff
Not logged in

Differences From:

File src/tag.c part of check-in [b7f32a71ab] - Add web-based branch color changer. Add the "branch list" command. Simplifications to color propagation logic. by drh on 2009-01-20 22:21:24. [view]

To:

File src/tag.c part of check-in [7c7edde116] - Add the sym-trunk and newbranch tags to the root check-in when rebuilding. Also add the newbranch tag to the root check-in when creating a new repository. by drh on 2009-01-21 02:47:42. [view]

@@ -247,9 +247,9 @@
 /*
 ** Add a control record to the repository that either creates
 ** or cancels a tag.
 */
-static void tag_add_artifact(
+void tag_add_artifact(
   const char *zPrefix,        /* Prefix to prepend to tag name */
   const char *zTagname,       /* The tag to add or cancel */
   const char *zObjName,       /* Name of object attached to */
   const char *zValue,         /* Value for the tag.  Might be NULL */
@@ -294,15 +294,10 @@
   }
   blob_appendf(&ctrl, "U %F\n", g.zLogin);
   md5sum_blob(&ctrl, &cksum);
   blob_appendf(&ctrl, "Z %b\n", &cksum);
-  db_begin_transaction();
   nrid = content_put(&ctrl, 0, 0);
   manifest_crosslink(nrid, &ctrl);
-  db_end_transaction(0);
-
-  /* Do an autosync push if requested */
-  autosync(AUTOSYNC_PUSH);
 }
 
 /*
 ** COMMAND: tag
@@ -371,9 +366,11 @@
     if( g.argc!=5 && g.argc!=6 ){
       usage("add ?--raw? ?--propagate? TAGNAME CHECK-IN ?VALUE?");
     }
     zValue = g.argc==6 ? g.argv[5] : 0;
+    db_begin_transaction();
     tag_add_artifact(zPrefix, g.argv[3], g.argv[4], zValue, 1+fPropagate);
+    db_end_transaction(0);
   }else
 
   if( strncmp(g.argv[2],"branch",n)==0 ){
     fossil_fatal("the \"fossil tag branch\" command is discontinued\n"
@@ -383,9 +380,11 @@
   if( strncmp(g.argv[2],"cancel",n)==0 ){
     if( g.argc!=5 ){
       usage("cancel ?--raw? TAGNAME CHECK-IN");
     }
+    db_begin_transaction();
     tag_add_artifact(zPrefix, g.argv[3], g.argv[4], 0, 0);
+    db_end_transaction(0);
   }else
 
   if( strncmp(g.argv[2],"find",n)==0 ){
     Stmt q;