Fossil

Check-in [238db72d]
Login

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

Overview
Comment:On the check-in info page, offer a selection of nearby leaves to diff against.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:238db72dc99a2a4f52127b1317794e127730af00
User & Date: drh 2012-09-06 19:52:24
Context
2012-09-06
20:31
Improved descriptions of the two check-ins being compared on the vdiff page. check-in: 6b22a464 user: drh tags: trunk
19:52
On the check-in info page, offer a selection of nearby leaves to diff against. check-in: 238db72d user: drh tags: trunk
18:26
Fix a bug in name resolution when the name begins with "tag:" check-in: ac65f5bd user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/info.c.

462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
...
477
478
479
480
481
482
483




484
485
486
487
488
489
490
491
492
493
494
495
496

497
498
499
500
501
502
503
...
557
558
559
560
561
562
563




















































564
565
566
567
568
569
570
    "SELECT uuid FROM plink, blob"
    " WHERE plink.cid=%d AND blob.rid=plink.pid AND plink.isprim",
    rid
  );
  isLeaf = is_a_leaf(rid);
  db_prepare(&q, 
     "SELECT uuid, datetime(mtime, 'localtime'), user, comment,"
     "       datetime(omtime, 'localtime')"
     "  FROM blob, event"
     " WHERE blob.rid=%d"
     "   AND event.objid=%d",
     rid, rid
  );
  sideBySide = atoi(PD("sbs","1"));
  if( db_step(&q)==SQLITE_ROW ){
................................................................................
    const char *zUuid = db_column_text(&q, 0);
    char *zTitle = mprintf("Check-in [%.10s]", zUuid);
    char *zEUser, *zEComment;
    const char *zUser;
    const char *zComment;
    const char *zDate;
    const char *zOrigDate;




    style_header(zTitle);
    login_anonymous_available();
    free(zTitle);
    zEUser = db_text(0,
                   "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d",
                    TAG_USER, rid);
    zEComment = db_text(0, 
                   "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d",
                   TAG_COMMENT, rid);
    zUser = db_column_text(&q, 2);
    zComment = db_column_text(&q, 3);
    zDate = db_column_text(&q,1);
    zOrigDate = db_column_text(&q, 4);

    @ <div class="section">Overview</div>
    @ <table class="label-value">
    @ <tr><th>SHA1&nbsp;Hash:</th><td>%s(zUuid)
    if( g.perm.Setup ){
      @ (Record ID: %d(rid))
    }
    @ </td></tr>
................................................................................
                     "   AND tag.tagid=tagxref.tagid "
                     "   AND +tag.tagname GLOB 'sym-*'", rid);
      while( db_step(&q)==SQLITE_ROW ){
        const char *zTagName = db_column_text(&q, 0);
        @  | %z(href("%R/timeline?r=%T",zTagName))%h(zTagName)</a>
      }
      db_finalize(&q);




















































      if( g.perm.Zip ){
        char *zUrl = mprintf("%R/tarball/%s-%S.tar.gz?uuid=%s",
                             zProjName, zUuid, zUuid);
        @ </td></tr>
        @ <tr><th>Downloads:</th><td>
        @ %z(href("%s",zUrl))Tarball</a>
        @ | %z(href("%R/zip/%s-%S.zip?uuid=%s",zProjName,zUuid,zUuid))







|







 







>
>
>
>













>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
...
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
...
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
    "SELECT uuid FROM plink, blob"
    " WHERE plink.cid=%d AND blob.rid=plink.pid AND plink.isprim",
    rid
  );
  isLeaf = is_a_leaf(rid);
  db_prepare(&q, 
     "SELECT uuid, datetime(mtime, 'localtime'), user, comment,"
     "       datetime(omtime, 'localtime'), mtime"
     "  FROM blob, event"
     " WHERE blob.rid=%d"
     "   AND event.objid=%d",
     rid, rid
  );
  sideBySide = atoi(PD("sbs","1"));
  if( db_step(&q)==SQLITE_ROW ){
................................................................................
    const char *zUuid = db_column_text(&q, 0);
    char *zTitle = mprintf("Check-in [%.10s]", zUuid);
    char *zEUser, *zEComment;
    const char *zUser;
    const char *zComment;
    const char *zDate;
    const char *zOrigDate;
    char *zThisBranch;
    double thisMtime;
    int seenDiffTitle = 0;
    
    style_header(zTitle);
    login_anonymous_available();
    free(zTitle);
    zEUser = db_text(0,
                   "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d",
                    TAG_USER, rid);
    zEComment = db_text(0, 
                   "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d",
                   TAG_COMMENT, rid);
    zUser = db_column_text(&q, 2);
    zComment = db_column_text(&q, 3);
    zDate = db_column_text(&q,1);
    zOrigDate = db_column_text(&q, 4);
    thisMtime = db_column_double(&q, 5);
    @ <div class="section">Overview</div>
    @ <table class="label-value">
    @ <tr><th>SHA1&nbsp;Hash:</th><td>%s(zUuid)
    if( g.perm.Setup ){
      @ (Record ID: %d(rid))
    }
    @ </td></tr>
................................................................................
                     "   AND tag.tagid=tagxref.tagid "
                     "   AND +tag.tagname GLOB 'sym-*'", rid);
      while( db_step(&q)==SQLITE_ROW ){
        const char *zTagName = db_column_text(&q, 0);
        @  | %z(href("%R/timeline?r=%T",zTagName))%h(zTagName)</a>
      }
      db_finalize(&q);

      /* Select a few other branches to diff against */
      zThisBranch = db_text("trunk", "SELECT value FROM tagxref"
                                     " WHERE tagid=%d AND tagtype>0"
                                     "   AND rid=%d",
                                     TAG_BRANCH, rid);

      /* Find nearby leaves to offer to diff against */
      db_prepare(&q,
         "SELECT tagxref.value, blob.uuid, min(%.17g-event.mtime)"
         "  FROM leaf, event, tagxref, blob"
         " WHERE event.mtime BETWEEN %.17g AND %.17g"
         "   AND event.type='ci'"
         "   AND event.objid=leaf.rid"
         "   AND NOT %z"
         "   AND tagxref.rid=event.objid"
         "   AND tagxref.tagid=%d AND tagxref.tagtype>0"
         "   AND tagxref.value!=%Q"
         "   AND blob.rid=tagxref.rid"
         " GROUP BY 1 ORDER BY 3",
         thisMtime, thisMtime-7, thisMtime+7,
         leaf_is_closed_sql("leaf.rid"),
         TAG_BRANCH, zThisBranch
      );
      while( db_step(&q)==SQLITE_ROW ){
        const char *zBr = db_column_text(&q, 0);
        const char *zId = db_column_text(&q, 1);
        if( !seenDiffTitle ){
          @ <tr><th valign="top">Diffs:</th><td valign="top">
          seenDiffTitle = 1;
        }else{
          @ |
        }
        @ %z(href("%R/vdiff?from=%S&to=%S",zId, zUuid))%h(zBr)</a>
      }
      db_finalize(&q);

      if( fossil_strcmp(zThisBranch,"trunk")!=0 ){
        if( !seenDiffTitle ){
          @ <tr><th valign="top">Diffs:</th><td valign="top">
          seenDiffTitle = 1;
        }else{
          @ |
        }
        @ %z(href("%R/vdiff?from=root:%S&to=%S",zUuid,zUuid))root of
        @ this branch</a>
      }
      if( seenDiffTitle ){
        @ </td></tr>
      }

      /* The Download: line */
      if( g.perm.Zip ){
        char *zUrl = mprintf("%R/tarball/%s-%S.tar.gz?uuid=%s",
                             zProjName, zUuid, zUuid);
        @ </td></tr>
        @ <tr><th>Downloads:</th><td>
        @ %z(href("%s",zUrl))Tarball</a>
        @ | %z(href("%R/zip/%s-%S.zip?uuid=%s",zProjName,zUuid,zUuid))