Fossil SCM

Add the --nosync option to temporarily disable autosync. Useful when off network.

drh 2008-05-10 17:09 trunk
Commit 9ba6e4287ba0db011906809a2d71a5eb2fab7d29
+1
--- src/main.c
+++ src/main.c
@@ -56,10 +56,11 @@
5656
char *zLocalRoot; /* The directory holding the local database */
5757
int minPrefix; /* Number of digits needed for a distinct UUID */
5858
int fSqlTrace; /* True if -sqltrace flag is present */
5959
int fSqlPrint; /* True if -sqlprint flag is present */
6060
int fHttpTrace; /* Trace outbound HTTP requests */
61
+ int fNoSync; /* Do not do an autosync even. --nosync */
6162
char *zPath; /* Name of webpage being served */
6263
char *zExtra; /* Extra path information past the webpage name */
6364
char *zBaseURL; /* Full text of the URL being served */
6465
char *zTop; /* Parent directory of zPath */
6566
const char *zContentType; /* The content type of the input HTTP request */
6667
--- src/main.c
+++ src/main.c
@@ -56,10 +56,11 @@
56 char *zLocalRoot; /* The directory holding the local database */
57 int minPrefix; /* Number of digits needed for a distinct UUID */
58 int fSqlTrace; /* True if -sqltrace flag is present */
59 int fSqlPrint; /* True if -sqlprint flag is present */
60 int fHttpTrace; /* Trace outbound HTTP requests */
 
61 char *zPath; /* Name of webpage being served */
62 char *zExtra; /* Extra path information past the webpage name */
63 char *zBaseURL; /* Full text of the URL being served */
64 char *zTop; /* Parent directory of zPath */
65 const char *zContentType; /* The content type of the input HTTP request */
66
--- src/main.c
+++ src/main.c
@@ -56,10 +56,11 @@
56 char *zLocalRoot; /* The directory holding the local database */
57 int minPrefix; /* Number of digits needed for a distinct UUID */
58 int fSqlTrace; /* True if -sqltrace flag is present */
59 int fSqlPrint; /* True if -sqlprint flag is present */
60 int fHttpTrace; /* Trace outbound HTTP requests */
61 int fNoSync; /* Do not do an autosync even. --nosync */
62 char *zPath; /* Name of webpage being served */
63 char *zExtra; /* Extra path information past the webpage name */
64 char *zBaseURL; /* Full text of the URL being served */
65 char *zTop; /* Parent directory of zPath */
66 const char *zContentType; /* The content type of the input HTTP request */
67
+3
--- src/sync.c
+++ src/sync.c
@@ -41,10 +41,13 @@
4141
** autosync. This will be a pull if the argument is true or a push
4242
** if the argument is false.
4343
*/
4444
void autosync(int flags){
4545
const char *zUrl;
46
+ if( g.fNoSync ){
47
+ return;
48
+ }
4649
if( db_get_boolean("autosync", 0)==0 ){
4750
return;
4851
}
4952
zUrl = db_get("last-sync-url", 0);
5053
if( zUrl==0 ){
5154
--- src/sync.c
+++ src/sync.c
@@ -41,10 +41,13 @@
41 ** autosync. This will be a pull if the argument is true or a push
42 ** if the argument is false.
43 */
44 void autosync(int flags){
45 const char *zUrl;
 
 
 
46 if( db_get_boolean("autosync", 0)==0 ){
47 return;
48 }
49 zUrl = db_get("last-sync-url", 0);
50 if( zUrl==0 ){
51
--- src/sync.c
+++ src/sync.c
@@ -41,10 +41,13 @@
41 ** autosync. This will be a pull if the argument is true or a push
42 ** if the argument is false.
43 */
44 void autosync(int flags){
45 const char *zUrl;
46 if( g.fNoSync ){
47 return;
48 }
49 if( db_get_boolean("autosync", 0)==0 ){
50 return;
51 }
52 zUrl = db_get("last-sync-url", 0);
53 if( zUrl==0 ){
54
+1
--- src/url.c
+++ src/url.c
@@ -148,10 +148,11 @@
148148
** --proxy URL|off
149149
**
150150
*/
151151
void url_proxy_options(void){
152152
zProxyOpt = find_option("proxy", 0, 1);
153
+ g.fNoSync = find_option("nosync", 0, 0)!=0;
153154
}
154155
155156
/*
156157
** If the "proxy" setting is defined, then change the URL to refer
157158
** to the proxy server.
158159
--- src/url.c
+++ src/url.c
@@ -148,10 +148,11 @@
148 ** --proxy URL|off
149 **
150 */
151 void url_proxy_options(void){
152 zProxyOpt = find_option("proxy", 0, 1);
 
153 }
154
155 /*
156 ** If the "proxy" setting is defined, then change the URL to refer
157 ** to the proxy server.
158
--- src/url.c
+++ src/url.c
@@ -148,10 +148,11 @@
148 ** --proxy URL|off
149 **
150 */
151 void url_proxy_options(void){
152 zProxyOpt = find_option("proxy", 0, 1);
153 g.fNoSync = find_option("nosync", 0, 0)!=0;
154 }
155
156 /*
157 ** If the "proxy" setting is defined, then change the URL to refer
158 ** to the proxy server.
159

Keyboard Shortcuts

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