Fossil SCM
Get "fossil undo" working on merges that involve name changes.
Commit
5d42fe9fee4512217d43b944ef11181a2651485e
Parent
c52927c76d94a9b…
2 files changed
+1
-1
+12
-1
+1
-1
| --- src/undo.c | ||
| +++ src/undo.c | ||
| @@ -194,11 +194,11 @@ | ||
| 194 | 194 | |
| 195 | 195 | if( !undoActive ) return; |
| 196 | 196 | zFullname = mprintf("%s/%s", g.zLocalRoot, zPathname); |
| 197 | 197 | existsFlag = file_size(zFullname)>=0; |
| 198 | 198 | db_prepare(&q, |
| 199 | - "REPLACE INTO undo(pathname,redoflag,existsflag,content)" | |
| 199 | + "INSERT OR IGNORE INTO undo(pathname,redoflag,existsflag,content)" | |
| 200 | 200 | " VALUES(%Q,0,%d,:c)", |
| 201 | 201 | zPathname, existsFlag |
| 202 | 202 | ); |
| 203 | 203 | if( existsFlag ){ |
| 204 | 204 | blob_read_from_file(&content, zFullname); |
| 205 | 205 |
| --- src/undo.c | |
| +++ src/undo.c | |
| @@ -194,11 +194,11 @@ | |
| 194 | |
| 195 | if( !undoActive ) return; |
| 196 | zFullname = mprintf("%s/%s", g.zLocalRoot, zPathname); |
| 197 | existsFlag = file_size(zFullname)>=0; |
| 198 | db_prepare(&q, |
| 199 | "REPLACE INTO undo(pathname,redoflag,existsflag,content)" |
| 200 | " VALUES(%Q,0,%d,:c)", |
| 201 | zPathname, existsFlag |
| 202 | ); |
| 203 | if( existsFlag ){ |
| 204 | blob_read_from_file(&content, zFullname); |
| 205 |
| --- src/undo.c | |
| +++ src/undo.c | |
| @@ -194,11 +194,11 @@ | |
| 194 | |
| 195 | if( !undoActive ) return; |
| 196 | zFullname = mprintf("%s/%s", g.zLocalRoot, zPathname); |
| 197 | existsFlag = file_size(zFullname)>=0; |
| 198 | db_prepare(&q, |
| 199 | "INSERT OR IGNORE INTO undo(pathname,redoflag,existsflag,content)" |
| 200 | " VALUES(%Q,0,%d,:c)", |
| 201 | zPathname, existsFlag |
| 202 | ); |
| 203 | if( existsFlag ){ |
| 204 | blob_read_from_file(&content, zFullname); |
| 205 |
+12
-1
| --- test/merge5.test | ||
| +++ test/merge5.test | ||
| @@ -235,11 +235,22 @@ | ||
| 235 | 235 | fossil undo |
| 236 | 236 | |
| 237 | 237 | # Merge br5 (which includes a file rename) into chng3 |
| 238 | 238 | # |
| 239 | 239 | fossil update chng3 |
| 240 | -fossil merge br5 | |
| 241 | 240 | checkout-test 130 { |
| 241 | + 6f525ab779ad66e24474d845c5fb7938be42d50d one.txt | |
| 242 | + 64a8a5c7320fccfa4b2e5dfc5fd20a5381a86c5b three.txt | |
| 243 | + b262fee89ed8a27a23a5e09d3917e0bebe22cd24 two.txt | |
| 244 | +} | |
| 245 | +fossil merge br5 | |
| 246 | +checkout-test 131 { | |
| 242 | 247 | 7eaf64a2c9141277b4c24259c7766d6a77047af7 one.txt |
| 243 | 248 | 98e47f99bb9fed4fdcd407f553615ca7f15a38a2 three.txt |
| 244 | 249 | e58c5da3e6007d0e30600ea31611813093ad180f two-rename.txt |
| 245 | 250 | } |
| 251 | +fossil undo | |
| 252 | +checkout-test 132 { | |
| 253 | + 6f525ab779ad66e24474d845c5fb7938be42d50d one.txt | |
| 254 | + 64a8a5c7320fccfa4b2e5dfc5fd20a5381a86c5b three.txt | |
| 255 | + b262fee89ed8a27a23a5e09d3917e0bebe22cd24 two.txt | |
| 256 | +} | |
| 246 | 257 |
| --- test/merge5.test | |
| +++ test/merge5.test | |
| @@ -235,11 +235,22 @@ | |
| 235 | fossil undo |
| 236 | |
| 237 | # Merge br5 (which includes a file rename) into chng3 |
| 238 | # |
| 239 | fossil update chng3 |
| 240 | fossil merge br5 |
| 241 | checkout-test 130 { |
| 242 | 7eaf64a2c9141277b4c24259c7766d6a77047af7 one.txt |
| 243 | 98e47f99bb9fed4fdcd407f553615ca7f15a38a2 three.txt |
| 244 | e58c5da3e6007d0e30600ea31611813093ad180f two-rename.txt |
| 245 | } |
| 246 |
| --- test/merge5.test | |
| +++ test/merge5.test | |
| @@ -235,11 +235,22 @@ | |
| 235 | fossil undo |
| 236 | |
| 237 | # Merge br5 (which includes a file rename) into chng3 |
| 238 | # |
| 239 | fossil update chng3 |
| 240 | checkout-test 130 { |
| 241 | 6f525ab779ad66e24474d845c5fb7938be42d50d one.txt |
| 242 | 64a8a5c7320fccfa4b2e5dfc5fd20a5381a86c5b three.txt |
| 243 | b262fee89ed8a27a23a5e09d3917e0bebe22cd24 two.txt |
| 244 | } |
| 245 | fossil merge br5 |
| 246 | checkout-test 131 { |
| 247 | 7eaf64a2c9141277b4c24259c7766d6a77047af7 one.txt |
| 248 | 98e47f99bb9fed4fdcd407f553615ca7f15a38a2 three.txt |
| 249 | e58c5da3e6007d0e30600ea31611813093ad180f two-rename.txt |
| 250 | } |
| 251 | fossil undo |
| 252 | checkout-test 132 { |
| 253 | 6f525ab779ad66e24474d845c5fb7938be42d50d one.txt |
| 254 | 64a8a5c7320fccfa4b2e5dfc5fd20a5381a86c5b three.txt |
| 255 | b262fee89ed8a27a23a5e09d3917e0bebe22cd24 two.txt |
| 256 | } |
| 257 |