Fossil SCM
Rename policy setting for private merges to 'unpublished.'
Commit
f2322d90447b4f65a8bf1dc121a50c980b44197dedb974c089eea48197548375
Parent
1b010f01793b9e6…
1 file changed
+8
-9
+8
-9
| --- src/warnpolicy.c | ||
| +++ src/warnpolicy.c | ||
| @@ -28,22 +28,21 @@ | ||
| 28 | 28 | ** |
| 29 | 29 | ** commit: Used when committing. A list of objects with names in |
| 30 | 30 | ** (message, branch, except-branch, users, except-users). |
| 31 | 31 | ** merge: Used when merging. A List of objects with names in |
| 32 | 32 | ** (message, branch, except-branch, from, except-from, |
| 33 | -** users, except-users, history-loss). | |
| 33 | +** users, except-users, unpublished). | |
| 34 | 34 | ** match-style: If "regexp", patterns use REGEXP, otherwise GLOB. |
| 35 | 35 | ** |
| 36 | 36 | ** Meaning of names used in lists above: |
| 37 | 37 | ** |
| 38 | 38 | ** message: MESSAGE Required: Message to show. |
| 39 | 39 | ** branch: PATTERN Apply branch match PATTERN (default any). |
| 40 | 40 | ** except-branch: PATTERN Exclude when in a branch matching PATTERN. |
| 41 | 41 | ** from: PATTERN Apply if merging from PATTERN (default any). |
| 42 | 42 | ** except-from: PATTERN Exclude when merging from PATTERN. |
| 43 | -** history-loss: true If true, only show message when history loss | |
| 44 | -** would occur; that is, when merging a private | |
| 43 | +** unpublished: true If true, only show when merging from a private | |
| 45 | 44 | ** branch into a public branch. |
| 46 | 45 | ** users: LIST Show only for users in LIST (default any). |
| 47 | 46 | ** except-users: LIST Users in LIST will not be shown the messages. |
| 48 | 47 | ** |
| 49 | 48 | ** Example: |
| @@ -53,13 +52,13 @@ | ||
| 53 | 52 | ** { "message": "Release pending, proceed with caution.", |
| 54 | 53 | ** "branch": "trunk", |
| 55 | 54 | ** "except-users": [ "owner", "admin" ] } |
| 56 | 55 | ** ], |
| 57 | 56 | ** "merge": [ |
| 58 | -** { "message": "Please 'fossil publish' before merging private to public", | |
| 57 | +** { "message": "Please use 'fossil publish' before merging private to public", | |
| 59 | 58 | ** "except-branch": "rebased-branch-*", |
| 60 | -** "history-loss": true }, | |
| 59 | +** "unpublished": true }, | |
| 61 | 60 | ** { "message": "Updates to release branches should be merged from rc.", |
| 62 | 61 | ** "branch": "release-*", |
| 63 | 62 | ** "except-from": "rc-*" } |
| 64 | 63 | ** ] |
| 65 | 64 | ** } |
| @@ -172,12 +171,12 @@ | ||
| 172 | 171 | zFrom, zMatch, zFrom, zMatch, |
| 173 | 172 | g.zLogin, g.zLogin |
| 174 | 173 | ); |
| 175 | 174 | if( !historyLoss ){ |
| 176 | 175 | blob_append_sql(&sql, |
| 177 | - " AND (elm->>'history-loss' IS NULL" | |
| 178 | - " OR NOT elm->>'history-loss')" | |
| 176 | + " AND (elm->>'unpublished' IS NULL" | |
| 177 | + " OR NOT elm->>'unpublished')" | |
| 179 | 178 | ); |
| 180 | 179 | } |
| 181 | 180 | nWarnings = print_policy_warnings(&sql); |
| 182 | 181 | blob_reset(&sql); |
| 183 | 182 | return nWarnings; |
| @@ -197,11 +196,11 @@ | ||
| 197 | 196 | ** -b|--branch BRANCH Test commit to BRANCH. |
| 198 | 197 | ** |
| 199 | 198 | ** Options for "merge" event: |
| 200 | 199 | ** -b|--branch BRANCH Test merge to BRANCH. |
| 201 | 200 | ** -f|--from BRANCH Test merge from BRANCH. |
| 202 | -** -hl|--history-loss Test merging from a private to a public branch. | |
| 201 | +** -u|--unpublished Test merging from a private to a public branch. | |
| 203 | 202 | */ |
| 204 | 203 | void test_warning_policy_cmd(void){ |
| 205 | 204 | const char *zEvent; |
| 206 | 205 | const char *zJSON; |
| 207 | 206 | |
| @@ -229,11 +228,11 @@ | ||
| 229 | 228 | verify_all_options(); |
| 230 | 229 | issue_commit_warnings(zBranch); |
| 231 | 230 | }else if( fossil_strcmp(zEvent, "merge")==0 ){ |
| 232 | 231 | const char *zBranch = find_option("branch", "b", 1); |
| 233 | 232 | const char *zFrom = find_option("from", "f", 1); |
| 234 | - int historyLoss = find_option("history-loss", "hl", 0)!=0; | |
| 233 | + int historyLoss = find_option("unpublished", "u", 0)!=0; | |
| 235 | 234 | if( zBranch==0 ) fossil_fatal("%s: missing --branch option", zEvent); |
| 236 | 235 | if( zFrom==0 ) fossil_fatal("%s: missing --from option", zEvent); |
| 237 | 236 | verify_all_options(); |
| 238 | 237 | issue_merge_warnings(zBranch, zFrom, historyLoss); |
| 239 | 238 | }else{ |
| 240 | 239 |
| --- src/warnpolicy.c | |
| +++ src/warnpolicy.c | |
| @@ -28,22 +28,21 @@ | |
| 28 | ** |
| 29 | ** commit: Used when committing. A list of objects with names in |
| 30 | ** (message, branch, except-branch, users, except-users). |
| 31 | ** merge: Used when merging. A List of objects with names in |
| 32 | ** (message, branch, except-branch, from, except-from, |
| 33 | ** users, except-users, history-loss). |
| 34 | ** match-style: If "regexp", patterns use REGEXP, otherwise GLOB. |
| 35 | ** |
| 36 | ** Meaning of names used in lists above: |
| 37 | ** |
| 38 | ** message: MESSAGE Required: Message to show. |
| 39 | ** branch: PATTERN Apply branch match PATTERN (default any). |
| 40 | ** except-branch: PATTERN Exclude when in a branch matching PATTERN. |
| 41 | ** from: PATTERN Apply if merging from PATTERN (default any). |
| 42 | ** except-from: PATTERN Exclude when merging from PATTERN. |
| 43 | ** history-loss: true If true, only show message when history loss |
| 44 | ** would occur; that is, when merging a private |
| 45 | ** branch into a public branch. |
| 46 | ** users: LIST Show only for users in LIST (default any). |
| 47 | ** except-users: LIST Users in LIST will not be shown the messages. |
| 48 | ** |
| 49 | ** Example: |
| @@ -53,13 +52,13 @@ | |
| 53 | ** { "message": "Release pending, proceed with caution.", |
| 54 | ** "branch": "trunk", |
| 55 | ** "except-users": [ "owner", "admin" ] } |
| 56 | ** ], |
| 57 | ** "merge": [ |
| 58 | ** { "message": "Please 'fossil publish' before merging private to public", |
| 59 | ** "except-branch": "rebased-branch-*", |
| 60 | ** "history-loss": true }, |
| 61 | ** { "message": "Updates to release branches should be merged from rc.", |
| 62 | ** "branch": "release-*", |
| 63 | ** "except-from": "rc-*" } |
| 64 | ** ] |
| 65 | ** } |
| @@ -172,12 +171,12 @@ | |
| 172 | zFrom, zMatch, zFrom, zMatch, |
| 173 | g.zLogin, g.zLogin |
| 174 | ); |
| 175 | if( !historyLoss ){ |
| 176 | blob_append_sql(&sql, |
| 177 | " AND (elm->>'history-loss' IS NULL" |
| 178 | " OR NOT elm->>'history-loss')" |
| 179 | ); |
| 180 | } |
| 181 | nWarnings = print_policy_warnings(&sql); |
| 182 | blob_reset(&sql); |
| 183 | return nWarnings; |
| @@ -197,11 +196,11 @@ | |
| 197 | ** -b|--branch BRANCH Test commit to BRANCH. |
| 198 | ** |
| 199 | ** Options for "merge" event: |
| 200 | ** -b|--branch BRANCH Test merge to BRANCH. |
| 201 | ** -f|--from BRANCH Test merge from BRANCH. |
| 202 | ** -hl|--history-loss Test merging from a private to a public branch. |
| 203 | */ |
| 204 | void test_warning_policy_cmd(void){ |
| 205 | const char *zEvent; |
| 206 | const char *zJSON; |
| 207 | |
| @@ -229,11 +228,11 @@ | |
| 229 | verify_all_options(); |
| 230 | issue_commit_warnings(zBranch); |
| 231 | }else if( fossil_strcmp(zEvent, "merge")==0 ){ |
| 232 | const char *zBranch = find_option("branch", "b", 1); |
| 233 | const char *zFrom = find_option("from", "f", 1); |
| 234 | int historyLoss = find_option("history-loss", "hl", 0)!=0; |
| 235 | if( zBranch==0 ) fossil_fatal("%s: missing --branch option", zEvent); |
| 236 | if( zFrom==0 ) fossil_fatal("%s: missing --from option", zEvent); |
| 237 | verify_all_options(); |
| 238 | issue_merge_warnings(zBranch, zFrom, historyLoss); |
| 239 | }else{ |
| 240 |
| --- src/warnpolicy.c | |
| +++ src/warnpolicy.c | |
| @@ -28,22 +28,21 @@ | |
| 28 | ** |
| 29 | ** commit: Used when committing. A list of objects with names in |
| 30 | ** (message, branch, except-branch, users, except-users). |
| 31 | ** merge: Used when merging. A List of objects with names in |
| 32 | ** (message, branch, except-branch, from, except-from, |
| 33 | ** users, except-users, unpublished). |
| 34 | ** match-style: If "regexp", patterns use REGEXP, otherwise GLOB. |
| 35 | ** |
| 36 | ** Meaning of names used in lists above: |
| 37 | ** |
| 38 | ** message: MESSAGE Required: Message to show. |
| 39 | ** branch: PATTERN Apply branch match PATTERN (default any). |
| 40 | ** except-branch: PATTERN Exclude when in a branch matching PATTERN. |
| 41 | ** from: PATTERN Apply if merging from PATTERN (default any). |
| 42 | ** except-from: PATTERN Exclude when merging from PATTERN. |
| 43 | ** unpublished: true If true, only show when merging from a private |
| 44 | ** branch into a public branch. |
| 45 | ** users: LIST Show only for users in LIST (default any). |
| 46 | ** except-users: LIST Users in LIST will not be shown the messages. |
| 47 | ** |
| 48 | ** Example: |
| @@ -53,13 +52,13 @@ | |
| 52 | ** { "message": "Release pending, proceed with caution.", |
| 53 | ** "branch": "trunk", |
| 54 | ** "except-users": [ "owner", "admin" ] } |
| 55 | ** ], |
| 56 | ** "merge": [ |
| 57 | ** { "message": "Please use 'fossil publish' before merging private to public", |
| 58 | ** "except-branch": "rebased-branch-*", |
| 59 | ** "unpublished": true }, |
| 60 | ** { "message": "Updates to release branches should be merged from rc.", |
| 61 | ** "branch": "release-*", |
| 62 | ** "except-from": "rc-*" } |
| 63 | ** ] |
| 64 | ** } |
| @@ -172,12 +171,12 @@ | |
| 171 | zFrom, zMatch, zFrom, zMatch, |
| 172 | g.zLogin, g.zLogin |
| 173 | ); |
| 174 | if( !historyLoss ){ |
| 175 | blob_append_sql(&sql, |
| 176 | " AND (elm->>'unpublished' IS NULL" |
| 177 | " OR NOT elm->>'unpublished')" |
| 178 | ); |
| 179 | } |
| 180 | nWarnings = print_policy_warnings(&sql); |
| 181 | blob_reset(&sql); |
| 182 | return nWarnings; |
| @@ -197,11 +196,11 @@ | |
| 196 | ** -b|--branch BRANCH Test commit to BRANCH. |
| 197 | ** |
| 198 | ** Options for "merge" event: |
| 199 | ** -b|--branch BRANCH Test merge to BRANCH. |
| 200 | ** -f|--from BRANCH Test merge from BRANCH. |
| 201 | ** -u|--unpublished Test merging from a private to a public branch. |
| 202 | */ |
| 203 | void test_warning_policy_cmd(void){ |
| 204 | const char *zEvent; |
| 205 | const char *zJSON; |
| 206 | |
| @@ -229,11 +228,11 @@ | |
| 228 | verify_all_options(); |
| 229 | issue_commit_warnings(zBranch); |
| 230 | }else if( fossil_strcmp(zEvent, "merge")==0 ){ |
| 231 | const char *zBranch = find_option("branch", "b", 1); |
| 232 | const char *zFrom = find_option("from", "f", 1); |
| 233 | int historyLoss = find_option("unpublished", "u", 0)!=0; |
| 234 | if( zBranch==0 ) fossil_fatal("%s: missing --branch option", zEvent); |
| 235 | if( zFrom==0 ) fossil_fatal("%s: missing --from option", zEvent); |
| 236 | verify_all_options(); |
| 237 | issue_merge_warnings(zBranch, zFrom, historyLoss); |
| 238 | }else{ |
| 239 |