Fossil SCM

If the "autosync" setting is "all", then autosync with all repos in "fossil remote list".

drh 2021-10-25 09:59 trunk
Commit 241ade812bebdbcaadd47f11c9f0dc5d7fdd05da4dd79e3ac192a07440482a10
1 file changed +9 -5
+9 -5
--- src/sync.c
+++ src/sync.c
@@ -125,23 +125,27 @@
125125
if( is_false(zAutosync) ) return 0;
126126
if( db_get_boolean("dont-push",0) || fossil_strncmp(zAutosync,"pull",4)==0 ){
127127
flags &= ~SYNC_CKIN_LOCK;
128128
if( flags & SYNC_PUSH ) return 0;
129129
}
130
+ if( find_option("verbose","v",0)!=0 ) flags |= SYNC_VERBOSE;
130131
url_parse(0, URL_REMEMBER);
131132
if( g.url.protocol==0 ) return 0;
132133
if( g.url.user!=0 && g.url.passwd==0 ){
133134
g.url.passwd = unobscure(db_get("last-sync-pw", 0));
134135
g.url.flags |= URL_PROMPT_PW;
135136
url_prompt_for_password();
136137
}
137138
g.zHttpAuth = get_httpauth();
138
- url_remember();
139
- if( find_option("verbose","v",0)!=0 ) flags |= SYNC_VERBOSE;
140
- fossil_print("Autosync: %s\n", g.url.canonical);
141
- url_enable_proxy("via proxy: ");
142
- rc = client_sync(flags, configSync, 0, 0);
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
+ rc = client_sync(flags, configSync, 0, 0);
146
+ }
143147
return rc;
144148
}
145149
146150
/*
147151
** This routine will try a number of times to perform autosync with a
148152
--- src/sync.c
+++ src/sync.c
@@ -125,23 +125,27 @@
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 url_parse(0, URL_REMEMBER);
131 if( g.url.protocol==0 ) return 0;
132 if( g.url.user!=0 && g.url.passwd==0 ){
133 g.url.passwd = unobscure(db_get("last-sync-pw", 0));
134 g.url.flags |= URL_PROMPT_PW;
135 url_prompt_for_password();
136 }
137 g.zHttpAuth = get_httpauth();
138 url_remember();
139 if( find_option("verbose","v",0)!=0 ) flags |= SYNC_VERBOSE;
140 fossil_print("Autosync: %s\n", g.url.canonical);
141 url_enable_proxy("via proxy: ");
142 rc = client_sync(flags, configSync, 0, 0);
 
 
 
143 return rc;
144 }
145
146 /*
147 ** This routine will try a number of times to perform autosync with a
148
--- src/sync.c
+++ src/sync.c
@@ -125,23 +125,27 @@
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);
132 if( g.url.protocol==0 ) return 0;
133 if( g.url.user!=0 && g.url.passwd==0 ){
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 rc = client_sync(flags, configSync, 0, 0);
146 }
147 return rc;
148 }
149
150 /*
151 ** This routine will try a number of times to perform autosync with a
152

Keyboard Shortcuts

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