Diff
Not logged in

Differences From:

File src/sync.c part of check-in [f9f7cf5684] - The autosync setting understands values like "on", "off", "true", and "false" in addition to 0 and 1. Updates to the documentation. by drh on 2007-11-24 02:45:39. Also file src/sync.c part of check-in [d0305b305a] - Merged mainline into my branch to get the newest application. by aku on 2007-12-05 08:07:46. [view]

To:

File src/sync.c part of check-in [49b59bc559] - Issue a warning after a commit if the commit causes a fork. by drh on 2008-02-09 00:11:04. [view]

@@ -26,15 +26,24 @@
 #include "config.h"
 #include "sync.h"
 #include <assert.h>
 
+#if INTERFACE
+/*
+** Flags used to determine which direction(s) an autosync goes in.
+*/
+#define AUTOSYNC_PUSH  1
+#define AUTOSYNC_PULL  2
+
+#endif /* INTERFACE */
+
 /*
 ** If the respository is configured for autosyncing, then do an
 ** autosync.  This will be a pull if the argument is true or a push
 ** if the argument is false.  Return true if the autosync is done
 ** and false if autosync is not requested for the current repository.
 */
-int autosync(int pullFlag){
+int autosync(int flags){
   const char *zUrl;
   if( db_get_boolean("autosync", 0)==0 ){
     return 0;
   }
@@ -50,9 +59,9 @@
     printf("Autosync:  http://%s:%d%s\n", g.urlName, g.urlPort, g.urlPath);
   }else{
     printf("Autosync:  http://%s%s\n", g.urlName, g.urlPath);
   }
-  client_sync(!pullFlag, pullFlag, 0);
+  client_sync((flags & AUTOSYNC_PUSH)!=0, 1, 0);
   return 1;
 }
 
 /*