Fossil SCM

Given that recovering from incorrect hiding is relatively straightforward, don't prevent access to hidden option on trunk and main-branch.

andybradford 2013-12-13 21:29 hidden-tag
Commit d35b1ca05e62915cbc740ac31027201076cb99bf
1 file changed +5 -34
+5 -34
--- src/info.c
+++ src/info.c
@@ -2056,11 +2056,10 @@
20562056
const char *zHideFlag;
20572057
int fPropagateColor; /* True if color propagates before edit */
20582058
int fNewPropagateColor; /* True if color propagates after edit */
20592059
int fHasHidden = 0; /* True if hidden tag already set */
20602060
int fHasClosed = 0; /* True if closed tag already set */
2061
- int fMainBranch = 0; /* True if branch is trunk or main-branch */
20622061
const char *zChngTime = 0; /* Value of chngtime= query param, if any */
20632062
char *zUuid;
20642063
Blob comment;
20652064
char *zBranchName = 0;
20662065
Stmt q;
@@ -2208,27 +2207,17 @@
22082207
zUuid[10] = 0;
22092208
style_header("Edit Check-in [%s]", zUuid);
22102209
/*
22112210
** Javascript functions to assist in modifying hidden branch options.
22122211
** 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
22152213
*/
22162214
@ <script>
22172215
@ function stcbi(id,val){
22182216
@ if( id ) id.textContent = val;
22192217
@ }
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){
22302219
@ hidbrid = gebi('hbranch');
22312220
@ cidbrid = document.getElementById('cbranch');
22322221
@ if( toggle ){
22332222
@ stcbi(hidbrid,zdef);
22342223
@ stcbi(cidbrid,zdef);
@@ -2357,26 +2346,18 @@
23572346
@ Cancel special tag <b>%h(zTagName)</b></label>
23582347
}else{
23592348
@ Cancel tag <b>%h(&zTagName[4])</b></label>
23602349
}
23612350
}
2362
- fMainBranch = fossil_strcmp("trunk", zBranchName)==0 ||
2363
- fossil_strcmp(db_get("main-branch", "trunk"), zBranchName)==0;
23642351
db_finalize(&q);
23652352
@ </td></tr>
23662353
23672354
@ <tr><th align="right" valign="top">Branching:</th>
23682355
@ <td valign="top">
23692356
@ <label><input id="newbr" type="checkbox" name="newbr"%s(zNewBrFlag)
23702357
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)"
23782359
}
23792360
@ />
23802361
@ Make this check-in the start of a new branch named:</label>
23812362
@ <input type="text" style="width:15;" id="brname" name="brname"
23822363
@ value="%h(zNewBranch)"
@@ -2384,29 +2365,19 @@
23842365
@ onkeyup="f=!!this.value
23852366
if( zBranchName ){
23862367
@ if(f)f=this.value!='%h(zBranchName)'
23872368
}
23882369
@ 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)"
23952371
}
23962372
@ />
23972373
@ </td></tr>
23982374
23992375
if( !fHasHidden && zBranchName ){
24002376
@ <tr><th align="right" valign="top">Branch Hiding:</th>
24012377
@ <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) />
24082379
@ Hide branch
24092380
@ <span style="font-weight:bold" id="hbranch">%h(zBranchName)</span>
24102381
@ from the timeline starting from this check-in</label>
24112382
@ </td></tr>
24122383
}
24132384
--- 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

Keyboard Shortcuts

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