Fossil

Check-in [2fa1a8a9]
Login

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

Overview
Comment:Adds option to show branch colors on brlist page
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | brlist-cleanup
Files: files | file ages | folders
SHA1:2fa1a8a935b18266774090eb1b5ba53bb4678fb8
User & Date: baruch 2016-05-17 11:35:56
Context
2016-05-17
11:44
tiny cleanup Leaf check-in: 9340f2fc user: baruch tags: brlist-cleanup
11:35
Adds option to show branch colors on brlist page check-in: 2fa1a8a9 user: baruch tags: brlist-cleanup
04:16
Remove unused variables check-in: f9decff0 user: andygoth tags: trunk
2016-03-06
06:35
Merge updates from trunk. Closed-Leaf check-in: 4bd2b545 user: mistachkin tags: pending-review
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Makefile.classic became executable.

Makefile.in became executable.

ajax/cgi-bin/fossil-json.cgi.example became executable.

autosetup/test-tclsh became a regular file.

compat/zlib/contrib/masmx64/bld_ml64.bat became a regular file.

compat/zlib/contrib/masmx86/bld_ml32.bat became a regular file.

compat/zlib/zlib2ansi became executable.

debian/makedeb.sh became executable.

Changes to src/branch.c.

315
316
317
318
319
320
321
322

323
324
325
326
327
328
329
...
336
337
338
339
340
341
342

343
344
345
346

347
348
349
350
351
352
353
...
359
360
361
362
363
364
365

366
367
368










369

370
371
372
373
374
375
376
@   (SELECT tagxref.value
@      FROM plink CROSS JOIN tagxref
@    WHERE plink.pid=event.objid
@       AND tagxref.rid=plink.cid
@      AND tagxref.tagid=(SELECT tagid FROM tag WHERE tagname='branch')
@      AND tagtype>0),
@   count(*),
@   (SELECT uuid FROM blob WHERE rid=tagxref.rid)

@  FROM tagxref, tag, event
@ WHERE tagxref.tagid=tag.tagid
@   AND tagxref.tagtype>0
@   AND tag.tagname='branch'
@   AND event.objid=tagxref.rid
@ GROUP BY 1
@ ORDER BY 2 DESC;
................................................................................
**
** Control jumps to this routine from brlist_page() (the /brlist handler)
** if there are no query parameters.
*/
static void new_brlist_page(void){
  Stmt q;
  double rNow;

  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
  style_header("Branches");
  style_adunit_config(ADUNIT_RIGHT_OK);

  login_anonymous_available();

  db_prepare(&q, brlistQuery/*works-like:""*/);
  rNow = db_double(0.0, "SELECT julianday('now')");
  @ <div class="brlist"><table id="branchlisttable">
  @ <thead><tr>
  @ <th>Branch Name</th>
................................................................................
  while( db_step(&q)==SQLITE_ROW ){
    const char *zBranch = db_column_text(&q, 0);
    double rMtime = db_column_double(&q, 1);
    int isClosed = db_column_int(&q, 2);
    const char *zMergeTo = db_column_text(&q, 3);
    int nCkin = db_column_int(&q, 4);
    const char *zLastCkin = db_column_text(&q, 5);

    char *zAge = human_readable_age(rNow - rMtime);
    sqlite3_int64 iMtime = (sqlite3_int64)(rMtime*86400.0);
    if( zMergeTo && zMergeTo[0]==0 ) zMergeTo = 0;










    @ <tr>

    @ <td>%z(href("%R/timeline?n=100&r=%T",zBranch))%h(zBranch)</a></td>
    @ <td data-sortkey="%016llx(-iMtime)">%s(zAge)</td>
    @ <td>%d(nCkin)</td>
    fossil_free(zAge);
    @ <td>%s(isClosed?"closed":"")</td>
    if( zMergeTo ){
      @ <td>merged into







|
>







 







>




>







 







>



>
>
>
>
>
>
>
>
>
>
|
>







315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
...
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
...
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
@   (SELECT tagxref.value
@      FROM plink CROSS JOIN tagxref
@    WHERE plink.pid=event.objid
@       AND tagxref.rid=plink.cid
@      AND tagxref.tagid=(SELECT tagid FROM tag WHERE tagname='branch')
@      AND tagtype>0),
@   count(*),
@   (SELECT uuid FROM blob WHERE rid=tagxref.rid),
@   event.bgcolor
@  FROM tagxref, tag, event
@ WHERE tagxref.tagid=tag.tagid
@   AND tagxref.tagtype>0
@   AND tag.tagname='branch'
@   AND event.objid=tagxref.rid
@ GROUP BY 1
@ ORDER BY 2 DESC;
................................................................................
**
** Control jumps to this routine from brlist_page() (the /brlist handler)
** if there are no query parameters.
*/
static void new_brlist_page(void){
  Stmt q;
  double rNow;
  int show_colors = PB("colors");
  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
  style_header("Branches");
  style_adunit_config(ADUNIT_RIGHT_OK);
  style_submenu_binary("colors", "Show branch colors", "No branch colors", 0);
  login_anonymous_available();

  db_prepare(&q, brlistQuery/*works-like:""*/);
  rNow = db_double(0.0, "SELECT julianday('now')");
  @ <div class="brlist"><table id="branchlisttable">
  @ <thead><tr>
  @ <th>Branch Name</th>
................................................................................
  while( db_step(&q)==SQLITE_ROW ){
    const char *zBranch = db_column_text(&q, 0);
    double rMtime = db_column_double(&q, 1);
    int isClosed = db_column_int(&q, 2);
    const char *zMergeTo = db_column_text(&q, 3);
    int nCkin = db_column_int(&q, 4);
    const char *zLastCkin = db_column_text(&q, 5);
    const char *zBgClr = db_column_text(&q, 6);
    char *zAge = human_readable_age(rNow - rMtime);
    sqlite3_int64 iMtime = (sqlite3_int64)(rMtime*86400.0);
    if( zMergeTo && zMergeTo[0]==0 ) zMergeTo = 0;
    if( zBgClr == 0 ){
      if( zBranch==0 || strcmp(zBranch,"trunk")==0 ){
        zBgClr = 0;
      }else{
        zBgClr = hash_color(zBranch);
      }
    }
    if( show_colors ){
      @ <tr style="background-color:%s(zBgClr)">
    }else{
      @ <tr>
    }
    @ <td>%z(href("%R/timeline?n=100&r=%T",zBranch))%h(zBranch)</a></td>
    @ <td data-sortkey="%016llx(-iMtime)">%s(zAge)</td>
    @ <td>%d(nCkin)</td>
    fossil_free(zAge);
    @ <td>%s(isClosed?"closed":"")</td>
    if( zMergeTo ){
      @ <td>merged into

src/makemake.tcl became executable.

test/many-www.tcl became executable.

test/update-test-1.sh became executable.

test/update-test-2.sh became executable.

test/valgrind-www.tcl became executable.

tools/cvs2fossil/changeset became executable.

tools/cvs2fossil/cvs2fossil became executable.

tools/cvs2fossil/filerevtree became executable.

tools/cvs2fossil/getmemoryseries.tcl became executable.

tools/cvs2fossil/lodtree became executable.

tools/cvs2fossil/showg became executable.

tools/cvs2fossil/symboltree became executable.

tools/encode_math.sh became executable.

tools/fossil_chat.tcl became executable.

win/Makefile.mingw became executable.

win/Makefile.mingw.mistachkin became executable.

www/faq.tcl became executable.

www/mkdownload.tcl became executable.

www/mkindex.tcl became executable.