Fossil SCM

Fix the /ambiguous page so that the src= query parameter is optional. Fix the /hash-colisions page so that it links to /ambiguous rather than to /whatis.

drh 2020-06-12 13:25 trunk
Commit 9a0132e52846e263039850d48b516cede1c2375d0cf5b453966b4c71cadc14bd
1 file changed +6 -3
+6 -3
--- src/name.c
+++ src/name.c
@@ -599,22 +599,25 @@
599599
** WEBPAGE: ambiguous
600600
** URL: /ambiguous?name=NAME&src=WEBPAGE
601601
**
602602
** The NAME given by the name parameter is ambiguous. Display a page
603603
** that shows all possible choices and let the user select between them.
604
+**
605
+** The src= query parameter is optional. If omitted it defaults
606
+** to "info".
604607
*/
605608
void ambiguous_page(void){
606609
Stmt q;
607610
const char *zName = P("name");
608
- const char *zSrc = P("src");
611
+ const char *zSrc = PD("src","info");
609612
char *z;
610613
611614
if( zName==0 || zName[0]==0 || zSrc==0 || zSrc[0]==0 ){
612615
fossil_redirect_home();
613616
}
614617
style_header("Ambiguous Artifact ID");
615
- @ <p>The artifact id <b>%h(zName)</b> is ambiguous and might
618
+ @ <p>The artifact hash prefix <b>%h(zName)</b> is ambiguous and might
616619
@ mean any of the following:
617620
@ <ol>
618621
z = mprintf("%s", zName);
619622
canonical16(z, strlen(z));
620623
db_prepare(&q, "SELECT uuid, rid FROM blob WHERE uuid GLOB '%q*'", z);
@@ -1613,11 +1616,11 @@
16131616
@ <p>First 25 collisions of length %d(i):
16141617
}
16151618
for(j=0; j<aCollide[i].cnt && j<MAX_COLLIDE; j++){
16161619
char *zId = aCollide[i].azHit[j];
16171620
if( zId==0 ) continue;
1618
- @ %z(href("%R/whatis/%s",zId))%h(zId)</a>
1621
+ @ %z(href("%R/ambiguous/%s",zId))%h(zId)</a>
16191622
}
16201623
}
16211624
for(i=4; i<count(aCollide); i++){
16221625
for(j=0; j<aCollide[i].cnt && j<MAX_COLLIDE; j++){
16231626
fossil_free(aCollide[i].azHit[j]);
16241627
--- src/name.c
+++ src/name.c
@@ -599,22 +599,25 @@
599 ** WEBPAGE: ambiguous
600 ** URL: /ambiguous?name=NAME&src=WEBPAGE
601 **
602 ** The NAME given by the name parameter is ambiguous. Display a page
603 ** that shows all possible choices and let the user select between them.
 
 
 
604 */
605 void ambiguous_page(void){
606 Stmt q;
607 const char *zName = P("name");
608 const char *zSrc = P("src");
609 char *z;
610
611 if( zName==0 || zName[0]==0 || zSrc==0 || zSrc[0]==0 ){
612 fossil_redirect_home();
613 }
614 style_header("Ambiguous Artifact ID");
615 @ <p>The artifact id <b>%h(zName)</b> is ambiguous and might
616 @ mean any of the following:
617 @ <ol>
618 z = mprintf("%s", zName);
619 canonical16(z, strlen(z));
620 db_prepare(&q, "SELECT uuid, rid FROM blob WHERE uuid GLOB '%q*'", z);
@@ -1613,11 +1616,11 @@
1613 @ <p>First 25 collisions of length %d(i):
1614 }
1615 for(j=0; j<aCollide[i].cnt && j<MAX_COLLIDE; j++){
1616 char *zId = aCollide[i].azHit[j];
1617 if( zId==0 ) continue;
1618 @ %z(href("%R/whatis/%s",zId))%h(zId)</a>
1619 }
1620 }
1621 for(i=4; i<count(aCollide); i++){
1622 for(j=0; j<aCollide[i].cnt && j<MAX_COLLIDE; j++){
1623 fossil_free(aCollide[i].azHit[j]);
1624
--- src/name.c
+++ src/name.c
@@ -599,22 +599,25 @@
599 ** WEBPAGE: ambiguous
600 ** URL: /ambiguous?name=NAME&src=WEBPAGE
601 **
602 ** The NAME given by the name parameter is ambiguous. Display a page
603 ** that shows all possible choices and let the user select between them.
604 **
605 ** The src= query parameter is optional. If omitted it defaults
606 ** to "info".
607 */
608 void ambiguous_page(void){
609 Stmt q;
610 const char *zName = P("name");
611 const char *zSrc = PD("src","info");
612 char *z;
613
614 if( zName==0 || zName[0]==0 || zSrc==0 || zSrc[0]==0 ){
615 fossil_redirect_home();
616 }
617 style_header("Ambiguous Artifact ID");
618 @ <p>The artifact hash prefix <b>%h(zName)</b> is ambiguous and might
619 @ mean any of the following:
620 @ <ol>
621 z = mprintf("%s", zName);
622 canonical16(z, strlen(z));
623 db_prepare(&q, "SELECT uuid, rid FROM blob WHERE uuid GLOB '%q*'", z);
@@ -1613,11 +1616,11 @@
1616 @ <p>First 25 collisions of length %d(i):
1617 }
1618 for(j=0; j<aCollide[i].cnt && j<MAX_COLLIDE; j++){
1619 char *zId = aCollide[i].azHit[j];
1620 if( zId==0 ) continue;
1621 @ %z(href("%R/ambiguous/%s",zId))%h(zId)</a>
1622 }
1623 }
1624 for(i=4; i<count(aCollide); i++){
1625 for(j=0; j<aCollide[i].cnt && j<MAX_COLLIDE; j++){
1626 fossil_free(aCollide[i].azHit[j]);
1627

Keyboard Shortcuts

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