Fossil SCM
Merge trunk. Make it possible to make a move to branch "mistake", close the branch, and hide it in one single step. 3 separate check-buttions control the 3 parts of this action separately.
Commit
884b0dc165c1c152d5c3ff6b0748562060131af7
Parent
1a453093bb46623…
2 files changed
+49
-31
+49
-31
+49
-31
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -2051,19 +2051,19 @@ | ||
| 2051 | 2051 | const char *zNewTagFlag; |
| 2052 | 2052 | const char *zNewTag; |
| 2053 | 2053 | const char *zNewBrFlag; |
| 2054 | 2054 | const char *zNewBranch; |
| 2055 | 2055 | const char *zCloseFlag; |
| 2056 | - const char *zHiddenFlag; | |
| 2056 | + const char *zHideFlag; | |
| 2057 | 2057 | int fPropagateColor; /* True if color propagates before edit */ |
| 2058 | 2058 | int fNewPropagateColor; /* True if color propagates after edit */ |
| 2059 | 2059 | int fHasHidden = 0; /* True if hidden tag already set */ |
| 2060 | 2060 | int fHasClosed = 0; /* True if closed tag already set */ |
| 2061 | 2061 | const char *zChngTime = 0; /* Value of chngtime= query param, if any */ |
| 2062 | 2062 | char *zUuid; |
| 2063 | 2063 | Blob comment; |
| 2064 | - const char *zBranchName = 0; | |
| 2064 | + char *zBranchName = 0; | |
| 2065 | 2065 | Stmt q; |
| 2066 | 2066 | |
| 2067 | 2067 | login_check_credentials(); |
| 2068 | 2068 | if( !g.perm.Write ){ login_needed(); return; } |
| 2069 | 2069 | rid = name_to_typed_rid(P("r"), "ci"); |
| @@ -2097,11 +2097,11 @@ | ||
| 2097 | 2097 | zNewTagFlag = P("newtag") ? " checked" : ""; |
| 2098 | 2098 | zNewTag = PDT("tagname",""); |
| 2099 | 2099 | zNewBrFlag = P("newbr") ? " checked" : ""; |
| 2100 | 2100 | zNewBranch = PDT("brname",""); |
| 2101 | 2101 | zCloseFlag = P("close") ? " checked" : ""; |
| 2102 | - zHiddenFlag = P("hide") ? " checked" : ""; | |
| 2102 | + zHideFlag = P("hide") ? " checked" : ""; | |
| 2103 | 2103 | if( P("apply") ){ |
| 2104 | 2104 | Blob ctrl; |
| 2105 | 2105 | char *zNow; |
| 2106 | 2106 | int nChng = 0; |
| 2107 | 2107 | |
| @@ -2148,15 +2148,19 @@ | ||
| 2148 | 2148 | if( P(zLabel) ){ |
| 2149 | 2149 | db_multi_exec("REPLACE INTO newtags VALUES(%Q,'-',NULL)", zTag); |
| 2150 | 2150 | } |
| 2151 | 2151 | } |
| 2152 | 2152 | db_finalize(&q); |
| 2153 | - if( zHiddenFlag[0] ){ | |
| 2153 | + if( zHideFlag[0] ){ | |
| 2154 | 2154 | db_multi_exec("REPLACE INTO newtags VALUES('hidden','*',NULL)"); |
| 2155 | - db_multi_exec("REPLACE INTO newtags VALUES('closed','*',NULL)"); | |
| 2156 | - }else if( zCloseFlag[0] ){ | |
| 2157 | - db_multi_exec("REPLACE INTO newtags VALUES('closed','+',NULL)"); | |
| 2155 | + } | |
| 2156 | + if( zCloseFlag[0] ){ | |
| 2157 | + if( is_a_leaf(rid) ){ | |
| 2158 | + db_multi_exec("REPLACE INTO newtags VALUES('closed','+',NULL)"); | |
| 2159 | + }else{ | |
| 2160 | + db_multi_exec("REPLACE INTO newtags VALUES('closed','*',NULL)"); | |
| 2161 | + } | |
| 2158 | 2162 | } |
| 2159 | 2163 | if( zNewTagFlag[0] && zNewTag[0] ){ |
| 2160 | 2164 | db_multi_exec("REPLACE INTO newtags VALUES('sym-%q','+',NULL)", zNewTag); |
| 2161 | 2165 | } |
| 2162 | 2166 | if( zNewBrFlag[0] && zNewBranch[0] ){ |
| @@ -2292,34 +2296,37 @@ | ||
| 2292 | 2296 | rid |
| 2293 | 2297 | ); |
| 2294 | 2298 | while( db_step(&q)==SQLITE_ROW ){ |
| 2295 | 2299 | int tagid = db_column_int(&q, 0); |
| 2296 | 2300 | const char *zTagName = db_column_text(&q, 1); |
| 2301 | + int isSpecialTag = strncmp(zTagName, "sym-", 4)!=0; | |
| 2297 | 2302 | char zLabel[30]; |
| 2298 | - if (tagid == TAG_COMMENT) continue; | |
| 2303 | + | |
| 2304 | + if (tagid == TAG_CLOSED){ | |
| 2305 | + fHasClosed = 1; | |
| 2306 | + }else if (tagid == TAG_COMMENT){ | |
| 2307 | + continue; | |
| 2308 | + }else if (tagid == TAG_BRANCH){ | |
| 2309 | + zBranchName = mprintf("%s", db_column_text(&q, 2)); | |
| 2310 | + continue; | |
| 2311 | + }else if( tagid==TAG_HIDDEN ){ | |
| 2312 | + fHasHidden = 1; | |
| 2313 | + }else if( !isSpecialTag && zBranchName && | |
| 2314 | + strcmp(&zTagName[4], zBranchName)==0){ | |
| 2315 | + continue; | |
| 2316 | + } | |
| 2299 | 2317 | sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid); |
| 2300 | 2318 | @ <br /><label> |
| 2301 | 2319 | if( P(zLabel) ){ |
| 2302 | 2320 | @ <input type="checkbox" name="c%d(tagid)" checked="checked" /> |
| 2303 | 2321 | }else{ |
| 2304 | 2322 | @ <input type="checkbox" name="c%d(tagid)" /> |
| 2305 | 2323 | } |
| 2306 | - if( strncmp(zTagName, "sym-", 4)==0 ){ | |
| 2307 | - @ Cancel tag <b>%h(&zTagName[4])</b></label> | |
| 2324 | + if( isSpecialTag ){ | |
| 2325 | + @ Cancel special tag <b>%h(zTagName)</b></label> | |
| 2308 | 2326 | }else{ |
| 2309 | - if( tagid==TAG_HIDDEN ){ | |
| 2310 | - fHasHidden = 1; | |
| 2311 | - }else if( tagid==TAG_CLOSED ){ | |
| 2312 | - fHasClosed = 1; | |
| 2313 | - }else if( tagid==TAG_BRANCH ){ | |
| 2314 | - const char *value = db_column_text(&q, 2); | |
| 2315 | - /* Protect "trunk" nodes from ever being hidden! */ | |
| 2316 | - if( strcmp(value, db_get("main-branch", "trunk"))!=0 ){ | |
| 2317 | - zBranchName = mprintf("%s", value); | |
| 2318 | - } | |
| 2319 | - } | |
| 2320 | - @ Cancel special tag <b>%h(zTagName)</b></label> | |
| 2327 | + @ Cancel tag <b>%h(&zTagName[4])</b></label> | |
| 2321 | 2328 | } |
| 2322 | 2329 | } |
| 2323 | 2330 | db_finalize(&q); |
| 2324 | 2331 | @ </td></tr> |
| 2325 | 2332 | |
| @@ -2332,23 +2339,34 @@ | ||
| 2332 | 2339 | @ </td></tr> |
| 2333 | 2340 | |
| 2334 | 2341 | if( !fHasHidden && zBranchName ){ |
| 2335 | 2342 | @ <tr><th align="right" valign="top">Branch Hiding:</th> |
| 2336 | 2343 | @ <td valign="top"> |
| 2337 | - @ <label><input type="checkbox" name="hide"%s(zHiddenFlag) /> | |
| 2344 | + @ <label><input type="checkbox" name="hide"%s(zHideFlag) /> | |
| 2338 | 2345 | @ Hide branch <b>%s(zBranchName)</b> from the timeline starting from this |
| 2339 | - @ check-in and make sure it is closed</label> | |
| 2346 | + @ check-in</label> | |
| 2340 | 2347 | @ </td></tr> |
| 2341 | 2348 | } |
| 2342 | 2349 | |
| 2343 | - if( !fHasClosed && is_a_leaf(rid) ){ | |
| 2344 | - @ <tr><th align="right" valign="top">Leaf Closure:</th> | |
| 2345 | - @ <td valign="top"> | |
| 2346 | - @ <label><input type="checkbox" name="close"%s(zCloseFlag) /> | |
| 2347 | - @ Mark this leaf as "closed" so that it no longer appears on the | |
| 2348 | - @ "leaves" page and is no longer labeled as a "<b>Leaf</b>"</label> | |
| 2349 | - @ </td></tr> | |
| 2350 | + if(zBranchName) fossil_free(zBranchName); | |
| 2351 | + | |
| 2352 | + if( !fHasClosed ){ | |
| 2353 | + if( is_a_leaf(rid) ){ | |
| 2354 | + @ <tr><th align="right" valign="top">Leaf Closure:</th> | |
| 2355 | + @ <td valign="top"> | |
| 2356 | + @ <label><input type="checkbox" name="close"%s(zCloseFlag) /> | |
| 2357 | + @ Mark this leaf as "closed" so that it no longer appears on the | |
| 2358 | + @ "leaves" page and is no longer labeled as a "<b>Leaf</b>"</label> | |
| 2359 | + @ </td></tr> | |
| 2360 | + }else{ | |
| 2361 | + @ <tr><th align="right" valign="top">Branch Closure:</th> | |
| 2362 | + @ <td valign="top"> | |
| 2363 | + @ <label><input type="checkbox" name="close"%s(zCloseFlag) /> | |
| 2364 | + @ Mark this branch as "closed" so that its leaf no longer appears on the | |
| 2365 | + @ "leaves" page and is no longer labeled as a "<b>Leaf</b>"</label> | |
| 2366 | + @ </td></tr> | |
| 2367 | + } | |
| 2350 | 2368 | } |
| 2351 | 2369 | |
| 2352 | 2370 | |
| 2353 | 2371 | @ <tr><td colspan="2"> |
| 2354 | 2372 | @ <input type="submit" name="preview" value="Preview" /> |
| 2355 | 2373 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2051,19 +2051,19 @@ | |
| 2051 | const char *zNewTagFlag; |
| 2052 | const char *zNewTag; |
| 2053 | const char *zNewBrFlag; |
| 2054 | const char *zNewBranch; |
| 2055 | const char *zCloseFlag; |
| 2056 | const char *zHiddenFlag; |
| 2057 | int fPropagateColor; /* True if color propagates before edit */ |
| 2058 | int fNewPropagateColor; /* True if color propagates after edit */ |
| 2059 | int fHasHidden = 0; /* True if hidden tag already set */ |
| 2060 | int fHasClosed = 0; /* True if closed tag already set */ |
| 2061 | const char *zChngTime = 0; /* Value of chngtime= query param, if any */ |
| 2062 | char *zUuid; |
| 2063 | Blob comment; |
| 2064 | const char *zBranchName = 0; |
| 2065 | Stmt q; |
| 2066 | |
| 2067 | login_check_credentials(); |
| 2068 | if( !g.perm.Write ){ login_needed(); return; } |
| 2069 | rid = name_to_typed_rid(P("r"), "ci"); |
| @@ -2097,11 +2097,11 @@ | |
| 2097 | zNewTagFlag = P("newtag") ? " checked" : ""; |
| 2098 | zNewTag = PDT("tagname",""); |
| 2099 | zNewBrFlag = P("newbr") ? " checked" : ""; |
| 2100 | zNewBranch = PDT("brname",""); |
| 2101 | zCloseFlag = P("close") ? " checked" : ""; |
| 2102 | zHiddenFlag = P("hide") ? " checked" : ""; |
| 2103 | if( P("apply") ){ |
| 2104 | Blob ctrl; |
| 2105 | char *zNow; |
| 2106 | int nChng = 0; |
| 2107 | |
| @@ -2148,15 +2148,19 @@ | |
| 2148 | if( P(zLabel) ){ |
| 2149 | db_multi_exec("REPLACE INTO newtags VALUES(%Q,'-',NULL)", zTag); |
| 2150 | } |
| 2151 | } |
| 2152 | db_finalize(&q); |
| 2153 | if( zHiddenFlag[0] ){ |
| 2154 | db_multi_exec("REPLACE INTO newtags VALUES('hidden','*',NULL)"); |
| 2155 | db_multi_exec("REPLACE INTO newtags VALUES('closed','*',NULL)"); |
| 2156 | }else if( zCloseFlag[0] ){ |
| 2157 | db_multi_exec("REPLACE INTO newtags VALUES('closed','+',NULL)"); |
| 2158 | } |
| 2159 | if( zNewTagFlag[0] && zNewTag[0] ){ |
| 2160 | db_multi_exec("REPLACE INTO newtags VALUES('sym-%q','+',NULL)", zNewTag); |
| 2161 | } |
| 2162 | if( zNewBrFlag[0] && zNewBranch[0] ){ |
| @@ -2292,34 +2296,37 @@ | |
| 2292 | rid |
| 2293 | ); |
| 2294 | while( db_step(&q)==SQLITE_ROW ){ |
| 2295 | int tagid = db_column_int(&q, 0); |
| 2296 | const char *zTagName = db_column_text(&q, 1); |
| 2297 | char zLabel[30]; |
| 2298 | if (tagid == TAG_COMMENT) continue; |
| 2299 | sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid); |
| 2300 | @ <br /><label> |
| 2301 | if( P(zLabel) ){ |
| 2302 | @ <input type="checkbox" name="c%d(tagid)" checked="checked" /> |
| 2303 | }else{ |
| 2304 | @ <input type="checkbox" name="c%d(tagid)" /> |
| 2305 | } |
| 2306 | if( strncmp(zTagName, "sym-", 4)==0 ){ |
| 2307 | @ Cancel tag <b>%h(&zTagName[4])</b></label> |
| 2308 | }else{ |
| 2309 | if( tagid==TAG_HIDDEN ){ |
| 2310 | fHasHidden = 1; |
| 2311 | }else if( tagid==TAG_CLOSED ){ |
| 2312 | fHasClosed = 1; |
| 2313 | }else if( tagid==TAG_BRANCH ){ |
| 2314 | const char *value = db_column_text(&q, 2); |
| 2315 | /* Protect "trunk" nodes from ever being hidden! */ |
| 2316 | if( strcmp(value, db_get("main-branch", "trunk"))!=0 ){ |
| 2317 | zBranchName = mprintf("%s", value); |
| 2318 | } |
| 2319 | } |
| 2320 | @ Cancel special tag <b>%h(zTagName)</b></label> |
| 2321 | } |
| 2322 | } |
| 2323 | db_finalize(&q); |
| 2324 | @ </td></tr> |
| 2325 | |
| @@ -2332,23 +2339,34 @@ | |
| 2332 | @ </td></tr> |
| 2333 | |
| 2334 | if( !fHasHidden && zBranchName ){ |
| 2335 | @ <tr><th align="right" valign="top">Branch Hiding:</th> |
| 2336 | @ <td valign="top"> |
| 2337 | @ <label><input type="checkbox" name="hide"%s(zHiddenFlag) /> |
| 2338 | @ Hide branch <b>%s(zBranchName)</b> from the timeline starting from this |
| 2339 | @ check-in and make sure it is closed</label> |
| 2340 | @ </td></tr> |
| 2341 | } |
| 2342 | |
| 2343 | if( !fHasClosed && is_a_leaf(rid) ){ |
| 2344 | @ <tr><th align="right" valign="top">Leaf Closure:</th> |
| 2345 | @ <td valign="top"> |
| 2346 | @ <label><input type="checkbox" name="close"%s(zCloseFlag) /> |
| 2347 | @ Mark this leaf as "closed" so that it no longer appears on the |
| 2348 | @ "leaves" page and is no longer labeled as a "<b>Leaf</b>"</label> |
| 2349 | @ </td></tr> |
| 2350 | } |
| 2351 | |
| 2352 | |
| 2353 | @ <tr><td colspan="2"> |
| 2354 | @ <input type="submit" name="preview" value="Preview" /> |
| 2355 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2051,19 +2051,19 @@ | |
| 2051 | const char *zNewTagFlag; |
| 2052 | const char *zNewTag; |
| 2053 | const char *zNewBrFlag; |
| 2054 | const char *zNewBranch; |
| 2055 | const char *zCloseFlag; |
| 2056 | const char *zHideFlag; |
| 2057 | int fPropagateColor; /* True if color propagates before edit */ |
| 2058 | int fNewPropagateColor; /* True if color propagates after edit */ |
| 2059 | int fHasHidden = 0; /* True if hidden tag already set */ |
| 2060 | int fHasClosed = 0; /* True if closed tag already set */ |
| 2061 | const char *zChngTime = 0; /* Value of chngtime= query param, if any */ |
| 2062 | char *zUuid; |
| 2063 | Blob comment; |
| 2064 | char *zBranchName = 0; |
| 2065 | Stmt q; |
| 2066 | |
| 2067 | login_check_credentials(); |
| 2068 | if( !g.perm.Write ){ login_needed(); return; } |
| 2069 | rid = name_to_typed_rid(P("r"), "ci"); |
| @@ -2097,11 +2097,11 @@ | |
| 2097 | zNewTagFlag = P("newtag") ? " checked" : ""; |
| 2098 | zNewTag = PDT("tagname",""); |
| 2099 | zNewBrFlag = P("newbr") ? " checked" : ""; |
| 2100 | zNewBranch = PDT("brname",""); |
| 2101 | zCloseFlag = P("close") ? " checked" : ""; |
| 2102 | zHideFlag = P("hide") ? " checked" : ""; |
| 2103 | if( P("apply") ){ |
| 2104 | Blob ctrl; |
| 2105 | char *zNow; |
| 2106 | int nChng = 0; |
| 2107 | |
| @@ -2148,15 +2148,19 @@ | |
| 2148 | if( P(zLabel) ){ |
| 2149 | db_multi_exec("REPLACE INTO newtags VALUES(%Q,'-',NULL)", zTag); |
| 2150 | } |
| 2151 | } |
| 2152 | db_finalize(&q); |
| 2153 | if( zHideFlag[0] ){ |
| 2154 | db_multi_exec("REPLACE INTO newtags VALUES('hidden','*',NULL)"); |
| 2155 | } |
| 2156 | if( zCloseFlag[0] ){ |
| 2157 | if( is_a_leaf(rid) ){ |
| 2158 | db_multi_exec("REPLACE INTO newtags VALUES('closed','+',NULL)"); |
| 2159 | }else{ |
| 2160 | db_multi_exec("REPLACE INTO newtags VALUES('closed','*',NULL)"); |
| 2161 | } |
| 2162 | } |
| 2163 | if( zNewTagFlag[0] && zNewTag[0] ){ |
| 2164 | db_multi_exec("REPLACE INTO newtags VALUES('sym-%q','+',NULL)", zNewTag); |
| 2165 | } |
| 2166 | if( zNewBrFlag[0] && zNewBranch[0] ){ |
| @@ -2292,34 +2296,37 @@ | |
| 2296 | rid |
| 2297 | ); |
| 2298 | while( db_step(&q)==SQLITE_ROW ){ |
| 2299 | int tagid = db_column_int(&q, 0); |
| 2300 | const char *zTagName = db_column_text(&q, 1); |
| 2301 | int isSpecialTag = strncmp(zTagName, "sym-", 4)!=0; |
| 2302 | char zLabel[30]; |
| 2303 | |
| 2304 | if (tagid == TAG_CLOSED){ |
| 2305 | fHasClosed = 1; |
| 2306 | }else if (tagid == TAG_COMMENT){ |
| 2307 | continue; |
| 2308 | }else if (tagid == TAG_BRANCH){ |
| 2309 | zBranchName = mprintf("%s", db_column_text(&q, 2)); |
| 2310 | continue; |
| 2311 | }else if( tagid==TAG_HIDDEN ){ |
| 2312 | fHasHidden = 1; |
| 2313 | }else if( !isSpecialTag && zBranchName && |
| 2314 | strcmp(&zTagName[4], zBranchName)==0){ |
| 2315 | continue; |
| 2316 | } |
| 2317 | sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid); |
| 2318 | @ <br /><label> |
| 2319 | if( P(zLabel) ){ |
| 2320 | @ <input type="checkbox" name="c%d(tagid)" checked="checked" /> |
| 2321 | }else{ |
| 2322 | @ <input type="checkbox" name="c%d(tagid)" /> |
| 2323 | } |
| 2324 | if( isSpecialTag ){ |
| 2325 | @ Cancel special tag <b>%h(zTagName)</b></label> |
| 2326 | }else{ |
| 2327 | @ Cancel tag <b>%h(&zTagName[4])</b></label> |
| 2328 | } |
| 2329 | } |
| 2330 | db_finalize(&q); |
| 2331 | @ </td></tr> |
| 2332 | |
| @@ -2332,23 +2339,34 @@ | |
| 2339 | @ </td></tr> |
| 2340 | |
| 2341 | if( !fHasHidden && zBranchName ){ |
| 2342 | @ <tr><th align="right" valign="top">Branch Hiding:</th> |
| 2343 | @ <td valign="top"> |
| 2344 | @ <label><input type="checkbox" name="hide"%s(zHideFlag) /> |
| 2345 | @ Hide branch <b>%s(zBranchName)</b> from the timeline starting from this |
| 2346 | @ check-in</label> |
| 2347 | @ </td></tr> |
| 2348 | } |
| 2349 | |
| 2350 | if(zBranchName) fossil_free(zBranchName); |
| 2351 | |
| 2352 | if( !fHasClosed ){ |
| 2353 | if( is_a_leaf(rid) ){ |
| 2354 | @ <tr><th align="right" valign="top">Leaf Closure:</th> |
| 2355 | @ <td valign="top"> |
| 2356 | @ <label><input type="checkbox" name="close"%s(zCloseFlag) /> |
| 2357 | @ Mark this leaf as "closed" so that it no longer appears on the |
| 2358 | @ "leaves" page and is no longer labeled as a "<b>Leaf</b>"</label> |
| 2359 | @ </td></tr> |
| 2360 | }else{ |
| 2361 | @ <tr><th align="right" valign="top">Branch Closure:</th> |
| 2362 | @ <td valign="top"> |
| 2363 | @ <label><input type="checkbox" name="close"%s(zCloseFlag) /> |
| 2364 | @ Mark this branch as "closed" so that its leaf no longer appears on the |
| 2365 | @ "leaves" page and is no longer labeled as a "<b>Leaf</b>"</label> |
| 2366 | @ </td></tr> |
| 2367 | } |
| 2368 | } |
| 2369 | |
| 2370 | |
| 2371 | @ <tr><td colspan="2"> |
| 2372 | @ <input type="submit" name="preview" value="Preview" /> |
| 2373 |
+49
-31
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -2051,19 +2051,19 @@ | ||
| 2051 | 2051 | const char *zNewTagFlag; |
| 2052 | 2052 | const char *zNewTag; |
| 2053 | 2053 | const char *zNewBrFlag; |
| 2054 | 2054 | const char *zNewBranch; |
| 2055 | 2055 | const char *zCloseFlag; |
| 2056 | - const char *zHiddenFlag; | |
| 2056 | + const char *zHideFlag; | |
| 2057 | 2057 | int fPropagateColor; /* True if color propagates before edit */ |
| 2058 | 2058 | int fNewPropagateColor; /* True if color propagates after edit */ |
| 2059 | 2059 | int fHasHidden = 0; /* True if hidden tag already set */ |
| 2060 | 2060 | int fHasClosed = 0; /* True if closed tag already set */ |
| 2061 | 2061 | const char *zChngTime = 0; /* Value of chngtime= query param, if any */ |
| 2062 | 2062 | char *zUuid; |
| 2063 | 2063 | Blob comment; |
| 2064 | - const char *zBranchName = 0; | |
| 2064 | + char *zBranchName = 0; | |
| 2065 | 2065 | Stmt q; |
| 2066 | 2066 | |
| 2067 | 2067 | login_check_credentials(); |
| 2068 | 2068 | if( !g.perm.Write ){ login_needed(); return; } |
| 2069 | 2069 | rid = name_to_typed_rid(P("r"), "ci"); |
| @@ -2097,11 +2097,11 @@ | ||
| 2097 | 2097 | zNewTagFlag = P("newtag") ? " checked" : ""; |
| 2098 | 2098 | zNewTag = PDT("tagname",""); |
| 2099 | 2099 | zNewBrFlag = P("newbr") ? " checked" : ""; |
| 2100 | 2100 | zNewBranch = PDT("brname",""); |
| 2101 | 2101 | zCloseFlag = P("close") ? " checked" : ""; |
| 2102 | - zHiddenFlag = P("hide") ? " checked" : ""; | |
| 2102 | + zHideFlag = P("hide") ? " checked" : ""; | |
| 2103 | 2103 | if( P("apply") ){ |
| 2104 | 2104 | Blob ctrl; |
| 2105 | 2105 | char *zNow; |
| 2106 | 2106 | int nChng = 0; |
| 2107 | 2107 | |
| @@ -2148,15 +2148,19 @@ | ||
| 2148 | 2148 | if( P(zLabel) ){ |
| 2149 | 2149 | db_multi_exec("REPLACE INTO newtags VALUES(%Q,'-',NULL)", zTag); |
| 2150 | 2150 | } |
| 2151 | 2151 | } |
| 2152 | 2152 | db_finalize(&q); |
| 2153 | - if( zHiddenFlag[0] ){ | |
| 2153 | + if( zHideFlag[0] ){ | |
| 2154 | 2154 | db_multi_exec("REPLACE INTO newtags VALUES('hidden','*',NULL)"); |
| 2155 | - db_multi_exec("REPLACE INTO newtags VALUES('closed','*',NULL)"); | |
| 2156 | - }else if( zCloseFlag[0] ){ | |
| 2157 | - db_multi_exec("REPLACE INTO newtags VALUES('closed','+',NULL)"); | |
| 2155 | + } | |
| 2156 | + if( zCloseFlag[0] ){ | |
| 2157 | + if( is_a_leaf(rid) ){ | |
| 2158 | + db_multi_exec("REPLACE INTO newtags VALUES('closed','+',NULL)"); | |
| 2159 | + }else{ | |
| 2160 | + db_multi_exec("REPLACE INTO newtags VALUES('closed','*',NULL)"); | |
| 2161 | + } | |
| 2158 | 2162 | } |
| 2159 | 2163 | if( zNewTagFlag[0] && zNewTag[0] ){ |
| 2160 | 2164 | db_multi_exec("REPLACE INTO newtags VALUES('sym-%q','+',NULL)", zNewTag); |
| 2161 | 2165 | } |
| 2162 | 2166 | if( zNewBrFlag[0] && zNewBranch[0] ){ |
| @@ -2292,34 +2296,37 @@ | ||
| 2292 | 2296 | rid |
| 2293 | 2297 | ); |
| 2294 | 2298 | while( db_step(&q)==SQLITE_ROW ){ |
| 2295 | 2299 | int tagid = db_column_int(&q, 0); |
| 2296 | 2300 | const char *zTagName = db_column_text(&q, 1); |
| 2301 | + int isSpecialTag = strncmp(zTagName, "sym-", 4)!=0; | |
| 2297 | 2302 | char zLabel[30]; |
| 2298 | - if (tagid == TAG_COMMENT) continue; | |
| 2303 | + | |
| 2304 | + if (tagid == TAG_CLOSED){ | |
| 2305 | + fHasClosed = 1; | |
| 2306 | + }else if (tagid == TAG_COMMENT){ | |
| 2307 | + continue; | |
| 2308 | + }else if (tagid == TAG_BRANCH){ | |
| 2309 | + zBranchName = mprintf("%s", db_column_text(&q, 2)); | |
| 2310 | + continue; | |
| 2311 | + }else if( tagid==TAG_HIDDEN ){ | |
| 2312 | + fHasHidden = 1; | |
| 2313 | + }else if( !isSpecialTag && zBranchName && | |
| 2314 | + strcmp(&zTagName[4], zBranchName)==0){ | |
| 2315 | + continue; | |
| 2316 | + } | |
| 2299 | 2317 | sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid); |
| 2300 | 2318 | @ <br /><label> |
| 2301 | 2319 | if( P(zLabel) ){ |
| 2302 | 2320 | @ <input type="checkbox" name="c%d(tagid)" checked="checked" /> |
| 2303 | 2321 | }else{ |
| 2304 | 2322 | @ <input type="checkbox" name="c%d(tagid)" /> |
| 2305 | 2323 | } |
| 2306 | - if( strncmp(zTagName, "sym-", 4)==0 ){ | |
| 2307 | - @ Cancel tag <b>%h(&zTagName[4])</b></label> | |
| 2324 | + if( isSpecialTag ){ | |
| 2325 | + @ Cancel special tag <b>%h(zTagName)</b></label> | |
| 2308 | 2326 | }else{ |
| 2309 | - if( tagid==TAG_HIDDEN ){ | |
| 2310 | - fHasHidden = 1; | |
| 2311 | - }else if( tagid==TAG_CLOSED ){ | |
| 2312 | - fHasClosed = 1; | |
| 2313 | - }else if( tagid==TAG_BRANCH ){ | |
| 2314 | - const char *value = db_column_text(&q, 2); | |
| 2315 | - /* Protect "trunk" nodes from ever being hidden! */ | |
| 2316 | - if( strcmp(value, db_get("main-branch", "trunk"))!=0 ){ | |
| 2317 | - zBranchName = mprintf("%s", value); | |
| 2318 | - } | |
| 2319 | - } | |
| 2320 | - @ Cancel special tag <b>%h(zTagName)</b></label> | |
| 2327 | + @ Cancel tag <b>%h(&zTagName[4])</b></label> | |
| 2321 | 2328 | } |
| 2322 | 2329 | } |
| 2323 | 2330 | db_finalize(&q); |
| 2324 | 2331 | @ </td></tr> |
| 2325 | 2332 | |
| @@ -2332,23 +2339,34 @@ | ||
| 2332 | 2339 | @ </td></tr> |
| 2333 | 2340 | |
| 2334 | 2341 | if( !fHasHidden && zBranchName ){ |
| 2335 | 2342 | @ <tr><th align="right" valign="top">Branch Hiding:</th> |
| 2336 | 2343 | @ <td valign="top"> |
| 2337 | - @ <label><input type="checkbox" name="hide"%s(zHiddenFlag) /> | |
| 2344 | + @ <label><input type="checkbox" name="hide"%s(zHideFlag) /> | |
| 2338 | 2345 | @ Hide branch <b>%s(zBranchName)</b> from the timeline starting from this |
| 2339 | - @ check-in and make sure it is closed</label> | |
| 2346 | + @ check-in</label> | |
| 2340 | 2347 | @ </td></tr> |
| 2341 | 2348 | } |
| 2342 | 2349 | |
| 2343 | - if( !fHasClosed && is_a_leaf(rid) ){ | |
| 2344 | - @ <tr><th align="right" valign="top">Leaf Closure:</th> | |
| 2345 | - @ <td valign="top"> | |
| 2346 | - @ <label><input type="checkbox" name="close"%s(zCloseFlag) /> | |
| 2347 | - @ Mark this leaf as "closed" so that it no longer appears on the | |
| 2348 | - @ "leaves" page and is no longer labeled as a "<b>Leaf</b>"</label> | |
| 2349 | - @ </td></tr> | |
| 2350 | + if(zBranchName) fossil_free(zBranchName); | |
| 2351 | + | |
| 2352 | + if( !fHasClosed ){ | |
| 2353 | + if( is_a_leaf(rid) ){ | |
| 2354 | + @ <tr><th align="right" valign="top">Leaf Closure:</th> | |
| 2355 | + @ <td valign="top"> | |
| 2356 | + @ <label><input type="checkbox" name="close"%s(zCloseFlag) /> | |
| 2357 | + @ Mark this leaf as "closed" so that it no longer appears on the | |
| 2358 | + @ "leaves" page and is no longer labeled as a "<b>Leaf</b>"</label> | |
| 2359 | + @ </td></tr> | |
| 2360 | + }else{ | |
| 2361 | + @ <tr><th align="right" valign="top">Branch Closure:</th> | |
| 2362 | + @ <td valign="top"> | |
| 2363 | + @ <label><input type="checkbox" name="close"%s(zCloseFlag) /> | |
| 2364 | + @ Mark this branch as "closed" so that its leaf no longer appears on the | |
| 2365 | + @ "leaves" page and is no longer labeled as a "<b>Leaf</b>"</label> | |
| 2366 | + @ </td></tr> | |
| 2367 | + } | |
| 2350 | 2368 | } |
| 2351 | 2369 | |
| 2352 | 2370 | |
| 2353 | 2371 | @ <tr><td colspan="2"> |
| 2354 | 2372 | @ <input type="submit" name="preview" value="Preview" /> |
| 2355 | 2373 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2051,19 +2051,19 @@ | |
| 2051 | const char *zNewTagFlag; |
| 2052 | const char *zNewTag; |
| 2053 | const char *zNewBrFlag; |
| 2054 | const char *zNewBranch; |
| 2055 | const char *zCloseFlag; |
| 2056 | const char *zHiddenFlag; |
| 2057 | int fPropagateColor; /* True if color propagates before edit */ |
| 2058 | int fNewPropagateColor; /* True if color propagates after edit */ |
| 2059 | int fHasHidden = 0; /* True if hidden tag already set */ |
| 2060 | int fHasClosed = 0; /* True if closed tag already set */ |
| 2061 | const char *zChngTime = 0; /* Value of chngtime= query param, if any */ |
| 2062 | char *zUuid; |
| 2063 | Blob comment; |
| 2064 | const char *zBranchName = 0; |
| 2065 | Stmt q; |
| 2066 | |
| 2067 | login_check_credentials(); |
| 2068 | if( !g.perm.Write ){ login_needed(); return; } |
| 2069 | rid = name_to_typed_rid(P("r"), "ci"); |
| @@ -2097,11 +2097,11 @@ | |
| 2097 | zNewTagFlag = P("newtag") ? " checked" : ""; |
| 2098 | zNewTag = PDT("tagname",""); |
| 2099 | zNewBrFlag = P("newbr") ? " checked" : ""; |
| 2100 | zNewBranch = PDT("brname",""); |
| 2101 | zCloseFlag = P("close") ? " checked" : ""; |
| 2102 | zHiddenFlag = P("hide") ? " checked" : ""; |
| 2103 | if( P("apply") ){ |
| 2104 | Blob ctrl; |
| 2105 | char *zNow; |
| 2106 | int nChng = 0; |
| 2107 | |
| @@ -2148,15 +2148,19 @@ | |
| 2148 | if( P(zLabel) ){ |
| 2149 | db_multi_exec("REPLACE INTO newtags VALUES(%Q,'-',NULL)", zTag); |
| 2150 | } |
| 2151 | } |
| 2152 | db_finalize(&q); |
| 2153 | if( zHiddenFlag[0] ){ |
| 2154 | db_multi_exec("REPLACE INTO newtags VALUES('hidden','*',NULL)"); |
| 2155 | db_multi_exec("REPLACE INTO newtags VALUES('closed','*',NULL)"); |
| 2156 | }else if( zCloseFlag[0] ){ |
| 2157 | db_multi_exec("REPLACE INTO newtags VALUES('closed','+',NULL)"); |
| 2158 | } |
| 2159 | if( zNewTagFlag[0] && zNewTag[0] ){ |
| 2160 | db_multi_exec("REPLACE INTO newtags VALUES('sym-%q','+',NULL)", zNewTag); |
| 2161 | } |
| 2162 | if( zNewBrFlag[0] && zNewBranch[0] ){ |
| @@ -2292,34 +2296,37 @@ | |
| 2292 | rid |
| 2293 | ); |
| 2294 | while( db_step(&q)==SQLITE_ROW ){ |
| 2295 | int tagid = db_column_int(&q, 0); |
| 2296 | const char *zTagName = db_column_text(&q, 1); |
| 2297 | char zLabel[30]; |
| 2298 | if (tagid == TAG_COMMENT) continue; |
| 2299 | sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid); |
| 2300 | @ <br /><label> |
| 2301 | if( P(zLabel) ){ |
| 2302 | @ <input type="checkbox" name="c%d(tagid)" checked="checked" /> |
| 2303 | }else{ |
| 2304 | @ <input type="checkbox" name="c%d(tagid)" /> |
| 2305 | } |
| 2306 | if( strncmp(zTagName, "sym-", 4)==0 ){ |
| 2307 | @ Cancel tag <b>%h(&zTagName[4])</b></label> |
| 2308 | }else{ |
| 2309 | if( tagid==TAG_HIDDEN ){ |
| 2310 | fHasHidden = 1; |
| 2311 | }else if( tagid==TAG_CLOSED ){ |
| 2312 | fHasClosed = 1; |
| 2313 | }else if( tagid==TAG_BRANCH ){ |
| 2314 | const char *value = db_column_text(&q, 2); |
| 2315 | /* Protect "trunk" nodes from ever being hidden! */ |
| 2316 | if( strcmp(value, db_get("main-branch", "trunk"))!=0 ){ |
| 2317 | zBranchName = mprintf("%s", value); |
| 2318 | } |
| 2319 | } |
| 2320 | @ Cancel special tag <b>%h(zTagName)</b></label> |
| 2321 | } |
| 2322 | } |
| 2323 | db_finalize(&q); |
| 2324 | @ </td></tr> |
| 2325 | |
| @@ -2332,23 +2339,34 @@ | |
| 2332 | @ </td></tr> |
| 2333 | |
| 2334 | if( !fHasHidden && zBranchName ){ |
| 2335 | @ <tr><th align="right" valign="top">Branch Hiding:</th> |
| 2336 | @ <td valign="top"> |
| 2337 | @ <label><input type="checkbox" name="hide"%s(zHiddenFlag) /> |
| 2338 | @ Hide branch <b>%s(zBranchName)</b> from the timeline starting from this |
| 2339 | @ check-in and make sure it is closed</label> |
| 2340 | @ </td></tr> |
| 2341 | } |
| 2342 | |
| 2343 | if( !fHasClosed && is_a_leaf(rid) ){ |
| 2344 | @ <tr><th align="right" valign="top">Leaf Closure:</th> |
| 2345 | @ <td valign="top"> |
| 2346 | @ <label><input type="checkbox" name="close"%s(zCloseFlag) /> |
| 2347 | @ Mark this leaf as "closed" so that it no longer appears on the |
| 2348 | @ "leaves" page and is no longer labeled as a "<b>Leaf</b>"</label> |
| 2349 | @ </td></tr> |
| 2350 | } |
| 2351 | |
| 2352 | |
| 2353 | @ <tr><td colspan="2"> |
| 2354 | @ <input type="submit" name="preview" value="Preview" /> |
| 2355 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2051,19 +2051,19 @@ | |
| 2051 | const char *zNewTagFlag; |
| 2052 | const char *zNewTag; |
| 2053 | const char *zNewBrFlag; |
| 2054 | const char *zNewBranch; |
| 2055 | const char *zCloseFlag; |
| 2056 | const char *zHideFlag; |
| 2057 | int fPropagateColor; /* True if color propagates before edit */ |
| 2058 | int fNewPropagateColor; /* True if color propagates after edit */ |
| 2059 | int fHasHidden = 0; /* True if hidden tag already set */ |
| 2060 | int fHasClosed = 0; /* True if closed tag already set */ |
| 2061 | const char *zChngTime = 0; /* Value of chngtime= query param, if any */ |
| 2062 | char *zUuid; |
| 2063 | Blob comment; |
| 2064 | char *zBranchName = 0; |
| 2065 | Stmt q; |
| 2066 | |
| 2067 | login_check_credentials(); |
| 2068 | if( !g.perm.Write ){ login_needed(); return; } |
| 2069 | rid = name_to_typed_rid(P("r"), "ci"); |
| @@ -2097,11 +2097,11 @@ | |
| 2097 | zNewTagFlag = P("newtag") ? " checked" : ""; |
| 2098 | zNewTag = PDT("tagname",""); |
| 2099 | zNewBrFlag = P("newbr") ? " checked" : ""; |
| 2100 | zNewBranch = PDT("brname",""); |
| 2101 | zCloseFlag = P("close") ? " checked" : ""; |
| 2102 | zHideFlag = P("hide") ? " checked" : ""; |
| 2103 | if( P("apply") ){ |
| 2104 | Blob ctrl; |
| 2105 | char *zNow; |
| 2106 | int nChng = 0; |
| 2107 | |
| @@ -2148,15 +2148,19 @@ | |
| 2148 | if( P(zLabel) ){ |
| 2149 | db_multi_exec("REPLACE INTO newtags VALUES(%Q,'-',NULL)", zTag); |
| 2150 | } |
| 2151 | } |
| 2152 | db_finalize(&q); |
| 2153 | if( zHideFlag[0] ){ |
| 2154 | db_multi_exec("REPLACE INTO newtags VALUES('hidden','*',NULL)"); |
| 2155 | } |
| 2156 | if( zCloseFlag[0] ){ |
| 2157 | if( is_a_leaf(rid) ){ |
| 2158 | db_multi_exec("REPLACE INTO newtags VALUES('closed','+',NULL)"); |
| 2159 | }else{ |
| 2160 | db_multi_exec("REPLACE INTO newtags VALUES('closed','*',NULL)"); |
| 2161 | } |
| 2162 | } |
| 2163 | if( zNewTagFlag[0] && zNewTag[0] ){ |
| 2164 | db_multi_exec("REPLACE INTO newtags VALUES('sym-%q','+',NULL)", zNewTag); |
| 2165 | } |
| 2166 | if( zNewBrFlag[0] && zNewBranch[0] ){ |
| @@ -2292,34 +2296,37 @@ | |
| 2296 | rid |
| 2297 | ); |
| 2298 | while( db_step(&q)==SQLITE_ROW ){ |
| 2299 | int tagid = db_column_int(&q, 0); |
| 2300 | const char *zTagName = db_column_text(&q, 1); |
| 2301 | int isSpecialTag = strncmp(zTagName, "sym-", 4)!=0; |
| 2302 | char zLabel[30]; |
| 2303 | |
| 2304 | if (tagid == TAG_CLOSED){ |
| 2305 | fHasClosed = 1; |
| 2306 | }else if (tagid == TAG_COMMENT){ |
| 2307 | continue; |
| 2308 | }else if (tagid == TAG_BRANCH){ |
| 2309 | zBranchName = mprintf("%s", db_column_text(&q, 2)); |
| 2310 | continue; |
| 2311 | }else if( tagid==TAG_HIDDEN ){ |
| 2312 | fHasHidden = 1; |
| 2313 | }else if( !isSpecialTag && zBranchName && |
| 2314 | strcmp(&zTagName[4], zBranchName)==0){ |
| 2315 | continue; |
| 2316 | } |
| 2317 | sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid); |
| 2318 | @ <br /><label> |
| 2319 | if( P(zLabel) ){ |
| 2320 | @ <input type="checkbox" name="c%d(tagid)" checked="checked" /> |
| 2321 | }else{ |
| 2322 | @ <input type="checkbox" name="c%d(tagid)" /> |
| 2323 | } |
| 2324 | if( isSpecialTag ){ |
| 2325 | @ Cancel special tag <b>%h(zTagName)</b></label> |
| 2326 | }else{ |
| 2327 | @ Cancel tag <b>%h(&zTagName[4])</b></label> |
| 2328 | } |
| 2329 | } |
| 2330 | db_finalize(&q); |
| 2331 | @ </td></tr> |
| 2332 | |
| @@ -2332,23 +2339,34 @@ | |
| 2339 | @ </td></tr> |
| 2340 | |
| 2341 | if( !fHasHidden && zBranchName ){ |
| 2342 | @ <tr><th align="right" valign="top">Branch Hiding:</th> |
| 2343 | @ <td valign="top"> |
| 2344 | @ <label><input type="checkbox" name="hide"%s(zHideFlag) /> |
| 2345 | @ Hide branch <b>%s(zBranchName)</b> from the timeline starting from this |
| 2346 | @ check-in</label> |
| 2347 | @ </td></tr> |
| 2348 | } |
| 2349 | |
| 2350 | if(zBranchName) fossil_free(zBranchName); |
| 2351 | |
| 2352 | if( !fHasClosed ){ |
| 2353 | if( is_a_leaf(rid) ){ |
| 2354 | @ <tr><th align="right" valign="top">Leaf Closure:</th> |
| 2355 | @ <td valign="top"> |
| 2356 | @ <label><input type="checkbox" name="close"%s(zCloseFlag) /> |
| 2357 | @ Mark this leaf as "closed" so that it no longer appears on the |
| 2358 | @ "leaves" page and is no longer labeled as a "<b>Leaf</b>"</label> |
| 2359 | @ </td></tr> |
| 2360 | }else{ |
| 2361 | @ <tr><th align="right" valign="top">Branch Closure:</th> |
| 2362 | @ <td valign="top"> |
| 2363 | @ <label><input type="checkbox" name="close"%s(zCloseFlag) /> |
| 2364 | @ Mark this branch as "closed" so that its leaf no longer appears on the |
| 2365 | @ "leaves" page and is no longer labeled as a "<b>Leaf</b>"</label> |
| 2366 | @ </td></tr> |
| 2367 | } |
| 2368 | } |
| 2369 | |
| 2370 | |
| 2371 | @ <tr><td colspan="2"> |
| 2372 | @ <input type="submit" name="preview" value="Preview" /> |
| 2373 |