Fossil SCM

Do not remove files that have been edited when doing an "update". Instead, mark the files as CONFLICT.

drh 2007-08-08 15:30 trunk
Commit fe6ee8a431b69e5695801bd703fb6a38ce30dc40
1 file changed +9 -5
+9 -5
--- src/update.c
+++ src/update.c
@@ -144,15 +144,19 @@
144144
}else if( idt>0 && idv>0 && ridt!=ridv && chnged==0 ){
145145
/* The file is unedited. Change it to the target version */
146146
printf("UPDATE %s\n", zName);
147147
vfile_to_disk(0, idt, 0);
148148
}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
+ }
154158
}else if( idt>0 && idv>0 && ridt!=ridv && chnged ){
155159
/* Merge the changes in the current tree into the target version */
156160
Blob e, r, t, v;
157161
char *zFullPath;
158162
printf("MERGE %s\n", zName);
159163
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button