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.
Commit
08dadf3fe42514ce210af324baea27ef85b07c9f15d8348efe4890f10a3a64e1
Parent
30f18ce13012aea…
3 files changed
-8
-10
-6
-8
| --- src/branch.c | ||
| +++ src/branch.c | ||
| @@ -81,18 +81,13 @@ | ||
| 81 | 81 | Manifest *pParent; /* Parsed parent manifest */ |
| 82 | 82 | Blob mcksum; /* Self-checksum on the manifest */ |
| 83 | 83 | const char *zDateOvrd; /* Override date string */ |
| 84 | 84 | const char *zUserOvrd; /* Override user name */ |
| 85 | 85 | int isPrivate = 0; /* True if the branch should be private */ |
| 86 | - int bAutoColor = 0; /* Value of "--bgcolor" is "auto" */ | |
| 87 | 86 | |
| 88 | 87 | noSign = find_option("nosign","",0)!=0; |
| 89 | 88 | zColor = find_option("bgcolor","c",1); |
| 90 | - if( fossil_strncmp(zColor, "auto", 4)==0 ) { | |
| 91 | - bAutoColor = 1; | |
| 92 | - zColor = 0; | |
| 93 | - } | |
| 94 | 89 | isPrivate = find_option("private",0,0)!=0; |
| 95 | 90 | zDateOvrd = find_option("date-override",0,1); |
| 96 | 91 | zUserOvrd = find_option("user-override",0,1); |
| 97 | 92 | verify_all_options(); |
| 98 | 93 | if( g.argc<5 ){ |
| @@ -152,11 +147,10 @@ | ||
| 152 | 147 | manifest_destroy(pParent); |
| 153 | 148 | |
| 154 | 149 | /* Add the symbolic branch name and the "branch" tag to identify |
| 155 | 150 | ** this as a new branch */ |
| 156 | 151 | if( content_is_private(rootid) ) isPrivate = 1; |
| 157 | - if( isPrivate && zColor==0 && !bAutoColor) zColor = "#fec084"; | |
| 158 | 152 | if( zColor!=0 ){ |
| 159 | 153 | blob_appendf(&branch, "T *bgcolor * %F\n", zColor); |
| 160 | 154 | } |
| 161 | 155 | blob_appendf(&branch, "T *branch * %F\n", zBranch); |
| 162 | 156 | blob_appendf(&branch, "T *sym-%F *\n", zBranch); |
| @@ -664,12 +658,10 @@ | ||
| 664 | 658 | ** Create a new branch BRANCH-NAME off of check-in BASIS. |
| 665 | 659 | ** |
| 666 | 660 | ** Options: |
| 667 | 661 | ** --private Branch is private (i.e., remains local) |
| 668 | 662 | ** --bgcolor COLOR Use COLOR instead of automatic background |
| 669 | -** ("auto" lets Fossil choose it automatically, | |
| 670 | -** even for private branches) | |
| 671 | 663 | ** --nosign Do not sign contents on this branch |
| 672 | 664 | ** --date-override DATE DATE to use instead of 'now' |
| 673 | 665 | ** --user-override USER USER to use instead of the current default |
| 674 | 666 | ** |
| 675 | 667 | ** DATE may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in |
| 676 | 668 |
| --- 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 |
-10
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -2180,12 +2180,10 @@ | ||
| 2180 | 2180 | ** --allow-older Allow a commit older than its ancestor |
| 2181 | 2181 | ** --baseline Use a baseline manifest in the commit process |
| 2182 | 2182 | ** --bgcolor COLOR Apply COLOR to this one check-in only |
| 2183 | 2183 | ** --branch NEW-BRANCH-NAME Check in to this new branch |
| 2184 | 2184 | ** --branchcolor COLOR Apply given COLOR to the branch |
| 2185 | -** ("auto" lets Fossil choose it automatically, | |
| 2186 | -** even for private branches) | |
| 2187 | 2185 | ** --close Close the branch being committed |
| 2188 | 2186 | ** --date-override DATETIME DATE to use instead of 'now' |
| 2189 | 2187 | ** --delta Use a delta manifest in the commit process |
| 2190 | 2188 | ** --hash Verify file status using hashing rather |
| 2191 | 2189 | ** than relying on file mtimes |
| @@ -2264,11 +2262,10 @@ | ||
| 2264 | 2262 | int nConflict = 0; /* Number of unresolved merge conflicts */ |
| 2265 | 2263 | int abortCommit = 0; /* Abort the commit due to text format conversions */ |
| 2266 | 2264 | Blob ans; /* Answer to continuation prompts */ |
| 2267 | 2265 | char cReply; /* First character of ans */ |
| 2268 | 2266 | int bRecheck = 0; /* Repeat fork and closed-branch checks*/ |
| 2269 | - int bAutoBrClr = 0; /* Value of "--branchcolor" is "auto" */ | |
| 2270 | 2267 | int bIgnoreSkew = 0; /* --ignore-clock-skew flag */ |
| 2271 | 2268 | int mxSize; |
| 2272 | 2269 | |
| 2273 | 2270 | memset(&sCiInfo, 0, sizeof(sCiInfo)); |
| 2274 | 2271 | url_proxy_options(); |
| @@ -2306,14 +2303,10 @@ | ||
| 2306 | 2303 | noVerify = find_option("no-verify",0,0)!=0; |
| 2307 | 2304 | bTrace = find_option("trace",0,0)!=0; |
| 2308 | 2305 | sCiInfo.zBranch = find_option("branch","b",1); |
| 2309 | 2306 | sCiInfo.zColor = find_option("bgcolor",0,1); |
| 2310 | 2307 | 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 | 2308 | sCiInfo.closeFlag = find_option("close",0,0)!=0; |
| 2316 | 2309 | sCiInfo.integrateFlag = find_option("integrate",0,0)!=0; |
| 2317 | 2310 | sCiInfo.zMimetype = find_option("mimetype",0,1); |
| 2318 | 2311 | sCiInfo.verboseFlag = find_option("verbose", "v", 0)!=0; |
| 2319 | 2312 | while( (zTag = find_option("tag",0,1))!=0 ){ |
| @@ -2351,13 +2344,10 @@ | ||
| 2351 | 2344 | if( privateFlag && !privateParent ){ |
| 2352 | 2345 | /* Apply default branch name ("private") and color ("orange") if not |
| 2353 | 2346 | ** specified otherwise on the command-line, and if the parent is not |
| 2354 | 2347 | ** already private. */ |
| 2355 | 2348 | if( sCiInfo.zBranch==0 ) sCiInfo.zBranch = "private"; |
| 2356 | - if( sCiInfo.zBrClr==0 && sCiInfo.zColor==0 && !bAutoBrClr) { | |
| 2357 | - sCiInfo.zBrClr = "#fec084"; | |
| 2358 | - } | |
| 2359 | 2349 | } |
| 2360 | 2350 | |
| 2361 | 2351 | /* Do not allow the creation of a new branch using an existing open |
| 2362 | 2352 | ** branch name unless the --force flag is used */ |
| 2363 | 2353 | if( sCiInfo.zBranch!=0 |
| 2364 | 2354 |
| --- 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 |
-6
| --- src/json_branch.c | ||
| +++ src/json_branch.c | ||
| @@ -197,16 +197,11 @@ | ||
| 197 | 197 | char *zDate; /* Date that branch was created */ |
| 198 | 198 | char *zComment; /* Check-in comment for the new branch */ |
| 199 | 199 | Blob branch; /* manifest for the new branch */ |
| 200 | 200 | Manifest *pParent; /* Parsed parent manifest */ |
| 201 | 201 | Blob mcksum; /* Self-checksum on the manifest */ |
| 202 | - int bAutoColor = 0; /* Value of "--bgcolor" is "auto" */ | |
| 203 | 202 | |
| 204 | - if( fossil_strncmp(zColor, "auto", 4)==0 ) { | |
| 205 | - bAutoColor = 1; | |
| 206 | - zColor = 0; | |
| 207 | - } | |
| 208 | 203 | /* fossil branch new name */ |
| 209 | 204 | if( zBranch==0 || zBranch[0]==0 ){ |
| 210 | 205 | zOpt->rcErrMsg = "Branch name may not be null/empty."; |
| 211 | 206 | return FSL_JSON_E_INVALID_ARGS; |
| 212 | 207 | } |
| @@ -265,11 +260,10 @@ | ||
| 265 | 260 | manifest_destroy(pParent); |
| 266 | 261 | |
| 267 | 262 | /* Add the symbolic branch name and the "branch" tag to identify |
| 268 | 263 | ** this as a new branch */ |
| 269 | 264 | if( content_is_private(rootid) ) zOpt->isPrivate = 1; |
| 270 | - if( zOpt->isPrivate && zColor==0 && !bAutoColor) zColor = "#fec084"; | |
| 271 | 265 | if( zColor!=0 ){ |
| 272 | 266 | blob_appendf(&branch, "T *bgcolor * %F\n", zColor); |
| 273 | 267 | } |
| 274 | 268 | blob_appendf(&branch, "T *branch * %F\n", zBranch); |
| 275 | 269 | blob_appendf(&branch, "T *sym-%F *\n", zBranch); |
| 276 | 270 |
| --- 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 |