Fossil SCM

Improved help text for the autosync setting.

drh 2021-10-25 10:09 trunk
Commit 19d7c5ff7b2f48f6373e85b38d1746cd4bd8b75c8b015155c8b94ffbe02e55d2
2 files changed +9 -4 +4 -2
+9 -4
--- src/db.c
+++ src/db.c
@@ -3807,15 +3807,20 @@
38073807
** If enabled, automatically pull the shunning list
38083808
** from a server to which the client autosyncs.
38093809
*/
38103810
/*
38113811
** 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
38143816
** 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.
38173822
*/
38183823
/*
38193824
** SETTING: autosync-tries width=16 default=1
38203825
** If autosync is enabled setting this to a value greater
38213826
** than zero will cause autosync to try no more than this
38223827
--- 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 @@
121121
return 0;
122122
}
123123
zAutosync = db_get("autosync", 0);
124124
if( zAutosync==0 ) zAutosync = "on"; /* defend against misconfig */
125125
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
+ ){
127129
flags &= ~SYNC_CKIN_LOCK;
128130
if( flags & SYNC_PUSH ) return 0;
129131
}
130132
if( find_option("verbose","v",0)!=0 ) flags |= SYNC_VERBOSE;
131133
url_parse(0, URL_REMEMBER);
@@ -134,11 +136,11 @@
134136
g.url.passwd = unobscure(db_get("last-sync-pw", 0));
135137
g.url.flags |= URL_PROMPT_PW;
136138
url_prompt_for_password();
137139
}
138140
g.zHttpAuth = get_httpauth();
139
- if( fossil_strcmp(zAutosync,"all")==0 ){
141
+ if( sqlite3_strglob("*all*", zAutosync)==0 ){
140142
rc = client_sync_all_urls(flags|SYNC_ALLURL, configSync, 0, 0);
141143
}else{
142144
url_remember();
143145
sync_explain(flags);
144146
url_enable_proxy("via proxy: ");
145147
--- 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

Keyboard Shortcuts

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