Fossil SCM
When doing a "fossil stash" make sure that the stash has committed before deleting changes from disk, so that the changes can be recovered if something goes wrong.
Commit
60af514d13969c79e4e82c4c116cee1b56424c1d73994148ea070654c6cd2a7c
Parent
35c8103e6d90413…
1 file changed
+3
+3
| --- src/stash.c | ||
| +++ src/stash.c | ||
| @@ -608,10 +608,13 @@ | ||
| 608 | 608 | newArgv[1] = 0; |
| 609 | 609 | g.argv = newArgv; |
| 610 | 610 | g.argc = nFile+2; |
| 611 | 611 | if( nFile==0 ) return; |
| 612 | 612 | } |
| 613 | + /* Make sure the stash has committed before running the revert, so that | |
| 614 | + ** we have a copy of the changes before deleting them. */ | |
| 615 | + db_commit_transaction(); | |
| 613 | 616 | g.argv[1] = "revert"; |
| 614 | 617 | revert_cmd(); |
| 615 | 618 | }else |
| 616 | 619 | if( memcmp(zCmd, "snapshot", nCmd)==0 ){ |
| 617 | 620 | stash_create(); |
| 618 | 621 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -608,10 +608,13 @@ | |
| 608 | newArgv[1] = 0; |
| 609 | g.argv = newArgv; |
| 610 | g.argc = nFile+2; |
| 611 | if( nFile==0 ) return; |
| 612 | } |
| 613 | g.argv[1] = "revert"; |
| 614 | revert_cmd(); |
| 615 | }else |
| 616 | if( memcmp(zCmd, "snapshot", nCmd)==0 ){ |
| 617 | stash_create(); |
| 618 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -608,10 +608,13 @@ | |
| 608 | newArgv[1] = 0; |
| 609 | g.argv = newArgv; |
| 610 | g.argc = nFile+2; |
| 611 | if( nFile==0 ) return; |
| 612 | } |
| 613 | /* Make sure the stash has committed before running the revert, so that |
| 614 | ** we have a copy of the changes before deleting them. */ |
| 615 | db_commit_transaction(); |
| 616 | g.argv[1] = "revert"; |
| 617 | revert_cmd(); |
| 618 | }else |
| 619 | if( memcmp(zCmd, "snapshot", nCmd)==0 ){ |
| 620 | stash_create(); |
| 621 |