Fossil SCM
Given that recovering from incorrect hiding is relatively straightforward, don't prevent access to hidden option on trunk and main-branch.
Commit
d35b1ca05e62915cbc740ac31027201076cb99bf
Parent
1d0517c1fa4885a…
1 file changed
+5
-34
+5
-34
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -2056,11 +2056,10 @@ | ||
| 2056 | 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 | - int fMainBranch = 0; /* True if branch is trunk or main-branch */ | |
| 2062 | 2061 | const char *zChngTime = 0; /* Value of chngtime= query param, if any */ |
| 2063 | 2062 | char *zUuid; |
| 2064 | 2063 | Blob comment; |
| 2065 | 2064 | char *zBranchName = 0; |
| 2066 | 2065 | Stmt q; |
| @@ -2208,27 +2207,17 @@ | ||
| 2208 | 2207 | zUuid[10] = 0; |
| 2209 | 2208 | style_header("Edit Check-in [%s]", zUuid); |
| 2210 | 2209 | /* |
| 2211 | 2210 | ** Javascript functions to assist in modifying hidden branch options. |
| 2212 | 2211 | ** stcbi: sets the textContent for the given element id to val |
| 2213 | - ** hcbxbi: hides the checkbox and unchecks for the given element id | |
| 2214 | - ** hauc: hides and unchecks the checkbox when needed | |
| 2212 | + ** usids: updates SPAN ids that contain the branch IDs | |
| 2215 | 2213 | */ |
| 2216 | 2214 | @ <script> |
| 2217 | 2215 | @ function stcbi(id,val){ |
| 2218 | 2216 | @ if( id ) id.textContent = val; |
| 2219 | 2217 | @ } |
| 2220 | - @ function hcbxbi(id,toggle){ | |
| 2221 | - @ if( toggle ){ | |
| 2222 | - @ id.disabled = true; | |
| 2223 | - @ id.checked = false; | |
| 2224 | - @ }else{ | |
| 2225 | - @ id.disabled = false; | |
| 2226 | - @ } | |
| 2227 | - @ } | |
| 2228 | - @ function hauc(cbxid,zdef,formid,toggle){ | |
| 2229 | - @ if( cbxid ) hcbxbi(cbxid,toggle); | |
| 2218 | + @ function usids(zdef,formid,toggle){ | |
| 2230 | 2219 | @ hidbrid = gebi('hbranch'); |
| 2231 | 2220 | @ cidbrid = document.getElementById('cbranch'); |
| 2232 | 2221 | @ if( toggle ){ |
| 2233 | 2222 | @ stcbi(hidbrid,zdef); |
| 2234 | 2223 | @ stcbi(cidbrid,zdef); |
| @@ -2357,26 +2346,18 @@ | ||
| 2357 | 2346 | @ Cancel special tag <b>%h(zTagName)</b></label> |
| 2358 | 2347 | }else{ |
| 2359 | 2348 | @ Cancel tag <b>%h(&zTagName[4])</b></label> |
| 2360 | 2349 | } |
| 2361 | 2350 | } |
| 2362 | - fMainBranch = fossil_strcmp("trunk", zBranchName)==0 || | |
| 2363 | - fossil_strcmp(db_get("main-branch", "trunk"), zBranchName)==0; | |
| 2364 | 2351 | db_finalize(&q); |
| 2365 | 2352 | @ </td></tr> |
| 2366 | 2353 | |
| 2367 | 2354 | @ <tr><th align="right" valign="top">Branching:</th> |
| 2368 | 2355 | @ <td valign="top"> |
| 2369 | 2356 | @ <label><input id="newbr" type="checkbox" name="newbr"%s(zNewBrFlag) |
| 2370 | 2357 | if( !fHasHidden && zBranchName ){ |
| 2371 | - if( fMainBranch ){ | |
| 2372 | - @ onclick="hauc(gebi('hidebr'),'%h(zBranchName)', | |
| 2373 | - @ 'brname',this.value)" | |
| 2374 | - }else{ | |
| 2375 | - @ onclick="hauc(null,'%h(zBranchName)', | |
| 2376 | - @ 'brname',this.value)" | |
| 2377 | - } | |
| 2358 | + @ onclick="usids('%h(zBranchName)','brname',this.value)" | |
| 2378 | 2359 | } |
| 2379 | 2360 | @ /> |
| 2380 | 2361 | @ Make this check-in the start of a new branch named:</label> |
| 2381 | 2362 | @ <input type="text" style="width:15;" id="brname" name="brname" |
| 2382 | 2363 | @ value="%h(zNewBranch)" |
| @@ -2384,29 +2365,19 @@ | ||
| 2384 | 2365 | @ onkeyup="f=!!this.value |
| 2385 | 2366 | if( zBranchName ){ |
| 2386 | 2367 | @ if(f)f=this.value!='%h(zBranchName)' |
| 2387 | 2368 | } |
| 2388 | 2369 | @ gebi('newbr').checked=f |
| 2389 | - if( fMainBranch ){ | |
| 2390 | - @ hauc(gebi('hidebr'),'%h(zBranchName)', | |
| 2391 | - @ 'brname',!f)" | |
| 2392 | - }else{ | |
| 2393 | - @ hauc(null,'%h(zBranchName)','brname',!f)" | |
| 2394 | - } | |
| 2370 | + @ usids('%h(zBranchName)','brname',!f)" | |
| 2395 | 2371 | } |
| 2396 | 2372 | @ /> |
| 2397 | 2373 | @ </td></tr> |
| 2398 | 2374 | |
| 2399 | 2375 | if( !fHasHidden && zBranchName ){ |
| 2400 | 2376 | @ <tr><th align="right" valign="top">Branch Hiding:</th> |
| 2401 | 2377 | @ <td valign="top"> |
| 2402 | - @ <label><input type="checkbox" id="hidebr" name="hide"%s(zHideFlag) | |
| 2403 | - if( fMainBranch ){ | |
| 2404 | - @ disabled /> | |
| 2405 | - }else{ | |
| 2406 | - @ /> | |
| 2407 | - } | |
| 2378 | + @ <label><input type="checkbox" id="hidebr" name="hide"%s(zHideFlag) /> | |
| 2408 | 2379 | @ Hide branch |
| 2409 | 2380 | @ <span style="font-weight:bold" id="hbranch">%h(zBranchName)</span> |
| 2410 | 2381 | @ from the timeline starting from this check-in</label> |
| 2411 | 2382 | @ </td></tr> |
| 2412 | 2383 | } |
| 2413 | 2384 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2056,11 +2056,10 @@ | |
| 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 | int fMainBranch = 0; /* True if branch is trunk or main-branch */ |
| 2062 | const char *zChngTime = 0; /* Value of chngtime= query param, if any */ |
| 2063 | char *zUuid; |
| 2064 | Blob comment; |
| 2065 | char *zBranchName = 0; |
| 2066 | Stmt q; |
| @@ -2208,27 +2207,17 @@ | |
| 2208 | zUuid[10] = 0; |
| 2209 | style_header("Edit Check-in [%s]", zUuid); |
| 2210 | /* |
| 2211 | ** Javascript functions to assist in modifying hidden branch options. |
| 2212 | ** stcbi: sets the textContent for the given element id to val |
| 2213 | ** hcbxbi: hides the checkbox and unchecks for the given element id |
| 2214 | ** hauc: hides and unchecks the checkbox when needed |
| 2215 | */ |
| 2216 | @ <script> |
| 2217 | @ function stcbi(id,val){ |
| 2218 | @ if( id ) id.textContent = val; |
| 2219 | @ } |
| 2220 | @ function hcbxbi(id,toggle){ |
| 2221 | @ if( toggle ){ |
| 2222 | @ id.disabled = true; |
| 2223 | @ id.checked = false; |
| 2224 | @ }else{ |
| 2225 | @ id.disabled = false; |
| 2226 | @ } |
| 2227 | @ } |
| 2228 | @ function hauc(cbxid,zdef,formid,toggle){ |
| 2229 | @ if( cbxid ) hcbxbi(cbxid,toggle); |
| 2230 | @ hidbrid = gebi('hbranch'); |
| 2231 | @ cidbrid = document.getElementById('cbranch'); |
| 2232 | @ if( toggle ){ |
| 2233 | @ stcbi(hidbrid,zdef); |
| 2234 | @ stcbi(cidbrid,zdef); |
| @@ -2357,26 +2346,18 @@ | |
| 2357 | @ Cancel special tag <b>%h(zTagName)</b></label> |
| 2358 | }else{ |
| 2359 | @ Cancel tag <b>%h(&zTagName[4])</b></label> |
| 2360 | } |
| 2361 | } |
| 2362 | fMainBranch = fossil_strcmp("trunk", zBranchName)==0 || |
| 2363 | fossil_strcmp(db_get("main-branch", "trunk"), zBranchName)==0; |
| 2364 | db_finalize(&q); |
| 2365 | @ </td></tr> |
| 2366 | |
| 2367 | @ <tr><th align="right" valign="top">Branching:</th> |
| 2368 | @ <td valign="top"> |
| 2369 | @ <label><input id="newbr" type="checkbox" name="newbr"%s(zNewBrFlag) |
| 2370 | if( !fHasHidden && zBranchName ){ |
| 2371 | if( fMainBranch ){ |
| 2372 | @ onclick="hauc(gebi('hidebr'),'%h(zBranchName)', |
| 2373 | @ 'brname',this.value)" |
| 2374 | }else{ |
| 2375 | @ onclick="hauc(null,'%h(zBranchName)', |
| 2376 | @ 'brname',this.value)" |
| 2377 | } |
| 2378 | } |
| 2379 | @ /> |
| 2380 | @ Make this check-in the start of a new branch named:</label> |
| 2381 | @ <input type="text" style="width:15;" id="brname" name="brname" |
| 2382 | @ value="%h(zNewBranch)" |
| @@ -2384,29 +2365,19 @@ | |
| 2384 | @ onkeyup="f=!!this.value |
| 2385 | if( zBranchName ){ |
| 2386 | @ if(f)f=this.value!='%h(zBranchName)' |
| 2387 | } |
| 2388 | @ gebi('newbr').checked=f |
| 2389 | if( fMainBranch ){ |
| 2390 | @ hauc(gebi('hidebr'),'%h(zBranchName)', |
| 2391 | @ 'brname',!f)" |
| 2392 | }else{ |
| 2393 | @ hauc(null,'%h(zBranchName)','brname',!f)" |
| 2394 | } |
| 2395 | } |
| 2396 | @ /> |
| 2397 | @ </td></tr> |
| 2398 | |
| 2399 | if( !fHasHidden && zBranchName ){ |
| 2400 | @ <tr><th align="right" valign="top">Branch Hiding:</th> |
| 2401 | @ <td valign="top"> |
| 2402 | @ <label><input type="checkbox" id="hidebr" name="hide"%s(zHideFlag) |
| 2403 | if( fMainBranch ){ |
| 2404 | @ disabled /> |
| 2405 | }else{ |
| 2406 | @ /> |
| 2407 | } |
| 2408 | @ Hide branch |
| 2409 | @ <span style="font-weight:bold" id="hbranch">%h(zBranchName)</span> |
| 2410 | @ from the timeline starting from this check-in</label> |
| 2411 | @ </td></tr> |
| 2412 | } |
| 2413 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2056,11 +2056,10 @@ | |
| 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; |
| @@ -2208,27 +2207,17 @@ | |
| 2207 | zUuid[10] = 0; |
| 2208 | style_header("Edit Check-in [%s]", zUuid); |
| 2209 | /* |
| 2210 | ** Javascript functions to assist in modifying hidden branch options. |
| 2211 | ** stcbi: sets the textContent for the given element id to val |
| 2212 | ** usids: updates SPAN ids that contain the branch IDs |
| 2213 | */ |
| 2214 | @ <script> |
| 2215 | @ function stcbi(id,val){ |
| 2216 | @ if( id ) id.textContent = val; |
| 2217 | @ } |
| 2218 | @ function usids(zdef,formid,toggle){ |
| 2219 | @ hidbrid = gebi('hbranch'); |
| 2220 | @ cidbrid = document.getElementById('cbranch'); |
| 2221 | @ if( toggle ){ |
| 2222 | @ stcbi(hidbrid,zdef); |
| 2223 | @ stcbi(cidbrid,zdef); |
| @@ -2357,26 +2346,18 @@ | |
| 2346 | @ Cancel special tag <b>%h(zTagName)</b></label> |
| 2347 | }else{ |
| 2348 | @ Cancel tag <b>%h(&zTagName[4])</b></label> |
| 2349 | } |
| 2350 | } |
| 2351 | db_finalize(&q); |
| 2352 | @ </td></tr> |
| 2353 | |
| 2354 | @ <tr><th align="right" valign="top">Branching:</th> |
| 2355 | @ <td valign="top"> |
| 2356 | @ <label><input id="newbr" type="checkbox" name="newbr"%s(zNewBrFlag) |
| 2357 | if( !fHasHidden && zBranchName ){ |
| 2358 | @ onclick="usids('%h(zBranchName)','brname',this.value)" |
| 2359 | } |
| 2360 | @ /> |
| 2361 | @ Make this check-in the start of a new branch named:</label> |
| 2362 | @ <input type="text" style="width:15;" id="brname" name="brname" |
| 2363 | @ value="%h(zNewBranch)" |
| @@ -2384,29 +2365,19 @@ | |
| 2365 | @ onkeyup="f=!!this.value |
| 2366 | if( zBranchName ){ |
| 2367 | @ if(f)f=this.value!='%h(zBranchName)' |
| 2368 | } |
| 2369 | @ gebi('newbr').checked=f |
| 2370 | @ usids('%h(zBranchName)','brname',!f)" |
| 2371 | } |
| 2372 | @ /> |
| 2373 | @ </td></tr> |
| 2374 | |
| 2375 | if( !fHasHidden && zBranchName ){ |
| 2376 | @ <tr><th align="right" valign="top">Branch Hiding:</th> |
| 2377 | @ <td valign="top"> |
| 2378 | @ <label><input type="checkbox" id="hidebr" name="hide"%s(zHideFlag) /> |
| 2379 | @ Hide branch |
| 2380 | @ <span style="font-weight:bold" id="hbranch">%h(zBranchName)</span> |
| 2381 | @ from the timeline starting from this check-in</label> |
| 2382 | @ </td></tr> |
| 2383 | } |
| 2384 |