Fossil SCM
Fix bugs with filter and with add+change in same commit
Commit
65dc40a1edeab13ae4f00994934f5a0a87500d38
Parent
05537c6fc04045f…
1 file changed
+6
-1
+6
-1
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -1258,11 +1258,11 @@ | ||
| 1258 | 1258 | if( strncmp(zKind, "dir", 3)==0 ) continue; |
| 1259 | 1259 | if( deltaFlag ){ |
| 1260 | 1260 | Blob deltaSrc; |
| 1261 | 1261 | Blob target; |
| 1262 | 1262 | rid = db_int(0, "SELECT trid, max(trev) FROM xhist" |
| 1263 | - " WHERE trev<=%d AND tpath=%Q", gsvn.rev-1, zPath); | |
| 1263 | + " WHERE trev<=%d AND tpath=%Q", gsvn.rev, zPath); | |
| 1264 | 1264 | content_get(rid, &deltaSrc); |
| 1265 | 1265 | svn_apply_svndiff(&rec.content, &deltaSrc, &target); |
| 1266 | 1266 | rid = content_put(&target); |
| 1267 | 1267 | }else{ |
| 1268 | 1268 | rid = content_put(&rec.content); |
| @@ -1330,10 +1330,11 @@ | ||
| 1330 | 1330 | void import_cmd(void){ |
| 1331 | 1331 | char *zPassword; |
| 1332 | 1332 | FILE *pIn; |
| 1333 | 1333 | Stmt q; |
| 1334 | 1334 | const char *zFilter = find_option("filter", 0, 1); |
| 1335 | + int lenFilter; | |
| 1335 | 1336 | int forceFlag = find_option("force", "f", 0)!=0; |
| 1336 | 1337 | int incrFlag = find_option("incremental", "i", 0)!=0; |
| 1337 | 1338 | gsvn.zTrunk = find_option("trunk", 0, 1); |
| 1338 | 1339 | gsvn.zBranches = find_option("branches", 0, 1); |
| 1339 | 1340 | gsvn.zTags = find_option("tags", 0, 1); |
| @@ -1435,12 +1436,16 @@ | ||
| 1435 | 1436 | if( gsvn.zTags[gsvn.lenTags-1]!='/' ){ |
| 1436 | 1437 | gsvn.zTags = mprintf("%s/", gsvn.zTags); |
| 1437 | 1438 | gsvn.lenTags++; |
| 1438 | 1439 | } |
| 1439 | 1440 | if( zFilter==0 ){ zFilter = ""; } |
| 1441 | + lenFilter = strlen(zFilter); | |
| 1440 | 1442 | blob_zero(&gsvn.filter); |
| 1441 | 1443 | blob_set(&gsvn.filter, zFilter); |
| 1444 | + if( lenFilter>0 && zFilter[lenFilter-1]!='/' ){ | |
| 1445 | + blob_append(&gsvn.filter, "/", 1); | |
| 1446 | + } | |
| 1442 | 1447 | svn_dump_import(pIn); |
| 1443 | 1448 | } |
| 1444 | 1449 | |
| 1445 | 1450 | verify_cancel(); |
| 1446 | 1451 | db_end_transaction(0); |
| 1447 | 1452 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -1258,11 +1258,11 @@ | |
| 1258 | if( strncmp(zKind, "dir", 3)==0 ) continue; |
| 1259 | if( deltaFlag ){ |
| 1260 | Blob deltaSrc; |
| 1261 | Blob target; |
| 1262 | rid = db_int(0, "SELECT trid, max(trev) FROM xhist" |
| 1263 | " WHERE trev<=%d AND tpath=%Q", gsvn.rev-1, zPath); |
| 1264 | content_get(rid, &deltaSrc); |
| 1265 | svn_apply_svndiff(&rec.content, &deltaSrc, &target); |
| 1266 | rid = content_put(&target); |
| 1267 | }else{ |
| 1268 | rid = content_put(&rec.content); |
| @@ -1330,10 +1330,11 @@ | |
| 1330 | void import_cmd(void){ |
| 1331 | char *zPassword; |
| 1332 | FILE *pIn; |
| 1333 | Stmt q; |
| 1334 | const char *zFilter = find_option("filter", 0, 1); |
| 1335 | int forceFlag = find_option("force", "f", 0)!=0; |
| 1336 | int incrFlag = find_option("incremental", "i", 0)!=0; |
| 1337 | gsvn.zTrunk = find_option("trunk", 0, 1); |
| 1338 | gsvn.zBranches = find_option("branches", 0, 1); |
| 1339 | gsvn.zTags = find_option("tags", 0, 1); |
| @@ -1435,12 +1436,16 @@ | |
| 1435 | if( gsvn.zTags[gsvn.lenTags-1]!='/' ){ |
| 1436 | gsvn.zTags = mprintf("%s/", gsvn.zTags); |
| 1437 | gsvn.lenTags++; |
| 1438 | } |
| 1439 | if( zFilter==0 ){ zFilter = ""; } |
| 1440 | blob_zero(&gsvn.filter); |
| 1441 | blob_set(&gsvn.filter, zFilter); |
| 1442 | svn_dump_import(pIn); |
| 1443 | } |
| 1444 | |
| 1445 | verify_cancel(); |
| 1446 | db_end_transaction(0); |
| 1447 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -1258,11 +1258,11 @@ | |
| 1258 | if( strncmp(zKind, "dir", 3)==0 ) continue; |
| 1259 | if( deltaFlag ){ |
| 1260 | Blob deltaSrc; |
| 1261 | Blob target; |
| 1262 | rid = db_int(0, "SELECT trid, max(trev) FROM xhist" |
| 1263 | " WHERE trev<=%d AND tpath=%Q", gsvn.rev, zPath); |
| 1264 | content_get(rid, &deltaSrc); |
| 1265 | svn_apply_svndiff(&rec.content, &deltaSrc, &target); |
| 1266 | rid = content_put(&target); |
| 1267 | }else{ |
| 1268 | rid = content_put(&rec.content); |
| @@ -1330,10 +1330,11 @@ | |
| 1330 | void import_cmd(void){ |
| 1331 | char *zPassword; |
| 1332 | FILE *pIn; |
| 1333 | Stmt q; |
| 1334 | const char *zFilter = find_option("filter", 0, 1); |
| 1335 | int lenFilter; |
| 1336 | int forceFlag = find_option("force", "f", 0)!=0; |
| 1337 | int incrFlag = find_option("incremental", "i", 0)!=0; |
| 1338 | gsvn.zTrunk = find_option("trunk", 0, 1); |
| 1339 | gsvn.zBranches = find_option("branches", 0, 1); |
| 1340 | gsvn.zTags = find_option("tags", 0, 1); |
| @@ -1435,12 +1436,16 @@ | |
| 1436 | if( gsvn.zTags[gsvn.lenTags-1]!='/' ){ |
| 1437 | gsvn.zTags = mprintf("%s/", gsvn.zTags); |
| 1438 | gsvn.lenTags++; |
| 1439 | } |
| 1440 | if( zFilter==0 ){ zFilter = ""; } |
| 1441 | lenFilter = strlen(zFilter); |
| 1442 | blob_zero(&gsvn.filter); |
| 1443 | blob_set(&gsvn.filter, zFilter); |
| 1444 | if( lenFilter>0 && zFilter[lenFilter-1]!='/' ){ |
| 1445 | blob_append(&gsvn.filter, "/", 1); |
| 1446 | } |
| 1447 | svn_dump_import(pIn); |
| 1448 | } |
| 1449 | |
| 1450 | verify_cancel(); |
| 1451 | db_end_transaction(0); |
| 1452 |