Fossil SCM
Back out check-in [3ad81c3c499599b4] which was causing sync to fail.
Commit
e1962ef67f88fc0878755131c7a7b1936f87b3c94259261b71c5b8e3d03c4e78
Parent
b40f1ac135038a0…
42 files changed
+4
-4
+1
-1
+2
-2
+2
-2
+1
-1
+1
-1
+4
-4
+2
-2
+1
-1
+2
-2
+2
-2
+4
-4
+3
-3
+1
-1
+1
-1
+2
-2
+1
-1
+1
-1
+1
-1
+2
-2
+1
-1
+1
-1
+2
-2
+1
-1
+2
-2
+1
-1
+7
-7
+7
-7
+1
-1
+8
-8
+1
-1
+2
-2
+1
-1
+3
-3
+1
-1
+1
-1
+1
-1
+5
-5
+2
-2
+2
-2
+3
-3
+2
-2
~
src/add.c
~
src/alerts.c
~
src/allrepo.c
~
src/attach.c
~
src/bisect.c
~
src/branch.c
~
src/bundle.c
~
src/checkin.c
~
src/checkout.c
~
src/clone.c
~
src/configure.c
~
src/content.c
~
src/db.c
~
src/diff.c
~
src/event.c
~
src/import.c
~
src/info.c
~
src/json.c
~
src/json_branch.c
~
src/json_tag.c
~
src/login.c
~
src/main.c
~
src/manifest.c
~
src/merge.c
~
src/moderate.c
~
src/publish.c
~
src/purge.c
~
src/rebuild.c
~
src/search.c
~
src/setup.c
~
src/shun.c
~
src/skins.c
~
src/stash.c
~
src/tag.c
~
src/tkt.c
~
src/tktsetup.c
~
src/undo.c
~
src/unversioned.c
~
src/update.c
~
src/vfile.c
~
src/wiki.c
~
src/xfer.c
+4
-4
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -306,11 +306,11 @@ | ||
| 306 | 306 | if( zIgnoreFlag==0 ){ |
| 307 | 307 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 308 | 308 | } |
| 309 | 309 | if( db_get_boolean("dotfiles", 0) ) scanFlags |= SCAN_ALL; |
| 310 | 310 | vid = db_lget_int("checkout",0); |
| 311 | - db_begin_write(); | |
| 311 | + db_begin_transaction(); | |
| 312 | 312 | db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)", |
| 313 | 313 | filename_collation()); |
| 314 | 314 | pClean = glob_create(zCleanFlag); |
| 315 | 315 | pIgnore = glob_create(zIgnoreFlag); |
| 316 | 316 | nRoot = strlen(g.zLocalRoot); |
| @@ -460,11 +460,11 @@ | ||
| 460 | 460 | |
| 461 | 461 | /* We should be done with options.. */ |
| 462 | 462 | verify_all_options(); |
| 463 | 463 | |
| 464 | 464 | db_must_be_within_tree(); |
| 465 | - db_begin_write(); | |
| 465 | + db_begin_transaction(); | |
| 466 | 466 | if( g.argv[1][0]=='f' ){ /* i.e. "forget" */ |
| 467 | 467 | removeFiles = 0; |
| 468 | 468 | }else if( softFlag ){ |
| 469 | 469 | removeFiles = 0; |
| 470 | 470 | }else if( hardFlag ){ |
| @@ -662,11 +662,11 @@ | ||
| 662 | 662 | if( zIgnoreFlag==0 ){ |
| 663 | 663 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 664 | 664 | } |
| 665 | 665 | if( db_get_boolean("dotfiles", 0) ) scanFlags |= SCAN_ALL; |
| 666 | 666 | vid = db_lget_int("checkout",0); |
| 667 | - db_begin_write(); | |
| 667 | + db_begin_transaction(); | |
| 668 | 668 | |
| 669 | 669 | /* step 1: |
| 670 | 670 | ** Populate the temp table "sfile" with the names of all unmanaged |
| 671 | 671 | ** files currently in the check-out, except for files that match the |
| 672 | 672 | ** --ignore or ignore-glob patterns and dot-files. Then add all of |
| @@ -881,11 +881,11 @@ | ||
| 881 | 881 | } |
| 882 | 882 | if( g.argc<4 ){ |
| 883 | 883 | usage("OLDNAME NEWNAME"); |
| 884 | 884 | } |
| 885 | 885 | zDest = g.argv[g.argc-1]; |
| 886 | - db_begin_write(); | |
| 886 | + db_begin_transaction(); | |
| 887 | 887 | if( g.argv[1][0]=='r' ){ /* i.e. "rename" */ |
| 888 | 888 | moveFiles = 0; |
| 889 | 889 | }else if( softFlag ){ |
| 890 | 890 | moveFiles = 0; |
| 891 | 891 | }else if( hardFlag ){ |
| 892 | 892 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -306,11 +306,11 @@ | |
| 306 | if( zIgnoreFlag==0 ){ |
| 307 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 308 | } |
| 309 | if( db_get_boolean("dotfiles", 0) ) scanFlags |= SCAN_ALL; |
| 310 | vid = db_lget_int("checkout",0); |
| 311 | db_begin_write(); |
| 312 | db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)", |
| 313 | filename_collation()); |
| 314 | pClean = glob_create(zCleanFlag); |
| 315 | pIgnore = glob_create(zIgnoreFlag); |
| 316 | nRoot = strlen(g.zLocalRoot); |
| @@ -460,11 +460,11 @@ | |
| 460 | |
| 461 | /* We should be done with options.. */ |
| 462 | verify_all_options(); |
| 463 | |
| 464 | db_must_be_within_tree(); |
| 465 | db_begin_write(); |
| 466 | if( g.argv[1][0]=='f' ){ /* i.e. "forget" */ |
| 467 | removeFiles = 0; |
| 468 | }else if( softFlag ){ |
| 469 | removeFiles = 0; |
| 470 | }else if( hardFlag ){ |
| @@ -662,11 +662,11 @@ | |
| 662 | if( zIgnoreFlag==0 ){ |
| 663 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 664 | } |
| 665 | if( db_get_boolean("dotfiles", 0) ) scanFlags |= SCAN_ALL; |
| 666 | vid = db_lget_int("checkout",0); |
| 667 | db_begin_write(); |
| 668 | |
| 669 | /* step 1: |
| 670 | ** Populate the temp table "sfile" with the names of all unmanaged |
| 671 | ** files currently in the check-out, except for files that match the |
| 672 | ** --ignore or ignore-glob patterns and dot-files. Then add all of |
| @@ -881,11 +881,11 @@ | |
| 881 | } |
| 882 | if( g.argc<4 ){ |
| 883 | usage("OLDNAME NEWNAME"); |
| 884 | } |
| 885 | zDest = g.argv[g.argc-1]; |
| 886 | db_begin_write(); |
| 887 | if( g.argv[1][0]=='r' ){ /* i.e. "rename" */ |
| 888 | moveFiles = 0; |
| 889 | }else if( softFlag ){ |
| 890 | moveFiles = 0; |
| 891 | }else if( hardFlag ){ |
| 892 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -306,11 +306,11 @@ | |
| 306 | if( zIgnoreFlag==0 ){ |
| 307 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 308 | } |
| 309 | if( db_get_boolean("dotfiles", 0) ) scanFlags |= SCAN_ALL; |
| 310 | vid = db_lget_int("checkout",0); |
| 311 | db_begin_transaction(); |
| 312 | db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)", |
| 313 | filename_collation()); |
| 314 | pClean = glob_create(zCleanFlag); |
| 315 | pIgnore = glob_create(zIgnoreFlag); |
| 316 | nRoot = strlen(g.zLocalRoot); |
| @@ -460,11 +460,11 @@ | |
| 460 | |
| 461 | /* We should be done with options.. */ |
| 462 | verify_all_options(); |
| 463 | |
| 464 | db_must_be_within_tree(); |
| 465 | db_begin_transaction(); |
| 466 | if( g.argv[1][0]=='f' ){ /* i.e. "forget" */ |
| 467 | removeFiles = 0; |
| 468 | }else if( softFlag ){ |
| 469 | removeFiles = 0; |
| 470 | }else if( hardFlag ){ |
| @@ -662,11 +662,11 @@ | |
| 662 | if( zIgnoreFlag==0 ){ |
| 663 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 664 | } |
| 665 | if( db_get_boolean("dotfiles", 0) ) scanFlags |= SCAN_ALL; |
| 666 | vid = db_lget_int("checkout",0); |
| 667 | db_begin_transaction(); |
| 668 | |
| 669 | /* step 1: |
| 670 | ** Populate the temp table "sfile" with the names of all unmanaged |
| 671 | ** files currently in the check-out, except for files that match the |
| 672 | ** --ignore or ignore-glob patterns and dot-files. Then add all of |
| @@ -881,11 +881,11 @@ | |
| 881 | } |
| 882 | if( g.argc<4 ){ |
| 883 | usage("OLDNAME NEWNAME"); |
| 884 | } |
| 885 | zDest = g.argv[g.argc-1]; |
| 886 | db_begin_transaction(); |
| 887 | if( g.argv[1][0]=='r' ){ /* i.e. "rename" */ |
| 888 | moveFiles = 0; |
| 889 | }else if( softFlag ){ |
| 890 | moveFiles = 0; |
| 891 | }else if( hardFlag ){ |
| 892 |
+1
-1
| --- src/alerts.c | ||
| +++ src/alerts.c | ||
| @@ -211,11 +211,11 @@ | ||
| 211 | 211 | login_check_credentials(); |
| 212 | 212 | if( !g.perm.Setup ){ |
| 213 | 213 | login_needed(0); |
| 214 | 214 | return; |
| 215 | 215 | } |
| 216 | - db_begin_write(); | |
| 216 | + db_begin_transaction(); | |
| 217 | 217 | |
| 218 | 218 | alert_submenu_common(); |
| 219 | 219 | style_submenu_element("Send Announcement","%R/announce"); |
| 220 | 220 | style_header("Email Notification Setup"); |
| 221 | 221 | @ <h1>Status</h1> |
| 222 | 222 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -211,11 +211,11 @@ | |
| 211 | login_check_credentials(); |
| 212 | if( !g.perm.Setup ){ |
| 213 | login_needed(0); |
| 214 | return; |
| 215 | } |
| 216 | db_begin_write(); |
| 217 | |
| 218 | alert_submenu_common(); |
| 219 | style_submenu_element("Send Announcement","%R/announce"); |
| 220 | style_header("Email Notification Setup"); |
| 221 | @ <h1>Status</h1> |
| 222 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -211,11 +211,11 @@ | |
| 211 | login_check_credentials(); |
| 212 | if( !g.perm.Setup ){ |
| 213 | login_needed(0); |
| 214 | return; |
| 215 | } |
| 216 | db_begin_transaction(); |
| 217 | |
| 218 | alert_submenu_common(); |
| 219 | style_submenu_element("Send Announcement","%R/announce"); |
| 220 | style_header("Email Notification Setup"); |
| 221 | @ <h1>Status</h1> |
| 222 |
+2
-2
| --- src/allrepo.c | ||
| +++ src/allrepo.c | ||
| @@ -301,11 +301,11 @@ | ||
| 301 | 301 | int j; |
| 302 | 302 | Blob fn = BLOB_INITIALIZER; |
| 303 | 303 | Blob sql = BLOB_INITIALIZER; |
| 304 | 304 | useCheckouts = find_option("ckout","c",0)!=0; |
| 305 | 305 | verify_all_options(); |
| 306 | - db_begin_write(); | |
| 306 | + db_begin_transaction(); | |
| 307 | 307 | for(j=3; j<g.argc; j++, blob_reset(&sql), blob_reset(&fn)){ |
| 308 | 308 | file_canonical_name(g.argv[j], &fn, useCheckouts?1:0); |
| 309 | 309 | blob_append_sql(&sql, |
| 310 | 310 | "DELETE FROM global_config WHERE name GLOB '%s:%q'", |
| 311 | 311 | useCheckouts?"ckout":"repo", blob_str(&fn) |
| @@ -324,11 +324,11 @@ | ||
| 324 | 324 | }else if( strncmp(zCmd, "add", n)==0 ){ |
| 325 | 325 | int j; |
| 326 | 326 | Blob fn = BLOB_INITIALIZER; |
| 327 | 327 | Blob sql = BLOB_INITIALIZER; |
| 328 | 328 | verify_all_options(); |
| 329 | - db_begin_write(); | |
| 329 | + db_begin_transaction(); | |
| 330 | 330 | for(j=3; j<g.argc; j++, blob_reset(&fn), blob_reset(&sql)){ |
| 331 | 331 | sqlite3 *db; |
| 332 | 332 | int rc; |
| 333 | 333 | const char *z; |
| 334 | 334 | file_canonical_name(g.argv[j], &fn, 0); |
| 335 | 335 |
| --- src/allrepo.c | |
| +++ src/allrepo.c | |
| @@ -301,11 +301,11 @@ | |
| 301 | int j; |
| 302 | Blob fn = BLOB_INITIALIZER; |
| 303 | Blob sql = BLOB_INITIALIZER; |
| 304 | useCheckouts = find_option("ckout","c",0)!=0; |
| 305 | verify_all_options(); |
| 306 | db_begin_write(); |
| 307 | for(j=3; j<g.argc; j++, blob_reset(&sql), blob_reset(&fn)){ |
| 308 | file_canonical_name(g.argv[j], &fn, useCheckouts?1:0); |
| 309 | blob_append_sql(&sql, |
| 310 | "DELETE FROM global_config WHERE name GLOB '%s:%q'", |
| 311 | useCheckouts?"ckout":"repo", blob_str(&fn) |
| @@ -324,11 +324,11 @@ | |
| 324 | }else if( strncmp(zCmd, "add", n)==0 ){ |
| 325 | int j; |
| 326 | Blob fn = BLOB_INITIALIZER; |
| 327 | Blob sql = BLOB_INITIALIZER; |
| 328 | verify_all_options(); |
| 329 | db_begin_write(); |
| 330 | for(j=3; j<g.argc; j++, blob_reset(&fn), blob_reset(&sql)){ |
| 331 | sqlite3 *db; |
| 332 | int rc; |
| 333 | const char *z; |
| 334 | file_canonical_name(g.argv[j], &fn, 0); |
| 335 |
| --- src/allrepo.c | |
| +++ src/allrepo.c | |
| @@ -301,11 +301,11 @@ | |
| 301 | int j; |
| 302 | Blob fn = BLOB_INITIALIZER; |
| 303 | Blob sql = BLOB_INITIALIZER; |
| 304 | useCheckouts = find_option("ckout","c",0)!=0; |
| 305 | verify_all_options(); |
| 306 | db_begin_transaction(); |
| 307 | for(j=3; j<g.argc; j++, blob_reset(&sql), blob_reset(&fn)){ |
| 308 | file_canonical_name(g.argv[j], &fn, useCheckouts?1:0); |
| 309 | blob_append_sql(&sql, |
| 310 | "DELETE FROM global_config WHERE name GLOB '%s:%q'", |
| 311 | useCheckouts?"ckout":"repo", blob_str(&fn) |
| @@ -324,11 +324,11 @@ | |
| 324 | }else if( strncmp(zCmd, "add", n)==0 ){ |
| 325 | int j; |
| 326 | Blob fn = BLOB_INITIALIZER; |
| 327 | Blob sql = BLOB_INITIALIZER; |
| 328 | verify_all_options(); |
| 329 | db_begin_transaction(); |
| 330 | for(j=3; j<g.argc; j++, blob_reset(&fn), blob_reset(&sql)){ |
| 331 | sqlite3 *db; |
| 332 | int rc; |
| 333 | const char *z; |
| 334 | file_canonical_name(g.argv[j], &fn, 0); |
| 335 |
+2
-2
| --- src/attach.c | ||
| +++ src/attach.c | ||
| @@ -266,11 +266,11 @@ | ||
| 266 | 266 | int rid; |
| 267 | 267 | int i, n; |
| 268 | 268 | int addCompress = 0; |
| 269 | 269 | Manifest *pManifest; |
| 270 | 270 | |
| 271 | - db_begin_write(); | |
| 271 | + db_begin_transaction(); | |
| 272 | 272 | blob_init(&content, aContent, szContent); |
| 273 | 273 | pManifest = manifest_parse(&content, 0, 0); |
| 274 | 274 | manifest_destroy(pManifest); |
| 275 | 275 | blob_init(&content, aContent, szContent); |
| 276 | 276 | if( pManifest ){ |
| @@ -501,11 +501,11 @@ | ||
| 501 | 501 | char *zDate; |
| 502 | 502 | Blob manifest; |
| 503 | 503 | Blob cksum; |
| 504 | 504 | const char *zFile = zName; |
| 505 | 505 | |
| 506 | - db_begin_write(); | |
| 506 | + db_begin_transaction(); | |
| 507 | 507 | blob_zero(&manifest); |
| 508 | 508 | for(i=n=0; zFile[i]; i++){ |
| 509 | 509 | if( zFile[i]=='/' || zFile[i]=='\\' ) n = i; |
| 510 | 510 | } |
| 511 | 511 | zFile += n; |
| 512 | 512 |
| --- src/attach.c | |
| +++ src/attach.c | |
| @@ -266,11 +266,11 @@ | |
| 266 | int rid; |
| 267 | int i, n; |
| 268 | int addCompress = 0; |
| 269 | Manifest *pManifest; |
| 270 | |
| 271 | db_begin_write(); |
| 272 | blob_init(&content, aContent, szContent); |
| 273 | pManifest = manifest_parse(&content, 0, 0); |
| 274 | manifest_destroy(pManifest); |
| 275 | blob_init(&content, aContent, szContent); |
| 276 | if( pManifest ){ |
| @@ -501,11 +501,11 @@ | |
| 501 | char *zDate; |
| 502 | Blob manifest; |
| 503 | Blob cksum; |
| 504 | const char *zFile = zName; |
| 505 | |
| 506 | db_begin_write(); |
| 507 | blob_zero(&manifest); |
| 508 | for(i=n=0; zFile[i]; i++){ |
| 509 | if( zFile[i]=='/' || zFile[i]=='\\' ) n = i; |
| 510 | } |
| 511 | zFile += n; |
| 512 |
| --- src/attach.c | |
| +++ src/attach.c | |
| @@ -266,11 +266,11 @@ | |
| 266 | int rid; |
| 267 | int i, n; |
| 268 | int addCompress = 0; |
| 269 | Manifest *pManifest; |
| 270 | |
| 271 | db_begin_transaction(); |
| 272 | blob_init(&content, aContent, szContent); |
| 273 | pManifest = manifest_parse(&content, 0, 0); |
| 274 | manifest_destroy(pManifest); |
| 275 | blob_init(&content, aContent, szContent); |
| 276 | if( pManifest ){ |
| @@ -501,11 +501,11 @@ | |
| 501 | char *zDate; |
| 502 | Blob manifest; |
| 503 | Blob cksum; |
| 504 | const char *zFile = zName; |
| 505 | |
| 506 | db_begin_transaction(); |
| 507 | blob_zero(&manifest); |
| 508 | for(i=n=0; zFile[i]; i++){ |
| 509 | if( zFile[i]=='/' || zFile[i]=='\\' ) n = i; |
| 510 | } |
| 511 | zFile += n; |
| 512 |
+1
-1
| --- src/bisect.c | ||
| +++ src/bisect.c | ||
| @@ -410,11 +410,11 @@ | ||
| 410 | 410 | Blob log, id; |
| 411 | 411 | int ridBad = 0; |
| 412 | 412 | int ridGood = 0; |
| 413 | 413 | int cnt = 0, i; |
| 414 | 414 | foundCmd = 1; |
| 415 | - db_begin_write(); | |
| 415 | + db_begin_transaction(); | |
| 416 | 416 | zLog = db_lget("bisect-log",""); |
| 417 | 417 | blob_init(&log, zLog, -1); |
| 418 | 418 | while( blob_token(&log, &id) ){ cnt++; } |
| 419 | 419 | if( cnt==0 ){ |
| 420 | 420 | fossil_fatal("no previous bisect steps to undo"); |
| 421 | 421 |
| --- src/bisect.c | |
| +++ src/bisect.c | |
| @@ -410,11 +410,11 @@ | |
| 410 | Blob log, id; |
| 411 | int ridBad = 0; |
| 412 | int ridGood = 0; |
| 413 | int cnt = 0, i; |
| 414 | foundCmd = 1; |
| 415 | db_begin_write(); |
| 416 | zLog = db_lget("bisect-log",""); |
| 417 | blob_init(&log, zLog, -1); |
| 418 | while( blob_token(&log, &id) ){ cnt++; } |
| 419 | if( cnt==0 ){ |
| 420 | fossil_fatal("no previous bisect steps to undo"); |
| 421 |
| --- src/bisect.c | |
| +++ src/bisect.c | |
| @@ -410,11 +410,11 @@ | |
| 410 | Blob log, id; |
| 411 | int ridBad = 0; |
| 412 | int ridGood = 0; |
| 413 | int cnt = 0, i; |
| 414 | foundCmd = 1; |
| 415 | db_begin_transaction(); |
| 416 | zLog = db_lget("bisect-log",""); |
| 417 | blob_init(&log, zLog, -1); |
| 418 | while( blob_token(&log, &id) ){ cnt++; } |
| 419 | if( cnt==0 ){ |
| 420 | fossil_fatal("no previous bisect steps to undo"); |
| 421 |
+1
-1
| --- src/branch.c | ||
| +++ src/branch.c | ||
| @@ -95,11 +95,11 @@ | ||
| 95 | 95 | zBranch)!=0 ){ |
| 96 | 96 | fossil_fatal("branch \"%s\" already exists", zBranch); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | user_select(); |
| 100 | - db_begin_write(); | |
| 100 | + db_begin_transaction(); | |
| 101 | 101 | rootid = name_to_typed_rid(g.argv[4], "ci"); |
| 102 | 102 | if( rootid==0 ){ |
| 103 | 103 | fossil_fatal("unable to locate check-in off of which to branch"); |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -95,11 +95,11 @@ | |
| 95 | zBranch)!=0 ){ |
| 96 | fossil_fatal("branch \"%s\" already exists", zBranch); |
| 97 | } |
| 98 | |
| 99 | user_select(); |
| 100 | db_begin_write(); |
| 101 | rootid = name_to_typed_rid(g.argv[4], "ci"); |
| 102 | if( rootid==0 ){ |
| 103 | fossil_fatal("unable to locate check-in off of which to branch"); |
| 104 | } |
| 105 | |
| 106 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -95,11 +95,11 @@ | |
| 95 | zBranch)!=0 ){ |
| 96 | fossil_fatal("branch \"%s\" already exists", zBranch); |
| 97 | } |
| 98 | |
| 99 | user_select(); |
| 100 | db_begin_transaction(); |
| 101 | rootid = name_to_typed_rid(g.argv[4], "ci"); |
| 102 | if( rootid==0 ){ |
| 103 | fossil_fatal("unable to locate check-in off of which to branch"); |
| 104 | } |
| 105 | |
| 106 |
+4
-4
| --- src/bundle.c | ||
| +++ src/bundle.c | ||
| @@ -158,11 +158,11 @@ | ||
| 158 | 158 | verify_all_options(); |
| 159 | 159 | bundle_attach_file(g.argv[3], "b1", 1); |
| 160 | 160 | db_prepare(&q, |
| 161 | 161 | "INSERT INTO bblob(blobid, uuid, sz, delta, data, notes) " |
| 162 | 162 | "VALUES(NULL, $uuid, $sz, NULL, $data, $filename)"); |
| 163 | - db_begin_write(); | |
| 163 | + db_begin_transaction(); | |
| 164 | 164 | for(i=4; i<g.argc; i++){ |
| 165 | 165 | int sz; |
| 166 | 166 | blob_read_from_file(&content, g.argv[i], ExtFILE); |
| 167 | 167 | sz = blob_size(&content); |
| 168 | 168 | sha1sum_blob(&content, &hash); |
| @@ -303,11 +303,11 @@ | ||
| 303 | 303 | describe_artifacts("IN tobundle"); |
| 304 | 304 | |
| 305 | 305 | if( g.argc!=4 ) usage("export BUNDLE ?OPTIONS?"); |
| 306 | 306 | /* Create the new bundle */ |
| 307 | 307 | bundle_attach_file(g.argv[3], "b1", 1); |
| 308 | - db_begin_write(); | |
| 308 | + db_begin_transaction(); | |
| 309 | 309 | |
| 310 | 310 | /* Add 'mtime' and 'project-code' entries to the bconfig table */ |
| 311 | 311 | db_multi_exec( |
| 312 | 312 | "INSERT INTO bconfig(bcname,bcvalue)" |
| 313 | 313 | " VALUES('mtime',datetime('now'));" |
| @@ -599,11 +599,11 @@ | ||
| 599 | 599 | if( zMissingDeltas && zMissingDeltas[0] ){ |
| 600 | 600 | fossil_fatal("delta basis artifacts not found in repository: %s", |
| 601 | 601 | zMissingDeltas); |
| 602 | 602 | } |
| 603 | 603 | |
| 604 | - db_begin_write(); | |
| 604 | + db_begin_transaction(); | |
| 605 | 605 | db_multi_exec( |
| 606 | 606 | "CREATE TEMP TABLE bix(" |
| 607 | 607 | " blobid INTEGER PRIMARY KEY," |
| 608 | 608 | " delta INTEGER" |
| 609 | 609 | ");" |
| @@ -639,11 +639,11 @@ | ||
| 639 | 639 | int bTest = find_option("test",0,0)!=0; /* Undocumented --test option */ |
| 640 | 640 | const char *zFile = g.argv[3]; |
| 641 | 641 | verify_all_options(); |
| 642 | 642 | if ( g.argc!=4 ) usage("purge BUNDLE ?OPTIONS?"); |
| 643 | 643 | bundle_attach_file(zFile, "b1", 0); |
| 644 | - db_begin_write(); | |
| 644 | + db_begin_transaction(); | |
| 645 | 645 | |
| 646 | 646 | /* Find all check-ins of the bundle */ |
| 647 | 647 | db_multi_exec( |
| 648 | 648 | "CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY);" |
| 649 | 649 | "INSERT OR IGNORE INTO ok SELECT blob.rid FROM bblob, blob, plink" |
| 650 | 650 |
| --- src/bundle.c | |
| +++ src/bundle.c | |
| @@ -158,11 +158,11 @@ | |
| 158 | verify_all_options(); |
| 159 | bundle_attach_file(g.argv[3], "b1", 1); |
| 160 | db_prepare(&q, |
| 161 | "INSERT INTO bblob(blobid, uuid, sz, delta, data, notes) " |
| 162 | "VALUES(NULL, $uuid, $sz, NULL, $data, $filename)"); |
| 163 | db_begin_write(); |
| 164 | for(i=4; i<g.argc; i++){ |
| 165 | int sz; |
| 166 | blob_read_from_file(&content, g.argv[i], ExtFILE); |
| 167 | sz = blob_size(&content); |
| 168 | sha1sum_blob(&content, &hash); |
| @@ -303,11 +303,11 @@ | |
| 303 | describe_artifacts("IN tobundle"); |
| 304 | |
| 305 | if( g.argc!=4 ) usage("export BUNDLE ?OPTIONS?"); |
| 306 | /* Create the new bundle */ |
| 307 | bundle_attach_file(g.argv[3], "b1", 1); |
| 308 | db_begin_write(); |
| 309 | |
| 310 | /* Add 'mtime' and 'project-code' entries to the bconfig table */ |
| 311 | db_multi_exec( |
| 312 | "INSERT INTO bconfig(bcname,bcvalue)" |
| 313 | " VALUES('mtime',datetime('now'));" |
| @@ -599,11 +599,11 @@ | |
| 599 | if( zMissingDeltas && zMissingDeltas[0] ){ |
| 600 | fossil_fatal("delta basis artifacts not found in repository: %s", |
| 601 | zMissingDeltas); |
| 602 | } |
| 603 | |
| 604 | db_begin_write(); |
| 605 | db_multi_exec( |
| 606 | "CREATE TEMP TABLE bix(" |
| 607 | " blobid INTEGER PRIMARY KEY," |
| 608 | " delta INTEGER" |
| 609 | ");" |
| @@ -639,11 +639,11 @@ | |
| 639 | int bTest = find_option("test",0,0)!=0; /* Undocumented --test option */ |
| 640 | const char *zFile = g.argv[3]; |
| 641 | verify_all_options(); |
| 642 | if ( g.argc!=4 ) usage("purge BUNDLE ?OPTIONS?"); |
| 643 | bundle_attach_file(zFile, "b1", 0); |
| 644 | db_begin_write(); |
| 645 | |
| 646 | /* Find all check-ins of the bundle */ |
| 647 | db_multi_exec( |
| 648 | "CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY);" |
| 649 | "INSERT OR IGNORE INTO ok SELECT blob.rid FROM bblob, blob, plink" |
| 650 |
| --- src/bundle.c | |
| +++ src/bundle.c | |
| @@ -158,11 +158,11 @@ | |
| 158 | verify_all_options(); |
| 159 | bundle_attach_file(g.argv[3], "b1", 1); |
| 160 | db_prepare(&q, |
| 161 | "INSERT INTO bblob(blobid, uuid, sz, delta, data, notes) " |
| 162 | "VALUES(NULL, $uuid, $sz, NULL, $data, $filename)"); |
| 163 | db_begin_transaction(); |
| 164 | for(i=4; i<g.argc; i++){ |
| 165 | int sz; |
| 166 | blob_read_from_file(&content, g.argv[i], ExtFILE); |
| 167 | sz = blob_size(&content); |
| 168 | sha1sum_blob(&content, &hash); |
| @@ -303,11 +303,11 @@ | |
| 303 | describe_artifacts("IN tobundle"); |
| 304 | |
| 305 | if( g.argc!=4 ) usage("export BUNDLE ?OPTIONS?"); |
| 306 | /* Create the new bundle */ |
| 307 | bundle_attach_file(g.argv[3], "b1", 1); |
| 308 | db_begin_transaction(); |
| 309 | |
| 310 | /* Add 'mtime' and 'project-code' entries to the bconfig table */ |
| 311 | db_multi_exec( |
| 312 | "INSERT INTO bconfig(bcname,bcvalue)" |
| 313 | " VALUES('mtime',datetime('now'));" |
| @@ -599,11 +599,11 @@ | |
| 599 | if( zMissingDeltas && zMissingDeltas[0] ){ |
| 600 | fossil_fatal("delta basis artifacts not found in repository: %s", |
| 601 | zMissingDeltas); |
| 602 | } |
| 603 | |
| 604 | db_begin_transaction(); |
| 605 | db_multi_exec( |
| 606 | "CREATE TEMP TABLE bix(" |
| 607 | " blobid INTEGER PRIMARY KEY," |
| 608 | " delta INTEGER" |
| 609 | ");" |
| @@ -639,11 +639,11 @@ | |
| 639 | int bTest = find_option("test",0,0)!=0; /* Undocumented --test option */ |
| 640 | const char *zFile = g.argv[3]; |
| 641 | verify_all_options(); |
| 642 | if ( g.argc!=4 ) usage("purge BUNDLE ?OPTIONS?"); |
| 643 | bundle_attach_file(zFile, "b1", 0); |
| 644 | db_begin_transaction(); |
| 645 | |
| 646 | /* Find all check-ins of the bundle */ |
| 647 | db_multi_exec( |
| 648 | "CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY);" |
| 649 | "INSERT OR IGNORE INTO ok SELECT blob.rid FROM bblob, blob, plink" |
| 650 |
+2
-2
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -2251,11 +2251,11 @@ | ||
| 2251 | 2251 | if( !db_exists("SELECT 1 FROM user WHERE login=%Q", g.zLogin) ){ |
| 2252 | 2252 | fossil_fatal("no such user: %s", g.zLogin); |
| 2253 | 2253 | } |
| 2254 | 2254 | |
| 2255 | 2255 | hasChanges = unsaved_changes(useHash ? CKSIG_HASH : 0); |
| 2256 | - db_begin_write(); | |
| 2256 | + db_begin_transaction(); | |
| 2257 | 2257 | db_record_repository_filename(0); |
| 2258 | 2258 | if( hasChanges==0 && !isAMerge && !allowEmpty && !forceFlag ){ |
| 2259 | 2259 | fossil_fatal("nothing has changed; use --allow-empty to override"); |
| 2260 | 2260 | } |
| 2261 | 2261 | |
| @@ -2352,11 +2352,11 @@ | ||
| 2352 | 2352 | } |
| 2353 | 2353 | } |
| 2354 | 2354 | }else{ |
| 2355 | 2355 | db_multi_exec("REPLACE INTO vvar VALUES('ci-comment',%B)", &comment); |
| 2356 | 2356 | db_end_transaction(0); |
| 2357 | - db_begin_write(); | |
| 2357 | + db_begin_transaction(); | |
| 2358 | 2358 | } |
| 2359 | 2359 | |
| 2360 | 2360 | /* |
| 2361 | 2361 | ** Step 1: Compute an aggregate MD5 checksum over the disk image |
| 2362 | 2362 | ** of every file in vid. The file names are part of the checksum. |
| 2363 | 2363 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -2251,11 +2251,11 @@ | |
| 2251 | if( !db_exists("SELECT 1 FROM user WHERE login=%Q", g.zLogin) ){ |
| 2252 | fossil_fatal("no such user: %s", g.zLogin); |
| 2253 | } |
| 2254 | |
| 2255 | hasChanges = unsaved_changes(useHash ? CKSIG_HASH : 0); |
| 2256 | db_begin_write(); |
| 2257 | db_record_repository_filename(0); |
| 2258 | if( hasChanges==0 && !isAMerge && !allowEmpty && !forceFlag ){ |
| 2259 | fossil_fatal("nothing has changed; use --allow-empty to override"); |
| 2260 | } |
| 2261 | |
| @@ -2352,11 +2352,11 @@ | |
| 2352 | } |
| 2353 | } |
| 2354 | }else{ |
| 2355 | db_multi_exec("REPLACE INTO vvar VALUES('ci-comment',%B)", &comment); |
| 2356 | db_end_transaction(0); |
| 2357 | db_begin_write(); |
| 2358 | } |
| 2359 | |
| 2360 | /* |
| 2361 | ** Step 1: Compute an aggregate MD5 checksum over the disk image |
| 2362 | ** of every file in vid. The file names are part of the checksum. |
| 2363 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -2251,11 +2251,11 @@ | |
| 2251 | if( !db_exists("SELECT 1 FROM user WHERE login=%Q", g.zLogin) ){ |
| 2252 | fossil_fatal("no such user: %s", g.zLogin); |
| 2253 | } |
| 2254 | |
| 2255 | hasChanges = unsaved_changes(useHash ? CKSIG_HASH : 0); |
| 2256 | db_begin_transaction(); |
| 2257 | db_record_repository_filename(0); |
| 2258 | if( hasChanges==0 && !isAMerge && !allowEmpty && !forceFlag ){ |
| 2259 | fossil_fatal("nothing has changed; use --allow-empty to override"); |
| 2260 | } |
| 2261 | |
| @@ -2352,11 +2352,11 @@ | |
| 2352 | } |
| 2353 | } |
| 2354 | }else{ |
| 2355 | db_multi_exec("REPLACE INTO vvar VALUES('ci-comment',%B)", &comment); |
| 2356 | db_end_transaction(0); |
| 2357 | db_begin_transaction(); |
| 2358 | } |
| 2359 | |
| 2360 | /* |
| 2361 | ** Step 1: Compute an aggregate MD5 checksum over the disk image |
| 2362 | ** of every file in vid. The file names are part of the checksum. |
| 2363 |
+1
-1
| --- src/checkout.c | ||
| +++ src/checkout.c | ||
| @@ -293,11 +293,11 @@ | ||
| 293 | 293 | int vid, prior; |
| 294 | 294 | int setmtimeFlag; /* --setmtime. Set mtimes on files */ |
| 295 | 295 | Blob cksum1, cksum1b, cksum2; |
| 296 | 296 | |
| 297 | 297 | db_must_be_within_tree(); |
| 298 | - db_begin_write(); | |
| 298 | + db_begin_transaction(); | |
| 299 | 299 | forceFlag = find_option("force","f",0)!=0; |
| 300 | 300 | forceMissingFlag = find_option("force-missing",0,0)!=0; |
| 301 | 301 | keepFlag = find_option("keep",0,0)!=0; |
| 302 | 302 | latestFlag = find_option("latest",0,0)!=0; |
| 303 | 303 | promptFlag = find_option("prompt",0,0)!=0 || forceFlag==0; |
| 304 | 304 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -293,11 +293,11 @@ | |
| 293 | int vid, prior; |
| 294 | int setmtimeFlag; /* --setmtime. Set mtimes on files */ |
| 295 | Blob cksum1, cksum1b, cksum2; |
| 296 | |
| 297 | db_must_be_within_tree(); |
| 298 | db_begin_write(); |
| 299 | forceFlag = find_option("force","f",0)!=0; |
| 300 | forceMissingFlag = find_option("force-missing",0,0)!=0; |
| 301 | keepFlag = find_option("keep",0,0)!=0; |
| 302 | latestFlag = find_option("latest",0,0)!=0; |
| 303 | promptFlag = find_option("prompt",0,0)!=0 || forceFlag==0; |
| 304 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -293,11 +293,11 @@ | |
| 293 | int vid, prior; |
| 294 | int setmtimeFlag; /* --setmtime. Set mtimes on files */ |
| 295 | Blob cksum1, cksum1b, cksum2; |
| 296 | |
| 297 | db_must_be_within_tree(); |
| 298 | db_begin_transaction(); |
| 299 | forceFlag = find_option("force","f",0)!=0; |
| 300 | forceMissingFlag = find_option("force-missing",0,0)!=0; |
| 301 | keepFlag = find_option("keep",0,0)!=0; |
| 302 | latestFlag = find_option("latest",0,0)!=0; |
| 303 | promptFlag = find_option("prompt",0,0)!=0 || forceFlag==0; |
| 304 |
+2
-2
| --- src/clone.c | ||
| +++ src/clone.c | ||
| @@ -177,11 +177,11 @@ | ||
| 177 | 177 | }else{ |
| 178 | 178 | db_close_config(); |
| 179 | 179 | db_create_repository(g.argv[3]); |
| 180 | 180 | db_open_repository(g.argv[3]); |
| 181 | 181 | db_open_config(0,0); |
| 182 | - db_begin_write(); | |
| 182 | + db_begin_transaction(); | |
| 183 | 183 | db_record_repository_filename(g.argv[3]); |
| 184 | 184 | db_initial_setup(0, 0, zDefaultUser); |
| 185 | 185 | user_select(); |
| 186 | 186 | db_set("content-schema", CONTENT_SCHEMA, 0); |
| 187 | 187 | db_set("aux-schema", AUX_SCHEMA_MAX, 0); |
| @@ -215,11 +215,11 @@ | ||
| 215 | 215 | file_delete(g.argv[3]); |
| 216 | 216 | fossil_fatal("server returned an error - clone aborted"); |
| 217 | 217 | } |
| 218 | 218 | db_open_repository(g.argv[3]); |
| 219 | 219 | } |
| 220 | - db_begin_write(); | |
| 220 | + db_begin_transaction(); | |
| 221 | 221 | fossil_print("Rebuilding repository meta-data...\n"); |
| 222 | 222 | rebuild_db(0, 1, 0); |
| 223 | 223 | if( !noCompress ){ |
| 224 | 224 | fossil_print("Extra delta compression... "); fflush(stdout); |
| 225 | 225 | extra_deltification(); |
| 226 | 226 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -177,11 +177,11 @@ | |
| 177 | }else{ |
| 178 | db_close_config(); |
| 179 | db_create_repository(g.argv[3]); |
| 180 | db_open_repository(g.argv[3]); |
| 181 | db_open_config(0,0); |
| 182 | db_begin_write(); |
| 183 | db_record_repository_filename(g.argv[3]); |
| 184 | db_initial_setup(0, 0, zDefaultUser); |
| 185 | user_select(); |
| 186 | db_set("content-schema", CONTENT_SCHEMA, 0); |
| 187 | db_set("aux-schema", AUX_SCHEMA_MAX, 0); |
| @@ -215,11 +215,11 @@ | |
| 215 | file_delete(g.argv[3]); |
| 216 | fossil_fatal("server returned an error - clone aborted"); |
| 217 | } |
| 218 | db_open_repository(g.argv[3]); |
| 219 | } |
| 220 | db_begin_write(); |
| 221 | fossil_print("Rebuilding repository meta-data...\n"); |
| 222 | rebuild_db(0, 1, 0); |
| 223 | if( !noCompress ){ |
| 224 | fossil_print("Extra delta compression... "); fflush(stdout); |
| 225 | extra_deltification(); |
| 226 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -177,11 +177,11 @@ | |
| 177 | }else{ |
| 178 | db_close_config(); |
| 179 | db_create_repository(g.argv[3]); |
| 180 | db_open_repository(g.argv[3]); |
| 181 | db_open_config(0,0); |
| 182 | db_begin_transaction(); |
| 183 | db_record_repository_filename(g.argv[3]); |
| 184 | db_initial_setup(0, 0, zDefaultUser); |
| 185 | user_select(); |
| 186 | db_set("content-schema", CONTENT_SCHEMA, 0); |
| 187 | db_set("aux-schema", AUX_SCHEMA_MAX, 0); |
| @@ -215,11 +215,11 @@ | |
| 215 | file_delete(g.argv[3]); |
| 216 | fossil_fatal("server returned an error - clone aborted"); |
| 217 | } |
| 218 | db_open_repository(g.argv[3]); |
| 219 | } |
| 220 | db_begin_transaction(); |
| 221 | fossil_print("Rebuilding repository meta-data...\n"); |
| 222 | rebuild_db(0, 1, 0); |
| 223 | if( !noCompress ){ |
| 224 | fossil_print("Extra delta compression... "); fflush(stdout); |
| 225 | extra_deltification(); |
| 226 |
+2
-2
| --- src/configure.c | ||
| +++ src/configure.c | ||
| @@ -779,11 +779,11 @@ | ||
| 779 | 779 | || strncmp(zMethod, "merge", n)==0 ){ |
| 780 | 780 | Blob in; |
| 781 | 781 | int groupMask; |
| 782 | 782 | if( g.argc!=4 ) usage(mprintf("%s FILENAME",zMethod)); |
| 783 | 783 | blob_read_from_file(&in, g.argv[3], ExtFILE); |
| 784 | - db_begin_write(); | |
| 784 | + db_begin_transaction(); | |
| 785 | 785 | if( zMethod[0]=='i' ){ |
| 786 | 786 | groupMask = CONFIGSET_ALL | CONFIGSET_OVERWRITE; |
| 787 | 787 | }else{ |
| 788 | 788 | groupMask = CONFIGSET_ALL; |
| 789 | 789 | } |
| @@ -827,11 +827,11 @@ | ||
| 827 | 827 | char *zBackup; |
| 828 | 828 | if( g.argc!=4 ) usage("reset AREA"); |
| 829 | 829 | mask = configure_name_to_mask(g.argv[3], 1); |
| 830 | 830 | zBackup = db_text(0, |
| 831 | 831 | "SELECT strftime('config-backup-%%Y%%m%%d%%H%%M%%f','now')"); |
| 832 | - db_begin_write(); | |
| 832 | + db_begin_transaction(); | |
| 833 | 833 | export_config(mask, g.argv[3], 0, zBackup); |
| 834 | 834 | for(i=0; i<count(aConfig); i++){ |
| 835 | 835 | const char *zName = aConfig[i].zName; |
| 836 | 836 | if( (aConfig[i].groupMask & mask)==0 ) continue; |
| 837 | 837 | if( zName[0]!='@' ){ |
| 838 | 838 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -779,11 +779,11 @@ | |
| 779 | || strncmp(zMethod, "merge", n)==0 ){ |
| 780 | Blob in; |
| 781 | int groupMask; |
| 782 | if( g.argc!=4 ) usage(mprintf("%s FILENAME",zMethod)); |
| 783 | blob_read_from_file(&in, g.argv[3], ExtFILE); |
| 784 | db_begin_write(); |
| 785 | if( zMethod[0]=='i' ){ |
| 786 | groupMask = CONFIGSET_ALL | CONFIGSET_OVERWRITE; |
| 787 | }else{ |
| 788 | groupMask = CONFIGSET_ALL; |
| 789 | } |
| @@ -827,11 +827,11 @@ | |
| 827 | char *zBackup; |
| 828 | if( g.argc!=4 ) usage("reset AREA"); |
| 829 | mask = configure_name_to_mask(g.argv[3], 1); |
| 830 | zBackup = db_text(0, |
| 831 | "SELECT strftime('config-backup-%%Y%%m%%d%%H%%M%%f','now')"); |
| 832 | db_begin_write(); |
| 833 | export_config(mask, g.argv[3], 0, zBackup); |
| 834 | for(i=0; i<count(aConfig); i++){ |
| 835 | const char *zName = aConfig[i].zName; |
| 836 | if( (aConfig[i].groupMask & mask)==0 ) continue; |
| 837 | if( zName[0]!='@' ){ |
| 838 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -779,11 +779,11 @@ | |
| 779 | || strncmp(zMethod, "merge", n)==0 ){ |
| 780 | Blob in; |
| 781 | int groupMask; |
| 782 | if( g.argc!=4 ) usage(mprintf("%s FILENAME",zMethod)); |
| 783 | blob_read_from_file(&in, g.argv[3], ExtFILE); |
| 784 | db_begin_transaction(); |
| 785 | if( zMethod[0]=='i' ){ |
| 786 | groupMask = CONFIGSET_ALL | CONFIGSET_OVERWRITE; |
| 787 | }else{ |
| 788 | groupMask = CONFIGSET_ALL; |
| 789 | } |
| @@ -827,11 +827,11 @@ | |
| 827 | char *zBackup; |
| 828 | if( g.argc!=4 ) usage("reset AREA"); |
| 829 | mask = configure_name_to_mask(g.argv[3], 1); |
| 830 | zBackup = db_text(0, |
| 831 | "SELECT strftime('config-backup-%%Y%%m%%d%%H%%M%%f','now')"); |
| 832 | db_begin_transaction(); |
| 833 | export_config(mask, g.argv[3], 0, zBackup); |
| 834 | for(i=0; i<count(aConfig); i++){ |
| 835 | const char *zName = aConfig[i].zName; |
| 836 | if( (aConfig[i].groupMask & mask)==0 ) continue; |
| 837 | if( zName[0]!='@' ){ |
| 838 |
+4
-4
| --- src/content.c | ||
| +++ src/content.c | ||
| @@ -513,11 +513,11 @@ | ||
| 513 | 513 | int isDephantomize = 0; |
| 514 | 514 | |
| 515 | 515 | assert( g.repositoryOpen ); |
| 516 | 516 | assert( pBlob!=0 ); |
| 517 | 517 | assert( srcId==0 || zUuid!=0 ); |
| 518 | - db_begin_write(); | |
| 518 | + db_begin_transaction(); | |
| 519 | 519 | if( zUuid==0 ){ |
| 520 | 520 | assert( nBlob==0 ); |
| 521 | 521 | /* First check the auxiliary hash to see if there is already an artifact |
| 522 | 522 | ** that uses the auxiliary hash name */ |
| 523 | 523 | hname_hash(pBlob, 1, &hash); |
| @@ -659,11 +659,11 @@ | ||
| 659 | 659 | int content_new(const char *zUuid, int isPrivate){ |
| 660 | 660 | int rid; |
| 661 | 661 | static Stmt s1, s2, s3; |
| 662 | 662 | |
| 663 | 663 | assert( g.repositoryOpen ); |
| 664 | - db_begin_write(); | |
| 664 | + db_begin_transaction(); | |
| 665 | 665 | if( uuid_is_shunned(zUuid) ){ |
| 666 | 666 | db_end_transaction(0); |
| 667 | 667 | return 0; |
| 668 | 668 | } |
| 669 | 669 | db_static_prepare(&s1, |
| @@ -870,11 +870,11 @@ | ||
| 870 | 870 | Stmt s1, s2; /* Statements used to create the delta */ |
| 871 | 871 | blob_compress(&bestDelta, &bestDelta); |
| 872 | 872 | db_prepare(&s1, "UPDATE blob SET content=:data WHERE rid=%d", rid); |
| 873 | 873 | db_prepare(&s2, "REPLACE INTO delta(rid,srcid)VALUES(%d,%d)", rid, bestSrc); |
| 874 | 874 | db_bind_blob(&s1, ":data", &bestDelta); |
| 875 | - db_begin_write(); | |
| 875 | + db_begin_transaction(); | |
| 876 | 876 | db_exec(&s1); |
| 877 | 877 | db_exec(&s2); |
| 878 | 878 | db_end_transaction(0); |
| 879 | 879 | db_finalize(&s1); |
| 880 | 880 | db_finalize(&s2); |
| @@ -1233,11 +1233,11 @@ | ||
| 1233 | 1233 | "Continue? (y/N)? ", &x); |
| 1234 | 1234 | c = blob_str(&x)[0]; |
| 1235 | 1235 | blob_reset(&x); |
| 1236 | 1236 | if( c!='y' && c!='Y' ) return; |
| 1237 | 1237 | db_find_and_open_repository(OPEN_ANY_SCHEMA, 0); |
| 1238 | - db_begin_write(); | |
| 1238 | + db_begin_transaction(); | |
| 1239 | 1239 | db_prepare(&q, "SELECT rid FROM delta WHERE srcid=:rid"); |
| 1240 | 1240 | for(i=2; i<g.argc; i++){ |
| 1241 | 1241 | int rid = atoi(g.argv[i]); |
| 1242 | 1242 | fossil_print("Erasing artifact %d (%s)\n", |
| 1243 | 1243 | rid, db_text("", "SELECT uuid FROM blob WHERE rid=%d", rid)); |
| 1244 | 1244 |
| --- src/content.c | |
| +++ src/content.c | |
| @@ -513,11 +513,11 @@ | |
| 513 | int isDephantomize = 0; |
| 514 | |
| 515 | assert( g.repositoryOpen ); |
| 516 | assert( pBlob!=0 ); |
| 517 | assert( srcId==0 || zUuid!=0 ); |
| 518 | db_begin_write(); |
| 519 | if( zUuid==0 ){ |
| 520 | assert( nBlob==0 ); |
| 521 | /* First check the auxiliary hash to see if there is already an artifact |
| 522 | ** that uses the auxiliary hash name */ |
| 523 | hname_hash(pBlob, 1, &hash); |
| @@ -659,11 +659,11 @@ | |
| 659 | int content_new(const char *zUuid, int isPrivate){ |
| 660 | int rid; |
| 661 | static Stmt s1, s2, s3; |
| 662 | |
| 663 | assert( g.repositoryOpen ); |
| 664 | db_begin_write(); |
| 665 | if( uuid_is_shunned(zUuid) ){ |
| 666 | db_end_transaction(0); |
| 667 | return 0; |
| 668 | } |
| 669 | db_static_prepare(&s1, |
| @@ -870,11 +870,11 @@ | |
| 870 | Stmt s1, s2; /* Statements used to create the delta */ |
| 871 | blob_compress(&bestDelta, &bestDelta); |
| 872 | db_prepare(&s1, "UPDATE blob SET content=:data WHERE rid=%d", rid); |
| 873 | db_prepare(&s2, "REPLACE INTO delta(rid,srcid)VALUES(%d,%d)", rid, bestSrc); |
| 874 | db_bind_blob(&s1, ":data", &bestDelta); |
| 875 | db_begin_write(); |
| 876 | db_exec(&s1); |
| 877 | db_exec(&s2); |
| 878 | db_end_transaction(0); |
| 879 | db_finalize(&s1); |
| 880 | db_finalize(&s2); |
| @@ -1233,11 +1233,11 @@ | |
| 1233 | "Continue? (y/N)? ", &x); |
| 1234 | c = blob_str(&x)[0]; |
| 1235 | blob_reset(&x); |
| 1236 | if( c!='y' && c!='Y' ) return; |
| 1237 | db_find_and_open_repository(OPEN_ANY_SCHEMA, 0); |
| 1238 | db_begin_write(); |
| 1239 | db_prepare(&q, "SELECT rid FROM delta WHERE srcid=:rid"); |
| 1240 | for(i=2; i<g.argc; i++){ |
| 1241 | int rid = atoi(g.argv[i]); |
| 1242 | fossil_print("Erasing artifact %d (%s)\n", |
| 1243 | rid, db_text("", "SELECT uuid FROM blob WHERE rid=%d", rid)); |
| 1244 |
| --- src/content.c | |
| +++ src/content.c | |
| @@ -513,11 +513,11 @@ | |
| 513 | int isDephantomize = 0; |
| 514 | |
| 515 | assert( g.repositoryOpen ); |
| 516 | assert( pBlob!=0 ); |
| 517 | assert( srcId==0 || zUuid!=0 ); |
| 518 | db_begin_transaction(); |
| 519 | if( zUuid==0 ){ |
| 520 | assert( nBlob==0 ); |
| 521 | /* First check the auxiliary hash to see if there is already an artifact |
| 522 | ** that uses the auxiliary hash name */ |
| 523 | hname_hash(pBlob, 1, &hash); |
| @@ -659,11 +659,11 @@ | |
| 659 | int content_new(const char *zUuid, int isPrivate){ |
| 660 | int rid; |
| 661 | static Stmt s1, s2, s3; |
| 662 | |
| 663 | assert( g.repositoryOpen ); |
| 664 | db_begin_transaction(); |
| 665 | if( uuid_is_shunned(zUuid) ){ |
| 666 | db_end_transaction(0); |
| 667 | return 0; |
| 668 | } |
| 669 | db_static_prepare(&s1, |
| @@ -870,11 +870,11 @@ | |
| 870 | Stmt s1, s2; /* Statements used to create the delta */ |
| 871 | blob_compress(&bestDelta, &bestDelta); |
| 872 | db_prepare(&s1, "UPDATE blob SET content=:data WHERE rid=%d", rid); |
| 873 | db_prepare(&s2, "REPLACE INTO delta(rid,srcid)VALUES(%d,%d)", rid, bestSrc); |
| 874 | db_bind_blob(&s1, ":data", &bestDelta); |
| 875 | db_begin_transaction(); |
| 876 | db_exec(&s1); |
| 877 | db_exec(&s2); |
| 878 | db_end_transaction(0); |
| 879 | db_finalize(&s1); |
| 880 | db_finalize(&s2); |
| @@ -1233,11 +1233,11 @@ | |
| 1233 | "Continue? (y/N)? ", &x); |
| 1234 | c = blob_str(&x)[0]; |
| 1235 | blob_reset(&x); |
| 1236 | if( c!='y' && c!='Y' ) return; |
| 1237 | db_find_and_open_repository(OPEN_ANY_SCHEMA, 0); |
| 1238 | db_begin_transaction(); |
| 1239 | db_prepare(&q, "SELECT rid FROM delta WHERE srcid=:rid"); |
| 1240 | for(i=2; i<g.argc; i++){ |
| 1241 | int rid = atoi(g.argv[i]); |
| 1242 | fossil_print("Erasing artifact %d (%s)\n", |
| 1243 | rid, db_text("", "SELECT uuid FROM blob WHERE rid=%d", rid)); |
| 1244 |
M
src/db.c
+3
-3
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2258,11 +2258,11 @@ | ||
| 2258 | 2258 | |
| 2259 | 2259 | db_create_repository(g.argv[2]); |
| 2260 | 2260 | db_open_repository(g.argv[2]); |
| 2261 | 2261 | db_open_config(0, 0); |
| 2262 | 2262 | if( zTemplate ) db_attach(zTemplate, "settingSrc"); |
| 2263 | - db_begin_write(); | |
| 2263 | + db_begin_transaction(); | |
| 2264 | 2264 | if( bUseSha1 ){ |
| 2265 | 2265 | g.eHashPolicy = HPOLICY_SHA1; |
| 2266 | 2266 | db_set_int("hash-policy", HPOLICY_SHA1, 0); |
| 2267 | 2267 | } |
| 2268 | 2268 | if( zDate==0 ) zDate = "now"; |
| @@ -2641,11 +2641,11 @@ | ||
| 2641 | 2641 | z = db_text(0, "SELECT strftime(%Q,%Q,'unixepoch');", zFormat, z); |
| 2642 | 2642 | } |
| 2643 | 2643 | return z; |
| 2644 | 2644 | } |
| 2645 | 2645 | void db_set(const char *zName, const char *zValue, int globalFlag){ |
| 2646 | - db_begin_write(); | |
| 2646 | + db_begin_transaction(); | |
| 2647 | 2647 | if( globalFlag ){ |
| 2648 | 2648 | db_swap_connections(); |
| 2649 | 2649 | db_multi_exec("REPLACE INTO global_config(name,value) VALUES(%Q,%Q)", |
| 2650 | 2650 | zName, zValue); |
| 2651 | 2651 | db_swap_connections(); |
| @@ -2657,11 +2657,11 @@ | ||
| 2657 | 2657 | db_multi_exec("DELETE FROM config WHERE name=%Q", zName); |
| 2658 | 2658 | } |
| 2659 | 2659 | db_end_transaction(0); |
| 2660 | 2660 | } |
| 2661 | 2661 | void db_unset(const char *zName, int globalFlag){ |
| 2662 | - db_begin_write(); | |
| 2662 | + db_begin_transaction(); | |
| 2663 | 2663 | if( globalFlag ){ |
| 2664 | 2664 | db_swap_connections(); |
| 2665 | 2665 | db_multi_exec("DELETE FROM global_config WHERE name=%Q", zName); |
| 2666 | 2666 | db_swap_connections(); |
| 2667 | 2667 | }else{ |
| 2668 | 2668 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2258,11 +2258,11 @@ | |
| 2258 | |
| 2259 | db_create_repository(g.argv[2]); |
| 2260 | db_open_repository(g.argv[2]); |
| 2261 | db_open_config(0, 0); |
| 2262 | if( zTemplate ) db_attach(zTemplate, "settingSrc"); |
| 2263 | db_begin_write(); |
| 2264 | if( bUseSha1 ){ |
| 2265 | g.eHashPolicy = HPOLICY_SHA1; |
| 2266 | db_set_int("hash-policy", HPOLICY_SHA1, 0); |
| 2267 | } |
| 2268 | if( zDate==0 ) zDate = "now"; |
| @@ -2641,11 +2641,11 @@ | |
| 2641 | z = db_text(0, "SELECT strftime(%Q,%Q,'unixepoch');", zFormat, z); |
| 2642 | } |
| 2643 | return z; |
| 2644 | } |
| 2645 | void db_set(const char *zName, const char *zValue, int globalFlag){ |
| 2646 | db_begin_write(); |
| 2647 | if( globalFlag ){ |
| 2648 | db_swap_connections(); |
| 2649 | db_multi_exec("REPLACE INTO global_config(name,value) VALUES(%Q,%Q)", |
| 2650 | zName, zValue); |
| 2651 | db_swap_connections(); |
| @@ -2657,11 +2657,11 @@ | |
| 2657 | db_multi_exec("DELETE FROM config WHERE name=%Q", zName); |
| 2658 | } |
| 2659 | db_end_transaction(0); |
| 2660 | } |
| 2661 | void db_unset(const char *zName, int globalFlag){ |
| 2662 | db_begin_write(); |
| 2663 | if( globalFlag ){ |
| 2664 | db_swap_connections(); |
| 2665 | db_multi_exec("DELETE FROM global_config WHERE name=%Q", zName); |
| 2666 | db_swap_connections(); |
| 2667 | }else{ |
| 2668 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2258,11 +2258,11 @@ | |
| 2258 | |
| 2259 | db_create_repository(g.argv[2]); |
| 2260 | db_open_repository(g.argv[2]); |
| 2261 | db_open_config(0, 0); |
| 2262 | if( zTemplate ) db_attach(zTemplate, "settingSrc"); |
| 2263 | db_begin_transaction(); |
| 2264 | if( bUseSha1 ){ |
| 2265 | g.eHashPolicy = HPOLICY_SHA1; |
| 2266 | db_set_int("hash-policy", HPOLICY_SHA1, 0); |
| 2267 | } |
| 2268 | if( zDate==0 ) zDate = "now"; |
| @@ -2641,11 +2641,11 @@ | |
| 2641 | z = db_text(0, "SELECT strftime(%Q,%Q,'unixepoch');", zFormat, z); |
| 2642 | } |
| 2643 | return z; |
| 2644 | } |
| 2645 | void db_set(const char *zName, const char *zValue, int globalFlag){ |
| 2646 | db_begin_transaction(); |
| 2647 | if( globalFlag ){ |
| 2648 | db_swap_connections(); |
| 2649 | db_multi_exec("REPLACE INTO global_config(name,value) VALUES(%Q,%Q)", |
| 2650 | zName, zValue); |
| 2651 | db_swap_connections(); |
| @@ -2657,11 +2657,11 @@ | |
| 2657 | db_multi_exec("DELETE FROM config WHERE name=%Q", zName); |
| 2658 | } |
| 2659 | db_end_transaction(0); |
| 2660 | } |
| 2661 | void db_unset(const char *zName, int globalFlag){ |
| 2662 | db_begin_transaction(); |
| 2663 | if( globalFlag ){ |
| 2664 | db_swap_connections(); |
| 2665 | db_multi_exec("DELETE FROM global_config WHERE name=%Q", zName); |
| 2666 | db_swap_connections(); |
| 2667 | }else{ |
| 2668 |
+1
-1
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -2235,11 +2235,11 @@ | ||
| 2235 | 2235 | }else{ |
| 2236 | 2236 | /* Default limit is as much as we can do in 1.000 seconds */ |
| 2237 | 2237 | iLimit = 0; |
| 2238 | 2238 | mxTime = current_time_in_milliseconds()+1000; |
| 2239 | 2239 | } |
| 2240 | - db_begin_write(); | |
| 2240 | + db_begin_transaction(); | |
| 2241 | 2241 | |
| 2242 | 2242 | /* Get the artifact ID for the check-in begin analyzed */ |
| 2243 | 2243 | if( zRevision ){ |
| 2244 | 2244 | cid = name_to_typed_rid(zRevision, "ci"); |
| 2245 | 2245 | }else{ |
| 2246 | 2246 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -2235,11 +2235,11 @@ | |
| 2235 | }else{ |
| 2236 | /* Default limit is as much as we can do in 1.000 seconds */ |
| 2237 | iLimit = 0; |
| 2238 | mxTime = current_time_in_milliseconds()+1000; |
| 2239 | } |
| 2240 | db_begin_write(); |
| 2241 | |
| 2242 | /* Get the artifact ID for the check-in begin analyzed */ |
| 2243 | if( zRevision ){ |
| 2244 | cid = name_to_typed_rid(zRevision, "ci"); |
| 2245 | }else{ |
| 2246 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -2235,11 +2235,11 @@ | |
| 2235 | }else{ |
| 2236 | /* Default limit is as much as we can do in 1.000 seconds */ |
| 2237 | iLimit = 0; |
| 2238 | mxTime = current_time_in_milliseconds()+1000; |
| 2239 | } |
| 2240 | db_begin_transaction(); |
| 2241 | |
| 2242 | /* Get the artifact ID for the check-in begin analyzed */ |
| 2243 | if( zRevision ){ |
| 2244 | cid = name_to_typed_rid(zRevision, "ci"); |
| 2245 | }else{ |
| 2246 |
+1
-1
| --- src/event.c | ||
| +++ src/event.c | ||
| @@ -255,11 +255,11 @@ | ||
| 255 | 255 | char *zDate; |
| 256 | 256 | Blob cksum; |
| 257 | 257 | int nrid, n; |
| 258 | 258 | |
| 259 | 259 | blob_init(&event, 0, 0); |
| 260 | - db_begin_write(); | |
| 260 | + db_begin_transaction(); | |
| 261 | 261 | while( fossil_isspace(zComment[0]) ) zComment++; |
| 262 | 262 | n = strlen(zComment); |
| 263 | 263 | while( n>0 && fossil_isspace(zComment[n-1]) ){ n--; } |
| 264 | 264 | if( n>0 ){ |
| 265 | 265 | blob_appendf(&event, "C %#F\n", n, zComment); |
| 266 | 266 |
| --- src/event.c | |
| +++ src/event.c | |
| @@ -255,11 +255,11 @@ | |
| 255 | char *zDate; |
| 256 | Blob cksum; |
| 257 | int nrid, n; |
| 258 | |
| 259 | blob_init(&event, 0, 0); |
| 260 | db_begin_write(); |
| 261 | while( fossil_isspace(zComment[0]) ) zComment++; |
| 262 | n = strlen(zComment); |
| 263 | while( n>0 && fossil_isspace(zComment[n-1]) ){ n--; } |
| 264 | if( n>0 ){ |
| 265 | blob_appendf(&event, "C %#F\n", n, zComment); |
| 266 |
| --- src/event.c | |
| +++ src/event.c | |
| @@ -255,11 +255,11 @@ | |
| 255 | char *zDate; |
| 256 | Blob cksum; |
| 257 | int nrid, n; |
| 258 | |
| 259 | blob_init(&event, 0, 0); |
| 260 | db_begin_transaction(); |
| 261 | while( fossil_isspace(zComment[0]) ) zComment++; |
| 262 | n = strlen(zComment); |
| 263 | while( n>0 && fossil_isspace(zComment[n-1]) ){ n--; } |
| 264 | if( n>0 ){ |
| 265 | blob_appendf(&event, "C %#F\n", n, zComment); |
| 266 |
+2
-2
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -1754,11 +1754,11 @@ | ||
| 1754 | 1754 | db_create_repository(g.argv[2]); |
| 1755 | 1755 | } |
| 1756 | 1756 | db_open_repository(g.argv[2]); |
| 1757 | 1757 | db_open_config(0, 0); |
| 1758 | 1758 | |
| 1759 | - db_begin_write(); | |
| 1759 | + db_begin_transaction(); | |
| 1760 | 1760 | if( !incrFlag ){ |
| 1761 | 1761 | db_initial_setup(0, 0, 0); |
| 1762 | 1762 | db_set("main-branch", gimport.zTrunkName, 0); |
| 1763 | 1763 | } |
| 1764 | 1764 | |
| @@ -1900,11 +1900,11 @@ | ||
| 1900 | 1900 | db_end_transaction(0); |
| 1901 | 1901 | fossil_print(" \r"); |
| 1902 | 1902 | if( omitRebuild ){ |
| 1903 | 1903 | omitVacuum = 1; |
| 1904 | 1904 | }else{ |
| 1905 | - db_begin_write(); | |
| 1905 | + db_begin_transaction(); | |
| 1906 | 1906 | fossil_print("Rebuilding repository meta-data...\n"); |
| 1907 | 1907 | rebuild_db(0, 1, !incrFlag); |
| 1908 | 1908 | verify_cancel(); |
| 1909 | 1909 | db_end_transaction(0); |
| 1910 | 1910 | } |
| 1911 | 1911 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -1754,11 +1754,11 @@ | |
| 1754 | db_create_repository(g.argv[2]); |
| 1755 | } |
| 1756 | db_open_repository(g.argv[2]); |
| 1757 | db_open_config(0, 0); |
| 1758 | |
| 1759 | db_begin_write(); |
| 1760 | if( !incrFlag ){ |
| 1761 | db_initial_setup(0, 0, 0); |
| 1762 | db_set("main-branch", gimport.zTrunkName, 0); |
| 1763 | } |
| 1764 | |
| @@ -1900,11 +1900,11 @@ | |
| 1900 | db_end_transaction(0); |
| 1901 | fossil_print(" \r"); |
| 1902 | if( omitRebuild ){ |
| 1903 | omitVacuum = 1; |
| 1904 | }else{ |
| 1905 | db_begin_write(); |
| 1906 | fossil_print("Rebuilding repository meta-data...\n"); |
| 1907 | rebuild_db(0, 1, !incrFlag); |
| 1908 | verify_cancel(); |
| 1909 | db_end_transaction(0); |
| 1910 | } |
| 1911 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -1754,11 +1754,11 @@ | |
| 1754 | db_create_repository(g.argv[2]); |
| 1755 | } |
| 1756 | db_open_repository(g.argv[2]); |
| 1757 | db_open_config(0, 0); |
| 1758 | |
| 1759 | db_begin_transaction(); |
| 1760 | if( !incrFlag ){ |
| 1761 | db_initial_setup(0, 0, 0); |
| 1762 | db_set("main-branch", gimport.zTrunkName, 0); |
| 1763 | } |
| 1764 | |
| @@ -1900,11 +1900,11 @@ | |
| 1900 | db_end_transaction(0); |
| 1901 | fossil_print(" \r"); |
| 1902 | if( omitRebuild ){ |
| 1903 | omitVacuum = 1; |
| 1904 | }else{ |
| 1905 | db_begin_transaction(); |
| 1906 | fossil_print("Rebuilding repository meta-data...\n"); |
| 1907 | rebuild_db(0, 1, !incrFlag); |
| 1908 | verify_cancel(); |
| 1909 | db_end_transaction(0); |
| 1910 | } |
| 1911 |
+1
-1
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -2721,11 +2721,11 @@ | ||
| 2721 | 2721 | if( fDryRun ){ |
| 2722 | 2722 | assert( g.isHTTP==0 ); /* Only print control artifact in console mode. */ |
| 2723 | 2723 | fossil_print("%s", blob_str(ctrl)); |
| 2724 | 2724 | blob_reset(ctrl); |
| 2725 | 2725 | }else{ |
| 2726 | - db_begin_write(); | |
| 2726 | + db_begin_transaction(); | |
| 2727 | 2727 | g.markPrivate = content_is_private(rid); |
| 2728 | 2728 | nrid = content_put(ctrl); |
| 2729 | 2729 | manifest_crosslink(nrid, ctrl, MC_PERMIT_HOOKS); |
| 2730 | 2730 | db_end_transaction(0); |
| 2731 | 2731 | } |
| 2732 | 2732 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2721,11 +2721,11 @@ | |
| 2721 | if( fDryRun ){ |
| 2722 | assert( g.isHTTP==0 ); /* Only print control artifact in console mode. */ |
| 2723 | fossil_print("%s", blob_str(ctrl)); |
| 2724 | blob_reset(ctrl); |
| 2725 | }else{ |
| 2726 | db_begin_write(); |
| 2727 | g.markPrivate = content_is_private(rid); |
| 2728 | nrid = content_put(ctrl); |
| 2729 | manifest_crosslink(nrid, ctrl, MC_PERMIT_HOOKS); |
| 2730 | db_end_transaction(0); |
| 2731 | } |
| 2732 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2721,11 +2721,11 @@ | |
| 2721 | if( fDryRun ){ |
| 2722 | assert( g.isHTTP==0 ); /* Only print control artifact in console mode. */ |
| 2723 | fossil_print("%s", blob_str(ctrl)); |
| 2724 | blob_reset(ctrl); |
| 2725 | }else{ |
| 2726 | db_begin_transaction(); |
| 2727 | g.markPrivate = content_is_private(rid); |
| 2728 | nrid = content_put(ctrl); |
| 2729 | manifest_crosslink(nrid, ctrl, MC_PERMIT_HOOKS); |
| 2730 | db_end_transaction(0); |
| 2731 | } |
| 2732 |
+1
-1
| --- src/json.c | ||
| +++ src/json.c | ||
| @@ -2103,11 +2103,11 @@ | ||
| 2103 | 2103 | longer than the client timeout, which will cause it to fail (but |
| 2104 | 2104 | it's sqlite3, so it'll fail gracefully). |
| 2105 | 2105 | */ |
| 2106 | 2106 | db_close(1); |
| 2107 | 2107 | db_open_repository(g.zRepositoryName); |
| 2108 | - db_begin_write(); | |
| 2108 | + db_begin_transaction(); | |
| 2109 | 2109 | rebuild_db(0, 0, 0); |
| 2110 | 2110 | db_end_transaction(0); |
| 2111 | 2111 | return NULL; |
| 2112 | 2112 | } |
| 2113 | 2113 | } |
| 2114 | 2114 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -2103,11 +2103,11 @@ | |
| 2103 | longer than the client timeout, which will cause it to fail (but |
| 2104 | it's sqlite3, so it'll fail gracefully). |
| 2105 | */ |
| 2106 | db_close(1); |
| 2107 | db_open_repository(g.zRepositoryName); |
| 2108 | db_begin_write(); |
| 2109 | rebuild_db(0, 0, 0); |
| 2110 | db_end_transaction(0); |
| 2111 | return NULL; |
| 2112 | } |
| 2113 | } |
| 2114 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -2103,11 +2103,11 @@ | |
| 2103 | longer than the client timeout, which will cause it to fail (but |
| 2104 | it's sqlite3, so it'll fail gracefully). |
| 2105 | */ |
| 2106 | db_close(1); |
| 2107 | db_open_repository(g.zRepositoryName); |
| 2108 | db_begin_transaction(); |
| 2109 | rebuild_db(0, 0, 0); |
| 2110 | db_end_transaction(0); |
| 2111 | return NULL; |
| 2112 | } |
| 2113 | } |
| 2114 |
+1
-1
| --- src/json_branch.c | ||
| +++ src/json_branch.c | ||
| @@ -212,11 +212,11 @@ | ||
| 212 | 212 | zBranch)!=0 ){ |
| 213 | 213 | zOpt->rcErrMsg = "Branch already exists."; |
| 214 | 214 | return FSL_JSON_E_RESOURCE_ALREADY_EXISTS; |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | - db_begin_write(); | |
| 217 | + db_begin_transaction(); | |
| 218 | 218 | rootid = name_to_typed_rid(zBasis, "ci"); |
| 219 | 219 | if( rootid==0 ){ |
| 220 | 220 | zOpt->rcErrMsg = "Basis branch not found."; |
| 221 | 221 | return FSL_JSON_E_RESOURCE_NOT_FOUND; |
| 222 | 222 | } |
| 223 | 223 |
| --- src/json_branch.c | |
| +++ src/json_branch.c | |
| @@ -212,11 +212,11 @@ | |
| 212 | zBranch)!=0 ){ |
| 213 | zOpt->rcErrMsg = "Branch already exists."; |
| 214 | return FSL_JSON_E_RESOURCE_ALREADY_EXISTS; |
| 215 | } |
| 216 | |
| 217 | db_begin_write(); |
| 218 | rootid = name_to_typed_rid(zBasis, "ci"); |
| 219 | if( rootid==0 ){ |
| 220 | zOpt->rcErrMsg = "Basis branch not found."; |
| 221 | return FSL_JSON_E_RESOURCE_NOT_FOUND; |
| 222 | } |
| 223 |
| --- src/json_branch.c | |
| +++ src/json_branch.c | |
| @@ -212,11 +212,11 @@ | |
| 212 | zBranch)!=0 ){ |
| 213 | zOpt->rcErrMsg = "Branch already exists."; |
| 214 | return FSL_JSON_E_RESOURCE_ALREADY_EXISTS; |
| 215 | } |
| 216 | |
| 217 | db_begin_transaction(); |
| 218 | rootid = name_to_typed_rid(zBasis, "ci"); |
| 219 | if( rootid==0 ){ |
| 220 | zOpt->rcErrMsg = "Basis branch not found."; |
| 221 | return FSL_JSON_E_RESOURCE_NOT_FOUND; |
| 222 | } |
| 223 |
+2
-2
| --- src/json_tag.c | ||
| +++ src/json_tag.c | ||
| @@ -98,11 +98,11 @@ | ||
| 98 | 98 | zValue = json_find_option_cstr("value",NULL,NULL); |
| 99 | 99 | if(!zValue && !fossil_has_json()){ |
| 100 | 100 | zValue = json_command_arg(5); |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - db_begin_write(); | |
| 103 | + db_begin_transaction(); | |
| 104 | 104 | tag_add_artifact(zPrefix, zName, zCheckin, zValue, |
| 105 | 105 | 1+fPropagate,NULL/*DateOvrd*/,NULL/*UserOvrd*/); |
| 106 | 106 | db_end_transaction(0); |
| 107 | 107 | |
| 108 | 108 | payV = cson_value_new_object(); |
| @@ -178,11 +178,11 @@ | ||
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | /* FIXME?: verify that the tag is currently active. We have no real |
| 181 | 181 | error case unless we do that. |
| 182 | 182 | */ |
| 183 | - db_begin_write(); | |
| 183 | + db_begin_transaction(); | |
| 184 | 184 | tag_add_artifact(zPrefix, zName, zCheckin, NULL, 0, 0, 0); |
| 185 | 185 | db_end_transaction(0); |
| 186 | 186 | return NULL; |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 |
| --- src/json_tag.c | |
| +++ src/json_tag.c | |
| @@ -98,11 +98,11 @@ | |
| 98 | zValue = json_find_option_cstr("value",NULL,NULL); |
| 99 | if(!zValue && !fossil_has_json()){ |
| 100 | zValue = json_command_arg(5); |
| 101 | } |
| 102 | |
| 103 | db_begin_write(); |
| 104 | tag_add_artifact(zPrefix, zName, zCheckin, zValue, |
| 105 | 1+fPropagate,NULL/*DateOvrd*/,NULL/*UserOvrd*/); |
| 106 | db_end_transaction(0); |
| 107 | |
| 108 | payV = cson_value_new_object(); |
| @@ -178,11 +178,11 @@ | |
| 178 | } |
| 179 | } |
| 180 | /* FIXME?: verify that the tag is currently active. We have no real |
| 181 | error case unless we do that. |
| 182 | */ |
| 183 | db_begin_write(); |
| 184 | tag_add_artifact(zPrefix, zName, zCheckin, NULL, 0, 0, 0); |
| 185 | db_end_transaction(0); |
| 186 | return NULL; |
| 187 | } |
| 188 | |
| 189 |
| --- src/json_tag.c | |
| +++ src/json_tag.c | |
| @@ -98,11 +98,11 @@ | |
| 98 | zValue = json_find_option_cstr("value",NULL,NULL); |
| 99 | if(!zValue && !fossil_has_json()){ |
| 100 | zValue = json_command_arg(5); |
| 101 | } |
| 102 | |
| 103 | db_begin_transaction(); |
| 104 | tag_add_artifact(zPrefix, zName, zCheckin, zValue, |
| 105 | 1+fPropagate,NULL/*DateOvrd*/,NULL/*UserOvrd*/); |
| 106 | db_end_transaction(0); |
| 107 | |
| 108 | payV = cson_value_new_object(); |
| @@ -178,11 +178,11 @@ | |
| 178 | } |
| 179 | } |
| 180 | /* FIXME?: verify that the tag is currently active. We have no real |
| 181 | error case unless we do that. |
| 182 | */ |
| 183 | db_begin_transaction(); |
| 184 | tag_add_artifact(zPrefix, zName, zCheckin, NULL, 0, 0, 0); |
| 185 | db_end_transaction(0); |
| 186 | return NULL; |
| 187 | } |
| 188 | |
| 189 |
+1
-1
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -1911,11 +1911,11 @@ | ||
| 1911 | 1911 | /* Create all the necessary CONFIG table entries on both the |
| 1912 | 1912 | ** other repository and on our own repository. |
| 1913 | 1913 | */ |
| 1914 | 1914 | zSelfProjCode = abbreviated_project_code(zSelfProjCode); |
| 1915 | 1915 | zOtherProjCode = abbreviated_project_code(zOtherProjCode); |
| 1916 | - db_begin_write(); | |
| 1916 | + db_begin_transaction(); | |
| 1917 | 1917 | db_multi_exec( |
| 1918 | 1918 | "DELETE FROM \"%w\".config WHERE name GLOB 'peer-*';" |
| 1919 | 1919 | "INSERT INTO \"%w\".config(name,value) VALUES('peer-repo-%q',%Q);" |
| 1920 | 1920 | "INSERT INTO \"%w\".config(name,value) " |
| 1921 | 1921 | " SELECT 'peer-name-%q', value FROM other.config" |
| 1922 | 1922 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -1911,11 +1911,11 @@ | |
| 1911 | /* Create all the necessary CONFIG table entries on both the |
| 1912 | ** other repository and on our own repository. |
| 1913 | */ |
| 1914 | zSelfProjCode = abbreviated_project_code(zSelfProjCode); |
| 1915 | zOtherProjCode = abbreviated_project_code(zOtherProjCode); |
| 1916 | db_begin_write(); |
| 1917 | db_multi_exec( |
| 1918 | "DELETE FROM \"%w\".config WHERE name GLOB 'peer-*';" |
| 1919 | "INSERT INTO \"%w\".config(name,value) VALUES('peer-repo-%q',%Q);" |
| 1920 | "INSERT INTO \"%w\".config(name,value) " |
| 1921 | " SELECT 'peer-name-%q', value FROM other.config" |
| 1922 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -1911,11 +1911,11 @@ | |
| 1911 | /* Create all the necessary CONFIG table entries on both the |
| 1912 | ** other repository and on our own repository. |
| 1913 | */ |
| 1914 | zSelfProjCode = abbreviated_project_code(zSelfProjCode); |
| 1915 | zOtherProjCode = abbreviated_project_code(zOtherProjCode); |
| 1916 | db_begin_transaction(); |
| 1917 | db_multi_exec( |
| 1918 | "DELETE FROM \"%w\".config WHERE name GLOB 'peer-*';" |
| 1919 | "INSERT INTO \"%w\".config(name,value) VALUES('peer-repo-%q',%Q);" |
| 1920 | "INSERT INTO \"%w\".config(name,value) " |
| 1921 | " SELECT 'peer-name-%q', value FROM other.config" |
| 1922 |
+1
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -2206,11 +2206,11 @@ | ||
| 2206 | 2206 | }else{ |
| 2207 | 2207 | if( isDir==0 && fCreate ){ |
| 2208 | 2208 | const char *zPassword; |
| 2209 | 2209 | db_create_repository(zRepo); |
| 2210 | 2210 | db_open_repository(zRepo); |
| 2211 | - db_begin_write(); | |
| 2211 | + db_begin_transaction(); | |
| 2212 | 2212 | g.eHashPolicy = HPOLICY_SHA3; |
| 2213 | 2213 | db_set_int("hash-policy", HPOLICY_SHA3, 0); |
| 2214 | 2214 | db_initial_setup(0, "now", g.zLogin); |
| 2215 | 2215 | db_end_transaction(0); |
| 2216 | 2216 | fossil_print("project-id: %s\n", db_get("project-code", 0)); |
| 2217 | 2217 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2206,11 +2206,11 @@ | |
| 2206 | }else{ |
| 2207 | if( isDir==0 && fCreate ){ |
| 2208 | const char *zPassword; |
| 2209 | db_create_repository(zRepo); |
| 2210 | db_open_repository(zRepo); |
| 2211 | db_begin_write(); |
| 2212 | g.eHashPolicy = HPOLICY_SHA3; |
| 2213 | db_set_int("hash-policy", HPOLICY_SHA3, 0); |
| 2214 | db_initial_setup(0, "now", g.zLogin); |
| 2215 | db_end_transaction(0); |
| 2216 | fossil_print("project-id: %s\n", db_get("project-code", 0)); |
| 2217 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2206,11 +2206,11 @@ | |
| 2206 | }else{ |
| 2207 | if( isDir==0 && fCreate ){ |
| 2208 | const char *zPassword; |
| 2209 | db_create_repository(zRepo); |
| 2210 | db_open_repository(zRepo); |
| 2211 | db_begin_transaction(); |
| 2212 | g.eHashPolicy = HPOLICY_SHA3; |
| 2213 | db_set_int("hash-policy", HPOLICY_SHA3, 0); |
| 2214 | db_initial_setup(0, "now", g.zLogin); |
| 2215 | db_end_transaction(0); |
| 2216 | fossil_print("project-id: %s\n", db_get("project-code", 0)); |
| 2217 |
+2
-2
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -1806,11 +1806,11 @@ | ||
| 1806 | 1806 | ** by the call to manifest_crosslink_end(). |
| 1807 | 1807 | */ |
| 1808 | 1808 | void manifest_crosslink_begin(void){ |
| 1809 | 1809 | assert( manifest_crosslink_busy==0 ); |
| 1810 | 1810 | manifest_crosslink_busy = 1; |
| 1811 | - db_begin_write(); | |
| 1811 | + db_begin_transaction(); | |
| 1812 | 1812 | db_multi_exec( |
| 1813 | 1813 | "CREATE TEMP TABLE pending_tkt(uuid TEXT UNIQUE);" |
| 1814 | 1814 | "CREATE TEMP TABLE time_fudge(" |
| 1815 | 1815 | " mid INTEGER PRIMARY KEY," /* The rid of a manifest */ |
| 1816 | 1816 | " m1 REAL," /* The timestamp on mid */ |
| @@ -2099,11 +2099,11 @@ | ||
| 2099 | 2099 | fossil_error(1, "cannot fetch baseline for manifest [%S]", |
| 2100 | 2100 | db_text(0, "SELECT uuid FROM blob WHERE rid=%d",rid)); |
| 2101 | 2101 | } |
| 2102 | 2102 | return 0; |
| 2103 | 2103 | } |
| 2104 | - db_begin_write(); | |
| 2104 | + db_begin_transaction(); | |
| 2105 | 2105 | if( p->type==CFTYPE_MANIFEST ){ |
| 2106 | 2106 | if( permitHooks ){ |
| 2107 | 2107 | zScript = xfer_commit_code(); |
| 2108 | 2108 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 2109 | 2109 | } |
| 2110 | 2110 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1806,11 +1806,11 @@ | |
| 1806 | ** by the call to manifest_crosslink_end(). |
| 1807 | */ |
| 1808 | void manifest_crosslink_begin(void){ |
| 1809 | assert( manifest_crosslink_busy==0 ); |
| 1810 | manifest_crosslink_busy = 1; |
| 1811 | db_begin_write(); |
| 1812 | db_multi_exec( |
| 1813 | "CREATE TEMP TABLE pending_tkt(uuid TEXT UNIQUE);" |
| 1814 | "CREATE TEMP TABLE time_fudge(" |
| 1815 | " mid INTEGER PRIMARY KEY," /* The rid of a manifest */ |
| 1816 | " m1 REAL," /* The timestamp on mid */ |
| @@ -2099,11 +2099,11 @@ | |
| 2099 | fossil_error(1, "cannot fetch baseline for manifest [%S]", |
| 2100 | db_text(0, "SELECT uuid FROM blob WHERE rid=%d",rid)); |
| 2101 | } |
| 2102 | return 0; |
| 2103 | } |
| 2104 | db_begin_write(); |
| 2105 | if( p->type==CFTYPE_MANIFEST ){ |
| 2106 | if( permitHooks ){ |
| 2107 | zScript = xfer_commit_code(); |
| 2108 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 2109 | } |
| 2110 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1806,11 +1806,11 @@ | |
| 1806 | ** by the call to manifest_crosslink_end(). |
| 1807 | */ |
| 1808 | void manifest_crosslink_begin(void){ |
| 1809 | assert( manifest_crosslink_busy==0 ); |
| 1810 | manifest_crosslink_busy = 1; |
| 1811 | db_begin_transaction(); |
| 1812 | db_multi_exec( |
| 1813 | "CREATE TEMP TABLE pending_tkt(uuid TEXT UNIQUE);" |
| 1814 | "CREATE TEMP TABLE time_fudge(" |
| 1815 | " mid INTEGER PRIMARY KEY," /* The rid of a manifest */ |
| 1816 | " m1 REAL," /* The timestamp on mid */ |
| @@ -2099,11 +2099,11 @@ | |
| 2099 | fossil_error(1, "cannot fetch baseline for manifest [%S]", |
| 2100 | db_text(0, "SELECT uuid FROM blob WHERE rid=%d",rid)); |
| 2101 | } |
| 2102 | return 0; |
| 2103 | } |
| 2104 | db_begin_transaction(); |
| 2105 | if( p->type==CFTYPE_MANIFEST ){ |
| 2106 | if( permitHooks ){ |
| 2107 | zScript = xfer_commit_code(); |
| 2108 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 2109 | } |
| 2110 |
+1
-1
| --- src/merge.c | ||
| +++ src/merge.c | ||
| @@ -396,11 +396,11 @@ | ||
| 396 | 396 | print_checkin_description(mid, 12, |
| 397 | 397 | integrateFlag ? "integrate:" : "merge-from:"); |
| 398 | 398 | print_checkin_description(pid, 12, "baseline:"); |
| 399 | 399 | } |
| 400 | 400 | vfile_check_signature(vid, CKSIG_ENOTFILE); |
| 401 | - db_begin_write(); | |
| 401 | + db_begin_transaction(); | |
| 402 | 402 | if( !dryRunFlag ) undo_begin(); |
| 403 | 403 | if( load_vfile_from_rid(mid) && !forceMissingFlag ){ |
| 404 | 404 | fossil_fatal("missing content, unable to merge"); |
| 405 | 405 | } |
| 406 | 406 | if( load_vfile_from_rid(pid) && !forceMissingFlag ){ |
| 407 | 407 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -396,11 +396,11 @@ | |
| 396 | print_checkin_description(mid, 12, |
| 397 | integrateFlag ? "integrate:" : "merge-from:"); |
| 398 | print_checkin_description(pid, 12, "baseline:"); |
| 399 | } |
| 400 | vfile_check_signature(vid, CKSIG_ENOTFILE); |
| 401 | db_begin_write(); |
| 402 | if( !dryRunFlag ) undo_begin(); |
| 403 | if( load_vfile_from_rid(mid) && !forceMissingFlag ){ |
| 404 | fossil_fatal("missing content, unable to merge"); |
| 405 | } |
| 406 | if( load_vfile_from_rid(pid) && !forceMissingFlag ){ |
| 407 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -396,11 +396,11 @@ | |
| 396 | print_checkin_description(mid, 12, |
| 397 | integrateFlag ? "integrate:" : "merge-from:"); |
| 398 | print_checkin_description(pid, 12, "baseline:"); |
| 399 | } |
| 400 | vfile_check_signature(vid, CKSIG_ENOTFILE); |
| 401 | db_begin_transaction(); |
| 402 | if( !dryRunFlag ) undo_begin(); |
| 403 | if( load_vfile_from_rid(mid) && !forceMissingFlag ){ |
| 404 | fossil_fatal("missing content, unable to merge"); |
| 405 | } |
| 406 | if( load_vfile_from_rid(pid) && !forceMissingFlag ){ |
| 407 |
+2
-2
| --- src/moderate.c | ||
| +++ src/moderate.c | ||
| @@ -107,11 +107,11 @@ | ||
| 107 | 107 | Stmt q; |
| 108 | 108 | char *zTktid; |
| 109 | 109 | int attachRid = 0; |
| 110 | 110 | int rid; |
| 111 | 111 | if( !moderation_pending(objid) ) return; |
| 112 | - db_begin_write(); | |
| 112 | + db_begin_transaction(); | |
| 113 | 113 | rid = objid; |
| 114 | 114 | while( rid && content_is_private(rid) ){ |
| 115 | 115 | db_prepare(&q, "SELECT rid FROM delta WHERE srcid=%d", rid); |
| 116 | 116 | while( db_step(&q)==SQLITE_ROW ){ |
| 117 | 117 | int ridUser = db_column_int(&q, 0); |
| @@ -149,11 +149,11 @@ | ||
| 149 | 149 | /* |
| 150 | 150 | ** Approve an object held for moderation. |
| 151 | 151 | */ |
| 152 | 152 | void moderation_approve(int rid){ |
| 153 | 153 | if( !moderation_pending(rid) ) return; |
| 154 | - db_begin_write(); | |
| 154 | + db_begin_transaction(); | |
| 155 | 155 | db_multi_exec( |
| 156 | 156 | "DELETE FROM private WHERE rid=%d;" |
| 157 | 157 | "INSERT OR IGNORE INTO unclustered VALUES(%d);" |
| 158 | 158 | "INSERT OR IGNORE INTO unsent VALUES(%d);", |
| 159 | 159 | rid, rid, rid |
| 160 | 160 |
| --- src/moderate.c | |
| +++ src/moderate.c | |
| @@ -107,11 +107,11 @@ | |
| 107 | Stmt q; |
| 108 | char *zTktid; |
| 109 | int attachRid = 0; |
| 110 | int rid; |
| 111 | if( !moderation_pending(objid) ) return; |
| 112 | db_begin_write(); |
| 113 | rid = objid; |
| 114 | while( rid && content_is_private(rid) ){ |
| 115 | db_prepare(&q, "SELECT rid FROM delta WHERE srcid=%d", rid); |
| 116 | while( db_step(&q)==SQLITE_ROW ){ |
| 117 | int ridUser = db_column_int(&q, 0); |
| @@ -149,11 +149,11 @@ | |
| 149 | /* |
| 150 | ** Approve an object held for moderation. |
| 151 | */ |
| 152 | void moderation_approve(int rid){ |
| 153 | if( !moderation_pending(rid) ) return; |
| 154 | db_begin_write(); |
| 155 | db_multi_exec( |
| 156 | "DELETE FROM private WHERE rid=%d;" |
| 157 | "INSERT OR IGNORE INTO unclustered VALUES(%d);" |
| 158 | "INSERT OR IGNORE INTO unsent VALUES(%d);", |
| 159 | rid, rid, rid |
| 160 |
| --- src/moderate.c | |
| +++ src/moderate.c | |
| @@ -107,11 +107,11 @@ | |
| 107 | Stmt q; |
| 108 | char *zTktid; |
| 109 | int attachRid = 0; |
| 110 | int rid; |
| 111 | if( !moderation_pending(objid) ) return; |
| 112 | db_begin_transaction(); |
| 113 | rid = objid; |
| 114 | while( rid && content_is_private(rid) ){ |
| 115 | db_prepare(&q, "SELECT rid FROM delta WHERE srcid=%d", rid); |
| 116 | while( db_step(&q)==SQLITE_ROW ){ |
| 117 | int ridUser = db_column_int(&q, 0); |
| @@ -149,11 +149,11 @@ | |
| 149 | /* |
| 150 | ** Approve an object held for moderation. |
| 151 | */ |
| 152 | void moderation_approve(int rid){ |
| 153 | if( !moderation_pending(rid) ) return; |
| 154 | db_begin_transaction(); |
| 155 | db_multi_exec( |
| 156 | "DELETE FROM private WHERE rid=%d;" |
| 157 | "INSERT OR IGNORE INTO unclustered VALUES(%d);" |
| 158 | "INSERT OR IGNORE INTO unsent VALUES(%d);", |
| 159 | rid, rid, rid |
| 160 |
+1
-1
| --- src/publish.c | ||
| +++ src/publish.c | ||
| @@ -77,11 +77,11 @@ | ||
| 77 | 77 | int i; |
| 78 | 78 | |
| 79 | 79 | db_find_and_open_repository(0,0); |
| 80 | 80 | verify_all_options(); |
| 81 | 81 | if( g.argc<3 ) usage("?--only? TAGS..."); |
| 82 | - db_begin_write(); | |
| 82 | + db_begin_transaction(); | |
| 83 | 83 | db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY);"); |
| 84 | 84 | for(i=2; i<g.argc; i++){ |
| 85 | 85 | int rid = name_to_rid(g.argv[i]); |
| 86 | 86 | if( db_exists("SELECT 1 FROM tagxref" |
| 87 | 87 | " WHERE rid=%d AND tagid=%d" |
| 88 | 88 |
| --- src/publish.c | |
| +++ src/publish.c | |
| @@ -77,11 +77,11 @@ | |
| 77 | int i; |
| 78 | |
| 79 | db_find_and_open_repository(0,0); |
| 80 | verify_all_options(); |
| 81 | if( g.argc<3 ) usage("?--only? TAGS..."); |
| 82 | db_begin_write(); |
| 83 | db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY);"); |
| 84 | for(i=2; i<g.argc; i++){ |
| 85 | int rid = name_to_rid(g.argv[i]); |
| 86 | if( db_exists("SELECT 1 FROM tagxref" |
| 87 | " WHERE rid=%d AND tagid=%d" |
| 88 |
| --- src/publish.c | |
| +++ src/publish.c | |
| @@ -77,11 +77,11 @@ | |
| 77 | int i; |
| 78 | |
| 79 | db_find_and_open_repository(0,0); |
| 80 | verify_all_options(); |
| 81 | if( g.argc<3 ) usage("?--only? TAGS..."); |
| 82 | db_begin_transaction(); |
| 83 | db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY);"); |
| 84 | for(i=2; i<g.argc; i++){ |
| 85 | int rid = name_to_rid(g.argv[i]); |
| 86 | if( db_exists("SELECT 1 FROM tagxref" |
| 87 | " WHERE rid=%d AND tagid=%d" |
| 88 |
+7
-7
| --- src/purge.c | ||
| +++ src/purge.c | ||
| @@ -103,11 +103,11 @@ | ||
| 103 | 103 | int peid = 0; /* New purgeevent ID */ |
| 104 | 104 | Stmt q; /* General-use prepared statement */ |
| 105 | 105 | char *z; |
| 106 | 106 | |
| 107 | 107 | assert( g.repositoryOpen ); /* Main database must already be open */ |
| 108 | - db_begin_write(); | |
| 108 | + db_begin_transaction(); | |
| 109 | 109 | z = sqlite3_mprintf("IN \"%w\"", zTab); |
| 110 | 110 | describe_artifacts(z); |
| 111 | 111 | sqlite3_free(z); |
| 112 | 112 | describe_artifacts_to_stdout(0, 0); |
| 113 | 113 | |
| @@ -260,11 +260,11 @@ | ||
| 260 | 260 | ** The "fossil publish" command with the (undocumented) --test and |
| 261 | 261 | ** --exclusive options can be used for interactiving testing of this |
| 262 | 262 | ** function. |
| 263 | 263 | */ |
| 264 | 264 | void find_checkin_associates(const char *zTab, int bExclusive){ |
| 265 | - db_begin_write(); | |
| 265 | + db_begin_transaction(); | |
| 266 | 266 | |
| 267 | 267 | /* Compute the set of files that need to be added to zTab */ |
| 268 | 268 | db_multi_exec("CREATE TEMP TABLE \"%w_files\"(fid INTEGER PRIMARY KEY)",zTab); |
| 269 | 269 | db_multi_exec( |
| 270 | 270 | "INSERT OR IGNORE INTO \"%w_files\"(fid)" |
| @@ -535,11 +535,11 @@ | ||
| 535 | 535 | if( find_option("explain",0,0)!=0 || find_option("dry-run",0,0)!=0 ){ |
| 536 | 536 | purgeFlags |= PURGE_EXPLAIN_ONLY; |
| 537 | 537 | } |
| 538 | 538 | if( strncmp(zSubcmd, "artifacts", n)==0 ){ |
| 539 | 539 | verify_all_options(); |
| 540 | - db_begin_write(); | |
| 540 | + db_begin_transaction(); | |
| 541 | 541 | db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)"); |
| 542 | 542 | for(i=3; i<g.argc; i++){ |
| 543 | 543 | int r = name_to_typed_rid(g.argv[i], ""); |
| 544 | 544 | db_multi_exec("INSERT OR IGNORE INTO ok(rid) VALUES(%d);", r); |
| 545 | 545 | } |
| @@ -562,11 +562,11 @@ | ||
| 562 | 562 | int vid; |
| 563 | 563 | if( find_option("explain",0,0)!=0 || find_option("dry-run",0,0)!=0 ){ |
| 564 | 564 | purgeFlags |= PURGE_EXPLAIN_ONLY; |
| 565 | 565 | } |
| 566 | 566 | verify_all_options(); |
| 567 | - db_begin_write(); | |
| 567 | + db_begin_transaction(); | |
| 568 | 568 | if( g.argc<=3 ) usage("checkins TAGS... [OPTIONS]"); |
| 569 | 569 | db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)"); |
| 570 | 570 | for(i=3; i<g.argc; i++){ |
| 571 | 571 | int r = name_to_typed_rid(g.argv[i], "br"); |
| 572 | 572 | compute_descendants(r, 1000000000); |
| @@ -578,11 +578,11 @@ | ||
| 578 | 578 | find_checkin_associates("ok", 1); |
| 579 | 579 | purge_artifact_list("ok", "", purgeFlags); |
| 580 | 580 | db_end_transaction(0); |
| 581 | 581 | }else if( strncmp(zSubcmd, "files", n)==0 ){ |
| 582 | 582 | verify_all_options(); |
| 583 | - db_begin_write(); | |
| 583 | + db_begin_transaction(); | |
| 584 | 584 | db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)"); |
| 585 | 585 | for(i=3; i<g.argc; i++){ |
| 586 | 586 | db_multi_exec( |
| 587 | 587 | "INSERT OR IGNORE INTO ok(rid) " |
| 588 | 588 | " SELECT fid FROM mlink, filename" |
| @@ -618,11 +618,11 @@ | ||
| 618 | 618 | cReply = blob_str(&ans)[0]; |
| 619 | 619 | if( cReply!='y' && cReply!='Y' ){ |
| 620 | 620 | fossil_exit(1); |
| 621 | 621 | } |
| 622 | 622 | } |
| 623 | - db_begin_write(); | |
| 623 | + db_begin_transaction(); | |
| 624 | 624 | for(i=3; i<g.argc; i++){ |
| 625 | 625 | int peid = atoi(g.argv[i]); |
| 626 | 626 | if( !db_exists("SELECT 1 FROM purgeevent WHERE peid=%d",peid) ){ |
| 627 | 627 | fossil_fatal("no such purge event: %s", g.argv[i]); |
| 628 | 628 | } |
| @@ -638,11 +638,11 @@ | ||
| 638 | 638 | }else if( strncmp(zSubcmd, "undo", n)==0 ){ |
| 639 | 639 | int peid; |
| 640 | 640 | if( g.argc!=4 ) usage("undo ID"); |
| 641 | 641 | peid = atoi(g.argv[3]); |
| 642 | 642 | if( (purgeFlags & PURGE_EXPLAIN_ONLY)==0 ){ |
| 643 | - db_begin_write(); | |
| 643 | + db_begin_transaction(); | |
| 644 | 644 | db_multi_exec( |
| 645 | 645 | "CREATE TEMP TABLE ix(" |
| 646 | 646 | " piid INTEGER PRIMARY KEY," |
| 647 | 647 | " srcid INTEGER" |
| 648 | 648 | ");" |
| 649 | 649 |
| --- src/purge.c | |
| +++ src/purge.c | |
| @@ -103,11 +103,11 @@ | |
| 103 | int peid = 0; /* New purgeevent ID */ |
| 104 | Stmt q; /* General-use prepared statement */ |
| 105 | char *z; |
| 106 | |
| 107 | assert( g.repositoryOpen ); /* Main database must already be open */ |
| 108 | db_begin_write(); |
| 109 | z = sqlite3_mprintf("IN \"%w\"", zTab); |
| 110 | describe_artifacts(z); |
| 111 | sqlite3_free(z); |
| 112 | describe_artifacts_to_stdout(0, 0); |
| 113 | |
| @@ -260,11 +260,11 @@ | |
| 260 | ** The "fossil publish" command with the (undocumented) --test and |
| 261 | ** --exclusive options can be used for interactiving testing of this |
| 262 | ** function. |
| 263 | */ |
| 264 | void find_checkin_associates(const char *zTab, int bExclusive){ |
| 265 | db_begin_write(); |
| 266 | |
| 267 | /* Compute the set of files that need to be added to zTab */ |
| 268 | db_multi_exec("CREATE TEMP TABLE \"%w_files\"(fid INTEGER PRIMARY KEY)",zTab); |
| 269 | db_multi_exec( |
| 270 | "INSERT OR IGNORE INTO \"%w_files\"(fid)" |
| @@ -535,11 +535,11 @@ | |
| 535 | if( find_option("explain",0,0)!=0 || find_option("dry-run",0,0)!=0 ){ |
| 536 | purgeFlags |= PURGE_EXPLAIN_ONLY; |
| 537 | } |
| 538 | if( strncmp(zSubcmd, "artifacts", n)==0 ){ |
| 539 | verify_all_options(); |
| 540 | db_begin_write(); |
| 541 | db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)"); |
| 542 | for(i=3; i<g.argc; i++){ |
| 543 | int r = name_to_typed_rid(g.argv[i], ""); |
| 544 | db_multi_exec("INSERT OR IGNORE INTO ok(rid) VALUES(%d);", r); |
| 545 | } |
| @@ -562,11 +562,11 @@ | |
| 562 | int vid; |
| 563 | if( find_option("explain",0,0)!=0 || find_option("dry-run",0,0)!=0 ){ |
| 564 | purgeFlags |= PURGE_EXPLAIN_ONLY; |
| 565 | } |
| 566 | verify_all_options(); |
| 567 | db_begin_write(); |
| 568 | if( g.argc<=3 ) usage("checkins TAGS... [OPTIONS]"); |
| 569 | db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)"); |
| 570 | for(i=3; i<g.argc; i++){ |
| 571 | int r = name_to_typed_rid(g.argv[i], "br"); |
| 572 | compute_descendants(r, 1000000000); |
| @@ -578,11 +578,11 @@ | |
| 578 | find_checkin_associates("ok", 1); |
| 579 | purge_artifact_list("ok", "", purgeFlags); |
| 580 | db_end_transaction(0); |
| 581 | }else if( strncmp(zSubcmd, "files", n)==0 ){ |
| 582 | verify_all_options(); |
| 583 | db_begin_write(); |
| 584 | db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)"); |
| 585 | for(i=3; i<g.argc; i++){ |
| 586 | db_multi_exec( |
| 587 | "INSERT OR IGNORE INTO ok(rid) " |
| 588 | " SELECT fid FROM mlink, filename" |
| @@ -618,11 +618,11 @@ | |
| 618 | cReply = blob_str(&ans)[0]; |
| 619 | if( cReply!='y' && cReply!='Y' ){ |
| 620 | fossil_exit(1); |
| 621 | } |
| 622 | } |
| 623 | db_begin_write(); |
| 624 | for(i=3; i<g.argc; i++){ |
| 625 | int peid = atoi(g.argv[i]); |
| 626 | if( !db_exists("SELECT 1 FROM purgeevent WHERE peid=%d",peid) ){ |
| 627 | fossil_fatal("no such purge event: %s", g.argv[i]); |
| 628 | } |
| @@ -638,11 +638,11 @@ | |
| 638 | }else if( strncmp(zSubcmd, "undo", n)==0 ){ |
| 639 | int peid; |
| 640 | if( g.argc!=4 ) usage("undo ID"); |
| 641 | peid = atoi(g.argv[3]); |
| 642 | if( (purgeFlags & PURGE_EXPLAIN_ONLY)==0 ){ |
| 643 | db_begin_write(); |
| 644 | db_multi_exec( |
| 645 | "CREATE TEMP TABLE ix(" |
| 646 | " piid INTEGER PRIMARY KEY," |
| 647 | " srcid INTEGER" |
| 648 | ");" |
| 649 |
| --- src/purge.c | |
| +++ src/purge.c | |
| @@ -103,11 +103,11 @@ | |
| 103 | int peid = 0; /* New purgeevent ID */ |
| 104 | Stmt q; /* General-use prepared statement */ |
| 105 | char *z; |
| 106 | |
| 107 | assert( g.repositoryOpen ); /* Main database must already be open */ |
| 108 | db_begin_transaction(); |
| 109 | z = sqlite3_mprintf("IN \"%w\"", zTab); |
| 110 | describe_artifacts(z); |
| 111 | sqlite3_free(z); |
| 112 | describe_artifacts_to_stdout(0, 0); |
| 113 | |
| @@ -260,11 +260,11 @@ | |
| 260 | ** The "fossil publish" command with the (undocumented) --test and |
| 261 | ** --exclusive options can be used for interactiving testing of this |
| 262 | ** function. |
| 263 | */ |
| 264 | void find_checkin_associates(const char *zTab, int bExclusive){ |
| 265 | db_begin_transaction(); |
| 266 | |
| 267 | /* Compute the set of files that need to be added to zTab */ |
| 268 | db_multi_exec("CREATE TEMP TABLE \"%w_files\"(fid INTEGER PRIMARY KEY)",zTab); |
| 269 | db_multi_exec( |
| 270 | "INSERT OR IGNORE INTO \"%w_files\"(fid)" |
| @@ -535,11 +535,11 @@ | |
| 535 | if( find_option("explain",0,0)!=0 || find_option("dry-run",0,0)!=0 ){ |
| 536 | purgeFlags |= PURGE_EXPLAIN_ONLY; |
| 537 | } |
| 538 | if( strncmp(zSubcmd, "artifacts", n)==0 ){ |
| 539 | verify_all_options(); |
| 540 | db_begin_transaction(); |
| 541 | db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)"); |
| 542 | for(i=3; i<g.argc; i++){ |
| 543 | int r = name_to_typed_rid(g.argv[i], ""); |
| 544 | db_multi_exec("INSERT OR IGNORE INTO ok(rid) VALUES(%d);", r); |
| 545 | } |
| @@ -562,11 +562,11 @@ | |
| 562 | int vid; |
| 563 | if( find_option("explain",0,0)!=0 || find_option("dry-run",0,0)!=0 ){ |
| 564 | purgeFlags |= PURGE_EXPLAIN_ONLY; |
| 565 | } |
| 566 | verify_all_options(); |
| 567 | db_begin_transaction(); |
| 568 | if( g.argc<=3 ) usage("checkins TAGS... [OPTIONS]"); |
| 569 | db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)"); |
| 570 | for(i=3; i<g.argc; i++){ |
| 571 | int r = name_to_typed_rid(g.argv[i], "br"); |
| 572 | compute_descendants(r, 1000000000); |
| @@ -578,11 +578,11 @@ | |
| 578 | find_checkin_associates("ok", 1); |
| 579 | purge_artifact_list("ok", "", purgeFlags); |
| 580 | db_end_transaction(0); |
| 581 | }else if( strncmp(zSubcmd, "files", n)==0 ){ |
| 582 | verify_all_options(); |
| 583 | db_begin_transaction(); |
| 584 | db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)"); |
| 585 | for(i=3; i<g.argc; i++){ |
| 586 | db_multi_exec( |
| 587 | "INSERT OR IGNORE INTO ok(rid) " |
| 588 | " SELECT fid FROM mlink, filename" |
| @@ -618,11 +618,11 @@ | |
| 618 | cReply = blob_str(&ans)[0]; |
| 619 | if( cReply!='y' && cReply!='Y' ){ |
| 620 | fossil_exit(1); |
| 621 | } |
| 622 | } |
| 623 | db_begin_transaction(); |
| 624 | for(i=3; i<g.argc; i++){ |
| 625 | int peid = atoi(g.argv[i]); |
| 626 | if( !db_exists("SELECT 1 FROM purgeevent WHERE peid=%d",peid) ){ |
| 627 | fossil_fatal("no such purge event: %s", g.argv[i]); |
| 628 | } |
| @@ -638,11 +638,11 @@ | |
| 638 | }else if( strncmp(zSubcmd, "undo", n)==0 ){ |
| 639 | int peid; |
| 640 | if( g.argc!=4 ) usage("undo ID"); |
| 641 | peid = atoi(g.argv[3]); |
| 642 | if( (purgeFlags & PURGE_EXPLAIN_ONLY)==0 ){ |
| 643 | db_begin_transaction(); |
| 644 | db_multi_exec( |
| 645 | "CREATE TEMP TABLE ix(" |
| 646 | " piid INTEGER PRIMARY KEY," |
| 647 | " srcid INTEGER" |
| 648 | ");" |
| 649 |
+7
-7
| --- src/rebuild.c | ||
| +++ src/rebuild.c | ||
| @@ -41,11 +41,11 @@ | ||
| 41 | 41 | ** 2015-01-24 schema change. Create them if necessary. This code |
| 42 | 42 | ** can be removed in the future, once all users have upgraded to the |
| 43 | 43 | ** 2015-01-24 or later schema. |
| 44 | 44 | */ |
| 45 | 45 | if( !db_table_has_column("repository","mlink","isaux") ){ |
| 46 | - db_begin_write(); | |
| 46 | + db_begin_transaction(); | |
| 47 | 47 | db_multi_exec( |
| 48 | 48 | "ALTER TABLE repository.mlink ADD COLUMN pmid INTEGER DEFAULT 0;" |
| 49 | 49 | "ALTER TABLE repository.mlink ADD COLUMN isaux BOOLEAN DEFAULT 0;" |
| 50 | 50 | ); |
| 51 | 51 | db_end_transaction(0); |
| @@ -486,11 +486,11 @@ | ||
| 486 | 486 | Stmt q; |
| 487 | 487 | int aPrev[N_NEIGHBOR]; |
| 488 | 488 | int nPrev; |
| 489 | 489 | int rid; |
| 490 | 490 | int prevfnid, fnid; |
| 491 | - db_begin_write(); | |
| 491 | + db_begin_transaction(); | |
| 492 | 492 | |
| 493 | 493 | /* Look for manifests that have not been deltaed and try to make them |
| 494 | 494 | ** children of one of the 5 chronologically subsequent check-ins |
| 495 | 495 | */ |
| 496 | 496 | db_prepare(&q, |
| @@ -661,11 +661,11 @@ | ||
| 661 | 661 | } |
| 662 | 662 | |
| 663 | 663 | /* We should be done with options.. */ |
| 664 | 664 | verify_all_options(); |
| 665 | 665 | |
| 666 | - db_begin_write(); | |
| 666 | + db_begin_transaction(); | |
| 667 | 667 | if( !compressOnlyFlag ){ |
| 668 | 668 | search_drop_index(); |
| 669 | 669 | ttyOutput = 1; |
| 670 | 670 | errCnt = rebuild_db(randomizeFlag, 1, doClustering); |
| 671 | 671 | reconstruct_private_table(); |
| @@ -749,11 +749,11 @@ | ||
| 749 | 749 | ** repositories. Used to create a "test" repository for development |
| 750 | 750 | ** testing by cloning a working project repository. |
| 751 | 751 | */ |
| 752 | 752 | void test_detach_cmd(void){ |
| 753 | 753 | db_find_and_open_repository(0, 2); |
| 754 | - db_begin_write(); | |
| 754 | + db_begin_transaction(); | |
| 755 | 755 | db_multi_exec( |
| 756 | 756 | "DELETE FROM config WHERE name='last-sync-url';" |
| 757 | 757 | "UPDATE config SET value=lower(hex(randomblob(20)))" |
| 758 | 758 | " WHERE name='project-code';" |
| 759 | 759 | "UPDATE config SET value='detached-' || value" |
| @@ -777,11 +777,11 @@ | ||
| 777 | 777 | usage("?REPOSITORY-FILENAME?"); |
| 778 | 778 | } |
| 779 | 779 | db_close(1); |
| 780 | 780 | db_open_repository(g.zRepositoryName); |
| 781 | 781 | } |
| 782 | - db_begin_write(); | |
| 782 | + db_begin_transaction(); | |
| 783 | 783 | create_cluster(); |
| 784 | 784 | db_end_transaction(0); |
| 785 | 785 | } |
| 786 | 786 | |
| 787 | 787 | /* |
| @@ -898,11 +898,11 @@ | ||
| 898 | 898 | cReply = blob_str(&ans)[0]; |
| 899 | 899 | if( cReply!='y' && cReply!='Y' ){ |
| 900 | 900 | fossil_exit(1); |
| 901 | 901 | } |
| 902 | 902 | } |
| 903 | - db_begin_write(); | |
| 903 | + db_begin_transaction(); | |
| 904 | 904 | if( privateOnly || bVerily ){ |
| 905 | 905 | bNeedRebuild = db_exists("SELECT 1 FROM private"); |
| 906 | 906 | delete_private_content(); |
| 907 | 907 | } |
| 908 | 908 | if( !privateOnly ){ |
| @@ -1167,11 +1167,11 @@ | ||
| 1167 | 1167 | |
| 1168 | 1168 | /* We should be done with options.. */ |
| 1169 | 1169 | verify_all_options(); |
| 1170 | 1170 | |
| 1171 | 1171 | db_open_config(0, 0); |
| 1172 | - db_begin_write(); | |
| 1172 | + db_begin_transaction(); | |
| 1173 | 1173 | db_initial_setup(0, 0, 0); |
| 1174 | 1174 | |
| 1175 | 1175 | fossil_print("Reading files from directory \"%s\"...\n", g.argv[3]); |
| 1176 | 1176 | recon_read_dir(g.argv[3]); |
| 1177 | 1177 | fossil_print("\nBuilding the Fossil repository...\n"); |
| 1178 | 1178 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -41,11 +41,11 @@ | |
| 41 | ** 2015-01-24 schema change. Create them if necessary. This code |
| 42 | ** can be removed in the future, once all users have upgraded to the |
| 43 | ** 2015-01-24 or later schema. |
| 44 | */ |
| 45 | if( !db_table_has_column("repository","mlink","isaux") ){ |
| 46 | db_begin_write(); |
| 47 | db_multi_exec( |
| 48 | "ALTER TABLE repository.mlink ADD COLUMN pmid INTEGER DEFAULT 0;" |
| 49 | "ALTER TABLE repository.mlink ADD COLUMN isaux BOOLEAN DEFAULT 0;" |
| 50 | ); |
| 51 | db_end_transaction(0); |
| @@ -486,11 +486,11 @@ | |
| 486 | Stmt q; |
| 487 | int aPrev[N_NEIGHBOR]; |
| 488 | int nPrev; |
| 489 | int rid; |
| 490 | int prevfnid, fnid; |
| 491 | db_begin_write(); |
| 492 | |
| 493 | /* Look for manifests that have not been deltaed and try to make them |
| 494 | ** children of one of the 5 chronologically subsequent check-ins |
| 495 | */ |
| 496 | db_prepare(&q, |
| @@ -661,11 +661,11 @@ | |
| 661 | } |
| 662 | |
| 663 | /* We should be done with options.. */ |
| 664 | verify_all_options(); |
| 665 | |
| 666 | db_begin_write(); |
| 667 | if( !compressOnlyFlag ){ |
| 668 | search_drop_index(); |
| 669 | ttyOutput = 1; |
| 670 | errCnt = rebuild_db(randomizeFlag, 1, doClustering); |
| 671 | reconstruct_private_table(); |
| @@ -749,11 +749,11 @@ | |
| 749 | ** repositories. Used to create a "test" repository for development |
| 750 | ** testing by cloning a working project repository. |
| 751 | */ |
| 752 | void test_detach_cmd(void){ |
| 753 | db_find_and_open_repository(0, 2); |
| 754 | db_begin_write(); |
| 755 | db_multi_exec( |
| 756 | "DELETE FROM config WHERE name='last-sync-url';" |
| 757 | "UPDATE config SET value=lower(hex(randomblob(20)))" |
| 758 | " WHERE name='project-code';" |
| 759 | "UPDATE config SET value='detached-' || value" |
| @@ -777,11 +777,11 @@ | |
| 777 | usage("?REPOSITORY-FILENAME?"); |
| 778 | } |
| 779 | db_close(1); |
| 780 | db_open_repository(g.zRepositoryName); |
| 781 | } |
| 782 | db_begin_write(); |
| 783 | create_cluster(); |
| 784 | db_end_transaction(0); |
| 785 | } |
| 786 | |
| 787 | /* |
| @@ -898,11 +898,11 @@ | |
| 898 | cReply = blob_str(&ans)[0]; |
| 899 | if( cReply!='y' && cReply!='Y' ){ |
| 900 | fossil_exit(1); |
| 901 | } |
| 902 | } |
| 903 | db_begin_write(); |
| 904 | if( privateOnly || bVerily ){ |
| 905 | bNeedRebuild = db_exists("SELECT 1 FROM private"); |
| 906 | delete_private_content(); |
| 907 | } |
| 908 | if( !privateOnly ){ |
| @@ -1167,11 +1167,11 @@ | |
| 1167 | |
| 1168 | /* We should be done with options.. */ |
| 1169 | verify_all_options(); |
| 1170 | |
| 1171 | db_open_config(0, 0); |
| 1172 | db_begin_write(); |
| 1173 | db_initial_setup(0, 0, 0); |
| 1174 | |
| 1175 | fossil_print("Reading files from directory \"%s\"...\n", g.argv[3]); |
| 1176 | recon_read_dir(g.argv[3]); |
| 1177 | fossil_print("\nBuilding the Fossil repository...\n"); |
| 1178 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -41,11 +41,11 @@ | |
| 41 | ** 2015-01-24 schema change. Create them if necessary. This code |
| 42 | ** can be removed in the future, once all users have upgraded to the |
| 43 | ** 2015-01-24 or later schema. |
| 44 | */ |
| 45 | if( !db_table_has_column("repository","mlink","isaux") ){ |
| 46 | db_begin_transaction(); |
| 47 | db_multi_exec( |
| 48 | "ALTER TABLE repository.mlink ADD COLUMN pmid INTEGER DEFAULT 0;" |
| 49 | "ALTER TABLE repository.mlink ADD COLUMN isaux BOOLEAN DEFAULT 0;" |
| 50 | ); |
| 51 | db_end_transaction(0); |
| @@ -486,11 +486,11 @@ | |
| 486 | Stmt q; |
| 487 | int aPrev[N_NEIGHBOR]; |
| 488 | int nPrev; |
| 489 | int rid; |
| 490 | int prevfnid, fnid; |
| 491 | db_begin_transaction(); |
| 492 | |
| 493 | /* Look for manifests that have not been deltaed and try to make them |
| 494 | ** children of one of the 5 chronologically subsequent check-ins |
| 495 | */ |
| 496 | db_prepare(&q, |
| @@ -661,11 +661,11 @@ | |
| 661 | } |
| 662 | |
| 663 | /* We should be done with options.. */ |
| 664 | verify_all_options(); |
| 665 | |
| 666 | db_begin_transaction(); |
| 667 | if( !compressOnlyFlag ){ |
| 668 | search_drop_index(); |
| 669 | ttyOutput = 1; |
| 670 | errCnt = rebuild_db(randomizeFlag, 1, doClustering); |
| 671 | reconstruct_private_table(); |
| @@ -749,11 +749,11 @@ | |
| 749 | ** repositories. Used to create a "test" repository for development |
| 750 | ** testing by cloning a working project repository. |
| 751 | */ |
| 752 | void test_detach_cmd(void){ |
| 753 | db_find_and_open_repository(0, 2); |
| 754 | db_begin_transaction(); |
| 755 | db_multi_exec( |
| 756 | "DELETE FROM config WHERE name='last-sync-url';" |
| 757 | "UPDATE config SET value=lower(hex(randomblob(20)))" |
| 758 | " WHERE name='project-code';" |
| 759 | "UPDATE config SET value='detached-' || value" |
| @@ -777,11 +777,11 @@ | |
| 777 | usage("?REPOSITORY-FILENAME?"); |
| 778 | } |
| 779 | db_close(1); |
| 780 | db_open_repository(g.zRepositoryName); |
| 781 | } |
| 782 | db_begin_transaction(); |
| 783 | create_cluster(); |
| 784 | db_end_transaction(0); |
| 785 | } |
| 786 | |
| 787 | /* |
| @@ -898,11 +898,11 @@ | |
| 898 | cReply = blob_str(&ans)[0]; |
| 899 | if( cReply!='y' && cReply!='Y' ){ |
| 900 | fossil_exit(1); |
| 901 | } |
| 902 | } |
| 903 | db_begin_transaction(); |
| 904 | if( privateOnly || bVerily ){ |
| 905 | bNeedRebuild = db_exists("SELECT 1 FROM private"); |
| 906 | delete_private_content(); |
| 907 | } |
| 908 | if( !privateOnly ){ |
| @@ -1167,11 +1167,11 @@ | |
| 1167 | |
| 1168 | /* We should be done with options.. */ |
| 1169 | verify_all_options(); |
| 1170 | |
| 1171 | db_open_config(0, 0); |
| 1172 | db_begin_transaction(); |
| 1173 | db_initial_setup(0, 0, 0); |
| 1174 | |
| 1175 | fossil_print("Reading files from directory \"%s\"...\n", g.argv[3]); |
| 1176 | recon_read_dir(g.argv[3]); |
| 1177 | fossil_print("\nBuilding the Fossil repository...\n"); |
| 1178 |
+1
-1
| --- src/search.c | ||
| +++ src/search.c | ||
| @@ -1881,11 +1881,11 @@ | ||
| 1881 | 1881 | } |
| 1882 | 1882 | if( iCmd==2 ){ |
| 1883 | 1883 | if( g.argc<3 ) usage("index (on|off)"); |
| 1884 | 1884 | iAction = 1 + is_truth(g.argv[3]); |
| 1885 | 1885 | } |
| 1886 | - db_begin_write(); | |
| 1886 | + db_begin_transaction(); | |
| 1887 | 1887 | |
| 1888 | 1888 | /* Adjust search settings */ |
| 1889 | 1889 | if( iCmd==3 || iCmd==4 ){ |
| 1890 | 1890 | const char *zCtrl; |
| 1891 | 1891 | if( g.argc<4 ) usage(mprintf("%s STRING",zSubCmd)); |
| 1892 | 1892 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -1881,11 +1881,11 @@ | |
| 1881 | } |
| 1882 | if( iCmd==2 ){ |
| 1883 | if( g.argc<3 ) usage("index (on|off)"); |
| 1884 | iAction = 1 + is_truth(g.argv[3]); |
| 1885 | } |
| 1886 | db_begin_write(); |
| 1887 | |
| 1888 | /* Adjust search settings */ |
| 1889 | if( iCmd==3 || iCmd==4 ){ |
| 1890 | const char *zCtrl; |
| 1891 | if( g.argc<4 ) usage(mprintf("%s STRING",zSubCmd)); |
| 1892 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -1881,11 +1881,11 @@ | |
| 1881 | } |
| 1882 | if( iCmd==2 ){ |
| 1883 | if( g.argc<3 ) usage("index (on|off)"); |
| 1884 | iAction = 1 + is_truth(g.argv[3]); |
| 1885 | } |
| 1886 | db_begin_transaction(); |
| 1887 | |
| 1888 | /* Adjust search settings */ |
| 1889 | if( iCmd==3 || iCmd==4 ){ |
| 1890 | const char *zCtrl; |
| 1891 | if( g.argc<4 ) usage(mprintf("%s STRING",zSubCmd)); |
| 1892 |
+8
-8
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -324,11 +324,11 @@ | ||
| 324 | 324 | login_needed(0); |
| 325 | 325 | return; |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | style_header("Access Control Settings"); |
| 329 | - db_begin_write(); | |
| 329 | + db_begin_transaction(); | |
| 330 | 330 | @ <form action="%s(g.zTop)/setup_access" method="post"><div> |
| 331 | 331 | login_insert_csrf_secret(); |
| 332 | 332 | @ <input type="submit" name="submit" value="Apply Changes" /></p> |
| 333 | 333 | @ <hr /> |
| 334 | 334 | multiple_choice_attribute("Redirect to HTTPS", |
| @@ -679,11 +679,11 @@ | ||
| 679 | 679 | login_needed(0); |
| 680 | 680 | return; |
| 681 | 681 | } |
| 682 | 682 | |
| 683 | 683 | style_header("Timeline Display Preferences"); |
| 684 | - db_begin_write(); | |
| 684 | + db_begin_transaction(); | |
| 685 | 685 | @ <form action="%s(g.zTop)/setup_timeline" method="post"><div> |
| 686 | 686 | login_insert_csrf_secret(); |
| 687 | 687 | @ <p><input type="submit" name="submit" value="Apply Changes" /></p> |
| 688 | 688 | |
| 689 | 689 | @ <hr /> |
| @@ -812,11 +812,11 @@ | ||
| 812 | 812 | if(!g.repositoryOpen){ |
| 813 | 813 | /* Provide read-only access to versioned settings, |
| 814 | 814 | but only if no repo file was explicitly provided. */ |
| 815 | 815 | db_open_local(0); |
| 816 | 816 | } |
| 817 | - db_begin_write(); | |
| 817 | + db_begin_transaction(); | |
| 818 | 818 | @ <p>Settings marked with (v) are "versionable" and will be overridden |
| 819 | 819 | @ by the contents of managed files named |
| 820 | 820 | @ "<tt>.fossil-settings/</tt><i>SETTING-NAME</i>". |
| 821 | 821 | @ If the file for a versionable setting exists, the value cannot be |
| 822 | 822 | @ changed on this screen.</p><hr /><p> |
| @@ -889,11 +889,11 @@ | ||
| 889 | 889 | login_needed(0); |
| 890 | 890 | return; |
| 891 | 891 | } |
| 892 | 892 | |
| 893 | 893 | style_header("WWW Configuration"); |
| 894 | - db_begin_write(); | |
| 894 | + db_begin_transaction(); | |
| 895 | 895 | @ <form action="%s(g.zTop)/setup_config" method="post"><div> |
| 896 | 896 | login_insert_csrf_secret(); |
| 897 | 897 | @ <input type="submit" name="submit" value="Apply Changes" /></p> |
| 898 | 898 | @ <hr /> |
| 899 | 899 | entry_attribute("Project Name", 60, "project-name", "pn", "", 0); |
| @@ -985,11 +985,11 @@ | ||
| 985 | 985 | login_needed(0); |
| 986 | 986 | return; |
| 987 | 987 | } |
| 988 | 988 | |
| 989 | 989 | style_header("Wiki Configuration"); |
| 990 | - db_begin_write(); | |
| 990 | + db_begin_transaction(); | |
| 991 | 991 | @ <form action="%s(g.zTop)/setup_wiki" method="post"><div> |
| 992 | 992 | login_insert_csrf_secret(); |
| 993 | 993 | @ <input type="submit" name="submit" value="Apply Changes" /></p> |
| 994 | 994 | @ <hr /> |
| 995 | 995 | onoff_attribute("Associate Wiki Pages With Branches, Tags, or Checkins", |
| @@ -1045,11 +1045,11 @@ | ||
| 1045 | 1045 | login_needed(0); |
| 1046 | 1046 | return; |
| 1047 | 1047 | } |
| 1048 | 1048 | |
| 1049 | 1049 | style_header("Moderator For Wiki And Tickets"); |
| 1050 | - db_begin_write(); | |
| 1050 | + db_begin_transaction(); | |
| 1051 | 1051 | @ <form action="%R/setup_modreq" method="post"><div> |
| 1052 | 1052 | login_insert_csrf_secret(); |
| 1053 | 1053 | @ <hr /> |
| 1054 | 1054 | onoff_attribute("Moderate ticket changes", |
| 1055 | 1055 | "modreq-tkt", "modreq-tkt", 0, 0); |
| @@ -1091,11 +1091,11 @@ | ||
| 1091 | 1091 | login_check_credentials(); |
| 1092 | 1092 | if( !g.perm.Admin ){ |
| 1093 | 1093 | login_needed(0); |
| 1094 | 1094 | return; |
| 1095 | 1095 | } |
| 1096 | - db_begin_write(); | |
| 1096 | + db_begin_transaction(); | |
| 1097 | 1097 | if( P("clear")!=0 && cgi_csrf_safe(1) ){ |
| 1098 | 1098 | db_multi_exec("DELETE FROM config WHERE name GLOB 'adunit*'"); |
| 1099 | 1099 | cgi_replace_parameter("adunit",""); |
| 1100 | 1100 | } |
| 1101 | 1101 | |
| @@ -1181,11 +1181,11 @@ | ||
| 1181 | 1181 | login_check_credentials(); |
| 1182 | 1182 | if( !g.perm.Admin ){ |
| 1183 | 1183 | login_needed(0); |
| 1184 | 1184 | return; |
| 1185 | 1185 | } |
| 1186 | - db_begin_write(); | |
| 1186 | + db_begin_transaction(); | |
| 1187 | 1187 | if( !cgi_csrf_safe(1) ){ |
| 1188 | 1188 | /* Allow no state changes if not safe from CSRF */ |
| 1189 | 1189 | }else if( P("setlogo")!=0 && zLogoMime && zLogoMime[0] && szLogoImg>0 ){ |
| 1190 | 1190 | Blob img; |
| 1191 | 1191 | Stmt ins; |
| 1192 | 1192 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -324,11 +324,11 @@ | |
| 324 | login_needed(0); |
| 325 | return; |
| 326 | } |
| 327 | |
| 328 | style_header("Access Control Settings"); |
| 329 | db_begin_write(); |
| 330 | @ <form action="%s(g.zTop)/setup_access" method="post"><div> |
| 331 | login_insert_csrf_secret(); |
| 332 | @ <input type="submit" name="submit" value="Apply Changes" /></p> |
| 333 | @ <hr /> |
| 334 | multiple_choice_attribute("Redirect to HTTPS", |
| @@ -679,11 +679,11 @@ | |
| 679 | login_needed(0); |
| 680 | return; |
| 681 | } |
| 682 | |
| 683 | style_header("Timeline Display Preferences"); |
| 684 | db_begin_write(); |
| 685 | @ <form action="%s(g.zTop)/setup_timeline" method="post"><div> |
| 686 | login_insert_csrf_secret(); |
| 687 | @ <p><input type="submit" name="submit" value="Apply Changes" /></p> |
| 688 | |
| 689 | @ <hr /> |
| @@ -812,11 +812,11 @@ | |
| 812 | if(!g.repositoryOpen){ |
| 813 | /* Provide read-only access to versioned settings, |
| 814 | but only if no repo file was explicitly provided. */ |
| 815 | db_open_local(0); |
| 816 | } |
| 817 | db_begin_write(); |
| 818 | @ <p>Settings marked with (v) are "versionable" and will be overridden |
| 819 | @ by the contents of managed files named |
| 820 | @ "<tt>.fossil-settings/</tt><i>SETTING-NAME</i>". |
| 821 | @ If the file for a versionable setting exists, the value cannot be |
| 822 | @ changed on this screen.</p><hr /><p> |
| @@ -889,11 +889,11 @@ | |
| 889 | login_needed(0); |
| 890 | return; |
| 891 | } |
| 892 | |
| 893 | style_header("WWW Configuration"); |
| 894 | db_begin_write(); |
| 895 | @ <form action="%s(g.zTop)/setup_config" method="post"><div> |
| 896 | login_insert_csrf_secret(); |
| 897 | @ <input type="submit" name="submit" value="Apply Changes" /></p> |
| 898 | @ <hr /> |
| 899 | entry_attribute("Project Name", 60, "project-name", "pn", "", 0); |
| @@ -985,11 +985,11 @@ | |
| 985 | login_needed(0); |
| 986 | return; |
| 987 | } |
| 988 | |
| 989 | style_header("Wiki Configuration"); |
| 990 | db_begin_write(); |
| 991 | @ <form action="%s(g.zTop)/setup_wiki" method="post"><div> |
| 992 | login_insert_csrf_secret(); |
| 993 | @ <input type="submit" name="submit" value="Apply Changes" /></p> |
| 994 | @ <hr /> |
| 995 | onoff_attribute("Associate Wiki Pages With Branches, Tags, or Checkins", |
| @@ -1045,11 +1045,11 @@ | |
| 1045 | login_needed(0); |
| 1046 | return; |
| 1047 | } |
| 1048 | |
| 1049 | style_header("Moderator For Wiki And Tickets"); |
| 1050 | db_begin_write(); |
| 1051 | @ <form action="%R/setup_modreq" method="post"><div> |
| 1052 | login_insert_csrf_secret(); |
| 1053 | @ <hr /> |
| 1054 | onoff_attribute("Moderate ticket changes", |
| 1055 | "modreq-tkt", "modreq-tkt", 0, 0); |
| @@ -1091,11 +1091,11 @@ | |
| 1091 | login_check_credentials(); |
| 1092 | if( !g.perm.Admin ){ |
| 1093 | login_needed(0); |
| 1094 | return; |
| 1095 | } |
| 1096 | db_begin_write(); |
| 1097 | if( P("clear")!=0 && cgi_csrf_safe(1) ){ |
| 1098 | db_multi_exec("DELETE FROM config WHERE name GLOB 'adunit*'"); |
| 1099 | cgi_replace_parameter("adunit",""); |
| 1100 | } |
| 1101 | |
| @@ -1181,11 +1181,11 @@ | |
| 1181 | login_check_credentials(); |
| 1182 | if( !g.perm.Admin ){ |
| 1183 | login_needed(0); |
| 1184 | return; |
| 1185 | } |
| 1186 | db_begin_write(); |
| 1187 | if( !cgi_csrf_safe(1) ){ |
| 1188 | /* Allow no state changes if not safe from CSRF */ |
| 1189 | }else if( P("setlogo")!=0 && zLogoMime && zLogoMime[0] && szLogoImg>0 ){ |
| 1190 | Blob img; |
| 1191 | Stmt ins; |
| 1192 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -324,11 +324,11 @@ | |
| 324 | login_needed(0); |
| 325 | return; |
| 326 | } |
| 327 | |
| 328 | style_header("Access Control Settings"); |
| 329 | db_begin_transaction(); |
| 330 | @ <form action="%s(g.zTop)/setup_access" method="post"><div> |
| 331 | login_insert_csrf_secret(); |
| 332 | @ <input type="submit" name="submit" value="Apply Changes" /></p> |
| 333 | @ <hr /> |
| 334 | multiple_choice_attribute("Redirect to HTTPS", |
| @@ -679,11 +679,11 @@ | |
| 679 | login_needed(0); |
| 680 | return; |
| 681 | } |
| 682 | |
| 683 | style_header("Timeline Display Preferences"); |
| 684 | db_begin_transaction(); |
| 685 | @ <form action="%s(g.zTop)/setup_timeline" method="post"><div> |
| 686 | login_insert_csrf_secret(); |
| 687 | @ <p><input type="submit" name="submit" value="Apply Changes" /></p> |
| 688 | |
| 689 | @ <hr /> |
| @@ -812,11 +812,11 @@ | |
| 812 | if(!g.repositoryOpen){ |
| 813 | /* Provide read-only access to versioned settings, |
| 814 | but only if no repo file was explicitly provided. */ |
| 815 | db_open_local(0); |
| 816 | } |
| 817 | db_begin_transaction(); |
| 818 | @ <p>Settings marked with (v) are "versionable" and will be overridden |
| 819 | @ by the contents of managed files named |
| 820 | @ "<tt>.fossil-settings/</tt><i>SETTING-NAME</i>". |
| 821 | @ If the file for a versionable setting exists, the value cannot be |
| 822 | @ changed on this screen.</p><hr /><p> |
| @@ -889,11 +889,11 @@ | |
| 889 | login_needed(0); |
| 890 | return; |
| 891 | } |
| 892 | |
| 893 | style_header("WWW Configuration"); |
| 894 | db_begin_transaction(); |
| 895 | @ <form action="%s(g.zTop)/setup_config" method="post"><div> |
| 896 | login_insert_csrf_secret(); |
| 897 | @ <input type="submit" name="submit" value="Apply Changes" /></p> |
| 898 | @ <hr /> |
| 899 | entry_attribute("Project Name", 60, "project-name", "pn", "", 0); |
| @@ -985,11 +985,11 @@ | |
| 985 | login_needed(0); |
| 986 | return; |
| 987 | } |
| 988 | |
| 989 | style_header("Wiki Configuration"); |
| 990 | db_begin_transaction(); |
| 991 | @ <form action="%s(g.zTop)/setup_wiki" method="post"><div> |
| 992 | login_insert_csrf_secret(); |
| 993 | @ <input type="submit" name="submit" value="Apply Changes" /></p> |
| 994 | @ <hr /> |
| 995 | onoff_attribute("Associate Wiki Pages With Branches, Tags, or Checkins", |
| @@ -1045,11 +1045,11 @@ | |
| 1045 | login_needed(0); |
| 1046 | return; |
| 1047 | } |
| 1048 | |
| 1049 | style_header("Moderator For Wiki And Tickets"); |
| 1050 | db_begin_transaction(); |
| 1051 | @ <form action="%R/setup_modreq" method="post"><div> |
| 1052 | login_insert_csrf_secret(); |
| 1053 | @ <hr /> |
| 1054 | onoff_attribute("Moderate ticket changes", |
| 1055 | "modreq-tkt", "modreq-tkt", 0, 0); |
| @@ -1091,11 +1091,11 @@ | |
| 1091 | login_check_credentials(); |
| 1092 | if( !g.perm.Admin ){ |
| 1093 | login_needed(0); |
| 1094 | return; |
| 1095 | } |
| 1096 | db_begin_transaction(); |
| 1097 | if( P("clear")!=0 && cgi_csrf_safe(1) ){ |
| 1098 | db_multi_exec("DELETE FROM config WHERE name GLOB 'adunit*'"); |
| 1099 | cgi_replace_parameter("adunit",""); |
| 1100 | } |
| 1101 | |
| @@ -1181,11 +1181,11 @@ | |
| 1181 | login_check_credentials(); |
| 1182 | if( !g.perm.Admin ){ |
| 1183 | login_needed(0); |
| 1184 | return; |
| 1185 | } |
| 1186 | db_begin_transaction(); |
| 1187 | if( !cgi_csrf_safe(1) ){ |
| 1188 | /* Allow no state changes if not safe from CSRF */ |
| 1189 | }else if( P("setlogo")!=0 && zLogoMime && zLogoMime[0] && szLogoImg>0 ){ |
| 1190 | Blob img; |
| 1191 | Stmt ins; |
| 1192 |
+1
-1
| --- src/shun.c | ||
| +++ src/shun.c | ||
| @@ -59,11 +59,11 @@ | ||
| 59 | 59 | return; |
| 60 | 60 | } |
| 61 | 61 | if( P("rebuild") ){ |
| 62 | 62 | db_close(1); |
| 63 | 63 | db_open_repository(g.zRepositoryName); |
| 64 | - db_begin_write(); | |
| 64 | + db_begin_transaction(); | |
| 65 | 65 | rebuild_db(0, 0, 0); |
| 66 | 66 | admin_log("Rebuilt database."); |
| 67 | 67 | db_end_transaction(0); |
| 68 | 68 | } |
| 69 | 69 | if( zUuid ){ |
| 70 | 70 |
| --- src/shun.c | |
| +++ src/shun.c | |
| @@ -59,11 +59,11 @@ | |
| 59 | return; |
| 60 | } |
| 61 | if( P("rebuild") ){ |
| 62 | db_close(1); |
| 63 | db_open_repository(g.zRepositoryName); |
| 64 | db_begin_write(); |
| 65 | rebuild_db(0, 0, 0); |
| 66 | admin_log("Rebuilt database."); |
| 67 | db_end_transaction(0); |
| 68 | } |
| 69 | if( zUuid ){ |
| 70 |
| --- src/shun.c | |
| +++ src/shun.c | |
| @@ -59,11 +59,11 @@ | |
| 59 | return; |
| 60 | } |
| 61 | if( P("rebuild") ){ |
| 62 | db_close(1); |
| 63 | db_open_repository(g.zRepositoryName); |
| 64 | db_begin_transaction(); |
| 65 | rebuild_db(0, 0, 0); |
| 66 | admin_log("Rebuilt database."); |
| 67 | db_end_transaction(0); |
| 68 | } |
| 69 | if( zUuid ){ |
| 70 |
+2
-2
| --- src/skins.c | ||
| +++ src/skins.c | ||
| @@ -463,11 +463,11 @@ | ||
| 463 | 463 | login_check_credentials(); |
| 464 | 464 | if( !g.perm.Admin ){ |
| 465 | 465 | login_needed(0); |
| 466 | 466 | return; |
| 467 | 467 | } |
| 468 | - db_begin_write(); | |
| 468 | + db_begin_transaction(); | |
| 469 | 469 | zCurrent = getSkin(0); |
| 470 | 470 | for(i=0; i<count(aBuiltinSkin); i++){ |
| 471 | 471 | aBuiltinSkin[i].zSQL = getSkin(aBuiltinSkin[i].zLabel); |
| 472 | 472 | } |
| 473 | 473 | |
| @@ -764,11 +764,11 @@ | ||
| 764 | 764 | if( P("revert")!=0 && cgi_csrf_safe(0) ){ |
| 765 | 765 | zContent = zDflt; |
| 766 | 766 | isRevert = 1; |
| 767 | 767 | } |
| 768 | 768 | |
| 769 | - db_begin_write(); | |
| 769 | + db_begin_transaction(); | |
| 770 | 770 | style_header("%s", zTitle); |
| 771 | 771 | for(j=0; j<count(aSkinAttr); j++){ |
| 772 | 772 | style_submenu_element(aSkinAttr[j].zSubmenu, |
| 773 | 773 | "%R/setup_skinedit?w=%d&basis=%h&sk=%d",j,zBasis,iSkin); |
| 774 | 774 | } |
| 775 | 775 |
| --- src/skins.c | |
| +++ src/skins.c | |
| @@ -463,11 +463,11 @@ | |
| 463 | login_check_credentials(); |
| 464 | if( !g.perm.Admin ){ |
| 465 | login_needed(0); |
| 466 | return; |
| 467 | } |
| 468 | db_begin_write(); |
| 469 | zCurrent = getSkin(0); |
| 470 | for(i=0; i<count(aBuiltinSkin); i++){ |
| 471 | aBuiltinSkin[i].zSQL = getSkin(aBuiltinSkin[i].zLabel); |
| 472 | } |
| 473 | |
| @@ -764,11 +764,11 @@ | |
| 764 | if( P("revert")!=0 && cgi_csrf_safe(0) ){ |
| 765 | zContent = zDflt; |
| 766 | isRevert = 1; |
| 767 | } |
| 768 | |
| 769 | db_begin_write(); |
| 770 | style_header("%s", zTitle); |
| 771 | for(j=0; j<count(aSkinAttr); j++){ |
| 772 | style_submenu_element(aSkinAttr[j].zSubmenu, |
| 773 | "%R/setup_skinedit?w=%d&basis=%h&sk=%d",j,zBasis,iSkin); |
| 774 | } |
| 775 |
| --- src/skins.c | |
| +++ src/skins.c | |
| @@ -463,11 +463,11 @@ | |
| 463 | login_check_credentials(); |
| 464 | if( !g.perm.Admin ){ |
| 465 | login_needed(0); |
| 466 | return; |
| 467 | } |
| 468 | db_begin_transaction(); |
| 469 | zCurrent = getSkin(0); |
| 470 | for(i=0; i<count(aBuiltinSkin); i++){ |
| 471 | aBuiltinSkin[i].zSQL = getSkin(aBuiltinSkin[i].zLabel); |
| 472 | } |
| 473 | |
| @@ -764,11 +764,11 @@ | |
| 764 | if( P("revert")!=0 && cgi_csrf_safe(0) ){ |
| 765 | zContent = zDflt; |
| 766 | isRevert = 1; |
| 767 | } |
| 768 | |
| 769 | db_begin_transaction(); |
| 770 | style_header("%s", zTitle); |
| 771 | for(j=0; j<count(aSkinAttr); j++){ |
| 772 | style_submenu_element(aSkinAttr[j].zSubmenu, |
| 773 | "%R/setup_skinedit?w=%d&basis=%h&sk=%d",j,zBasis,iSkin); |
| 774 | } |
| 775 |
+1
-1
| --- src/stash.c | ||
| +++ src/stash.c | ||
| @@ -580,11 +580,11 @@ | ||
| 580 | 580 | int nCmd; |
| 581 | 581 | int stashid = 0; |
| 582 | 582 | undo_capture_command_line(); |
| 583 | 583 | db_must_be_within_tree(); |
| 584 | 584 | db_open_config(0, 0); |
| 585 | - db_begin_write(); | |
| 585 | + db_begin_transaction(); | |
| 586 | 586 | stash_tables_exist_and_current(); |
| 587 | 587 | if( g.argc<=2 ){ |
| 588 | 588 | zCmd = "save"; |
| 589 | 589 | }else{ |
| 590 | 590 | zCmd = g.argv[2]; |
| 591 | 591 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -580,11 +580,11 @@ | |
| 580 | int nCmd; |
| 581 | int stashid = 0; |
| 582 | undo_capture_command_line(); |
| 583 | db_must_be_within_tree(); |
| 584 | db_open_config(0, 0); |
| 585 | db_begin_write(); |
| 586 | stash_tables_exist_and_current(); |
| 587 | if( g.argc<=2 ){ |
| 588 | zCmd = "save"; |
| 589 | }else{ |
| 590 | zCmd = g.argv[2]; |
| 591 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -580,11 +580,11 @@ | |
| 580 | int nCmd; |
| 581 | int stashid = 0; |
| 582 | undo_capture_command_line(); |
| 583 | db_must_be_within_tree(); |
| 584 | db_open_config(0, 0); |
| 585 | db_begin_transaction(); |
| 586 | stash_tables_exist_and_current(); |
| 587 | if( g.argc<=2 ){ |
| 588 | zCmd = "save"; |
| 589 | }else{ |
| 590 | zCmd = g.argv[2]; |
| 591 |
+3
-3
| --- src/tag.c | ||
| +++ src/tag.c | ||
| @@ -274,11 +274,11 @@ | ||
| 274 | 274 | if( rid==0 ){ |
| 275 | 275 | fossil_fatal("no such object: %s", g.argv[3]); |
| 276 | 276 | } |
| 277 | 277 | g.markPrivate = content_is_private(rid); |
| 278 | 278 | zValue = g.argc==5 ? g.argv[4] : 0; |
| 279 | - db_begin_write(); | |
| 279 | + db_begin_transaction(); | |
| 280 | 280 | tag_insert(zTag, tagtype, zValue, -1, 0.0, rid); |
| 281 | 281 | db_end_transaction(0); |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | /* |
| @@ -469,11 +469,11 @@ | ||
| 469 | 469 | if( find_option("dryrun","n",0)!=0 ) dryRun = TAG_ADD_DRYRUN; |
| 470 | 470 | if( g.argc!=5 && g.argc!=6 ){ |
| 471 | 471 | usage("add ?options? TAGNAME CHECK-IN ?VALUE?"); |
| 472 | 472 | } |
| 473 | 473 | zValue = g.argc==6 ? g.argv[5] : 0; |
| 474 | - db_begin_write(); | |
| 474 | + db_begin_transaction(); | |
| 475 | 475 | tag_add_artifact(zPrefix, g.argv[3], g.argv[4], zValue, |
| 476 | 476 | 1+fPropagate+dryRun,zDateOvrd,zUserOvrd); |
| 477 | 477 | db_end_transaction(0); |
| 478 | 478 | }else |
| 479 | 479 | |
| @@ -490,11 +490,11 @@ | ||
| 490 | 490 | const char *zUserOvrd = find_option("user-override",0,1); |
| 491 | 491 | if( find_option("dryrun","n",0)!=0 ) dryRun = TAG_ADD_DRYRUN; |
| 492 | 492 | if( g.argc!=5 ){ |
| 493 | 493 | usage("cancel ?options? TAGNAME CHECK-IN"); |
| 494 | 494 | } |
| 495 | - db_begin_write(); | |
| 495 | + db_begin_transaction(); | |
| 496 | 496 | tag_add_artifact(zPrefix, g.argv[3], g.argv[4], 0, dryRun, |
| 497 | 497 | zDateOvrd, zUserOvrd); |
| 498 | 498 | db_end_transaction(0); |
| 499 | 499 | }else |
| 500 | 500 | |
| 501 | 501 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -274,11 +274,11 @@ | |
| 274 | if( rid==0 ){ |
| 275 | fossil_fatal("no such object: %s", g.argv[3]); |
| 276 | } |
| 277 | g.markPrivate = content_is_private(rid); |
| 278 | zValue = g.argc==5 ? g.argv[4] : 0; |
| 279 | db_begin_write(); |
| 280 | tag_insert(zTag, tagtype, zValue, -1, 0.0, rid); |
| 281 | db_end_transaction(0); |
| 282 | } |
| 283 | |
| 284 | /* |
| @@ -469,11 +469,11 @@ | |
| 469 | if( find_option("dryrun","n",0)!=0 ) dryRun = TAG_ADD_DRYRUN; |
| 470 | if( g.argc!=5 && g.argc!=6 ){ |
| 471 | usage("add ?options? TAGNAME CHECK-IN ?VALUE?"); |
| 472 | } |
| 473 | zValue = g.argc==6 ? g.argv[5] : 0; |
| 474 | db_begin_write(); |
| 475 | tag_add_artifact(zPrefix, g.argv[3], g.argv[4], zValue, |
| 476 | 1+fPropagate+dryRun,zDateOvrd,zUserOvrd); |
| 477 | db_end_transaction(0); |
| 478 | }else |
| 479 | |
| @@ -490,11 +490,11 @@ | |
| 490 | const char *zUserOvrd = find_option("user-override",0,1); |
| 491 | if( find_option("dryrun","n",0)!=0 ) dryRun = TAG_ADD_DRYRUN; |
| 492 | if( g.argc!=5 ){ |
| 493 | usage("cancel ?options? TAGNAME CHECK-IN"); |
| 494 | } |
| 495 | db_begin_write(); |
| 496 | tag_add_artifact(zPrefix, g.argv[3], g.argv[4], 0, dryRun, |
| 497 | zDateOvrd, zUserOvrd); |
| 498 | db_end_transaction(0); |
| 499 | }else |
| 500 | |
| 501 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -274,11 +274,11 @@ | |
| 274 | if( rid==0 ){ |
| 275 | fossil_fatal("no such object: %s", g.argv[3]); |
| 276 | } |
| 277 | g.markPrivate = content_is_private(rid); |
| 278 | zValue = g.argc==5 ? g.argv[4] : 0; |
| 279 | db_begin_transaction(); |
| 280 | tag_insert(zTag, tagtype, zValue, -1, 0.0, rid); |
| 281 | db_end_transaction(0); |
| 282 | } |
| 283 | |
| 284 | /* |
| @@ -469,11 +469,11 @@ | |
| 469 | if( find_option("dryrun","n",0)!=0 ) dryRun = TAG_ADD_DRYRUN; |
| 470 | if( g.argc!=5 && g.argc!=6 ){ |
| 471 | usage("add ?options? TAGNAME CHECK-IN ?VALUE?"); |
| 472 | } |
| 473 | zValue = g.argc==6 ? g.argv[5] : 0; |
| 474 | db_begin_transaction(); |
| 475 | tag_add_artifact(zPrefix, g.argv[3], g.argv[4], zValue, |
| 476 | 1+fPropagate+dryRun,zDateOvrd,zUserOvrd); |
| 477 | db_end_transaction(0); |
| 478 | }else |
| 479 | |
| @@ -490,11 +490,11 @@ | |
| 490 | const char *zUserOvrd = find_option("user-override",0,1); |
| 491 | if( find_option("dryrun","n",0)!=0 ) dryRun = TAG_ADD_DRYRUN; |
| 492 | if( g.argc!=5 ){ |
| 493 | usage("cancel ?options? TAGNAME CHECK-IN"); |
| 494 | } |
| 495 | db_begin_transaction(); |
| 496 | tag_add_artifact(zPrefix, g.argv[3], g.argv[4], 0, dryRun, |
| 497 | zDateOvrd, zUserOvrd); |
| 498 | db_end_transaction(0); |
| 499 | }else |
| 500 | |
| 501 |
+1
-1
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -386,11 +386,11 @@ | ||
| 386 | 386 | ** available ticket artifacts. |
| 387 | 387 | */ |
| 388 | 388 | void ticket_rebuild(void){ |
| 389 | 389 | Stmt q; |
| 390 | 390 | ticket_create_table(1); |
| 391 | - db_begin_write(); | |
| 391 | + db_begin_transaction(); | |
| 392 | 392 | db_prepare(&q,"SELECT tagname FROM tag WHERE tagname GLOB 'tkt-*'"); |
| 393 | 393 | while( db_step(&q)==SQLITE_ROW ){ |
| 394 | 394 | const char *zName = db_column_text(&q, 0); |
| 395 | 395 | int len; |
| 396 | 396 | zName += 4; |
| 397 | 397 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -386,11 +386,11 @@ | |
| 386 | ** available ticket artifacts. |
| 387 | */ |
| 388 | void ticket_rebuild(void){ |
| 389 | Stmt q; |
| 390 | ticket_create_table(1); |
| 391 | db_begin_write(); |
| 392 | db_prepare(&q,"SELECT tagname FROM tag WHERE tagname GLOB 'tkt-*'"); |
| 393 | while( db_step(&q)==SQLITE_ROW ){ |
| 394 | const char *zName = db_column_text(&q, 0); |
| 395 | int len; |
| 396 | zName += 4; |
| 397 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -386,11 +386,11 @@ | |
| 386 | ** available ticket artifacts. |
| 387 | */ |
| 388 | void ticket_rebuild(void){ |
| 389 | Stmt q; |
| 390 | ticket_create_table(1); |
| 391 | db_begin_transaction(); |
| 392 | db_prepare(&q,"SELECT tagname FROM tag WHERE tagname GLOB 'tkt-*'"); |
| 393 | while( db_step(&q)==SQLITE_ROW ){ |
| 394 | const char *zName = db_column_text(&q, 0); |
| 395 | int len; |
| 396 | zName += 4; |
| 397 |
+1
-1
| --- src/tktsetup.c | ||
| +++ src/tktsetup.c | ||
| @@ -891,11 +891,11 @@ | ||
| 891 | 891 | |
| 892 | 892 | if( P("setup") ){ |
| 893 | 893 | cgi_redirect("tktsetup"); |
| 894 | 894 | } |
| 895 | 895 | style_header("Ticket Display On Timelines"); |
| 896 | - db_begin_write(); | |
| 896 | + db_begin_transaction(); | |
| 897 | 897 | @ <form action="%s(g.zTop)/tktsetup_timeline" method="post"><div> |
| 898 | 898 | login_insert_csrf_secret(); |
| 899 | 899 | |
| 900 | 900 | @ <hr /> |
| 901 | 901 | entry_attribute("Ticket Title", 40, "ticket-title-expr", "t", |
| 902 | 902 |
| --- src/tktsetup.c | |
| +++ src/tktsetup.c | |
| @@ -891,11 +891,11 @@ | |
| 891 | |
| 892 | if( P("setup") ){ |
| 893 | cgi_redirect("tktsetup"); |
| 894 | } |
| 895 | style_header("Ticket Display On Timelines"); |
| 896 | db_begin_write(); |
| 897 | @ <form action="%s(g.zTop)/tktsetup_timeline" method="post"><div> |
| 898 | login_insert_csrf_secret(); |
| 899 | |
| 900 | @ <hr /> |
| 901 | entry_attribute("Ticket Title", 40, "ticket-title-expr", "t", |
| 902 |
| --- src/tktsetup.c | |
| +++ src/tktsetup.c | |
| @@ -891,11 +891,11 @@ | |
| 891 | |
| 892 | if( P("setup") ){ |
| 893 | cgi_redirect("tktsetup"); |
| 894 | } |
| 895 | style_header("Ticket Display On Timelines"); |
| 896 | db_begin_transaction(); |
| 897 | @ <form action="%s(g.zTop)/tktsetup_timeline" method="post"><div> |
| 898 | login_insert_csrf_secret(); |
| 899 | |
| 900 | @ <hr /> |
| 901 | entry_attribute("Ticket Title", 40, "ticket-title-expr", "t", |
| 902 |
+1
-1
| --- src/undo.c | ||
| +++ src/undo.c | ||
| @@ -461,11 +461,11 @@ | ||
| 461 | 461 | if( !dryRunFlag ){ |
| 462 | 462 | dryRunFlag = find_option("explain", 0, 0)!=0; |
| 463 | 463 | } |
| 464 | 464 | db_must_be_within_tree(); |
| 465 | 465 | verify_all_options(); |
| 466 | - db_begin_write(); | |
| 466 | + db_begin_transaction(); | |
| 467 | 467 | undo_available = db_lget_int("undo_available", 0); |
| 468 | 468 | if( dryRunFlag ){ |
| 469 | 469 | if( undo_available==0 ){ |
| 470 | 470 | fossil_print("No undo or redo is available\n"); |
| 471 | 471 | }else{ |
| 472 | 472 |
| --- src/undo.c | |
| +++ src/undo.c | |
| @@ -461,11 +461,11 @@ | |
| 461 | if( !dryRunFlag ){ |
| 462 | dryRunFlag = find_option("explain", 0, 0)!=0; |
| 463 | } |
| 464 | db_must_be_within_tree(); |
| 465 | verify_all_options(); |
| 466 | db_begin_write(); |
| 467 | undo_available = db_lget_int("undo_available", 0); |
| 468 | if( dryRunFlag ){ |
| 469 | if( undo_available==0 ){ |
| 470 | fossil_print("No undo or redo is available\n"); |
| 471 | }else{ |
| 472 |
| --- src/undo.c | |
| +++ src/undo.c | |
| @@ -461,11 +461,11 @@ | |
| 461 | if( !dryRunFlag ){ |
| 462 | dryRunFlag = find_option("explain", 0, 0)!=0; |
| 463 | } |
| 464 | db_must_be_within_tree(); |
| 465 | verify_all_options(); |
| 466 | db_begin_transaction(); |
| 467 | undo_available = db_lget_int("undo_available", 0); |
| 468 | if( dryRunFlag ){ |
| 469 | if( undo_available==0 ){ |
| 470 | fossil_print("No undo or redo is available\n"); |
| 471 | }else{ |
| 472 |
+5
-5
| --- src/unversioned.c | ||
| +++ src/unversioned.c | ||
| @@ -293,11 +293,11 @@ | ||
| 293 | 293 | int i; |
| 294 | 294 | |
| 295 | 295 | zAs = find_option("as",0,1); |
| 296 | 296 | if( zAs && g.argc!=4 ) usage("add DISKFILE --as UVFILE"); |
| 297 | 297 | verify_all_options(); |
| 298 | - db_begin_write(); | |
| 298 | + db_begin_transaction(); | |
| 299 | 299 | content_rcvid_init("#!fossil unversioned add"); |
| 300 | 300 | for(i=3; i<g.argc; i++){ |
| 301 | 301 | zIn = zAs ? zAs : g.argv[i]; |
| 302 | 302 | if( zIn[0]==0 ){ |
| 303 | 303 | zError = "be empty string"; |
| @@ -318,11 +318,11 @@ | ||
| 318 | 318 | } |
| 319 | 319 | db_end_transaction(0); |
| 320 | 320 | }else if( memcmp(zCmd, "cat", nCmd)==0 ){ |
| 321 | 321 | int i; |
| 322 | 322 | verify_all_options(); |
| 323 | - db_begin_write(); | |
| 323 | + db_begin_transaction(); | |
| 324 | 324 | for(i=3; i<g.argc; i++){ |
| 325 | 325 | Blob content; |
| 326 | 326 | if( unversioned_content(g.argv[i], &content)==0 ){ |
| 327 | 327 | blob_write_to_file(&content, "-"); |
| 328 | 328 | } |
| @@ -341,11 +341,11 @@ | ||
| 341 | 341 | zUVFile = g.argv[3]; |
| 342 | 342 | zEditor = fossil_text_editor(); |
| 343 | 343 | if( zEditor==0 ) fossil_fatal("no text editor - set the VISUAL env variable"); |
| 344 | 344 | zTFile = fossil_temp_filename(); |
| 345 | 345 | if( zTFile==0 ) fossil_fatal("cannot find a temporary filename"); |
| 346 | - db_begin_write(); | |
| 346 | + db_begin_transaction(); | |
| 347 | 347 | content_rcvid_init("#!fossil unversioned edit"); |
| 348 | 348 | if( unversioned_content(zUVFile, &content) ){ |
| 349 | 349 | fossil_fatal("no such uv-file: %Q", zUVFile); |
| 350 | 350 | } |
| 351 | 351 | if( looks_like_binary(&content) ){ |
| @@ -431,11 +431,11 @@ | ||
| 431 | 431 | sync_unversioned(syncFlags); |
| 432 | 432 | }else if( memcmp(zCmd, "remove", nCmd)==0 || memcmp(zCmd, "rm", nCmd)==0 |
| 433 | 433 | || memcmp(zCmd, "delete", nCmd)==0 ){ |
| 434 | 434 | int i; |
| 435 | 435 | verify_all_options(); |
| 436 | - db_begin_write(); | |
| 436 | + db_begin_transaction(); | |
| 437 | 437 | for(i=3; i<g.argc; i++){ |
| 438 | 438 | db_multi_exec( |
| 439 | 439 | "UPDATE unversioned" |
| 440 | 440 | " SET hash=NULL, content=NULL, mtime=%lld, sz=0 WHERE name=%Q", |
| 441 | 441 | mtime, g.argv[i] |
| @@ -449,11 +449,11 @@ | ||
| 449 | 449 | g.argv[2] = "--uv-noop"; |
| 450 | 450 | sync_unversioned(syncFlags); |
| 451 | 451 | }else if( memcmp(zCmd, "touch", nCmd)==0 ){ |
| 452 | 452 | int i; |
| 453 | 453 | verify_all_options(); |
| 454 | - db_begin_write(); | |
| 454 | + db_begin_transaction(); | |
| 455 | 455 | for(i=3; i<g.argc; i++){ |
| 456 | 456 | db_multi_exec( |
| 457 | 457 | "UPDATE unversioned SET mtime=%lld WHERE name=%Q", |
| 458 | 458 | mtime, g.argv[i] |
| 459 | 459 | ); |
| 460 | 460 |
| --- src/unversioned.c | |
| +++ src/unversioned.c | |
| @@ -293,11 +293,11 @@ | |
| 293 | int i; |
| 294 | |
| 295 | zAs = find_option("as",0,1); |
| 296 | if( zAs && g.argc!=4 ) usage("add DISKFILE --as UVFILE"); |
| 297 | verify_all_options(); |
| 298 | db_begin_write(); |
| 299 | content_rcvid_init("#!fossil unversioned add"); |
| 300 | for(i=3; i<g.argc; i++){ |
| 301 | zIn = zAs ? zAs : g.argv[i]; |
| 302 | if( zIn[0]==0 ){ |
| 303 | zError = "be empty string"; |
| @@ -318,11 +318,11 @@ | |
| 318 | } |
| 319 | db_end_transaction(0); |
| 320 | }else if( memcmp(zCmd, "cat", nCmd)==0 ){ |
| 321 | int i; |
| 322 | verify_all_options(); |
| 323 | db_begin_write(); |
| 324 | for(i=3; i<g.argc; i++){ |
| 325 | Blob content; |
| 326 | if( unversioned_content(g.argv[i], &content)==0 ){ |
| 327 | blob_write_to_file(&content, "-"); |
| 328 | } |
| @@ -341,11 +341,11 @@ | |
| 341 | zUVFile = g.argv[3]; |
| 342 | zEditor = fossil_text_editor(); |
| 343 | if( zEditor==0 ) fossil_fatal("no text editor - set the VISUAL env variable"); |
| 344 | zTFile = fossil_temp_filename(); |
| 345 | if( zTFile==0 ) fossil_fatal("cannot find a temporary filename"); |
| 346 | db_begin_write(); |
| 347 | content_rcvid_init("#!fossil unversioned edit"); |
| 348 | if( unversioned_content(zUVFile, &content) ){ |
| 349 | fossil_fatal("no such uv-file: %Q", zUVFile); |
| 350 | } |
| 351 | if( looks_like_binary(&content) ){ |
| @@ -431,11 +431,11 @@ | |
| 431 | sync_unversioned(syncFlags); |
| 432 | }else if( memcmp(zCmd, "remove", nCmd)==0 || memcmp(zCmd, "rm", nCmd)==0 |
| 433 | || memcmp(zCmd, "delete", nCmd)==0 ){ |
| 434 | int i; |
| 435 | verify_all_options(); |
| 436 | db_begin_write(); |
| 437 | for(i=3; i<g.argc; i++){ |
| 438 | db_multi_exec( |
| 439 | "UPDATE unversioned" |
| 440 | " SET hash=NULL, content=NULL, mtime=%lld, sz=0 WHERE name=%Q", |
| 441 | mtime, g.argv[i] |
| @@ -449,11 +449,11 @@ | |
| 449 | g.argv[2] = "--uv-noop"; |
| 450 | sync_unversioned(syncFlags); |
| 451 | }else if( memcmp(zCmd, "touch", nCmd)==0 ){ |
| 452 | int i; |
| 453 | verify_all_options(); |
| 454 | db_begin_write(); |
| 455 | for(i=3; i<g.argc; i++){ |
| 456 | db_multi_exec( |
| 457 | "UPDATE unversioned SET mtime=%lld WHERE name=%Q", |
| 458 | mtime, g.argv[i] |
| 459 | ); |
| 460 |
| --- src/unversioned.c | |
| +++ src/unversioned.c | |
| @@ -293,11 +293,11 @@ | |
| 293 | int i; |
| 294 | |
| 295 | zAs = find_option("as",0,1); |
| 296 | if( zAs && g.argc!=4 ) usage("add DISKFILE --as UVFILE"); |
| 297 | verify_all_options(); |
| 298 | db_begin_transaction(); |
| 299 | content_rcvid_init("#!fossil unversioned add"); |
| 300 | for(i=3; i<g.argc; i++){ |
| 301 | zIn = zAs ? zAs : g.argv[i]; |
| 302 | if( zIn[0]==0 ){ |
| 303 | zError = "be empty string"; |
| @@ -318,11 +318,11 @@ | |
| 318 | } |
| 319 | db_end_transaction(0); |
| 320 | }else if( memcmp(zCmd, "cat", nCmd)==0 ){ |
| 321 | int i; |
| 322 | verify_all_options(); |
| 323 | db_begin_transaction(); |
| 324 | for(i=3; i<g.argc; i++){ |
| 325 | Blob content; |
| 326 | if( unversioned_content(g.argv[i], &content)==0 ){ |
| 327 | blob_write_to_file(&content, "-"); |
| 328 | } |
| @@ -341,11 +341,11 @@ | |
| 341 | zUVFile = g.argv[3]; |
| 342 | zEditor = fossil_text_editor(); |
| 343 | if( zEditor==0 ) fossil_fatal("no text editor - set the VISUAL env variable"); |
| 344 | zTFile = fossil_temp_filename(); |
| 345 | if( zTFile==0 ) fossil_fatal("cannot find a temporary filename"); |
| 346 | db_begin_transaction(); |
| 347 | content_rcvid_init("#!fossil unversioned edit"); |
| 348 | if( unversioned_content(zUVFile, &content) ){ |
| 349 | fossil_fatal("no such uv-file: %Q", zUVFile); |
| 350 | } |
| 351 | if( looks_like_binary(&content) ){ |
| @@ -431,11 +431,11 @@ | |
| 431 | sync_unversioned(syncFlags); |
| 432 | }else if( memcmp(zCmd, "remove", nCmd)==0 || memcmp(zCmd, "rm", nCmd)==0 |
| 433 | || memcmp(zCmd, "delete", nCmd)==0 ){ |
| 434 | int i; |
| 435 | verify_all_options(); |
| 436 | db_begin_transaction(); |
| 437 | for(i=3; i<g.argc; i++){ |
| 438 | db_multi_exec( |
| 439 | "UPDATE unversioned" |
| 440 | " SET hash=NULL, content=NULL, mtime=%lld, sz=0 WHERE name=%Q", |
| 441 | mtime, g.argv[i] |
| @@ -449,11 +449,11 @@ | |
| 449 | g.argv[2] = "--uv-noop"; |
| 450 | sync_unversioned(syncFlags); |
| 451 | }else if( memcmp(zCmd, "touch", nCmd)==0 ){ |
| 452 | int i; |
| 453 | verify_all_options(); |
| 454 | db_begin_transaction(); |
| 455 | for(i=3; i<g.argc; i++){ |
| 456 | db_multi_exec( |
| 457 | "UPDATE unversioned SET mtime=%lld WHERE name=%Q", |
| 458 | mtime, g.argv[i] |
| 459 | ); |
| 460 |
+2
-2
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -229,11 +229,11 @@ | ||
| 229 | 229 | |
| 230 | 230 | if( tid==0 ){ |
| 231 | 231 | return; |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | - db_begin_write(); | |
| 234 | + db_begin_transaction(); | |
| 235 | 235 | db_multi_exec( |
| 236 | 236 | "CREATE TEMP TABLE dir_to_delete(name TEXT %s PRIMARY KEY)WITHOUT ROWID", |
| 237 | 237 | filename_collation() |
| 238 | 238 | ); |
| 239 | 239 | vfile_check_signature(vid, CKSIG_ENOTFILE); |
| @@ -803,11 +803,11 @@ | ||
| 803 | 803 | |
| 804 | 804 | /* Get manifests of revert version and (if different) current checkout. */ |
| 805 | 805 | pRvManifest = historical_manifest(zRevision); |
| 806 | 806 | pCoManifest = zRevision ? historical_manifest(0) : 0; |
| 807 | 807 | |
| 808 | - db_begin_write(); | |
| 808 | + db_begin_transaction(); | |
| 809 | 809 | undo_begin(); |
| 810 | 810 | db_multi_exec("CREATE TEMP TABLE torevert(name UNIQUE);"); |
| 811 | 811 | |
| 812 | 812 | if( g.argc>2 ){ |
| 813 | 813 | for(i=2; i<g.argc; i++){ |
| 814 | 814 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -229,11 +229,11 @@ | |
| 229 | |
| 230 | if( tid==0 ){ |
| 231 | return; |
| 232 | } |
| 233 | |
| 234 | db_begin_write(); |
| 235 | db_multi_exec( |
| 236 | "CREATE TEMP TABLE dir_to_delete(name TEXT %s PRIMARY KEY)WITHOUT ROWID", |
| 237 | filename_collation() |
| 238 | ); |
| 239 | vfile_check_signature(vid, CKSIG_ENOTFILE); |
| @@ -803,11 +803,11 @@ | |
| 803 | |
| 804 | /* Get manifests of revert version and (if different) current checkout. */ |
| 805 | pRvManifest = historical_manifest(zRevision); |
| 806 | pCoManifest = zRevision ? historical_manifest(0) : 0; |
| 807 | |
| 808 | db_begin_write(); |
| 809 | undo_begin(); |
| 810 | db_multi_exec("CREATE TEMP TABLE torevert(name UNIQUE);"); |
| 811 | |
| 812 | if( g.argc>2 ){ |
| 813 | for(i=2; i<g.argc; i++){ |
| 814 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -229,11 +229,11 @@ | |
| 229 | |
| 230 | if( tid==0 ){ |
| 231 | return; |
| 232 | } |
| 233 | |
| 234 | db_begin_transaction(); |
| 235 | db_multi_exec( |
| 236 | "CREATE TEMP TABLE dir_to_delete(name TEXT %s PRIMARY KEY)WITHOUT ROWID", |
| 237 | filename_collation() |
| 238 | ); |
| 239 | vfile_check_signature(vid, CKSIG_ENOTFILE); |
| @@ -803,11 +803,11 @@ | |
| 803 | |
| 804 | /* Get manifests of revert version and (if different) current checkout. */ |
| 805 | pRvManifest = historical_manifest(zRevision); |
| 806 | pCoManifest = zRevision ? historical_manifest(0) : 0; |
| 807 | |
| 808 | db_begin_transaction(); |
| 809 | undo_begin(); |
| 810 | db_multi_exec("CREATE TEMP TABLE torevert(name UNIQUE);"); |
| 811 | |
| 812 | if( g.argc>2 ){ |
| 813 | for(i=2; i<g.argc; i++){ |
| 814 |
+2
-2
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -81,11 +81,11 @@ | ||
| 81 | 81 | |
| 82 | 82 | if( db_exists("SELECT 1 FROM vfile WHERE vid=%d", vid) ){ |
| 83 | 83 | return 0; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - db_begin_write(); | |
| 86 | + db_begin_transaction(); | |
| 87 | 87 | p = manifest_get(vid, CFTYPE_MANIFEST, 0); |
| 88 | 88 | if( p==0 ) { |
| 89 | 89 | db_end_transaction(1); |
| 90 | 90 | return 0; |
| 91 | 91 | } |
| @@ -174,11 +174,11 @@ | ||
| 174 | 174 | int nErr = 0; |
| 175 | 175 | Stmt q; |
| 176 | 176 | int useMtime = (cksigFlags & CKSIG_HASH)==0 |
| 177 | 177 | && db_get_boolean("mtime-changes", 1); |
| 178 | 178 | |
| 179 | - db_begin_write(); | |
| 179 | + db_begin_transaction(); | |
| 180 | 180 | db_prepare(&q, "SELECT id, %Q || pathname," |
| 181 | 181 | " vfile.mrid, deleted, chnged, uuid, size, mtime," |
| 182 | 182 | " CASE WHEN isexe THEN %d WHEN islink THEN %d ELSE %d END" |
| 183 | 183 | " FROM vfile LEFT JOIN blob ON vfile.mrid=blob.rid" |
| 184 | 184 | " WHERE vid=%d ", g.zLocalRoot, PERM_EXE, PERM_LNK, PERM_REG, |
| 185 | 185 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -81,11 +81,11 @@ | |
| 81 | |
| 82 | if( db_exists("SELECT 1 FROM vfile WHERE vid=%d", vid) ){ |
| 83 | return 0; |
| 84 | } |
| 85 | |
| 86 | db_begin_write(); |
| 87 | p = manifest_get(vid, CFTYPE_MANIFEST, 0); |
| 88 | if( p==0 ) { |
| 89 | db_end_transaction(1); |
| 90 | return 0; |
| 91 | } |
| @@ -174,11 +174,11 @@ | |
| 174 | int nErr = 0; |
| 175 | Stmt q; |
| 176 | int useMtime = (cksigFlags & CKSIG_HASH)==0 |
| 177 | && db_get_boolean("mtime-changes", 1); |
| 178 | |
| 179 | db_begin_write(); |
| 180 | db_prepare(&q, "SELECT id, %Q || pathname," |
| 181 | " vfile.mrid, deleted, chnged, uuid, size, mtime," |
| 182 | " CASE WHEN isexe THEN %d WHEN islink THEN %d ELSE %d END" |
| 183 | " FROM vfile LEFT JOIN blob ON vfile.mrid=blob.rid" |
| 184 | " WHERE vid=%d ", g.zLocalRoot, PERM_EXE, PERM_LNK, PERM_REG, |
| 185 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -81,11 +81,11 @@ | |
| 81 | |
| 82 | if( db_exists("SELECT 1 FROM vfile WHERE vid=%d", vid) ){ |
| 83 | return 0; |
| 84 | } |
| 85 | |
| 86 | db_begin_transaction(); |
| 87 | p = manifest_get(vid, CFTYPE_MANIFEST, 0); |
| 88 | if( p==0 ) { |
| 89 | db_end_transaction(1); |
| 90 | return 0; |
| 91 | } |
| @@ -174,11 +174,11 @@ | |
| 174 | int nErr = 0; |
| 175 | Stmt q; |
| 176 | int useMtime = (cksigFlags & CKSIG_HASH)==0 |
| 177 | && db_get_boolean("mtime-changes", 1); |
| 178 | |
| 179 | db_begin_transaction(); |
| 180 | db_prepare(&q, "SELECT id, %Q || pathname," |
| 181 | " vfile.mrid, deleted, chnged, uuid, size, mtime," |
| 182 | " CASE WHEN isexe THEN %d WHEN islink THEN %d ELSE %d END" |
| 183 | " FROM vfile LEFT JOIN blob ON vfile.mrid=blob.rid" |
| 184 | " WHERE vid=%d ", g.zLocalRoot, PERM_EXE, PERM_LNK, PERM_REG, |
| 185 |
+3
-3
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -656,11 +656,11 @@ | ||
| 656 | 656 | && (goodCaptcha = captcha_is_correct(0)) |
| 657 | 657 | ){ |
| 658 | 658 | char *zDate; |
| 659 | 659 | Blob cksum; |
| 660 | 660 | blob_zero(&wiki); |
| 661 | - db_begin_write(); | |
| 661 | + db_begin_transaction(); | |
| 662 | 662 | if( isSandbox ){ |
| 663 | 663 | db_set("sandbox",zBody,0); |
| 664 | 664 | db_set("sandbox-mimetype",zMimetype,0); |
| 665 | 665 | }else{ |
| 666 | 666 | login_verify_csrf_secret(); |
| @@ -935,11 +935,11 @@ | ||
| 935 | 935 | if( pWiki ){ |
| 936 | 936 | blob_append(&body, pWiki->zWiki, -1); |
| 937 | 937 | manifest_destroy(pWiki); |
| 938 | 938 | } |
| 939 | 939 | blob_zero(&wiki); |
| 940 | - db_begin_write(); | |
| 940 | + db_begin_transaction(); | |
| 941 | 941 | zDate = date_in_standard_format("now"); |
| 942 | 942 | blob_appendf(&wiki, "D %s\n", zDate); |
| 943 | 943 | blob_appendf(&wiki, "L %F\n", zPageName); |
| 944 | 944 | if( fossil_strcmp(zMimetype, "text/x-fossil-wiki")!=0 ){ |
| 945 | 945 | blob_appendf(&wiki, "N %s\n", zMimetype); |
| @@ -1311,11 +1311,11 @@ | ||
| 1311 | 1311 | blob_appendf( &wiki, "W %d\n%s\n", blob_size(pContent), |
| 1312 | 1312 | blob_str(pContent) ); |
| 1313 | 1313 | md5sum_blob(&wiki, &cksum); |
| 1314 | 1314 | blob_appendf(&wiki, "Z %b\n", &cksum); |
| 1315 | 1315 | blob_reset(&cksum); |
| 1316 | - db_begin_write(); | |
| 1316 | + db_begin_transaction(); | |
| 1317 | 1317 | wiki_put(&wiki, 0, wiki_need_moderation(localUser)); |
| 1318 | 1318 | db_end_transaction(0); |
| 1319 | 1319 | return 1; |
| 1320 | 1320 | } |
| 1321 | 1321 | |
| 1322 | 1322 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -656,11 +656,11 @@ | |
| 656 | && (goodCaptcha = captcha_is_correct(0)) |
| 657 | ){ |
| 658 | char *zDate; |
| 659 | Blob cksum; |
| 660 | blob_zero(&wiki); |
| 661 | db_begin_write(); |
| 662 | if( isSandbox ){ |
| 663 | db_set("sandbox",zBody,0); |
| 664 | db_set("sandbox-mimetype",zMimetype,0); |
| 665 | }else{ |
| 666 | login_verify_csrf_secret(); |
| @@ -935,11 +935,11 @@ | |
| 935 | if( pWiki ){ |
| 936 | blob_append(&body, pWiki->zWiki, -1); |
| 937 | manifest_destroy(pWiki); |
| 938 | } |
| 939 | blob_zero(&wiki); |
| 940 | db_begin_write(); |
| 941 | zDate = date_in_standard_format("now"); |
| 942 | blob_appendf(&wiki, "D %s\n", zDate); |
| 943 | blob_appendf(&wiki, "L %F\n", zPageName); |
| 944 | if( fossil_strcmp(zMimetype, "text/x-fossil-wiki")!=0 ){ |
| 945 | blob_appendf(&wiki, "N %s\n", zMimetype); |
| @@ -1311,11 +1311,11 @@ | |
| 1311 | blob_appendf( &wiki, "W %d\n%s\n", blob_size(pContent), |
| 1312 | blob_str(pContent) ); |
| 1313 | md5sum_blob(&wiki, &cksum); |
| 1314 | blob_appendf(&wiki, "Z %b\n", &cksum); |
| 1315 | blob_reset(&cksum); |
| 1316 | db_begin_write(); |
| 1317 | wiki_put(&wiki, 0, wiki_need_moderation(localUser)); |
| 1318 | db_end_transaction(0); |
| 1319 | return 1; |
| 1320 | } |
| 1321 | |
| 1322 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -656,11 +656,11 @@ | |
| 656 | && (goodCaptcha = captcha_is_correct(0)) |
| 657 | ){ |
| 658 | char *zDate; |
| 659 | Blob cksum; |
| 660 | blob_zero(&wiki); |
| 661 | db_begin_transaction(); |
| 662 | if( isSandbox ){ |
| 663 | db_set("sandbox",zBody,0); |
| 664 | db_set("sandbox-mimetype",zMimetype,0); |
| 665 | }else{ |
| 666 | login_verify_csrf_secret(); |
| @@ -935,11 +935,11 @@ | |
| 935 | if( pWiki ){ |
| 936 | blob_append(&body, pWiki->zWiki, -1); |
| 937 | manifest_destroy(pWiki); |
| 938 | } |
| 939 | blob_zero(&wiki); |
| 940 | db_begin_transaction(); |
| 941 | zDate = date_in_standard_format("now"); |
| 942 | blob_appendf(&wiki, "D %s\n", zDate); |
| 943 | blob_appendf(&wiki, "L %F\n", zPageName); |
| 944 | if( fossil_strcmp(zMimetype, "text/x-fossil-wiki")!=0 ){ |
| 945 | blob_appendf(&wiki, "N %s\n", zMimetype); |
| @@ -1311,11 +1311,11 @@ | |
| 1311 | blob_appendf( &wiki, "W %d\n%s\n", blob_size(pContent), |
| 1312 | blob_str(pContent) ); |
| 1313 | md5sum_blob(&wiki, &cksum); |
| 1314 | blob_appendf(&wiki, "Z %b\n", &cksum); |
| 1315 | blob_reset(&cksum); |
| 1316 | db_begin_transaction(); |
| 1317 | wiki_put(&wiki, 0, wiki_need_moderation(localUser)); |
| 1318 | db_end_transaction(0); |
| 1319 | return 1; |
| 1320 | } |
| 1321 | |
| 1322 |
+2
-2
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -1167,11 +1167,11 @@ | ||
| 1167 | 1167 | xfer.maxTime = db_get_int("max-download-time", 30); |
| 1168 | 1168 | if( xfer.maxTime<1 ) xfer.maxTime = 1; |
| 1169 | 1169 | xfer.maxTime += time(NULL); |
| 1170 | 1170 | g.xferPanic = 1; |
| 1171 | 1171 | |
| 1172 | - db_begin_write(); | |
| 1172 | + db_begin_transaction(); | |
| 1173 | 1173 | db_multi_exec( |
| 1174 | 1174 | "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);" |
| 1175 | 1175 | ); |
| 1176 | 1176 | manifest_crosslink_begin(); |
| 1177 | 1177 | rc = xfer_run_common_script(); |
| @@ -1888,11 +1888,11 @@ | ||
| 1888 | 1888 | } |
| 1889 | 1889 | |
| 1890 | 1890 | while( go ){ |
| 1891 | 1891 | int newPhantom = 0; |
| 1892 | 1892 | char *zRandomness; |
| 1893 | - db_begin_write(); | |
| 1893 | + db_begin_transaction(); | |
| 1894 | 1894 | db_record_repository_filename(0); |
| 1895 | 1895 | db_multi_exec( |
| 1896 | 1896 | "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);" |
| 1897 | 1897 | ); |
| 1898 | 1898 | manifest_crosslink_begin(); |
| 1899 | 1899 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1167,11 +1167,11 @@ | |
| 1167 | xfer.maxTime = db_get_int("max-download-time", 30); |
| 1168 | if( xfer.maxTime<1 ) xfer.maxTime = 1; |
| 1169 | xfer.maxTime += time(NULL); |
| 1170 | g.xferPanic = 1; |
| 1171 | |
| 1172 | db_begin_write(); |
| 1173 | db_multi_exec( |
| 1174 | "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);" |
| 1175 | ); |
| 1176 | manifest_crosslink_begin(); |
| 1177 | rc = xfer_run_common_script(); |
| @@ -1888,11 +1888,11 @@ | |
| 1888 | } |
| 1889 | |
| 1890 | while( go ){ |
| 1891 | int newPhantom = 0; |
| 1892 | char *zRandomness; |
| 1893 | db_begin_write(); |
| 1894 | db_record_repository_filename(0); |
| 1895 | db_multi_exec( |
| 1896 | "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);" |
| 1897 | ); |
| 1898 | manifest_crosslink_begin(); |
| 1899 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1167,11 +1167,11 @@ | |
| 1167 | xfer.maxTime = db_get_int("max-download-time", 30); |
| 1168 | if( xfer.maxTime<1 ) xfer.maxTime = 1; |
| 1169 | xfer.maxTime += time(NULL); |
| 1170 | g.xferPanic = 1; |
| 1171 | |
| 1172 | db_begin_transaction(); |
| 1173 | db_multi_exec( |
| 1174 | "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);" |
| 1175 | ); |
| 1176 | manifest_crosslink_begin(); |
| 1177 | rc = xfer_run_common_script(); |
| @@ -1888,11 +1888,11 @@ | |
| 1888 | } |
| 1889 | |
| 1890 | while( go ){ |
| 1891 | int newPhantom = 0; |
| 1892 | char *zRandomness; |
| 1893 | db_begin_transaction(); |
| 1894 | db_record_repository_filename(0); |
| 1895 | db_multi_exec( |
| 1896 | "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);" |
| 1897 | ); |
| 1898 | manifest_crosslink_begin(); |
| 1899 |