Fossil SCM

Further improvements to /clusterlist and to /info for a cluster.

drh 2024-12-20 19:50 trunk
Commit 9953b169766f74ff05e12c8c8c0eebb62d1aa2a7d36798bff7e9cc304671901e
2 files changed +15 -1 +12 -14
+15 -1
--- src/info.c
+++ src/info.c
@@ -3181,20 +3181,34 @@
31813181
Blob unks = BLOB_INITIALIZER;
31823182
Stmt q;
31833183
char *zSha1Bg;
31843184
char *zSha3Bg;
31853185
int badRid = 0;
3186
+ int rcvid;
31863187
int hashClr = PB("hclr");
3188
+ const char *zDate;
31873189
31883190
pCluster = manifest_get(rid, CFTYPE_CLUSTER, 0);
31893191
if( pCluster==0 ){
31903192
artifact_page();
31913193
return;
31923194
}
31933195
style_header("Cluster %S", zName);
3196
+ rcvid = db_int(0, "SELECT rcvid FROM blob WHERE rid=%d", rid);
3197
+ if( rcvid==0 ){
3198
+ zDate = 0;
3199
+ }else{
3200
+ zDate = db_text(0, "SELECT datetime(mtime) FROM rcvfrom WHERE rcvid=%d",
3201
+ rcvid);
3202
+ }
31943203
@ <p>Artifact %z(href("%R/artifact/%h",zName))%S(zName)</a> is a cluster
3195
- @ with %d(pCluster->nCChild) entries:</p>
3204
+ @ with %d(pCluster->nCChild) entries
3205
+ if( g.perm.Admin ){
3206
+ @ received <a href="%R/rcvfrom?rcvid=%d(rcvid)">%h(zDate)</a>:
3207
+ }else{
3208
+ @ received %h(zDate):
3209
+ }
31963210
blob_appendf(&where,"IN(0");
31973211
for(i=0; i<pCluster->nCChild; i++){
31983212
int rid = fast_uuid_to_rid(pCluster->azCChild[i]);
31993213
if( rid ){
32003214
blob_appendf(&where,",%d", rid);
32013215
--- src/info.c
+++ src/info.c
@@ -3181,20 +3181,34 @@
3181 Blob unks = BLOB_INITIALIZER;
3182 Stmt q;
3183 char *zSha1Bg;
3184 char *zSha3Bg;
3185 int badRid = 0;
 
3186 int hashClr = PB("hclr");
 
3187
3188 pCluster = manifest_get(rid, CFTYPE_CLUSTER, 0);
3189 if( pCluster==0 ){
3190 artifact_page();
3191 return;
3192 }
3193 style_header("Cluster %S", zName);
 
 
 
 
 
 
 
3194 @ <p>Artifact %z(href("%R/artifact/%h",zName))%S(zName)</a> is a cluster
3195 @ with %d(pCluster->nCChild) entries:</p>
 
 
 
 
 
3196 blob_appendf(&where,"IN(0");
3197 for(i=0; i<pCluster->nCChild; i++){
3198 int rid = fast_uuid_to_rid(pCluster->azCChild[i]);
3199 if( rid ){
3200 blob_appendf(&where,",%d", rid);
3201
--- src/info.c
+++ src/info.c
@@ -3181,20 +3181,34 @@
3181 Blob unks = BLOB_INITIALIZER;
3182 Stmt q;
3183 char *zSha1Bg;
3184 char *zSha3Bg;
3185 int badRid = 0;
3186 int rcvid;
3187 int hashClr = PB("hclr");
3188 const char *zDate;
3189
3190 pCluster = manifest_get(rid, CFTYPE_CLUSTER, 0);
3191 if( pCluster==0 ){
3192 artifact_page();
3193 return;
3194 }
3195 style_header("Cluster %S", zName);
3196 rcvid = db_int(0, "SELECT rcvid FROM blob WHERE rid=%d", rid);
3197 if( rcvid==0 ){
3198 zDate = 0;
3199 }else{
3200 zDate = db_text(0, "SELECT datetime(mtime) FROM rcvfrom WHERE rcvid=%d",
3201 rcvid);
3202 }
3203 @ <p>Artifact %z(href("%R/artifact/%h",zName))%S(zName)</a> is a cluster
3204 @ with %d(pCluster->nCChild) entries
3205 if( g.perm.Admin ){
3206 @ received <a href="%R/rcvfrom?rcvid=%d(rcvid)">%h(zDate)</a>:
3207 }else{
3208 @ received %h(zDate):
3209 }
3210 blob_appendf(&where,"IN(0");
3211 for(i=0; i<pCluster->nCChild; i++){
3212 int rid = fast_uuid_to_rid(pCluster->azCChild[i]);
3213 if( rid ){
3214 blob_appendf(&where,",%d", rid);
3215
+12 -14
--- src/name.c
+++ src/name.c
@@ -1756,12 +1756,15 @@
17561756
zRange = mprintf("BETWEEN %d AND %d", s, s+n-1);
17571757
}
17581758
describe_artifacts(zRange);
17591759
fossil_free(zRange);
17601760
db_prepare(&q,
1761
- "SELECT rid, uuid, summary, isPrivate, type='phantom', rcvid, ref"
1762
- " FROM description ORDER BY rid %s",
1761
+ /* 0 1 2 3 4 5 6 */
1762
+ "SELECT rid, uuid, summary, isPrivate, type='phantom', ref, rcvid, "
1763
+ " datetime(rcvfrom.mtime)"
1764
+ " FROM description LEFT JOIN rcvfrom USING(rcvid)"
1765
+ " ORDER BY rid %s",
17631766
((bRecent||bUnclst)?"DESC":"ASC")/*safe-for-%s*/
17641767
);
17651768
if( skin_detail_boolean("white-foreground") ){
17661769
zSha1Bg = "#714417";
17671770
zSha3Bg = "#177117";
@@ -1768,22 +1771,19 @@
17681771
}else{
17691772
zSha1Bg = "#ebffb0";
17701773
zSha3Bg = "#b0ffb0";
17711774
}
17721775
@ <table cellpadding="2" cellspacing="0" border="1">
1773
- if( g.perm.Admin ){
1774
- @ <tr><th>RID<th>Hash<th>Rcvid<th>Description<th>Ref<th>Remarks
1775
- }else{
1776
- @ <tr><th>RID<th>Hash<th>Description<th>Ref<th>Remarks
1777
- }
1776
+ @ <tr><th>RID<th>Hash<th>Received<th>Description<th>Ref<th>Remarks
17781777
while( db_step(&q)==SQLITE_ROW ){
17791778
int rid = db_column_int(&q,0);
17801779
const char *zUuid = db_column_text(&q, 1);
17811780
const char *zDesc = db_column_text(&q, 2);
17821781
int isPriv = db_column_int(&q,3);
17831782
int isPhantom = db_column_int(&q,4);
1784
- const char *zRef = db_column_text(&q,6);
1783
+ const char *zRef = db_column_text(&q,5);
1784
+ const char *zDate = db_column_text(&q,7);
17851785
if( isPriv && !isPhantom && !g.perm.Private && !g.perm.Admin ){
17861786
/* Don't show private artifacts to users without Private (x) permission */
17871787
continue;
17881788
}
17891789
if( hashClr ){
@@ -1792,16 +1792,14 @@
17921792
}else{
17931793
@ <tr><td align="right">%d(rid)</td>
17941794
}
17951795
@ <td>&nbsp;%z(href("%R/info/%!S",zUuid))%S(zUuid)</a>&nbsp;</td>
17961796
if( g.perm.Admin ){
1797
- int rcvid = db_column_int(&q,5);
1798
- if( rcvid<=0 ){
1799
- @ <td>&nbsp;
1800
- }else{
1801
- @ <td><a href='%R/rcvfrom?rcvid=%d(rcvid)'>%d(rcvid)</a>
1802
- }
1797
+ int rcvid = db_column_int(&q, 6);
1798
+ @ <td><a href='%R/rcvfrom?rcvid=%d(rcvid)'>%h(zDate)</a>
1799
+ }else{
1800
+ @ <td>%h(zDate)
18031801
}
18041802
@ <td align="left">%h(zDesc)</td>
18051803
if( zRef && zRef[0] ){
18061804
@ <td>%z(href("%R/info/%!S",zRef))%S(zRef)</a>
18071805
}else{
18081806
--- src/name.c
+++ src/name.c
@@ -1756,12 +1756,15 @@
1756 zRange = mprintf("BETWEEN %d AND %d", s, s+n-1);
1757 }
1758 describe_artifacts(zRange);
1759 fossil_free(zRange);
1760 db_prepare(&q,
1761 "SELECT rid, uuid, summary, isPrivate, type='phantom', rcvid, ref"
1762 " FROM description ORDER BY rid %s",
 
 
 
1763 ((bRecent||bUnclst)?"DESC":"ASC")/*safe-for-%s*/
1764 );
1765 if( skin_detail_boolean("white-foreground") ){
1766 zSha1Bg = "#714417";
1767 zSha3Bg = "#177117";
@@ -1768,22 +1771,19 @@
1768 }else{
1769 zSha1Bg = "#ebffb0";
1770 zSha3Bg = "#b0ffb0";
1771 }
1772 @ <table cellpadding="2" cellspacing="0" border="1">
1773 if( g.perm.Admin ){
1774 @ <tr><th>RID<th>Hash<th>Rcvid<th>Description<th>Ref<th>Remarks
1775 }else{
1776 @ <tr><th>RID<th>Hash<th>Description<th>Ref<th>Remarks
1777 }
1778 while( db_step(&q)==SQLITE_ROW ){
1779 int rid = db_column_int(&q,0);
1780 const char *zUuid = db_column_text(&q, 1);
1781 const char *zDesc = db_column_text(&q, 2);
1782 int isPriv = db_column_int(&q,3);
1783 int isPhantom = db_column_int(&q,4);
1784 const char *zRef = db_column_text(&q,6);
 
1785 if( isPriv && !isPhantom && !g.perm.Private && !g.perm.Admin ){
1786 /* Don't show private artifacts to users without Private (x) permission */
1787 continue;
1788 }
1789 if( hashClr ){
@@ -1792,16 +1792,14 @@
1792 }else{
1793 @ <tr><td align="right">%d(rid)</td>
1794 }
1795 @ <td>&nbsp;%z(href("%R/info/%!S",zUuid))%S(zUuid)</a>&nbsp;</td>
1796 if( g.perm.Admin ){
1797 int rcvid = db_column_int(&q,5);
1798 if( rcvid<=0 ){
1799 @ <td>&nbsp;
1800 }else{
1801 @ <td><a href='%R/rcvfrom?rcvid=%d(rcvid)'>%d(rcvid)</a>
1802 }
1803 }
1804 @ <td align="left">%h(zDesc)</td>
1805 if( zRef && zRef[0] ){
1806 @ <td>%z(href("%R/info/%!S",zRef))%S(zRef)</a>
1807 }else{
1808
--- src/name.c
+++ src/name.c
@@ -1756,12 +1756,15 @@
1756 zRange = mprintf("BETWEEN %d AND %d", s, s+n-1);
1757 }
1758 describe_artifacts(zRange);
1759 fossil_free(zRange);
1760 db_prepare(&q,
1761 /* 0 1 2 3 4 5 6 */
1762 "SELECT rid, uuid, summary, isPrivate, type='phantom', ref, rcvid, "
1763 " datetime(rcvfrom.mtime)"
1764 " FROM description LEFT JOIN rcvfrom USING(rcvid)"
1765 " ORDER BY rid %s",
1766 ((bRecent||bUnclst)?"DESC":"ASC")/*safe-for-%s*/
1767 );
1768 if( skin_detail_boolean("white-foreground") ){
1769 zSha1Bg = "#714417";
1770 zSha3Bg = "#177117";
@@ -1768,22 +1771,19 @@
1771 }else{
1772 zSha1Bg = "#ebffb0";
1773 zSha3Bg = "#b0ffb0";
1774 }
1775 @ <table cellpadding="2" cellspacing="0" border="1">
1776 @ <tr><th>RID<th>Hash<th>Received<th>Description<th>Ref<th>Remarks
 
 
 
 
1777 while( db_step(&q)==SQLITE_ROW ){
1778 int rid = db_column_int(&q,0);
1779 const char *zUuid = db_column_text(&q, 1);
1780 const char *zDesc = db_column_text(&q, 2);
1781 int isPriv = db_column_int(&q,3);
1782 int isPhantom = db_column_int(&q,4);
1783 const char *zRef = db_column_text(&q,5);
1784 const char *zDate = db_column_text(&q,7);
1785 if( isPriv && !isPhantom && !g.perm.Private && !g.perm.Admin ){
1786 /* Don't show private artifacts to users without Private (x) permission */
1787 continue;
1788 }
1789 if( hashClr ){
@@ -1792,16 +1792,14 @@
1792 }else{
1793 @ <tr><td align="right">%d(rid)</td>
1794 }
1795 @ <td>&nbsp;%z(href("%R/info/%!S",zUuid))%S(zUuid)</a>&nbsp;</td>
1796 if( g.perm.Admin ){
1797 int rcvid = db_column_int(&q, 6);
1798 @ <td><a href='%R/rcvfrom?rcvid=%d(rcvid)'>%h(zDate)</a>
1799 }else{
1800 @ <td>%h(zDate)
 
 
1801 }
1802 @ <td align="left">%h(zDesc)</td>
1803 if( zRef && zRef[0] ){
1804 @ <td>%z(href("%R/info/%!S",zRef))%S(zRef)</a>
1805 }else{
1806

Keyboard Shortcuts

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