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
Parent
b81125e2501b52e…
2 files changed
+1
-1
+11
-6
+1
-1
| --- src/attach.c | ||
| +++ src/attach.c | ||
| @@ -356,11 +356,11 @@ | ||
| 356 | 356 | zTechNote = db_text(0, "SELECT substr(tagname,7) FROM tag" |
| 357 | 357 | " WHERE tagname GLOB 'event-%q*'", zTechNote); |
| 358 | 358 | if( zTechNote==0) fossil_redirect_home(); |
| 359 | 359 | } |
| 360 | 360 | 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>", | |
| 362 | 362 | zTechNote, zTechNote); |
| 363 | 363 | |
| 364 | 364 | }else{ |
| 365 | 365 | if( g.perm.ApndTkt==0 || g.perm.Attach==0 ){ |
| 366 | 366 | login_needed(g.anon.ApndTkt && g.anon.Attach); |
| 367 | 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/%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 @@ | ||
| 2066 | 2066 | const char isAdd = (zSrc && zSrc[0]) ? 1 : 0; |
| 2067 | 2067 | char *zComment; |
| 2068 | 2068 | if( isAdd ){ |
| 2069 | 2069 | zComment = mprintf( |
| 2070 | 2070 | "Add attachment [/artifact/%!S|%h] to" |
| 2071 | - " tech note [/technote/%h|%.10h]", | |
| 2071 | + " tech note [/technote/%!S|%S]", | |
| 2072 | 2072 | zSrc, zName, zTarget, zTarget); |
| 2073 | 2073 | }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); | |
| 2076 | 2078 | } |
| 2077 | 2079 | db_multi_exec("UPDATE event SET comment=%Q, type='e'" |
| 2078 | 2080 | " WHERE objid=%Q", |
| 2079 | 2081 | zComment, zAttachId); |
| 2080 | 2082 | fossil_free(zComment); |
| @@ -2162,15 +2164,18 @@ | ||
| 2162 | 2164 | p->zAttachName, p->zAttachTarget); |
| 2163 | 2165 | } |
| 2164 | 2166 | }else if( 'e' == attachToType ){ |
| 2165 | 2167 | if( isAdd ){ |
| 2166 | 2168 | 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]", | |
| 2168 | 2170 | p->zAttachSrc, p->zAttachName, p->zAttachTarget, p->zAttachTarget); |
| 2169 | 2171 | }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); | |
| 2172 | 2177 | } |
| 2173 | 2178 | }else{ |
| 2174 | 2179 | if( isAdd ){ |
| 2175 | 2180 | zComment = mprintf( |
| 2176 | 2181 | "Add attachment [/artifact/%!S|%h] to ticket [%!S|%S]", |
| 2177 | 2182 |
| --- 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 |