Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | technoteattachcli
Files: files | file ages | folders
SHA1:4ce3c62b53694f97394962ba621a933860623f67
User & Date: dave.vines 2016-03-28 12:12:07
Context
2016-04-01
14:47
Remove non tech notes from the list and error checking performed by fossil wiki --technote. Ambiguity of tech note with the same timestamp resolved in favour of the tech note with the highest modification timestamp. check-in: 3d2341a2 user: dave.vines tags: technoteattachcli
2016-03-28
12:12
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) check-in: 4ce3c62b user: dave.vines tags: technoteattachcli
2016-03-24
22:27
Fixed some typos and attempted to improve documentation of the fossil wiki command. Added and rearranged test casesd for fossil wiki to explicitly include a knownBug case for the collision between a previous attachment and a new technote that happen to occur in the same second. Note that the reverse order does not fail, as demonstrated by some additional tests. check-in: b81125e2 user: rberteig tags: technoteattachcli
Changes

Changes to src/attach.c.

354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
    }
    if( !db_exists("SELECT 1 FROM tag WHERE tagname='event-%q'", zTechNote) ){
      zTechNote = db_text(0, "SELECT substr(tagname,7) FROM tag"
                             " WHERE tagname GLOB 'event-%q*'", zTechNote);
      if( zTechNote==0) fossil_redirect_home();
    }
    zTarget = zTechNote;
    zTargetType = mprintf("Tech Note <a href=\"%R/technote/%h\">%h</a>",
                           zTechNote, zTechNote);
  
  }else{
    if( g.perm.ApndTkt==0 || g.perm.Attach==0 ){
      login_needed(g.anon.ApndTkt && g.anon.Attach);
      return;
    }







|







354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
    }
    if( !db_exists("SELECT 1 FROM tag WHERE tagname='event-%q'", zTechNote) ){
      zTechNote = db_text(0, "SELECT substr(tagname,7) FROM tag"
                             " WHERE tagname GLOB 'event-%q*'", zTechNote);
      if( zTechNote==0) fossil_redirect_home();
    }
    zTarget = zTechNote;
    zTargetType = mprintf("Tech Note <a href=\"%R/technote/%s\">%S</a>",
                           zTechNote, zTechNote);
  
  }else{
    if( g.perm.ApndTkt==0 || g.perm.Attach==0 ){
      login_needed(g.anon.ApndTkt && g.anon.Attach);
      return;
    }

Changes to src/manifest.c.

2064
2065
2066
2067
2068
2069
2070
2071
2072
2073

2074

2075
2076
2077
2078
2079
2080
2081
2082
....
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170


2171

2172
2173
2174
2175
2176
2177
2178
      const char *zTarget = db_column_text(&qatt, 2);
      const char *zName = db_column_text(&qatt, 3);
      const char isAdd = (zSrc && zSrc[0]) ? 1 : 0;
      char *zComment;
      if( isAdd ){
        zComment = mprintf(
             "Add attachment [/artifact/%!S|%h] to"
             " tech note [/technote/%h|%.10h]",
             zSrc, zName, zTarget, zTarget); 
      }else{

        zComment = mprintf("Delete attachment \"%h\" from tech note [%.10h]",

             zName, zTarget);
      }
      db_multi_exec("UPDATE event SET comment=%Q, type='e'"
                       " WHERE objid=%Q",
                    zComment, zAttachId);
      fossil_free(zComment);      
    }
    db_finalize(&qatt);
................................................................................
      }else{
        zComment = mprintf("Delete attachment \"%h\" from wiki page [%h]",
             p->zAttachName, p->zAttachTarget);
      }
    }else if( 'e' == attachToType ){
      if( isAdd ){
        zComment = mprintf(
          "Add attachment [/artifact/%!S|%h] to tech note [/technote/%h|%.10h]",
          p->zAttachSrc, p->zAttachName, p->zAttachTarget, p->zAttachTarget); 
      }else{
        zComment = mprintf("Delete attachment \"%h\" from tech note [%.10h]",


             p->zAttachName, p->zAttachTarget);

      }      
    }else{
      if( isAdd ){
        zComment = mprintf(
             "Add attachment [/artifact/%!S|%h] to ticket [%!S|%S]",
             p->zAttachSrc, p->zAttachName, p->zAttachTarget, p->zAttachTarget);
      }else{







|


>
|
>
|







 







|


|
>
>
|
>







2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
....
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
      const char *zTarget = db_column_text(&qatt, 2);
      const char *zName = db_column_text(&qatt, 3);
      const char isAdd = (zSrc && zSrc[0]) ? 1 : 0;
      char *zComment;
      if( isAdd ){
        zComment = mprintf(
             "Add attachment [/artifact/%!S|%h] to"
             " tech note [/technote/%!S|%S]",
             zSrc, zName, zTarget, zTarget); 
      }else{
        zComment = mprintf(
             "Delete attachment \"%h\" from"
             " tech note [/technote/%!S|%S]",
             zName, zTarget, zTarget);
      }
      db_multi_exec("UPDATE event SET comment=%Q, type='e'"
                       " WHERE objid=%Q",
                    zComment, zAttachId);
      fossil_free(zComment);      
    }
    db_finalize(&qatt);
................................................................................
      }else{
        zComment = mprintf("Delete attachment \"%h\" from wiki page [%h]",
             p->zAttachName, p->zAttachTarget);
      }
    }else if( 'e' == attachToType ){
      if( isAdd ){
        zComment = mprintf(
          "Add attachment [/artifact/%!S|%h] to tech note [/technote/%!S|%S]",
          p->zAttachSrc, p->zAttachName, p->zAttachTarget, p->zAttachTarget); 
      }else{
        zComment = mprintf(
             "Delete attachment \"/artifact/%!S|%h\" from"
             " tech note [/technote/%!S|%S]",
             p->zAttachName, p->zAttachName,
             p->zAttachTarget,p->zAttachTarget);
      }      
    }else{
      if( isAdd ){
        zComment = mprintf(
             "Add attachment [/artifact/%!S|%h] to ticket [%!S|%S]",
             p->zAttachSrc, p->zAttachName, p->zAttachTarget, p->zAttachTarget);
      }else{