Fossil

Check-in [768f30ffb7]
Login

Check-in [768f30ffb7]

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

Overview
Comment:branch hide/unhide subcommands now skip over checkins which have resp. don't have the hidden tag.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | branch-close-subcommand
Files: files | file ages | folders
SHA3-256: 768f30ffb7b22674b02ad020bc12ed38b549b102ffc4429a8206f75f9c5336a4
User & Date: stephan 2021-07-23 02:44:32.135
Context
2021-07-23
06:12
Added (branch reopen) subcommand, the inverse of (branch close), per forum feedback. ... (Closed-Leaf check-in: 6f3ab14165 user: stephan tags: branch-close-subcommand)
02:44
branch hide/unhide subcommands now skip over checkins which have resp. don't have the hidden tag. ... (check-in: 768f30ffb7 user: stephan tags: branch-close-subcommand)
02:22
Added (branch hide/unhide) subcommands. ... (check-in: 05b42e6aa6 user: stephan tags: branch-close-subcommand)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/branch.c.
478
479
480
481
482
483
484

485
486
487







488
489
490
491
492
493
494
  const char *zUserOvrd = find_option("user-override",0,1);

  verify_all_options();
  db_begin_transaction();
  for( ; argPos < g.argc; fossil_free(zUuid), ++argPos ){
    const char * zName = g.argv[argPos];
    const int rid = branch_resolve_name(zName, &zUuid);

    /* Potential TODO: check for existing 'hidden' flag and skip this
    ** entry if it already has (if fHide) or does not have (if !fHide)
    ** that tag. FWIW, /ci_edit does not do so. */







    branch_cmd_tag_add(rid, fHide ? "*hidden" : "-hidden");
    if(fVerbose!=0){
      fossil_print("%s checkin [%s] %s\n",
                   fHide ? "Hiding" : "Unhiding",
                   zName, zUuid);
    }
  }







>



>
>
>
>
>
>
>







478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
  const char *zUserOvrd = find_option("user-override",0,1);

  verify_all_options();
  db_begin_transaction();
  for( ; argPos < g.argc; fossil_free(zUuid), ++argPos ){
    const char * zName = g.argv[argPos];
    const int rid = branch_resolve_name(zName, &zUuid);
    const int isHidden = tag_has(rid, TAG_HIDDEN);
    /* Potential TODO: check for existing 'hidden' flag and skip this
    ** entry if it already has (if fHide) or does not have (if !fHide)
    ** that tag. FWIW, /ci_edit does not do so. */
    if(fHide && isHidden){
      fossil_warning("Skipping hidden checkin %s: %s.", zName, zUuid);
      continue;
    }else if(!fHide && !isHidden){
      fossil_warning("Skipping non-hidden checkin %s: %s.", zName, zUuid);
      continue;
    }
    branch_cmd_tag_add(rid, fHide ? "*hidden" : "-hidden");
    if(fVerbose!=0){
      fossil_print("%s checkin [%s] %s\n",
                   fHide ? "Hiding" : "Unhiding",
                   zName, zUuid);
    }
  }
Changes to src/tag.c.
887
888
889
890
891
892
893














  if( PB("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
  if( PB("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
  www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, 0);
  db_finalize(&q);
  @ <br />
  style_finish_page();
}





















>
>
>
>
>
>
>
>
>
>
>
>
>
>
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
  if( PB("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
  if( PB("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
  www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, 0);
  db_finalize(&q);
  @ <br />
  style_finish_page();
}

/*
** Returns true if the given blob.rid value has the given tag ID
** applied to it, else false.
*/
int tag_has(int rid, int tagId){
  return db_exists(
     "SELECT tag.tagid FROM tagxref, tag"
     " WHERE tagxref.rid=%d AND tagtype>0 "
     " AND tag.tagid=%d"
     " AND tagxref.tagid=tag.tagid",
     rid, tagId
  );
}