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.

jan.nijtmans 2013-12-16 10:46 trunk merge
Commit 3529f2c47bb068692371220f4abf743b452b9b25
2 files changed +12 -12 +12 -12
+12 -12
--- src/info.c
+++ src/info.c
@@ -1770,11 +1770,11 @@
17701770
if( modPending ){
17711771
@ <span class="modpending">*** Awaiting Moderator Approval ***</span>
17721772
}
17731773
@ <tr><th>Ticket:</th>
17741774
@ <td>%z(href("%R/tktview/%s",zTktName))%s(zTktName)</a>
1775
- if(zTktTitle){
1775
+ if( zTktTitle ){
17761776
@<br>%h(zTktTitle)
17771777
}
17781778
@</td></tr>
17791779
@ <tr><th>Date:</th><td>
17801780
hyperlink_to_date(zDate, "</td></tr>");
@@ -2295,10 +2295,13 @@
22952295
@ <td valign="top">
22962296
@ <label><input type="checkbox" id="newtag" name="newtag"%s(zNewTagFlag) />
22972297
@ Add the following new tag name to this check-in:</label>
22982298
@ <input type="text" style="width:15;" name="tagname" value="%h(zNewTag)"
22992299
@ 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);
23002303
db_prepare(&q,
23012304
"SELECT tag.tagid, tagname, tagxref.value FROM tagxref, tag"
23022305
" WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid"
23032306
" ORDER BY CASE WHEN tagname GLOB 'sym-*' THEN substr(tagname,5)"
23042307
" ELSE tagname END /*sort*/",
@@ -2305,22 +2308,19 @@
23052308
rid
23062309
);
23072310
while( db_step(&q)==SQLITE_ROW ){
23082311
int tagid = db_column_int(&q, 0);
23092312
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;
23112314
char zLabel[30];
23122315
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){
23222322
continue;
23232323
}
23242324
sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid);
23252325
@ <br /><label>
23262326
if( P(zLabel) ){
@@ -2368,11 +2368,11 @@
23682368
@ as "closed" so that its leafs no longer appear on the "leaves" page
23692369
@ and are no longer labeled as a leaf "<b>Leaf</b>"</label>
23702370
@ </td></tr>
23712371
}
23722372
}
2373
- if(zBranchName) fossil_free(zBranchName);
2373
+ if( zBranchName ) fossil_free(zBranchName);
23742374
23752375
23762376
@ <tr><td colspan="2">
23772377
@ <input type="submit" name="preview" value="Preview" />
23782378
@ <input type="submit" name="apply" value="Apply Changes" />
23792379
--- 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 @@
17701770
if( modPending ){
17711771
@ <span class="modpending">*** Awaiting Moderator Approval ***</span>
17721772
}
17731773
@ <tr><th>Ticket:</th>
17741774
@ <td>%z(href("%R/tktview/%s",zTktName))%s(zTktName)</a>
1775
- if(zTktTitle){
1775
+ if( zTktTitle ){
17761776
@<br>%h(zTktTitle)
17771777
}
17781778
@</td></tr>
17791779
@ <tr><th>Date:</th><td>
17801780
hyperlink_to_date(zDate, "</td></tr>");
@@ -2295,10 +2295,13 @@
22952295
@ <td valign="top">
22962296
@ <label><input type="checkbox" id="newtag" name="newtag"%s(zNewTagFlag) />
22972297
@ Add the following new tag name to this check-in:</label>
22982298
@ <input type="text" style="width:15;" name="tagname" value="%h(zNewTag)"
22992299
@ 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);
23002303
db_prepare(&q,
23012304
"SELECT tag.tagid, tagname, tagxref.value FROM tagxref, tag"
23022305
" WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid"
23032306
" ORDER BY CASE WHEN tagname GLOB 'sym-*' THEN substr(tagname,5)"
23042307
" ELSE tagname END /*sort*/",
@@ -2305,22 +2308,19 @@
23052308
rid
23062309
);
23072310
while( db_step(&q)==SQLITE_ROW ){
23082311
int tagid = db_column_int(&q, 0);
23092312
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;
23112314
char zLabel[30];
23122315
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){
23222322
continue;
23232323
}
23242324
sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid);
23252325
@ <br /><label>
23262326
if( P(zLabel) ){
@@ -2368,11 +2368,11 @@
23682368
@ as "closed" so that its leafs no longer appear on the "leaves" page
23692369
@ and are no longer labeled as a leaf "<b>Leaf</b>"</label>
23702370
@ </td></tr>
23712371
}
23722372
}
2373
- if(zBranchName) fossil_free(zBranchName);
2373
+ if( zBranchName ) fossil_free(zBranchName);
23742374
23752375
23762376
@ <tr><td colspan="2">
23772377
@ <input type="submit" name="preview" value="Preview" />
23782378
@ <input type="submit" name="apply" value="Apply Changes" />
23792379
--- 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

Keyboard Shortcuts

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