Fossil

Check-in [59ba20f8]
Login

Check-in [59ba20f8]

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

Overview
Comment:Make an appropriate entry in the rcvfrom table when doing a git or svn import. See forum post 92db82a45e for details on the problem that this check-in attempts to fix.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 59ba20f8450bb8583aa71cead5cf2abd2fbdf2a3b85ec9a6b9f9ad168504b488
User & Date: drh 2020-09-16 13:21:48
Context
2020-09-16
13:45
Update the built-in SQLite and Pikchr to the latest code, for testing. ... (check-in: ecf679b2 user: drh tags: trunk)
13:21
Make an appropriate entry in the rcvfrom table when doing a git or svn import. See forum post 92db82a45e for details on the problem that this check-in attempts to fix. ... (check-in: 59ba20f8 user: drh tags: trunk)
08:04
pikchrshow, wikiedit, and fileedit now all respond to ctrl-enter in their editor to refresh the preview. The latter two, on their preview tabs, respond to ctrl-enter to switch back to the editor and give it focus. It's now possible to edit, preview, and switch back to the same editing position without the mouse :). ... (check-in: a1838297 user: stephan tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/import.c.

158
159
160
161
162
163
164

165
166

167
168
169
170
171
172
173
  Blob cmpr;
  int rid;

  hname_hash(pContent, 0, &hash);
  rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &hash);
  if( rid==0 ){
    static Stmt ins;

    db_static_prepare(&ins,
        "INSERT INTO blob(uuid, size, content) VALUES(:uuid, :size, :content)"

    );
    db_bind_text(&ins, ":uuid", blob_str(&hash));
    db_bind_int(&ins, ":size", gg.nData);
    blob_compress(pContent, &cmpr);
    db_bind_blob(&ins, ":content", &cmpr);
    db_step(&ins);
    db_reset(&ins);







>

|
>







158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
  Blob cmpr;
  int rid;

  hname_hash(pContent, 0, &hash);
  rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &hash);
  if( rid==0 ){
    static Stmt ins;
    assert( g.rcvid>0 );
    db_static_prepare(&ins,
        "INSERT INTO blob(uuid, size, rcvid, content)"
        "VALUES(:uuid, :size, %d, :content)", g.rcvid
    );
    db_bind_text(&ins, ":uuid", blob_str(&hash));
    db_bind_int(&ins, ":size", gg.nData);
    blob_compress(pContent, &cmpr);
    db_bind_blob(&ins, ":content", &cmpr);
    db_step(&ins);
    db_reset(&ins);
1768
1769
1770
1771
1772
1773
1774

1775
1776
1777
1778
1779
1780
1781
  db_unprotect(PROTECT_ALL);

  db_begin_transaction();
  if( !incrFlag ){
    db_initial_setup(0, 0, zDefaultUser);
    db_set("main-branch", gimport.zTrunkName, 0);
  }


  if( svnFlag ){
    db_multi_exec(
       "CREATE TEMP TABLE xrevisions("
       " trev INTEGER, tbranch INT, trid INT, tparent INT DEFAULT 0,"
       " UNIQUE(tbranch, trev)"
       ");"







>







1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
  db_unprotect(PROTECT_ALL);

  db_begin_transaction();
  if( !incrFlag ){
    db_initial_setup(0, 0, zDefaultUser);
    db_set("main-branch", gimport.zTrunkName, 0);
  }
  content_rcvid_init(svnFlag ? "svn-import" : "git-import");

  if( svnFlag ){
    db_multi_exec(
       "CREATE TEMP TABLE xrevisions("
       " trev INTEGER, tbranch INT, trid INT, tparent INT DEFAULT 0,"
       " UNIQUE(tbranch, trev)"
       ");"