Check-in [5153d61893]
Not logged in
Overview

SHA1 Hash:5153d618937eb274b06a5cb2ae93fa0832157575
Date: 2009-11-06 14:15:17
User: drh
Comment:Add the --once command-line option to push, pull, and sync. Ticket 2aaa8042caec
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/sync.c from [693322f662] to [ed149c3f44].

@@ -71,10 +71,11 @@
 ** most recently synced URL.  Remember the current URL for next time.
 */
 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);
   }else if( g.argc==3 ){
@@ -83,11 +84,13 @@
   if( zUrl==0 ){
     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",
               g.urlProtocol, g.urlName, g.urlPort, g.urlPath);
@@ -99,16 +102,23 @@
 }
 
 /*
 ** 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){
   process_sync_args();
@@ -116,16 +126,23 @@
 }
 
 /*
 ** 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){
   process_sync_args();
@@ -134,21 +151,28 @@
 
 
 /*
 ** 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){
   process_sync_args();