Fossil SCM
stash patch from [forum:b96b0755a0|forum post b96b0755a0] which updates it to handle the NULL stashfile.hash case introduced in [ed06585f41]. This resolves the 11 failing stash tests.
Commit
4531bcd49774708cfd9746f33d09f6fa715389036bc7b5bbdf3db7366e08552f
Parent
b9107e42cdb3bad…
1 file changed
+8
-4
+8
-4
| --- src/stash.c | ||
| +++ src/stash.c | ||
| @@ -308,12 +308,14 @@ | ||
| 308 | 308 | static void stash_apply(int stashid, int nConflict){ |
| 309 | 309 | int vid; |
| 310 | 310 | Stmt q; |
| 311 | 311 | db_prepare(&q, |
| 312 | 312 | "SELECT blob.rid, isRemoved, isExec, isLink, origname, newname, delta" |
| 313 | - " FROM stashfile, blob WHERE stashid=%d AND blob.uuid=stashfile.hash", | |
| 314 | - stashid | |
| 313 | + " FROM stashfile, blob WHERE stashid=%d AND blob.uuid=stashfile.hash" | |
| 314 | + " UNION ALL SELECT 0, isRemoved, isExec, isLink, origname, newname, delta" | |
| 315 | + " FROM stashfile WHERE stashid=%d AND stashfile.hash IS NULL", | |
| 316 | + stashid, stashid | |
| 315 | 317 | ); |
| 316 | 318 | vid = db_lget_int("checkout",0); |
| 317 | 319 | db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)", |
| 318 | 320 | filename_collation()); |
| 319 | 321 | while( db_step(&q)==SQLITE_ROW ){ |
| @@ -412,12 +414,14 @@ | ||
| 412 | 414 | int bWebpage = (pCfg->diffFlags & (DIFF_WEBPAGE|DIFF_JSON|DIFF_TCL))!=0; |
| 413 | 415 | blob_zero(&empty); |
| 414 | 416 | diff_begin(pCfg); |
| 415 | 417 | db_prepare(&q, |
| 416 | 418 | "SELECT blob.rid, isRemoved, isExec, isLink, origname, newname, delta" |
| 417 | - " FROM stashfile, blob WHERE stashid=%d AND blob.uuid=stashfile.hash", | |
| 418 | - stashid | |
| 419 | + " FROM stashfile, blob WHERE stashid=%d AND blob.uuid=stashfile.hash" | |
| 420 | + " UNION ALL SELECT 0, isRemoved, isExec, isLink, origname, newname, delta" | |
| 421 | + " FROM stashfile WHERE stashid=%d AND stashfile.hash IS NULL", | |
| 422 | + stashid, stashid | |
| 419 | 423 | ); |
| 420 | 424 | while( db_step(&q)==SQLITE_ROW ){ |
| 421 | 425 | int rid = db_column_int(&q, 0); |
| 422 | 426 | int isRemoved = db_column_int(&q, 1); |
| 423 | 427 | int isLink = db_column_int(&q, 3); |
| 424 | 428 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -308,12 +308,14 @@ | |
| 308 | static void stash_apply(int stashid, int nConflict){ |
| 309 | int vid; |
| 310 | Stmt q; |
| 311 | db_prepare(&q, |
| 312 | "SELECT blob.rid, isRemoved, isExec, isLink, origname, newname, delta" |
| 313 | " FROM stashfile, blob WHERE stashid=%d AND blob.uuid=stashfile.hash", |
| 314 | stashid |
| 315 | ); |
| 316 | vid = db_lget_int("checkout",0); |
| 317 | db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)", |
| 318 | filename_collation()); |
| 319 | while( db_step(&q)==SQLITE_ROW ){ |
| @@ -412,12 +414,14 @@ | |
| 412 | int bWebpage = (pCfg->diffFlags & (DIFF_WEBPAGE|DIFF_JSON|DIFF_TCL))!=0; |
| 413 | blob_zero(&empty); |
| 414 | diff_begin(pCfg); |
| 415 | db_prepare(&q, |
| 416 | "SELECT blob.rid, isRemoved, isExec, isLink, origname, newname, delta" |
| 417 | " FROM stashfile, blob WHERE stashid=%d AND blob.uuid=stashfile.hash", |
| 418 | stashid |
| 419 | ); |
| 420 | while( db_step(&q)==SQLITE_ROW ){ |
| 421 | int rid = db_column_int(&q, 0); |
| 422 | int isRemoved = db_column_int(&q, 1); |
| 423 | int isLink = db_column_int(&q, 3); |
| 424 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -308,12 +308,14 @@ | |
| 308 | static void stash_apply(int stashid, int nConflict){ |
| 309 | int vid; |
| 310 | Stmt q; |
| 311 | db_prepare(&q, |
| 312 | "SELECT blob.rid, isRemoved, isExec, isLink, origname, newname, delta" |
| 313 | " FROM stashfile, blob WHERE stashid=%d AND blob.uuid=stashfile.hash" |
| 314 | " UNION ALL SELECT 0, isRemoved, isExec, isLink, origname, newname, delta" |
| 315 | " FROM stashfile WHERE stashid=%d AND stashfile.hash IS NULL", |
| 316 | stashid, stashid |
| 317 | ); |
| 318 | vid = db_lget_int("checkout",0); |
| 319 | db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)", |
| 320 | filename_collation()); |
| 321 | while( db_step(&q)==SQLITE_ROW ){ |
| @@ -412,12 +414,14 @@ | |
| 414 | int bWebpage = (pCfg->diffFlags & (DIFF_WEBPAGE|DIFF_JSON|DIFF_TCL))!=0; |
| 415 | blob_zero(&empty); |
| 416 | diff_begin(pCfg); |
| 417 | db_prepare(&q, |
| 418 | "SELECT blob.rid, isRemoved, isExec, isLink, origname, newname, delta" |
| 419 | " FROM stashfile, blob WHERE stashid=%d AND blob.uuid=stashfile.hash" |
| 420 | " UNION ALL SELECT 0, isRemoved, isExec, isLink, origname, newname, delta" |
| 421 | " FROM stashfile WHERE stashid=%d AND stashfile.hash IS NULL", |
| 422 | stashid, stashid |
| 423 | ); |
| 424 | while( db_step(&q)==SQLITE_ROW ){ |
| 425 | int rid = db_column_int(&q, 0); |
| 426 | int isRemoved = db_column_int(&q, 1); |
| 427 | int isLink = db_column_int(&q, 3); |
| 428 |