Artifact Content
Not logged in

Artifact 1fd269d0d86fe22b0383814350a4394951ee9607

Ticket change [1fd269d0d8] - New ticket 2aaa8042ca Option to avoid saving the sync URL. by dmitry on 2009-11-06 12:22:50.

D 2009-11-06T12:22:50
J comment I\shave\sa\sclone/fork\sof\sFossil\srepository\son\smy\swebserver\s(let's\ssay\sit's\shttp://example.com/fossil-fork),\swhich\sI\smerge\swith\sthe\smain\sone\sfrom\stime\sto\stime.\sWhen\sI\spull\schanges\sfrom\shttp://www.fossil-scm.org,\sthe\sURL\sgets\ssaved\sinto\slast-sync-url.\sThe\snext\stime\sI\scommit\sto\sit\s(with\sautosync\soption\sturned\son),\sFossil\stries\sto\spush\schanges\sinto\smainline,\swhile\sI\swant\sit\sto\spush\sinto\smy\sfork\s(http://example.com/fossil-fork).\sI\shave\sto\suse\sremote-url\scommand\sto\sset\slast-sync-url\sback\sto\sthe\sURL\sof\smy\sfork.\r\n\r\nI\sthink\sthe\s"--once"\soption\sfor\ssync/pull/push\swill\sbe\suseful\sfor\ssynchronizing\sforks.\sE.g.,\r\n\r\n<verbatim>\r\n$\sfossil\sremote-url\r\nhttp://example.com/fossil-fork\r\n\r\n$\sfossil\spull\s--once\shttp://www.fossil-scm.org\r\n...\r\nTotal\snetwork\straffic:\s318\sbytes\ssent,\s1292\sbytes\sreceived\r\n\r\n$\sfossil\sremote-url\r\nhttp://example.com/fossil-fork\r\n</verbatim>\r\n\r\nDiff:\r\n\r\n<verbatim>\r\n---\ssrc/sync.c\r\n+++\ssrc/sync.c\r\n@@\s-67,14\s+67,17\s@@\r\n\s/*\r\n\s**\sThis\sroutine\sprocesses\sthe\scommand-line\sargument\sfor\spush,\spull,\r\n\s**\sand\ssync.\s\sIf\sa\scommand-line\sargument\sis\sgiven,\sthat\sis\sthe\sURL\r\n\s**\sof\sa\sserver\sto\ssync\sagainst.\s\sIf\sno\sargument\sis\sgiven,\suse\sthe\r\n\s**\smost\srecently\ssynced\sURL.\s\sRemember\sthe\scurrent\sURL\sfor\snext\stime.\r\n+**\r\n+**\sIf\s--once\soption\sis\sspecified,\sdo\snot\sremember\sURL.\r\n\s*/\r\n\svoid\sprocess_sync_args(void){\r\n\s\s\sconst\schar\s*zUrl\s=\s0;\r\n\s\s\sint\surlOptional\s=\sfind_option("autourl",0,0)!=0;\r\n+\s\sint\ssyncOnce\s=\sfind_option("once",0,0)!=0;\r\n\s\s\surl_proxy_options();\r\n\s\s\sdb_find_and_open_repository(1);\r\n\s\s\sif(\sg.argc==2\s){\r\n\s\s\s\s\szUrl\s=\sdb_get("last-sync-url",\s0);\r\n\s\s\s}else\sif(\sg.argc==3\s){\r\n@@\s-83,11\s+86,13\s@@\r\n\s\s\sif(\szUrl==0\s){\r\n\s\s\s\s\sif(\surlOptional\s)\sexit(0);\r\n\s\s\s\s\susage("URL");\r\n\s\s\s}\r\n\s\s\surl_parse(zUrl);\r\n-\s\sdb_set("last-sync-url",\sg.urlIsFile\s?\sg.urlCanonical\s:\szUrl,\s0);\r\n+\s\sif\s(\ssyncOnce==0\s)\s{\r\n+\s\s\s\sdb_set("last-sync-url",\sg.urlIsFile\s?\sg.urlCanonical\s:\szUrl,\s0);\r\n+\s\s}\r\n\s\s\suser_select();\r\n\s\s\sif(\sg.argc==2\s){\r\n\s\s\s\s\sif(\sg.urlPort!=g.urlDfltPort\s){\r\n\s\s\s\s\s\s\sprintf("Server:\s\s\s\s%s://%s:%d%s\\n",\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sg.urlProtocol,\sg.urlName,\sg.urlPort,\sg.urlPath);\r\n@@\s-99,16\s+104,18\s@@\r\n\s}\r\n\s\r\n\s/*\r\n\s**\sCOMMAND:\spull\r\n\s**\r\n-**\sUsage:\s%fossil\spull\s?URL?\s?-R|--respository\sREPOSITORY?\r\n+**\sUsage:\s%fossil\spull\s?URL?\s?-R|--respository\sREPOSITORY?\s?--once?\r\n\s**\r\n\s**\sPull\schanges\sfrom\sa\sremote\srepository\sinto\sthe\slocal\srepository.\r\n\s**\r\n\s**\sIf\sthe\sURL\sis\snot\sspecified,\sthen\sthe\sURL\sfrom\sthe\smost\srecent\r\n\s**\sclone,\spush,\spull,\sremote-url,\sor\ssync\scommand\sis\sused.\r\n+**\r\n+**\sIf\s--once\soption\sis\sspecified,\sdo\snot\sremember\sURL.\r\n\s**\r\n\s**\sSee\salso:\sclone,\spush,\ssync,\sremote-url\r\n\s*/\r\n\svoid\spull_cmd(void){\r\n\s\s\sprocess_sync_args();\r\n@@\s-122,10\s+129,12\s@@\r\n\s**\r\n\s**\sPush\schanges\sin\sthe\slocal\srepository\sover\sinto\sa\sremote\srepository.\r\n\s**\r\n\s**\sIf\sthe\sURL\sis\snot\sspecified,\sthen\sthe\sURL\sfrom\sthe\smost\srecent\r\n\s**\sclone,\spush,\spull,\sremote-url,\sor\ssync\scommand\sis\sused.\r\n+**\r\n+**\sIf\s--once\soption\sis\sspecified,\sdo\snot\sremember\sURL.\r\n\s**\r\n\s**\sSee\salso:\sclone,\spull,\ssync,\sremote-url\r\n\s*/\r\n\svoid\spush_cmd(void){\r\n\s\s\sprocess_sync_args();\r\n@@\s-145,10\s+154,12\s@@\r\n\s**\r\n\s**\s\s\s\s\shttp://userid:password@www.domain.com:1234/path\r\n\s**\r\n\s**\sIf\sthe\sURL\sis\snot\sspecified,\sthen\sthe\sURL\sfrom\sthe\smost\srecent\ssuccessful\r\n\s**\sclone,\spush,\spull,\sremote-url,\sor\ssync\scommand\sis\sused.\r\n+**\r\n+**\sIf\s--once\soption\sis\sspecified,\sdo\snot\sremember\sURL.\r\n\s**\r\n\s**\sSee\salso:\s\sclone,\spush,\spull,\sremote-url\r\n\s*/\r\n\svoid\ssync_cmd(void){\r\n\s\s\sprocess_sync_args();\r\n</verbatim>
J foundin 149945beea
J private_contact 05f652db744266759b20d248ec2f451629420388
J severity Minor
J status Open
J title Option\sto\savoid\ssaving\sthe\ssync\sURL
J type Feature_Request
K 2aaa8042caec7929f432ce1de37b10563c70dd07
U dmitry
Z 987ed46ac029a77806fb0854a0ae4a24