Fossil SCM
pulled in trunk.
Commit
648028751718883a65f95247abb63a6335652baa
Parent
e1a0de75756eb10…
10 files changed
+10
-5
+13
-7
+9
-14
+9
-4
+10
-2
+9
-2
+9
-5
+21
-10
+7
+1
-1
+10
-5
| --- src/checkout.c | ||
| +++ src/checkout.c | ||
| @@ -54,11 +54,11 @@ | ||
| 54 | 54 | ** Given the abbreviated UUID name of a version, load the content of that |
| 55 | 55 | ** version in the VFILE table. Return the VID for the version. |
| 56 | 56 | ** |
| 57 | 57 | ** If anything goes wrong, panic. |
| 58 | 58 | */ |
| 59 | -int load_vfile(const char *zName){ | |
| 59 | +int load_vfile(const char *zName, int forceMissingFlag){ | |
| 60 | 60 | Blob uuid; |
| 61 | 61 | int vid; |
| 62 | 62 | |
| 63 | 63 | blob_init(&uuid, zName, -1); |
| 64 | 64 | if( name_to_uuid(&uuid, 1, "ci") ){ |
| @@ -69,11 +69,13 @@ | ||
| 69 | 69 | fossil_fatal("no such check-in: %s", g.argv[2]); |
| 70 | 70 | } |
| 71 | 71 | if( !is_a_version(vid) ){ |
| 72 | 72 | fossil_fatal("object [%.10s] is not a check-in", blob_str(&uuid)); |
| 73 | 73 | } |
| 74 | - load_vfile_from_rid(vid); | |
| 74 | + if( load_vfile_from_rid(vid) && !forceMissingFlag ){ | |
| 75 | + fossil_fatal("missing content, unable to checkout"); | |
| 76 | + }; | |
| 75 | 77 | return vid; |
| 76 | 78 | } |
| 77 | 79 | |
| 78 | 80 | /* |
| 79 | 81 | ** Set or clear the vfile.isexe flag for a file. |
| @@ -176,17 +178,19 @@ | ||
| 176 | 178 | ** |
| 177 | 179 | ** The --latest flag can be used in place of VERSION to checkout the |
| 178 | 180 | ** latest version in the repository. |
| 179 | 181 | ** |
| 180 | 182 | ** Options: |
| 181 | -** --force Ignore edited files in the current checkout | |
| 182 | -** --keep Only update the manifest and manifest.uuid files | |
| 183 | +** --force Ignore edited files in the current checkout | |
| 184 | +** --keep Only update the manifest and manifest.uuid files | |
| 185 | +** --force-missing Force checkout even if content is missing | |
| 183 | 186 | ** |
| 184 | 187 | ** See also: update |
| 185 | 188 | */ |
| 186 | 189 | void checkout_cmd(void){ |
| 187 | 190 | int forceFlag; /* Force checkout even if edits exist */ |
| 191 | + int forceMissingFlag; /* Force checkout even if missing content */ | |
| 188 | 192 | int keepFlag; /* Do not change any files on disk */ |
| 189 | 193 | int latestFlag; /* Checkout the latest version */ |
| 190 | 194 | char *zVers; /* Version to checkout */ |
| 191 | 195 | int promptFlag; /* True to prompt before overwriting */ |
| 192 | 196 | int vid, prior; |
| @@ -193,10 +197,11 @@ | ||
| 193 | 197 | Blob cksum1, cksum1b, cksum2; |
| 194 | 198 | |
| 195 | 199 | db_must_be_within_tree(); |
| 196 | 200 | db_begin_transaction(); |
| 197 | 201 | forceFlag = find_option("force","f",0)!=0; |
| 202 | + forceMissingFlag = find_option("force-missing",0,0)!=0; | |
| 198 | 203 | keepFlag = find_option("keep",0,0)!=0; |
| 199 | 204 | latestFlag = find_option("latest",0,0)!=0; |
| 200 | 205 | promptFlag = find_option("prompt",0,0)!=0 || forceFlag==0; |
| 201 | 206 | if( (latestFlag!=0 && g.argc!=2) || (latestFlag==0 && g.argc!=3) ){ |
| 202 | 207 | usage("VERSION|--latest ?--force? ?--keep?"); |
| @@ -224,11 +229,11 @@ | ||
| 224 | 229 | return; |
| 225 | 230 | } |
| 226 | 231 | }else{ |
| 227 | 232 | zVers = g.argv[2]; |
| 228 | 233 | } |
| 229 | - vid = load_vfile(zVers); | |
| 234 | + vid = load_vfile(zVers, forceMissingFlag); | |
| 230 | 235 | if( prior==vid ){ |
| 231 | 236 | return; |
| 232 | 237 | } |
| 233 | 238 | if( !keepFlag ){ |
| 234 | 239 | uncheckout(prior); |
| 235 | 240 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -54,11 +54,11 @@ | |
| 54 | ** Given the abbreviated UUID name of a version, load the content of that |
| 55 | ** version in the VFILE table. Return the VID for the version. |
| 56 | ** |
| 57 | ** If anything goes wrong, panic. |
| 58 | */ |
| 59 | int load_vfile(const char *zName){ |
| 60 | Blob uuid; |
| 61 | int vid; |
| 62 | |
| 63 | blob_init(&uuid, zName, -1); |
| 64 | if( name_to_uuid(&uuid, 1, "ci") ){ |
| @@ -69,11 +69,13 @@ | |
| 69 | fossil_fatal("no such check-in: %s", g.argv[2]); |
| 70 | } |
| 71 | if( !is_a_version(vid) ){ |
| 72 | fossil_fatal("object [%.10s] is not a check-in", blob_str(&uuid)); |
| 73 | } |
| 74 | load_vfile_from_rid(vid); |
| 75 | return vid; |
| 76 | } |
| 77 | |
| 78 | /* |
| 79 | ** Set or clear the vfile.isexe flag for a file. |
| @@ -176,17 +178,19 @@ | |
| 176 | ** |
| 177 | ** The --latest flag can be used in place of VERSION to checkout the |
| 178 | ** latest version in the repository. |
| 179 | ** |
| 180 | ** Options: |
| 181 | ** --force Ignore edited files in the current checkout |
| 182 | ** --keep Only update the manifest and manifest.uuid files |
| 183 | ** |
| 184 | ** See also: update |
| 185 | */ |
| 186 | void checkout_cmd(void){ |
| 187 | int forceFlag; /* Force checkout even if edits exist */ |
| 188 | int keepFlag; /* Do not change any files on disk */ |
| 189 | int latestFlag; /* Checkout the latest version */ |
| 190 | char *zVers; /* Version to checkout */ |
| 191 | int promptFlag; /* True to prompt before overwriting */ |
| 192 | int vid, prior; |
| @@ -193,10 +197,11 @@ | |
| 193 | Blob cksum1, cksum1b, cksum2; |
| 194 | |
| 195 | db_must_be_within_tree(); |
| 196 | db_begin_transaction(); |
| 197 | forceFlag = find_option("force","f",0)!=0; |
| 198 | keepFlag = find_option("keep",0,0)!=0; |
| 199 | latestFlag = find_option("latest",0,0)!=0; |
| 200 | promptFlag = find_option("prompt",0,0)!=0 || forceFlag==0; |
| 201 | if( (latestFlag!=0 && g.argc!=2) || (latestFlag==0 && g.argc!=3) ){ |
| 202 | usage("VERSION|--latest ?--force? ?--keep?"); |
| @@ -224,11 +229,11 @@ | |
| 224 | return; |
| 225 | } |
| 226 | }else{ |
| 227 | zVers = g.argv[2]; |
| 228 | } |
| 229 | vid = load_vfile(zVers); |
| 230 | if( prior==vid ){ |
| 231 | return; |
| 232 | } |
| 233 | if( !keepFlag ){ |
| 234 | uncheckout(prior); |
| 235 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -54,11 +54,11 @@ | |
| 54 | ** Given the abbreviated UUID name of a version, load the content of that |
| 55 | ** version in the VFILE table. Return the VID for the version. |
| 56 | ** |
| 57 | ** If anything goes wrong, panic. |
| 58 | */ |
| 59 | int load_vfile(const char *zName, int forceMissingFlag){ |
| 60 | Blob uuid; |
| 61 | int vid; |
| 62 | |
| 63 | blob_init(&uuid, zName, -1); |
| 64 | if( name_to_uuid(&uuid, 1, "ci") ){ |
| @@ -69,11 +69,13 @@ | |
| 69 | fossil_fatal("no such check-in: %s", g.argv[2]); |
| 70 | } |
| 71 | if( !is_a_version(vid) ){ |
| 72 | fossil_fatal("object [%.10s] is not a check-in", blob_str(&uuid)); |
| 73 | } |
| 74 | if( load_vfile_from_rid(vid) && !forceMissingFlag ){ |
| 75 | fossil_fatal("missing content, unable to checkout"); |
| 76 | }; |
| 77 | return vid; |
| 78 | } |
| 79 | |
| 80 | /* |
| 81 | ** Set or clear the vfile.isexe flag for a file. |
| @@ -176,17 +178,19 @@ | |
| 178 | ** |
| 179 | ** The --latest flag can be used in place of VERSION to checkout the |
| 180 | ** latest version in the repository. |
| 181 | ** |
| 182 | ** Options: |
| 183 | ** --force Ignore edited files in the current checkout |
| 184 | ** --keep Only update the manifest and manifest.uuid files |
| 185 | ** --force-missing Force checkout even if content is missing |
| 186 | ** |
| 187 | ** See also: update |
| 188 | */ |
| 189 | void checkout_cmd(void){ |
| 190 | int forceFlag; /* Force checkout even if edits exist */ |
| 191 | int forceMissingFlag; /* Force checkout even if missing content */ |
| 192 | int keepFlag; /* Do not change any files on disk */ |
| 193 | int latestFlag; /* Checkout the latest version */ |
| 194 | char *zVers; /* Version to checkout */ |
| 195 | int promptFlag; /* True to prompt before overwriting */ |
| 196 | int vid, prior; |
| @@ -193,10 +197,11 @@ | |
| 197 | Blob cksum1, cksum1b, cksum2; |
| 198 | |
| 199 | db_must_be_within_tree(); |
| 200 | db_begin_transaction(); |
| 201 | forceFlag = find_option("force","f",0)!=0; |
| 202 | forceMissingFlag = find_option("force-missing",0,0)!=0; |
| 203 | keepFlag = find_option("keep",0,0)!=0; |
| 204 | latestFlag = find_option("latest",0,0)!=0; |
| 205 | promptFlag = find_option("prompt",0,0)!=0 || forceFlag==0; |
| 206 | if( (latestFlag!=0 && g.argc!=2) || (latestFlag==0 && g.argc!=3) ){ |
| 207 | usage("VERSION|--latest ?--force? ?--keep?"); |
| @@ -224,11 +229,11 @@ | |
| 229 | return; |
| 230 | } |
| 231 | }else{ |
| 232 | zVers = g.argv[2]; |
| 233 | } |
| 234 | vid = load_vfile(zVers, forceMissingFlag); |
| 235 | if( prior==vid ){ |
| 236 | return; |
| 237 | } |
| 238 | if( !keepFlag ){ |
| 239 | uncheckout(prior); |
| 240 |
M
src/db.c
+13
-7
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1441,10 +1441,11 @@ | ||
| 1441 | 1441 | ** |
| 1442 | 1442 | ** Options: |
| 1443 | 1443 | ** --template FILE copy settings from repository file |
| 1444 | 1444 | ** --admin-user|-A USERNAME select given USERNAME as admin user |
| 1445 | 1445 | ** --date-override DATETIME use DATETIME as time of the initial checkin |
| 1446 | +** (default: don't create initial checkin) | |
| 1446 | 1447 | ** |
| 1447 | 1448 | ** See also: clone |
| 1448 | 1449 | */ |
| 1449 | 1450 | void create_repository_cmd(void){ |
| 1450 | 1451 | char *zPassword; |
| @@ -1453,11 +1454,10 @@ | ||
| 1453 | 1454 | const char *zDefaultUser; /* Optional name of the default user */ |
| 1454 | 1455 | |
| 1455 | 1456 | zTemplate = find_option("template",0,1); |
| 1456 | 1457 | zDate = find_option("date-override",0,1); |
| 1457 | 1458 | zDefaultUser = find_option("admin-user","A",1); |
| 1458 | - if( zDate==0 ) zDate = "now"; | |
| 1459 | 1459 | if( g.argc!=3 ){ |
| 1460 | 1460 | usage("REPOSITORY-NAME"); |
| 1461 | 1461 | } |
| 1462 | 1462 | db_create_repository(g.argv[2]); |
| 1463 | 1463 | db_open_repository(g.argv[2]); |
| @@ -1985,29 +1985,32 @@ | ||
| 1985 | 1985 | ** If VERSION is specified then that version is checked out. Otherwise |
| 1986 | 1986 | ** the latest version is checked out. No files other than "manifest" |
| 1987 | 1987 | ** and "manifest.uuid" are modified if the --keep option is present. |
| 1988 | 1988 | ** |
| 1989 | 1989 | ** Options: |
| 1990 | -** --empty Initialize checkout as being empty, but still connected | |
| 1991 | -** with the local repository. If you commit this checkout, | |
| 1992 | -** it will become a new "initial" commit in the repository. | |
| 1993 | -** --keep Only modify the manifest and manifest.uuid files | |
| 1994 | -** --nested Allow opening a repository inside an opened checkout | |
| 1990 | +** --empty Initialize checkout as being empty, but still connected | |
| 1991 | +** with the local repository. If you commit this checkout, | |
| 1992 | +** it will become a new "initial" commit in the repository. | |
| 1993 | +** --keep Only modify the manifest and manifest.uuid files | |
| 1994 | +** --nested Allow opening a repository inside an opened checkout | |
| 1995 | +** --force-missing Force opening a repository with missing content | |
| 1995 | 1996 | ** |
| 1996 | 1997 | ** See also: close |
| 1997 | 1998 | */ |
| 1998 | 1999 | void cmd_open(void){ |
| 1999 | 2000 | int emptyFlag; |
| 2000 | 2001 | int keepFlag; |
| 2002 | + int forceMissingFlag; | |
| 2001 | 2003 | int allowNested; |
| 2002 | 2004 | char **oldArgv; |
| 2003 | 2005 | int oldArgc; |
| 2004 | - static char *azNewArgv[] = { 0, "checkout", "--prompt", 0, 0, 0 }; | |
| 2006 | + static char *azNewArgv[] = { 0, "checkout", "--prompt", 0, 0, 0, 0 }; | |
| 2005 | 2007 | |
| 2006 | 2008 | url_proxy_options(); |
| 2007 | 2009 | emptyFlag = find_option("empty",0,0)!=0; |
| 2008 | 2010 | keepFlag = find_option("keep",0,0)!=0; |
| 2011 | + forceMissingFlag = find_option("force-missing",0,0)!=0; | |
| 2009 | 2012 | allowNested = find_option("nested",0,0)!=0; |
| 2010 | 2013 | if( g.argc!=3 && g.argc!=4 ){ |
| 2011 | 2014 | usage("REPOSITORY-FILENAME ?VERSION?"); |
| 2012 | 2015 | } |
| 2013 | 2016 | if( !allowNested && db_open_local(0) ){ |
| @@ -2043,10 +2046,13 @@ | ||
| 2043 | 2046 | azNewArgv[g.argc-1] = db_get("main-branch", "trunk"); |
| 2044 | 2047 | } |
| 2045 | 2048 | if( keepFlag ){ |
| 2046 | 2049 | azNewArgv[g.argc++] = "--keep"; |
| 2047 | 2050 | } |
| 2051 | + if( forceMissingFlag ){ | |
| 2052 | + azNewArgv[g.argc++] = "--force-missing"; | |
| 2053 | + } | |
| 2048 | 2054 | checkout_cmd(); |
| 2049 | 2055 | } |
| 2050 | 2056 | g.argc = 2; |
| 2051 | 2057 | info_cmd(); |
| 2052 | 2058 | } |
| 2053 | 2059 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1441,10 +1441,11 @@ | |
| 1441 | ** |
| 1442 | ** Options: |
| 1443 | ** --template FILE copy settings from repository file |
| 1444 | ** --admin-user|-A USERNAME select given USERNAME as admin user |
| 1445 | ** --date-override DATETIME use DATETIME as time of the initial checkin |
| 1446 | ** |
| 1447 | ** See also: clone |
| 1448 | */ |
| 1449 | void create_repository_cmd(void){ |
| 1450 | char *zPassword; |
| @@ -1453,11 +1454,10 @@ | |
| 1453 | const char *zDefaultUser; /* Optional name of the default user */ |
| 1454 | |
| 1455 | zTemplate = find_option("template",0,1); |
| 1456 | zDate = find_option("date-override",0,1); |
| 1457 | zDefaultUser = find_option("admin-user","A",1); |
| 1458 | if( zDate==0 ) zDate = "now"; |
| 1459 | if( g.argc!=3 ){ |
| 1460 | usage("REPOSITORY-NAME"); |
| 1461 | } |
| 1462 | db_create_repository(g.argv[2]); |
| 1463 | db_open_repository(g.argv[2]); |
| @@ -1985,29 +1985,32 @@ | |
| 1985 | ** If VERSION is specified then that version is checked out. Otherwise |
| 1986 | ** the latest version is checked out. No files other than "manifest" |
| 1987 | ** and "manifest.uuid" are modified if the --keep option is present. |
| 1988 | ** |
| 1989 | ** Options: |
| 1990 | ** --empty Initialize checkout as being empty, but still connected |
| 1991 | ** with the local repository. If you commit this checkout, |
| 1992 | ** it will become a new "initial" commit in the repository. |
| 1993 | ** --keep Only modify the manifest and manifest.uuid files |
| 1994 | ** --nested Allow opening a repository inside an opened checkout |
| 1995 | ** |
| 1996 | ** See also: close |
| 1997 | */ |
| 1998 | void cmd_open(void){ |
| 1999 | int emptyFlag; |
| 2000 | int keepFlag; |
| 2001 | int allowNested; |
| 2002 | char **oldArgv; |
| 2003 | int oldArgc; |
| 2004 | static char *azNewArgv[] = { 0, "checkout", "--prompt", 0, 0, 0 }; |
| 2005 | |
| 2006 | url_proxy_options(); |
| 2007 | emptyFlag = find_option("empty",0,0)!=0; |
| 2008 | keepFlag = find_option("keep",0,0)!=0; |
| 2009 | allowNested = find_option("nested",0,0)!=0; |
| 2010 | if( g.argc!=3 && g.argc!=4 ){ |
| 2011 | usage("REPOSITORY-FILENAME ?VERSION?"); |
| 2012 | } |
| 2013 | if( !allowNested && db_open_local(0) ){ |
| @@ -2043,10 +2046,13 @@ | |
| 2043 | azNewArgv[g.argc-1] = db_get("main-branch", "trunk"); |
| 2044 | } |
| 2045 | if( keepFlag ){ |
| 2046 | azNewArgv[g.argc++] = "--keep"; |
| 2047 | } |
| 2048 | checkout_cmd(); |
| 2049 | } |
| 2050 | g.argc = 2; |
| 2051 | info_cmd(); |
| 2052 | } |
| 2053 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1441,10 +1441,11 @@ | |
| 1441 | ** |
| 1442 | ** Options: |
| 1443 | ** --template FILE copy settings from repository file |
| 1444 | ** --admin-user|-A USERNAME select given USERNAME as admin user |
| 1445 | ** --date-override DATETIME use DATETIME as time of the initial checkin |
| 1446 | ** (default: don't create initial checkin) |
| 1447 | ** |
| 1448 | ** See also: clone |
| 1449 | */ |
| 1450 | void create_repository_cmd(void){ |
| 1451 | char *zPassword; |
| @@ -1453,11 +1454,10 @@ | |
| 1454 | const char *zDefaultUser; /* Optional name of the default user */ |
| 1455 | |
| 1456 | zTemplate = find_option("template",0,1); |
| 1457 | zDate = find_option("date-override",0,1); |
| 1458 | zDefaultUser = find_option("admin-user","A",1); |
| 1459 | if( g.argc!=3 ){ |
| 1460 | usage("REPOSITORY-NAME"); |
| 1461 | } |
| 1462 | db_create_repository(g.argv[2]); |
| 1463 | db_open_repository(g.argv[2]); |
| @@ -1985,29 +1985,32 @@ | |
| 1985 | ** If VERSION is specified then that version is checked out. Otherwise |
| 1986 | ** the latest version is checked out. No files other than "manifest" |
| 1987 | ** and "manifest.uuid" are modified if the --keep option is present. |
| 1988 | ** |
| 1989 | ** Options: |
| 1990 | ** --empty Initialize checkout as being empty, but still connected |
| 1991 | ** with the local repository. If you commit this checkout, |
| 1992 | ** it will become a new "initial" commit in the repository. |
| 1993 | ** --keep Only modify the manifest and manifest.uuid files |
| 1994 | ** --nested Allow opening a repository inside an opened checkout |
| 1995 | ** --force-missing Force opening a repository with missing content |
| 1996 | ** |
| 1997 | ** See also: close |
| 1998 | */ |
| 1999 | void cmd_open(void){ |
| 2000 | int emptyFlag; |
| 2001 | int keepFlag; |
| 2002 | int forceMissingFlag; |
| 2003 | int allowNested; |
| 2004 | char **oldArgv; |
| 2005 | int oldArgc; |
| 2006 | static char *azNewArgv[] = { 0, "checkout", "--prompt", 0, 0, 0, 0 }; |
| 2007 | |
| 2008 | url_proxy_options(); |
| 2009 | emptyFlag = find_option("empty",0,0)!=0; |
| 2010 | keepFlag = find_option("keep",0,0)!=0; |
| 2011 | forceMissingFlag = find_option("force-missing",0,0)!=0; |
| 2012 | allowNested = find_option("nested",0,0)!=0; |
| 2013 | if( g.argc!=3 && g.argc!=4 ){ |
| 2014 | usage("REPOSITORY-FILENAME ?VERSION?"); |
| 2015 | } |
| 2016 | if( !allowNested && db_open_local(0) ){ |
| @@ -2043,10 +2046,13 @@ | |
| 2046 | azNewArgv[g.argc-1] = db_get("main-branch", "trunk"); |
| 2047 | } |
| 2048 | if( keepFlag ){ |
| 2049 | azNewArgv[g.argc++] = "--keep"; |
| 2050 | } |
| 2051 | if( forceMissingFlag ){ |
| 2052 | azNewArgv[g.argc++] = "--force-missing"; |
| 2053 | } |
| 2054 | checkout_cmd(); |
| 2055 | } |
| 2056 | g.argc = 2; |
| 2057 | info_cmd(); |
| 2058 | } |
| 2059 |
+9
-14
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -1005,30 +1005,25 @@ | ||
| 1005 | 1005 | ** (3) Delete the temp file. |
| 1006 | 1006 | */ |
| 1007 | 1007 | void diff_tk(const char *zSubCmd, int firstArg){ |
| 1008 | 1008 | int i; |
| 1009 | 1009 | Blob script; |
| 1010 | - char *zTempFile = 0; | |
| 1010 | + const char *zTempFile = 0; | |
| 1011 | 1011 | char *zCmd; |
| 1012 | 1012 | blob_zero(&script); |
| 1013 | 1013 | blob_appendf(&script, "set fossilcmd {| \"%/\" %s --html -y -i -v", |
| 1014 | 1014 | g.nameOfExe, zSubCmd); |
| 1015 | + find_option("html",0,0); | |
| 1016 | + find_option("side-by-side","y",0); | |
| 1017 | + find_option("internal","i",0); | |
| 1018 | + find_option("verbose","v",0); | |
| 1019 | + /* The undocumented --script FILENAME option causes the Tk script to | |
| 1020 | + ** be written into the FILENAME instead of being run. This is used | |
| 1021 | + ** for testing and debugging. */ | |
| 1022 | + zTempFile = find_option("script",0,1); | |
| 1015 | 1023 | for(i=firstArg; i<g.argc; i++){ |
| 1016 | 1024 | const char *z = g.argv[i]; |
| 1017 | - if( z[0]=='-' ){ | |
| 1018 | - if( strglob("*-html",z) ) continue; | |
| 1019 | - if( strglob("*-y",z) ) continue; | |
| 1020 | - if( strglob("*-i",z) ) continue; | |
| 1021 | - /* The undocumented --script FILENAME option causes the Tk script to | |
| 1022 | - ** be written into the FILENAME instead of being run. This is used | |
| 1023 | - ** for testing and debugging. */ | |
| 1024 | - if( strglob("*-script",z) && i<g.argc-1 ){ | |
| 1025 | - i++; | |
| 1026 | - zTempFile = g.argv[i]; | |
| 1027 | - continue; | |
| 1028 | - } | |
| 1029 | - } | |
| 1030 | 1025 | if( sqlite3_strglob("*}*",z) ){ |
| 1031 | 1026 | blob_appendf(&script, " {%/}", z); |
| 1032 | 1027 | }else{ |
| 1033 | 1028 | int j; |
| 1034 | 1029 | blob_append(&script, " ", 1); |
| 1035 | 1030 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -1005,30 +1005,25 @@ | |
| 1005 | ** (3) Delete the temp file. |
| 1006 | */ |
| 1007 | void diff_tk(const char *zSubCmd, int firstArg){ |
| 1008 | int i; |
| 1009 | Blob script; |
| 1010 | char *zTempFile = 0; |
| 1011 | char *zCmd; |
| 1012 | blob_zero(&script); |
| 1013 | blob_appendf(&script, "set fossilcmd {| \"%/\" %s --html -y -i -v", |
| 1014 | g.nameOfExe, zSubCmd); |
| 1015 | for(i=firstArg; i<g.argc; i++){ |
| 1016 | const char *z = g.argv[i]; |
| 1017 | if( z[0]=='-' ){ |
| 1018 | if( strglob("*-html",z) ) continue; |
| 1019 | if( strglob("*-y",z) ) continue; |
| 1020 | if( strglob("*-i",z) ) continue; |
| 1021 | /* The undocumented --script FILENAME option causes the Tk script to |
| 1022 | ** be written into the FILENAME instead of being run. This is used |
| 1023 | ** for testing and debugging. */ |
| 1024 | if( strglob("*-script",z) && i<g.argc-1 ){ |
| 1025 | i++; |
| 1026 | zTempFile = g.argv[i]; |
| 1027 | continue; |
| 1028 | } |
| 1029 | } |
| 1030 | if( sqlite3_strglob("*}*",z) ){ |
| 1031 | blob_appendf(&script, " {%/}", z); |
| 1032 | }else{ |
| 1033 | int j; |
| 1034 | blob_append(&script, " ", 1); |
| 1035 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -1005,30 +1005,25 @@ | |
| 1005 | ** (3) Delete the temp file. |
| 1006 | */ |
| 1007 | void diff_tk(const char *zSubCmd, int firstArg){ |
| 1008 | int i; |
| 1009 | Blob script; |
| 1010 | const char *zTempFile = 0; |
| 1011 | char *zCmd; |
| 1012 | blob_zero(&script); |
| 1013 | blob_appendf(&script, "set fossilcmd {| \"%/\" %s --html -y -i -v", |
| 1014 | g.nameOfExe, zSubCmd); |
| 1015 | find_option("html",0,0); |
| 1016 | find_option("side-by-side","y",0); |
| 1017 | find_option("internal","i",0); |
| 1018 | find_option("verbose","v",0); |
| 1019 | /* The undocumented --script FILENAME option causes the Tk script to |
| 1020 | ** be written into the FILENAME instead of being run. This is used |
| 1021 | ** for testing and debugging. */ |
| 1022 | zTempFile = find_option("script",0,1); |
| 1023 | for(i=firstArg; i<g.argc; i++){ |
| 1024 | const char *z = g.argv[i]; |
| 1025 | if( sqlite3_strglob("*}*",z) ){ |
| 1026 | blob_appendf(&script, " {%/}", z); |
| 1027 | }else{ |
| 1028 | int j; |
| 1029 | blob_append(&script, " ", 1); |
| 1030 |
+9
-4
| --- src/http.c | ||
| +++ src/http.c | ||
| @@ -323,14 +323,18 @@ | ||
| 323 | 323 | } |
| 324 | 324 | }else if( rc==302 && fossil_strnicmp(zLine, "location:", 9)==0 ){ |
| 325 | 325 | int i, j; |
| 326 | 326 | |
| 327 | 327 | if ( --maxRedirect == 0){ |
| 328 | - fossil_fatal("redirect limit exceeded"); | |
| 328 | + fossil_warning("redirect limit exceeded"); | |
| 329 | + goto write_err; | |
| 329 | 330 | } |
| 330 | 331 | for(i=9; zLine[i] && zLine[i]==' '; i++){} |
| 331 | - if( zLine[i]==0 ) fossil_fatal("malformed redirect: %s", zLine); | |
| 332 | + if( zLine[i]==0 ){ | |
| 333 | + fossil_warning("malformed redirect: %s", zLine); | |
| 334 | + goto write_err; | |
| 335 | + } | |
| 332 | 336 | j = strlen(zLine) - 1; |
| 333 | 337 | while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){ |
| 334 | 338 | j -= 4; |
| 335 | 339 | zLine[j] = 0; |
| 336 | 340 | } |
| @@ -351,11 +355,11 @@ | ||
| 351 | 355 | isError = 1; |
| 352 | 356 | } |
| 353 | 357 | } |
| 354 | 358 | } |
| 355 | 359 | if( iLength<0 ){ |
| 356 | - fossil_fatal("server did not reply"); | |
| 360 | + fossil_warning("server did not reply"); | |
| 357 | 361 | goto write_err; |
| 358 | 362 | } |
| 359 | 363 | if( rc!=200 ){ |
| 360 | 364 | fossil_warning("\"location:\" missing from 302 redirect reply"); |
| 361 | 365 | goto write_err; |
| @@ -378,11 +382,12 @@ | ||
| 378 | 382 | if( z[i]==0 ) break; |
| 379 | 383 | } |
| 380 | 384 | z[j] = z[i]; |
| 381 | 385 | } |
| 382 | 386 | z[j] = 0; |
| 383 | - fossil_fatal("server sends error: %s", z); | |
| 387 | + fossil_warning("server sends error: %s", z); | |
| 388 | + goto write_err; | |
| 384 | 389 | } |
| 385 | 390 | if( isCompressed ) blob_uncompress(pReply, pReply); |
| 386 | 391 | |
| 387 | 392 | /* |
| 388 | 393 | ** Close the connection to the server if appropriate. |
| 389 | 394 |
| --- src/http.c | |
| +++ src/http.c | |
| @@ -323,14 +323,18 @@ | |
| 323 | } |
| 324 | }else if( rc==302 && fossil_strnicmp(zLine, "location:", 9)==0 ){ |
| 325 | int i, j; |
| 326 | |
| 327 | if ( --maxRedirect == 0){ |
| 328 | fossil_fatal("redirect limit exceeded"); |
| 329 | } |
| 330 | for(i=9; zLine[i] && zLine[i]==' '; i++){} |
| 331 | if( zLine[i]==0 ) fossil_fatal("malformed redirect: %s", zLine); |
| 332 | j = strlen(zLine) - 1; |
| 333 | while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){ |
| 334 | j -= 4; |
| 335 | zLine[j] = 0; |
| 336 | } |
| @@ -351,11 +355,11 @@ | |
| 351 | isError = 1; |
| 352 | } |
| 353 | } |
| 354 | } |
| 355 | if( iLength<0 ){ |
| 356 | fossil_fatal("server did not reply"); |
| 357 | goto write_err; |
| 358 | } |
| 359 | if( rc!=200 ){ |
| 360 | fossil_warning("\"location:\" missing from 302 redirect reply"); |
| 361 | goto write_err; |
| @@ -378,11 +382,12 @@ | |
| 378 | if( z[i]==0 ) break; |
| 379 | } |
| 380 | z[j] = z[i]; |
| 381 | } |
| 382 | z[j] = 0; |
| 383 | fossil_fatal("server sends error: %s", z); |
| 384 | } |
| 385 | if( isCompressed ) blob_uncompress(pReply, pReply); |
| 386 | |
| 387 | /* |
| 388 | ** Close the connection to the server if appropriate. |
| 389 |
| --- src/http.c | |
| +++ src/http.c | |
| @@ -323,14 +323,18 @@ | |
| 323 | } |
| 324 | }else if( rc==302 && fossil_strnicmp(zLine, "location:", 9)==0 ){ |
| 325 | int i, j; |
| 326 | |
| 327 | if ( --maxRedirect == 0){ |
| 328 | fossil_warning("redirect limit exceeded"); |
| 329 | goto write_err; |
| 330 | } |
| 331 | for(i=9; zLine[i] && zLine[i]==' '; i++){} |
| 332 | if( zLine[i]==0 ){ |
| 333 | fossil_warning("malformed redirect: %s", zLine); |
| 334 | goto write_err; |
| 335 | } |
| 336 | j = strlen(zLine) - 1; |
| 337 | while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){ |
| 338 | j -= 4; |
| 339 | zLine[j] = 0; |
| 340 | } |
| @@ -351,11 +355,11 @@ | |
| 355 | isError = 1; |
| 356 | } |
| 357 | } |
| 358 | } |
| 359 | if( iLength<0 ){ |
| 360 | fossil_warning("server did not reply"); |
| 361 | goto write_err; |
| 362 | } |
| 363 | if( rc!=200 ){ |
| 364 | fossil_warning("\"location:\" missing from 302 redirect reply"); |
| 365 | goto write_err; |
| @@ -378,11 +382,12 @@ | |
| 382 | if( z[i]==0 ) break; |
| 383 | } |
| 384 | z[j] = z[i]; |
| 385 | } |
| 386 | z[j] = 0; |
| 387 | fossil_warning("server sends error: %s", z); |
| 388 | goto write_err; |
| 389 | } |
| 390 | if( isCompressed ) blob_uncompress(pReply, pReply); |
| 391 | |
| 392 | /* |
| 393 | ** Close the connection to the server if appropriate. |
| 394 |
+10
-2
| --- src/merge.c | ||
| +++ src/merge.c | ||
| @@ -91,10 +91,12 @@ | ||
| 91 | 91 | ** files whose names differ only in case are taken |
| 92 | 92 | ** to be the same file. |
| 93 | 93 | ** |
| 94 | 94 | ** -f|--force Force the merge even if it would be a no-op. |
| 95 | 95 | ** |
| 96 | +** --force-missing Force the merge even if there is missing content. | |
| 97 | +** | |
| 96 | 98 | ** --integrate Merged branch will be closed when committing. |
| 97 | 99 | ** |
| 98 | 100 | ** -n|--dry-run If given, display instead of run actions |
| 99 | 101 | ** |
| 100 | 102 | ** -v|--verbose Show additional details of the merge |
| @@ -107,10 +109,11 @@ | ||
| 107 | 109 | int integrateFlag; /* True if the --integrate option is present */ |
| 108 | 110 | int pickFlag; /* True if the --cherrypick option is present */ |
| 109 | 111 | int backoutFlag; /* True if the --backout option is present */ |
| 110 | 112 | int dryRunFlag; /* True if the --dry-run or -n option is present */ |
| 111 | 113 | int forceFlag; /* True if the --force or -f option is present */ |
| 114 | + int forceMissingFlag; /* True if the --force-missing option is present */ | |
| 112 | 115 | const char *zBinGlob; /* The value of --binary */ |
| 113 | 116 | const char *zPivot; /* The value of --baseline */ |
| 114 | 117 | int debugFlag; /* True if --debug is present */ |
| 115 | 118 | int nChng; /* Number of file name changes */ |
| 116 | 119 | int *aChng; /* An array of file name changes */ |
| @@ -127,10 +130,11 @@ | ||
| 127 | 130 | ** P The "pivot" - the most recent common ancestor of V and M. |
| 128 | 131 | */ |
| 129 | 132 | |
| 130 | 133 | undo_capture_command_line(); |
| 131 | 134 | verboseFlag = find_option("verbose","v",0)!=0; |
| 135 | + forceMissingFlag = find_option("force-missing",0,0)!=0; | |
| 132 | 136 | if( !verboseFlag ){ |
| 133 | 137 | verboseFlag = find_option("detail",0,0)!=0; /* deprecated */ |
| 134 | 138 | } |
| 135 | 139 | pickFlag = find_option("cherrypick",0,0)!=0; |
| 136 | 140 | integrateFlag = find_option("integrate",0,0)!=0; |
| @@ -269,12 +273,16 @@ | ||
| 269 | 273 | print_checkin_description(pid, 12, "baseline:"); |
| 270 | 274 | } |
| 271 | 275 | vfile_check_signature(vid, CKSIG_ENOTFILE); |
| 272 | 276 | db_begin_transaction(); |
| 273 | 277 | if( !dryRunFlag ) undo_begin(); |
| 274 | - load_vfile_from_rid(mid); | |
| 275 | - load_vfile_from_rid(pid); | |
| 278 | + if( load_vfile_from_rid(mid) && !forceMissingFlag ){ | |
| 279 | + fossil_fatal("missing content, unable to merge"); | |
| 280 | + } | |
| 281 | + if( load_vfile_from_rid(pid) && !forceMissingFlag ){ | |
| 282 | + fossil_fatal("missing content, unable to merge"); | |
| 283 | + } | |
| 276 | 284 | if( debugFlag ){ |
| 277 | 285 | char *z; |
| 278 | 286 | z = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", pid); |
| 279 | 287 | fossil_print("P=%d %z\n", pid, z); |
| 280 | 288 | z = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", mid); |
| 281 | 289 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -91,10 +91,12 @@ | |
| 91 | ** files whose names differ only in case are taken |
| 92 | ** to be the same file. |
| 93 | ** |
| 94 | ** -f|--force Force the merge even if it would be a no-op. |
| 95 | ** |
| 96 | ** --integrate Merged branch will be closed when committing. |
| 97 | ** |
| 98 | ** -n|--dry-run If given, display instead of run actions |
| 99 | ** |
| 100 | ** -v|--verbose Show additional details of the merge |
| @@ -107,10 +109,11 @@ | |
| 107 | int integrateFlag; /* True if the --integrate option is present */ |
| 108 | int pickFlag; /* True if the --cherrypick option is present */ |
| 109 | int backoutFlag; /* True if the --backout option is present */ |
| 110 | int dryRunFlag; /* True if the --dry-run or -n option is present */ |
| 111 | int forceFlag; /* True if the --force or -f option is present */ |
| 112 | const char *zBinGlob; /* The value of --binary */ |
| 113 | const char *zPivot; /* The value of --baseline */ |
| 114 | int debugFlag; /* True if --debug is present */ |
| 115 | int nChng; /* Number of file name changes */ |
| 116 | int *aChng; /* An array of file name changes */ |
| @@ -127,10 +130,11 @@ | |
| 127 | ** P The "pivot" - the most recent common ancestor of V and M. |
| 128 | */ |
| 129 | |
| 130 | undo_capture_command_line(); |
| 131 | verboseFlag = find_option("verbose","v",0)!=0; |
| 132 | if( !verboseFlag ){ |
| 133 | verboseFlag = find_option("detail",0,0)!=0; /* deprecated */ |
| 134 | } |
| 135 | pickFlag = find_option("cherrypick",0,0)!=0; |
| 136 | integrateFlag = find_option("integrate",0,0)!=0; |
| @@ -269,12 +273,16 @@ | |
| 269 | print_checkin_description(pid, 12, "baseline:"); |
| 270 | } |
| 271 | vfile_check_signature(vid, CKSIG_ENOTFILE); |
| 272 | db_begin_transaction(); |
| 273 | if( !dryRunFlag ) undo_begin(); |
| 274 | load_vfile_from_rid(mid); |
| 275 | load_vfile_from_rid(pid); |
| 276 | if( debugFlag ){ |
| 277 | char *z; |
| 278 | z = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", pid); |
| 279 | fossil_print("P=%d %z\n", pid, z); |
| 280 | z = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", mid); |
| 281 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -91,10 +91,12 @@ | |
| 91 | ** files whose names differ only in case are taken |
| 92 | ** to be the same file. |
| 93 | ** |
| 94 | ** -f|--force Force the merge even if it would be a no-op. |
| 95 | ** |
| 96 | ** --force-missing Force the merge even if there is missing content. |
| 97 | ** |
| 98 | ** --integrate Merged branch will be closed when committing. |
| 99 | ** |
| 100 | ** -n|--dry-run If given, display instead of run actions |
| 101 | ** |
| 102 | ** -v|--verbose Show additional details of the merge |
| @@ -107,10 +109,11 @@ | |
| 109 | int integrateFlag; /* True if the --integrate option is present */ |
| 110 | int pickFlag; /* True if the --cherrypick option is present */ |
| 111 | int backoutFlag; /* True if the --backout option is present */ |
| 112 | int dryRunFlag; /* True if the --dry-run or -n option is present */ |
| 113 | int forceFlag; /* True if the --force or -f option is present */ |
| 114 | int forceMissingFlag; /* True if the --force-missing option is present */ |
| 115 | const char *zBinGlob; /* The value of --binary */ |
| 116 | const char *zPivot; /* The value of --baseline */ |
| 117 | int debugFlag; /* True if --debug is present */ |
| 118 | int nChng; /* Number of file name changes */ |
| 119 | int *aChng; /* An array of file name changes */ |
| @@ -127,10 +130,11 @@ | |
| 130 | ** P The "pivot" - the most recent common ancestor of V and M. |
| 131 | */ |
| 132 | |
| 133 | undo_capture_command_line(); |
| 134 | verboseFlag = find_option("verbose","v",0)!=0; |
| 135 | forceMissingFlag = find_option("force-missing",0,0)!=0; |
| 136 | if( !verboseFlag ){ |
| 137 | verboseFlag = find_option("detail",0,0)!=0; /* deprecated */ |
| 138 | } |
| 139 | pickFlag = find_option("cherrypick",0,0)!=0; |
| 140 | integrateFlag = find_option("integrate",0,0)!=0; |
| @@ -269,12 +273,16 @@ | |
| 273 | print_checkin_description(pid, 12, "baseline:"); |
| 274 | } |
| 275 | vfile_check_signature(vid, CKSIG_ENOTFILE); |
| 276 | db_begin_transaction(); |
| 277 | if( !dryRunFlag ) undo_begin(); |
| 278 | if( load_vfile_from_rid(mid) && !forceMissingFlag ){ |
| 279 | fossil_fatal("missing content, unable to merge"); |
| 280 | } |
| 281 | if( load_vfile_from_rid(pid) && !forceMissingFlag ){ |
| 282 | fossil_fatal("missing content, unable to merge"); |
| 283 | } |
| 284 | if( debugFlag ){ |
| 285 | char *z; |
| 286 | z = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", pid); |
| 287 | fossil_print("P=%d %z\n", pid, z); |
| 288 | z = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", mid); |
| 289 |
+9
-2
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -88,10 +88,11 @@ | ||
| 88 | 88 | ** |
| 89 | 89 | ** Options: |
| 90 | 90 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 91 | 91 | ** --debug print debug information on stdout |
| 92 | 92 | ** --latest acceptable in place of VERSION, update to latest version |
| 93 | +** --force-missing force update if missing content after sync | |
| 93 | 94 | ** -n|--dry-run If given, display instead of run actions |
| 94 | 95 | ** -v|--verbose print status information about all files |
| 95 | 96 | ** |
| 96 | 97 | ** See also: revert |
| 97 | 98 | */ |
| @@ -100,10 +101,11 @@ | ||
| 100 | 101 | int tid=0; /* Target version - version we are changing to */ |
| 101 | 102 | Stmt q; |
| 102 | 103 | int latestFlag; /* --latest. Pick the latest version if true */ |
| 103 | 104 | int dryRunFlag; /* -n or --dry-run. Do a dry run */ |
| 104 | 105 | int verboseFlag; /* -v or --verbose. Output extra information */ |
| 106 | + int forceMissingFlag; /* --force-missing. Continue if missing content */ | |
| 105 | 107 | int debugFlag; /* --debug option */ |
| 106 | 108 | int setmtimeFlag; /* --setmtime. Set mtimes on files */ |
| 107 | 109 | int nChng; /* Number of file renames */ |
| 108 | 110 | int *aChng; /* Array of file renames */ |
| 109 | 111 | int i; /* Loop counter */ |
| @@ -120,18 +122,21 @@ | ||
| 120 | 122 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 121 | 123 | if( !dryRunFlag ){ |
| 122 | 124 | dryRunFlag = find_option("nochange",0,0)!=0; /* deprecated */ |
| 123 | 125 | } |
| 124 | 126 | verboseFlag = find_option("verbose","v",0)!=0; |
| 127 | + forceMissingFlag = find_option("force-missing",0,0)!=0; | |
| 125 | 128 | debugFlag = find_option("debug",0,0)!=0; |
| 126 | 129 | setmtimeFlag = find_option("setmtime",0,0)!=0; |
| 127 | 130 | capture_case_sensitive_option(); |
| 128 | 131 | db_must_be_within_tree(); |
| 129 | 132 | vid = db_lget_int("checkout", 0); |
| 130 | 133 | user_select(); |
| 131 | 134 | if( !dryRunFlag && !internalUpdate ){ |
| 132 | - autosync(SYNC_PULL + SYNC_VERBOSE*verboseFlag); | |
| 135 | + if( autosync(SYNC_PULL + SYNC_VERBOSE*verboseFlag) ){ | |
| 136 | + fossil_fatal("Cannot proceed with update"); | |
| 137 | + } | |
| 133 | 138 | } |
| 134 | 139 | |
| 135 | 140 | /* Create any empty directories now, as well as after the update, |
| 136 | 141 | ** so changes in settings are reflected now */ |
| 137 | 142 | if( !dryRunFlag ) ensure_empty_dirs_created(); |
| @@ -203,11 +208,13 @@ | ||
| 203 | 208 | } |
| 204 | 209 | |
| 205 | 210 | db_begin_transaction(); |
| 206 | 211 | vfile_check_signature(vid, CKSIG_ENOTFILE); |
| 207 | 212 | if( !dryRunFlag && !internalUpdate ) undo_begin(); |
| 208 | - load_vfile_from_rid(tid); | |
| 213 | + if( load_vfile_from_rid(tid) && !forceMissingFlag ){ | |
| 214 | + fossil_fatal("missing content, unable to update"); | |
| 215 | + }; | |
| 209 | 216 | |
| 210 | 217 | /* |
| 211 | 218 | ** The record.fn field is used to match files against each other. The |
| 212 | 219 | ** FV table contains one row for each each unique filename in |
| 213 | 220 | ** in the current checkout, the pivot, and the version being merged. |
| 214 | 221 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -88,10 +88,11 @@ | |
| 88 | ** |
| 89 | ** Options: |
| 90 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 91 | ** --debug print debug information on stdout |
| 92 | ** --latest acceptable in place of VERSION, update to latest version |
| 93 | ** -n|--dry-run If given, display instead of run actions |
| 94 | ** -v|--verbose print status information about all files |
| 95 | ** |
| 96 | ** See also: revert |
| 97 | */ |
| @@ -100,10 +101,11 @@ | |
| 100 | int tid=0; /* Target version - version we are changing to */ |
| 101 | Stmt q; |
| 102 | int latestFlag; /* --latest. Pick the latest version if true */ |
| 103 | int dryRunFlag; /* -n or --dry-run. Do a dry run */ |
| 104 | int verboseFlag; /* -v or --verbose. Output extra information */ |
| 105 | int debugFlag; /* --debug option */ |
| 106 | int setmtimeFlag; /* --setmtime. Set mtimes on files */ |
| 107 | int nChng; /* Number of file renames */ |
| 108 | int *aChng; /* Array of file renames */ |
| 109 | int i; /* Loop counter */ |
| @@ -120,18 +122,21 @@ | |
| 120 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 121 | if( !dryRunFlag ){ |
| 122 | dryRunFlag = find_option("nochange",0,0)!=0; /* deprecated */ |
| 123 | } |
| 124 | verboseFlag = find_option("verbose","v",0)!=0; |
| 125 | debugFlag = find_option("debug",0,0)!=0; |
| 126 | setmtimeFlag = find_option("setmtime",0,0)!=0; |
| 127 | capture_case_sensitive_option(); |
| 128 | db_must_be_within_tree(); |
| 129 | vid = db_lget_int("checkout", 0); |
| 130 | user_select(); |
| 131 | if( !dryRunFlag && !internalUpdate ){ |
| 132 | autosync(SYNC_PULL + SYNC_VERBOSE*verboseFlag); |
| 133 | } |
| 134 | |
| 135 | /* Create any empty directories now, as well as after the update, |
| 136 | ** so changes in settings are reflected now */ |
| 137 | if( !dryRunFlag ) ensure_empty_dirs_created(); |
| @@ -203,11 +208,13 @@ | |
| 203 | } |
| 204 | |
| 205 | db_begin_transaction(); |
| 206 | vfile_check_signature(vid, CKSIG_ENOTFILE); |
| 207 | if( !dryRunFlag && !internalUpdate ) undo_begin(); |
| 208 | load_vfile_from_rid(tid); |
| 209 | |
| 210 | /* |
| 211 | ** The record.fn field is used to match files against each other. The |
| 212 | ** FV table contains one row for each each unique filename in |
| 213 | ** in the current checkout, the pivot, and the version being merged. |
| 214 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -88,10 +88,11 @@ | |
| 88 | ** |
| 89 | ** Options: |
| 90 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 91 | ** --debug print debug information on stdout |
| 92 | ** --latest acceptable in place of VERSION, update to latest version |
| 93 | ** --force-missing force update if missing content after sync |
| 94 | ** -n|--dry-run If given, display instead of run actions |
| 95 | ** -v|--verbose print status information about all files |
| 96 | ** |
| 97 | ** See also: revert |
| 98 | */ |
| @@ -100,10 +101,11 @@ | |
| 101 | int tid=0; /* Target version - version we are changing to */ |
| 102 | Stmt q; |
| 103 | int latestFlag; /* --latest. Pick the latest version if true */ |
| 104 | int dryRunFlag; /* -n or --dry-run. Do a dry run */ |
| 105 | int verboseFlag; /* -v or --verbose. Output extra information */ |
| 106 | int forceMissingFlag; /* --force-missing. Continue if missing content */ |
| 107 | int debugFlag; /* --debug option */ |
| 108 | int setmtimeFlag; /* --setmtime. Set mtimes on files */ |
| 109 | int nChng; /* Number of file renames */ |
| 110 | int *aChng; /* Array of file renames */ |
| 111 | int i; /* Loop counter */ |
| @@ -120,18 +122,21 @@ | |
| 122 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 123 | if( !dryRunFlag ){ |
| 124 | dryRunFlag = find_option("nochange",0,0)!=0; /* deprecated */ |
| 125 | } |
| 126 | verboseFlag = find_option("verbose","v",0)!=0; |
| 127 | forceMissingFlag = find_option("force-missing",0,0)!=0; |
| 128 | debugFlag = find_option("debug",0,0)!=0; |
| 129 | setmtimeFlag = find_option("setmtime",0,0)!=0; |
| 130 | capture_case_sensitive_option(); |
| 131 | db_must_be_within_tree(); |
| 132 | vid = db_lget_int("checkout", 0); |
| 133 | user_select(); |
| 134 | if( !dryRunFlag && !internalUpdate ){ |
| 135 | if( autosync(SYNC_PULL + SYNC_VERBOSE*verboseFlag) ){ |
| 136 | fossil_fatal("Cannot proceed with update"); |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | /* Create any empty directories now, as well as after the update, |
| 141 | ** so changes in settings are reflected now */ |
| 142 | if( !dryRunFlag ) ensure_empty_dirs_created(); |
| @@ -203,11 +208,13 @@ | |
| 208 | } |
| 209 | |
| 210 | db_begin_transaction(); |
| 211 | vfile_check_signature(vid, CKSIG_ENOTFILE); |
| 212 | if( !dryRunFlag && !internalUpdate ) undo_begin(); |
| 213 | if( load_vfile_from_rid(tid) && !forceMissingFlag ){ |
| 214 | fossil_fatal("missing content, unable to update"); |
| 215 | }; |
| 216 | |
| 217 | /* |
| 218 | ** The record.fn field is used to match files against each other. The |
| 219 | ** FV table contains one row for each each unique filename in |
| 220 | ** in the current checkout, the pivot, and the version being merged. |
| 221 |
+9
-5
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -68,34 +68,36 @@ | ||
| 68 | 68 | return rid; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
| 72 | 72 | /* |
| 73 | -** Load a vfile from a record ID. | |
| 73 | +** Load a vfile from a record ID. Return the number of files with | |
| 74 | +** missing content. | |
| 74 | 75 | */ |
| 75 | -void load_vfile_from_rid(int vid){ | |
| 76 | - int rid, size; | |
| 76 | +int load_vfile_from_rid(int vid){ | |
| 77 | + int rid, size, nMissing; | |
| 77 | 78 | Stmt ins, ridq; |
| 78 | 79 | Manifest *p; |
| 79 | 80 | ManifestFile *pFile; |
| 80 | 81 | |
| 81 | 82 | if( db_exists("SELECT 1 FROM vfile WHERE vid=%d", vid) ){ |
| 82 | - return; | |
| 83 | + return 0; | |
| 83 | 84 | } |
| 84 | 85 | |
| 85 | 86 | db_begin_transaction(); |
| 86 | 87 | p = manifest_get(vid, CFTYPE_MANIFEST, 0); |
| 87 | 88 | if( p==0 ) { |
| 88 | 89 | db_end_transaction(1); |
| 89 | - return; | |
| 90 | + return 0; | |
| 90 | 91 | } |
| 91 | 92 | db_prepare(&ins, |
| 92 | 93 | "INSERT INTO vfile(vid,isexe,islink,rid,mrid,pathname) " |
| 93 | 94 | " VALUES(:vid,:isexe,:islink,:id,:id,:name)"); |
| 94 | 95 | db_prepare(&ridq, "SELECT rid,size FROM blob WHERE uuid=:uuid"); |
| 95 | 96 | db_bind_int(&ins, ":vid", vid); |
| 96 | 97 | manifest_file_rewind(p); |
| 98 | + nMissing = 0; | |
| 97 | 99 | while( (pFile = manifest_file_next(p,0))!=0 ){ |
| 98 | 100 | if( pFile->zUuid==0 || uuid_is_shunned(pFile->zUuid) ) continue; |
| 99 | 101 | db_bind_text(&ridq, ":uuid", pFile->zUuid); |
| 100 | 102 | if( db_step(&ridq)==SQLITE_ROW ){ |
| 101 | 103 | rid = db_column_int(&ridq, 0); |
| @@ -105,10 +107,11 @@ | ||
| 105 | 107 | size = 0; |
| 106 | 108 | } |
| 107 | 109 | db_reset(&ridq); |
| 108 | 110 | if( rid==0 || size<0 ){ |
| 109 | 111 | fossil_warning("content missing for %s", pFile->zName); |
| 112 | + nMissing++; | |
| 110 | 113 | continue; |
| 111 | 114 | } |
| 112 | 115 | db_bind_int(&ins, ":isexe", ( manifest_file_mperm(pFile)==PERM_EXE )); |
| 113 | 116 | db_bind_int(&ins, ":id", rid); |
| 114 | 117 | db_bind_text(&ins, ":name", pFile->zName); |
| @@ -118,10 +121,11 @@ | ||
| 118 | 121 | } |
| 119 | 122 | db_finalize(&ridq); |
| 120 | 123 | db_finalize(&ins); |
| 121 | 124 | manifest_destroy(p); |
| 122 | 125 | db_end_transaction(0); |
| 126 | + return nMissing; | |
| 123 | 127 | } |
| 124 | 128 | |
| 125 | 129 | #if INTERFACE |
| 126 | 130 | /* |
| 127 | 131 | ** The cksigFlags parameter to vfile_check_signature() is an OR-ed |
| 128 | 132 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -68,34 +68,36 @@ | |
| 68 | return rid; |
| 69 | } |
| 70 | |
| 71 | |
| 72 | /* |
| 73 | ** Load a vfile from a record ID. |
| 74 | */ |
| 75 | void load_vfile_from_rid(int vid){ |
| 76 | int rid, size; |
| 77 | Stmt ins, ridq; |
| 78 | Manifest *p; |
| 79 | ManifestFile *pFile; |
| 80 | |
| 81 | if( db_exists("SELECT 1 FROM vfile WHERE vid=%d", vid) ){ |
| 82 | return; |
| 83 | } |
| 84 | |
| 85 | db_begin_transaction(); |
| 86 | p = manifest_get(vid, CFTYPE_MANIFEST, 0); |
| 87 | if( p==0 ) { |
| 88 | db_end_transaction(1); |
| 89 | return; |
| 90 | } |
| 91 | db_prepare(&ins, |
| 92 | "INSERT INTO vfile(vid,isexe,islink,rid,mrid,pathname) " |
| 93 | " VALUES(:vid,:isexe,:islink,:id,:id,:name)"); |
| 94 | db_prepare(&ridq, "SELECT rid,size FROM blob WHERE uuid=:uuid"); |
| 95 | db_bind_int(&ins, ":vid", vid); |
| 96 | manifest_file_rewind(p); |
| 97 | while( (pFile = manifest_file_next(p,0))!=0 ){ |
| 98 | if( pFile->zUuid==0 || uuid_is_shunned(pFile->zUuid) ) continue; |
| 99 | db_bind_text(&ridq, ":uuid", pFile->zUuid); |
| 100 | if( db_step(&ridq)==SQLITE_ROW ){ |
| 101 | rid = db_column_int(&ridq, 0); |
| @@ -105,10 +107,11 @@ | |
| 105 | size = 0; |
| 106 | } |
| 107 | db_reset(&ridq); |
| 108 | if( rid==0 || size<0 ){ |
| 109 | fossil_warning("content missing for %s", pFile->zName); |
| 110 | continue; |
| 111 | } |
| 112 | db_bind_int(&ins, ":isexe", ( manifest_file_mperm(pFile)==PERM_EXE )); |
| 113 | db_bind_int(&ins, ":id", rid); |
| 114 | db_bind_text(&ins, ":name", pFile->zName); |
| @@ -118,10 +121,11 @@ | |
| 118 | } |
| 119 | db_finalize(&ridq); |
| 120 | db_finalize(&ins); |
| 121 | manifest_destroy(p); |
| 122 | db_end_transaction(0); |
| 123 | } |
| 124 | |
| 125 | #if INTERFACE |
| 126 | /* |
| 127 | ** The cksigFlags parameter to vfile_check_signature() is an OR-ed |
| 128 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -68,34 +68,36 @@ | |
| 68 | return rid; |
| 69 | } |
| 70 | |
| 71 | |
| 72 | /* |
| 73 | ** Load a vfile from a record ID. Return the number of files with |
| 74 | ** missing content. |
| 75 | */ |
| 76 | int load_vfile_from_rid(int vid){ |
| 77 | int rid, size, nMissing; |
| 78 | Stmt ins, ridq; |
| 79 | Manifest *p; |
| 80 | ManifestFile *pFile; |
| 81 | |
| 82 | if( db_exists("SELECT 1 FROM vfile WHERE vid=%d", vid) ){ |
| 83 | return 0; |
| 84 | } |
| 85 | |
| 86 | db_begin_transaction(); |
| 87 | p = manifest_get(vid, CFTYPE_MANIFEST, 0); |
| 88 | if( p==0 ) { |
| 89 | db_end_transaction(1); |
| 90 | return 0; |
| 91 | } |
| 92 | db_prepare(&ins, |
| 93 | "INSERT INTO vfile(vid,isexe,islink,rid,mrid,pathname) " |
| 94 | " VALUES(:vid,:isexe,:islink,:id,:id,:name)"); |
| 95 | db_prepare(&ridq, "SELECT rid,size FROM blob WHERE uuid=:uuid"); |
| 96 | db_bind_int(&ins, ":vid", vid); |
| 97 | manifest_file_rewind(p); |
| 98 | nMissing = 0; |
| 99 | while( (pFile = manifest_file_next(p,0))!=0 ){ |
| 100 | if( pFile->zUuid==0 || uuid_is_shunned(pFile->zUuid) ) continue; |
| 101 | db_bind_text(&ridq, ":uuid", pFile->zUuid); |
| 102 | if( db_step(&ridq)==SQLITE_ROW ){ |
| 103 | rid = db_column_int(&ridq, 0); |
| @@ -105,10 +107,11 @@ | |
| 107 | size = 0; |
| 108 | } |
| 109 | db_reset(&ridq); |
| 110 | if( rid==0 || size<0 ){ |
| 111 | fossil_warning("content missing for %s", pFile->zName); |
| 112 | nMissing++; |
| 113 | continue; |
| 114 | } |
| 115 | db_bind_int(&ins, ":isexe", ( manifest_file_mperm(pFile)==PERM_EXE )); |
| 116 | db_bind_int(&ins, ":id", rid); |
| 117 | db_bind_text(&ins, ":name", pFile->zName); |
| @@ -118,10 +121,11 @@ | |
| 121 | } |
| 122 | db_finalize(&ridq); |
| 123 | db_finalize(&ins); |
| 124 | manifest_destroy(p); |
| 125 | db_end_transaction(0); |
| 126 | return nMissing; |
| 127 | } |
| 128 | |
| 129 | #if INTERFACE |
| 130 | /* |
| 131 | ** The cksigFlags parameter to vfile_check_signature() is an OR-ed |
| 132 |
+21
-10
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -1429,15 +1429,10 @@ | ||
| 1429 | 1429 | if( syncFlags & SYNC_PRIVATE ){ |
| 1430 | 1430 | g.perm.Private = 1; |
| 1431 | 1431 | xfer.syncPrivate = 1; |
| 1432 | 1432 | } |
| 1433 | 1433 | |
| 1434 | - db_begin_transaction(); | |
| 1435 | - db_record_repository_filename(0); | |
| 1436 | - db_multi_exec( | |
| 1437 | - "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);" | |
| 1438 | - ); | |
| 1439 | 1434 | blobarray_zero(xfer.aToken, count(xfer.aToken)); |
| 1440 | 1435 | blob_zero(&send); |
| 1441 | 1436 | blob_zero(&recv); |
| 1442 | 1437 | blob_zero(&xfer.err); |
| 1443 | 1438 | blob_zero(&xfer.line); |
| @@ -1472,18 +1467,23 @@ | ||
| 1472 | 1467 | blob_appendf(&send, "push %s %s\n", zSCode, zPCode); |
| 1473 | 1468 | nCardSent++; |
| 1474 | 1469 | if( (syncFlags & SYNC_PULL)==0 ) zOpType = "Push"; |
| 1475 | 1470 | if( (syncFlags & SYNC_RESYNC)!=0 ) xfer.resync = 0x7fffffff; |
| 1476 | 1471 | } |
| 1477 | - manifest_crosslink_begin(); | |
| 1478 | 1472 | if( syncFlags & SYNC_VERBOSE ){ |
| 1479 | 1473 | fossil_print(zLabelFormat, "", "Bytes", "Cards", "Artifacts", "Deltas"); |
| 1480 | 1474 | } |
| 1481 | 1475 | |
| 1482 | 1476 | while( go ){ |
| 1483 | 1477 | int newPhantom = 0; |
| 1484 | 1478 | char *zRandomness; |
| 1479 | + db_begin_transaction(); | |
| 1480 | + db_record_repository_filename(0); | |
| 1481 | + db_multi_exec( | |
| 1482 | + "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);" | |
| 1483 | + ); | |
| 1484 | + manifest_crosslink_begin(); | |
| 1485 | 1485 | |
| 1486 | 1486 | /* Send make the most recently received cookie. Let the server |
| 1487 | 1487 | ** figure out if this is a cookie that it cares about. |
| 1488 | 1488 | */ |
| 1489 | 1489 | zCookie = db_get("cookie", 0); |
| @@ -1559,10 +1559,11 @@ | ||
| 1559 | 1559 | fflush(stdout); |
| 1560 | 1560 | /* Exchange messages with the server */ |
| 1561 | 1561 | if( http_exchange(&send, &recv, (syncFlags & SYNC_CLONE)==0 || nCycle>0, |
| 1562 | 1562 | MAX_REDIRECTS) ){ |
| 1563 | 1563 | nErr++; |
| 1564 | + go = 2; | |
| 1564 | 1565 | break; |
| 1565 | 1566 | } |
| 1566 | 1567 | |
| 1567 | 1568 | /* Output current stats */ |
| 1568 | 1569 | if( syncFlags & SYNC_VERBOSE ){ |
| @@ -1910,10 +1911,18 @@ | ||
| 1910 | 1911 | ** we have gone at least two rounds. Always go at least two rounds |
| 1911 | 1912 | ** on a clone in order to be sure to retrieve the configuration |
| 1912 | 1913 | ** information which is only sent on the second round. |
| 1913 | 1914 | */ |
| 1914 | 1915 | if( cloneSeqno<=0 && nCycle>1 ) go = 0; |
| 1916 | + db_multi_exec("DROP TABLE onremote"); | |
| 1917 | + if( go ){ | |
| 1918 | + manifest_crosslink_end(MC_PERMIT_HOOKS); | |
| 1919 | + }else{ | |
| 1920 | + manifest_crosslink_end(MC_PERMIT_HOOKS); | |
| 1921 | + content_enable_dephantomize(1); | |
| 1922 | + } | |
| 1923 | + db_end_transaction(0); | |
| 1915 | 1924 | }; |
| 1916 | 1925 | transport_stats(&nSent, &nRcvd, 1); |
| 1917 | 1926 | if( (rSkew*24.0*3600.0) > 10.0 ){ |
| 1918 | 1927 | fossil_warning("*** time skew *** server is fast by %s", |
| 1919 | 1928 | db_timespan_name(rSkew)); |
| @@ -1928,11 +1937,13 @@ | ||
| 1928 | 1937 | fossil_print( |
| 1929 | 1938 | "%s finished with %lld bytes sent, %lld bytes received\n", |
| 1930 | 1939 | zOpType, nSent, nRcvd); |
| 1931 | 1940 | transport_close(&g.url); |
| 1932 | 1941 | transport_global_shutdown(&g.url); |
| 1933 | - db_multi_exec("DROP TABLE onremote"); | |
| 1934 | - manifest_crosslink_end(MC_PERMIT_HOOKS); | |
| 1935 | - content_enable_dephantomize(1); | |
| 1936 | - db_end_transaction(0); | |
| 1942 | + if( nErr && go==2 ){ | |
| 1943 | + db_multi_exec("DROP TABLE onremote"); | |
| 1944 | + manifest_crosslink_end(MC_PERMIT_HOOKS); | |
| 1945 | + content_enable_dephantomize(1); | |
| 1946 | + db_end_transaction(0); | |
| 1947 | + } | |
| 1937 | 1948 | return nErr; |
| 1938 | 1949 | } |
| 1939 | 1950 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1429,15 +1429,10 @@ | |
| 1429 | if( syncFlags & SYNC_PRIVATE ){ |
| 1430 | g.perm.Private = 1; |
| 1431 | xfer.syncPrivate = 1; |
| 1432 | } |
| 1433 | |
| 1434 | db_begin_transaction(); |
| 1435 | db_record_repository_filename(0); |
| 1436 | db_multi_exec( |
| 1437 | "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);" |
| 1438 | ); |
| 1439 | blobarray_zero(xfer.aToken, count(xfer.aToken)); |
| 1440 | blob_zero(&send); |
| 1441 | blob_zero(&recv); |
| 1442 | blob_zero(&xfer.err); |
| 1443 | blob_zero(&xfer.line); |
| @@ -1472,18 +1467,23 @@ | |
| 1472 | blob_appendf(&send, "push %s %s\n", zSCode, zPCode); |
| 1473 | nCardSent++; |
| 1474 | if( (syncFlags & SYNC_PULL)==0 ) zOpType = "Push"; |
| 1475 | if( (syncFlags & SYNC_RESYNC)!=0 ) xfer.resync = 0x7fffffff; |
| 1476 | } |
| 1477 | manifest_crosslink_begin(); |
| 1478 | if( syncFlags & SYNC_VERBOSE ){ |
| 1479 | fossil_print(zLabelFormat, "", "Bytes", "Cards", "Artifacts", "Deltas"); |
| 1480 | } |
| 1481 | |
| 1482 | while( go ){ |
| 1483 | int newPhantom = 0; |
| 1484 | char *zRandomness; |
| 1485 | |
| 1486 | /* Send make the most recently received cookie. Let the server |
| 1487 | ** figure out if this is a cookie that it cares about. |
| 1488 | */ |
| 1489 | zCookie = db_get("cookie", 0); |
| @@ -1559,10 +1559,11 @@ | |
| 1559 | fflush(stdout); |
| 1560 | /* Exchange messages with the server */ |
| 1561 | if( http_exchange(&send, &recv, (syncFlags & SYNC_CLONE)==0 || nCycle>0, |
| 1562 | MAX_REDIRECTS) ){ |
| 1563 | nErr++; |
| 1564 | break; |
| 1565 | } |
| 1566 | |
| 1567 | /* Output current stats */ |
| 1568 | if( syncFlags & SYNC_VERBOSE ){ |
| @@ -1910,10 +1911,18 @@ | |
| 1910 | ** we have gone at least two rounds. Always go at least two rounds |
| 1911 | ** on a clone in order to be sure to retrieve the configuration |
| 1912 | ** information which is only sent on the second round. |
| 1913 | */ |
| 1914 | if( cloneSeqno<=0 && nCycle>1 ) go = 0; |
| 1915 | }; |
| 1916 | transport_stats(&nSent, &nRcvd, 1); |
| 1917 | if( (rSkew*24.0*3600.0) > 10.0 ){ |
| 1918 | fossil_warning("*** time skew *** server is fast by %s", |
| 1919 | db_timespan_name(rSkew)); |
| @@ -1928,11 +1937,13 @@ | |
| 1928 | fossil_print( |
| 1929 | "%s finished with %lld bytes sent, %lld bytes received\n", |
| 1930 | zOpType, nSent, nRcvd); |
| 1931 | transport_close(&g.url); |
| 1932 | transport_global_shutdown(&g.url); |
| 1933 | db_multi_exec("DROP TABLE onremote"); |
| 1934 | manifest_crosslink_end(MC_PERMIT_HOOKS); |
| 1935 | content_enable_dephantomize(1); |
| 1936 | db_end_transaction(0); |
| 1937 | return nErr; |
| 1938 | } |
| 1939 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1429,15 +1429,10 @@ | |
| 1429 | if( syncFlags & SYNC_PRIVATE ){ |
| 1430 | g.perm.Private = 1; |
| 1431 | xfer.syncPrivate = 1; |
| 1432 | } |
| 1433 | |
| 1434 | blobarray_zero(xfer.aToken, count(xfer.aToken)); |
| 1435 | blob_zero(&send); |
| 1436 | blob_zero(&recv); |
| 1437 | blob_zero(&xfer.err); |
| 1438 | blob_zero(&xfer.line); |
| @@ -1472,18 +1467,23 @@ | |
| 1467 | blob_appendf(&send, "push %s %s\n", zSCode, zPCode); |
| 1468 | nCardSent++; |
| 1469 | if( (syncFlags & SYNC_PULL)==0 ) zOpType = "Push"; |
| 1470 | if( (syncFlags & SYNC_RESYNC)!=0 ) xfer.resync = 0x7fffffff; |
| 1471 | } |
| 1472 | if( syncFlags & SYNC_VERBOSE ){ |
| 1473 | fossil_print(zLabelFormat, "", "Bytes", "Cards", "Artifacts", "Deltas"); |
| 1474 | } |
| 1475 | |
| 1476 | while( go ){ |
| 1477 | int newPhantom = 0; |
| 1478 | char *zRandomness; |
| 1479 | db_begin_transaction(); |
| 1480 | db_record_repository_filename(0); |
| 1481 | db_multi_exec( |
| 1482 | "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);" |
| 1483 | ); |
| 1484 | manifest_crosslink_begin(); |
| 1485 | |
| 1486 | /* Send make the most recently received cookie. Let the server |
| 1487 | ** figure out if this is a cookie that it cares about. |
| 1488 | */ |
| 1489 | zCookie = db_get("cookie", 0); |
| @@ -1559,10 +1559,11 @@ | |
| 1559 | fflush(stdout); |
| 1560 | /* Exchange messages with the server */ |
| 1561 | if( http_exchange(&send, &recv, (syncFlags & SYNC_CLONE)==0 || nCycle>0, |
| 1562 | MAX_REDIRECTS) ){ |
| 1563 | nErr++; |
| 1564 | go = 2; |
| 1565 | break; |
| 1566 | } |
| 1567 | |
| 1568 | /* Output current stats */ |
| 1569 | if( syncFlags & SYNC_VERBOSE ){ |
| @@ -1910,10 +1911,18 @@ | |
| 1911 | ** we have gone at least two rounds. Always go at least two rounds |
| 1912 | ** on a clone in order to be sure to retrieve the configuration |
| 1913 | ** information which is only sent on the second round. |
| 1914 | */ |
| 1915 | if( cloneSeqno<=0 && nCycle>1 ) go = 0; |
| 1916 | db_multi_exec("DROP TABLE onremote"); |
| 1917 | if( go ){ |
| 1918 | manifest_crosslink_end(MC_PERMIT_HOOKS); |
| 1919 | }else{ |
| 1920 | manifest_crosslink_end(MC_PERMIT_HOOKS); |
| 1921 | content_enable_dephantomize(1); |
| 1922 | } |
| 1923 | db_end_transaction(0); |
| 1924 | }; |
| 1925 | transport_stats(&nSent, &nRcvd, 1); |
| 1926 | if( (rSkew*24.0*3600.0) > 10.0 ){ |
| 1927 | fossil_warning("*** time skew *** server is fast by %s", |
| 1928 | db_timespan_name(rSkew)); |
| @@ -1928,11 +1937,13 @@ | |
| 1937 | fossil_print( |
| 1938 | "%s finished with %lld bytes sent, %lld bytes received\n", |
| 1939 | zOpType, nSent, nRcvd); |
| 1940 | transport_close(&g.url); |
| 1941 | transport_global_shutdown(&g.url); |
| 1942 | if( nErr && go==2 ){ |
| 1943 | db_multi_exec("DROP TABLE onremote"); |
| 1944 | manifest_crosslink_end(MC_PERMIT_HOOKS); |
| 1945 | content_enable_dephantomize(1); |
| 1946 | db_end_transaction(0); |
| 1947 | } |
| 1948 | return nErr; |
| 1949 | } |
| 1950 |
+7
| --- www/changes.wiki | ||
| +++ www/changes.wiki | ||
| @@ -48,10 +48,17 @@ | ||
| 48 | 48 | * Issue a warning if a [/help?cmd=add|fossil add] command tries to add a file |
| 49 | 49 | that matches the ignore-glob. |
| 50 | 50 | * Add option -W|--width to "[/help?cmd=stash|fossil stash ls]" |
| 51 | 51 | and "[/help?cmd=leaves|fossil leaves]" commands. |
| 52 | 52 | * Enhance support for running as the root user. Now works on Haiku. |
| 53 | + * [/help?cmd=new|fossil new] no longer creates an initial empty commit by | |
| 54 | + default. The first commit after checking out a new empty repository will | |
| 55 | + become the initial commit. | |
| 56 | + * Enhance sync operations by committing each round-trip to minimize number | |
| 57 | + of retransmits when autosync fails. Include option for | |
| 58 | + [/help?cmd=update| fossil update] and [/help?cmd=merge| fossil merge] to | |
| 59 | + continue even if missing content. | |
| 53 | 60 | |
| 54 | 61 | <h2>Changes For Version 1.28 (2014-01-27)</h2> |
| 55 | 62 | * Enhance [/help?cmd=/reports | /reports] to support event type filtering. |
| 56 | 63 | * When cloning a repository, the user name passed via the URL (if any) |
| 57 | 64 | is now used as the default local admin user's name. |
| 58 | 65 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -48,10 +48,17 @@ | |
| 48 | * Issue a warning if a [/help?cmd=add|fossil add] command tries to add a file |
| 49 | that matches the ignore-glob. |
| 50 | * Add option -W|--width to "[/help?cmd=stash|fossil stash ls]" |
| 51 | and "[/help?cmd=leaves|fossil leaves]" commands. |
| 52 | * Enhance support for running as the root user. Now works on Haiku. |
| 53 | |
| 54 | <h2>Changes For Version 1.28 (2014-01-27)</h2> |
| 55 | * Enhance [/help?cmd=/reports | /reports] to support event type filtering. |
| 56 | * When cloning a repository, the user name passed via the URL (if any) |
| 57 | is now used as the default local admin user's name. |
| 58 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -48,10 +48,17 @@ | |
| 48 | * Issue a warning if a [/help?cmd=add|fossil add] command tries to add a file |
| 49 | that matches the ignore-glob. |
| 50 | * Add option -W|--width to "[/help?cmd=stash|fossil stash ls]" |
| 51 | and "[/help?cmd=leaves|fossil leaves]" commands. |
| 52 | * Enhance support for running as the root user. Now works on Haiku. |
| 53 | * [/help?cmd=new|fossil new] no longer creates an initial empty commit by |
| 54 | default. The first commit after checking out a new empty repository will |
| 55 | become the initial commit. |
| 56 | * Enhance sync operations by committing each round-trip to minimize number |
| 57 | of retransmits when autosync fails. Include option for |
| 58 | [/help?cmd=update| fossil update] and [/help?cmd=merge| fossil merge] to |
| 59 | continue even if missing content. |
| 60 | |
| 61 | <h2>Changes For Version 1.28 (2014-01-27)</h2> |
| 62 | * Enhance [/help?cmd=/reports | /reports] to support event type filtering. |
| 63 | * When cloning a repository, the user name passed via the URL (if any) |
| 64 | is now used as the default local admin user's name. |
| 65 |
+1
-1
| --- www/shunning.wiki | ||
| +++ www/shunning.wiki | ||
| @@ -65,11 +65,11 @@ | ||
| 65 | 65 | another repository that has not shunned the artifact. |
| 66 | 66 | |
| 67 | 67 | <h3>Managing the shunning list</h3> |
| 68 | 68 | |
| 69 | 69 | The complete shunning list for a repository can be viewed by a user |
| 70 | -with "admin" privilege on the "/shunned" URL of the web interface to Fossil. | |
| 70 | +with "admin" privilege on the "/shun" URL of the web interface to Fossil. | |
| 71 | 71 | That URL is accessible under the "Admin" button on the default menu |
| 72 | 72 | bar. Items can be added to or removed from the shunning list. "Sync" |
| 73 | 73 | operations are inhibited as soon as the artifact is added to the |
| 74 | 74 | shunning list, but the content of the artifact is not actually removed |
| 75 | 75 | from the repository until the next time the repository is rebuilt. |
| 76 | 76 |
| --- www/shunning.wiki | |
| +++ www/shunning.wiki | |
| @@ -65,11 +65,11 @@ | |
| 65 | another repository that has not shunned the artifact. |
| 66 | |
| 67 | <h3>Managing the shunning list</h3> |
| 68 | |
| 69 | The complete shunning list for a repository can be viewed by a user |
| 70 | with "admin" privilege on the "/shunned" URL of the web interface to Fossil. |
| 71 | That URL is accessible under the "Admin" button on the default menu |
| 72 | bar. Items can be added to or removed from the shunning list. "Sync" |
| 73 | operations are inhibited as soon as the artifact is added to the |
| 74 | shunning list, but the content of the artifact is not actually removed |
| 75 | from the repository until the next time the repository is rebuilt. |
| 76 |
| --- www/shunning.wiki | |
| +++ www/shunning.wiki | |
| @@ -65,11 +65,11 @@ | |
| 65 | another repository that has not shunned the artifact. |
| 66 | |
| 67 | <h3>Managing the shunning list</h3> |
| 68 | |
| 69 | The complete shunning list for a repository can be viewed by a user |
| 70 | with "admin" privilege on the "/shun" URL of the web interface to Fossil. |
| 71 | That URL is accessible under the "Admin" button on the default menu |
| 72 | bar. Items can be added to or removed from the shunning list. "Sync" |
| 73 | operations are inhibited as soon as the artifact is added to the |
| 74 | shunning list, but the content of the artifact is not actually removed |
| 75 | from the repository until the next time the repository is rebuilt. |
| 76 |