Fossil SCM

Use auto-coloring for private branches, instead of applying the orangeish default `#fec084', so colors play better with skins and the `fossil publish' command.

florian 2024-01-13 13:00 trunk
Commit 08dadf3fe42514ce210af324baea27ef85b07c9f15d8348efe4890f10a3a64e1
--- src/branch.c
+++ src/branch.c
@@ -81,18 +81,13 @@
8181
Manifest *pParent; /* Parsed parent manifest */
8282
Blob mcksum; /* Self-checksum on the manifest */
8383
const char *zDateOvrd; /* Override date string */
8484
const char *zUserOvrd; /* Override user name */
8585
int isPrivate = 0; /* True if the branch should be private */
86
- int bAutoColor = 0; /* Value of "--bgcolor" is "auto" */
8786
8887
noSign = find_option("nosign","",0)!=0;
8988
zColor = find_option("bgcolor","c",1);
90
- if( fossil_strncmp(zColor, "auto", 4)==0 ) {
91
- bAutoColor = 1;
92
- zColor = 0;
93
- }
9489
isPrivate = find_option("private",0,0)!=0;
9590
zDateOvrd = find_option("date-override",0,1);
9691
zUserOvrd = find_option("user-override",0,1);
9792
verify_all_options();
9893
if( g.argc<5 ){
@@ -152,11 +147,10 @@
152147
manifest_destroy(pParent);
153148
154149
/* Add the symbolic branch name and the "branch" tag to identify
155150
** this as a new branch */
156151
if( content_is_private(rootid) ) isPrivate = 1;
157
- if( isPrivate && zColor==0 && !bAutoColor) zColor = "#fec084";
158152
if( zColor!=0 ){
159153
blob_appendf(&branch, "T *bgcolor * %F\n", zColor);
160154
}
161155
blob_appendf(&branch, "T *branch * %F\n", zBranch);
162156
blob_appendf(&branch, "T *sym-%F *\n", zBranch);
@@ -664,12 +658,10 @@
664658
** Create a new branch BRANCH-NAME off of check-in BASIS.
665659
**
666660
** Options:
667661
** --private Branch is private (i.e., remains local)
668662
** --bgcolor COLOR Use COLOR instead of automatic background
669
-** ("auto" lets Fossil choose it automatically,
670
-** even for private branches)
671663
** --nosign Do not sign contents on this branch
672664
** --date-override DATE DATE to use instead of 'now'
673665
** --user-override USER USER to use instead of the current default
674666
**
675667
** DATE may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in
676668
--- src/branch.c
+++ src/branch.c
@@ -81,18 +81,13 @@
81 Manifest *pParent; /* Parsed parent manifest */
82 Blob mcksum; /* Self-checksum on the manifest */
83 const char *zDateOvrd; /* Override date string */
84 const char *zUserOvrd; /* Override user name */
85 int isPrivate = 0; /* True if the branch should be private */
86 int bAutoColor = 0; /* Value of "--bgcolor" is "auto" */
87
88 noSign = find_option("nosign","",0)!=0;
89 zColor = find_option("bgcolor","c",1);
90 if( fossil_strncmp(zColor, "auto", 4)==0 ) {
91 bAutoColor = 1;
92 zColor = 0;
93 }
94 isPrivate = find_option("private",0,0)!=0;
95 zDateOvrd = find_option("date-override",0,1);
96 zUserOvrd = find_option("user-override",0,1);
97 verify_all_options();
98 if( g.argc<5 ){
@@ -152,11 +147,10 @@
152 manifest_destroy(pParent);
153
154 /* Add the symbolic branch name and the "branch" tag to identify
155 ** this as a new branch */
156 if( content_is_private(rootid) ) isPrivate = 1;
157 if( isPrivate && zColor==0 && !bAutoColor) zColor = "#fec084";
158 if( zColor!=0 ){
159 blob_appendf(&branch, "T *bgcolor * %F\n", zColor);
160 }
161 blob_appendf(&branch, "T *branch * %F\n", zBranch);
162 blob_appendf(&branch, "T *sym-%F *\n", zBranch);
@@ -664,12 +658,10 @@
664 ** Create a new branch BRANCH-NAME off of check-in BASIS.
665 **
666 ** Options:
667 ** --private Branch is private (i.e., remains local)
668 ** --bgcolor COLOR Use COLOR instead of automatic background
669 ** ("auto" lets Fossil choose it automatically,
670 ** even for private branches)
671 ** --nosign Do not sign contents on this branch
672 ** --date-override DATE DATE to use instead of 'now'
673 ** --user-override USER USER to use instead of the current default
674 **
675 ** DATE may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in
676
--- src/branch.c
+++ src/branch.c
@@ -81,18 +81,13 @@
81 Manifest *pParent; /* Parsed parent manifest */
82 Blob mcksum; /* Self-checksum on the manifest */
83 const char *zDateOvrd; /* Override date string */
84 const char *zUserOvrd; /* Override user name */
85 int isPrivate = 0; /* True if the branch should be private */
 
86
87 noSign = find_option("nosign","",0)!=0;
88 zColor = find_option("bgcolor","c",1);
 
 
 
 
89 isPrivate = find_option("private",0,0)!=0;
90 zDateOvrd = find_option("date-override",0,1);
91 zUserOvrd = find_option("user-override",0,1);
92 verify_all_options();
93 if( g.argc<5 ){
@@ -152,11 +147,10 @@
147 manifest_destroy(pParent);
148
149 /* Add the symbolic branch name and the "branch" tag to identify
150 ** this as a new branch */
151 if( content_is_private(rootid) ) isPrivate = 1;
 
152 if( zColor!=0 ){
153 blob_appendf(&branch, "T *bgcolor * %F\n", zColor);
154 }
155 blob_appendf(&branch, "T *branch * %F\n", zBranch);
156 blob_appendf(&branch, "T *sym-%F *\n", zBranch);
@@ -664,12 +658,10 @@
658 ** Create a new branch BRANCH-NAME off of check-in BASIS.
659 **
660 ** Options:
661 ** --private Branch is private (i.e., remains local)
662 ** --bgcolor COLOR Use COLOR instead of automatic background
 
 
663 ** --nosign Do not sign contents on this branch
664 ** --date-override DATE DATE to use instead of 'now'
665 ** --user-override USER USER to use instead of the current default
666 **
667 ** DATE may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in
668
--- src/checkin.c
+++ src/checkin.c
@@ -2180,12 +2180,10 @@
21802180
** --allow-older Allow a commit older than its ancestor
21812181
** --baseline Use a baseline manifest in the commit process
21822182
** --bgcolor COLOR Apply COLOR to this one check-in only
21832183
** --branch NEW-BRANCH-NAME Check in to this new branch
21842184
** --branchcolor COLOR Apply given COLOR to the branch
2185
-** ("auto" lets Fossil choose it automatically,
2186
-** even for private branches)
21872185
** --close Close the branch being committed
21882186
** --date-override DATETIME DATE to use instead of 'now'
21892187
** --delta Use a delta manifest in the commit process
21902188
** --hash Verify file status using hashing rather
21912189
** than relying on file mtimes
@@ -2264,11 +2262,10 @@
22642262
int nConflict = 0; /* Number of unresolved merge conflicts */
22652263
int abortCommit = 0; /* Abort the commit due to text format conversions */
22662264
Blob ans; /* Answer to continuation prompts */
22672265
char cReply; /* First character of ans */
22682266
int bRecheck = 0; /* Repeat fork and closed-branch checks*/
2269
- int bAutoBrClr = 0; /* Value of "--branchcolor" is "auto" */
22702267
int bIgnoreSkew = 0; /* --ignore-clock-skew flag */
22712268
int mxSize;
22722269
22732270
memset(&sCiInfo, 0, sizeof(sCiInfo));
22742271
url_proxy_options();
@@ -2306,14 +2303,10 @@
23062303
noVerify = find_option("no-verify",0,0)!=0;
23072304
bTrace = find_option("trace",0,0)!=0;
23082305
sCiInfo.zBranch = find_option("branch","b",1);
23092306
sCiInfo.zColor = find_option("bgcolor",0,1);
23102307
sCiInfo.zBrClr = find_option("branchcolor",0,1);
2311
- if ( fossil_strncmp(sCiInfo.zBrClr, "auto", 4)==0 ) {
2312
- bAutoBrClr = 1;
2313
- sCiInfo.zBrClr = 0;
2314
- }
23152308
sCiInfo.closeFlag = find_option("close",0,0)!=0;
23162309
sCiInfo.integrateFlag = find_option("integrate",0,0)!=0;
23172310
sCiInfo.zMimetype = find_option("mimetype",0,1);
23182311
sCiInfo.verboseFlag = find_option("verbose", "v", 0)!=0;
23192312
while( (zTag = find_option("tag",0,1))!=0 ){
@@ -2351,13 +2344,10 @@
23512344
if( privateFlag && !privateParent ){
23522345
/* Apply default branch name ("private") and color ("orange") if not
23532346
** specified otherwise on the command-line, and if the parent is not
23542347
** already private. */
23552348
if( sCiInfo.zBranch==0 ) sCiInfo.zBranch = "private";
2356
- if( sCiInfo.zBrClr==0 && sCiInfo.zColor==0 && !bAutoBrClr) {
2357
- sCiInfo.zBrClr = "#fec084";
2358
- }
23592349
}
23602350
23612351
/* Do not allow the creation of a new branch using an existing open
23622352
** branch name unless the --force flag is used */
23632353
if( sCiInfo.zBranch!=0
23642354
--- src/checkin.c
+++ src/checkin.c
@@ -2180,12 +2180,10 @@
2180 ** --allow-older Allow a commit older than its ancestor
2181 ** --baseline Use a baseline manifest in the commit process
2182 ** --bgcolor COLOR Apply COLOR to this one check-in only
2183 ** --branch NEW-BRANCH-NAME Check in to this new branch
2184 ** --branchcolor COLOR Apply given COLOR to the branch
2185 ** ("auto" lets Fossil choose it automatically,
2186 ** even for private branches)
2187 ** --close Close the branch being committed
2188 ** --date-override DATETIME DATE to use instead of 'now'
2189 ** --delta Use a delta manifest in the commit process
2190 ** --hash Verify file status using hashing rather
2191 ** than relying on file mtimes
@@ -2264,11 +2262,10 @@
2264 int nConflict = 0; /* Number of unresolved merge conflicts */
2265 int abortCommit = 0; /* Abort the commit due to text format conversions */
2266 Blob ans; /* Answer to continuation prompts */
2267 char cReply; /* First character of ans */
2268 int bRecheck = 0; /* Repeat fork and closed-branch checks*/
2269 int bAutoBrClr = 0; /* Value of "--branchcolor" is "auto" */
2270 int bIgnoreSkew = 0; /* --ignore-clock-skew flag */
2271 int mxSize;
2272
2273 memset(&sCiInfo, 0, sizeof(sCiInfo));
2274 url_proxy_options();
@@ -2306,14 +2303,10 @@
2306 noVerify = find_option("no-verify",0,0)!=0;
2307 bTrace = find_option("trace",0,0)!=0;
2308 sCiInfo.zBranch = find_option("branch","b",1);
2309 sCiInfo.zColor = find_option("bgcolor",0,1);
2310 sCiInfo.zBrClr = find_option("branchcolor",0,1);
2311 if ( fossil_strncmp(sCiInfo.zBrClr, "auto", 4)==0 ) {
2312 bAutoBrClr = 1;
2313 sCiInfo.zBrClr = 0;
2314 }
2315 sCiInfo.closeFlag = find_option("close",0,0)!=0;
2316 sCiInfo.integrateFlag = find_option("integrate",0,0)!=0;
2317 sCiInfo.zMimetype = find_option("mimetype",0,1);
2318 sCiInfo.verboseFlag = find_option("verbose", "v", 0)!=0;
2319 while( (zTag = find_option("tag",0,1))!=0 ){
@@ -2351,13 +2344,10 @@
2351 if( privateFlag && !privateParent ){
2352 /* Apply default branch name ("private") and color ("orange") if not
2353 ** specified otherwise on the command-line, and if the parent is not
2354 ** already private. */
2355 if( sCiInfo.zBranch==0 ) sCiInfo.zBranch = "private";
2356 if( sCiInfo.zBrClr==0 && sCiInfo.zColor==0 && !bAutoBrClr) {
2357 sCiInfo.zBrClr = "#fec084";
2358 }
2359 }
2360
2361 /* Do not allow the creation of a new branch using an existing open
2362 ** branch name unless the --force flag is used */
2363 if( sCiInfo.zBranch!=0
2364
--- src/checkin.c
+++ src/checkin.c
@@ -2180,12 +2180,10 @@
2180 ** --allow-older Allow a commit older than its ancestor
2181 ** --baseline Use a baseline manifest in the commit process
2182 ** --bgcolor COLOR Apply COLOR to this one check-in only
2183 ** --branch NEW-BRANCH-NAME Check in to this new branch
2184 ** --branchcolor COLOR Apply given COLOR to the branch
 
 
2185 ** --close Close the branch being committed
2186 ** --date-override DATETIME DATE to use instead of 'now'
2187 ** --delta Use a delta manifest in the commit process
2188 ** --hash Verify file status using hashing rather
2189 ** than relying on file mtimes
@@ -2264,11 +2262,10 @@
2262 int nConflict = 0; /* Number of unresolved merge conflicts */
2263 int abortCommit = 0; /* Abort the commit due to text format conversions */
2264 Blob ans; /* Answer to continuation prompts */
2265 char cReply; /* First character of ans */
2266 int bRecheck = 0; /* Repeat fork and closed-branch checks*/
 
2267 int bIgnoreSkew = 0; /* --ignore-clock-skew flag */
2268 int mxSize;
2269
2270 memset(&sCiInfo, 0, sizeof(sCiInfo));
2271 url_proxy_options();
@@ -2306,14 +2303,10 @@
2303 noVerify = find_option("no-verify",0,0)!=0;
2304 bTrace = find_option("trace",0,0)!=0;
2305 sCiInfo.zBranch = find_option("branch","b",1);
2306 sCiInfo.zColor = find_option("bgcolor",0,1);
2307 sCiInfo.zBrClr = find_option("branchcolor",0,1);
 
 
 
 
2308 sCiInfo.closeFlag = find_option("close",0,0)!=0;
2309 sCiInfo.integrateFlag = find_option("integrate",0,0)!=0;
2310 sCiInfo.zMimetype = find_option("mimetype",0,1);
2311 sCiInfo.verboseFlag = find_option("verbose", "v", 0)!=0;
2312 while( (zTag = find_option("tag",0,1))!=0 ){
@@ -2351,13 +2344,10 @@
2344 if( privateFlag && !privateParent ){
2345 /* Apply default branch name ("private") and color ("orange") if not
2346 ** specified otherwise on the command-line, and if the parent is not
2347 ** already private. */
2348 if( sCiInfo.zBranch==0 ) sCiInfo.zBranch = "private";
 
 
 
2349 }
2350
2351 /* Do not allow the creation of a new branch using an existing open
2352 ** branch name unless the --force flag is used */
2353 if( sCiInfo.zBranch!=0
2354
--- src/json_branch.c
+++ src/json_branch.c
@@ -197,16 +197,11 @@
197197
char *zDate; /* Date that branch was created */
198198
char *zComment; /* Check-in comment for the new branch */
199199
Blob branch; /* manifest for the new branch */
200200
Manifest *pParent; /* Parsed parent manifest */
201201
Blob mcksum; /* Self-checksum on the manifest */
202
- int bAutoColor = 0; /* Value of "--bgcolor" is "auto" */
203202
204
- if( fossil_strncmp(zColor, "auto", 4)==0 ) {
205
- bAutoColor = 1;
206
- zColor = 0;
207
- }
208203
/* fossil branch new name */
209204
if( zBranch==0 || zBranch[0]==0 ){
210205
zOpt->rcErrMsg = "Branch name may not be null/empty.";
211206
return FSL_JSON_E_INVALID_ARGS;
212207
}
@@ -265,11 +260,10 @@
265260
manifest_destroy(pParent);
266261
267262
/* Add the symbolic branch name and the "branch" tag to identify
268263
** this as a new branch */
269264
if( content_is_private(rootid) ) zOpt->isPrivate = 1;
270
- if( zOpt->isPrivate && zColor==0 && !bAutoColor) zColor = "#fec084";
271265
if( zColor!=0 ){
272266
blob_appendf(&branch, "T *bgcolor * %F\n", zColor);
273267
}
274268
blob_appendf(&branch, "T *branch * %F\n", zBranch);
275269
blob_appendf(&branch, "T *sym-%F *\n", zBranch);
276270
--- src/json_branch.c
+++ src/json_branch.c
@@ -197,16 +197,11 @@
197 char *zDate; /* Date that branch was created */
198 char *zComment; /* Check-in comment for the new branch */
199 Blob branch; /* manifest for the new branch */
200 Manifest *pParent; /* Parsed parent manifest */
201 Blob mcksum; /* Self-checksum on the manifest */
202 int bAutoColor = 0; /* Value of "--bgcolor" is "auto" */
203
204 if( fossil_strncmp(zColor, "auto", 4)==0 ) {
205 bAutoColor = 1;
206 zColor = 0;
207 }
208 /* fossil branch new name */
209 if( zBranch==0 || zBranch[0]==0 ){
210 zOpt->rcErrMsg = "Branch name may not be null/empty.";
211 return FSL_JSON_E_INVALID_ARGS;
212 }
@@ -265,11 +260,10 @@
265 manifest_destroy(pParent);
266
267 /* Add the symbolic branch name and the "branch" tag to identify
268 ** this as a new branch */
269 if( content_is_private(rootid) ) zOpt->isPrivate = 1;
270 if( zOpt->isPrivate && zColor==0 && !bAutoColor) zColor = "#fec084";
271 if( zColor!=0 ){
272 blob_appendf(&branch, "T *bgcolor * %F\n", zColor);
273 }
274 blob_appendf(&branch, "T *branch * %F\n", zBranch);
275 blob_appendf(&branch, "T *sym-%F *\n", zBranch);
276
--- src/json_branch.c
+++ src/json_branch.c
@@ -197,16 +197,11 @@
197 char *zDate; /* Date that branch was created */
198 char *zComment; /* Check-in comment for the new branch */
199 Blob branch; /* manifest for the new branch */
200 Manifest *pParent; /* Parsed parent manifest */
201 Blob mcksum; /* Self-checksum on the manifest */
 
202
 
 
 
 
203 /* fossil branch new name */
204 if( zBranch==0 || zBranch[0]==0 ){
205 zOpt->rcErrMsg = "Branch name may not be null/empty.";
206 return FSL_JSON_E_INVALID_ARGS;
207 }
@@ -265,11 +260,10 @@
260 manifest_destroy(pParent);
261
262 /* Add the symbolic branch name and the "branch" tag to identify
263 ** this as a new branch */
264 if( content_is_private(rootid) ) zOpt->isPrivate = 1;
 
265 if( zColor!=0 ){
266 blob_appendf(&branch, "T *bgcolor * %F\n", zColor);
267 }
268 blob_appendf(&branch, "T *branch * %F\n", zBranch);
269 blob_appendf(&branch, "T *sym-%F *\n", zBranch);
270

Keyboard Shortcuts

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