Fossil

Check-in [49402fc7]
Login

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

Overview
Comment:Improvements to artifact descriptions merged into trunk.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 49402fc72296cc555f0467a42808b327a83f0ce5
User & Date: drh 2011-08-31 14:34:41.852
References
2011-09-08
23:16 Fixed ticket [a9b07eeb]: Have the artifact sources in an HTML list plus 2 other changes ... (artifact: 9200e01a user: dmitry)
18:47 Ticket [6b310619] Artifacts da39a3ee5e6b4b0d3255bfef95601890afd80709 (empty files) status still Open with 2 other changes ... (artifact: 3f363eb7 user: dmitry)
Context
2011-09-01
17:44
Fixing typo in the 'fossil configuration' command line help. ... (check-in: cd8041b1 user: viriketo tags: trunk)
11:33
Make sure the perferred timezone format has been queried prior to running user SQL, since while running user SQL access to the CONFIG table is restricted. ... (check-in: 7922e566 user: drh tags: trunk)
2011-08-31
16:28
Merge improvements to artifact descriptions into symlinks branch. Also modify displaying of permissions: now web UI shows "File", "Executable file", or "Symbolic link" in file artifact description. ... (check-in: 3115774f user: dmitry tags: symlinks)
14:34
Improvements to artifact descriptions merged into trunk. ... (check-in: 49402fc7 user: drh tags: trunk)
14:28
Show the branch name in artifact descriptions. ... (Closed-Leaf check-in: 2e38bed4 user: drh tags: artifact_description)
2011-08-30
18:04
Print an error message and quite if the --user option appears on a "fossil commit" command but specifies a username not found in the database. Ticket [3ed2e994e1750b] ... (check-in: b120bc8b user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/info.c.
774
775
776
777
778
779
780


781
782
783
784
785


786
787
788
789
790
791

792
793

794
795
796
797
798
799


800
801
802
803
804

805
806
807
808
809





810
811







812
813
814

815
816
817
818
819
820
821
822
823


824
825
826
827
828
829
830
  Blob *pDownloadName      /* Fill with an appropriate download name */
){
  Stmt q;
  int cnt = 0;
  int nWiki = 0;
  char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);



  db_prepare(&q,
    "SELECT filename.name, datetime(event.mtime),"
    "       coalesce(event.ecomment,event.comment),"
    "       coalesce(event.euser,event.user),"
    "       b.uuid"


    "  FROM mlink, filename, event, blob a, blob b"
    " WHERE filename.fnid=mlink.fnid"
    "   AND event.objid=mlink.mid"
    "   AND a.rid=mlink.fid"
    "   AND b.rid=mlink.mid"
    "   AND mlink.fid=%d",

    rid
  );

  while( db_step(&q)==SQLITE_ROW ){
    const char *zName = db_column_text(&q, 0);
    const char *zDate = db_column_text(&q, 1);
    const char *zCom = db_column_text(&q, 2);
    const char *zUser = db_column_text(&q, 3);
    const char *zVers = db_column_text(&q, 4);


    if( cnt>0 ){
      @ Also file
    }else{
      @ File
    }

    if( g.okHistory ){
      @ <a href="%s(g.zTop)/finfo?name=%T(zName)">%h(zName)</a>
    }else{
      @ %h(zName)
    }





    @ part of check-in
    hyperlink_to_uuid(zVers);







    @ - %w(zCom) by 
    hyperlink_to_user(zUser,zDate," on");
    hyperlink_to_date(zDate,".");

    if( g.okHistory ){
      @ <a href="%s(g.zTop)/annotate?checkin=%S(zVers)&filename=%T(zName)">
      @ [annotate]</a>
    }
    cnt++;
    if( pDownloadName && blob_size(pDownloadName)==0 ){
      blob_append(pDownloadName, zName, -1);
    }
  }


  db_finalize(&q);
  db_prepare(&q, 
    "SELECT substr(tagname, 6, 10000), datetime(event.mtime),"
    "       coalesce(event.euser, event.user)"
    "  FROM tagxref, tag, event"
    " WHERE tagxref.rid=%d"
    "   AND tag.tagid=tagxref.tagid" 







>
>




|
>
>





|
>
|

>






>
>
|
<
<
|
|
>
|
|
|
|
|
>
>
>
>
>
|

>
>
>
>
>
>
>
|
|
<
>









>
>







774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808


809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832

833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
  Blob *pDownloadName      /* Fill with an appropriate download name */
){
  Stmt q;
  int cnt = 0;
  int nWiki = 0;
  char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);

  char *prevName = 0;

  db_prepare(&q,
    "SELECT filename.name, datetime(event.mtime),"
    "       coalesce(event.ecomment,event.comment),"
    "       coalesce(event.euser,event.user),"
    "       b.uuid,"
    "       coalesce((SELECT value FROM tagxref"
                    "  WHERE tagid=%d AND tagtype>0 AND rid=mlink.mid),'trunk')"
    "  FROM mlink, filename, event, blob a, blob b"
    " WHERE filename.fnid=mlink.fnid"
    "   AND event.objid=mlink.mid"
    "   AND a.rid=mlink.fid"
    "   AND b.rid=mlink.mid"
    "   AND mlink.fid=%d"
    "   ORDER BY filename.name, event.mtime",
    TAG_BRANCH, rid
  );
  @ <ul>
  while( db_step(&q)==SQLITE_ROW ){
    const char *zName = db_column_text(&q, 0);
    const char *zDate = db_column_text(&q, 1);
    const char *zCom = db_column_text(&q, 2);
    const char *zUser = db_column_text(&q, 3);
    const char *zVers = db_column_text(&q, 4);
    const char *zBr = db_column_text(&q, 5);
    if( !prevName || fossil_strcmp(zName, prevName) ) {
      if( prevName ) {


        @ </ul>
      }
      @ <li>File
      if( g.okHistory ){
        @ <a href="%s(g.zTop)/finfo?name=%T(zName)">%h(zName)</a>
      }else{
        @ %h(zName)
      }
      @ <ul>
      prevName = fossil_strdup(zName);
    }
    @ <li>
    hyperlink_to_date(zDate,"");
    @ - part of checkin
    hyperlink_to_uuid(zVers);
    if( zBr && zBr[0] ){
      if( g.okHistory ){
        @ on branch <a href="%s(g.zTop)/timeline?r=%T(zBr)">%h(zBr)</a>
      }else{
        @ on branch %h(zBr)
      }
    }
    @ - %w(zCom) (user:
    hyperlink_to_user(zUser,zDate,"");

    @ )
    if( g.okHistory ){
      @ <a href="%s(g.zTop)/annotate?checkin=%S(zVers)&filename=%T(zName)">
      @ [annotate]</a>
    }
    cnt++;
    if( pDownloadName && blob_size(pDownloadName)==0 ){
      blob_append(pDownloadName, zName, -1);
    }
  }
  @ </ul></ul>
  free(prevName);
  db_finalize(&q);
  db_prepare(&q, 
    "SELECT substr(tagname, 6, 10000), datetime(event.mtime),"
    "       coalesce(event.euser, event.user)"
    "  FROM tagxref, tag, event"
    " WHERE tagxref.rid=%d"
    "   AND tag.tagid=tagxref.tagid" 
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
  blob_reset(&c2);
  if( !isPatch ){
    style_header("Diff");
    style_submenu_element("Patch", "Patch", "%s/fdiff?v1=%T&v2=%T&patch",
                          g.zTop, P("v1"), P("v2"));
    @ <h2>Differences From
    @ Artifact <a href="%s(g.zTop)/artifact/%S(zV1)">[%S(zV1)]</a>:</h2>
    @ <blockquote><p>
    object_description(v1, 1, 0);
    @ </p></blockquote>
    @ <h2>To Artifact <a href="%s(g.zTop)/artifact/%S(zV2)">[%S(zV2)]</a>:</h2>
    @ <blockquote><p>
    object_description(v2, 1, 0);
    @ </p></blockquote>
    @ <hr />
    @ <blockquote><pre>
    @ %h(blob_str(&diff))
    @ </pre></blockquote>
    blob_reset(&diff);
    style_footer();
  }







<
|
<

<
|
<







1007
1008
1009
1010
1011
1012
1013

1014

1015

1016

1017
1018
1019
1020
1021
1022
1023
  blob_reset(&c2);
  if( !isPatch ){
    style_header("Diff");
    style_submenu_element("Patch", "Patch", "%s/fdiff?v1=%T&v2=%T&patch",
                          g.zTop, P("v1"), P("v2"));
    @ <h2>Differences From
    @ Artifact <a href="%s(g.zTop)/artifact/%S(zV1)">[%S(zV1)]</a>:</h2>

    object_description(v1, 0, 0);

    @ <h2>To Artifact <a href="%s(g.zTop)/artifact/%S(zV2)">[%S(zV2)]</a>:</h2>

    object_description(v2, 0, 0);

    @ <hr />
    @ <blockquote><pre>
    @ %h(blob_str(&diff))
    @ </pre></blockquote>
    blob_reset(&diff);
    style_footer();
  }
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
      style_submenu_element("Shun","Shun", "%s/shun?shun=%s#addshun",
            g.zTop, zUuid);
    }
  }
  style_header("Hex Artifact Content");
  zUuid = db_text("?","SELECT uuid FROM blob WHERE rid=%d", rid);
  @ <h2>Artifact %s(zUuid):</h2>
  @ <blockquote><p>
  blob_zero(&downloadName);
  object_description(rid, 0, &downloadName);
  style_submenu_element("Download", "Download", 
        "%s/raw/%T?name=%s", g.zTop, blob_str(&downloadName), zUuid);
  @ </p></blockquote>
  @ <hr />
  content_get(rid, &content);
  @ <blockquote><pre>
  hexdump(&content);
  @ </pre></blockquote>
  style_footer();
}







<




<







1122
1123
1124
1125
1126
1127
1128

1129
1130
1131
1132

1133
1134
1135
1136
1137
1138
1139
      style_submenu_element("Shun","Shun", "%s/shun?shun=%s#addshun",
            g.zTop, zUuid);
    }
  }
  style_header("Hex Artifact Content");
  zUuid = db_text("?","SELECT uuid FROM blob WHERE rid=%d", rid);
  @ <h2>Artifact %s(zUuid):</h2>

  blob_zero(&downloadName);
  object_description(rid, 0, &downloadName);
  style_submenu_element("Download", "Download", 
        "%s/raw/%T?name=%s", g.zTop, blob_str(&downloadName), zUuid);

  @ <hr />
  content_get(rid, &content);
  @ <blockquote><pre>
  hexdump(&content);
  @ </pre></blockquote>
  style_footer();
}
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
      style_submenu_element("Shun","Shun", "%s/shun?shun=%s#addshun",
            g.zTop, zUuid);
    }
  }
  style_header("Artifact Content");
  zUuid = db_text("?", "SELECT uuid FROM blob WHERE rid=%d", rid);
  @ <h2>Artifact %s(zUuid)</h2>
  @ <blockquote><p>
  blob_zero(&downloadName);
  object_description(rid, 0, &downloadName);
  style_submenu_element("Download", "Download", 
          "%s/raw/%T?name=%s", g.zTop, blob_str(&downloadName), zUuid);
  zMime = mimetype_from_name(blob_str(&downloadName));
  if( zMime ){
    if( fossil_strcmp(zMime, "text/html")==0 ){







<







1269
1270
1271
1272
1273
1274
1275

1276
1277
1278
1279
1280
1281
1282
      style_submenu_element("Shun","Shun", "%s/shun?shun=%s#addshun",
            g.zTop, zUuid);
    }
  }
  style_header("Artifact Content");
  zUuid = db_text("?", "SELECT uuid FROM blob WHERE rid=%d", rid);
  @ <h2>Artifact %s(zUuid)</h2>

  blob_zero(&downloadName);
  object_description(rid, 0, &downloadName);
  style_submenu_element("Download", "Download", 
          "%s/raw/%T?name=%s", g.zTop, blob_str(&downloadName), zUuid);
  zMime = mimetype_from_name(blob_str(&downloadName));
  if( zMime ){
    if( fossil_strcmp(zMime, "text/html")==0 ){
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
      }else{
        renderAsWiki = 1;
        style_submenu_element("Text", "Text",
                              "%s/artifact/%s?txt=1", g.zTop, zUuid);
      }
    }
  }
  @ </p></blockquote>
  @ <hr />
  content_get(rid, &content);
  if( renderAsWiki ){
    wiki_convert(&content, 0, 0);
  }else if( renderAsHtml ){
    @ <div>
    cgi_append_content(blob_buffer(&content), blob_size(&content));







<







1295
1296
1297
1298
1299
1300
1301

1302
1303
1304
1305
1306
1307
1308
      }else{
        renderAsWiki = 1;
        style_submenu_element("Text", "Text",
                              "%s/artifact/%s?txt=1", g.zTop, zUuid);
      }
    }
  }

  @ <hr />
  content_get(rid, &content);
  if( renderAsWiki ){
    wiki_convert(&content, 0, 0);
  }else if( renderAsHtml ){
    @ <div>
    cgi_append_content(blob_buffer(&content), blob_size(&content));