Fossil SCM

Fix bugs with filter and with add+change in same commit

baruch 2014-11-03 16:05 svn-import
Commit 65dc40a1edeab13ae4f00994934f5a0a87500d38
1 file changed +6 -1
+6 -1
--- src/import.c
+++ src/import.c
@@ -1258,11 +1258,11 @@
12581258
if( strncmp(zKind, "dir", 3)==0 ) continue;
12591259
if( deltaFlag ){
12601260
Blob deltaSrc;
12611261
Blob target;
12621262
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);
12641264
content_get(rid, &deltaSrc);
12651265
svn_apply_svndiff(&rec.content, &deltaSrc, &target);
12661266
rid = content_put(&target);
12671267
}else{
12681268
rid = content_put(&rec.content);
@@ -1330,10 +1330,11 @@
13301330
void import_cmd(void){
13311331
char *zPassword;
13321332
FILE *pIn;
13331333
Stmt q;
13341334
const char *zFilter = find_option("filter", 0, 1);
1335
+ int lenFilter;
13351336
int forceFlag = find_option("force", "f", 0)!=0;
13361337
int incrFlag = find_option("incremental", "i", 0)!=0;
13371338
gsvn.zTrunk = find_option("trunk", 0, 1);
13381339
gsvn.zBranches = find_option("branches", 0, 1);
13391340
gsvn.zTags = find_option("tags", 0, 1);
@@ -1435,12 +1436,16 @@
14351436
if( gsvn.zTags[gsvn.lenTags-1]!='/' ){
14361437
gsvn.zTags = mprintf("%s/", gsvn.zTags);
14371438
gsvn.lenTags++;
14381439
}
14391440
if( zFilter==0 ){ zFilter = ""; }
1441
+ lenFilter = strlen(zFilter);
14401442
blob_zero(&gsvn.filter);
14411443
blob_set(&gsvn.filter, zFilter);
1444
+ if( lenFilter>0 && zFilter[lenFilter-1]!='/' ){
1445
+ blob_append(&gsvn.filter, "/", 1);
1446
+ }
14421447
svn_dump_import(pIn);
14431448
}
14441449
14451450
verify_cancel();
14461451
db_end_transaction(0);
14471452
--- 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

Keyboard Shortcuts

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