Fossil SCM
If the name of a 'sym-<branchname>' tag sorts before the 'branch' tag, no option in the ci_edit page should be displayed to cancel the tag. Bug-fix discovered and implemented by Andy Bradford.
Commit
3529f2c47bb068692371220f4abf743b452b9b25
Parent
07a8e5d08500d2b…
2 files changed
+12
-12
+12
-12
+12
-12
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -1770,11 +1770,11 @@ | ||
| 1770 | 1770 | if( modPending ){ |
| 1771 | 1771 | @ <span class="modpending">*** Awaiting Moderator Approval ***</span> |
| 1772 | 1772 | } |
| 1773 | 1773 | @ <tr><th>Ticket:</th> |
| 1774 | 1774 | @ <td>%z(href("%R/tktview/%s",zTktName))%s(zTktName)</a> |
| 1775 | - if(zTktTitle){ | |
| 1775 | + if( zTktTitle ){ | |
| 1776 | 1776 | @<br>%h(zTktTitle) |
| 1777 | 1777 | } |
| 1778 | 1778 | @</td></tr> |
| 1779 | 1779 | @ <tr><th>Date:</th><td> |
| 1780 | 1780 | hyperlink_to_date(zDate, "</td></tr>"); |
| @@ -2295,10 +2295,13 @@ | ||
| 2295 | 2295 | @ <td valign="top"> |
| 2296 | 2296 | @ <label><input type="checkbox" id="newtag" name="newtag"%s(zNewTagFlag) /> |
| 2297 | 2297 | @ Add the following new tag name to this check-in:</label> |
| 2298 | 2298 | @ <input type="text" style="width:15;" name="tagname" value="%h(zNewTag)" |
| 2299 | 2299 | @ onkeyup="gebi('newtag').checked=!!this.value" /> |
| 2300 | + zBranchName = db_text(0, "SELECT value FROM tagxref, tag" | |
| 2301 | + " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid" | |
| 2302 | + " AND tagxref.tagid=%d", rid, TAG_BRANCH); | |
| 2300 | 2303 | db_prepare(&q, |
| 2301 | 2304 | "SELECT tag.tagid, tagname, tagxref.value FROM tagxref, tag" |
| 2302 | 2305 | " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid" |
| 2303 | 2306 | " ORDER BY CASE WHEN tagname GLOB 'sym-*' THEN substr(tagname,5)" |
| 2304 | 2307 | " ELSE tagname END /*sort*/", |
| @@ -2305,22 +2308,19 @@ | ||
| 2305 | 2308 | rid |
| 2306 | 2309 | ); |
| 2307 | 2310 | while( db_step(&q)==SQLITE_ROW ){ |
| 2308 | 2311 | int tagid = db_column_int(&q, 0); |
| 2309 | 2312 | const char *zTagName = db_column_text(&q, 1); |
| 2310 | - int isSpecialTag = strncmp(zTagName, "sym-", 4)!=0; | |
| 2313 | + int isSpecialTag = fossil_strncmp(zTagName, "sym-", 4)!=0; | |
| 2311 | 2314 | char zLabel[30]; |
| 2312 | 2315 | |
| 2313 | - if (tagid == TAG_CLOSED){ | |
| 2314 | - fHasClosed = 1; | |
| 2315 | - }else if (tagid == TAG_COMMENT){ | |
| 2316 | - continue; | |
| 2317 | - }else if (tagid == TAG_BRANCH){ | |
| 2318 | - zBranchName = mprintf("%s", db_column_text(&q, 2)); | |
| 2319 | - continue; | |
| 2320 | - }else if( !isSpecialTag && zBranchName && | |
| 2321 | - strcmp(&zTagName[4], zBranchName)==0){ | |
| 2316 | + if( tagid == TAG_CLOSED ){ | |
| 2317 | + fHasClosed = 1; | |
| 2318 | + }else if( (tagid == TAG_COMMENT) || (tagid == TAG_BRANCH) ){ | |
| 2319 | + continue; | |
| 2320 | + }else if( !isSpecialTag && zTagName && | |
| 2321 | + fossil_strcmp(&zTagName[4], zBranchName)==0){ | |
| 2322 | 2322 | continue; |
| 2323 | 2323 | } |
| 2324 | 2324 | sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid); |
| 2325 | 2325 | @ <br /><label> |
| 2326 | 2326 | if( P(zLabel) ){ |
| @@ -2368,11 +2368,11 @@ | ||
| 2368 | 2368 | @ as "closed" so that its leafs no longer appear on the "leaves" page |
| 2369 | 2369 | @ and are no longer labeled as a leaf "<b>Leaf</b>"</label> |
| 2370 | 2370 | @ </td></tr> |
| 2371 | 2371 | } |
| 2372 | 2372 | } |
| 2373 | - if(zBranchName) fossil_free(zBranchName); | |
| 2373 | + if( zBranchName ) fossil_free(zBranchName); | |
| 2374 | 2374 | |
| 2375 | 2375 | |
| 2376 | 2376 | @ <tr><td colspan="2"> |
| 2377 | 2377 | @ <input type="submit" name="preview" value="Preview" /> |
| 2378 | 2378 | @ <input type="submit" name="apply" value="Apply Changes" /> |
| 2379 | 2379 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1770,11 +1770,11 @@ | |
| 1770 | if( modPending ){ |
| 1771 | @ <span class="modpending">*** Awaiting Moderator Approval ***</span> |
| 1772 | } |
| 1773 | @ <tr><th>Ticket:</th> |
| 1774 | @ <td>%z(href("%R/tktview/%s",zTktName))%s(zTktName)</a> |
| 1775 | if(zTktTitle){ |
| 1776 | @<br>%h(zTktTitle) |
| 1777 | } |
| 1778 | @</td></tr> |
| 1779 | @ <tr><th>Date:</th><td> |
| 1780 | hyperlink_to_date(zDate, "</td></tr>"); |
| @@ -2295,10 +2295,13 @@ | |
| 2295 | @ <td valign="top"> |
| 2296 | @ <label><input type="checkbox" id="newtag" name="newtag"%s(zNewTagFlag) /> |
| 2297 | @ Add the following new tag name to this check-in:</label> |
| 2298 | @ <input type="text" style="width:15;" name="tagname" value="%h(zNewTag)" |
| 2299 | @ onkeyup="gebi('newtag').checked=!!this.value" /> |
| 2300 | db_prepare(&q, |
| 2301 | "SELECT tag.tagid, tagname, tagxref.value FROM tagxref, tag" |
| 2302 | " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid" |
| 2303 | " ORDER BY CASE WHEN tagname GLOB 'sym-*' THEN substr(tagname,5)" |
| 2304 | " ELSE tagname END /*sort*/", |
| @@ -2305,22 +2308,19 @@ | |
| 2305 | rid |
| 2306 | ); |
| 2307 | while( db_step(&q)==SQLITE_ROW ){ |
| 2308 | int tagid = db_column_int(&q, 0); |
| 2309 | const char *zTagName = db_column_text(&q, 1); |
| 2310 | int isSpecialTag = strncmp(zTagName, "sym-", 4)!=0; |
| 2311 | char zLabel[30]; |
| 2312 | |
| 2313 | if (tagid == TAG_CLOSED){ |
| 2314 | fHasClosed = 1; |
| 2315 | }else if (tagid == TAG_COMMENT){ |
| 2316 | continue; |
| 2317 | }else if (tagid == TAG_BRANCH){ |
| 2318 | zBranchName = mprintf("%s", db_column_text(&q, 2)); |
| 2319 | continue; |
| 2320 | }else if( !isSpecialTag && zBranchName && |
| 2321 | strcmp(&zTagName[4], zBranchName)==0){ |
| 2322 | continue; |
| 2323 | } |
| 2324 | sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid); |
| 2325 | @ <br /><label> |
| 2326 | if( P(zLabel) ){ |
| @@ -2368,11 +2368,11 @@ | |
| 2368 | @ as "closed" so that its leafs no longer appear on the "leaves" page |
| 2369 | @ and are no longer labeled as a leaf "<b>Leaf</b>"</label> |
| 2370 | @ </td></tr> |
| 2371 | } |
| 2372 | } |
| 2373 | if(zBranchName) fossil_free(zBranchName); |
| 2374 | |
| 2375 | |
| 2376 | @ <tr><td colspan="2"> |
| 2377 | @ <input type="submit" name="preview" value="Preview" /> |
| 2378 | @ <input type="submit" name="apply" value="Apply Changes" /> |
| 2379 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1770,11 +1770,11 @@ | |
| 1770 | if( modPending ){ |
| 1771 | @ <span class="modpending">*** Awaiting Moderator Approval ***</span> |
| 1772 | } |
| 1773 | @ <tr><th>Ticket:</th> |
| 1774 | @ <td>%z(href("%R/tktview/%s",zTktName))%s(zTktName)</a> |
| 1775 | if( zTktTitle ){ |
| 1776 | @<br>%h(zTktTitle) |
| 1777 | } |
| 1778 | @</td></tr> |
| 1779 | @ <tr><th>Date:</th><td> |
| 1780 | hyperlink_to_date(zDate, "</td></tr>"); |
| @@ -2295,10 +2295,13 @@ | |
| 2295 | @ <td valign="top"> |
| 2296 | @ <label><input type="checkbox" id="newtag" name="newtag"%s(zNewTagFlag) /> |
| 2297 | @ Add the following new tag name to this check-in:</label> |
| 2298 | @ <input type="text" style="width:15;" name="tagname" value="%h(zNewTag)" |
| 2299 | @ onkeyup="gebi('newtag').checked=!!this.value" /> |
| 2300 | zBranchName = db_text(0, "SELECT value FROM tagxref, tag" |
| 2301 | " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid" |
| 2302 | " AND tagxref.tagid=%d", rid, TAG_BRANCH); |
| 2303 | db_prepare(&q, |
| 2304 | "SELECT tag.tagid, tagname, tagxref.value FROM tagxref, tag" |
| 2305 | " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid" |
| 2306 | " ORDER BY CASE WHEN tagname GLOB 'sym-*' THEN substr(tagname,5)" |
| 2307 | " ELSE tagname END /*sort*/", |
| @@ -2305,22 +2308,19 @@ | |
| 2308 | rid |
| 2309 | ); |
| 2310 | while( db_step(&q)==SQLITE_ROW ){ |
| 2311 | int tagid = db_column_int(&q, 0); |
| 2312 | const char *zTagName = db_column_text(&q, 1); |
| 2313 | int isSpecialTag = fossil_strncmp(zTagName, "sym-", 4)!=0; |
| 2314 | char zLabel[30]; |
| 2315 | |
| 2316 | if( tagid == TAG_CLOSED ){ |
| 2317 | fHasClosed = 1; |
| 2318 | }else if( (tagid == TAG_COMMENT) || (tagid == TAG_BRANCH) ){ |
| 2319 | continue; |
| 2320 | }else if( !isSpecialTag && zTagName && |
| 2321 | fossil_strcmp(&zTagName[4], zBranchName)==0){ |
| 2322 | continue; |
| 2323 | } |
| 2324 | sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid); |
| 2325 | @ <br /><label> |
| 2326 | if( P(zLabel) ){ |
| @@ -2368,11 +2368,11 @@ | |
| 2368 | @ as "closed" so that its leafs no longer appear on the "leaves" page |
| 2369 | @ and are no longer labeled as a leaf "<b>Leaf</b>"</label> |
| 2370 | @ </td></tr> |
| 2371 | } |
| 2372 | } |
| 2373 | if( zBranchName ) fossil_free(zBranchName); |
| 2374 | |
| 2375 | |
| 2376 | @ <tr><td colspan="2"> |
| 2377 | @ <input type="submit" name="preview" value="Preview" /> |
| 2378 | @ <input type="submit" name="apply" value="Apply Changes" /> |
| 2379 |
+12
-12
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -1770,11 +1770,11 @@ | ||
| 1770 | 1770 | if( modPending ){ |
| 1771 | 1771 | @ <span class="modpending">*** Awaiting Moderator Approval ***</span> |
| 1772 | 1772 | } |
| 1773 | 1773 | @ <tr><th>Ticket:</th> |
| 1774 | 1774 | @ <td>%z(href("%R/tktview/%s",zTktName))%s(zTktName)</a> |
| 1775 | - if(zTktTitle){ | |
| 1775 | + if( zTktTitle ){ | |
| 1776 | 1776 | @<br>%h(zTktTitle) |
| 1777 | 1777 | } |
| 1778 | 1778 | @</td></tr> |
| 1779 | 1779 | @ <tr><th>Date:</th><td> |
| 1780 | 1780 | hyperlink_to_date(zDate, "</td></tr>"); |
| @@ -2295,10 +2295,13 @@ | ||
| 2295 | 2295 | @ <td valign="top"> |
| 2296 | 2296 | @ <label><input type="checkbox" id="newtag" name="newtag"%s(zNewTagFlag) /> |
| 2297 | 2297 | @ Add the following new tag name to this check-in:</label> |
| 2298 | 2298 | @ <input type="text" style="width:15;" name="tagname" value="%h(zNewTag)" |
| 2299 | 2299 | @ onkeyup="gebi('newtag').checked=!!this.value" /> |
| 2300 | + zBranchName = db_text(0, "SELECT value FROM tagxref, tag" | |
| 2301 | + " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid" | |
| 2302 | + " AND tagxref.tagid=%d", rid, TAG_BRANCH); | |
| 2300 | 2303 | db_prepare(&q, |
| 2301 | 2304 | "SELECT tag.tagid, tagname, tagxref.value FROM tagxref, tag" |
| 2302 | 2305 | " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid" |
| 2303 | 2306 | " ORDER BY CASE WHEN tagname GLOB 'sym-*' THEN substr(tagname,5)" |
| 2304 | 2307 | " ELSE tagname END /*sort*/", |
| @@ -2305,22 +2308,19 @@ | ||
| 2305 | 2308 | rid |
| 2306 | 2309 | ); |
| 2307 | 2310 | while( db_step(&q)==SQLITE_ROW ){ |
| 2308 | 2311 | int tagid = db_column_int(&q, 0); |
| 2309 | 2312 | const char *zTagName = db_column_text(&q, 1); |
| 2310 | - int isSpecialTag = strncmp(zTagName, "sym-", 4)!=0; | |
| 2313 | + int isSpecialTag = fossil_strncmp(zTagName, "sym-", 4)!=0; | |
| 2311 | 2314 | char zLabel[30]; |
| 2312 | 2315 | |
| 2313 | - if (tagid == TAG_CLOSED){ | |
| 2314 | - fHasClosed = 1; | |
| 2315 | - }else if (tagid == TAG_COMMENT){ | |
| 2316 | - continue; | |
| 2317 | - }else if (tagid == TAG_BRANCH){ | |
| 2318 | - zBranchName = mprintf("%s", db_column_text(&q, 2)); | |
| 2319 | - continue; | |
| 2320 | - }else if( !isSpecialTag && zBranchName && | |
| 2321 | - strcmp(&zTagName[4], zBranchName)==0){ | |
| 2316 | + if( tagid == TAG_CLOSED ){ | |
| 2317 | + fHasClosed = 1; | |
| 2318 | + }else if( (tagid == TAG_COMMENT) || (tagid == TAG_BRANCH) ){ | |
| 2319 | + continue; | |
| 2320 | + }else if( !isSpecialTag && zTagName && | |
| 2321 | + fossil_strcmp(&zTagName[4], zBranchName)==0){ | |
| 2322 | 2322 | continue; |
| 2323 | 2323 | } |
| 2324 | 2324 | sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid); |
| 2325 | 2325 | @ <br /><label> |
| 2326 | 2326 | if( P(zLabel) ){ |
| @@ -2368,11 +2368,11 @@ | ||
| 2368 | 2368 | @ as "closed" so that its leafs no longer appear on the "leaves" page |
| 2369 | 2369 | @ and are no longer labeled as a leaf "<b>Leaf</b>"</label> |
| 2370 | 2370 | @ </td></tr> |
| 2371 | 2371 | } |
| 2372 | 2372 | } |
| 2373 | - if(zBranchName) fossil_free(zBranchName); | |
| 2373 | + if( zBranchName ) fossil_free(zBranchName); | |
| 2374 | 2374 | |
| 2375 | 2375 | |
| 2376 | 2376 | @ <tr><td colspan="2"> |
| 2377 | 2377 | @ <input type="submit" name="preview" value="Preview" /> |
| 2378 | 2378 | @ <input type="submit" name="apply" value="Apply Changes" /> |
| 2379 | 2379 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1770,11 +1770,11 @@ | |
| 1770 | if( modPending ){ |
| 1771 | @ <span class="modpending">*** Awaiting Moderator Approval ***</span> |
| 1772 | } |
| 1773 | @ <tr><th>Ticket:</th> |
| 1774 | @ <td>%z(href("%R/tktview/%s",zTktName))%s(zTktName)</a> |
| 1775 | if(zTktTitle){ |
| 1776 | @<br>%h(zTktTitle) |
| 1777 | } |
| 1778 | @</td></tr> |
| 1779 | @ <tr><th>Date:</th><td> |
| 1780 | hyperlink_to_date(zDate, "</td></tr>"); |
| @@ -2295,10 +2295,13 @@ | |
| 2295 | @ <td valign="top"> |
| 2296 | @ <label><input type="checkbox" id="newtag" name="newtag"%s(zNewTagFlag) /> |
| 2297 | @ Add the following new tag name to this check-in:</label> |
| 2298 | @ <input type="text" style="width:15;" name="tagname" value="%h(zNewTag)" |
| 2299 | @ onkeyup="gebi('newtag').checked=!!this.value" /> |
| 2300 | db_prepare(&q, |
| 2301 | "SELECT tag.tagid, tagname, tagxref.value FROM tagxref, tag" |
| 2302 | " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid" |
| 2303 | " ORDER BY CASE WHEN tagname GLOB 'sym-*' THEN substr(tagname,5)" |
| 2304 | " ELSE tagname END /*sort*/", |
| @@ -2305,22 +2308,19 @@ | |
| 2305 | rid |
| 2306 | ); |
| 2307 | while( db_step(&q)==SQLITE_ROW ){ |
| 2308 | int tagid = db_column_int(&q, 0); |
| 2309 | const char *zTagName = db_column_text(&q, 1); |
| 2310 | int isSpecialTag = strncmp(zTagName, "sym-", 4)!=0; |
| 2311 | char zLabel[30]; |
| 2312 | |
| 2313 | if (tagid == TAG_CLOSED){ |
| 2314 | fHasClosed = 1; |
| 2315 | }else if (tagid == TAG_COMMENT){ |
| 2316 | continue; |
| 2317 | }else if (tagid == TAG_BRANCH){ |
| 2318 | zBranchName = mprintf("%s", db_column_text(&q, 2)); |
| 2319 | continue; |
| 2320 | }else if( !isSpecialTag && zBranchName && |
| 2321 | strcmp(&zTagName[4], zBranchName)==0){ |
| 2322 | continue; |
| 2323 | } |
| 2324 | sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid); |
| 2325 | @ <br /><label> |
| 2326 | if( P(zLabel) ){ |
| @@ -2368,11 +2368,11 @@ | |
| 2368 | @ as "closed" so that its leafs no longer appear on the "leaves" page |
| 2369 | @ and are no longer labeled as a leaf "<b>Leaf</b>"</label> |
| 2370 | @ </td></tr> |
| 2371 | } |
| 2372 | } |
| 2373 | if(zBranchName) fossil_free(zBranchName); |
| 2374 | |
| 2375 | |
| 2376 | @ <tr><td colspan="2"> |
| 2377 | @ <input type="submit" name="preview" value="Preview" /> |
| 2378 | @ <input type="submit" name="apply" value="Apply Changes" /> |
| 2379 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1770,11 +1770,11 @@ | |
| 1770 | if( modPending ){ |
| 1771 | @ <span class="modpending">*** Awaiting Moderator Approval ***</span> |
| 1772 | } |
| 1773 | @ <tr><th>Ticket:</th> |
| 1774 | @ <td>%z(href("%R/tktview/%s",zTktName))%s(zTktName)</a> |
| 1775 | if( zTktTitle ){ |
| 1776 | @<br>%h(zTktTitle) |
| 1777 | } |
| 1778 | @</td></tr> |
| 1779 | @ <tr><th>Date:</th><td> |
| 1780 | hyperlink_to_date(zDate, "</td></tr>"); |
| @@ -2295,10 +2295,13 @@ | |
| 2295 | @ <td valign="top"> |
| 2296 | @ <label><input type="checkbox" id="newtag" name="newtag"%s(zNewTagFlag) /> |
| 2297 | @ Add the following new tag name to this check-in:</label> |
| 2298 | @ <input type="text" style="width:15;" name="tagname" value="%h(zNewTag)" |
| 2299 | @ onkeyup="gebi('newtag').checked=!!this.value" /> |
| 2300 | zBranchName = db_text(0, "SELECT value FROM tagxref, tag" |
| 2301 | " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid" |
| 2302 | " AND tagxref.tagid=%d", rid, TAG_BRANCH); |
| 2303 | db_prepare(&q, |
| 2304 | "SELECT tag.tagid, tagname, tagxref.value FROM tagxref, tag" |
| 2305 | " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid" |
| 2306 | " ORDER BY CASE WHEN tagname GLOB 'sym-*' THEN substr(tagname,5)" |
| 2307 | " ELSE tagname END /*sort*/", |
| @@ -2305,22 +2308,19 @@ | |
| 2308 | rid |
| 2309 | ); |
| 2310 | while( db_step(&q)==SQLITE_ROW ){ |
| 2311 | int tagid = db_column_int(&q, 0); |
| 2312 | const char *zTagName = db_column_text(&q, 1); |
| 2313 | int isSpecialTag = fossil_strncmp(zTagName, "sym-", 4)!=0; |
| 2314 | char zLabel[30]; |
| 2315 | |
| 2316 | if( tagid == TAG_CLOSED ){ |
| 2317 | fHasClosed = 1; |
| 2318 | }else if( (tagid == TAG_COMMENT) || (tagid == TAG_BRANCH) ){ |
| 2319 | continue; |
| 2320 | }else if( !isSpecialTag && zTagName && |
| 2321 | fossil_strcmp(&zTagName[4], zBranchName)==0){ |
| 2322 | continue; |
| 2323 | } |
| 2324 | sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid); |
| 2325 | @ <br /><label> |
| 2326 | if( P(zLabel) ){ |
| @@ -2368,11 +2368,11 @@ | |
| 2368 | @ as "closed" so that its leafs no longer appear on the "leaves" page |
| 2369 | @ and are no longer labeled as a leaf "<b>Leaf</b>"</label> |
| 2370 | @ </td></tr> |
| 2371 | } |
| 2372 | } |
| 2373 | if( zBranchName ) fossil_free(zBranchName); |
| 2374 | |
| 2375 | |
| 2376 | @ <tr><td colspan="2"> |
| 2377 | @ <input type="submit" name="preview" value="Preview" /> |
| 2378 | @ <input type="submit" name="apply" value="Apply Changes" /> |
| 2379 |