Fossil SCM

merge trunk

jan.nijtmans 2012-09-07 07:55 unicode-cmdline merge
Commit af4287ac3a314b4088b6fb40620fda9327722249
2 files changed +96 -8 +1
+96 -8
--- src/info.c
+++ src/info.c
@@ -464,11 +464,11 @@
464464
rid
465465
);
466466
isLeaf = is_a_leaf(rid);
467467
db_prepare(&q,
468468
"SELECT uuid, datetime(mtime, 'localtime'), user, comment,"
469
- " datetime(omtime, 'localtime')"
469
+ " datetime(omtime, 'localtime'), mtime"
470470
" FROM blob, event"
471471
" WHERE blob.rid=%d"
472472
" AND event.objid=%d",
473473
rid, rid
474474
);
@@ -479,10 +479,14 @@
479479
char *zEUser, *zEComment;
480480
const char *zUser;
481481
const char *zComment;
482482
const char *zDate;
483483
const char *zOrigDate;
484
+ char *zThisBranch;
485
+ double thisMtime;
486
+ int seenDiffTitle = 0;
487
+
484488
style_header(zTitle);
485489
login_anonymous_available();
486490
free(zTitle);
487491
zEUser = db_text(0,
488492
"SELECT value FROM tagxref WHERE tagid=%d AND rid=%d",
@@ -492,10 +496,11 @@
492496
TAG_COMMENT, rid);
493497
zUser = db_column_text(&q, 2);
494498
zComment = db_column_text(&q, 3);
495499
zDate = db_column_text(&q,1);
496500
zOrigDate = db_column_text(&q, 4);
501
+ thisMtime = db_column_double(&q, 5);
497502
@ <div class="section">Overview</div>
498503
@ <table class="label-value">
499504
@ <tr><th>SHA1&nbsp;Hash:</th><td>%s(zUuid)
500505
if( g.perm.Setup ){
501506
@ (Record ID: %d(rid))
@@ -559,10 +564,62 @@
559564
while( db_step(&q)==SQLITE_ROW ){
560565
const char *zTagName = db_column_text(&q, 0);
561566
@ | %z(href("%R/timeline?r=%T",zTagName))%h(zTagName)</a>
562567
}
563568
db_finalize(&q);
569
+
570
+ /* Select a few other branches to diff against */
571
+ zThisBranch = db_text("trunk", "SELECT value FROM tagxref"
572
+ " WHERE tagid=%d AND tagtype>0"
573
+ " AND rid=%d",
574
+ TAG_BRANCH, rid);
575
+
576
+ /* Find nearby leaves to offer to diff against */
577
+ db_prepare(&q,
578
+ "SELECT tagxref.value, blob.uuid, min(%.17g-event.mtime)"
579
+ " FROM leaf, event, tagxref, blob"
580
+ " WHERE event.mtime BETWEEN %.17g AND %.17g"
581
+ " AND event.type='ci'"
582
+ " AND event.objid=leaf.rid"
583
+ " AND NOT %z"
584
+ " AND tagxref.rid=event.objid"
585
+ " AND tagxref.tagid=%d AND tagxref.tagtype>0"
586
+ " AND tagxref.value!=%Q"
587
+ " AND blob.rid=tagxref.rid"
588
+ " GROUP BY 1 ORDER BY 3",
589
+ thisMtime, thisMtime-7, thisMtime+7,
590
+ leaf_is_closed_sql("leaf.rid"),
591
+ TAG_BRANCH, zThisBranch
592
+ );
593
+ while( db_step(&q)==SQLITE_ROW ){
594
+ const char *zBr = db_column_text(&q, 0);
595
+ const char *zId = db_column_text(&q, 1);
596
+ if( !seenDiffTitle ){
597
+ @ <tr><th valign="top">Diffs:</th><td valign="top">
598
+ seenDiffTitle = 1;
599
+ }else{
600
+ @ |
601
+ }
602
+ @ %z(href("%R/vdiff?from=%S&to=%S",zId, zUuid))%h(zBr)</a>
603
+ }
604
+ db_finalize(&q);
605
+
606
+ if( fossil_strcmp(zThisBranch,"trunk")!=0 ){
607
+ if( !seenDiffTitle ){
608
+ @ <tr><th valign="top">Diffs:</th><td valign="top">
609
+ seenDiffTitle = 1;
610
+ }else{
611
+ @ |
612
+ }
613
+ @ %z(href("%R/vdiff?from=root:%S&to=%S",zUuid,zUuid))root of
614
+ @ this branch</a>
615
+ }
616
+ if( seenDiffTitle ){
617
+ @ </td></tr>
618
+ }
619
+
620
+ /* The Download: line */
564621
if( g.perm.Zip ){
565622
char *zUrl = mprintf("%R/tarball/%s-%S.tar.gz?uuid=%s",
566623
zProjName, zUuid, zUuid);
567624
@ </td></tr>
568625
@ <tr><th>Downloads:</th><td>
@@ -774,30 +831,61 @@
774831
}
775832
776833
/*
777834
** Output a description of a check-in
778835
*/
779
-void checkin_description(int rid){
836
+static void checkin_description(int rid){
780837
Stmt q;
781838
db_prepare(&q,
782839
"SELECT datetime(mtime), coalesce(euser,user),"
783
- " coalesce(ecomment,comment), uuid"
840
+ " coalesce(ecomment,comment), uuid,"
841
+ " (SELECT group_concat(substr(tagname,5), ', ') FROM tag, tagxref"
842
+ " WHERE tagname GLOB 'sym-*' AND tag.tagid=tagxref.tagid"
843
+ " AND tagxref.rid=blob.rid AND tagxref.tagtype>0)"
784844
" FROM event, blob"
785845
" WHERE event.objid=%d AND type='ci'"
786846
" AND blob.rid=%d",
787847
rid, rid
788848
);
789849
while( db_step(&q)==SQLITE_ROW ){
790850
const char *zDate = db_column_text(&q, 0);
791851
const char *zUser = db_column_text(&q, 1);
792
- const char *zCom = db_column_text(&q, 2);
793852
const char *zUuid = db_column_text(&q, 3);
794
- @ Check-in
853
+ const char *zTagList = db_column_text(&q, 4);
854
+ Blob comment;
855
+ int wikiFlags = WIKI_INLINE;
856
+ if( db_get_boolean("timeline-block-markup", 0)==0 ){
857
+ wikiFlags |= WIKI_NOBLOCK;
858
+ }
795859
hyperlink_to_uuid(zUuid);
796
- @ - %w(zCom) by
797
- hyperlink_to_user(zUser,zDate," on");
798
- hyperlink_to_date(zDate, ".");
860
+ blob_zero(&comment);
861
+ db_column_blob(&q, 2, &comment);
862
+ wiki_convert(&comment, 0, wikiFlags);
863
+ blob_reset(&comment);
864
+ @ (user:
865
+ hyperlink_to_user(zUser,zDate,",");
866
+ if( zTagList && zTagList[0] && g.perm.Hyperlink ){
867
+ int i;
868
+ const char *z = zTagList;
869
+ Blob links;
870
+ blob_zero(&links);
871
+ while( z && z[0] ){
872
+ for(i=0; z[i] && (z[i]!=',' || z[i+1]!=' '); i++){}
873
+ blob_appendf(&links,
874
+ "%z%#h</a>%.2s",
875
+ href("%R/timeline?r=%#t&nd&c=%s",i,z,zDate), i,z, &z[i]
876
+ );
877
+ if( z[i]==0 ) break;
878
+ z += i+2;
879
+ }
880
+ @ tags: %s(blob_str(&links)),
881
+ blob_reset(&links);
882
+ }else{
883
+ @ tags: %h(zTagList),
884
+ }
885
+ @ date:
886
+ hyperlink_to_date(zDate, ")");
799887
}
800888
db_finalize(&q);
801889
}
802890
803891
804892
--- src/info.c
+++ src/info.c
@@ -464,11 +464,11 @@
464 rid
465 );
466 isLeaf = is_a_leaf(rid);
467 db_prepare(&q,
468 "SELECT uuid, datetime(mtime, 'localtime'), user, comment,"
469 " datetime(omtime, 'localtime')"
470 " FROM blob, event"
471 " WHERE blob.rid=%d"
472 " AND event.objid=%d",
473 rid, rid
474 );
@@ -479,10 +479,14 @@
479 char *zEUser, *zEComment;
480 const char *zUser;
481 const char *zComment;
482 const char *zDate;
483 const char *zOrigDate;
 
 
 
 
484 style_header(zTitle);
485 login_anonymous_available();
486 free(zTitle);
487 zEUser = db_text(0,
488 "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d",
@@ -492,10 +496,11 @@
492 TAG_COMMENT, rid);
493 zUser = db_column_text(&q, 2);
494 zComment = db_column_text(&q, 3);
495 zDate = db_column_text(&q,1);
496 zOrigDate = db_column_text(&q, 4);
 
497 @ <div class="section">Overview</div>
498 @ <table class="label-value">
499 @ <tr><th>SHA1&nbsp;Hash:</th><td>%s(zUuid)
500 if( g.perm.Setup ){
501 @ (Record ID: %d(rid))
@@ -559,10 +564,62 @@
559 while( db_step(&q)==SQLITE_ROW ){
560 const char *zTagName = db_column_text(&q, 0);
561 @ | %z(href("%R/timeline?r=%T",zTagName))%h(zTagName)</a>
562 }
563 db_finalize(&q);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
564 if( g.perm.Zip ){
565 char *zUrl = mprintf("%R/tarball/%s-%S.tar.gz?uuid=%s",
566 zProjName, zUuid, zUuid);
567 @ </td></tr>
568 @ <tr><th>Downloads:</th><td>
@@ -774,30 +831,61 @@
774 }
775
776 /*
777 ** Output a description of a check-in
778 */
779 void checkin_description(int rid){
780 Stmt q;
781 db_prepare(&q,
782 "SELECT datetime(mtime), coalesce(euser,user),"
783 " coalesce(ecomment,comment), uuid"
 
 
 
784 " FROM event, blob"
785 " WHERE event.objid=%d AND type='ci'"
786 " AND blob.rid=%d",
787 rid, rid
788 );
789 while( db_step(&q)==SQLITE_ROW ){
790 const char *zDate = db_column_text(&q, 0);
791 const char *zUser = db_column_text(&q, 1);
792 const char *zCom = db_column_text(&q, 2);
793 const char *zUuid = db_column_text(&q, 3);
794 @ Check-in
 
 
 
 
 
795 hyperlink_to_uuid(zUuid);
796 @ - %w(zCom) by
797 hyperlink_to_user(zUser,zDate," on");
798 hyperlink_to_date(zDate, ".");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
799 }
800 db_finalize(&q);
801 }
802
803
804
--- src/info.c
+++ src/info.c
@@ -464,11 +464,11 @@
464 rid
465 );
466 isLeaf = is_a_leaf(rid);
467 db_prepare(&q,
468 "SELECT uuid, datetime(mtime, 'localtime'), user, comment,"
469 " datetime(omtime, 'localtime'), mtime"
470 " FROM blob, event"
471 " WHERE blob.rid=%d"
472 " AND event.objid=%d",
473 rid, rid
474 );
@@ -479,10 +479,14 @@
479 char *zEUser, *zEComment;
480 const char *zUser;
481 const char *zComment;
482 const char *zDate;
483 const char *zOrigDate;
484 char *zThisBranch;
485 double thisMtime;
486 int seenDiffTitle = 0;
487
488 style_header(zTitle);
489 login_anonymous_available();
490 free(zTitle);
491 zEUser = db_text(0,
492 "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d",
@@ -492,10 +496,11 @@
496 TAG_COMMENT, rid);
497 zUser = db_column_text(&q, 2);
498 zComment = db_column_text(&q, 3);
499 zDate = db_column_text(&q,1);
500 zOrigDate = db_column_text(&q, 4);
501 thisMtime = db_column_double(&q, 5);
502 @ <div class="section">Overview</div>
503 @ <table class="label-value">
504 @ <tr><th>SHA1&nbsp;Hash:</th><td>%s(zUuid)
505 if( g.perm.Setup ){
506 @ (Record ID: %d(rid))
@@ -559,10 +564,62 @@
564 while( db_step(&q)==SQLITE_ROW ){
565 const char *zTagName = db_column_text(&q, 0);
566 @ | %z(href("%R/timeline?r=%T",zTagName))%h(zTagName)</a>
567 }
568 db_finalize(&q);
569
570 /* Select a few other branches to diff against */
571 zThisBranch = db_text("trunk", "SELECT value FROM tagxref"
572 " WHERE tagid=%d AND tagtype>0"
573 " AND rid=%d",
574 TAG_BRANCH, rid);
575
576 /* Find nearby leaves to offer to diff against */
577 db_prepare(&q,
578 "SELECT tagxref.value, blob.uuid, min(%.17g-event.mtime)"
579 " FROM leaf, event, tagxref, blob"
580 " WHERE event.mtime BETWEEN %.17g AND %.17g"
581 " AND event.type='ci'"
582 " AND event.objid=leaf.rid"
583 " AND NOT %z"
584 " AND tagxref.rid=event.objid"
585 " AND tagxref.tagid=%d AND tagxref.tagtype>0"
586 " AND tagxref.value!=%Q"
587 " AND blob.rid=tagxref.rid"
588 " GROUP BY 1 ORDER BY 3",
589 thisMtime, thisMtime-7, thisMtime+7,
590 leaf_is_closed_sql("leaf.rid"),
591 TAG_BRANCH, zThisBranch
592 );
593 while( db_step(&q)==SQLITE_ROW ){
594 const char *zBr = db_column_text(&q, 0);
595 const char *zId = db_column_text(&q, 1);
596 if( !seenDiffTitle ){
597 @ <tr><th valign="top">Diffs:</th><td valign="top">
598 seenDiffTitle = 1;
599 }else{
600 @ |
601 }
602 @ %z(href("%R/vdiff?from=%S&to=%S",zId, zUuid))%h(zBr)</a>
603 }
604 db_finalize(&q);
605
606 if( fossil_strcmp(zThisBranch,"trunk")!=0 ){
607 if( !seenDiffTitle ){
608 @ <tr><th valign="top">Diffs:</th><td valign="top">
609 seenDiffTitle = 1;
610 }else{
611 @ |
612 }
613 @ %z(href("%R/vdiff?from=root:%S&to=%S",zUuid,zUuid))root of
614 @ this branch</a>
615 }
616 if( seenDiffTitle ){
617 @ </td></tr>
618 }
619
620 /* The Download: line */
621 if( g.perm.Zip ){
622 char *zUrl = mprintf("%R/tarball/%s-%S.tar.gz?uuid=%s",
623 zProjName, zUuid, zUuid);
624 @ </td></tr>
625 @ <tr><th>Downloads:</th><td>
@@ -774,30 +831,61 @@
831 }
832
833 /*
834 ** Output a description of a check-in
835 */
836 static void checkin_description(int rid){
837 Stmt q;
838 db_prepare(&q,
839 "SELECT datetime(mtime), coalesce(euser,user),"
840 " coalesce(ecomment,comment), uuid,"
841 " (SELECT group_concat(substr(tagname,5), ', ') FROM tag, tagxref"
842 " WHERE tagname GLOB 'sym-*' AND tag.tagid=tagxref.tagid"
843 " AND tagxref.rid=blob.rid AND tagxref.tagtype>0)"
844 " FROM event, blob"
845 " WHERE event.objid=%d AND type='ci'"
846 " AND blob.rid=%d",
847 rid, rid
848 );
849 while( db_step(&q)==SQLITE_ROW ){
850 const char *zDate = db_column_text(&q, 0);
851 const char *zUser = db_column_text(&q, 1);
 
852 const char *zUuid = db_column_text(&q, 3);
853 const char *zTagList = db_column_text(&q, 4);
854 Blob comment;
855 int wikiFlags = WIKI_INLINE;
856 if( db_get_boolean("timeline-block-markup", 0)==0 ){
857 wikiFlags |= WIKI_NOBLOCK;
858 }
859 hyperlink_to_uuid(zUuid);
860 blob_zero(&comment);
861 db_column_blob(&q, 2, &comment);
862 wiki_convert(&comment, 0, wikiFlags);
863 blob_reset(&comment);
864 @ (user:
865 hyperlink_to_user(zUser,zDate,",");
866 if( zTagList && zTagList[0] && g.perm.Hyperlink ){
867 int i;
868 const char *z = zTagList;
869 Blob links;
870 blob_zero(&links);
871 while( z && z[0] ){
872 for(i=0; z[i] && (z[i]!=',' || z[i+1]!=' '); i++){}
873 blob_appendf(&links,
874 "%z%#h</a>%.2s",
875 href("%R/timeline?r=%#t&nd&c=%s",i,z,zDate), i,z, &z[i]
876 );
877 if( z[i]==0 ) break;
878 z += i+2;
879 }
880 @ tags: %s(blob_str(&links)),
881 blob_reset(&links);
882 }else{
883 @ tags: %h(zTagList),
884 }
885 @ date:
886 hyperlink_to_date(zDate, ")");
887 }
888 db_finalize(&q);
889 }
890
891
892
+1
--- src/name.c
+++ src/name.c
@@ -152,10 +152,11 @@
152152
" AND event.objid=tagxref.rid "
153153
" AND event.type GLOB '%q'"
154154
" ORDER BY event.mtime DESC /*sort*/",
155155
&zTag[4], zType
156156
);
157
+ return rid;
157158
}
158159
159160
/* root:TAG -> The origin of the branch */
160161
if( memcmp(zTag, "root:", 5)==0 ){
161162
Stmt q;
162163
--- src/name.c
+++ src/name.c
@@ -152,10 +152,11 @@
152 " AND event.objid=tagxref.rid "
153 " AND event.type GLOB '%q'"
154 " ORDER BY event.mtime DESC /*sort*/",
155 &zTag[4], zType
156 );
 
157 }
158
159 /* root:TAG -> The origin of the branch */
160 if( memcmp(zTag, "root:", 5)==0 ){
161 Stmt q;
162
--- src/name.c
+++ src/name.c
@@ -152,10 +152,11 @@
152 " AND event.objid=tagxref.rid "
153 " AND event.type GLOB '%q'"
154 " ORDER BY event.mtime DESC /*sort*/",
155 &zTag[4], zType
156 );
157 return rid;
158 }
159
160 /* root:TAG -> The origin of the branch */
161 if( memcmp(zTag, "root:", 5)==0 ){
162 Stmt q;
163

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button