Fossil SCM

Simplify UUID handling in ticket UI. No functional change.

jan.nijtmans 2014-04-08 09:37 trunk
Commit b18f3a5cfb8bf40e265d4743191453cf44ab7d33
1 file changed +7 -14
+7 -14
--- src/tkt.c
+++ src/tkt.c
@@ -924,17 +924,14 @@
924924
" ORDER BY 1",
925925
timeline_utc(), tagid, timeline_utc(), tagid
926926
);
927927
while( db_step(&q)==SQLITE_ROW ){
928928
Manifest *pTicket;
929
- char zShort[12];
930929
const char *zDate = db_column_text(&q, 0);
931930
int rid = db_column_int(&q, 1);
932931
const char *zChngUuid = db_column_text(&q, 2);
933932
const char *zFile = db_column_text(&q, 4);
934
- memcpy(zShort, zChngUuid, 10);
935
- zShort[10] = 0;
936933
if( nChng==0 ){
937934
@ <ol>
938935
}
939936
nChng++;
940937
if( zFile!=0 ){
@@ -946,20 +943,20 @@
946943
}else{
947944
@
948945
@ <li><p>Add attachment
949946
@ "%z(href("%R/artifact/%s",zSrc))%s(zFile)</a>"
950947
}
951
- @ [%z(href("%R/artifact/%T",zChngUuid))%s(zShort)</a>]
948
+ @ [%z(href("%R/artifact/%s",zChngUuid))%.10s(zChngUuid)</a>]
952949
@ (rid %d(rid)) by
953950
hyperlink_to_user(zUser,zDate," on");
954951
hyperlink_to_date(zDate, ".</p>");
955952
}else{
956953
pTicket = manifest_get(rid, CFTYPE_TICKET, 0);
957954
if( pTicket ){
958955
@
959956
@ <li><p>Ticket change
960
- @ [%z(href("%R/artifact/%T",zChngUuid))%s(zShort)</a>]
957
+ @ [%z(href("%R/artifact/%s",zChngUuid))%.10s(zChngUuid)</a>]
961958
@ (rid %d(rid)) by
962959
hyperlink_to_user(pTicket->zUser,zDate," on");
963960
hyperlink_to_date(zDate, ":");
964961
@ </p>
965962
ticket_output_change_artifact(pTicket, "a");
@@ -1219,35 +1216,31 @@
12191216
zTktUuid);
12201217
if( tagid==0 ){
12211218
fossil_fatal("no such ticket %h", zTktUuid);
12221219
}
12231220
db_prepare(&q,
1224
- "SELECT datetime(mtime%s), objid, uuid, NULL, NULL, NULL"
1221
+ "SELECT datetime(mtime%s), objid, NULL, NULL, NULL"
12251222
" FROM event, blob"
12261223
" WHERE objid IN (SELECT rid FROM tagxref WHERE tagid=%d)"
12271224
" AND blob.rid=event.objid"
12281225
" UNION "
1229
- "SELECT datetime(mtime%s), attachid, uuid, src, "
1230
- " filename, user"
1226
+ "SELECT datetime(mtime%s), attachid, filename, "
1227
+ " src, user"
12311228
" FROM attachment, blob"
12321229
" WHERE target=(SELECT substr(tagname,5) FROM tag WHERE tagid=%d)"
12331230
" AND blob.rid=attachid"
12341231
" ORDER BY 1 DESC",
12351232
timeline_utc(), tagid, timeline_utc(), tagid
12361233
);
12371234
while( db_step(&q)==SQLITE_ROW ){
12381235
Manifest *pTicket;
1239
- char zShort[12];
12401236
const char *zDate = db_column_text(&q, 0);
12411237
int rid = db_column_int(&q, 1);
1242
- const char *zChngUuid = db_column_text(&q, 2);
1243
- const char *zFile = db_column_text(&q, 4);
1244
- memcpy(zShort, zChngUuid, 10);
1245
- zShort[10] = 0;
1238
+ const char *zFile = db_column_text(&q, 2);
12461239
if( zFile!=0 ){
12471240
const char *zSrc = db_column_text(&q, 3);
1248
- const char *zUser = db_column_text(&q, 5);
1241
+ const char *zUser = db_column_text(&q, 4);
12491242
if( zSrc==0 || zSrc[0]==0 ){
12501243
fossil_print("Delete attachment %s\n", zFile);
12511244
}else{
12521245
fossil_print("Add attachment %s\n", zFile);
12531246
}
12541247
--- src/tkt.c
+++ src/tkt.c
@@ -924,17 +924,14 @@
924 " ORDER BY 1",
925 timeline_utc(), tagid, timeline_utc(), tagid
926 );
927 while( db_step(&q)==SQLITE_ROW ){
928 Manifest *pTicket;
929 char zShort[12];
930 const char *zDate = db_column_text(&q, 0);
931 int rid = db_column_int(&q, 1);
932 const char *zChngUuid = db_column_text(&q, 2);
933 const char *zFile = db_column_text(&q, 4);
934 memcpy(zShort, zChngUuid, 10);
935 zShort[10] = 0;
936 if( nChng==0 ){
937 @ <ol>
938 }
939 nChng++;
940 if( zFile!=0 ){
@@ -946,20 +943,20 @@
946 }else{
947 @
948 @ <li><p>Add attachment
949 @ "%z(href("%R/artifact/%s",zSrc))%s(zFile)</a>"
950 }
951 @ [%z(href("%R/artifact/%T",zChngUuid))%s(zShort)</a>]
952 @ (rid %d(rid)) by
953 hyperlink_to_user(zUser,zDate," on");
954 hyperlink_to_date(zDate, ".</p>");
955 }else{
956 pTicket = manifest_get(rid, CFTYPE_TICKET, 0);
957 if( pTicket ){
958 @
959 @ <li><p>Ticket change
960 @ [%z(href("%R/artifact/%T",zChngUuid))%s(zShort)</a>]
961 @ (rid %d(rid)) by
962 hyperlink_to_user(pTicket->zUser,zDate," on");
963 hyperlink_to_date(zDate, ":");
964 @ </p>
965 ticket_output_change_artifact(pTicket, "a");
@@ -1219,35 +1216,31 @@
1219 zTktUuid);
1220 if( tagid==0 ){
1221 fossil_fatal("no such ticket %h", zTktUuid);
1222 }
1223 db_prepare(&q,
1224 "SELECT datetime(mtime%s), objid, uuid, NULL, NULL, NULL"
1225 " FROM event, blob"
1226 " WHERE objid IN (SELECT rid FROM tagxref WHERE tagid=%d)"
1227 " AND blob.rid=event.objid"
1228 " UNION "
1229 "SELECT datetime(mtime%s), attachid, uuid, src, "
1230 " filename, user"
1231 " FROM attachment, blob"
1232 " WHERE target=(SELECT substr(tagname,5) FROM tag WHERE tagid=%d)"
1233 " AND blob.rid=attachid"
1234 " ORDER BY 1 DESC",
1235 timeline_utc(), tagid, timeline_utc(), tagid
1236 );
1237 while( db_step(&q)==SQLITE_ROW ){
1238 Manifest *pTicket;
1239 char zShort[12];
1240 const char *zDate = db_column_text(&q, 0);
1241 int rid = db_column_int(&q, 1);
1242 const char *zChngUuid = db_column_text(&q, 2);
1243 const char *zFile = db_column_text(&q, 4);
1244 memcpy(zShort, zChngUuid, 10);
1245 zShort[10] = 0;
1246 if( zFile!=0 ){
1247 const char *zSrc = db_column_text(&q, 3);
1248 const char *zUser = db_column_text(&q, 5);
1249 if( zSrc==0 || zSrc[0]==0 ){
1250 fossil_print("Delete attachment %s\n", zFile);
1251 }else{
1252 fossil_print("Add attachment %s\n", zFile);
1253 }
1254
--- src/tkt.c
+++ src/tkt.c
@@ -924,17 +924,14 @@
924 " ORDER BY 1",
925 timeline_utc(), tagid, timeline_utc(), tagid
926 );
927 while( db_step(&q)==SQLITE_ROW ){
928 Manifest *pTicket;
 
929 const char *zDate = db_column_text(&q, 0);
930 int rid = db_column_int(&q, 1);
931 const char *zChngUuid = db_column_text(&q, 2);
932 const char *zFile = db_column_text(&q, 4);
 
 
933 if( nChng==0 ){
934 @ <ol>
935 }
936 nChng++;
937 if( zFile!=0 ){
@@ -946,20 +943,20 @@
943 }else{
944 @
945 @ <li><p>Add attachment
946 @ "%z(href("%R/artifact/%s",zSrc))%s(zFile)</a>"
947 }
948 @ [%z(href("%R/artifact/%s",zChngUuid))%.10s(zChngUuid)</a>]
949 @ (rid %d(rid)) by
950 hyperlink_to_user(zUser,zDate," on");
951 hyperlink_to_date(zDate, ".</p>");
952 }else{
953 pTicket = manifest_get(rid, CFTYPE_TICKET, 0);
954 if( pTicket ){
955 @
956 @ <li><p>Ticket change
957 @ [%z(href("%R/artifact/%s",zChngUuid))%.10s(zChngUuid)</a>]
958 @ (rid %d(rid)) by
959 hyperlink_to_user(pTicket->zUser,zDate," on");
960 hyperlink_to_date(zDate, ":");
961 @ </p>
962 ticket_output_change_artifact(pTicket, "a");
@@ -1219,35 +1216,31 @@
1216 zTktUuid);
1217 if( tagid==0 ){
1218 fossil_fatal("no such ticket %h", zTktUuid);
1219 }
1220 db_prepare(&q,
1221 "SELECT datetime(mtime%s), objid, NULL, NULL, NULL"
1222 " FROM event, blob"
1223 " WHERE objid IN (SELECT rid FROM tagxref WHERE tagid=%d)"
1224 " AND blob.rid=event.objid"
1225 " UNION "
1226 "SELECT datetime(mtime%s), attachid, filename, "
1227 " src, user"
1228 " FROM attachment, blob"
1229 " WHERE target=(SELECT substr(tagname,5) FROM tag WHERE tagid=%d)"
1230 " AND blob.rid=attachid"
1231 " ORDER BY 1 DESC",
1232 timeline_utc(), tagid, timeline_utc(), tagid
1233 );
1234 while( db_step(&q)==SQLITE_ROW ){
1235 Manifest *pTicket;
 
1236 const char *zDate = db_column_text(&q, 0);
1237 int rid = db_column_int(&q, 1);
1238 const char *zFile = db_column_text(&q, 2);
 
 
 
1239 if( zFile!=0 ){
1240 const char *zSrc = db_column_text(&q, 3);
1241 const char *zUser = db_column_text(&q, 4);
1242 if( zSrc==0 || zSrc[0]==0 ){
1243 fossil_print("Delete attachment %s\n", zFile);
1244 }else{
1245 fossil_print("Add attachment %s\n", zFile);
1246 }
1247

Keyboard Shortcuts

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