Fossil SCM
In wiki_submenu_to_read_wiki(), do not show the menu entry for branch/... pages. This is a proposed solution for [forum:ff453de2f30791dd | forum post ff453de2f30791dd], in which the /wiki/foo link on /timeline?r=foo redirects back to /timeline?r=foo. Similar treatment may be needed for the other special wiki types.
Commit
f15b634402d0c16bbedeaf7d9df66ae05158fbf4e1820fd62574dbb9cf2d3519
Parent
aef937dab525ca3…
1 file changed
+4
-1
+4
-1
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -2583,11 +2583,14 @@ | ||
| 2583 | 2583 | static void wiki_submenu_to_read_wiki( |
| 2584 | 2584 | const char *zPrefix, /* "branch", "tag", or "checkin" */ |
| 2585 | 2585 | const char *zName, /* Name of the object */ |
| 2586 | 2586 | unsigned int mFlags /* Zero or more WIKIASSOC_* flags */ |
| 2587 | 2587 | ){ |
| 2588 | - if( g.perm.RdWiki && (mFlags & WIKIASSOC_MENU_READ)!=0 ){ | |
| 2588 | + if( g.perm.RdWiki && (mFlags & WIKIASSOC_MENU_READ)!=0 | |
| 2589 | + && 0!=fossil_strcmp("branch", zPrefix) | |
| 2590 | + /* ^^^ https://fossil-scm.org/forum/forumpost/ff453de2f30791dd */ | |
| 2591 | + ){ | |
| 2589 | 2592 | style_submenu_element("Wiki", "%R/wiki?name=%s/%t", zPrefix, zName); |
| 2590 | 2593 | } |
| 2591 | 2594 | } |
| 2592 | 2595 | |
| 2593 | 2596 | /* |
| 2594 | 2597 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -2583,11 +2583,14 @@ | |
| 2583 | static void wiki_submenu_to_read_wiki( |
| 2584 | const char *zPrefix, /* "branch", "tag", or "checkin" */ |
| 2585 | const char *zName, /* Name of the object */ |
| 2586 | unsigned int mFlags /* Zero or more WIKIASSOC_* flags */ |
| 2587 | ){ |
| 2588 | if( g.perm.RdWiki && (mFlags & WIKIASSOC_MENU_READ)!=0 ){ |
| 2589 | style_submenu_element("Wiki", "%R/wiki?name=%s/%t", zPrefix, zName); |
| 2590 | } |
| 2591 | } |
| 2592 | |
| 2593 | /* |
| 2594 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -2583,11 +2583,14 @@ | |
| 2583 | static void wiki_submenu_to_read_wiki( |
| 2584 | const char *zPrefix, /* "branch", "tag", or "checkin" */ |
| 2585 | const char *zName, /* Name of the object */ |
| 2586 | unsigned int mFlags /* Zero or more WIKIASSOC_* flags */ |
| 2587 | ){ |
| 2588 | if( g.perm.RdWiki && (mFlags & WIKIASSOC_MENU_READ)!=0 |
| 2589 | && 0!=fossil_strcmp("branch", zPrefix) |
| 2590 | /* ^^^ https://fossil-scm.org/forum/forumpost/ff453de2f30791dd */ |
| 2591 | ){ |
| 2592 | style_submenu_element("Wiki", "%R/wiki?name=%s/%t", zPrefix, zName); |
| 2593 | } |
| 2594 | } |
| 2595 | |
| 2596 | /* |
| 2597 |