Fossil SCM

Add http authorisation to UPDATE command

danshearer 2026-11-03 01:35 UTC trunk
Commit 4e4ae18fc5d87f2e7842757f13e0a20c83f4d1cfc6bafc7bc498b77766c8b9c2
2 files changed +1 -1 +5
+1 -1
--- src/sync.c
+++ src/sync.c
@@ -186,11 +186,11 @@
186186
if( g.url.user!=0 && g.url.passwd==0 ){
187187
g.url.passwd = unobscure(db_get("last-sync-pw", 0));
188188
g.url.flags |= URL_PROMPT_PW;
189189
url_prompt_for_password();
190190
}
191
- g.zHttpAuth = get_httpauth();
191
+ if( g.zHttpAuth==0 ) g.zHttpAuth = get_httpauth();
192192
if( sqlite3_strglob("*all*", zAutosync)==0 ){
193193
rc = client_sync_all_urls(flags|SYNC_ALLURL, configSync, 0, 0);
194194
}else{
195195
url_remember();
196196
sync_explain(flags);
197197
--- src/sync.c
+++ src/sync.c
@@ -186,11 +186,11 @@
186 if( g.url.user!=0 && g.url.passwd==0 ){
187 g.url.passwd = unobscure(db_get("last-sync-pw", 0));
188 g.url.flags |= URL_PROMPT_PW;
189 url_prompt_for_password();
190 }
191 g.zHttpAuth = get_httpauth();
192 if( sqlite3_strglob("*all*", zAutosync)==0 ){
193 rc = client_sync_all_urls(flags|SYNC_ALLURL, configSync, 0, 0);
194 }else{
195 url_remember();
196 sync_explain(flags);
197
--- src/sync.c
+++ src/sync.c
@@ -186,11 +186,11 @@
186 if( g.url.user!=0 && g.url.passwd==0 ){
187 g.url.passwd = unobscure(db_get("last-sync-pw", 0));
188 g.url.flags |= URL_PROMPT_PW;
189 url_prompt_for_password();
190 }
191 if( g.zHttpAuth==0 ) g.zHttpAuth = get_httpauth();
192 if( sqlite3_strglob("*all*", zAutosync)==0 ){
193 rc = client_sync_all_urls(flags|SYNC_ALLURL, configSync, 0, 0);
194 }else{
195 url_remember();
196 sync_explain(flags);
197
--- src/update.c
+++ src/update.c
@@ -91,10 +91,12 @@
9191
**
9292
** The -v or --verbose option prints status information about
9393
** unchanged files in addition to those files that actually do change.
9494
**
9595
** Options:
96
+** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol,
97
+** if required by the remote site
9698
** --case-sensitive BOOL Override case-sensitive setting
9799
** --debug Print debug information on stdout
98100
** -n|--dry-run If given, display instead of run actions
99101
** --force-missing Force update if missing content after sync
100102
** -K|--keep-merge-files On merge conflict, retain the temporary files
@@ -133,10 +135,11 @@
133135
int nUpdate = 0; /* Number of changes of any kind */
134136
int bNosync = 0; /* --nosync. Omit the auto-sync */
135137
int width; /* Width of printed comment lines */
136138
Stmt mtimeXfer; /* Statement to transfer mtimes */
137139
const char *zWidth; /* Width option string value */
140
+ const char *zHttpAuth; /* --httpauth USER:PASS for the autosync */
138141
const char *zCurBrName; /* Current branch name */
139142
const char *zNewBrName; /* New branch name */
140143
const char *zBrChgMsg = ""; /* Message to display if branch changes */
141144
142145
if( !internalUpdate ){
@@ -161,10 +164,12 @@
161164
forceMissingFlag = find_option("force-missing",0,0)!=0;
162165
debugFlag = find_option("debug",0,0)!=0;
163166
setmtimeFlag = find_option("setmtime",0,0)!=0;
164167
keepMergeFlag = find_option("keep-merge-files", "K",0)!=0;
165168
bNosync = find_option("nosync",0,0)!=0;
169
+ zHttpAuth = find_option("httpauth","B",1);
170
+ if( zHttpAuth && zHttpAuth[0] ) g.zHttpAuth = fossil_strdup(zHttpAuth);
166171
167172
/* We should be done with options.. */
168173
verify_all_options();
169174
170175
db_must_be_within_tree();
171176
--- src/update.c
+++ src/update.c
@@ -91,10 +91,12 @@
91 **
92 ** The -v or --verbose option prints status information about
93 ** unchanged files in addition to those files that actually do change.
94 **
95 ** Options:
 
 
96 ** --case-sensitive BOOL Override case-sensitive setting
97 ** --debug Print debug information on stdout
98 ** -n|--dry-run If given, display instead of run actions
99 ** --force-missing Force update if missing content after sync
100 ** -K|--keep-merge-files On merge conflict, retain the temporary files
@@ -133,10 +135,11 @@
133 int nUpdate = 0; /* Number of changes of any kind */
134 int bNosync = 0; /* --nosync. Omit the auto-sync */
135 int width; /* Width of printed comment lines */
136 Stmt mtimeXfer; /* Statement to transfer mtimes */
137 const char *zWidth; /* Width option string value */
 
138 const char *zCurBrName; /* Current branch name */
139 const char *zNewBrName; /* New branch name */
140 const char *zBrChgMsg = ""; /* Message to display if branch changes */
141
142 if( !internalUpdate ){
@@ -161,10 +164,12 @@
161 forceMissingFlag = find_option("force-missing",0,0)!=0;
162 debugFlag = find_option("debug",0,0)!=0;
163 setmtimeFlag = find_option("setmtime",0,0)!=0;
164 keepMergeFlag = find_option("keep-merge-files", "K",0)!=0;
165 bNosync = find_option("nosync",0,0)!=0;
 
 
166
167 /* We should be done with options.. */
168 verify_all_options();
169
170 db_must_be_within_tree();
171
--- src/update.c
+++ src/update.c
@@ -91,10 +91,12 @@
91 **
92 ** The -v or --verbose option prints status information about
93 ** unchanged files in addition to those files that actually do change.
94 **
95 ** Options:
96 ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol,
97 ** if required by the remote site
98 ** --case-sensitive BOOL Override case-sensitive setting
99 ** --debug Print debug information on stdout
100 ** -n|--dry-run If given, display instead of run actions
101 ** --force-missing Force update if missing content after sync
102 ** -K|--keep-merge-files On merge conflict, retain the temporary files
@@ -133,10 +135,11 @@
135 int nUpdate = 0; /* Number of changes of any kind */
136 int bNosync = 0; /* --nosync. Omit the auto-sync */
137 int width; /* Width of printed comment lines */
138 Stmt mtimeXfer; /* Statement to transfer mtimes */
139 const char *zWidth; /* Width option string value */
140 const char *zHttpAuth; /* --httpauth USER:PASS for the autosync */
141 const char *zCurBrName; /* Current branch name */
142 const char *zNewBrName; /* New branch name */
143 const char *zBrChgMsg = ""; /* Message to display if branch changes */
144
145 if( !internalUpdate ){
@@ -161,10 +164,12 @@
164 forceMissingFlag = find_option("force-missing",0,0)!=0;
165 debugFlag = find_option("debug",0,0)!=0;
166 setmtimeFlag = find_option("setmtime",0,0)!=0;
167 keepMergeFlag = find_option("keep-merge-files", "K",0)!=0;
168 bNosync = find_option("nosync",0,0)!=0;
169 zHttpAuth = find_option("httpauth","B",1);
170 if( zHttpAuth && zHttpAuth[0] ) g.zHttpAuth = fossil_strdup(zHttpAuth);
171
172 /* We should be done with options.. */
173 verify_all_options();
174
175 db_must_be_within_tree();
176

Keyboard Shortcuts

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