Diff
Not logged in

Differences From:

File src/sync.c part of check-in [11ecd5c0b5] - Fix the "remote-url" command so that it preserves the userid and password. Ticket 68c7f7bee951302. by drh on 2009-10-31 14:03:49. [view]

To:

File src/sync.c part of check-in [5153d61893] - Add the --once command-line option to push, pull, and sync. Ticket 2aaa8042caec by drh on 2009-11-06 14:15:17. [view]

@@ -72,8 +72,9 @@
 */
 void process_sync_args(void){
   const char *zUrl = 0;
   int urlOptional = find_option("autourl",0,0)!=0;
+  int dontKeepUrl = find_option("once",0,0)!=0;
   url_proxy_options();
   db_find_and_open_repository(1);
   if( g.argc==2 ){
     zUrl = db_get("last-sync-url", 0);
@@ -84,9 +85,11 @@
     if( urlOptional ) exit(0);
     usage("URL");
   }
   url_parse(zUrl);
-  db_set("last-sync-url", g.urlIsFile ? g.urlCanonical : zUrl, 0);
+  if( !dontKeepUrl ){
+    db_set("last-sync-url", g.urlIsFile ? g.urlCanonical : zUrl, 0);
+  }
   user_select();
   if( g.argc==2 ){
     if( g.urlPort!=g.urlDfltPort ){
       printf("Server:    %s://%s:%d%s\n",
@@ -100,14 +103,21 @@
 
 /*
 ** COMMAND: pull
 **
-** Usage: %fossil pull ?URL? ?-R|--respository REPOSITORY?
+** Usage: %fossil pull ?URL? ?options?
 **
 ** Pull changes from a remote repository into the local repository.
+** Use the "-R REPO" or "--repository REPO" command-line options
+** to specify an alternative repository file.
 **
 ** If the URL is not specified, then the URL from the most recent
 ** clone, push, pull, remote-url, or sync command is used.
+**
+** The URL specified normally becomes the new "remote-url" used for
+** subsequent push, pull, and sync operations.  However, the "--once"
+** command-line option makes the URL a one-time-use URL that is not
+** saved.
 **
 ** See also: clone, push, sync, remote-url
 */
 void pull_cmd(void){
@@ -117,14 +127,21 @@
 
 /*
 ** COMMAND: push
 **
-** Usage: %fossil push ?URL? ?-R|--repository REPOSITORY?
+** Usage: %fossil push ?URL? ?options?
 **
 ** Push changes in the local repository over into a remote repository.
+** Use the "-R REPO" or "--repository REPO" command-line options
+** to specify an alternative repository file.
 **
 ** If the URL is not specified, then the URL from the most recent
 ** clone, push, pull, remote-url, or sync command is used.
+**
+** The URL specified normally becomes the new "remote-url" used for
+** subsequent push, pull, and sync operations.  However, the "--once"
+** command-line option makes the URL a one-time-use URL that is not
+** saved.
 **
 ** See also: clone, pull, sync, remote-url
 */
 void push_cmd(void){
@@ -135,19 +152,26 @@
 
 /*
 ** COMMAND: sync
 **
-** Usage: %fossil sync ?URL? ?-R|--repository REPOSITORY?
+** Usage: %fossil sync ?URL? ?options?
 **
 ** Synchronize the local repository with a remote repository.  This is
 ** the equivalent of running both "push" and "pull" at the same time.
+** Use the "-R REPO" or "--repository REPO" command-line options
+** to specify an alternative repository file.
 **
 ** If a user-id and password are required, specify them as follows:
 **
 **     http://userid:password@www.domain.com:1234/path
 **
 ** If the URL is not specified, then the URL from the most recent successful
 ** clone, push, pull, remote-url, or sync command is used.
+**
+** The URL specified normally becomes the new "remote-url" used for
+** subsequent push, pull, and sync operations.  However, the "--once"
+** command-line option makes the URL a one-time-use URL that is not
+** saved.
 **
 ** See also:  clone, push, pull, remote-url
 */
 void sync_cmd(void){