Fossil SCM

Stop using 10h as the format for tech note ids. Note that the comment for any existing attachments to tech notes won't change as the comment is generated when the attachment is made (since this change is new, I'd expect there to be none outside of my own personal fossil repositories)

dave.vines 2016-03-28 12:12
Commit 4ce3c62b53694f97394962ba621a933860623f67
2 files changed +1 -1 +11 -6
+1 -1
--- src/attach.c
+++ src/attach.c
@@ -356,11 +356,11 @@
356356
zTechNote = db_text(0, "SELECT substr(tagname,7) FROM tag"
357357
" WHERE tagname GLOB 'event-%q*'", zTechNote);
358358
if( zTechNote==0) fossil_redirect_home();
359359
}
360360
zTarget = zTechNote;
361
- zTargetType = mprintf("Tech Note <a href=\"%R/technote/%h\">%h</a>",
361
+ zTargetType = mprintf("Tech Note <a href=\"%R/technote/%s\">%S</a>",
362362
zTechNote, zTechNote);
363363
364364
}else{
365365
if( g.perm.ApndTkt==0 || g.perm.Attach==0 ){
366366
login_needed(g.anon.ApndTkt && g.anon.Attach);
367367
--- src/attach.c
+++ src/attach.c
@@ -356,11 +356,11 @@
356 zTechNote = db_text(0, "SELECT substr(tagname,7) FROM tag"
357 " WHERE tagname GLOB 'event-%q*'", zTechNote);
358 if( zTechNote==0) fossil_redirect_home();
359 }
360 zTarget = zTechNote;
361 zTargetType = mprintf("Tech Note <a href=\"%R/technote/%h\">%h</a>",
362 zTechNote, zTechNote);
363
364 }else{
365 if( g.perm.ApndTkt==0 || g.perm.Attach==0 ){
366 login_needed(g.anon.ApndTkt && g.anon.Attach);
367
--- src/attach.c
+++ src/attach.c
@@ -356,11 +356,11 @@
356 zTechNote = db_text(0, "SELECT substr(tagname,7) FROM tag"
357 " WHERE tagname GLOB 'event-%q*'", zTechNote);
358 if( zTechNote==0) fossil_redirect_home();
359 }
360 zTarget = zTechNote;
361 zTargetType = mprintf("Tech Note <a href=\"%R/technote/%s\">%S</a>",
362 zTechNote, zTechNote);
363
364 }else{
365 if( g.perm.ApndTkt==0 || g.perm.Attach==0 ){
366 login_needed(g.anon.ApndTkt && g.anon.Attach);
367
+11 -6
--- src/manifest.c
+++ src/manifest.c
@@ -2066,15 +2066,17 @@
20662066
const char isAdd = (zSrc && zSrc[0]) ? 1 : 0;
20672067
char *zComment;
20682068
if( isAdd ){
20692069
zComment = mprintf(
20702070
"Add attachment [/artifact/%!S|%h] to"
2071
- " tech note [/technote/%h|%.10h]",
2071
+ " tech note [/technote/%!S|%S]",
20722072
zSrc, zName, zTarget, zTarget);
20732073
}else{
2074
- zComment = mprintf("Delete attachment \"%h\" from tech note [%.10h]",
2075
- zName, zTarget);
2074
+ zComment = mprintf(
2075
+ "Delete attachment \"%h\" from"
2076
+ " tech note [/technote/%!S|%S]",
2077
+ zName, zTarget, zTarget);
20762078
}
20772079
db_multi_exec("UPDATE event SET comment=%Q, type='e'"
20782080
" WHERE objid=%Q",
20792081
zComment, zAttachId);
20802082
fossil_free(zComment);
@@ -2162,15 +2164,18 @@
21622164
p->zAttachName, p->zAttachTarget);
21632165
}
21642166
}else if( 'e' == attachToType ){
21652167
if( isAdd ){
21662168
zComment = mprintf(
2167
- "Add attachment [/artifact/%!S|%h] to tech note [/technote/%h|%.10h]",
2169
+ "Add attachment [/artifact/%!S|%h] to tech note [/technote/%!S|%S]",
21682170
p->zAttachSrc, p->zAttachName, p->zAttachTarget, p->zAttachTarget);
21692171
}else{
2170
- zComment = mprintf("Delete attachment \"%h\" from tech note [%.10h]",
2171
- p->zAttachName, p->zAttachTarget);
2172
+ zComment = mprintf(
2173
+ "Delete attachment \"/artifact/%!S|%h\" from"
2174
+ " tech note [/technote/%!S|%S]",
2175
+ p->zAttachName, p->zAttachName,
2176
+ p->zAttachTarget,p->zAttachTarget);
21722177
}
21732178
}else{
21742179
if( isAdd ){
21752180
zComment = mprintf(
21762181
"Add attachment [/artifact/%!S|%h] to ticket [%!S|%S]",
21772182
--- src/manifest.c
+++ src/manifest.c
@@ -2066,15 +2066,17 @@
2066 const char isAdd = (zSrc && zSrc[0]) ? 1 : 0;
2067 char *zComment;
2068 if( isAdd ){
2069 zComment = mprintf(
2070 "Add attachment [/artifact/%!S|%h] to"
2071 " tech note [/technote/%h|%.10h]",
2072 zSrc, zName, zTarget, zTarget);
2073 }else{
2074 zComment = mprintf("Delete attachment \"%h\" from tech note [%.10h]",
2075 zName, zTarget);
 
 
2076 }
2077 db_multi_exec("UPDATE event SET comment=%Q, type='e'"
2078 " WHERE objid=%Q",
2079 zComment, zAttachId);
2080 fossil_free(zComment);
@@ -2162,15 +2164,18 @@
2162 p->zAttachName, p->zAttachTarget);
2163 }
2164 }else if( 'e' == attachToType ){
2165 if( isAdd ){
2166 zComment = mprintf(
2167 "Add attachment [/artifact/%!S|%h] to tech note [/technote/%h|%.10h]",
2168 p->zAttachSrc, p->zAttachName, p->zAttachTarget, p->zAttachTarget);
2169 }else{
2170 zComment = mprintf("Delete attachment \"%h\" from tech note [%.10h]",
2171 p->zAttachName, p->zAttachTarget);
 
 
 
2172 }
2173 }else{
2174 if( isAdd ){
2175 zComment = mprintf(
2176 "Add attachment [/artifact/%!S|%h] to ticket [%!S|%S]",
2177
--- src/manifest.c
+++ src/manifest.c
@@ -2066,15 +2066,17 @@
2066 const char isAdd = (zSrc && zSrc[0]) ? 1 : 0;
2067 char *zComment;
2068 if( isAdd ){
2069 zComment = mprintf(
2070 "Add attachment [/artifact/%!S|%h] to"
2071 " tech note [/technote/%!S|%S]",
2072 zSrc, zName, zTarget, zTarget);
2073 }else{
2074 zComment = mprintf(
2075 "Delete attachment \"%h\" from"
2076 " tech note [/technote/%!S|%S]",
2077 zName, zTarget, zTarget);
2078 }
2079 db_multi_exec("UPDATE event SET comment=%Q, type='e'"
2080 " WHERE objid=%Q",
2081 zComment, zAttachId);
2082 fossil_free(zComment);
@@ -2162,15 +2164,18 @@
2164 p->zAttachName, p->zAttachTarget);
2165 }
2166 }else if( 'e' == attachToType ){
2167 if( isAdd ){
2168 zComment = mprintf(
2169 "Add attachment [/artifact/%!S|%h] to tech note [/technote/%!S|%S]",
2170 p->zAttachSrc, p->zAttachName, p->zAttachTarget, p->zAttachTarget);
2171 }else{
2172 zComment = mprintf(
2173 "Delete attachment \"/artifact/%!S|%h\" from"
2174 " tech note [/technote/%!S|%S]",
2175 p->zAttachName, p->zAttachName,
2176 p->zAttachTarget,p->zAttachTarget);
2177 }
2178 }else{
2179 if( isAdd ){
2180 zComment = mprintf(
2181 "Add attachment [/artifact/%!S|%h] to ticket [%!S|%S]",
2182

Keyboard Shortcuts

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