Fossil

Check-in [06d3aa22]
Login

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

Overview
Comment:Fix for copy on same branch causing a merge
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | svn-import
Files: files | file ages | folders
SHA1:06d3aa22d3a25b4989aeb223b7800110ecb62e0a
User & Date: baruch 2015-01-08 10:17:40
Context
2015-01-08
10:47
Reformat long lines check-in: 32e94835 user: baruch tags: svn-import
10:17
Fix for copy on same branch causing a merge check-in: 06d3aa22 user: baruch tags: svn-import
2015-01-07
19:46
Merge latest trunk check-in: aea273f7 user: baruch tags: svn-import
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/import.c.

1226
1227
1228
1229
1230
1231
1232

1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
....
1289
1290
1291
1292
1293
1294
1295







1296
1297
1298
1299
1300
1301
1302
        db_bind_int(&addRev, ":branch", branchId);
        db_step(&addRev);
        db_reset(&addRev);
      } /* no 'else' here since 'replace' does both a 'delete' and an 'add' */
      if( strncmp(zAction, "add", 3)==0
       || strncmp(zAction, "replace", 7)==0 )
      {

        if( zKind==0 ){
          fossil_fatal("Missing Node-kind");
        }else if( strncmp(zKind, "dir", 3)==0 ){
          if( zSrcPath ){
            int srcRid = db_int(0, "SELECT trid, max(trev) FROM xrevisions"
                                   " WHERE trev<=%d AND tbranch=%d",
                                srcRev, srcBranch);
            if( srcRid>0 ){
              db_bind_text(&cpyPath, ":path", zFile);
              db_bind_int(&cpyPath, ":branch", branchId);
              db_bind_text(&cpyPath, ":srcpath", zSrcFile);
              db_bind_int(&cpyPath, ":rid", srcRid);
              db_step(&cpyPath);
              db_reset(&cpyPath);
              db_bind_int(&addRev, ":branch", branchId);
              db_step(&addRev);
              db_reset(&addRev);
              db_bind_int(&revSrc, ":parent", srcRid);
              db_bind_int(&revSrc, ":rev", gsvn.rev);
              db_bind_int(&revSrc, ":branch", branchId);
              db_step(&revSrc);
              db_reset(&revSrc);
            }
          }
        }else{
          int rid = 0;
          if( zSrcPath ){
            int srcRid = db_int(0, "SELECT trid, max(trev) FROM xrevisions"
                            " WHERE trev<=%d AND tbranch=%d",
                         srcRev, srcBranch);
            rid = db_int(0, "SELECT rid FROM blob WHERE uuid=("
                            " SELECT uuid FROM xfoci"
                            "  WHERE checkinID=%d AND filename=%Q"
                            ")",
                         srcRid, zSrcFile);
            db_bind_int(&revSrc, ":parent", srcRid);
            db_bind_int(&revSrc, ":rev", gsvn.rev);
            db_bind_int(&revSrc, ":branch", branchId);
            db_step(&revSrc);
            db_reset(&revSrc);
          }
          if( deltaFlag ){
            Blob deltaSrc;
            Blob target;
            if( rid!=0 ){
              content_get(rid, &deltaSrc);
            }else{
................................................................................
          db_bind_int(&addFile, ":rid", rid);
          db_bind_text(&addFile, ":perm", zPerm);
          db_step(&addFile);
          db_reset(&addFile);
          db_bind_int(&addRev, ":branch", branchId);
          db_step(&addRev);
          db_reset(&addRev);







        }
      }else
      if( strncmp(zAction, "change", 6)==0 ){
        int rid = 0;
        if( zKind==0 ){
          fossil_fatal("Missing Node-kind");
        }







>




|












<
<
<
<
<





|







<
<
<
<
<







 







>
>
>
>
>
>
>







1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250





1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263





1264
1265
1266
1267
1268
1269
1270
....
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
        db_bind_int(&addRev, ":branch", branchId);
        db_step(&addRev);
        db_reset(&addRev);
      } /* no 'else' here since 'replace' does both a 'delete' and an 'add' */
      if( strncmp(zAction, "add", 3)==0
       || strncmp(zAction, "replace", 7)==0 )
      {
        int srcRid = 0;
        if( zKind==0 ){
          fossil_fatal("Missing Node-kind");
        }else if( strncmp(zKind, "dir", 3)==0 ){
          if( zSrcPath ){
            srcRid = db_int(0, "SELECT trid, max(trev) FROM xrevisions"
                                   " WHERE trev<=%d AND tbranch=%d",
                                srcRev, srcBranch);
            if( srcRid>0 ){
              db_bind_text(&cpyPath, ":path", zFile);
              db_bind_int(&cpyPath, ":branch", branchId);
              db_bind_text(&cpyPath, ":srcpath", zSrcFile);
              db_bind_int(&cpyPath, ":rid", srcRid);
              db_step(&cpyPath);
              db_reset(&cpyPath);
              db_bind_int(&addRev, ":branch", branchId);
              db_step(&addRev);
              db_reset(&addRev);





            }
          }
        }else{
          int rid = 0;
          if( zSrcPath ){
            srcRid = db_int(0, "SELECT trid, max(trev) FROM xrevisions"
                            " WHERE trev<=%d AND tbranch=%d",
                         srcRev, srcBranch);
            rid = db_int(0, "SELECT rid FROM blob WHERE uuid=("
                            " SELECT uuid FROM xfoci"
                            "  WHERE checkinID=%d AND filename=%Q"
                            ")",
                         srcRid, zSrcFile);





          }
          if( deltaFlag ){
            Blob deltaSrc;
            Blob target;
            if( rid!=0 ){
              content_get(rid, &deltaSrc);
            }else{
................................................................................
          db_bind_int(&addFile, ":rid", rid);
          db_bind_text(&addFile, ":perm", zPerm);
          db_step(&addFile);
          db_reset(&addFile);
          db_bind_int(&addRev, ":branch", branchId);
          db_step(&addRev);
          db_reset(&addRev);
        }
        if( zSrcPath && srcRid>0 && srcBranch!=branchId ){
          db_bind_int(&revSrc, ":parent", srcRid);
          db_bind_int(&revSrc, ":rev", gsvn.rev);
          db_bind_int(&revSrc, ":branch", branchId);
          db_step(&revSrc);
          db_reset(&revSrc);
        }
      }else
      if( strncmp(zAction, "change", 6)==0 ){
        int rid = 0;
        if( zKind==0 ){
          fossil_fatal("Missing Node-kind");
        }