Fossil SCM
Do not remove files that have been edited when doing an "update". Instead, mark the files as CONFLICT.
Commit
fe6ee8a431b69e5695801bd703fb6a38ce30dc40
Parent
20bcbcf2f2b2518…
1 file changed
+9
-5
+9
-5
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -144,15 +144,19 @@ | ||
| 144 | 144 | }else if( idt>0 && idv>0 && ridt!=ridv && chnged==0 ){ |
| 145 | 145 | /* The file is unedited. Change it to the target version */ |
| 146 | 146 | printf("UPDATE %s\n", zName); |
| 147 | 147 | vfile_to_disk(0, idt, 0); |
| 148 | 148 | }else if( idt==0 && idv>0 ){ |
| 149 | - char *zFullPath; | |
| 150 | - printf("REMOVE %s\n", zName); | |
| 151 | - zFullPath = mprintf("%s/%s", g.zLocalRoot, zName); | |
| 152 | - unlink(zFullPath); | |
| 153 | - free(zFullPath); | |
| 149 | + if( chnged ){ | |
| 150 | + printf("CONFLICT %s\n", zName); | |
| 151 | + }else{ | |
| 152 | + char *zFullPath; | |
| 153 | + printf("REMOVE %s\n", zName); | |
| 154 | + zFullPath = mprintf("%s/%s", g.zLocalRoot, zName); | |
| 155 | + unlink(zFullPath); | |
| 156 | + free(zFullPath); | |
| 157 | + } | |
| 154 | 158 | }else if( idt>0 && idv>0 && ridt!=ridv && chnged ){ |
| 155 | 159 | /* Merge the changes in the current tree into the target version */ |
| 156 | 160 | Blob e, r, t, v; |
| 157 | 161 | char *zFullPath; |
| 158 | 162 | printf("MERGE %s\n", zName); |
| 159 | 163 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -144,15 +144,19 @@ | |
| 144 | }else if( idt>0 && idv>0 && ridt!=ridv && chnged==0 ){ |
| 145 | /* The file is unedited. Change it to the target version */ |
| 146 | printf("UPDATE %s\n", zName); |
| 147 | vfile_to_disk(0, idt, 0); |
| 148 | }else if( idt==0 && idv>0 ){ |
| 149 | char *zFullPath; |
| 150 | printf("REMOVE %s\n", zName); |
| 151 | zFullPath = mprintf("%s/%s", g.zLocalRoot, zName); |
| 152 | unlink(zFullPath); |
| 153 | free(zFullPath); |
| 154 | }else if( idt>0 && idv>0 && ridt!=ridv && chnged ){ |
| 155 | /* Merge the changes in the current tree into the target version */ |
| 156 | Blob e, r, t, v; |
| 157 | char *zFullPath; |
| 158 | printf("MERGE %s\n", zName); |
| 159 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -144,15 +144,19 @@ | |
| 144 | }else if( idt>0 && idv>0 && ridt!=ridv && chnged==0 ){ |
| 145 | /* The file is unedited. Change it to the target version */ |
| 146 | printf("UPDATE %s\n", zName); |
| 147 | vfile_to_disk(0, idt, 0); |
| 148 | }else if( idt==0 && idv>0 ){ |
| 149 | if( chnged ){ |
| 150 | printf("CONFLICT %s\n", zName); |
| 151 | }else{ |
| 152 | char *zFullPath; |
| 153 | printf("REMOVE %s\n", zName); |
| 154 | zFullPath = mprintf("%s/%s", g.zLocalRoot, zName); |
| 155 | unlink(zFullPath); |
| 156 | free(zFullPath); |
| 157 | } |
| 158 | }else if( idt>0 && idv>0 && ridt!=ridv && chnged ){ |
| 159 | /* Merge the changes in the current tree into the target version */ |
| 160 | Blob e, r, t, v; |
| 161 | char *zFullPath; |
| 162 | printf("MERGE %s\n", zName); |
| 163 |