Fossil

Check-in [7a41dd2b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Attempt to prevent hiding of either main-branch or trunk.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | hidden-tag
Files: files | file ages | folders
SHA1:7a41dd2b0605f4a890aedbd42d0a73178743b1f1
User & Date: andybradford 2013-12-13 02:46:23
Context
2013-12-13
05:40
Minor comment cleanup. No code change. check-in: 40c5b3b3 user: andybradford tags: hidden-tag
02:46
Attempt to prevent hiding of either main-branch or trunk. check-in: 7a41dd2b user: andybradford tags: hidden-tag
2013-12-12
09:46
merge trunk check-in: 820a5990 user: jan.nijtmans tags: hidden-tag
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/info.c.

2054
2055
2056
2057
2058
2059
2060

2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
....
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
....
2356
2357
2358
2359
2360
2361
2362


2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
....
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
  const char *zNewBranch;
  const char *zCloseFlag;
  const char *zHideFlag;
  int fPropagateColor;          /* True if color propagates before edit */
  int fNewPropagateColor;       /* True if color propagates after edit */
  int fHasHidden = 0;           /* True if hidden tag already set */
  int fHasClosed = 0;           /* True if closed tag already set */

  const char *zChngTime = 0;     /* Value of chngtime= query param, if any */
  char *zUuid;
  Blob comment;
  char *zBranchName = 0;
  const char *zTrunk;
  Stmt q;

  login_check_credentials();
  if( !g.perm.Write ){ login_needed(); return; }
  rid = name_to_typed_rid(P("r"), "ci");
  zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
  zComment = db_text(0, "SELECT coalesce(ecomment,comment)"
................................................................................
  db_prepare(&q,
     "SELECT tag.tagid, tagname, tagxref.value FROM tagxref, tag"
     " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid"
     " ORDER BY CASE WHEN tagname GLOB 'sym-*' THEN substr(tagname,5)"
     "               ELSE tagname END /*sort*/",
     rid
  );
  zTrunk = db_get("main-branch", "trunk");
  while( db_step(&q)==SQLITE_ROW ){
    int tagid = db_column_int(&q, 0);
    const char *zTagName = db_column_text(&q, 1);
    int isSpecialTag = strncmp(zTagName, "sym-", 4)!=0;
    char zLabel[30];

    if (tagid == TAG_CLOSED){
................................................................................
    }
    if( isSpecialTag ){
      @ Cancel special tag <b>%h(zTagName)</b></label>
    }else{
      @ Cancel tag <b>%h(&zTagName[4])</b></label>
    }
  }


  db_finalize(&q);
  @ </td></tr>

  @ <tr><th align="right" valign="top">Branching:</th>
  @ <td valign="top">
  @ <label><input id="newbr" type="checkbox" name="newbr"%s(zNewBrFlag)
  if( !fHasHidden && zBranchName ){
    if( fossil_strcmp(zBranchName, zTrunk)==0 ){
      @ onclick="hauc(gebi('hidebr'),'%h(zBranchName)',
      @ 'brname',this.value)"
    }else{
      @ onclick="hauc(null,'%h(zBranchName)',
      @ 'brname',this.value)"
    }
  }
................................................................................
  @ value="%h(zNewBranch)"
  if( !fHasHidden && zBranchName ){
    @ onkeyup="f=!!this.value
    if( zBranchName ){
      @  if(f)f=this.value!='%h(zBranchName)'
    }
    @ gebi('newbr').checked=f
    if( fossil_strcmp(zBranchName, zTrunk)==0 ){
      @ hauc(gebi('hidebr'),'%h(zBranchName)',
      @ 'brname',!f)"
    }else{
      @ hauc(null,'%h(zBranchName)','brname',!f)"
    }
  }
  @ />
  @ </td></tr>

  if( !fHasHidden && zBranchName ){
    @ <tr><th align="right" valign="top">Branch Hiding:</th>
    @ <td valign="top">
    @ <label><input type="checkbox" id="hidebr" name="hide"%s(zHideFlag) 
    if( fossil_strcmp(zBranchName, zTrunk)==0 ){
      @ disabled />
    }else{
      @ />
    }
    @ Hide branch 
    @ <span style="font-weight:bold" id="hbranch">%h(zBranchName)</span>
    @ from the timeline starting from this check-in</label>







>




<







 







<







 







>
>







|







 







|













|







2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065

2066
2067
2068
2069
2070
2071
2072
....
2323
2324
2325
2326
2327
2328
2329

2330
2331
2332
2333
2334
2335
2336
....
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
....
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
  const char *zNewBranch;
  const char *zCloseFlag;
  const char *zHideFlag;
  int fPropagateColor;          /* True if color propagates before edit */
  int fNewPropagateColor;       /* True if color propagates after edit */
  int fHasHidden = 0;           /* True if hidden tag already set */
  int fHasClosed = 0;           /* True if closed tag already set */
  int fMainBranch = 0;        /* True if branch is trunk or main-branch */
  const char *zChngTime = 0;     /* Value of chngtime= query param, if any */
  char *zUuid;
  Blob comment;
  char *zBranchName = 0;

  Stmt q;

  login_check_credentials();
  if( !g.perm.Write ){ login_needed(); return; }
  rid = name_to_typed_rid(P("r"), "ci");
  zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
  zComment = db_text(0, "SELECT coalesce(ecomment,comment)"
................................................................................
  db_prepare(&q,
     "SELECT tag.tagid, tagname, tagxref.value FROM tagxref, tag"
     " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid"
     " ORDER BY CASE WHEN tagname GLOB 'sym-*' THEN substr(tagname,5)"
     "               ELSE tagname END /*sort*/",
     rid
  );

  while( db_step(&q)==SQLITE_ROW ){
    int tagid = db_column_int(&q, 0);
    const char *zTagName = db_column_text(&q, 1);
    int isSpecialTag = strncmp(zTagName, "sym-", 4)!=0;
    char zLabel[30];

    if (tagid == TAG_CLOSED){
................................................................................
    }
    if( isSpecialTag ){
      @ Cancel special tag <b>%h(zTagName)</b></label>
    }else{
      @ Cancel tag <b>%h(&zTagName[4])</b></label>
    }
  }
  fMainBranch = fossil_strcmp("trunk", zBranchName)==0 ||
                fossil_strcmp(db_get("main-branch", "trunk"), zBranchName)==0;
  db_finalize(&q);
  @ </td></tr>

  @ <tr><th align="right" valign="top">Branching:</th>
  @ <td valign="top">
  @ <label><input id="newbr" type="checkbox" name="newbr"%s(zNewBrFlag)
  if( !fHasHidden && zBranchName ){
    if( fMainBranch ){
      @ onclick="hauc(gebi('hidebr'),'%h(zBranchName)',
      @ 'brname',this.value)"
    }else{
      @ onclick="hauc(null,'%h(zBranchName)',
      @ 'brname',this.value)"
    }
  }
................................................................................
  @ value="%h(zNewBranch)"
  if( !fHasHidden && zBranchName ){
    @ onkeyup="f=!!this.value
    if( zBranchName ){
      @  if(f)f=this.value!='%h(zBranchName)'
    }
    @ gebi('newbr').checked=f
    if( fMainBranch ){
      @ hauc(gebi('hidebr'),'%h(zBranchName)',
      @ 'brname',!f)"
    }else{
      @ hauc(null,'%h(zBranchName)','brname',!f)"
    }
  }
  @ />
  @ </td></tr>

  if( !fHasHidden && zBranchName ){
    @ <tr><th align="right" valign="top">Branch Hiding:</th>
    @ <td valign="top">
    @ <label><input type="checkbox" id="hidebr" name="hide"%s(zHideFlag) 
    if( fMainBranch ){
      @ disabled />
    }else{
      @ />
    }
    @ Hide branch 
    @ <span style="font-weight:bold" id="hbranch">%h(zBranchName)</span>
    @ from the timeline starting from this check-in</label>