Fossil SCM
Improved help text for the autosync setting.
Commit
19d7c5ff7b2f48f6373e85b38d1746cd4bd8b75c8b015155c8b94ffbe02e55d2
Parent
241ade812bebdbc…
2 files changed
+9
-4
+4
-2
M
src/db.c
+9
-4
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -3807,15 +3807,20 @@ | ||
| 3807 | 3807 | ** If enabled, automatically pull the shunning list |
| 3808 | 3808 | ** from a server to which the client autosyncs. |
| 3809 | 3809 | */ |
| 3810 | 3810 | /* |
| 3811 | 3811 | ** SETTING: autosync width=16 default=on |
| 3812 | -** This setting can take either a boolean value or "pullonly" | |
| 3813 | -** If enabled, automatically pull prior to commit | |
| 3812 | +** This setting can be a boolean value (0, 1, on, off, true, false) | |
| 3813 | +** or "pullonly" or "all". | |
| 3814 | +** | |
| 3815 | +** If not false, automatically pull prior to commit | |
| 3814 | 3816 | ** or update and automatically push after commit or |
| 3815 | -** tag or branch creation. If the value is "pullonly" | |
| 3816 | -** then only pull operations occur automatically. | |
| 3817 | +** tag or branch creation. Except, if the value is | |
| 3818 | +** "pullonly" then only pull operations occur automatically. | |
| 3819 | +** Normally, only the default remote is used, but if the | |
| 3820 | +** value is "all" then push/pull operations occur on all | |
| 3821 | +** remotes. | |
| 3817 | 3822 | */ |
| 3818 | 3823 | /* |
| 3819 | 3824 | ** SETTING: autosync-tries width=16 default=1 |
| 3820 | 3825 | ** If autosync is enabled setting this to a value greater |
| 3821 | 3826 | ** than zero will cause autosync to try no more than this |
| 3822 | 3827 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -3807,15 +3807,20 @@ | |
| 3807 | ** If enabled, automatically pull the shunning list |
| 3808 | ** from a server to which the client autosyncs. |
| 3809 | */ |
| 3810 | /* |
| 3811 | ** SETTING: autosync width=16 default=on |
| 3812 | ** This setting can take either a boolean value or "pullonly" |
| 3813 | ** If enabled, automatically pull prior to commit |
| 3814 | ** or update and automatically push after commit or |
| 3815 | ** tag or branch creation. If the value is "pullonly" |
| 3816 | ** then only pull operations occur automatically. |
| 3817 | */ |
| 3818 | /* |
| 3819 | ** SETTING: autosync-tries width=16 default=1 |
| 3820 | ** If autosync is enabled setting this to a value greater |
| 3821 | ** than zero will cause autosync to try no more than this |
| 3822 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -3807,15 +3807,20 @@ | |
| 3807 | ** If enabled, automatically pull the shunning list |
| 3808 | ** from a server to which the client autosyncs. |
| 3809 | */ |
| 3810 | /* |
| 3811 | ** SETTING: autosync width=16 default=on |
| 3812 | ** This setting can be a boolean value (0, 1, on, off, true, false) |
| 3813 | ** or "pullonly" or "all". |
| 3814 | ** |
| 3815 | ** If not false, automatically pull prior to commit |
| 3816 | ** or update and automatically push after commit or |
| 3817 | ** tag or branch creation. Except, if the value is |
| 3818 | ** "pullonly" then only pull operations occur automatically. |
| 3819 | ** Normally, only the default remote is used, but if the |
| 3820 | ** value is "all" then push/pull operations occur on all |
| 3821 | ** remotes. |
| 3822 | */ |
| 3823 | /* |
| 3824 | ** SETTING: autosync-tries width=16 default=1 |
| 3825 | ** If autosync is enabled setting this to a value greater |
| 3826 | ** than zero will cause autosync to try no more than this |
| 3827 |
+4
-2
| --- src/sync.c | ||
| +++ src/sync.c | ||
| @@ -121,11 +121,13 @@ | ||
| 121 | 121 | return 0; |
| 122 | 122 | } |
| 123 | 123 | zAutosync = db_get("autosync", 0); |
| 124 | 124 | if( zAutosync==0 ) zAutosync = "on"; /* defend against misconfig */ |
| 125 | 125 | if( is_false(zAutosync) ) return 0; |
| 126 | - if( db_get_boolean("dont-push",0) || fossil_strncmp(zAutosync,"pull",4)==0 ){ | |
| 126 | + if( db_get_boolean("dont-push",0) | |
| 127 | + || sqlite3_strglob("*pull*", zAutosync)==0 | |
| 128 | + ){ | |
| 127 | 129 | flags &= ~SYNC_CKIN_LOCK; |
| 128 | 130 | if( flags & SYNC_PUSH ) return 0; |
| 129 | 131 | } |
| 130 | 132 | if( find_option("verbose","v",0)!=0 ) flags |= SYNC_VERBOSE; |
| 131 | 133 | url_parse(0, URL_REMEMBER); |
| @@ -134,11 +136,11 @@ | ||
| 134 | 136 | g.url.passwd = unobscure(db_get("last-sync-pw", 0)); |
| 135 | 137 | g.url.flags |= URL_PROMPT_PW; |
| 136 | 138 | url_prompt_for_password(); |
| 137 | 139 | } |
| 138 | 140 | g.zHttpAuth = get_httpauth(); |
| 139 | - if( fossil_strcmp(zAutosync,"all")==0 ){ | |
| 141 | + if( sqlite3_strglob("*all*", zAutosync)==0 ){ | |
| 140 | 142 | rc = client_sync_all_urls(flags|SYNC_ALLURL, configSync, 0, 0); |
| 141 | 143 | }else{ |
| 142 | 144 | url_remember(); |
| 143 | 145 | sync_explain(flags); |
| 144 | 146 | url_enable_proxy("via proxy: "); |
| 145 | 147 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -121,11 +121,13 @@ | |
| 121 | return 0; |
| 122 | } |
| 123 | zAutosync = db_get("autosync", 0); |
| 124 | if( zAutosync==0 ) zAutosync = "on"; /* defend against misconfig */ |
| 125 | if( is_false(zAutosync) ) return 0; |
| 126 | if( db_get_boolean("dont-push",0) || fossil_strncmp(zAutosync,"pull",4)==0 ){ |
| 127 | flags &= ~SYNC_CKIN_LOCK; |
| 128 | if( flags & SYNC_PUSH ) return 0; |
| 129 | } |
| 130 | if( find_option("verbose","v",0)!=0 ) flags |= SYNC_VERBOSE; |
| 131 | url_parse(0, URL_REMEMBER); |
| @@ -134,11 +136,11 @@ | |
| 134 | g.url.passwd = unobscure(db_get("last-sync-pw", 0)); |
| 135 | g.url.flags |= URL_PROMPT_PW; |
| 136 | url_prompt_for_password(); |
| 137 | } |
| 138 | g.zHttpAuth = get_httpauth(); |
| 139 | if( fossil_strcmp(zAutosync,"all")==0 ){ |
| 140 | rc = client_sync_all_urls(flags|SYNC_ALLURL, configSync, 0, 0); |
| 141 | }else{ |
| 142 | url_remember(); |
| 143 | sync_explain(flags); |
| 144 | url_enable_proxy("via proxy: "); |
| 145 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -121,11 +121,13 @@ | |
| 121 | return 0; |
| 122 | } |
| 123 | zAutosync = db_get("autosync", 0); |
| 124 | if( zAutosync==0 ) zAutosync = "on"; /* defend against misconfig */ |
| 125 | if( is_false(zAutosync) ) return 0; |
| 126 | if( db_get_boolean("dont-push",0) |
| 127 | || sqlite3_strglob("*pull*", zAutosync)==0 |
| 128 | ){ |
| 129 | flags &= ~SYNC_CKIN_LOCK; |
| 130 | if( flags & SYNC_PUSH ) return 0; |
| 131 | } |
| 132 | if( find_option("verbose","v",0)!=0 ) flags |= SYNC_VERBOSE; |
| 133 | url_parse(0, URL_REMEMBER); |
| @@ -134,11 +136,11 @@ | |
| 136 | g.url.passwd = unobscure(db_get("last-sync-pw", 0)); |
| 137 | g.url.flags |= URL_PROMPT_PW; |
| 138 | url_prompt_for_password(); |
| 139 | } |
| 140 | g.zHttpAuth = get_httpauth(); |
| 141 | if( sqlite3_strglob("*all*", zAutosync)==0 ){ |
| 142 | rc = client_sync_all_urls(flags|SYNC_ALLURL, configSync, 0, 0); |
| 143 | }else{ |
| 144 | url_remember(); |
| 145 | sync_explain(flags); |
| 146 | url_enable_proxy("via proxy: "); |
| 147 |