Fossil SCM
Prohibit partial check-ins of a merge. To allow such a thing would confuse the branch tracking logic. There are still problems in the partial check-in logic for cases were new files have been added to the repository.
Commit
aafd536a5cced0647c402e7c820e8aaa3c232ac2
Parent
f5e8b1d736ab0c0…
1 file changed
+5
-1
+5
-1
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -230,11 +230,11 @@ | ||
| 230 | 230 | */ |
| 231 | 231 | void select_commit_files(void){ |
| 232 | 232 | if( g.argc>2 ){ |
| 233 | 233 | int ii; |
| 234 | 234 | Blob b; |
| 235 | - memset(&b, 0, sizeof(Blob)); | |
| 235 | + blob_zero(&b); | |
| 236 | 236 | g.aCommitFile = malloc(sizeof(int)*(g.argc-1)); |
| 237 | 237 | |
| 238 | 238 | for(ii=2; ii<g.argc; ii++){ |
| 239 | 239 | int iId; |
| 240 | 240 | if( !file_tree_name(g.argv[ii], &b) ){ |
| @@ -243,10 +243,11 @@ | ||
| 243 | 243 | iId = db_int(-1, "SELECT id FROM vfile WHERE pathname=%Q", blob_str(&b)); |
| 244 | 244 | if( iId<0 ){ |
| 245 | 245 | fossil_fatal("fossil knows nothing about: %s", g.argv[ii]); |
| 246 | 246 | } |
| 247 | 247 | g.aCommitFile[ii-2] = iId; |
| 248 | + blob_reset(&b); | |
| 248 | 249 | } |
| 249 | 250 | g.aCommitFile[ii-2] = 0; |
| 250 | 251 | } |
| 251 | 252 | } |
| 252 | 253 | |
| @@ -288,10 +289,13 @@ | ||
| 288 | 289 | ** array is allocated to contain the "id" field from the vfile table |
| 289 | 290 | ** for each file to be committed. Or, if aCommitFile is NULL, all files |
| 290 | 291 | ** should be committed. |
| 291 | 292 | */ |
| 292 | 293 | select_commit_files(); |
| 294 | + if( g.aCommitFile && db_exists("SELECT 1 FROM vmerge") ){ | |
| 295 | + fossil_fatal("cannot do a partial commit of a merge"); | |
| 296 | + } | |
| 293 | 297 | |
| 294 | 298 | user_select(); |
| 295 | 299 | db_begin_transaction(); |
| 296 | 300 | rc = unsaved_changes(); |
| 297 | 301 | if( rc==0 ){ |
| 298 | 302 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -230,11 +230,11 @@ | |
| 230 | */ |
| 231 | void select_commit_files(void){ |
| 232 | if( g.argc>2 ){ |
| 233 | int ii; |
| 234 | Blob b; |
| 235 | memset(&b, 0, sizeof(Blob)); |
| 236 | g.aCommitFile = malloc(sizeof(int)*(g.argc-1)); |
| 237 | |
| 238 | for(ii=2; ii<g.argc; ii++){ |
| 239 | int iId; |
| 240 | if( !file_tree_name(g.argv[ii], &b) ){ |
| @@ -243,10 +243,11 @@ | |
| 243 | iId = db_int(-1, "SELECT id FROM vfile WHERE pathname=%Q", blob_str(&b)); |
| 244 | if( iId<0 ){ |
| 245 | fossil_fatal("fossil knows nothing about: %s", g.argv[ii]); |
| 246 | } |
| 247 | g.aCommitFile[ii-2] = iId; |
| 248 | } |
| 249 | g.aCommitFile[ii-2] = 0; |
| 250 | } |
| 251 | } |
| 252 | |
| @@ -288,10 +289,13 @@ | |
| 288 | ** array is allocated to contain the "id" field from the vfile table |
| 289 | ** for each file to be committed. Or, if aCommitFile is NULL, all files |
| 290 | ** should be committed. |
| 291 | */ |
| 292 | select_commit_files(); |
| 293 | |
| 294 | user_select(); |
| 295 | db_begin_transaction(); |
| 296 | rc = unsaved_changes(); |
| 297 | if( rc==0 ){ |
| 298 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -230,11 +230,11 @@ | |
| 230 | */ |
| 231 | void select_commit_files(void){ |
| 232 | if( g.argc>2 ){ |
| 233 | int ii; |
| 234 | Blob b; |
| 235 | blob_zero(&b); |
| 236 | g.aCommitFile = malloc(sizeof(int)*(g.argc-1)); |
| 237 | |
| 238 | for(ii=2; ii<g.argc; ii++){ |
| 239 | int iId; |
| 240 | if( !file_tree_name(g.argv[ii], &b) ){ |
| @@ -243,10 +243,11 @@ | |
| 243 | iId = db_int(-1, "SELECT id FROM vfile WHERE pathname=%Q", blob_str(&b)); |
| 244 | if( iId<0 ){ |
| 245 | fossil_fatal("fossil knows nothing about: %s", g.argv[ii]); |
| 246 | } |
| 247 | g.aCommitFile[ii-2] = iId; |
| 248 | blob_reset(&b); |
| 249 | } |
| 250 | g.aCommitFile[ii-2] = 0; |
| 251 | } |
| 252 | } |
| 253 | |
| @@ -288,10 +289,13 @@ | |
| 289 | ** array is allocated to contain the "id" field from the vfile table |
| 290 | ** for each file to be committed. Or, if aCommitFile is NULL, all files |
| 291 | ** should be committed. |
| 292 | */ |
| 293 | select_commit_files(); |
| 294 | if( g.aCommitFile && db_exists("SELECT 1 FROM vmerge") ){ |
| 295 | fossil_fatal("cannot do a partial commit of a merge"); |
| 296 | } |
| 297 | |
| 298 | user_select(); |
| 299 | db_begin_transaction(); |
| 300 | rc = unsaved_changes(); |
| 301 | if( rc==0 ){ |
| 302 |