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.

drh 2007-08-04 00:26 trunk
Commit aafd536a5cced0647c402e7c820e8aaa3c232ac2
1 file changed +5 -1
+5 -1
--- src/checkin.c
+++ src/checkin.c
@@ -230,11 +230,11 @@
230230
*/
231231
void select_commit_files(void){
232232
if( g.argc>2 ){
233233
int ii;
234234
Blob b;
235
- memset(&b, 0, sizeof(Blob));
235
+ blob_zero(&b);
236236
g.aCommitFile = malloc(sizeof(int)*(g.argc-1));
237237
238238
for(ii=2; ii<g.argc; ii++){
239239
int iId;
240240
if( !file_tree_name(g.argv[ii], &b) ){
@@ -243,10 +243,11 @@
243243
iId = db_int(-1, "SELECT id FROM vfile WHERE pathname=%Q", blob_str(&b));
244244
if( iId<0 ){
245245
fossil_fatal("fossil knows nothing about: %s", g.argv[ii]);
246246
}
247247
g.aCommitFile[ii-2] = iId;
248
+ blob_reset(&b);
248249
}
249250
g.aCommitFile[ii-2] = 0;
250251
}
251252
}
252253
@@ -288,10 +289,13 @@
288289
** array is allocated to contain the "id" field from the vfile table
289290
** for each file to be committed. Or, if aCommitFile is NULL, all files
290291
** should be committed.
291292
*/
292293
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
+ }
293297
294298
user_select();
295299
db_begin_transaction();
296300
rc = unsaved_changes();
297301
if( rc==0 ){
298302
--- 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

Keyboard Shortcuts

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