History Of Ticket 2aaa8042ca
Not logged in
Ticket change [0d387de140] (rid 5588) by dmitry on 2009-11-06 15:31:13:
  1. Appended to comment:

    dmitry added on 2009-11-06 15:31:13:
    Thanks! The funny thing is that the original patch was almost exactly the same (with dontSaveUrl variable), but I changed it for some reason :)

Ticket change [8e003f5982] (rid 5586) by drh on 2009-11-06 14:16:01:
  1. Appended to comment:

    drh added on 2009-11-06 14:16:01:
    check-in 5153d618937eb274b06a5cb2ae93fa0832157575

  2. Change resolution to "Fixed"
  3. Change status to "Fixed"
Ticket change [bb51df381a] (rid 5580) by dmitry on 2009-11-06 13:12:30:
  1. Change comment to "I have a clone/fork of Fossil repository on my webserver (let's say it's http://example.com/fossil-fork), which I merge with the main one from time to time. When I pull changes from http://www.fossil-scm.org, the URL gets saved into last-sync-url. The next time I commit to it (with autosync option turned on), Fossil tries to push changes into mainline, while I want it to push into my fork (http://example.com/fossil-fork). I have to use remote-url command to set last-sync-url back to the URL of my fork. I think the "--once" option for sync/pull/push will be useful for synchronizing forks. E.g., <verbatim> $ fossil remote-url http://example.com/fossil-fork $ fossil pull --once http://www.fossil-scm.org ... Total network traffic: 318 bytes sent, 1292 bytes received $ fossil remote-url http://example.com/fossil-fork </verbatim> Diff: <verbatim> --- src/sync.c +++ src/sync.c @@ -67,14 +67,17 @@ /* ** This routine processes the command-line argument for push, pull, ** and sync. If a command-line argument is given, that is the URL ** of a server to sync against. If no argument is given, use the ** most recently synced URL. Remember the current URL for next time. +** +** If --once option is specified, do not remember URL. */ void process_sync_args(void){ const char *zUrl = 0; int urlOptional = find_option("autourl",0,0)!=0; + int syncOnce = 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 +86,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 ( syncOnce==0 ) { + 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 +104,18 @@ } /* ** COMMAND: pull ** -** Usage: %fossil pull ?URL? ?-R|--respository REPOSITORY? +** Usage: %fossil pull ?URL? ?-R|--respository REPOSITORY? ?--once? ** ** Pull changes from a remote repository into the local repository. ** ** If the URL is not specified, then the URL from the most recent ** clone, push, pull, remote-url, or sync command is used. +** +** If --once option is specified, do not remember URL. ** ** See also: clone, push, sync, remote-url */ void pull_cmd(void){ process_sync_args(); @@ -116,16 +123,18 @@ } /* ** COMMAND: push ** -** Usage: %fossil push ?URL? ?-R|--repository REPOSITORY? +** Usage: %fossil push ?URL? ?-R|--repository REPOSITORY? ?--once? ** ** Push changes in the local repository over into a remote repository. ** ** If the URL is not specified, then the URL from the most recent ** clone, push, pull, remote-url, or sync command is used. +** +** If --once option is specified, do not remember URL. ** ** See also: clone, pull, sync, remote-url */ void push_cmd(void){ process_sync_args(); @@ -134,11 +143,11 @@ /* ** COMMAND: sync ** -** Usage: %fossil sync ?URL? ?-R|--repository REPOSITORY? +** Usage: %fossil sync ?URL? ?-R|--repository REPOSITORY? ?--once? ** ** Synchronize the local repository with a remote repository. This is ** the equivalent of running both "push" and "pull" at the same time. ** ** If a user-id and password are required, specify them as follows: @@ -145,10 +154,12 @@ ** ** 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. +** +** If --once option is specified, do not remember URL. ** ** See also: clone, push, pull, remote-url */ void sync_cmd(void){ process_sync_args(); </verbatim>"
Ticket change [19641d9e3e] (rid 5579) by dmitry on 2009-11-06 12:27:01:
  1. Appended to comment:

    dmitry added on 2009-11-06 12:27:01:
    Sorry, forgot to add ?--once? to some commands description. Here's the updated version:

    --- src/sync.c
    +++ src/sync.c
    @@ -67,14 +67,17 @@
     /*
     ** This routine processes the command-line argument for push, pull,
     ** and sync.  If a command-line argument is given, that is the URL
     ** of a server to sync against.  If no argument is given, use the
     ** most recently synced URL.  Remember the current URL for next time.
    +**
    +** If --once option is specified, do not remember URL.
     */
     void process_sync_args(void){
       const char *zUrl = 0;
       int urlOptional = find_option("autourl",0,0)!=0;
    +  int syncOnce = 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 +86,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 ( syncOnce==0 ) {
    +    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 +104,18 @@
     }
     
     /*
     ** COMMAND: pull
     **
    -** Usage: %fossil pull ?URL? ?-R|--respository REPOSITORY?
    +** Usage: %fossil pull ?URL? ?-R|--respository REPOSITORY? ?--once?
     **
     ** Pull changes from a remote repository into the local repository.
     **
     ** If the URL is not specified, then the URL from the most recent
     ** clone, push, pull, remote-url, or sync command is used.
    +**
    +** If --once option is specified, do not remember URL.
     **
     ** See also: clone, push, sync, remote-url
     */
     void pull_cmd(void){
       process_sync_args();
    @@ -116,16 +123,18 @@
     }
     
     /*
     ** COMMAND: push
     **
    -** Usage: %fossil push ?URL? ?-R|--repository REPOSITORY?
    +** Usage: %fossil push ?URL? ?-R|--repository REPOSITORY? ?--once?
     **
     ** Push changes in the local repository over into a remote repository.
     **
     ** If the URL is not specified, then the URL from the most recent
     ** clone, push, pull, remote-url, or sync command is used.
    +**
    +** If --once option is specified, do not remember URL.
     **
     ** See also: clone, pull, sync, remote-url
     */
     void push_cmd(void){
       process_sync_args();
    @@ -134,11 +143,11 @@
     
     
     /*
     ** COMMAND: sync
     **
    -** Usage: %fossil sync ?URL? ?-R|--repository REPOSITORY?
    +** Usage: %fossil sync ?URL? ?-R|--repository REPOSITORY? ?--once?
     **
     ** Synchronize the local repository with a remote repository.  This is
     ** the equivalent of running both "push" and "pull" at the same time.
     **
     ** If a user-id and password are required, specify them as follows:
    @@ -145,10 +154,12 @@
     **
     **     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.
    +**
    +** If --once option is specified, do not remember URL.
     **
     ** See also:  clone, push, pull, remote-url
     */
     void sync_cmd(void){
       process_sync_args();
    
    
  2. Change resolution to "Open"
Ticket change [1fd269d0d8] (rid 5578) by dmitry on 2009-11-06 12:22:50:
  1. Change comment to "I have a clone/fork of Fossil repository on my webserver (let's say it's http://example.com/fossil-fork), which I merge with the main one from time to time. When I pull changes from http://www.fossil-scm.org, the URL gets saved into last-sync-url. The next time I commit to it (with autosync option turned on), Fossil tries to push changes into mainline, while I want it to push into my fork (http://example.com/fossil-fork). I have to use remote-url command to set last-sync-url back to the URL of my fork. I think the "--once" option for sync/pull/push will be useful for synchronizing forks. E.g., <verbatim> $ fossil remote-url http://example.com/fossil-fork $ fossil pull --once http://www.fossil-scm.org ... Total network traffic: 318 bytes sent, 1292 bytes received $ fossil remote-url http://example.com/fossil-fork </verbatim> Diff: <verbatim> --- src/sync.c +++ src/sync.c @@ -67,14 +67,17 @@ /* ** This routine processes the command-line argument for push, pull, ** and sync. If a command-line argument is given, that is the URL ** of a server to sync against. If no argument is given, use the ** most recently synced URL. Remember the current URL for next time. +** +** If --once option is specified, do not remember URL. */ void process_sync_args(void){ const char *zUrl = 0; int urlOptional = find_option("autourl",0,0)!=0; + int syncOnce = 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 +86,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 ( syncOnce==0 ) { + 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 +104,18 @@ } /* ** COMMAND: pull ** -** Usage: %fossil pull ?URL? ?-R|--respository REPOSITORY? +** Usage: %fossil pull ?URL? ?-R|--respository REPOSITORY? ?--once? ** ** Pull changes from a remote repository into the local repository. ** ** If the URL is not specified, then the URL from the most recent ** clone, push, pull, remote-url, or sync command is used. +** +** If --once option is specified, do not remember URL. ** ** See also: clone, push, sync, remote-url */ void pull_cmd(void){ process_sync_args(); @@ -122,10 +129,12 @@ ** ** Push changes in the local repository over into a remote repository. ** ** If the URL is not specified, then the URL from the most recent ** clone, push, pull, remote-url, or sync command is used. +** +** If --once option is specified, do not remember URL. ** ** See also: clone, pull, sync, remote-url */ void push_cmd(void){ process_sync_args(); @@ -145,10 +154,12 @@ ** ** 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. +** +** If --once option is specified, do not remember URL. ** ** See also: clone, push, pull, remote-url */ void sync_cmd(void){ process_sync_args(); </verbatim>"
  2. Change foundin to "149945beea"
  3. Change private_contact to "05f652db744266759b20d248ec2f451629420388"
  4. Change severity to "Minor"
  5. Change status to "Open"
  6. Change title to "Option to avoid saving the sync URL"
  7. Change type to "Feature_Request"