244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
|
int mnToBundle; /* Minimum RID in the bundle */
Stmt q;
/* Decode the arguments (like --branch) that specify which artifacts
** should be in the bundle */
db_multi_exec("CREATE TEMP TABLE tobundle(rid INTEGER PRIMARY KEY);");
subtree_from_arguments("tobundle");
find_checkin_associates("tobundle", !bStandalone);
verify_all_options();
/* Create the new bundle */
bundle_attach_file(g.argv[3], "b1", 1);
db_begin_transaction();
/* Add 'mtime' and 'project-code' entries to the bconfig table */
|
|
|
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
|
int mnToBundle; /* Minimum RID in the bundle */
Stmt q;
/* Decode the arguments (like --branch) that specify which artifacts
** should be in the bundle */
db_multi_exec("CREATE TEMP TABLE tobundle(rid INTEGER PRIMARY KEY);");
subtree_from_arguments("tobundle");
find_checkin_associates("tobundle", 0);
verify_all_options();
/* Create the new bundle */
bundle_attach_file(g.argv[3], "b1", 1);
db_begin_transaction();
/* Add 'mtime' and 'project-code' entries to the bconfig table */
|
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
|
" tobundle.rid,"
" blob.uuid,"
" blob.size,"
" delta.srcid,"
" blob.content"
" FROM tobundle, blob, delta"
" WHERE blob.rid=tobundle.rid"
" AND delta.rid=tobundle.rid;"
);
/* For all the remaining artifacts, we need to construct their deltas
** manually.
*/
mnToBundle = db_int(0,"SELECT min(rid) FROM tobundle");
db_prepare(&q,
|
|
>
|
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
|
" tobundle.rid,"
" blob.uuid,"
" blob.size,"
" delta.srcid,"
" blob.content"
" FROM tobundle, blob, delta"
" WHERE blob.rid=tobundle.rid"
" AND delta.rid=tobundle.rid"
" AND delta.srcid IN tobundle;"
);
/* For all the remaining artifacts, we need to construct their deltas
** manually.
*/
mnToBundle = db_int(0,"SELECT min(rid) FROM tobundle");
db_prepare(&q,
|
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
|
");"
"CREATE INDEX bixdelta ON bix(delta);"
"INSERT INTO bix(blobid,delta)"
" SELECT blobid,"
" CASE WHEN typeof(delta)=='integer'"
" THEN delta ELSE 0 END"
" FROM bblob"
" WHERE NOT EXISTS(SELECT 1 FROM blob WHERE uuid=bblob.uuid);"
);
manifest_crosslink_begin();
bundle_import_elements(0, 0, isPriv);
manifest_crosslink_end(0);
db_end_transaction(0);
}
|
|
|
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
|
");"
"CREATE INDEX bixdelta ON bix(delta);"
"INSERT INTO bix(blobid,delta)"
" SELECT blobid,"
" CASE WHEN typeof(delta)=='integer'"
" THEN delta ELSE 0 END"
" FROM bblob"
" WHERE NOT EXISTS(SELECT 1 FROM blob WHERE uuid=bblob.uuid AND size>=0);"
);
manifest_crosslink_begin();
bundle_import_elements(0, 0, isPriv);
manifest_crosslink_end(0);
db_end_transaction(0);
}
|