Fossil

Check-in [fca30736]
Login

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

Overview
Comment:Since the mlink table contains entries with pid=0 for non-empty manifests without parents, drop the original non-incremental commit logic by folding the few special cases into the mlink/plink based output.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: fca30736219e8c7a40df379f042956545f2e32ce
User & Date: joerg 2011-07-22 19:38:19
Context
2011-07-22
23:15
Experimental query parameters brbg and ubg for the timeline. check-in: b6b419c3 user: drh tags: trunk
22:07
Update autosetup to the latest version. This fixes bootstrap on systems with older compilers. Now './configure; make' works on Haiku R1/Alpha 3. Closed-Leaf check-in: c32b23d6 user: steveb tags: autosetup
19:38
Since the mlink table contains entries with pid=0 for non-empty manifests without parents, drop the original non-incremental commit logic by folding the few special cases into the mlink/plink based output. check-in: fca30736 user: joerg tags: trunk
03:12
Merge the recent autosetup changes into trunk. The Makefile has been renamed to Makefile.classic. The standard procedure to build is now ./configure; make. check-in: 75f02948 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/export.c.

190
191
192
193
194
195
196
197
198
199
200
201
202
203

204
205
206
207
208
209
210
...
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261



262

263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
    "  FROM event"
    " WHERE type='ci' AND NOT EXISTS (SELECT 1 FROM oldcommit WHERE objid=rid)"
    " ORDER BY mtime ASC",
    TAG_BRANCH
  );
  db_prepare(&q2, "INSERT INTO oldcommit VALUES (:rid)");
  while( db_step(&q)==SQLITE_ROW ){
    Stmt q3;
    const char *zSecondsSince1970 = db_column_text(&q, 0);
    int ckinId = db_column_int(&q, 1);
    const char *zComment = db_column_text(&q, 2);
    const char *zUser = db_column_text(&q, 3);
    const char *zBranch = db_column_text(&q, 4);
    char *zBr;


    bag_insert(&vers, ckinId);
    db_bind_int(&q2, ":rid", ckinId);
    db_step(&q2);
    db_reset(&q2);
    if( zBranch==0 ) zBranch = "trunk";
    zBr = mprintf("%s", zBranch);
................................................................................
    free(zBr);
    printf("committer");
    print_person(zUser);
    printf(" %s +0000\n", zSecondsSince1970);
    if( zComment==0 ) zComment = "null comment";
    printf("data %d\n%s\n", (int)strlen(zComment), zComment);
    db_prepare(&q3, "SELECT pid FROM plink WHERE cid=%d AND isprim", ckinId);
    if( db_step(&q3) != SQLITE_ROW ){
      const char *zFromType;
      Manifest *p;
      ManifestFile *pFile;

      zFromType = "from";
      p = manifest_get(ckinId, CFTYPE_ANY);
      for(i=0; i<p->nParent; i++){
        int pid = fast_uuid_to_rid(p->azParent[i]);
        if( pid==0 || !bag_find(&vers, pid) ) continue;
        printf("%s :%d\n", zFromType, COMMITMARK(fast_uuid_to_rid(p->azParent[i])));
        zFromType = "merge";
      }
      printf("deleteall\n");
      manifest_file_rewind(p);
      while( (pFile=manifest_file_next(p, 0))!=0 ){
        int fid = fast_uuid_to_rid(pFile->zUuid);
        const char *zPerm = "100644";
        if( fid==0 ) continue;
        if( pFile->zPerm && strstr(pFile->zPerm,"x") ) zPerm = "100755";
        if( !bag_find(&blobs, fid) ) continue;
        printf("M %s :%d %s\n", zPerm, BLOBMARK(fid), pFile->zName);
      }
      manifest_cache_insert(p);
    }else{
      Stmt q4;
      int parent;

      parent = db_column_int(&q3, 0);
      printf("from :%d\n", COMMITMARK(parent));
      db_prepare(&q4,
        "SELECT pid FROM plink"
        " WHERE cid=%d AND NOT isprim"
        "   AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=pid)"
        " ORDER BY pid",
        ckinId);
      while( db_step(&q4)==SQLITE_ROW ){
        printf("merge :%d\n", COMMITMARK(db_column_int(&q4,0)));
      }
      db_finalize(&q4);





      db_prepare(&q4,
        "SELECT filename.name, mlink.fid, mlink.mperm FROM mlink"
        " JOIN filename ON filename.fnid=mlink.fnid"
        " WHERE mlink.mid=%d",
        parent
      );
      while( db_step(&q4)==SQLITE_ROW ){
        const char *zName = db_column_text(&q4,0);
        int zNew = db_column_int(&q4,1);
        int mPerm = db_column_int(&q4,2);
        if( zNew==0)
           printf("D %s\n", zName);
        else if( bag_find(&blobs, zNew) )
           printf("M %s :%d %s\n", mPerm ? "100755" : "100644", BLOBMARK(zNew), zName);
      }
      db_finalize(&q4);
    }
    db_finalize(&q3);
    printf("\n");
  }
  db_finalize(&q2);
  db_finalize(&q);
  bag_clear(&blobs);
  manifest_cache_clear();







|






>







 







|
|
<
<

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<











>
>
>
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<







190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
...
216
217
218
219
220
221
222
223
224


225
























226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257

258
259
260
261
262
263
264
    "  FROM event"
    " WHERE type='ci' AND NOT EXISTS (SELECT 1 FROM oldcommit WHERE objid=rid)"
    " ORDER BY mtime ASC",
    TAG_BRANCH
  );
  db_prepare(&q2, "INSERT INTO oldcommit VALUES (:rid)");
  while( db_step(&q)==SQLITE_ROW ){
    Stmt q3, q4;
    const char *zSecondsSince1970 = db_column_text(&q, 0);
    int ckinId = db_column_int(&q, 1);
    const char *zComment = db_column_text(&q, 2);
    const char *zUser = db_column_text(&q, 3);
    const char *zBranch = db_column_text(&q, 4);
    char *zBr;
    int parent;

    bag_insert(&vers, ckinId);
    db_bind_int(&q2, ":rid", ckinId);
    db_step(&q2);
    db_reset(&q2);
    if( zBranch==0 ) zBranch = "trunk";
    zBr = mprintf("%s", zBranch);
................................................................................
    free(zBr);
    printf("committer");
    print_person(zUser);
    printf(" %s +0000\n", zSecondsSince1970);
    if( zComment==0 ) zComment = "null comment";
    printf("data %d\n%s\n", (int)strlen(zComment), zComment);
    db_prepare(&q3, "SELECT pid FROM plink WHERE cid=%d AND isprim", ckinId);
    if( db_step(&q3) == SQLITE_ROW ){
      parent = db_column_int(&q3, 0);



























      printf("from :%d\n", COMMITMARK(parent));
      db_prepare(&q4,
        "SELECT pid FROM plink"
        " WHERE cid=%d AND NOT isprim"
        "   AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=pid)"
        " ORDER BY pid",
        ckinId);
      while( db_step(&q4)==SQLITE_ROW ){
        printf("merge :%d\n", COMMITMARK(db_column_int(&q4,0)));
      }
      db_finalize(&q4);
    }else{
      parent = 0;
      printf("deleteall\n");
    }

    db_prepare(&q4,
      "SELECT filename.name, mlink.fid, mlink.mperm FROM mlink"
      " JOIN filename ON filename.fnid=mlink.fnid"
      " WHERE mlink.mid=%d",
      parent
    );
    while( db_step(&q4)==SQLITE_ROW ){
      const char *zName = db_column_text(&q4,0);
      int zNew = db_column_int(&q4,1);
      int mPerm = db_column_int(&q4,2);
      if( zNew==0)
        printf("D %s\n", zName);
      else if( bag_find(&blobs, zNew) )
        printf("M %s :%d %s\n", mPerm ? "100755" : "100644", BLOBMARK(zNew), zName);
    }
    db_finalize(&q4);

    db_finalize(&q3);
    printf("\n");
  }
  db_finalize(&q2);
  db_finalize(&q);
  bag_clear(&blobs);
  manifest_cache_clear();