Fossil

Check-in [1851b26d2b]
Login

Check-in [1851b26d2b]

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

Overview
Comment:Use the datetime of the start of the branch as the input for the color hash. See suggestion made by Stephan Beal in [forum:/forumpost/a9a92d73c4a172f9|forum post a9a92d73c4a172f9].
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | datetime-color-hash
Files: files | file ages | folders
SHA3-256: 1851b26d2b7894f51b69ea50d8a8facb51105cc67758e87fabefe337f6eac178
User & Date: andybradford 2025-09-27 00:47:16.820
Context
2025-09-27
16:26
Switch to time based color hash generation for other pages (brlist, finfo, info, and ci_edit). Now abandoned. ... (Closed-Leaf check-in: 4a90f3352d user: andybradford tags: datetime-color-hash)
00:47
Use the datetime of the start of the branch as the input for the color hash. See suggestion made by Stephan Beal in [forum:/forumpost/a9a92d73c4a172f9|forum post a9a92d73c4a172f9]. ... (check-in: 1851b26d2b user: andybradford tags: datetime-color-hash)
2025-09-26
20:07
Add a new setting "regexp-limit" that determines the maximum size of a REGEXP virtual machine. Default value 1000. ... (check-in: 82888a0d35 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/branch.c.
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
    for(i=3; i<g.argc; i++){
      const char *zBrName = g.argv[i];
      int rid = branch_is_open(zBrName);
      if( rid==0 ){
        fossil_print("%s: not an open branch\n", zBrName);
      }else{
        const char *zUuid = db_text(0,"SELECT uuid FROM blob WHERE rid=%d",rid);
        const char *zDate = db_text(0,
          "SELECT datetime(mtime,toLocal()) FROM event"
          " WHERE objid=%d", rid);
        fossil_print("%s: open as of %s on %.16s\n", zBrName, zDate, zUuid);
      }
    }
  }else if( strncmp(zCmd,"list",n)==0 ||
            strncmp(zCmd, "ls", n)==0 ||
            strcmp(zCmd, "lsh")==0 ){
    Stmt q;







|
<
<







698
699
700
701
702
703
704
705


706
707
708
709
710
711
712
    for(i=3; i<g.argc; i++){
      const char *zBrName = g.argv[i];
      int rid = branch_is_open(zBrName);
      if( rid==0 ){
        fossil_print("%s: not an open branch\n", zBrName);
      }else{
        const char *zUuid = db_text(0,"SELECT uuid FROM blob WHERE rid=%d",rid);
        const char *zDate = datetime_of_rid(rid);


        fossil_print("%s: open as of %s on %.16s\n", zBrName, zDate, zUuid);
      }
    }
  }else if( strncmp(zCmd,"list",n)==0 ||
            strncmp(zCmd, "ls", n)==0 ||
            strcmp(zCmd, "lsh")==0 ){
    Stmt q;
Changes to src/name.c.
201
202
203
204
205
206
207








208
209
210
211
212
213
214
    memcpy(zUp+10, " 23:59:59.999z", 14);
    if( !addZ ) zUp[23] = 0;
    return zUp;
  }
  return zDate;
}










/*
** Return the RID that is the "root" of the branch that contains
** check-in "rid".  Details depending on eType:
**
**    eType==0    The check-in of the parent branch off of which
**                the branch containing RID originally diverged.







>
>
>
>
>
>
>
>







201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
    memcpy(zUp+10, " 23:59:59.999z", 14);
    if( !addZ ) zUp[23] = 0;
    return zUp;
  }
  return zDate;
}

/*
** Return the datetime of a given "rid"
*/
char *datetime_of_rid(int rid){
  return db_text(0,
    "SELECT datetime(mtime,toLocal()) FROM event"
    " WHERE objid=%d", rid);
}

/*
** Return the RID that is the "root" of the branch that contains
** check-in "rid".  Details depending on eType:
**
**    eType==0    The check-in of the parent branch off of which
**                the branch containing RID originally diverged.
Changes to src/timeline.c.
271
272
273
274
275
276
277

278
279
280
281
282
283
284
  blob_zero(&comment);
  while( db_step(pQuery)==SQLITE_ROW ){
    int rid = db_column_int(pQuery, 0);
    const char *zUuid = db_column_text(pQuery, 1);
    int isLeaf = db_column_int(pQuery, 5);
    const char *zBgClr = db_column_text(pQuery, 6);
    const char *zDate = db_column_text(pQuery, 2);

    const char *zType = db_column_text(pQuery, 7);
    const char *zUser = db_column_text(pQuery, 4);
    const char *zTagList = db_column_text(pQuery, 8);
    int tagid = db_column_int(pQuery, 9);
    const char *zDispUser = zUser && zUser[0] ? zUser : "anonymous";
    char *zBr = 0;            /* Branch */
    int commentColumn = 3;    /* Column containing comment text */







>







271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
  blob_zero(&comment);
  while( db_step(pQuery)==SQLITE_ROW ){
    int rid = db_column_int(pQuery, 0);
    const char *zUuid = db_column_text(pQuery, 1);
    int isLeaf = db_column_int(pQuery, 5);
    const char *zBgClr = db_column_text(pQuery, 6);
    const char *zDate = db_column_text(pQuery, 2);
    const char *zBrDate = datetime_of_rid(start_of_branch(rid,1));
    const char *zType = db_column_text(pQuery, 7);
    const char *zUser = db_column_text(pQuery, 4);
    const char *zTagList = db_column_text(pQuery, 8);
    int tagid = db_column_int(pQuery, 9);
    const char *zDispUser = zUser && zUser[0] ? zUser : "anonymous";
    char *zBr = 0;            /* Branch */
    int commentColumn = 3;    /* Column containing comment text */
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
      if( zBgClr==0 || (tmFlags & TIMELINE_BRCOLOR)!=0 ){
        /* If no background color is specified, use a color based on the
        ** branch name */
        if( tmFlags & (TIMELINE_DELTA|TIMELINE_NOCOLOR) ){
        }else if( zBr==0 || strcmp(zBr,"trunk")==0 ){
          zBgClr = 0;
        }else{
          zBgClr = hash_color(zBr);
        }
      }
    }
    if( zType[0]=='c' && pGraph ){
      int nParent = 0;
      int nCherrypick = 0;
      GraphRowId aParent[GR_MAX_RAIL];







|







436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
      if( zBgClr==0 || (tmFlags & TIMELINE_BRCOLOR)!=0 ){
        /* If no background color is specified, use a color based on the
        ** branch name */
        if( tmFlags & (TIMELINE_DELTA|TIMELINE_NOCOLOR) ){
        }else if( zBr==0 || strcmp(zBr,"trunk")==0 ){
          zBgClr = 0;
        }else{
          zBgClr = hash_color(zBrDate);
        }
      }
    }
    if( zType[0]=='c' && pGraph ){
      int nParent = 0;
      int nCherrypick = 0;
      GraphRowId aParent[GR_MAX_RAIL];