Fossil

Check-in [2d94dadceb]
Login

Check-in [2d94dadceb]

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

Overview
Comment:OLD_STYLE macro restores legacy display of /brtimeline
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | timeline-enhance-2025
Files: files | file ages | folders
SHA3-256: 2d94dadceb73bc91eab11329be24f04dd87681cab58163e37ad1b51891f89071
User & Date: drh 2025-10-17 11:14:56.067
Context
2025-10-17
12:05
Improvements to the /tarlist page. ... (check-in: 6827cd0582 user: drh tags: timeline-enhance-2025)
11:18
Add the /tarlist page with infrastructure changes to facilitate. Fix the "ng" (no-graph) query parameter so that it still colors timeline entries appropriately and still shows node circles, it just omits all the connecting lines. ... (check-in: 9cc36d2354 user: drh tags: trunk)
11:14
OLD_STYLE macro restores legacy display of /brtimeline ... (check-in: 2d94dadceb user: drh tags: timeline-enhance-2025)
11:05
Add #define to enable the new formatting of the "extra" tail on timeline entries. Currently set for legacy. ... (check-in: 4da636fe35 user: drh tags: timeline-enhance-2025)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/branch.c.
1036
1037
1038
1039
1040
1041
1042




1043
1044
1045
1046

1047
1048
1049
1050
1051
1052
1053
1054
1055




1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070

1071

1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090






1091

1092
1093
1094
1095
1096
1097
1098
    "   AND tagxref.tagid=tag.tagid"
    "   AND tagxref.tagtype>0"
    "   AND tag.tagname GLOB 'sym-*'",
    rid
  );
  while( db_step(&q)==SQLITE_ROW ){
    const char *zTagName = db_column_text(&q, 0);




    char *zBrName = branch_of_rid(rid);
    @  <strong>%h(zBrName)</strong><br>\
    @  %z(href("%R/timeline?r=%T",zTagName))<button>timeline</button></a>
    fossil_free(zBrName);

  }
  db_finalize(&q);
}

/*
** WEBPAGE: brtimeline
**
** List the first check of every branch, starting with the most recent
** and going backwards in time.




*/
void brtimeline_page(void){
  Blob sql = empty_blob;
  Stmt q;
  int tmFlags;                            /* Timeline display flags */
  int fNoHidden = PB("nohidden")!=0;      /* The "nohidden" query parameter */
  int fOnlyHidden = PB("onlyhidden")!=0;  /* The "onlyhidden" query parameter */

  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }

  style_set_current_feature("branch");
  style_header("Branches");
  style_submenu_element("Branch List", "brlist");
  login_anonymous_available();

  /* timeline_ss_submenu(); */

  cgi_check_for_malice();
  @ <h2>First check-in for every branch, starting with the most recent
  @ and going backwards in time.</h2>
  blob_append(&sql, timeline_query_for_www(), -1);
  blob_append_sql(&sql,
    "AND blob.rid IN (SELECT rid FROM tagxref"
    "                  WHERE tagtype>0 AND tagid=%d AND srcid!=0)", TAG_BRANCH);
  if( fNoHidden || fOnlyHidden ){
    const char* zUnaryOp = fNoHidden ? "NOT" : "";
    blob_append_sql(&sql,
      " AND %s EXISTS(SELECT 1 FROM tagxref"
      " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)\n",
      zUnaryOp/*safe-for-%s*/, TAG_HIDDEN);
  }
  db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_sql_text(&sql));
  blob_reset(&sql);
  /* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
  ** many descenders to (off-screen) parents. */
  tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL | TIMELINE_COLUMNAR






          | TIMELINE_BRCOLOR;

  www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, brtimeline_extra);
  db_finalize(&q);
  style_finish_page();
}

/*
** Generate a multichoice submenu for the few recent active branches. zName is







>
>
>
>




>









>
>
>
>















>
|
>


















|
>
>
>
>
>
>
|
>







1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
    "   AND tagxref.tagid=tag.tagid"
    "   AND tagxref.tagtype>0"
    "   AND tag.tagname GLOB 'sym-*'",
    rid
  );
  while( db_step(&q)==SQLITE_ROW ){
    const char *zTagName = db_column_text(&q, 0);
#define OLD_STYLE 1
#if OLD_STYLE
    @  %z(href("%R/timeline?r=%T",zTagName))[timeline]</a>
#else
    char *zBrName = branch_of_rid(rid);
    @  <strong>%h(zBrName)</strong><br>\
    @  %z(href("%R/timeline?r=%T",zTagName))<button>timeline</button></a>
    fossil_free(zBrName);
#endif
  }
  db_finalize(&q);
}

/*
** WEBPAGE: brtimeline
**
** List the first check of every branch, starting with the most recent
** and going backwards in time.
**
** Query parameters:
**
**    ubg            Color the graph by user, not by branch.
*/
void brtimeline_page(void){
  Blob sql = empty_blob;
  Stmt q;
  int tmFlags;                            /* Timeline display flags */
  int fNoHidden = PB("nohidden")!=0;      /* The "nohidden" query parameter */
  int fOnlyHidden = PB("onlyhidden")!=0;  /* The "onlyhidden" query parameter */

  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }

  style_set_current_feature("branch");
  style_header("Branches");
  style_submenu_element("Branch List", "brlist");
  login_anonymous_available();
#if OLD_STYLE
  timeline_ss_submenu();
#endif
  cgi_check_for_malice();
  @ <h2>First check-in for every branch, starting with the most recent
  @ and going backwards in time.</h2>
  blob_append(&sql, timeline_query_for_www(), -1);
  blob_append_sql(&sql,
    "AND blob.rid IN (SELECT rid FROM tagxref"
    "                  WHERE tagtype>0 AND tagid=%d AND srcid!=0)", TAG_BRANCH);
  if( fNoHidden || fOnlyHidden ){
    const char* zUnaryOp = fNoHidden ? "NOT" : "";
    blob_append_sql(&sql,
      " AND %s EXISTS(SELECT 1 FROM tagxref"
      " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)\n",
      zUnaryOp/*safe-for-%s*/, TAG_HIDDEN);
  }
  db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_sql_text(&sql));
  blob_reset(&sql);
  /* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
  ** many descenders to (off-screen) parents. */
  tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
#if !OLD_STYLE
  tmFlags |= TIMELINE_COLUMNAR;
#endif
  if( PB("ubg")!=0 ){
    tmFlags |= TIMELINE_UCOLOR;
  }else{
    tmFlags |= TIMELINE_BRCOLOR;
  }
  www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, brtimeline_extra);
  db_finalize(&q);
  style_finish_page();
}

/*
** Generate a multichoice submenu for the few recent active branches. zName is