Fossil SCM

support copying files (no folders support yet)

baruch 2014-10-21 15:00 svn-import
Commit 0edbf144f3675633d7b450c3c2ed4b1abdfe1026
1 file changed +10 -7
+10 -7
--- src/import.c
+++ src/import.c
@@ -868,17 +868,15 @@
868868
blob_zero(&rec->content);
869869
zLen = svn_find_header(*rec, "Text-content-length");
870870
if( zLen ){
871871
nLen = atoi(zLen);
872872
}
873
- if( nLen>=0 ){
874
- blob_read_from_channel(&rec->content, pIn, nLen);
875
- if( blob_size(&rec->content)!=nLen ){
876
- fossil_fatal("short read: got %d of %d bytes",
877
- blob_size(&rec->content), nLen
878
- );
879
- }
873
+ blob_read_from_channel(&rec->content, pIn, nLen);
874
+ if( blob_size(&rec->content)!=nLen ){
875
+ fossil_fatal("short read: got %d of %d bytes",
876
+ blob_size(&rec->content), nLen
877
+ );
880878
}
881879
return 1;
882880
}
883881
884882
static void svn_create_manifests(){
@@ -1023,10 +1021,15 @@
10231021
fossil_fatal("Missing copyfrom-rev");
10241022
}
10251023
}
10261024
rid = content_put(&rec.content);
10271025
if( strncmp(zAction, "add", 3)==0 ){
1026
+ if( blob_size(&rec.content)>0 && zSrcPath!=0 ){
1027
+ rid = db_int(rid,
1028
+ "SELECT trid FROM xfiles WHERE trev=%d AND tpath=%Q",
1029
+ srcRev, zSrcPath);
1030
+ }
10281031
db_bind_int(&insFile, ":rev", rev);
10291032
db_bind_int(&insFile, ":rid", rid);
10301033
db_bind_text(&insFile, ":path", zPath);
10311034
db_bind_text(&insFile, ":perm", zPerm);
10321035
db_step(&insFile);
10331036
--- src/import.c
+++ src/import.c
@@ -868,17 +868,15 @@
868 blob_zero(&rec->content);
869 zLen = svn_find_header(*rec, "Text-content-length");
870 if( zLen ){
871 nLen = atoi(zLen);
872 }
873 if( nLen>=0 ){
874 blob_read_from_channel(&rec->content, pIn, nLen);
875 if( blob_size(&rec->content)!=nLen ){
876 fossil_fatal("short read: got %d of %d bytes",
877 blob_size(&rec->content), nLen
878 );
879 }
880 }
881 return 1;
882 }
883
884 static void svn_create_manifests(){
@@ -1023,10 +1021,15 @@
1023 fossil_fatal("Missing copyfrom-rev");
1024 }
1025 }
1026 rid = content_put(&rec.content);
1027 if( strncmp(zAction, "add", 3)==0 ){
 
 
 
 
 
1028 db_bind_int(&insFile, ":rev", rev);
1029 db_bind_int(&insFile, ":rid", rid);
1030 db_bind_text(&insFile, ":path", zPath);
1031 db_bind_text(&insFile, ":perm", zPerm);
1032 db_step(&insFile);
1033
--- src/import.c
+++ src/import.c
@@ -868,17 +868,15 @@
868 blob_zero(&rec->content);
869 zLen = svn_find_header(*rec, "Text-content-length");
870 if( zLen ){
871 nLen = atoi(zLen);
872 }
873 blob_read_from_channel(&rec->content, pIn, nLen);
874 if( blob_size(&rec->content)!=nLen ){
875 fossil_fatal("short read: got %d of %d bytes",
876 blob_size(&rec->content), nLen
877 );
 
 
878 }
879 return 1;
880 }
881
882 static void svn_create_manifests(){
@@ -1023,10 +1021,15 @@
1021 fossil_fatal("Missing copyfrom-rev");
1022 }
1023 }
1024 rid = content_put(&rec.content);
1025 if( strncmp(zAction, "add", 3)==0 ){
1026 if( blob_size(&rec.content)>0 && zSrcPath!=0 ){
1027 rid = db_int(rid,
1028 "SELECT trid FROM xfiles WHERE trev=%d AND tpath=%Q",
1029 srcRev, zSrcPath);
1030 }
1031 db_bind_int(&insFile, ":rev", rev);
1032 db_bind_int(&insFile, ":rid", rid);
1033 db_bind_text(&insFile, ":path", zPath);
1034 db_bind_text(&insFile, ":perm", zPerm);
1035 db_step(&insFile);
1036

Keyboard Shortcuts

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