Fossil SCM
Don't discard the current remote if there is a problem in parsing the new remote. For example, if the port is greater than 65535.
Commit
1c87d418d93440e199403f368ef73c6353a3f82e8f093c4d2a28b851f8586587
Parent
d3c5c08fd841fde…
1 file changed
+2
+2
| --- src/sync.c | ||
| +++ src/sync.c | ||
| @@ -876,15 +876,17 @@ | ||
| 876 | 876 | || sqlite3_strlike("https://%",zArg,0)==0 |
| 877 | 877 | || sqlite3_strlike("ssh:%",zArg,0)==0 |
| 878 | 878 | || sqlite3_strlike("file:%",zArg,0)==0 |
| 879 | 879 | || db_exists("SELECT 1 FROM config WHERE name='sync-url:%q'",zArg) |
| 880 | 880 | ){ |
| 881 | + db_begin_transaction(); | |
| 881 | 882 | db_unset("last-sync-url", 0); |
| 882 | 883 | db_unset("last-sync-pw", 0); |
| 883 | 884 | url_parse(g.argv[2], URL_REMEMBER|URL_PROMPT_PW| |
| 884 | 885 | URL_USE_CONFIG|URL_ASK_REMEMBER_PW); |
| 885 | 886 | url_remember(); |
| 887 | + db_commit_transaction(); | |
| 886 | 888 | return; |
| 887 | 889 | } |
| 888 | 890 | fossil_fatal("unknown command \"%s\" - should be a URL or one of: " |
| 889 | 891 | "add delete hyperlink list off scrub", zArg); |
| 890 | 892 | } |
| 891 | 893 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -876,15 +876,17 @@ | |
| 876 | || sqlite3_strlike("https://%",zArg,0)==0 |
| 877 | || sqlite3_strlike("ssh:%",zArg,0)==0 |
| 878 | || sqlite3_strlike("file:%",zArg,0)==0 |
| 879 | || db_exists("SELECT 1 FROM config WHERE name='sync-url:%q'",zArg) |
| 880 | ){ |
| 881 | db_unset("last-sync-url", 0); |
| 882 | db_unset("last-sync-pw", 0); |
| 883 | url_parse(g.argv[2], URL_REMEMBER|URL_PROMPT_PW| |
| 884 | URL_USE_CONFIG|URL_ASK_REMEMBER_PW); |
| 885 | url_remember(); |
| 886 | return; |
| 887 | } |
| 888 | fossil_fatal("unknown command \"%s\" - should be a URL or one of: " |
| 889 | "add delete hyperlink list off scrub", zArg); |
| 890 | } |
| 891 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -876,15 +876,17 @@ | |
| 876 | || sqlite3_strlike("https://%",zArg,0)==0 |
| 877 | || sqlite3_strlike("ssh:%",zArg,0)==0 |
| 878 | || sqlite3_strlike("file:%",zArg,0)==0 |
| 879 | || db_exists("SELECT 1 FROM config WHERE name='sync-url:%q'",zArg) |
| 880 | ){ |
| 881 | db_begin_transaction(); |
| 882 | db_unset("last-sync-url", 0); |
| 883 | db_unset("last-sync-pw", 0); |
| 884 | url_parse(g.argv[2], URL_REMEMBER|URL_PROMPT_PW| |
| 885 | URL_USE_CONFIG|URL_ASK_REMEMBER_PW); |
| 886 | url_remember(); |
| 887 | db_commit_transaction(); |
| 888 | return; |
| 889 | } |
| 890 | fossil_fatal("unknown command \"%s\" - should be a URL or one of: " |
| 891 | "add delete hyperlink list off scrub", zArg); |
| 892 | } |
| 893 |