Fossil

Check-in [3873aa7e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Additional fixes to the "fossil import" command. Correct handling of zero-length content files. Correct handling of merges with no new or modified files.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3873aa7ecb90bce176bafaa8296102e371a49088
User & Date: drh 2010-11-16 18:02:00
References
2010-12-12
18:14 New ticket [d22946aa] Adding files with non-English file names is not cross-platform. artifact: 7b1ce666 user: anonymous
Context
2010-11-16
23:16
Update to the latest version of SQLite with the sqlite3_stmt_readonly() capability and use that interface for additional security of the user-entered SQL in the ticket report logic. check-in: 115f3ea6 user: drh tags: trunk
18:02
Additional fixes to the "fossil import" command. Correct handling of zero-length content files. Correct handling of merges with no new or modified files. check-in: 3873aa7e user: drh tags: trunk
04:18
Fix a bug in the Git import routine. check-in: 9c318664 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/import.c.

146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
...
184
185
186
187
188
189
190



191
192
193
194
195
196
197
198

199
200
201
202
203
204
205

/*
** Use data accumulated in gg from a "blob" record to add a new file
** to the BLOB table.
*/
static void finish_blob(void){
  Blob content;

  if( gg.nData>0 ){
    blob_init(&content, gg.aData, gg.nData);
    fast_insert_content(&content, gg.zMark);
    blob_reset(&content);
  }
  import_reset(0);
}

/*
** Use data accumulated in gg from a "tag" record to add a new 
** control artifact to the BLOB table.
*/
................................................................................
*/
static int mfile_cmp(const void *pLeft, const void *pRight){
  const ImportFile *pA = (const ImportFile*)pLeft;
  const ImportFile *pB = (const ImportFile*)pRight;
  return strcmp(pA->zName, pB->zName);
}




/*
** Use data accumulated in gg from a "commit" record to add a new 
** manifest artifact to the BLOB table.
*/
static void finish_commit(void){
  int i;
  char *zFromBranch;
  Blob record, cksum;

  qsort(gg.aFile, gg.nFile, sizeof(gg.aFile[0]), mfile_cmp);
  blob_zero(&record);
  blob_appendf(&record, "C %F\n", gg.zComment);
  blob_appendf(&record, "D %s\n", gg.zDate);
  for(i=0; i<gg.nFile; i++){
    const char *zUuid = gg.aFile[i].zUuid;
    if( zUuid==0 ) continue;







<
<
|
|
|
<







 







>
>
>








>







146
147
148
149
150
151
152


153
154
155

156
157
158
159
160
161
162
...
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206

/*
** Use data accumulated in gg from a "blob" record to add a new file
** to the BLOB table.
*/
static void finish_blob(void){
  Blob content;


  blob_init(&content, gg.aData, gg.nData);
  fast_insert_content(&content, gg.zMark);
  blob_reset(&content);

  import_reset(0);
}

/*
** Use data accumulated in gg from a "tag" record to add a new 
** control artifact to the BLOB table.
*/
................................................................................
*/
static int mfile_cmp(const void *pLeft, const void *pRight){
  const ImportFile *pA = (const ImportFile*)pLeft;
  const ImportFile *pB = (const ImportFile*)pRight;
  return strcmp(pA->zName, pB->zName);
}

/* Forward reference */
static void import_prior_files(void);

/*
** Use data accumulated in gg from a "commit" record to add a new 
** manifest artifact to the BLOB table.
*/
static void finish_commit(void){
  int i;
  char *zFromBranch;
  Blob record, cksum;
  import_prior_files();
  qsort(gg.aFile, gg.nFile, sizeof(gg.aFile[0]), mfile_cmp);
  blob_zero(&record);
  blob_appendf(&record, "C %F\n", gg.zComment);
  blob_appendf(&record, "D %s\n", gg.zDate);
  for(i=0; i<gg.nFile; i++){
    const char *zUuid = gg.aFile[i].zUuid;
    if( zUuid==0 ) continue;