Fossil SCM

In the timeline, replace a hard-coded 'trunk' with a db_get('main-branch'), as suggested in [forum:61450a0395|forum post 61450a0395].

stephan 2025-10-09 09:33 tktview-newest-first
Commit 263c51941ac8e3bb2760782247c41f2e20a23c54366e36d8db4bd488634559e1
1 file changed +3 -2
+3 -2
--- src/timeline.c
+++ src/timeline.c
@@ -287,10 +287,11 @@
287287
int drawDetailEllipsis; /* True to show ellipsis in place of detail */
288288
int gidx = 0; /* Graph row identifier */
289289
int isSelectedOrCurrent = 0; /* True if current row is selected */
290290
const char *zExtraClass = "";
291291
char zTime[20];
292
+ char *zMainBranch = db_get("main-branch","trunk");
292293
293294
if( zDate==0 ){
294295
zDate = "YYYY-MM-DD HH:MM:SS"; /* Something wrong with the repo */
295296
}
296297
modPending = moderation_pending(rid);
@@ -434,11 +435,11 @@
434435
zBr = branch_of_rid(rid);
435436
if( zBgClr==0 || (tmFlags & TIMELINE_BRCOLOR)!=0 ){
436437
/* If no background color is specified, use a color based on the
437438
** branch name */
438439
if( tmFlags & (TIMELINE_DELTA|TIMELINE_NOCOLOR) ){
439
- }else if( zBr==0 || strcmp(zBr,"trunk")==0 ){
440
+ }else if( zBr==0 || strcmp(zBr,zMainBranch)==0 ){
440441
zBgClr = 0;
441442
}else{
442443
zBgClr = hash_color(zBr);
443444
}
444445
}
@@ -598,11 +599,11 @@
598599
drawDetailEllipsis = 0;
599600
}else{
600601
cgi_printf("%W",blob_str(&comment));
601602
}
602603
}
603
-
604
+
604605
if( zType[0]=='c' && strcmp(zUuid, MANIFEST_UUID)==0 ){
605606
/* This will only ever happen when Fossil is drawing a timeline for
606607
** its own self-host repository. If the timeline shows the specific
607608
** check-in corresponding to the current executable, then tag that
608609
** check-in with "This is me!". */
609610
--- src/timeline.c
+++ src/timeline.c
@@ -287,10 +287,11 @@
287 int drawDetailEllipsis; /* True to show ellipsis in place of detail */
288 int gidx = 0; /* Graph row identifier */
289 int isSelectedOrCurrent = 0; /* True if current row is selected */
290 const char *zExtraClass = "";
291 char zTime[20];
 
292
293 if( zDate==0 ){
294 zDate = "YYYY-MM-DD HH:MM:SS"; /* Something wrong with the repo */
295 }
296 modPending = moderation_pending(rid);
@@ -434,11 +435,11 @@
434 zBr = branch_of_rid(rid);
435 if( zBgClr==0 || (tmFlags & TIMELINE_BRCOLOR)!=0 ){
436 /* If no background color is specified, use a color based on the
437 ** branch name */
438 if( tmFlags & (TIMELINE_DELTA|TIMELINE_NOCOLOR) ){
439 }else if( zBr==0 || strcmp(zBr,"trunk")==0 ){
440 zBgClr = 0;
441 }else{
442 zBgClr = hash_color(zBr);
443 }
444 }
@@ -598,11 +599,11 @@
598 drawDetailEllipsis = 0;
599 }else{
600 cgi_printf("%W",blob_str(&comment));
601 }
602 }
603
604 if( zType[0]=='c' && strcmp(zUuid, MANIFEST_UUID)==0 ){
605 /* This will only ever happen when Fossil is drawing a timeline for
606 ** its own self-host repository. If the timeline shows the specific
607 ** check-in corresponding to the current executable, then tag that
608 ** check-in with "This is me!". */
609
--- src/timeline.c
+++ src/timeline.c
@@ -287,10 +287,11 @@
287 int drawDetailEllipsis; /* True to show ellipsis in place of detail */
288 int gidx = 0; /* Graph row identifier */
289 int isSelectedOrCurrent = 0; /* True if current row is selected */
290 const char *zExtraClass = "";
291 char zTime[20];
292 char *zMainBranch = db_get("main-branch","trunk");
293
294 if( zDate==0 ){
295 zDate = "YYYY-MM-DD HH:MM:SS"; /* Something wrong with the repo */
296 }
297 modPending = moderation_pending(rid);
@@ -434,11 +435,11 @@
435 zBr = branch_of_rid(rid);
436 if( zBgClr==0 || (tmFlags & TIMELINE_BRCOLOR)!=0 ){
437 /* If no background color is specified, use a color based on the
438 ** branch name */
439 if( tmFlags & (TIMELINE_DELTA|TIMELINE_NOCOLOR) ){
440 }else if( zBr==0 || strcmp(zBr,zMainBranch)==0 ){
441 zBgClr = 0;
442 }else{
443 zBgClr = hash_color(zBr);
444 }
445 }
@@ -598,11 +599,11 @@
599 drawDetailEllipsis = 0;
600 }else{
601 cgi_printf("%W",blob_str(&comment));
602 }
603 }
604
605 if( zType[0]=='c' && strcmp(zUuid, MANIFEST_UUID)==0 ){
606 /* This will only ever happen when Fossil is drawing a timeline for
607 ** its own self-host repository. If the timeline shows the specific
608 ** check-in corresponding to the current executable, then tag that
609 ** check-in with "This is me!". */
610

Keyboard Shortcuts

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