Fossil SCM

Additional fixes to the "fossil import" command. Correct handling of zero-length content files. Correct handling of merges with no new or modified files.

drh 2010-11-16 18:01 trunk
Commit 3873aa7ecb90bce176bafaa8296102e371a49088
1 file changed +7 -6
+7 -6
--- src/import.c
+++ src/import.c
@@ -148,16 +148,13 @@
148148
** Use data accumulated in gg from a "blob" record to add a new file
149149
** to the BLOB table.
150150
*/
151151
static void finish_blob(void){
152152
Blob content;
153
-
154
- if( gg.nData>0 ){
155
- blob_init(&content, gg.aData, gg.nData);
156
- fast_insert_content(&content, gg.zMark);
157
- blob_reset(&content);
158
- }
153
+ blob_init(&content, gg.aData, gg.nData);
154
+ fast_insert_content(&content, gg.zMark);
155
+ blob_reset(&content);
159156
import_reset(0);
160157
}
161158
162159
/*
163160
** Use data accumulated in gg from a "tag" record to add a new
@@ -186,18 +183,22 @@
186183
const ImportFile *pA = (const ImportFile*)pLeft;
187184
const ImportFile *pB = (const ImportFile*)pRight;
188185
return strcmp(pA->zName, pB->zName);
189186
}
190187
188
+/* Forward reference */
189
+static void import_prior_files(void);
190
+
191191
/*
192192
** Use data accumulated in gg from a "commit" record to add a new
193193
** manifest artifact to the BLOB table.
194194
*/
195195
static void finish_commit(void){
196196
int i;
197197
char *zFromBranch;
198198
Blob record, cksum;
199
+ import_prior_files();
199200
qsort(gg.aFile, gg.nFile, sizeof(gg.aFile[0]), mfile_cmp);
200201
blob_zero(&record);
201202
blob_appendf(&record, "C %F\n", gg.zComment);
202203
blob_appendf(&record, "D %s\n", gg.zDate);
203204
for(i=0; i<gg.nFile; i++){
204205
--- src/import.c
+++ src/import.c
@@ -148,16 +148,13 @@
148 ** Use data accumulated in gg from a "blob" record to add a new file
149 ** to the BLOB table.
150 */
151 static void finish_blob(void){
152 Blob content;
153
154 if( gg.nData>0 ){
155 blob_init(&content, gg.aData, gg.nData);
156 fast_insert_content(&content, gg.zMark);
157 blob_reset(&content);
158 }
159 import_reset(0);
160 }
161
162 /*
163 ** Use data accumulated in gg from a "tag" record to add a new
@@ -186,18 +183,22 @@
186 const ImportFile *pA = (const ImportFile*)pLeft;
187 const ImportFile *pB = (const ImportFile*)pRight;
188 return strcmp(pA->zName, pB->zName);
189 }
190
 
 
 
191 /*
192 ** Use data accumulated in gg from a "commit" record to add a new
193 ** manifest artifact to the BLOB table.
194 */
195 static void finish_commit(void){
196 int i;
197 char *zFromBranch;
198 Blob record, cksum;
 
199 qsort(gg.aFile, gg.nFile, sizeof(gg.aFile[0]), mfile_cmp);
200 blob_zero(&record);
201 blob_appendf(&record, "C %F\n", gg.zComment);
202 blob_appendf(&record, "D %s\n", gg.zDate);
203 for(i=0; i<gg.nFile; i++){
204
--- src/import.c
+++ src/import.c
@@ -148,16 +148,13 @@
148 ** Use data accumulated in gg from a "blob" record to add a new file
149 ** to the BLOB table.
150 */
151 static void finish_blob(void){
152 Blob content;
153 blob_init(&content, gg.aData, gg.nData);
154 fast_insert_content(&content, gg.zMark);
155 blob_reset(&content);
 
 
 
156 import_reset(0);
157 }
158
159 /*
160 ** Use data accumulated in gg from a "tag" record to add a new
@@ -186,18 +183,22 @@
183 const ImportFile *pA = (const ImportFile*)pLeft;
184 const ImportFile *pB = (const ImportFile*)pRight;
185 return strcmp(pA->zName, pB->zName);
186 }
187
188 /* Forward reference */
189 static void import_prior_files(void);
190
191 /*
192 ** Use data accumulated in gg from a "commit" record to add a new
193 ** manifest artifact to the BLOB table.
194 */
195 static void finish_commit(void){
196 int i;
197 char *zFromBranch;
198 Blob record, cksum;
199 import_prior_files();
200 qsort(gg.aFile, gg.nFile, sizeof(gg.aFile[0]), mfile_cmp);
201 blob_zero(&record);
202 blob_appendf(&record, "C %F\n", gg.zComment);
203 blob_appendf(&record, "D %s\n", gg.zDate);
204 for(i=0; i<gg.nFile; i++){
205

Keyboard Shortcuts

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