Fossil SCM

In the db_get(N,D) function, if N is setting, then always leave D as NULL so that we use the published default value for that setting.

drh 2019-09-19 14:14 trunk
Commit eb804dc6749a1f29b118a7ea3718e6b5d1e3b360a40edc266242dc598a9ad06a
+3 -3
--- src/alerts.c
+++ src/alerts.c
@@ -110,11 +110,11 @@
110110
** if the email-send-method is something other than "off".
111111
*/
112112
void alert_schema(int bOnlyIfEnabled){
113113
if( !alert_tables_exist() ){
114114
if( bOnlyIfEnabled
115
- && fossil_strcmp(db_get("email-send-method","off"),"off")==0
115
+ && fossil_strcmp(db_get("email-send-method",0),"off")==0
116116
){
117117
return; /* Don't create table for disabled email */
118118
}
119119
db_multi_exec(zAlertInit/*works-like:""*/);
120120
alert_triggers_enable();
@@ -158,11 +158,11 @@
158158
/*
159159
** Return true if email alerts are active.
160160
*/
161161
int alert_enabled(void){
162162
if( !alert_tables_exist() ) return 0;
163
- if( fossil_strcmp(db_get("email-send-method","off"),"off")==0 ) return 0;
163
+ if( fossil_strcmp(db_get("email-send-method",0),"off")==0 ) return 0;
164164
return 1;
165165
}
166166
167167
/*
168168
** If the subscriber table does not exist, then paint an error message
@@ -482,11 +482,11 @@
482482
blob_init(&p->out, 0, 0);
483483
p->mFlags = mFlags;
484484
if( zAltDest ){
485485
p->zDest = zAltDest;
486486
}else{
487
- p->zDest = db_get("email-send-method","off");
487
+ p->zDest = db_get("email-send-method",0);
488488
}
489489
if( fossil_strcmp(p->zDest,"off")==0 ) return p;
490490
if( emailerGetSetting(p, &p->zFrom, "email-self") ) return p;
491491
if( fossil_strcmp(p->zDest,"db")==0 ){
492492
char *zErr;
493493
--- src/alerts.c
+++ src/alerts.c
@@ -110,11 +110,11 @@
110 ** if the email-send-method is something other than "off".
111 */
112 void alert_schema(int bOnlyIfEnabled){
113 if( !alert_tables_exist() ){
114 if( bOnlyIfEnabled
115 && fossil_strcmp(db_get("email-send-method","off"),"off")==0
116 ){
117 return; /* Don't create table for disabled email */
118 }
119 db_multi_exec(zAlertInit/*works-like:""*/);
120 alert_triggers_enable();
@@ -158,11 +158,11 @@
158 /*
159 ** Return true if email alerts are active.
160 */
161 int alert_enabled(void){
162 if( !alert_tables_exist() ) return 0;
163 if( fossil_strcmp(db_get("email-send-method","off"),"off")==0 ) return 0;
164 return 1;
165 }
166
167 /*
168 ** If the subscriber table does not exist, then paint an error message
@@ -482,11 +482,11 @@
482 blob_init(&p->out, 0, 0);
483 p->mFlags = mFlags;
484 if( zAltDest ){
485 p->zDest = zAltDest;
486 }else{
487 p->zDest = db_get("email-send-method","off");
488 }
489 if( fossil_strcmp(p->zDest,"off")==0 ) return p;
490 if( emailerGetSetting(p, &p->zFrom, "email-self") ) return p;
491 if( fossil_strcmp(p->zDest,"db")==0 ){
492 char *zErr;
493
--- src/alerts.c
+++ src/alerts.c
@@ -110,11 +110,11 @@
110 ** if the email-send-method is something other than "off".
111 */
112 void alert_schema(int bOnlyIfEnabled){
113 if( !alert_tables_exist() ){
114 if( bOnlyIfEnabled
115 && fossil_strcmp(db_get("email-send-method",0),"off")==0
116 ){
117 return; /* Don't create table for disabled email */
118 }
119 db_multi_exec(zAlertInit/*works-like:""*/);
120 alert_triggers_enable();
@@ -158,11 +158,11 @@
158 /*
159 ** Return true if email alerts are active.
160 */
161 int alert_enabled(void){
162 if( !alert_tables_exist() ) return 0;
163 if( fossil_strcmp(db_get("email-send-method",0),"off")==0 ) return 0;
164 return 1;
165 }
166
167 /*
168 ** If the subscriber table does not exist, then paint an error message
@@ -482,11 +482,11 @@
482 blob_init(&p->out, 0, 0);
483 p->mFlags = mFlags;
484 if( zAltDest ){
485 p->zDest = zAltDest;
486 }else{
487 p->zDest = db_get("email-send-method",0);
488 }
489 if( fossil_strcmp(p->zDest,"off")==0 ) return p;
490 if( emailerGetSetting(p, &p->zFrom, "email-self") ) return p;
491 if( fossil_strcmp(p->zDest,"db")==0 ){
492 char *zErr;
493
+1 -1
--- src/branch.c
+++ src/branch.c
@@ -40,11 +40,11 @@
4040
zBr = fossil_strdup(db_column_text(&q,0));
4141
}
4242
db_reset(&q);
4343
if( zBr==0 ){
4444
static char *zMain = 0;
45
- if( zMain==0 ) zMain = db_get("main-branch","trunk");
45
+ if( zMain==0 ) zMain = db_get("main-branch",0);
4646
zBr = fossil_strdup(zMain);
4747
}
4848
return zBr;
4949
}
5050
5151
--- src/branch.c
+++ src/branch.c
@@ -40,11 +40,11 @@
40 zBr = fossil_strdup(db_column_text(&q,0));
41 }
42 db_reset(&q);
43 if( zBr==0 ){
44 static char *zMain = 0;
45 if( zMain==0 ) zMain = db_get("main-branch","trunk");
46 zBr = fossil_strdup(zMain);
47 }
48 return zBr;
49 }
50
51
--- src/branch.c
+++ src/branch.c
@@ -40,11 +40,11 @@
40 zBr = fossil_strdup(db_column_text(&q,0));
41 }
42 db_reset(&q);
43 if( zBr==0 ){
44 static char *zMain = 0;
45 if( zMain==0 ) zMain = db_get("main-branch",0);
46 zBr = fossil_strdup(zMain);
47 }
48 return zBr;
49 }
50
51
+1 -1
--- src/checkin.c
+++ src/checkin.c
@@ -2130,11 +2130,11 @@
21302130
/* Get the ID of the parent manifest artifact */
21312131
vid = db_lget_int("checkout", 0);
21322132
if( vid==0 ){
21332133
useCksum = 1;
21342134
if( sCiInfo.zBranch==0 ) {
2135
- sCiInfo.zBranch=db_get("main-branch", "trunk");
2135
+ sCiInfo.zBranch=db_get("main-branch", 0);
21362136
}
21372137
}else if( content_is_private(vid) ){
21382138
g.markPrivate = 1;
21392139
}
21402140
21412141
--- src/checkin.c
+++ src/checkin.c
@@ -2130,11 +2130,11 @@
2130 /* Get the ID of the parent manifest artifact */
2131 vid = db_lget_int("checkout", 0);
2132 if( vid==0 ){
2133 useCksum = 1;
2134 if( sCiInfo.zBranch==0 ) {
2135 sCiInfo.zBranch=db_get("main-branch", "trunk");
2136 }
2137 }else if( content_is_private(vid) ){
2138 g.markPrivate = 1;
2139 }
2140
2141
--- src/checkin.c
+++ src/checkin.c
@@ -2130,11 +2130,11 @@
2130 /* Get the ID of the parent manifest artifact */
2131 vid = db_lget_int("checkout", 0);
2132 if( vid==0 ){
2133 useCksum = 1;
2134 if( sCiInfo.zBranch==0 ) {
2135 sCiInfo.zBranch=db_get("main-branch", 0);
2136 }
2137 }else if( content_is_private(vid) ){
2138 g.markPrivate = 1;
2139 }
2140
2141
+1 -1
--- src/db.c
+++ src/db.c
@@ -2950,11 +2950,11 @@
29502950
/* Figure out which revision to open. */
29512951
if( !emptyFlag ){
29522952
if( g.argc==4 ){
29532953
g.zOpenRevision = g.argv[3];
29542954
}else if( db_exists("SELECT 1 FROM event WHERE type='ci'") ){
2955
- g.zOpenRevision = db_get("main-branch", "trunk");
2955
+ g.zOpenRevision = db_get("main-branch", 0);
29562956
}
29572957
}
29582958
29592959
if( g.zOpenRevision ){
29602960
/* Since the repository is open and we know the revision now,
29612961
--- src/db.c
+++ src/db.c
@@ -2950,11 +2950,11 @@
2950 /* Figure out which revision to open. */
2951 if( !emptyFlag ){
2952 if( g.argc==4 ){
2953 g.zOpenRevision = g.argv[3];
2954 }else if( db_exists("SELECT 1 FROM event WHERE type='ci'") ){
2955 g.zOpenRevision = db_get("main-branch", "trunk");
2956 }
2957 }
2958
2959 if( g.zOpenRevision ){
2960 /* Since the repository is open and we know the revision now,
2961
--- src/db.c
+++ src/db.c
@@ -2950,11 +2950,11 @@
2950 /* Figure out which revision to open. */
2951 if( !emptyFlag ){
2952 if( g.argc==4 ){
2953 g.zOpenRevision = g.argv[3];
2954 }else if( db_exists("SELECT 1 FROM event WHERE type='ci'") ){
2955 g.zOpenRevision = db_get("main-branch", 0);
2956 }
2957 }
2958
2959 if( g.zOpenRevision ){
2960 /* Since the repository is open and we know the revision now,
2961
+1 -1
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -707,11 +707,11 @@
707707
find_option("side-by-side","y",0);
708708
find_option("internal","i",0);
709709
find_option("verbose","v",0);
710710
zTclsh = find_option("tclsh",0,1);
711711
if( zTclsh==0 ){
712
- zTclsh = db_get("tclsh","tclsh");
712
+ zTclsh = db_get("tclsh",0);
713713
}
714714
/* The undocumented --script FILENAME option causes the Tk script to
715715
** be written into the FILENAME instead of being run. This is used
716716
** for testing and debugging. */
717717
zTempFile = find_option("script",0,1);
718718
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -707,11 +707,11 @@
707 find_option("side-by-side","y",0);
708 find_option("internal","i",0);
709 find_option("verbose","v",0);
710 zTclsh = find_option("tclsh",0,1);
711 if( zTclsh==0 ){
712 zTclsh = db_get("tclsh","tclsh");
713 }
714 /* The undocumented --script FILENAME option causes the Tk script to
715 ** be written into the FILENAME instead of being run. This is used
716 ** for testing and debugging. */
717 zTempFile = find_option("script",0,1);
718
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -707,11 +707,11 @@
707 find_option("side-by-side","y",0);
708 find_option("internal","i",0);
709 find_option("verbose","v",0);
710 zTclsh = find_option("tclsh",0,1);
711 if( zTclsh==0 ){
712 zTclsh = db_get("tclsh",0);
713 }
714 /* The undocumented --script FILENAME option causes the Tk script to
715 ** be written into the FILENAME instead of being run. This is used
716 ** for testing and debugging. */
717 zTempFile = find_option("script",0,1);
718
+2 -2
--- src/info.c
+++ src/info.c
@@ -884,11 +884,11 @@
884884
}
885885
886886
if( g.perm.Hyperlink ){
887887
@ <tr><th>Other&nbsp;Links:</th>
888888
@ <td>
889
- if( fossil_strcmp(zBrName, db_get("main-branch","trunk"))!=0 ){
889
+ if( fossil_strcmp(zBrName, db_get("main-branch",0))!=0 ){
890890
@ %z(href("%R/vdiff?branch=%!S", zUuid))branch diff</a> |
891891
}
892892
@ %z(href("%R/artifact/%!S",zUuid))manifest</a>
893893
@ | %z(href("%R/ci_tags/%!S",zUuid))tags</a>
894894
if( g.perm.Admin ){
@@ -3008,11 +3008,11 @@
30083008
}
30093009
db_finalize(&q);
30103010
@ </td></tr>
30113011
30123012
if( !zBranchName ){
3013
- zBranchName = db_get("main-branch", "trunk");
3013
+ zBranchName = db_get("main-branch", 0);
30143014
}
30153015
if( !zNewBranch || !zNewBranch[0]){
30163016
zNewBranch = zBranchName;
30173017
}
30183018
@ <tr><th align="right" valign="top">Branching:</th>
30193019
--- src/info.c
+++ src/info.c
@@ -884,11 +884,11 @@
884 }
885
886 if( g.perm.Hyperlink ){
887 @ <tr><th>Other&nbsp;Links:</th>
888 @ <td>
889 if( fossil_strcmp(zBrName, db_get("main-branch","trunk"))!=0 ){
890 @ %z(href("%R/vdiff?branch=%!S", zUuid))branch diff</a> |
891 }
892 @ %z(href("%R/artifact/%!S",zUuid))manifest</a>
893 @ | %z(href("%R/ci_tags/%!S",zUuid))tags</a>
894 if( g.perm.Admin ){
@@ -3008,11 +3008,11 @@
3008 }
3009 db_finalize(&q);
3010 @ </td></tr>
3011
3012 if( !zBranchName ){
3013 zBranchName = db_get("main-branch", "trunk");
3014 }
3015 if( !zNewBranch || !zNewBranch[0]){
3016 zNewBranch = zBranchName;
3017 }
3018 @ <tr><th align="right" valign="top">Branching:</th>
3019
--- src/info.c
+++ src/info.c
@@ -884,11 +884,11 @@
884 }
885
886 if( g.perm.Hyperlink ){
887 @ <tr><th>Other&nbsp;Links:</th>
888 @ <td>
889 if( fossil_strcmp(zBrName, db_get("main-branch",0))!=0 ){
890 @ %z(href("%R/vdiff?branch=%!S", zUuid))branch diff</a> |
891 }
892 @ %z(href("%R/artifact/%!S",zUuid))manifest</a>
893 @ | %z(href("%R/ci_tags/%!S",zUuid))tags</a>
894 if( g.perm.Admin ){
@@ -3008,11 +3008,11 @@
3008 }
3009 db_finalize(&q);
3010 @ </td></tr>
3011
3012 if( !zBranchName ){
3013 zBranchName = db_get("main-branch", 0);
3014 }
3015 if( !zNewBranch || !zNewBranch[0]){
3016 zNewBranch = zBranchName;
3017 }
3018 @ <tr><th align="right" valign="top">Branching:</th>
3019
+1 -1
--- src/loadctrl.c
+++ src/loadctrl.c
@@ -49,11 +49,11 @@
4949
/*
5050
** Abort the current operation of the load average of the host computer
5151
** is too high.
5252
*/
5353
void load_control(void){
54
- double mxLoad = atof(db_get("max-loadavg", "0"));
54
+ double mxLoad = atof(db_get("max-loadavg", 0));
5555
if( mxLoad<=0.0 || mxLoad>=load_average() ) return;
5656
5757
style_header("Server Overload");
5858
@ <h2>The server load is currently too high.
5959
@ Please try again later.</h2>
6060
--- src/loadctrl.c
+++ src/loadctrl.c
@@ -49,11 +49,11 @@
49 /*
50 ** Abort the current operation of the load average of the host computer
51 ** is too high.
52 */
53 void load_control(void){
54 double mxLoad = atof(db_get("max-loadavg", "0"));
55 if( mxLoad<=0.0 || mxLoad>=load_average() ) return;
56
57 style_header("Server Overload");
58 @ <h2>The server load is currently too high.
59 @ Please try again later.</h2>
60
--- src/loadctrl.c
+++ src/loadctrl.c
@@ -49,11 +49,11 @@
49 /*
50 ** Abort the current operation of the load average of the host computer
51 ** is too high.
52 */
53 void load_control(void){
54 double mxLoad = atof(db_get("max-loadavg", 0));
55 if( mxLoad<=0.0 || mxLoad>=load_average() ) return;
56
57 style_header("Server Overload");
58 @ <h2>The server load is currently too high.
59 @ Please try again later.</h2>
60
+3 -3
--- src/login.c
+++ src/login.c
@@ -514,11 +514,11 @@
514514
int login_self_register_available(const char *zNeeded){
515515
CapabilityString *pCap;
516516
int rc;
517517
if( !db_get_boolean("self-register",0) ) return 0;
518518
if( zNeeded==0 ) return 1;
519
- pCap = capability_add(0, db_get("default-perms",""));
519
+ pCap = capability_add(0, db_get("default-perms", 0));
520520
capability_expand(pCap);
521521
rc = capability_has_any(pCap, zNeeded);
522522
capability_free(pCap);
523523
return rc;
524524
}
@@ -1162,11 +1162,11 @@
11621162
if( zPublicPages!=0 ){
11631163
Glob *pGlob = glob_create(zPublicPages);
11641164
const char *zUri = PD("REQUEST_URI","");
11651165
zUri += (int)strlen(g.zTop);
11661166
if( glob_match(pGlob, zUri) ){
1167
- login_set_capabilities(db_get("default-perms","u"), 0);
1167
+ login_set_capabilities(db_get("default-perms", 0), 0);
11681168
}
11691169
glob_free(pGlob);
11701170
}
11711171
}
11721172
@@ -1504,11 +1504,11 @@
15041504
@ <p>This project does not allow user self-registration. Please contact the
15051505
@ project administrator to obtain an account.</p>
15061506
style_footer();
15071507
return;
15081508
}
1509
- zPerms = db_get("default-perms","u");
1509
+ zPerms = db_get("default-perms", 0);
15101510
15111511
/* Prompt the user for email alerts if this repository is configured for
15121512
** email alerts and if the default permissions include "7" */
15131513
canDoAlerts = alert_tables_exist() && db_int(0,
15141514
"SELECT fullcap(%Q) GLOB '*7*'", zPerms
15151515
--- src/login.c
+++ src/login.c
@@ -514,11 +514,11 @@
514 int login_self_register_available(const char *zNeeded){
515 CapabilityString *pCap;
516 int rc;
517 if( !db_get_boolean("self-register",0) ) return 0;
518 if( zNeeded==0 ) return 1;
519 pCap = capability_add(0, db_get("default-perms",""));
520 capability_expand(pCap);
521 rc = capability_has_any(pCap, zNeeded);
522 capability_free(pCap);
523 return rc;
524 }
@@ -1162,11 +1162,11 @@
1162 if( zPublicPages!=0 ){
1163 Glob *pGlob = glob_create(zPublicPages);
1164 const char *zUri = PD("REQUEST_URI","");
1165 zUri += (int)strlen(g.zTop);
1166 if( glob_match(pGlob, zUri) ){
1167 login_set_capabilities(db_get("default-perms","u"), 0);
1168 }
1169 glob_free(pGlob);
1170 }
1171 }
1172
@@ -1504,11 +1504,11 @@
1504 @ <p>This project does not allow user self-registration. Please contact the
1505 @ project administrator to obtain an account.</p>
1506 style_footer();
1507 return;
1508 }
1509 zPerms = db_get("default-perms","u");
1510
1511 /* Prompt the user for email alerts if this repository is configured for
1512 ** email alerts and if the default permissions include "7" */
1513 canDoAlerts = alert_tables_exist() && db_int(0,
1514 "SELECT fullcap(%Q) GLOB '*7*'", zPerms
1515
--- src/login.c
+++ src/login.c
@@ -514,11 +514,11 @@
514 int login_self_register_available(const char *zNeeded){
515 CapabilityString *pCap;
516 int rc;
517 if( !db_get_boolean("self-register",0) ) return 0;
518 if( zNeeded==0 ) return 1;
519 pCap = capability_add(0, db_get("default-perms", 0));
520 capability_expand(pCap);
521 rc = capability_has_any(pCap, zNeeded);
522 capability_free(pCap);
523 return rc;
524 }
@@ -1162,11 +1162,11 @@
1162 if( zPublicPages!=0 ){
1163 Glob *pGlob = glob_create(zPublicPages);
1164 const char *zUri = PD("REQUEST_URI","");
1165 zUri += (int)strlen(g.zTop);
1166 if( glob_match(pGlob, zUri) ){
1167 login_set_capabilities(db_get("default-perms", 0), 0);
1168 }
1169 glob_free(pGlob);
1170 }
1171 }
1172
@@ -1504,11 +1504,11 @@
1504 @ <p>This project does not allow user self-registration. Please contact the
1505 @ project administrator to obtain an account.</p>
1506 style_footer();
1507 return;
1508 }
1509 zPerms = db_get("default-perms", 0);
1510
1511 /* Prompt the user for email alerts if this repository is configured for
1512 ** email alerts and if the default permissions include "7" */
1513 canDoAlerts = alert_tables_exist() && db_int(0,
1514 "SELECT fullcap(%Q) GLOB '*7*'", zPerms
1515
--- src/security_audit.c
+++ src/security_audit.c
@@ -128,11 +128,11 @@
128128
*/
129129
zAnonCap = db_text("", "SELECT fullcap(NULL)");
130130
zPubPages = db_get("public-pages",0);
131131
if( db_get_boolean("self-register",0) ){
132132
CapabilityString *pCap;
133
- pCap = capability_add(0, db_get("default-perms",""));
133
+ pCap = capability_add(0, db_get("default-perms",0));
134134
capability_expand(pCap);
135135
zSelfCap = capability_string(pCap);
136136
capability_free(pCap);
137137
}else{
138138
zSelfCap = fossil_strdup("");
@@ -440,11 +440,11 @@
440440
@ from throttling expensive operations during peak demand.
441441
@ <p>If running in a chroot jail on Linux, verify that the /proc
442442
@ filesystem is mounted within the jail, so that the load average
443443
@ can be obtained from the /proc/loadavg file.
444444
}else {
445
- double r = atof(db_get("max-loadavg", "0"));
445
+ double r = atof(db_get("max-loadavg", 0));
446446
if( r<=0.0 ){
447447
@ <li><p>
448448
@ Load average limiting is turned off. This can cause the server
449449
@ to bog down if many requests for expensive services (such as
450450
@ large diffs or tarballs) arrive at about the same time.
451451
--- src/security_audit.c
+++ src/security_audit.c
@@ -128,11 +128,11 @@
128 */
129 zAnonCap = db_text("", "SELECT fullcap(NULL)");
130 zPubPages = db_get("public-pages",0);
131 if( db_get_boolean("self-register",0) ){
132 CapabilityString *pCap;
133 pCap = capability_add(0, db_get("default-perms",""));
134 capability_expand(pCap);
135 zSelfCap = capability_string(pCap);
136 capability_free(pCap);
137 }else{
138 zSelfCap = fossil_strdup("");
@@ -440,11 +440,11 @@
440 @ from throttling expensive operations during peak demand.
441 @ <p>If running in a chroot jail on Linux, verify that the /proc
442 @ filesystem is mounted within the jail, so that the load average
443 @ can be obtained from the /proc/loadavg file.
444 }else {
445 double r = atof(db_get("max-loadavg", "0"));
446 if( r<=0.0 ){
447 @ <li><p>
448 @ Load average limiting is turned off. This can cause the server
449 @ to bog down if many requests for expensive services (such as
450 @ large diffs or tarballs) arrive at about the same time.
451
--- src/security_audit.c
+++ src/security_audit.c
@@ -128,11 +128,11 @@
128 */
129 zAnonCap = db_text("", "SELECT fullcap(NULL)");
130 zPubPages = db_get("public-pages",0);
131 if( db_get_boolean("self-register",0) ){
132 CapabilityString *pCap;
133 pCap = capability_add(0, db_get("default-perms",0));
134 capability_expand(pCap);
135 zSelfCap = capability_string(pCap);
136 capability_free(pCap);
137 }else{
138 zSelfCap = fossil_strdup("");
@@ -440,11 +440,11 @@
440 @ from throttling expensive operations during peak demand.
441 @ <p>If running in a chroot jail on Linux, verify that the /proc
442 @ filesystem is mounted within the jail, so that the load average
443 @ can be obtained from the /proc/loadavg file.
444 }else {
445 double r = atof(db_get("max-loadavg", 0));
446 if( r<=0.0 ){
447 @ <li><p>
448 @ Load average limiting is turned off. This can cause the server
449 @ to bog down if many requests for expensive services (such as
450 @ large diffs or tarballs) arrive at about the same time.
451
+2 -1
--- src/sync.c
+++ src/sync.c
@@ -45,11 +45,12 @@
4545
int rc;
4646
int configSync = 0; /* configuration changes transferred */
4747
if( g.fNoSync ){
4848
return 0;
4949
}
50
- zAutosync = db_get("autosync", "on");
50
+ zAutosync = db_get("autosync", 0);
51
+ if( zAutosync==0 ) zAutosync = "on"; /* defend against misconfig */
5152
if( is_false(zAutosync) ) return 0;
5253
if( db_get_boolean("dont-push",0) || fossil_strncmp(zAutosync,"pull",4)==0 ){
5354
flags &= ~SYNC_CKIN_LOCK;
5455
if( flags & SYNC_PUSH ) return 0;
5556
}
5657
--- src/sync.c
+++ src/sync.c
@@ -45,11 +45,12 @@
45 int rc;
46 int configSync = 0; /* configuration changes transferred */
47 if( g.fNoSync ){
48 return 0;
49 }
50 zAutosync = db_get("autosync", "on");
 
51 if( is_false(zAutosync) ) return 0;
52 if( db_get_boolean("dont-push",0) || fossil_strncmp(zAutosync,"pull",4)==0 ){
53 flags &= ~SYNC_CKIN_LOCK;
54 if( flags & SYNC_PUSH ) return 0;
55 }
56
--- src/sync.c
+++ src/sync.c
@@ -45,11 +45,12 @@
45 int rc;
46 int configSync = 0; /* configuration changes transferred */
47 if( g.fNoSync ){
48 return 0;
49 }
50 zAutosync = db_get("autosync", 0);
51 if( zAutosync==0 ) zAutosync = "on"; /* defend against misconfig */
52 if( is_false(zAutosync) ) return 0;
53 if( db_get_boolean("dont-push",0) || fossil_strncmp(zAutosync,"pull",4)==0 ){
54 flags &= ~SYNC_CKIN_LOCK;
55 if( flags & SYNC_PUSH ) return 0;
56 }
57
+1 -1
--- src/update.c
+++ src/update.c
@@ -677,11 +677,11 @@
677677
678678
/* Determine the check-in manifest artifact ID. Panic on failure. */
679679
if( zRevision ){
680680
vid = name_to_typed_rid(zRevision, "ci");
681681
}else if( !g.localOpen ){
682
- vid = name_to_typed_rid(db_get("main-branch", "trunk"), "ci");
682
+ vid = name_to_typed_rid(db_get("main-branch", 0), "ci");
683683
}else{
684684
vid = db_lget_int("checkout", 0);
685685
if( !is_a_version(vid) ){
686686
zRevision = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
687687
if( zRevision ){
688688
--- src/update.c
+++ src/update.c
@@ -677,11 +677,11 @@
677
678 /* Determine the check-in manifest artifact ID. Panic on failure. */
679 if( zRevision ){
680 vid = name_to_typed_rid(zRevision, "ci");
681 }else if( !g.localOpen ){
682 vid = name_to_typed_rid(db_get("main-branch", "trunk"), "ci");
683 }else{
684 vid = db_lget_int("checkout", 0);
685 if( !is_a_version(vid) ){
686 zRevision = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
687 if( zRevision ){
688
--- src/update.c
+++ src/update.c
@@ -677,11 +677,11 @@
677
678 /* Determine the check-in manifest artifact ID. Panic on failure. */
679 if( zRevision ){
680 vid = name_to_typed_rid(zRevision, "ci");
681 }else if( !g.localOpen ){
682 vid = name_to_typed_rid(db_get("main-branch", 0), "ci");
683 }else{
684 vid = db_lget_int("checkout", 0);
685 if( !is_a_version(vid) ){
686 zRevision = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
687 if( zRevision ){
688
+1 -1
--- src/user.c
+++ src/user.c
@@ -365,11 +365,11 @@
365365
}
366366
n = strlen(g.argv[2]);
367367
if( n>=2 && strncmp(g.argv[2],"new",n)==0 ){
368368
Blob passwd, login, caps, contact;
369369
char *zPw;
370
- blob_init(&caps, db_get("default-perms", "u"), -1);
370
+ blob_init(&caps, db_get("default-perms", 0), -1);
371371
372372
if( g.argc>=4 ){
373373
blob_init(&login, g.argv[3], -1);
374374
}else{
375375
prompt_user("login: ", &login);
376376
--- src/user.c
+++ src/user.c
@@ -365,11 +365,11 @@
365 }
366 n = strlen(g.argv[2]);
367 if( n>=2 && strncmp(g.argv[2],"new",n)==0 ){
368 Blob passwd, login, caps, contact;
369 char *zPw;
370 blob_init(&caps, db_get("default-perms", "u"), -1);
371
372 if( g.argc>=4 ){
373 blob_init(&login, g.argv[3], -1);
374 }else{
375 prompt_user("login: ", &login);
376
--- src/user.c
+++ src/user.c
@@ -365,11 +365,11 @@
365 }
366 n = strlen(g.argv[2]);
367 if( n>=2 && strncmp(g.argv[2],"new",n)==0 ){
368 Blob passwd, login, caps, contact;
369 char *zPw;
370 blob_init(&caps, db_get("default-perms", 0), -1);
371
372 if( g.argc>=4 ){
373 blob_init(&login, g.argv[3], -1);
374 }else{
375 prompt_user("login: ", &login);
376

Keyboard Shortcuts

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