Fossil SCM
Fix an extra call to db_end_transaction() in "fossil config pull ticket".
Commit
f5eb03f5e585cdd5678888f4479178ef6f901e022aa82f9176df69817389f2e7
Parent
0b6d3eaf6cc3e22…
2 files changed
+11
-10
+1
-1
+11
-10
| --- src/configure.c | ||
| +++ src/configure.c | ||
| @@ -36,11 +36,11 @@ | ||
| 36 | 36 | #define CONFIGSET_SHUN 0x000010 /* Shun settings */ |
| 37 | 37 | #define CONFIGSET_USER 0x000020 /* The USER table */ |
| 38 | 38 | #define CONFIGSET_ADDR 0x000040 /* The CONCEALED table */ |
| 39 | 39 | #define CONFIGSET_XFER 0x000080 /* Transfer configuration */ |
| 40 | 40 | #define CONFIGSET_ALIAS 0x000100 /* URL Aliases */ |
| 41 | -#define CONFIGSET_ALERT 0x000200 /* Email alerts */ | |
| 41 | +#define CONFIGSET_SCRIBERS 0x000200 /* Email subscribers */ | |
| 42 | 42 | #define CONFIGSET_FORUM 0x000400 /* Forum posts */ |
| 43 | 43 | |
| 44 | 44 | #define CONFIGSET_ALL 0x0007ff /* Everything */ |
| 45 | 45 | |
| 46 | 46 | #define CONFIGSET_OVERWRITE 0x100000 /* Causes overwrite instead of merge */ |
| @@ -70,12 +70,12 @@ | ||
| 70 | 70 | { "/shun", CONFIGSET_SHUN, "List of shunned artifacts" }, |
| 71 | 71 | { "/ticket", CONFIGSET_TKT, "Ticket setup", }, |
| 72 | 72 | { "/user", CONFIGSET_USER, "Users and privilege settings" }, |
| 73 | 73 | { "/xfer", CONFIGSET_XFER, "Transfer setup", }, |
| 74 | 74 | { "/alias", CONFIGSET_ALIAS, "URL Aliases", }, |
| 75 | - { "/alert", CONFIGSET_ALERT, "Notification sent by email", }, | |
| 76 | - { "/forum", CONFIGSET_FORUM, "Forum posts", }, | |
| 75 | + { "/subscribers", CONFIGSET_SCRIBERS,"Email notification subscriber list" }, | |
| 76 | +/* { "/forum", CONFIGSET_FORUM, "Forum posts", }, */ | |
| 77 | 77 | { "/all", CONFIGSET_ALL, "All of the above" }, |
| 78 | 78 | }; |
| 79 | 79 | |
| 80 | 80 | |
| 81 | 81 | /* |
| @@ -161,11 +161,11 @@ | ||
| 161 | 161 | |
| 162 | 162 | { "@shun", CONFIGSET_SHUN }, |
| 163 | 163 | |
| 164 | 164 | { "@alias", CONFIGSET_ALIAS }, |
| 165 | 165 | |
| 166 | - { "@subscriber", CONFIGSET_ALERT }, | |
| 166 | + { "@subscriber", CONFIGSET_SCRIBERS }, | |
| 167 | 167 | |
| 168 | 168 | { "xfer-common-script", CONFIGSET_XFER }, |
| 169 | 169 | { "xfer-push-script", CONFIGSET_XFER }, |
| 170 | 170 | { "xfer-commit-script", CONFIGSET_XFER }, |
| 171 | 171 | { "xfer-ticket-script", CONFIGSET_XFER }, |
| @@ -235,11 +235,11 @@ | ||
| 235 | 235 | } |
| 236 | 236 | for(i=0; i<count(aConfig); i++){ |
| 237 | 237 | if( strncmp(zName, aConfig[i].zName, n)==0 && aConfig[i].zName[n]==0 ){ |
| 238 | 238 | int m = aConfig[i].groupMask; |
| 239 | 239 | if( !g.perm.Admin ){ |
| 240 | - m &= ~(CONFIGSET_USER|CONFIGSET_ALERT); | |
| 240 | + m &= ~(CONFIGSET_USER|CONFIGSET_SCRIBERS); | |
| 241 | 241 | } |
| 242 | 242 | if( !g.perm.RdForum ){ |
| 243 | 243 | m &= ~(CONFIGSET_FORUM); |
| 244 | 244 | } |
| 245 | 245 | if( !g.perm.RdAddr ){ |
| @@ -324,11 +324,11 @@ | ||
| 324 | 324 | ** NEW FORMAT: |
| 325 | 325 | ** |
| 326 | 326 | ** zName is one of: |
| 327 | 327 | ** |
| 328 | 328 | ** "/config", "/user", "/shun", "/reportfmt", "/concealed", |
| 329 | -** "/alert", "/forum" | |
| 329 | +** "/subscriber", | |
| 330 | 330 | ** |
| 331 | 331 | ** zName indicates the table that holds the configuration information being |
| 332 | 332 | ** transferred. pContent is a string that consist of alternating Fossil |
| 333 | 333 | ** and SQL tokens. The First token is a timestamp in seconds since 1970. |
| 334 | 334 | ** The second token is a primary key for the table identified by zName. If |
| @@ -350,11 +350,11 @@ | ||
| 350 | 350 | ** /subscriber $SMTIME $SEMAIL suname $V ... |
| 351 | 351 | */ |
| 352 | 352 | void configure_receive(const char *zName, Blob *pContent, int groupMask){ |
| 353 | 353 | int checkMask; /* Masks for which we must first check existance of tables */ |
| 354 | 354 | |
| 355 | - checkMask = CONFIGSET_ALERT; | |
| 355 | + checkMask = CONFIGSET_SCRIBERS; | |
| 356 | 356 | if( zName[0]=='/' ){ |
| 357 | 357 | /* The new format */ |
| 358 | 358 | char *azToken[24]; |
| 359 | 359 | int nToken = 0; |
| 360 | 360 | int ii, jj; |
| @@ -403,11 +403,11 @@ | ||
| 403 | 403 | }else{ |
| 404 | 404 | thisMask = configure_is_exportable(aType[ii].zName); |
| 405 | 405 | } |
| 406 | 406 | if( (thisMask & groupMask)==0 ) return; |
| 407 | 407 | if( (thisMask & checkMask)!=0 ){ |
| 408 | - if( (thisMask & CONFIGSET_ALERT)!=0 ){ | |
| 408 | + if( (thisMask & CONFIGSET_SCRIBERS)!=0 ){ | |
| 409 | 409 | email_schema(1); |
| 410 | 410 | } |
| 411 | 411 | checkMask &= ~thisMask; |
| 412 | 412 | } |
| 413 | 413 | |
| @@ -585,11 +585,11 @@ | ||
| 585 | 585 | nCard++; |
| 586 | 586 | blob_reset(&rec); |
| 587 | 587 | } |
| 588 | 588 | db_finalize(&q); |
| 589 | 589 | } |
| 590 | - if( (groupMask & CONFIGSET_ALERT)!=0 | |
| 590 | + if( (groupMask & CONFIGSET_SCRIBERS)!=0 | |
| 591 | 591 | && db_table_exists("repository","subscriber") |
| 592 | 592 | ){ |
| 593 | 593 | db_prepare(&q, "SELECT mtime, quote(semail)," |
| 594 | 594 | " quote(suname), quote(sdigest)," |
| 595 | 595 | " quote(sdonotcall), quote(ssub)," |
| @@ -652,11 +652,12 @@ | ||
| 652 | 652 | } |
| 653 | 653 | } |
| 654 | 654 | if( notFoundIsFatal ){ |
| 655 | 655 | fossil_print("Available configuration areas:\n"); |
| 656 | 656 | for(i=0; i<count(aGroupName); i++){ |
| 657 | - fossil_print(" %-10s %s\n", &aGroupName[i].zName[1], aGroupName[i].zHelp); | |
| 657 | + fossil_print(" %-13s %s\n", | |
| 658 | + &aGroupName[i].zName[1], aGroupName[i].zHelp); | |
| 658 | 659 | } |
| 659 | 660 | fossil_fatal("no such configuration area: \"%s\"", z); |
| 660 | 661 | } |
| 661 | 662 | return 0; |
| 662 | 663 | } |
| 663 | 664 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -36,11 +36,11 @@ | |
| 36 | #define CONFIGSET_SHUN 0x000010 /* Shun settings */ |
| 37 | #define CONFIGSET_USER 0x000020 /* The USER table */ |
| 38 | #define CONFIGSET_ADDR 0x000040 /* The CONCEALED table */ |
| 39 | #define CONFIGSET_XFER 0x000080 /* Transfer configuration */ |
| 40 | #define CONFIGSET_ALIAS 0x000100 /* URL Aliases */ |
| 41 | #define CONFIGSET_ALERT 0x000200 /* Email alerts */ |
| 42 | #define CONFIGSET_FORUM 0x000400 /* Forum posts */ |
| 43 | |
| 44 | #define CONFIGSET_ALL 0x0007ff /* Everything */ |
| 45 | |
| 46 | #define CONFIGSET_OVERWRITE 0x100000 /* Causes overwrite instead of merge */ |
| @@ -70,12 +70,12 @@ | |
| 70 | { "/shun", CONFIGSET_SHUN, "List of shunned artifacts" }, |
| 71 | { "/ticket", CONFIGSET_TKT, "Ticket setup", }, |
| 72 | { "/user", CONFIGSET_USER, "Users and privilege settings" }, |
| 73 | { "/xfer", CONFIGSET_XFER, "Transfer setup", }, |
| 74 | { "/alias", CONFIGSET_ALIAS, "URL Aliases", }, |
| 75 | { "/alert", CONFIGSET_ALERT, "Notification sent by email", }, |
| 76 | { "/forum", CONFIGSET_FORUM, "Forum posts", }, |
| 77 | { "/all", CONFIGSET_ALL, "All of the above" }, |
| 78 | }; |
| 79 | |
| 80 | |
| 81 | /* |
| @@ -161,11 +161,11 @@ | |
| 161 | |
| 162 | { "@shun", CONFIGSET_SHUN }, |
| 163 | |
| 164 | { "@alias", CONFIGSET_ALIAS }, |
| 165 | |
| 166 | { "@subscriber", CONFIGSET_ALERT }, |
| 167 | |
| 168 | { "xfer-common-script", CONFIGSET_XFER }, |
| 169 | { "xfer-push-script", CONFIGSET_XFER }, |
| 170 | { "xfer-commit-script", CONFIGSET_XFER }, |
| 171 | { "xfer-ticket-script", CONFIGSET_XFER }, |
| @@ -235,11 +235,11 @@ | |
| 235 | } |
| 236 | for(i=0; i<count(aConfig); i++){ |
| 237 | if( strncmp(zName, aConfig[i].zName, n)==0 && aConfig[i].zName[n]==0 ){ |
| 238 | int m = aConfig[i].groupMask; |
| 239 | if( !g.perm.Admin ){ |
| 240 | m &= ~(CONFIGSET_USER|CONFIGSET_ALERT); |
| 241 | } |
| 242 | if( !g.perm.RdForum ){ |
| 243 | m &= ~(CONFIGSET_FORUM); |
| 244 | } |
| 245 | if( !g.perm.RdAddr ){ |
| @@ -324,11 +324,11 @@ | |
| 324 | ** NEW FORMAT: |
| 325 | ** |
| 326 | ** zName is one of: |
| 327 | ** |
| 328 | ** "/config", "/user", "/shun", "/reportfmt", "/concealed", |
| 329 | ** "/alert", "/forum" |
| 330 | ** |
| 331 | ** zName indicates the table that holds the configuration information being |
| 332 | ** transferred. pContent is a string that consist of alternating Fossil |
| 333 | ** and SQL tokens. The First token is a timestamp in seconds since 1970. |
| 334 | ** The second token is a primary key for the table identified by zName. If |
| @@ -350,11 +350,11 @@ | |
| 350 | ** /subscriber $SMTIME $SEMAIL suname $V ... |
| 351 | */ |
| 352 | void configure_receive(const char *zName, Blob *pContent, int groupMask){ |
| 353 | int checkMask; /* Masks for which we must first check existance of tables */ |
| 354 | |
| 355 | checkMask = CONFIGSET_ALERT; |
| 356 | if( zName[0]=='/' ){ |
| 357 | /* The new format */ |
| 358 | char *azToken[24]; |
| 359 | int nToken = 0; |
| 360 | int ii, jj; |
| @@ -403,11 +403,11 @@ | |
| 403 | }else{ |
| 404 | thisMask = configure_is_exportable(aType[ii].zName); |
| 405 | } |
| 406 | if( (thisMask & groupMask)==0 ) return; |
| 407 | if( (thisMask & checkMask)!=0 ){ |
| 408 | if( (thisMask & CONFIGSET_ALERT)!=0 ){ |
| 409 | email_schema(1); |
| 410 | } |
| 411 | checkMask &= ~thisMask; |
| 412 | } |
| 413 | |
| @@ -585,11 +585,11 @@ | |
| 585 | nCard++; |
| 586 | blob_reset(&rec); |
| 587 | } |
| 588 | db_finalize(&q); |
| 589 | } |
| 590 | if( (groupMask & CONFIGSET_ALERT)!=0 |
| 591 | && db_table_exists("repository","subscriber") |
| 592 | ){ |
| 593 | db_prepare(&q, "SELECT mtime, quote(semail)," |
| 594 | " quote(suname), quote(sdigest)," |
| 595 | " quote(sdonotcall), quote(ssub)," |
| @@ -652,11 +652,12 @@ | |
| 652 | } |
| 653 | } |
| 654 | if( notFoundIsFatal ){ |
| 655 | fossil_print("Available configuration areas:\n"); |
| 656 | for(i=0; i<count(aGroupName); i++){ |
| 657 | fossil_print(" %-10s %s\n", &aGroupName[i].zName[1], aGroupName[i].zHelp); |
| 658 | } |
| 659 | fossil_fatal("no such configuration area: \"%s\"", z); |
| 660 | } |
| 661 | return 0; |
| 662 | } |
| 663 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -36,11 +36,11 @@ | |
| 36 | #define CONFIGSET_SHUN 0x000010 /* Shun settings */ |
| 37 | #define CONFIGSET_USER 0x000020 /* The USER table */ |
| 38 | #define CONFIGSET_ADDR 0x000040 /* The CONCEALED table */ |
| 39 | #define CONFIGSET_XFER 0x000080 /* Transfer configuration */ |
| 40 | #define CONFIGSET_ALIAS 0x000100 /* URL Aliases */ |
| 41 | #define CONFIGSET_SCRIBERS 0x000200 /* Email subscribers */ |
| 42 | #define CONFIGSET_FORUM 0x000400 /* Forum posts */ |
| 43 | |
| 44 | #define CONFIGSET_ALL 0x0007ff /* Everything */ |
| 45 | |
| 46 | #define CONFIGSET_OVERWRITE 0x100000 /* Causes overwrite instead of merge */ |
| @@ -70,12 +70,12 @@ | |
| 70 | { "/shun", CONFIGSET_SHUN, "List of shunned artifacts" }, |
| 71 | { "/ticket", CONFIGSET_TKT, "Ticket setup", }, |
| 72 | { "/user", CONFIGSET_USER, "Users and privilege settings" }, |
| 73 | { "/xfer", CONFIGSET_XFER, "Transfer setup", }, |
| 74 | { "/alias", CONFIGSET_ALIAS, "URL Aliases", }, |
| 75 | { "/subscribers", CONFIGSET_SCRIBERS,"Email notification subscriber list" }, |
| 76 | /* { "/forum", CONFIGSET_FORUM, "Forum posts", }, */ |
| 77 | { "/all", CONFIGSET_ALL, "All of the above" }, |
| 78 | }; |
| 79 | |
| 80 | |
| 81 | /* |
| @@ -161,11 +161,11 @@ | |
| 161 | |
| 162 | { "@shun", CONFIGSET_SHUN }, |
| 163 | |
| 164 | { "@alias", CONFIGSET_ALIAS }, |
| 165 | |
| 166 | { "@subscriber", CONFIGSET_SCRIBERS }, |
| 167 | |
| 168 | { "xfer-common-script", CONFIGSET_XFER }, |
| 169 | { "xfer-push-script", CONFIGSET_XFER }, |
| 170 | { "xfer-commit-script", CONFIGSET_XFER }, |
| 171 | { "xfer-ticket-script", CONFIGSET_XFER }, |
| @@ -235,11 +235,11 @@ | |
| 235 | } |
| 236 | for(i=0; i<count(aConfig); i++){ |
| 237 | if( strncmp(zName, aConfig[i].zName, n)==0 && aConfig[i].zName[n]==0 ){ |
| 238 | int m = aConfig[i].groupMask; |
| 239 | if( !g.perm.Admin ){ |
| 240 | m &= ~(CONFIGSET_USER|CONFIGSET_SCRIBERS); |
| 241 | } |
| 242 | if( !g.perm.RdForum ){ |
| 243 | m &= ~(CONFIGSET_FORUM); |
| 244 | } |
| 245 | if( !g.perm.RdAddr ){ |
| @@ -324,11 +324,11 @@ | |
| 324 | ** NEW FORMAT: |
| 325 | ** |
| 326 | ** zName is one of: |
| 327 | ** |
| 328 | ** "/config", "/user", "/shun", "/reportfmt", "/concealed", |
| 329 | ** "/subscriber", |
| 330 | ** |
| 331 | ** zName indicates the table that holds the configuration information being |
| 332 | ** transferred. pContent is a string that consist of alternating Fossil |
| 333 | ** and SQL tokens. The First token is a timestamp in seconds since 1970. |
| 334 | ** The second token is a primary key for the table identified by zName. If |
| @@ -350,11 +350,11 @@ | |
| 350 | ** /subscriber $SMTIME $SEMAIL suname $V ... |
| 351 | */ |
| 352 | void configure_receive(const char *zName, Blob *pContent, int groupMask){ |
| 353 | int checkMask; /* Masks for which we must first check existance of tables */ |
| 354 | |
| 355 | checkMask = CONFIGSET_SCRIBERS; |
| 356 | if( zName[0]=='/' ){ |
| 357 | /* The new format */ |
| 358 | char *azToken[24]; |
| 359 | int nToken = 0; |
| 360 | int ii, jj; |
| @@ -403,11 +403,11 @@ | |
| 403 | }else{ |
| 404 | thisMask = configure_is_exportable(aType[ii].zName); |
| 405 | } |
| 406 | if( (thisMask & groupMask)==0 ) return; |
| 407 | if( (thisMask & checkMask)!=0 ){ |
| 408 | if( (thisMask & CONFIGSET_SCRIBERS)!=0 ){ |
| 409 | email_schema(1); |
| 410 | } |
| 411 | checkMask &= ~thisMask; |
| 412 | } |
| 413 | |
| @@ -585,11 +585,11 @@ | |
| 585 | nCard++; |
| 586 | blob_reset(&rec); |
| 587 | } |
| 588 | db_finalize(&q); |
| 589 | } |
| 590 | if( (groupMask & CONFIGSET_SCRIBERS)!=0 |
| 591 | && db_table_exists("repository","subscriber") |
| 592 | ){ |
| 593 | db_prepare(&q, "SELECT mtime, quote(semail)," |
| 594 | " quote(suname), quote(sdigest)," |
| 595 | " quote(sdonotcall), quote(ssub)," |
| @@ -652,11 +652,12 @@ | |
| 652 | } |
| 653 | } |
| 654 | if( notFoundIsFatal ){ |
| 655 | fossil_print("Available configuration areas:\n"); |
| 656 | for(i=0; i<count(aGroupName); i++){ |
| 657 | fossil_print(" %-13s %s\n", |
| 658 | &aGroupName[i].zName[1], aGroupName[i].zHelp); |
| 659 | } |
| 660 | fossil_fatal("no such configuration area: \"%s\"", z); |
| 661 | } |
| 662 | return 0; |
| 663 | } |
| 664 |
+1
-1
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -372,11 +372,11 @@ | ||
| 372 | 372 | "DROP TABLE IF EXISTS ticket;" |
| 373 | 373 | "DROP TABLE IF EXISTS ticketchng;" |
| 374 | 374 | ); |
| 375 | 375 | zSql = ticket_table_schema(); |
| 376 | 376 | if( separateConnection ){ |
| 377 | - db_end_transaction(0); | |
| 377 | + if( db_transaction_nesting_depth() ) db_end_transaction(0); | |
| 378 | 378 | db_init_database(g.zRepositoryName, zSql, 0); |
| 379 | 379 | }else{ |
| 380 | 380 | db_multi_exec("%s", zSql/*safe-for-%s*/); |
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | 383 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -372,11 +372,11 @@ | |
| 372 | "DROP TABLE IF EXISTS ticket;" |
| 373 | "DROP TABLE IF EXISTS ticketchng;" |
| 374 | ); |
| 375 | zSql = ticket_table_schema(); |
| 376 | if( separateConnection ){ |
| 377 | db_end_transaction(0); |
| 378 | db_init_database(g.zRepositoryName, zSql, 0); |
| 379 | }else{ |
| 380 | db_multi_exec("%s", zSql/*safe-for-%s*/); |
| 381 | } |
| 382 | } |
| 383 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -372,11 +372,11 @@ | |
| 372 | "DROP TABLE IF EXISTS ticket;" |
| 373 | "DROP TABLE IF EXISTS ticketchng;" |
| 374 | ); |
| 375 | zSql = ticket_table_schema(); |
| 376 | if( separateConnection ){ |
| 377 | if( db_transaction_nesting_depth() ) db_end_transaction(0); |
| 378 | db_init_database(g.zRepositoryName, zSql, 0); |
| 379 | }else{ |
| 380 | db_multi_exec("%s", zSql/*safe-for-%s*/); |
| 381 | } |
| 382 | } |
| 383 |