Fossil SCM

Make an appropriate entry in the rcvfrom table when doing a git or svn import. See [forum:92db82a45e|forum post 92db82a45e] for details on the problem that this check-in attempts to fix.

drh 2020-09-16 13:21 trunk
Commit 59ba20f8450bb8583aa71cead5cf2abd2fbdf2a3b85ec9a6b9f9ad168504b488
1 file changed +4 -1
+4 -1
--- src/import.c
+++ src/import.c
@@ -160,12 +160,14 @@
160160
161161
hname_hash(pContent, 0, &hash);
162162
rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &hash);
163163
if( rid==0 ){
164164
static Stmt ins;
165
+ assert( g.rcvid>0 );
165166
db_static_prepare(&ins,
166
- "INSERT INTO blob(uuid, size, content) VALUES(:uuid, :size, :content)"
167
+ "INSERT INTO blob(uuid, size, rcvid, content)"
168
+ "VALUES(:uuid, :size, %d, :content)", g.rcvid
167169
);
168170
db_bind_text(&ins, ":uuid", blob_str(&hash));
169171
db_bind_int(&ins, ":size", gg.nData);
170172
blob_compress(pContent, &cmpr);
171173
db_bind_blob(&ins, ":content", &cmpr);
@@ -1770,10 +1772,11 @@
17701772
db_begin_transaction();
17711773
if( !incrFlag ){
17721774
db_initial_setup(0, 0, zDefaultUser);
17731775
db_set("main-branch", gimport.zTrunkName, 0);
17741776
}
1777
+ content_rcvid_init(svnFlag ? "svn-import" : "git-import");
17751778
17761779
if( svnFlag ){
17771780
db_multi_exec(
17781781
"CREATE TEMP TABLE xrevisions("
17791782
" trev INTEGER, tbranch INT, trid INT, tparent INT DEFAULT 0,"
17801783
--- src/import.c
+++ src/import.c
@@ -160,12 +160,14 @@
160
161 hname_hash(pContent, 0, &hash);
162 rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &hash);
163 if( rid==0 ){
164 static Stmt ins;
 
165 db_static_prepare(&ins,
166 "INSERT INTO blob(uuid, size, content) VALUES(:uuid, :size, :content)"
 
167 );
168 db_bind_text(&ins, ":uuid", blob_str(&hash));
169 db_bind_int(&ins, ":size", gg.nData);
170 blob_compress(pContent, &cmpr);
171 db_bind_blob(&ins, ":content", &cmpr);
@@ -1770,10 +1772,11 @@
1770 db_begin_transaction();
1771 if( !incrFlag ){
1772 db_initial_setup(0, 0, zDefaultUser);
1773 db_set("main-branch", gimport.zTrunkName, 0);
1774 }
 
1775
1776 if( svnFlag ){
1777 db_multi_exec(
1778 "CREATE TEMP TABLE xrevisions("
1779 " trev INTEGER, tbranch INT, trid INT, tparent INT DEFAULT 0,"
1780
--- src/import.c
+++ src/import.c
@@ -160,12 +160,14 @@
160
161 hname_hash(pContent, 0, &hash);
162 rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &hash);
163 if( rid==0 ){
164 static Stmt ins;
165 assert( g.rcvid>0 );
166 db_static_prepare(&ins,
167 "INSERT INTO blob(uuid, size, rcvid, content)"
168 "VALUES(:uuid, :size, %d, :content)", g.rcvid
169 );
170 db_bind_text(&ins, ":uuid", blob_str(&hash));
171 db_bind_int(&ins, ":size", gg.nData);
172 blob_compress(pContent, &cmpr);
173 db_bind_blob(&ins, ":content", &cmpr);
@@ -1770,10 +1772,11 @@
1772 db_begin_transaction();
1773 if( !incrFlag ){
1774 db_initial_setup(0, 0, zDefaultUser);
1775 db_set("main-branch", gimport.zTrunkName, 0);
1776 }
1777 content_rcvid_init(svnFlag ? "svn-import" : "git-import");
1778
1779 if( svnFlag ){
1780 db_multi_exec(
1781 "CREATE TEMP TABLE xrevisions("
1782 " trev INTEGER, tbranch INT, trid INT, tparent INT DEFAULT 0,"
1783

Keyboard Shortcuts

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