https://www.mail-archive.com/[email protected]/msg24574.html
bug export --git : error: multiple updates for ref ... not allowed
Git generates errors due to fossil inappropriate export code.
Index: src/export.c
==================================================================
--- src/export.c
+++ src/export.c
@@ -695,37 +695,59 @@
db_finalize(&q);
manifest_cache_clear();
/* Output tags */
+ int allow_multiple_tag = 1;
+ int current_tag_count = 0;
+ char *zCurrentTagName = 0;
db_prepare(&q,
"SELECT tagname, rid, strftime('%%s',mtime),"
" (SELECT coalesce(euser, user) FROM event WHERE objid=rid),"
" value"
" FROM tagxref JOIN tag USING(tagid)"
" WHERE tagtype=1 AND tagname GLOB 'sym-*'"
+ " ORDER BY tagname ASC, mtime DESC"
);
while( db_step(&q)==SQLITE_ROW ){
const char *zTagname = db_column_text(&q, 0);
int rid = db_column_int(&q, 1);
char *zMark = mark_name_from_rid(rid, &unused_mark);
const char *zSecSince1970 = db_column_text(&q, 2);
const char *zUser = db_column_text(&q, 3);
const char *zValue = db_column_text(&q, 4);
+ if ( fossil_strcmp(zCurrentTagName, zTagname)!=0 ){
+ fossil_free(zCurrentTagName);
+ zCurrentTagName = mprintf("%s", zTagname);
+ current_tag_count = 0;
+ }
+ current_tag_count++;
+ if( !allow_multiple_tag && current_tag_count!=1 )
+ continue;
if( rid==0 || !bag_find(&vers, rid) ) continue;
zTagname += 4;
printf("tag ");
- print_ref(zTagname);
+ if( current_tag_count>1 ){
+ char *p = db_text(0, "SELECT %Q ||'@'||substr(uuid,1,10)"
+ " FROM blob WHERE rid=%d",
+ zTagname, rid);
+ print_ref(p);
+ fossil_free(p);
+ }else{
+ print_ref(zTagname);
+ }
printf("\nfrom %s\n", zMark);
free(zMark);
printf("tagger");
print_person(zUser);
printf(" %s +0000\n", zSecSince1970);
printf("data %d\n", zValue==NULL?0:(int)strlen(zValue)+1);
if( zValue!=NULL ) printf("%s\n",zValue);
+ printf("\n");
}
db_finalize(&q);
+ fossil_free(zCurrentTagName);
if( markfile_out!=0 ){
FILE *f;
f = fossil_fopen(markfile_out, "w");
if( f == 0 ){
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users