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.
Commit
9a0132e52846e263039850d48b516cede1c2375d0cf5b453966b4c71cadc14bd
Parent
b3d57881915d804…
1 file changed
+6
-3
+6
-3
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -599,22 +599,25 @@ | ||
| 599 | 599 | ** WEBPAGE: ambiguous |
| 600 | 600 | ** URL: /ambiguous?name=NAME&src=WEBPAGE |
| 601 | 601 | ** |
| 602 | 602 | ** The NAME given by the name parameter is ambiguous. Display a page |
| 603 | 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". | |
| 604 | 607 | */ |
| 605 | 608 | void ambiguous_page(void){ |
| 606 | 609 | Stmt q; |
| 607 | 610 | const char *zName = P("name"); |
| 608 | - const char *zSrc = P("src"); | |
| 611 | + const char *zSrc = PD("src","info"); | |
| 609 | 612 | char *z; |
| 610 | 613 | |
| 611 | 614 | if( zName==0 || zName[0]==0 || zSrc==0 || zSrc[0]==0 ){ |
| 612 | 615 | fossil_redirect_home(); |
| 613 | 616 | } |
| 614 | 617 | 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 | |
| 616 | 619 | @ mean any of the following: |
| 617 | 620 | @ <ol> |
| 618 | 621 | z = mprintf("%s", zName); |
| 619 | 622 | canonical16(z, strlen(z)); |
| 620 | 623 | db_prepare(&q, "SELECT uuid, rid FROM blob WHERE uuid GLOB '%q*'", z); |
| @@ -1613,11 +1616,11 @@ | ||
| 1613 | 1616 | @ <p>First 25 collisions of length %d(i): |
| 1614 | 1617 | } |
| 1615 | 1618 | for(j=0; j<aCollide[i].cnt && j<MAX_COLLIDE; j++){ |
| 1616 | 1619 | char *zId = aCollide[i].azHit[j]; |
| 1617 | 1620 | if( zId==0 ) continue; |
| 1618 | - @ %z(href("%R/whatis/%s",zId))%h(zId)</a> | |
| 1621 | + @ %z(href("%R/ambiguous/%s",zId))%h(zId)</a> | |
| 1619 | 1622 | } |
| 1620 | 1623 | } |
| 1621 | 1624 | for(i=4; i<count(aCollide); i++){ |
| 1622 | 1625 | for(j=0; j<aCollide[i].cnt && j<MAX_COLLIDE; j++){ |
| 1623 | 1626 | fossil_free(aCollide[i].azHit[j]); |
| 1624 | 1627 |
| --- 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 |