Fossil SCM

Merge the ben-testing branch into trunk.

drh 2011-08-14 23:14 trunk merge
Commit 9a0c99582611bf1af626f4971c8f37d744fd56dd
+92 -15
--- src/checkin.c
+++ src/checkin.c
@@ -32,60 +32,72 @@
3232
** are not true files results in a fatal error.
3333
*/
3434
static void status_report(
3535
Blob *report, /* Append the status report here */
3636
const char *zPrefix, /* Prefix on each line of the report */
37
- int missingIsFatal /* MISSING and NOT_A_FILE are fatal errors */
37
+ int missingIsFatal, /* MISSING and NOT_A_FILE are fatal errors */
38
+ int cwdRelative /* Report relative to the current working dir */
3839
){
3940
Stmt q;
4041
int nPrefix = strlen(zPrefix);
4142
int nErr = 0;
43
+ Blob rewrittenPathname;
4244
db_prepare(&q,
4345
"SELECT pathname, deleted, chnged, rid, coalesce(origname!=pathname,0)"
4446
" FROM vfile "
4547
" WHERE file_is_selected(id)"
4648
" AND (chnged OR deleted OR rid=0 OR pathname!=origname) ORDER BY 1"
4749
);
50
+ blob_zero(&rewrittenPathname);
4851
while( db_step(&q)==SQLITE_ROW ){
4952
const char *zPathname = db_column_text(&q,0);
53
+ const char *zDisplayName = zPathname;
5054
int isDeleted = db_column_int(&q, 1);
5155
int isChnged = db_column_int(&q,2);
5256
int isNew = db_column_int(&q,3)==0;
5357
int isRenamed = db_column_int(&q,4);
5458
char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
59
+ if( cwdRelative ){
60
+ file_relative_name(zFullName, &rewrittenPathname);
61
+ zDisplayName = blob_str(&rewrittenPathname);
62
+ if( zDisplayName[0]=='.' && zDisplayName[1]=='/' ){
63
+ zDisplayName += 2; /* no unnecessary ./ prefix */
64
+ }
65
+ }
5566
blob_append(report, zPrefix, nPrefix);
5667
if( isDeleted ){
57
- blob_appendf(report, "DELETED %s\n", zPathname);
68
+ blob_appendf(report, "DELETED %s\n", zDisplayName);
5869
}else if( !file_isfile(zFullName) ){
5970
if( file_access(zFullName, 0)==0 ){
60
- blob_appendf(report, "NOT_A_FILE %s\n", zPathname);
71
+ blob_appendf(report, "NOT_A_FILE %s\n", zDisplayName);
6172
if( missingIsFatal ){
62
- fossil_warning("not a file: %s", zPathname);
73
+ fossil_warning("not a file: %s", zDisplayName);
6374
nErr++;
6475
}
6576
}else{
66
- blob_appendf(report, "MISSING %s\n", zPathname);
77
+ blob_appendf(report, "MISSING %s\n", zDisplayName);
6778
if( missingIsFatal ){
68
- fossil_warning("missing file: %s", zPathname);
79
+ fossil_warning("missing file: %s", zDisplayName);
6980
nErr++;
7081
}
7182
}
7283
}else if( isNew ){
73
- blob_appendf(report, "ADDED %s\n", zPathname);
84
+ blob_appendf(report, "ADDED %s\n", zDisplayName);
7485
}else if( isDeleted ){
75
- blob_appendf(report, "DELETED %s\n", zPathname);
86
+ blob_appendf(report, "DELETED %s\n", zDisplayName);
7687
}else if( isChnged==2 ){
77
- blob_appendf(report, "UPDATED_BY_MERGE %s\n", zPathname);
88
+ blob_appendf(report, "UPDATED_BY_MERGE %s\n", zDisplayName);
7889
}else if( isChnged==3 ){
79
- blob_appendf(report, "ADDED_BY_MERGE %s\n", zPathname);
90
+ blob_appendf(report, "ADDED_BY_MERGE %s\n", zDisplayName);
8091
}else if( isChnged==1 ){
81
- blob_appendf(report, "EDITED %s\n", zPathname);
92
+ blob_appendf(report, "EDITED %s\n", zDisplayName);
8293
}else if( isRenamed ){
83
- blob_appendf(report, "RENAMED %s\n", zPathname);
94
+ blob_appendf(report, "RENAMED %s\n", zDisplayName);
8495
}
8596
free(zFullName);
8697
}
98
+ blob_reset(&rewrittenPathname);
8799
db_finalize(&q);
88100
db_prepare(&q, "SELECT uuid FROM vmerge JOIN blob ON merge=rid"
89101
" WHERE id=0");
90102
while( db_step(&q)==SQLITE_ROW ){
91103
blob_append(report, zPrefix, nPrefix);
@@ -94,33 +106,59 @@
94106
db_finalize(&q);
95107
if( nErr ){
96108
fossil_fatal("aborting due to prior errors");
97109
}
98110
}
111
+
112
+/*
113
+** Use the "relative-paths" setting and the --abs-paths and
114
+** --rel-paths command line options to determine whether the
115
+** status report should be shown relative to the current
116
+** working directory.
117
+*/
118
+static int determine_cwd_relative_option()
119
+{
120
+ int relativePaths = db_get_boolean("relative-paths", 1);
121
+ int absPathOption = find_option("abs-paths", 0, 0)!=0;
122
+ int relPathOption = find_option("rel-paths", 0, 0)!=0;
123
+ if( absPathOption ){ relativePaths = 0; }
124
+ if( relPathOption ){ relativePaths = 1; }
125
+ return relativePaths;
126
+}
99127
100128
/*
101129
** COMMAND: changes
102130
**
103131
** Usage: %fossil changes
104132
**
105133
** Report on the edit status of all files in the current checkout.
106134
** See also the "status" and "extra" commands.
107135
**
136
+** Pathnames are displayed according to the "relative-paths" setting,
137
+** unless overridden by the --abs-paths or --rel-paths options.
138
+**
108139
** Options:
109140
**
110141
** --sha1sum Verify file status using SHA1 hashing rather
111142
** than relying on file mtimes.
143
+**
144
+** --abs-paths Display absolute pathnames.
145
+**
146
+** --rel-paths Display pathnames relative to the current working
147
+** directory.
112148
*/
113149
void changes_cmd(void){
114150
Blob report;
115151
int vid;
116152
int useSha1sum = find_option("sha1sum", 0, 0)!=0;
153
+ int cwdRelative = 0;
117154
db_must_be_within_tree();
155
+ cwdRelative = determine_cwd_relative_option();
118156
blob_zero(&report);
119157
vid = db_lget_int("checkout", 0);
120158
vfile_check_signature(vid, 0, useSha1sum);
121
- status_report(&report, "", 0);
159
+ status_report(&report, "", 0, cwdRelative);
122160
blob_write_to_file(&report, "-");
123161
}
124162
125163
/*
126164
** COMMAND: status
@@ -127,14 +165,22 @@
127165
**
128166
** Usage: %fossil status
129167
**
130168
** Report on the status of the current checkout.
131169
**
170
+** Pathnames are displayed according to the "relative-paths" setting,
171
+** unless overridden by the --abs-paths or --rel-paths options.
172
+**
132173
** Options:
133174
**
134175
** --sha1sum Verify file status using SHA1 hashing rather
135176
** than relying on file mtimes.
177
+**
178
+** --abs-paths Display absolute pathnames.
179
+**
180
+** --rel-paths Display pathnames relative to the current working
181
+** directory.
136182
*/
137183
void status_cmd(void){
138184
int vid;
139185
db_must_be_within_tree();
140186
/* 012345678901234 */
@@ -212,22 +258,41 @@
212258
** ignored but can be included by adding the --dotfiles option.
213259
**
214260
** The GLOBPATTERN is a comma-separated list of GLOB expressions for
215261
** files that are ignored. The GLOBPATTERN specified by the "ignore-glob"
216262
** is used if the --ignore option is omitted.
263
+**
264
+** Pathnames are displayed according to the "relative-paths" setting,
265
+** unless overridden by the --abs-paths or --rel-paths options.
266
+**
267
+** Options:
268
+**
269
+** --dotfiles Include files with names beginning with "."
270
+**
271
+** --ignore GLOBPATTERN
272
+** Override the "ignore-glob" setting.
273
+**
274
+** --abs-paths Display absolute pathnames.
275
+**
276
+** --rel-paths Display pathnames relative to the current working
277
+** directory.
217278
*/
218279
void extra_cmd(void){
219280
Blob path;
220281
Blob repo;
221282
Stmt q;
222283
int n;
223284
const char *zIgnoreFlag = find_option("ignore",0,1);
224285
int allFlag = find_option("dotfiles",0,0)!=0;
286
+ int cwdRelative = 0;
225287
int outputManifest;
226288
Glob *pIgnore;
289
+ Blob rewrittenPathname;
290
+ const char *zPathname, *zDisplayName;
227291
228292
db_must_be_within_tree();
293
+ cwdRelative = determine_cwd_relative_option();
229294
outputManifest = db_get_boolean("manifest",0);
230295
db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
231296
n = strlen(g.zLocalRoot);
232297
blob_init(&path, g.zLocalRoot, n-1);
233298
if( zIgnoreFlag==0 ){
@@ -243,13 +308,25 @@
243308
fossil_all_reserved_names()
244309
);
245310
if( file_tree_name(g.zRepositoryName, &repo, 0) ){
246311
db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
247312
}
313
+ blob_zero(&rewrittenPathname);
248314
while( db_step(&q)==SQLITE_ROW ){
249
- fossil_print("%s\n", db_column_text(&q, 0));
315
+ zDisplayName = zPathname = db_column_text(&q, 0);
316
+ if( cwdRelative ) {
317
+ char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
318
+ file_relative_name(zFullName, &rewrittenPathname);
319
+ free(zFullName);
320
+ zDisplayName = blob_str(&rewrittenPathname);
321
+ if( zDisplayName[0]=='.' && zDisplayName[1]=='/' ){
322
+ zDisplayName += 2; /* no unnecessary ./ prefix */
323
+ }
324
+ }
325
+ fossil_print("%s\n", zDisplayName);
250326
}
327
+ blob_reset(&rewrittenPathname);
251328
db_finalize(&q);
252329
}
253330
254331
/*
255332
** COMMAND: clean
@@ -367,11 +444,11 @@
367444
"# PRIVATE BRANCH: This check-in will be private and will not sync to\n"
368445
"# repositories.\n"
369446
"#\n", -1
370447
);
371448
}
372
- status_report(&text, "# ", 1);
449
+ status_report(&text, "# ", 1, 0);
373450
zEditor = db_get("editor", 0);
374451
if( zEditor==0 ){
375452
zEditor = getenv("VISUAL");
376453
}
377454
if( zEditor==0 ){
378455
--- src/checkin.c
+++ src/checkin.c
@@ -32,60 +32,72 @@
32 ** are not true files results in a fatal error.
33 */
34 static void status_report(
35 Blob *report, /* Append the status report here */
36 const char *zPrefix, /* Prefix on each line of the report */
37 int missingIsFatal /* MISSING and NOT_A_FILE are fatal errors */
 
38 ){
39 Stmt q;
40 int nPrefix = strlen(zPrefix);
41 int nErr = 0;
 
42 db_prepare(&q,
43 "SELECT pathname, deleted, chnged, rid, coalesce(origname!=pathname,0)"
44 " FROM vfile "
45 " WHERE file_is_selected(id)"
46 " AND (chnged OR deleted OR rid=0 OR pathname!=origname) ORDER BY 1"
47 );
 
48 while( db_step(&q)==SQLITE_ROW ){
49 const char *zPathname = db_column_text(&q,0);
 
50 int isDeleted = db_column_int(&q, 1);
51 int isChnged = db_column_int(&q,2);
52 int isNew = db_column_int(&q,3)==0;
53 int isRenamed = db_column_int(&q,4);
54 char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
 
 
 
 
 
 
 
55 blob_append(report, zPrefix, nPrefix);
56 if( isDeleted ){
57 blob_appendf(report, "DELETED %s\n", zPathname);
58 }else if( !file_isfile(zFullName) ){
59 if( file_access(zFullName, 0)==0 ){
60 blob_appendf(report, "NOT_A_FILE %s\n", zPathname);
61 if( missingIsFatal ){
62 fossil_warning("not a file: %s", zPathname);
63 nErr++;
64 }
65 }else{
66 blob_appendf(report, "MISSING %s\n", zPathname);
67 if( missingIsFatal ){
68 fossil_warning("missing file: %s", zPathname);
69 nErr++;
70 }
71 }
72 }else if( isNew ){
73 blob_appendf(report, "ADDED %s\n", zPathname);
74 }else if( isDeleted ){
75 blob_appendf(report, "DELETED %s\n", zPathname);
76 }else if( isChnged==2 ){
77 blob_appendf(report, "UPDATED_BY_MERGE %s\n", zPathname);
78 }else if( isChnged==3 ){
79 blob_appendf(report, "ADDED_BY_MERGE %s\n", zPathname);
80 }else if( isChnged==1 ){
81 blob_appendf(report, "EDITED %s\n", zPathname);
82 }else if( isRenamed ){
83 blob_appendf(report, "RENAMED %s\n", zPathname);
84 }
85 free(zFullName);
86 }
 
87 db_finalize(&q);
88 db_prepare(&q, "SELECT uuid FROM vmerge JOIN blob ON merge=rid"
89 " WHERE id=0");
90 while( db_step(&q)==SQLITE_ROW ){
91 blob_append(report, zPrefix, nPrefix);
@@ -94,33 +106,59 @@
94 db_finalize(&q);
95 if( nErr ){
96 fossil_fatal("aborting due to prior errors");
97 }
98 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
100 /*
101 ** COMMAND: changes
102 **
103 ** Usage: %fossil changes
104 **
105 ** Report on the edit status of all files in the current checkout.
106 ** See also the "status" and "extra" commands.
107 **
 
 
 
108 ** Options:
109 **
110 ** --sha1sum Verify file status using SHA1 hashing rather
111 ** than relying on file mtimes.
 
 
 
 
 
112 */
113 void changes_cmd(void){
114 Blob report;
115 int vid;
116 int useSha1sum = find_option("sha1sum", 0, 0)!=0;
 
117 db_must_be_within_tree();
 
118 blob_zero(&report);
119 vid = db_lget_int("checkout", 0);
120 vfile_check_signature(vid, 0, useSha1sum);
121 status_report(&report, "", 0);
122 blob_write_to_file(&report, "-");
123 }
124
125 /*
126 ** COMMAND: status
@@ -127,14 +165,22 @@
127 **
128 ** Usage: %fossil status
129 **
130 ** Report on the status of the current checkout.
131 **
 
 
 
132 ** Options:
133 **
134 ** --sha1sum Verify file status using SHA1 hashing rather
135 ** than relying on file mtimes.
 
 
 
 
 
136 */
137 void status_cmd(void){
138 int vid;
139 db_must_be_within_tree();
140 /* 012345678901234 */
@@ -212,22 +258,41 @@
212 ** ignored but can be included by adding the --dotfiles option.
213 **
214 ** The GLOBPATTERN is a comma-separated list of GLOB expressions for
215 ** files that are ignored. The GLOBPATTERN specified by the "ignore-glob"
216 ** is used if the --ignore option is omitted.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217 */
218 void extra_cmd(void){
219 Blob path;
220 Blob repo;
221 Stmt q;
222 int n;
223 const char *zIgnoreFlag = find_option("ignore",0,1);
224 int allFlag = find_option("dotfiles",0,0)!=0;
 
225 int outputManifest;
226 Glob *pIgnore;
 
 
227
228 db_must_be_within_tree();
 
229 outputManifest = db_get_boolean("manifest",0);
230 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
231 n = strlen(g.zLocalRoot);
232 blob_init(&path, g.zLocalRoot, n-1);
233 if( zIgnoreFlag==0 ){
@@ -243,13 +308,25 @@
243 fossil_all_reserved_names()
244 );
245 if( file_tree_name(g.zRepositoryName, &repo, 0) ){
246 db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
247 }
 
248 while( db_step(&q)==SQLITE_ROW ){
249 fossil_print("%s\n", db_column_text(&q, 0));
 
 
 
 
 
 
 
 
 
 
250 }
 
251 db_finalize(&q);
252 }
253
254 /*
255 ** COMMAND: clean
@@ -367,11 +444,11 @@
367 "# PRIVATE BRANCH: This check-in will be private and will not sync to\n"
368 "# repositories.\n"
369 "#\n", -1
370 );
371 }
372 status_report(&text, "# ", 1);
373 zEditor = db_get("editor", 0);
374 if( zEditor==0 ){
375 zEditor = getenv("VISUAL");
376 }
377 if( zEditor==0 ){
378
--- src/checkin.c
+++ src/checkin.c
@@ -32,60 +32,72 @@
32 ** are not true files results in a fatal error.
33 */
34 static void status_report(
35 Blob *report, /* Append the status report here */
36 const char *zPrefix, /* Prefix on each line of the report */
37 int missingIsFatal, /* MISSING and NOT_A_FILE are fatal errors */
38 int cwdRelative /* Report relative to the current working dir */
39 ){
40 Stmt q;
41 int nPrefix = strlen(zPrefix);
42 int nErr = 0;
43 Blob rewrittenPathname;
44 db_prepare(&q,
45 "SELECT pathname, deleted, chnged, rid, coalesce(origname!=pathname,0)"
46 " FROM vfile "
47 " WHERE file_is_selected(id)"
48 " AND (chnged OR deleted OR rid=0 OR pathname!=origname) ORDER BY 1"
49 );
50 blob_zero(&rewrittenPathname);
51 while( db_step(&q)==SQLITE_ROW ){
52 const char *zPathname = db_column_text(&q,0);
53 const char *zDisplayName = zPathname;
54 int isDeleted = db_column_int(&q, 1);
55 int isChnged = db_column_int(&q,2);
56 int isNew = db_column_int(&q,3)==0;
57 int isRenamed = db_column_int(&q,4);
58 char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
59 if( cwdRelative ){
60 file_relative_name(zFullName, &rewrittenPathname);
61 zDisplayName = blob_str(&rewrittenPathname);
62 if( zDisplayName[0]=='.' && zDisplayName[1]=='/' ){
63 zDisplayName += 2; /* no unnecessary ./ prefix */
64 }
65 }
66 blob_append(report, zPrefix, nPrefix);
67 if( isDeleted ){
68 blob_appendf(report, "DELETED %s\n", zDisplayName);
69 }else if( !file_isfile(zFullName) ){
70 if( file_access(zFullName, 0)==0 ){
71 blob_appendf(report, "NOT_A_FILE %s\n", zDisplayName);
72 if( missingIsFatal ){
73 fossil_warning("not a file: %s", zDisplayName);
74 nErr++;
75 }
76 }else{
77 blob_appendf(report, "MISSING %s\n", zDisplayName);
78 if( missingIsFatal ){
79 fossil_warning("missing file: %s", zDisplayName);
80 nErr++;
81 }
82 }
83 }else if( isNew ){
84 blob_appendf(report, "ADDED %s\n", zDisplayName);
85 }else if( isDeleted ){
86 blob_appendf(report, "DELETED %s\n", zDisplayName);
87 }else if( isChnged==2 ){
88 blob_appendf(report, "UPDATED_BY_MERGE %s\n", zDisplayName);
89 }else if( isChnged==3 ){
90 blob_appendf(report, "ADDED_BY_MERGE %s\n", zDisplayName);
91 }else if( isChnged==1 ){
92 blob_appendf(report, "EDITED %s\n", zDisplayName);
93 }else if( isRenamed ){
94 blob_appendf(report, "RENAMED %s\n", zDisplayName);
95 }
96 free(zFullName);
97 }
98 blob_reset(&rewrittenPathname);
99 db_finalize(&q);
100 db_prepare(&q, "SELECT uuid FROM vmerge JOIN blob ON merge=rid"
101 " WHERE id=0");
102 while( db_step(&q)==SQLITE_ROW ){
103 blob_append(report, zPrefix, nPrefix);
@@ -94,33 +106,59 @@
106 db_finalize(&q);
107 if( nErr ){
108 fossil_fatal("aborting due to prior errors");
109 }
110 }
111
112 /*
113 ** Use the "relative-paths" setting and the --abs-paths and
114 ** --rel-paths command line options to determine whether the
115 ** status report should be shown relative to the current
116 ** working directory.
117 */
118 static int determine_cwd_relative_option()
119 {
120 int relativePaths = db_get_boolean("relative-paths", 1);
121 int absPathOption = find_option("abs-paths", 0, 0)!=0;
122 int relPathOption = find_option("rel-paths", 0, 0)!=0;
123 if( absPathOption ){ relativePaths = 0; }
124 if( relPathOption ){ relativePaths = 1; }
125 return relativePaths;
126 }
127
128 /*
129 ** COMMAND: changes
130 **
131 ** Usage: %fossil changes
132 **
133 ** Report on the edit status of all files in the current checkout.
134 ** See also the "status" and "extra" commands.
135 **
136 ** Pathnames are displayed according to the "relative-paths" setting,
137 ** unless overridden by the --abs-paths or --rel-paths options.
138 **
139 ** Options:
140 **
141 ** --sha1sum Verify file status using SHA1 hashing rather
142 ** than relying on file mtimes.
143 **
144 ** --abs-paths Display absolute pathnames.
145 **
146 ** --rel-paths Display pathnames relative to the current working
147 ** directory.
148 */
149 void changes_cmd(void){
150 Blob report;
151 int vid;
152 int useSha1sum = find_option("sha1sum", 0, 0)!=0;
153 int cwdRelative = 0;
154 db_must_be_within_tree();
155 cwdRelative = determine_cwd_relative_option();
156 blob_zero(&report);
157 vid = db_lget_int("checkout", 0);
158 vfile_check_signature(vid, 0, useSha1sum);
159 status_report(&report, "", 0, cwdRelative);
160 blob_write_to_file(&report, "-");
161 }
162
163 /*
164 ** COMMAND: status
@@ -127,14 +165,22 @@
165 **
166 ** Usage: %fossil status
167 **
168 ** Report on the status of the current checkout.
169 **
170 ** Pathnames are displayed according to the "relative-paths" setting,
171 ** unless overridden by the --abs-paths or --rel-paths options.
172 **
173 ** Options:
174 **
175 ** --sha1sum Verify file status using SHA1 hashing rather
176 ** than relying on file mtimes.
177 **
178 ** --abs-paths Display absolute pathnames.
179 **
180 ** --rel-paths Display pathnames relative to the current working
181 ** directory.
182 */
183 void status_cmd(void){
184 int vid;
185 db_must_be_within_tree();
186 /* 012345678901234 */
@@ -212,22 +258,41 @@
258 ** ignored but can be included by adding the --dotfiles option.
259 **
260 ** The GLOBPATTERN is a comma-separated list of GLOB expressions for
261 ** files that are ignored. The GLOBPATTERN specified by the "ignore-glob"
262 ** is used if the --ignore option is omitted.
263 **
264 ** Pathnames are displayed according to the "relative-paths" setting,
265 ** unless overridden by the --abs-paths or --rel-paths options.
266 **
267 ** Options:
268 **
269 ** --dotfiles Include files with names beginning with "."
270 **
271 ** --ignore GLOBPATTERN
272 ** Override the "ignore-glob" setting.
273 **
274 ** --abs-paths Display absolute pathnames.
275 **
276 ** --rel-paths Display pathnames relative to the current working
277 ** directory.
278 */
279 void extra_cmd(void){
280 Blob path;
281 Blob repo;
282 Stmt q;
283 int n;
284 const char *zIgnoreFlag = find_option("ignore",0,1);
285 int allFlag = find_option("dotfiles",0,0)!=0;
286 int cwdRelative = 0;
287 int outputManifest;
288 Glob *pIgnore;
289 Blob rewrittenPathname;
290 const char *zPathname, *zDisplayName;
291
292 db_must_be_within_tree();
293 cwdRelative = determine_cwd_relative_option();
294 outputManifest = db_get_boolean("manifest",0);
295 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
296 n = strlen(g.zLocalRoot);
297 blob_init(&path, g.zLocalRoot, n-1);
298 if( zIgnoreFlag==0 ){
@@ -243,13 +308,25 @@
308 fossil_all_reserved_names()
309 );
310 if( file_tree_name(g.zRepositoryName, &repo, 0) ){
311 db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
312 }
313 blob_zero(&rewrittenPathname);
314 while( db_step(&q)==SQLITE_ROW ){
315 zDisplayName = zPathname = db_column_text(&q, 0);
316 if( cwdRelative ) {
317 char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
318 file_relative_name(zFullName, &rewrittenPathname);
319 free(zFullName);
320 zDisplayName = blob_str(&rewrittenPathname);
321 if( zDisplayName[0]=='.' && zDisplayName[1]=='/' ){
322 zDisplayName += 2; /* no unnecessary ./ prefix */
323 }
324 }
325 fossil_print("%s\n", zDisplayName);
326 }
327 blob_reset(&rewrittenPathname);
328 db_finalize(&q);
329 }
330
331 /*
332 ** COMMAND: clean
@@ -367,11 +444,11 @@
444 "# PRIVATE BRANCH: This check-in will be private and will not sync to\n"
445 "# repositories.\n"
446 "#\n", -1
447 );
448 }
449 status_report(&text, "# ", 1, 0);
450 zEditor = db_get("editor", 0);
451 if( zEditor==0 ){
452 zEditor = getenv("VISUAL");
453 }
454 if( zEditor==0 ){
455
--- src/checkout.c
+++ src/checkout.c
@@ -232,10 +232,11 @@
232232
if( !keepFlag ){
233233
vfile_to_disk(vid, 0, 1, promptFlag);
234234
}
235235
checkout_set_all_exe(vid);
236236
manifest_to_disk(vid);
237
+ ensure_empty_dirs_created();
237238
db_lset_int("checkout", vid);
238239
undo_reset();
239240
db_multi_exec("DELETE FROM vmerge");
240241
if( !keepFlag && db_get_boolean("repo-cksum",1) ){
241242
vfile_aggregate_checksum_manifest(vid, &cksum1, &cksum1b);
242243
--- src/checkout.c
+++ src/checkout.c
@@ -232,10 +232,11 @@
232 if( !keepFlag ){
233 vfile_to_disk(vid, 0, 1, promptFlag);
234 }
235 checkout_set_all_exe(vid);
236 manifest_to_disk(vid);
 
237 db_lset_int("checkout", vid);
238 undo_reset();
239 db_multi_exec("DELETE FROM vmerge");
240 if( !keepFlag && db_get_boolean("repo-cksum",1) ){
241 vfile_aggregate_checksum_manifest(vid, &cksum1, &cksum1b);
242
--- src/checkout.c
+++ src/checkout.c
@@ -232,10 +232,11 @@
232 if( !keepFlag ){
233 vfile_to_disk(vid, 0, 1, promptFlag);
234 }
235 checkout_set_all_exe(vid);
236 manifest_to_disk(vid);
237 ensure_empty_dirs_created();
238 db_lset_int("checkout", vid);
239 undo_reset();
240 db_multi_exec("DELETE FROM vmerge");
241 if( !keepFlag && db_get_boolean("repo-cksum",1) ){
242 vfile_aggregate_checksum_manifest(vid, &cksum1, &cksum1b);
243
--- src/clone.c
+++ src/clone.c
@@ -37,10 +37,11 @@
3737
**
3838
** Options:
3939
**
4040
** --admin-user|-A USERNAME Make USERNAME the administrator
4141
** --private Also clone private branches
42
+** --ssl-identity=filename Use the SSL identity if requested by the server
4243
**
4344
*/
4445
void clone_cmd(void){
4546
char *zPassword;
4647
const char *zDefaultUser; /* Optional name of the default user */
@@ -94,10 +95,18 @@
9495
db_initial_setup(0, zDefaultUser, 0);
9596
user_select();
9697
db_set("content-schema", CONTENT_SCHEMA, 0);
9798
db_set("aux-schema", AUX_SCHEMA, 0);
9899
db_set("last-sync-url", g.argv[2], 0);
100
+ if( g.zSSLIdentity!=0 ){
101
+ /* If the --ssl-identity option was specified, store it as a setting */
102
+ Blob fn;
103
+ blob_zero(&fn);
104
+ file_canonical_name(g.zSSLIdentity, &fn);
105
+ db_set("ssl-identity", blob_str(&fn), 0);
106
+ blob_reset(&fn);
107
+ }
99108
db_multi_exec(
100109
"REPLACE INTO config(name,value,mtime)"
101110
" VALUES('server-code', lower(hex(randomblob(20))), now());"
102111
);
103112
url_enable_proxy(0);
104113
--- src/clone.c
+++ src/clone.c
@@ -37,10 +37,11 @@
37 **
38 ** Options:
39 **
40 ** --admin-user|-A USERNAME Make USERNAME the administrator
41 ** --private Also clone private branches
 
42 **
43 */
44 void clone_cmd(void){
45 char *zPassword;
46 const char *zDefaultUser; /* Optional name of the default user */
@@ -94,10 +95,18 @@
94 db_initial_setup(0, zDefaultUser, 0);
95 user_select();
96 db_set("content-schema", CONTENT_SCHEMA, 0);
97 db_set("aux-schema", AUX_SCHEMA, 0);
98 db_set("last-sync-url", g.argv[2], 0);
 
 
 
 
 
 
 
 
99 db_multi_exec(
100 "REPLACE INTO config(name,value,mtime)"
101 " VALUES('server-code', lower(hex(randomblob(20))), now());"
102 );
103 url_enable_proxy(0);
104
--- src/clone.c
+++ src/clone.c
@@ -37,10 +37,11 @@
37 **
38 ** Options:
39 **
40 ** --admin-user|-A USERNAME Make USERNAME the administrator
41 ** --private Also clone private branches
42 ** --ssl-identity=filename Use the SSL identity if requested by the server
43 **
44 */
45 void clone_cmd(void){
46 char *zPassword;
47 const char *zDefaultUser; /* Optional name of the default user */
@@ -94,10 +95,18 @@
95 db_initial_setup(0, zDefaultUser, 0);
96 user_select();
97 db_set("content-schema", CONTENT_SCHEMA, 0);
98 db_set("aux-schema", AUX_SCHEMA, 0);
99 db_set("last-sync-url", g.argv[2], 0);
100 if( g.zSSLIdentity!=0 ){
101 /* If the --ssl-identity option was specified, store it as a setting */
102 Blob fn;
103 blob_zero(&fn);
104 file_canonical_name(g.zSSLIdentity, &fn);
105 db_set("ssl-identity", blob_str(&fn), 0);
106 blob_reset(&fn);
107 }
108 db_multi_exec(
109 "REPLACE INTO config(name,value,mtime)"
110 " VALUES('server-code', lower(hex(randomblob(20))), now());"
111 );
112 url_enable_proxy(0);
113
--- src/configure.c
+++ src/configure.c
@@ -81,10 +81,11 @@
8181
{ "project-name", CONFIGSET_PROJ },
8282
{ "project-description", CONFIGSET_PROJ },
8383
{ "manifest", CONFIGSET_PROJ },
8484
{ "ignore-glob", CONFIGSET_PROJ },
8585
{ "crnl-glob", CONFIGSET_PROJ },
86
+ { "empty-dirs", CONFIGSET_PROJ },
8687
{ "index-page", CONFIGSET_SKIN },
8788
{ "timeline-block-markup", CONFIGSET_SKIN },
8889
{ "timeline-max-comment", CONFIGSET_SKIN },
8990
{ "ticket-table", CONFIGSET_TKT },
9091
{ "ticket-common", CONFIGSET_TKT },
9192
--- src/configure.c
+++ src/configure.c
@@ -81,10 +81,11 @@
81 { "project-name", CONFIGSET_PROJ },
82 { "project-description", CONFIGSET_PROJ },
83 { "manifest", CONFIGSET_PROJ },
84 { "ignore-glob", CONFIGSET_PROJ },
85 { "crnl-glob", CONFIGSET_PROJ },
 
86 { "index-page", CONFIGSET_SKIN },
87 { "timeline-block-markup", CONFIGSET_SKIN },
88 { "timeline-max-comment", CONFIGSET_SKIN },
89 { "ticket-table", CONFIGSET_TKT },
90 { "ticket-common", CONFIGSET_TKT },
91
--- src/configure.c
+++ src/configure.c
@@ -81,10 +81,11 @@
81 { "project-name", CONFIGSET_PROJ },
82 { "project-description", CONFIGSET_PROJ },
83 { "manifest", CONFIGSET_PROJ },
84 { "ignore-glob", CONFIGSET_PROJ },
85 { "crnl-glob", CONFIGSET_PROJ },
86 { "empty-dirs", CONFIGSET_PROJ },
87 { "index-page", CONFIGSET_SKIN },
88 { "timeline-block-markup", CONFIGSET_SKIN },
89 { "timeline-max-comment", CONFIGSET_SKIN },
90 { "ticket-table", CONFIGSET_TKT },
91 { "ticket-common", CONFIGSET_TKT },
92
+160 -46
--- src/db.c
+++ src/db.c
@@ -1399,24 +1399,93 @@
13991399
sqlite3 *dbTemp = g.db;
14001400
g.db = g.dbConfig;
14011401
g.dbConfig = dbTemp;
14021402
}
14031403
}
1404
+
1405
+/*
1406
+** Logic for reading potentially versioned settings from
1407
+** .fossil-settings/<name> , and emits warnings if necessary.
1408
+** Returns the non-versioned value without modification if there is no
1409
+** versioned value.
1410
+*/
1411
+static char *db_get_do_versionable(const char *zName, char *zNonVersionedSetting){
1412
+ /* Attempt to load the versioned setting from a checked out file */
1413
+ char *zVersionedSetting = 0;
1414
+ int noWarn = 0;
1415
+
1416
+ if( db_open_local() ){
1417
+ Blob versionedPathname;
1418
+ char *zVersionedPathname;
1419
+ blob_zero(&versionedPathname);
1420
+ blob_appendf(&versionedPathname, "%s/.fossil-settings/%s",
1421
+ g.zLocalRoot, zName);
1422
+ zVersionedPathname = blob_str(&versionedPathname);
1423
+ if( file_size(zVersionedPathname)>=0 ){
1424
+ /* File exists, and contains the value for this setting. Load from
1425
+ ** the file. */
1426
+ Blob setting;
1427
+ blob_zero(&setting);
1428
+ if( blob_read_from_file(&setting, zVersionedPathname) >= 0 ){
1429
+ blob_trim(&setting); /* Avoid non-obvious problems with line endings
1430
+ ** on boolean properties */
1431
+ zVersionedSetting = strdup(blob_str(&setting));
1432
+ }
1433
+ blob_reset(&setting);
1434
+ /* See if there's a no-warn flag */
1435
+ blob_append(&versionedPathname, ".no-warn", -1);
1436
+ if( file_size(blob_str(&versionedPathname))>=0 ){
1437
+ noWarn = 1;
1438
+ }
1439
+ }
1440
+ blob_reset(&versionedPathname);
1441
+ }
1442
+ /* Display a warning? */
1443
+ if( zVersionedSetting!=0 && zNonVersionedSetting!=0
1444
+ && zNonVersionedSetting[0]!='\0' && !noWarn
1445
+ ){
1446
+ /* There's a versioned setting, and a non-versioned setting. Tell
1447
+ ** the user about the conflict */
1448
+ fossil_warning(
1449
+ "setting %s has both versioned and non-versioned values: using "
1450
+ "versioned value from file .fossil-settings/%s (to silence this "
1451
+ "warning, either create an empty file named "
1452
+ ".fossil-settings/%s.no-warn or delete the non-versioned setting "
1453
+ " with \"fossil unset %s\")", zName, zName, zName, zName
1454
+ );
1455
+ }
1456
+ /* Prefer the versioned setting */
1457
+ return ( zVersionedSetting!=0 ) ? zVersionedSetting : zNonVersionedSetting;
1458
+}
1459
+
14041460
14051461
/*
14061462
** Get and set values from the CONFIG, GLOBAL_CONFIG and VVAR table in the
14071463
** repository and local databases.
14081464
*/
14091465
char *db_get(const char *zName, char *zDefault){
14101466
char *z = 0;
1467
+ int i;
1468
+ const struct stControlSettings *ctrlSetting = 0;
1469
+ /* Is this a setting? */
1470
+ for(i=0; ctrlSettings[i].name; i++){
1471
+ if( strcmp(ctrlSettings[i].name, zName)==0 ){
1472
+ ctrlSetting = &(ctrlSettings[i]);
1473
+ break;
1474
+ }
1475
+ }
14111476
if( g.repositoryOpen ){
14121477
z = db_text(0, "SELECT value FROM config WHERE name=%Q", zName);
14131478
}
14141479
if( z==0 && g.configOpen ){
14151480
db_swap_connections();
14161481
z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
14171482
db_swap_connections();
1483
+ }
1484
+ if( ctrlSetting!=0 && ctrlSetting->versionable ){
1485
+ /* This is a versionable setting, try and get the info from a checked out file */
1486
+ z = db_get_do_versionable(zName, z);
14181487
}
14191488
if( z==0 ){
14201489
z = zDefault;
14211490
}
14221491
return z;
@@ -1603,30 +1672,39 @@
16031672
}
16041673
16051674
/*
16061675
** Print the value of a setting named zName
16071676
*/
1608
-static void print_setting(const char *zName){
1677
+static void print_setting(const struct stControlSettings *ctrlSetting, int localOpen){
16091678
Stmt q;
16101679
if( g.repositoryOpen ){
16111680
db_prepare(&q,
16121681
"SELECT '(local)', value FROM config WHERE name=%Q"
16131682
" UNION ALL "
16141683
"SELECT '(global)', value FROM global_config WHERE name=%Q",
1615
- zName, zName
1684
+ ctrlSetting->name, ctrlSetting->name
16161685
);
16171686
}else{
16181687
db_prepare(&q,
16191688
"SELECT '(global)', value FROM global_config WHERE name=%Q",
1620
- zName
1689
+ ctrlSetting->name
16211690
);
16221691
}
16231692
if( db_step(&q)==SQLITE_ROW ){
1624
- fossil_print("%-20s %-8s %s\n", zName, db_column_text(&q, 0),
1693
+ fossil_print("%-20s %-8s %s\n", ctrlSetting->name, db_column_text(&q, 0),
16251694
db_column_text(&q, 1));
16261695
}else{
1627
- fossil_print("%-20s\n", zName);
1696
+ fossil_print("%-20s\n", ctrlSetting->name);
1697
+ }
1698
+ if( ctrlSetting->versionable && localOpen ){
1699
+ /* Check to see if this is overridden by a versionable settings file */
1700
+ Blob versionedPathname;
1701
+ blob_zero(&versionedPathname);
1702
+ blob_appendf(&versionedPathname, "%s/.fossil-settings/%s", g.zLocalRoot, ctrlSetting->name);
1703
+ if( file_size(blob_str(&versionedPathname))>=0 ){
1704
+ fossil_print(" (overridden by contents of file .fossil-settings/%s)\n", ctrlSetting->name);
1705
+ }
16281706
}
16291707
db_finalize(&q);
16301708
}
16311709
16321710
@@ -1642,44 +1720,49 @@
16421720
#if INTERFACE
16431721
struct stControlSettings {
16441722
char const *name; /* Name of the setting */
16451723
char const *var; /* Internal variable name used by db_set() */
16461724
int width; /* Width of display. 0 for boolean values */
1725
+ int versionable; /* Is this setting versionable? */
16471726
char const *def; /* Default value */
16481727
};
16491728
#endif /* INTERFACE */
16501729
struct stControlSettings const ctrlSettings[] = {
1651
- { "access-log", 0, 0, "off" },
1652
- { "auto-captcha", "autocaptcha", 0, "on" },
1653
- { "auto-shun", 0, 0, "on" },
1654
- { "autosync", 0, 0, "on" },
1655
- { "binary-glob", 0, 32, "" },
1656
- { "case-sensitive",0, 0, "on" },
1657
- { "clearsign", 0, 0, "off" },
1658
- { "crnl-glob", 0, 16, "" },
1659
- { "default-perms", 0, 16, "u" },
1660
- { "diff-command", 0, 16, "" },
1661
- { "dont-push", 0, 0, "off" },
1662
- { "editor", 0, 16, "" },
1663
- { "gdiff-command", 0, 16, "gdiff" },
1664
- { "gmerge-command",0, 40, "" },
1665
- { "https-login", 0, 0, "off" },
1666
- { "ignore-glob", 0, 40, "" },
1667
- { "http-port", 0, 16, "8080" },
1668
- { "localauth", 0, 0, "off" },
1669
- { "main-branch", 0, 40, "trunk" },
1670
- { "manifest", 0, 0, "off" },
1671
- { "max-upload", 0, 25, "250000" },
1672
- { "mtime-changes", 0, 0, "on" },
1673
- { "pgp-command", 0, 32, "gpg --clearsign -o " },
1674
- { "proxy", 0, 32, "off" },
1675
- { "repo-cksum", 0, 0, "on" },
1676
- { "self-register", 0, 0, "off" },
1677
- { "ssh-command", 0, 32, "" },
1678
- { "web-browser", 0, 32, "" },
1679
- { "white-foreground", 0, 0, "off" },
1680
- { 0,0,0,0 }
1730
+ { "access-log", 0, 0, 0, "off" },
1731
+ { "auto-captcha", "autocaptcha", 0, 0, "on" },
1732
+ { "auto-shun", 0, 0, 0, "on" },
1733
+ { "autosync", 0, 0, 0, "on" },
1734
+ { "binary-glob", 0, 32, 1, "" },
1735
+ { "clearsign", 0, 0, 0, "off" },
1736
+ { "case-sensitive",0, 0, 0, "on" },
1737
+ { "crnl-glob", 0, 16, 1, "" },
1738
+ { "default-perms", 0, 16, 0, "u" },
1739
+ { "diff-command", 0, 16, 0, "" },
1740
+ { "dont-push", 0, 0, 0, "off" },
1741
+ { "editor", 0, 16, 0, "" },
1742
+ { "gdiff-command", 0, 16, 0, "gdiff" },
1743
+ { "gmerge-command",0, 40, 0, "" },
1744
+ { "https-login", 0, 0, 0, "off" },
1745
+ { "ignore-glob", 0, 40, 1, "" },
1746
+ { "empty-dirs", 0, 40, 1, "" },
1747
+ { "http-port", 0, 16, 0, "8080" },
1748
+ { "localauth", 0, 0, 0, "off" },
1749
+ { "main-branch", 0, 40, 0, "trunk" },
1750
+ { "manifest", 0, 0, 1, "off" },
1751
+ { "max-upload", 0, 25, 0, "250000" },
1752
+ { "mtime-changes", 0, 0, 0, "on" },
1753
+ { "pgp-command", 0, 32, 0, "gpg --clearsign -o " },
1754
+ { "proxy", 0, 32, 0, "off" },
1755
+ { "relative-paths",0, 0, 0, "on" },
1756
+ { "repo-cksum", 0, 0, 0, "on" },
1757
+ { "self-register", 0, 0, 0, "off" },
1758
+ { "ssl-ca-location",0, 40, 0, "" },
1759
+ { "ssl-identity", 0, 40, 0, "" },
1760
+ { "ssh-command", 0, 32, 0, "" },
1761
+ { "web-browser", 0, 32, 0, "" },
1762
+ { "white-foreground", 0, 0, 0, "off" },
1763
+ { 0,0,0,0,0 }
16811764
};
16821765
16831766
/*
16841767
** COMMAND: settings
16851768
** COMMAND: unset
@@ -1688,10 +1771,14 @@
16881771
** %fossil unset PROPERTY ?-global?
16891772
**
16901773
** The "settings" command with no arguments lists all properties and their
16911774
** values. With just a property name it shows the value of that property.
16921775
** With a value argument it changes the property for the current repository.
1776
+**
1777
+** Settings marked as versionable are overridden by the contents of the
1778
+** file named .fossil-settings/PROPERTY in the checked out files, if that
1779
+** file exists.
16931780
**
16941781
** The "unset" command clears a property setting.
16951782
**
16961783
**
16971784
** auto-captcha If enabled, the Login page provides a button to
@@ -1705,13 +1792,13 @@
17051792
** or update and automatically push after commit or
17061793
** tag or branch creation. If the value is "pullonly"
17071794
** then only pull operations occur automatically.
17081795
** Default: on
17091796
**
1710
-** binary-glob The VALUE is a comma-separated list of GLOB patterns
1711
-** that should be treated as binary files for merging
1712
-** purposes. Example: *.xml
1797
+** binary-glob The VALUE is a comma or newline-separated list of
1798
+** (versionable) GLOB patterns that should be treated as binary files
1799
+** for merging purposes. Example: *.xml
17131800
**
17141801
** case-sensitive If TRUE, the files whose names differ only in case
17151802
** care considered distinct. If FALSE files whose names
17161803
** differ only in case are the same file. Defaults to
17171804
** TRUE for unix and FALSE for windows and mac.
@@ -1718,12 +1805,12 @@
17181805
**
17191806
** clearsign When enabled, fossil will attempt to sign all commits
17201807
** with gpg. When disabled (the default), commits will
17211808
** be unsigned. Default: off
17221809
**
1723
-** crnl-glob A comma-separated list of GLOB patterns for text files
1724
-** in which it is ok to have CR+NL line endings.
1810
+** crnl-glob A comma or newline-separated list of GLOB patterns for
1811
+** (versionable) text files in which it is ok to have CR+NL line endings.
17251812
** Set to "*" to disable CR+NL checking.
17261813
**
17271814
** default-perms Permissions given automatically to new users. For more
17281815
** information on permissions see Users page in Server
17291816
** Administration of the HTTP UI. Default: u.
@@ -1731,10 +1818,15 @@
17311818
** diff-command External command to run when performing a diff.
17321819
** If undefined, the internal text diff will be used.
17331820
**
17341821
** dont-push Prevent this repository from pushing from client to
17351822
** server. Useful when setting up a private branch.
1823
+**
1824
+** empty-dirs A comma or newline-separated list of pathnames. On
1825
+** (versionable) update and checkout commands, if no file or directory
1826
+** exists with that name, an empty directory will be
1827
+** created.
17361828
**
17371829
** editor Text editor command used for check-in comments.
17381830
**
17391831
** gdiff-command External command to run when performing a graphical
17401832
** diff. If undefined, text diff will be used.
@@ -1749,23 +1841,23 @@
17491841
** and "ui" commands. Default: 8080
17501842
**
17511843
** https-login Send login creditials using HTTPS instead of HTTP
17521844
** even if the login page request came via HTTP.
17531845
**
1754
-** ignore-glob The VALUE is a comma-separated list of GLOB patterns
1755
-** specifying files that the "extra" command will ignore.
1756
-** Example: *.o,*.obj,*.exe
1846
+** ignore-glob The VALUE is a comma or newline-separated list of GLOB
1847
+** (versionable) patterns specifying files that the "extra" command will
1848
+** ignore. Example: *.o,*.obj,*.exe
17571849
**
17581850
** localauth If enabled, require that HTTP connections from
17591851
** 127.0.0.1 be authenticated by password. If
17601852
** false, all HTTP requests from localhost have
17611853
** unrestricted access to the repository.
17621854
**
17631855
** main-branch The primary branch for the project. Default: trunk
17641856
**
17651857
** manifest If enabled, automatically create files "manifest" and
1766
-** "manifest.uuid" in every checkout. The SQLite and
1858
+** (versionable) "manifest.uuid" in every checkout. The SQLite and
17671859
** Fossil repositories both require this. Default: off.
17681860
**
17691861
** max-upload A limit on the size of uplink HTTP requests. The
17701862
** default is 250000 bytes.
17711863
**
@@ -1777,10 +1869,13 @@
17771869
**
17781870
** proxy URL of the HTTP proxy. If undefined or "off" then
17791871
** the "http_proxy" environment variable is consulted.
17801872
** If the http_proxy environment variable is undefined
17811873
** then a direct HTTP connection is used.
1874
+**
1875
+** relative-paths When showing changes and extras, report paths relative
1876
+** to the current working directory. Default: "on"
17821877
**
17831878
** repo-cksum Compute checksums over all files in each checkout
17841879
** as a double-check of correctness. Defaults to "on".
17851880
** Disable on large repositories for a performance
17861881
** improvement.
@@ -1787,10 +1882,28 @@
17871882
**
17881883
** self-register Allow users to register themselves through the HTTP UI.
17891884
** This is useful if you want to see other names than
17901885
** "Anonymous" in e.g. ticketing system. On the other hand
17911886
** users can not be deleted. Default: off.
1887
+**
1888
+** ssl-ca-location The full pathname to a file containing PEM encoded
1889
+** CA root certificates, or a directory of certificates
1890
+** with filenames formed from the certificate hashes as
1891
+** required by OpenSSL.
1892
+** If set, this will override the OS default list of
1893
+** OpenSSL CAs. If unset, the default list will be used.
1894
+** Some platforms may add additional certificates.
1895
+** Check your platform behaviour is as required if the
1896
+** exact contents of the CA root is critical for your
1897
+** application.
1898
+**
1899
+** ssl-identity The full pathname to a file containing a certificate
1900
+** and private key in PEM format. Create by concatenating
1901
+** the certificate and private key files.
1902
+** This identity will be presented to SSL servers to
1903
+** authenticate this client, in addition to the normal
1904
+** password authentication.
17921905
**
17931906
** ssh-command Command used to talk to a remote machine with
17941907
** the "ssh://" protocol.
17951908
**
17961909
** web-browser A shell command used to launch your preferred
@@ -1811,12 +1924,13 @@
18111924
}
18121925
if( unsetFlag && g.argc!=3 ){
18131926
usage("PROPERTY ?-global?");
18141927
}
18151928
if( g.argc==2 ){
1929
+ int openLocal = db_open_local();
18161930
for(i=0; ctrlSettings[i].name; i++){
1817
- print_setting(ctrlSettings[i].name);
1931
+ print_setting(&ctrlSettings[i], openLocal);
18181932
}
18191933
}else if( g.argc==3 || g.argc==4 ){
18201934
const char *zName = g.argv[2];
18211935
int isManifest;
18221936
int n = strlen(zName);
@@ -1834,11 +1948,11 @@
18341948
db_unset(ctrlSettings[i].name, globalFlag);
18351949
}else if( g.argc==4 ){
18361950
db_set(ctrlSettings[i].name, g.argv[3], globalFlag);
18371951
}else{
18381952
isManifest = 0;
1839
- print_setting(ctrlSettings[i].name);
1953
+ print_setting(&ctrlSettings[i], db_open_local());
18401954
}
18411955
if( isManifest && g.localOpen ){
18421956
manifest_to_disk(db_lget_int("checkout", 0));
18431957
}
18441958
}else{
18451959
--- src/db.c
+++ src/db.c
@@ -1399,24 +1399,93 @@
1399 sqlite3 *dbTemp = g.db;
1400 g.db = g.dbConfig;
1401 g.dbConfig = dbTemp;
1402 }
1403 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1404
1405 /*
1406 ** Get and set values from the CONFIG, GLOBAL_CONFIG and VVAR table in the
1407 ** repository and local databases.
1408 */
1409 char *db_get(const char *zName, char *zDefault){
1410 char *z = 0;
 
 
 
 
 
 
 
 
 
1411 if( g.repositoryOpen ){
1412 z = db_text(0, "SELECT value FROM config WHERE name=%Q", zName);
1413 }
1414 if( z==0 && g.configOpen ){
1415 db_swap_connections();
1416 z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
1417 db_swap_connections();
 
 
 
 
1418 }
1419 if( z==0 ){
1420 z = zDefault;
1421 }
1422 return z;
@@ -1603,30 +1672,39 @@
1603 }
1604
1605 /*
1606 ** Print the value of a setting named zName
1607 */
1608 static void print_setting(const char *zName){
1609 Stmt q;
1610 if( g.repositoryOpen ){
1611 db_prepare(&q,
1612 "SELECT '(local)', value FROM config WHERE name=%Q"
1613 " UNION ALL "
1614 "SELECT '(global)', value FROM global_config WHERE name=%Q",
1615 zName, zName
1616 );
1617 }else{
1618 db_prepare(&q,
1619 "SELECT '(global)', value FROM global_config WHERE name=%Q",
1620 zName
1621 );
1622 }
1623 if( db_step(&q)==SQLITE_ROW ){
1624 fossil_print("%-20s %-8s %s\n", zName, db_column_text(&q, 0),
1625 db_column_text(&q, 1));
1626 }else{
1627 fossil_print("%-20s\n", zName);
 
 
 
 
 
 
 
 
 
1628 }
1629 db_finalize(&q);
1630 }
1631
1632
@@ -1642,44 +1720,49 @@
1642 #if INTERFACE
1643 struct stControlSettings {
1644 char const *name; /* Name of the setting */
1645 char const *var; /* Internal variable name used by db_set() */
1646 int width; /* Width of display. 0 for boolean values */
 
1647 char const *def; /* Default value */
1648 };
1649 #endif /* INTERFACE */
1650 struct stControlSettings const ctrlSettings[] = {
1651 { "access-log", 0, 0, "off" },
1652 { "auto-captcha", "autocaptcha", 0, "on" },
1653 { "auto-shun", 0, 0, "on" },
1654 { "autosync", 0, 0, "on" },
1655 { "binary-glob", 0, 32, "" },
1656 { "case-sensitive",0, 0, "on" },
1657 { "clearsign", 0, 0, "off" },
1658 { "crnl-glob", 0, 16, "" },
1659 { "default-perms", 0, 16, "u" },
1660 { "diff-command", 0, 16, "" },
1661 { "dont-push", 0, 0, "off" },
1662 { "editor", 0, 16, "" },
1663 { "gdiff-command", 0, 16, "gdiff" },
1664 { "gmerge-command",0, 40, "" },
1665 { "https-login", 0, 0, "off" },
1666 { "ignore-glob", 0, 40, "" },
1667 { "http-port", 0, 16, "8080" },
1668 { "localauth", 0, 0, "off" },
1669 { "main-branch", 0, 40, "trunk" },
1670 { "manifest", 0, 0, "off" },
1671 { "max-upload", 0, 25, "250000" },
1672 { "mtime-changes", 0, 0, "on" },
1673 { "pgp-command", 0, 32, "gpg --clearsign -o " },
1674 { "proxy", 0, 32, "off" },
1675 { "repo-cksum", 0, 0, "on" },
1676 { "self-register", 0, 0, "off" },
1677 { "ssh-command", 0, 32, "" },
1678 { "web-browser", 0, 32, "" },
1679 { "white-foreground", 0, 0, "off" },
1680 { 0,0,0,0 }
 
 
 
 
1681 };
1682
1683 /*
1684 ** COMMAND: settings
1685 ** COMMAND: unset
@@ -1688,10 +1771,14 @@
1688 ** %fossil unset PROPERTY ?-global?
1689 **
1690 ** The "settings" command with no arguments lists all properties and their
1691 ** values. With just a property name it shows the value of that property.
1692 ** With a value argument it changes the property for the current repository.
 
 
 
 
1693 **
1694 ** The "unset" command clears a property setting.
1695 **
1696 **
1697 ** auto-captcha If enabled, the Login page provides a button to
@@ -1705,13 +1792,13 @@
1705 ** or update and automatically push after commit or
1706 ** tag or branch creation. If the value is "pullonly"
1707 ** then only pull operations occur automatically.
1708 ** Default: on
1709 **
1710 ** binary-glob The VALUE is a comma-separated list of GLOB patterns
1711 ** that should be treated as binary files for merging
1712 ** purposes. Example: *.xml
1713 **
1714 ** case-sensitive If TRUE, the files whose names differ only in case
1715 ** care considered distinct. If FALSE files whose names
1716 ** differ only in case are the same file. Defaults to
1717 ** TRUE for unix and FALSE for windows and mac.
@@ -1718,12 +1805,12 @@
1718 **
1719 ** clearsign When enabled, fossil will attempt to sign all commits
1720 ** with gpg. When disabled (the default), commits will
1721 ** be unsigned. Default: off
1722 **
1723 ** crnl-glob A comma-separated list of GLOB patterns for text files
1724 ** in which it is ok to have CR+NL line endings.
1725 ** Set to "*" to disable CR+NL checking.
1726 **
1727 ** default-perms Permissions given automatically to new users. For more
1728 ** information on permissions see Users page in Server
1729 ** Administration of the HTTP UI. Default: u.
@@ -1731,10 +1818,15 @@
1731 ** diff-command External command to run when performing a diff.
1732 ** If undefined, the internal text diff will be used.
1733 **
1734 ** dont-push Prevent this repository from pushing from client to
1735 ** server. Useful when setting up a private branch.
 
 
 
 
 
1736 **
1737 ** editor Text editor command used for check-in comments.
1738 **
1739 ** gdiff-command External command to run when performing a graphical
1740 ** diff. If undefined, text diff will be used.
@@ -1749,23 +1841,23 @@
1749 ** and "ui" commands. Default: 8080
1750 **
1751 ** https-login Send login creditials using HTTPS instead of HTTP
1752 ** even if the login page request came via HTTP.
1753 **
1754 ** ignore-glob The VALUE is a comma-separated list of GLOB patterns
1755 ** specifying files that the "extra" command will ignore.
1756 ** Example: *.o,*.obj,*.exe
1757 **
1758 ** localauth If enabled, require that HTTP connections from
1759 ** 127.0.0.1 be authenticated by password. If
1760 ** false, all HTTP requests from localhost have
1761 ** unrestricted access to the repository.
1762 **
1763 ** main-branch The primary branch for the project. Default: trunk
1764 **
1765 ** manifest If enabled, automatically create files "manifest" and
1766 ** "manifest.uuid" in every checkout. The SQLite and
1767 ** Fossil repositories both require this. Default: off.
1768 **
1769 ** max-upload A limit on the size of uplink HTTP requests. The
1770 ** default is 250000 bytes.
1771 **
@@ -1777,10 +1869,13 @@
1777 **
1778 ** proxy URL of the HTTP proxy. If undefined or "off" then
1779 ** the "http_proxy" environment variable is consulted.
1780 ** If the http_proxy environment variable is undefined
1781 ** then a direct HTTP connection is used.
 
 
 
1782 **
1783 ** repo-cksum Compute checksums over all files in each checkout
1784 ** as a double-check of correctness. Defaults to "on".
1785 ** Disable on large repositories for a performance
1786 ** improvement.
@@ -1787,10 +1882,28 @@
1787 **
1788 ** self-register Allow users to register themselves through the HTTP UI.
1789 ** This is useful if you want to see other names than
1790 ** "Anonymous" in e.g. ticketing system. On the other hand
1791 ** users can not be deleted. Default: off.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1792 **
1793 ** ssh-command Command used to talk to a remote machine with
1794 ** the "ssh://" protocol.
1795 **
1796 ** web-browser A shell command used to launch your preferred
@@ -1811,12 +1924,13 @@
1811 }
1812 if( unsetFlag && g.argc!=3 ){
1813 usage("PROPERTY ?-global?");
1814 }
1815 if( g.argc==2 ){
 
1816 for(i=0; ctrlSettings[i].name; i++){
1817 print_setting(ctrlSettings[i].name);
1818 }
1819 }else if( g.argc==3 || g.argc==4 ){
1820 const char *zName = g.argv[2];
1821 int isManifest;
1822 int n = strlen(zName);
@@ -1834,11 +1948,11 @@
1834 db_unset(ctrlSettings[i].name, globalFlag);
1835 }else if( g.argc==4 ){
1836 db_set(ctrlSettings[i].name, g.argv[3], globalFlag);
1837 }else{
1838 isManifest = 0;
1839 print_setting(ctrlSettings[i].name);
1840 }
1841 if( isManifest && g.localOpen ){
1842 manifest_to_disk(db_lget_int("checkout", 0));
1843 }
1844 }else{
1845
--- src/db.c
+++ src/db.c
@@ -1399,24 +1399,93 @@
1399 sqlite3 *dbTemp = g.db;
1400 g.db = g.dbConfig;
1401 g.dbConfig = dbTemp;
1402 }
1403 }
1404
1405 /*
1406 ** Logic for reading potentially versioned settings from
1407 ** .fossil-settings/<name> , and emits warnings if necessary.
1408 ** Returns the non-versioned value without modification if there is no
1409 ** versioned value.
1410 */
1411 static char *db_get_do_versionable(const char *zName, char *zNonVersionedSetting){
1412 /* Attempt to load the versioned setting from a checked out file */
1413 char *zVersionedSetting = 0;
1414 int noWarn = 0;
1415
1416 if( db_open_local() ){
1417 Blob versionedPathname;
1418 char *zVersionedPathname;
1419 blob_zero(&versionedPathname);
1420 blob_appendf(&versionedPathname, "%s/.fossil-settings/%s",
1421 g.zLocalRoot, zName);
1422 zVersionedPathname = blob_str(&versionedPathname);
1423 if( file_size(zVersionedPathname)>=0 ){
1424 /* File exists, and contains the value for this setting. Load from
1425 ** the file. */
1426 Blob setting;
1427 blob_zero(&setting);
1428 if( blob_read_from_file(&setting, zVersionedPathname) >= 0 ){
1429 blob_trim(&setting); /* Avoid non-obvious problems with line endings
1430 ** on boolean properties */
1431 zVersionedSetting = strdup(blob_str(&setting));
1432 }
1433 blob_reset(&setting);
1434 /* See if there's a no-warn flag */
1435 blob_append(&versionedPathname, ".no-warn", -1);
1436 if( file_size(blob_str(&versionedPathname))>=0 ){
1437 noWarn = 1;
1438 }
1439 }
1440 blob_reset(&versionedPathname);
1441 }
1442 /* Display a warning? */
1443 if( zVersionedSetting!=0 && zNonVersionedSetting!=0
1444 && zNonVersionedSetting[0]!='\0' && !noWarn
1445 ){
1446 /* There's a versioned setting, and a non-versioned setting. Tell
1447 ** the user about the conflict */
1448 fossil_warning(
1449 "setting %s has both versioned and non-versioned values: using "
1450 "versioned value from file .fossil-settings/%s (to silence this "
1451 "warning, either create an empty file named "
1452 ".fossil-settings/%s.no-warn or delete the non-versioned setting "
1453 " with \"fossil unset %s\")", zName, zName, zName, zName
1454 );
1455 }
1456 /* Prefer the versioned setting */
1457 return ( zVersionedSetting!=0 ) ? zVersionedSetting : zNonVersionedSetting;
1458 }
1459
1460
1461 /*
1462 ** Get and set values from the CONFIG, GLOBAL_CONFIG and VVAR table in the
1463 ** repository and local databases.
1464 */
1465 char *db_get(const char *zName, char *zDefault){
1466 char *z = 0;
1467 int i;
1468 const struct stControlSettings *ctrlSetting = 0;
1469 /* Is this a setting? */
1470 for(i=0; ctrlSettings[i].name; i++){
1471 if( strcmp(ctrlSettings[i].name, zName)==0 ){
1472 ctrlSetting = &(ctrlSettings[i]);
1473 break;
1474 }
1475 }
1476 if( g.repositoryOpen ){
1477 z = db_text(0, "SELECT value FROM config WHERE name=%Q", zName);
1478 }
1479 if( z==0 && g.configOpen ){
1480 db_swap_connections();
1481 z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
1482 db_swap_connections();
1483 }
1484 if( ctrlSetting!=0 && ctrlSetting->versionable ){
1485 /* This is a versionable setting, try and get the info from a checked out file */
1486 z = db_get_do_versionable(zName, z);
1487 }
1488 if( z==0 ){
1489 z = zDefault;
1490 }
1491 return z;
@@ -1603,30 +1672,39 @@
1672 }
1673
1674 /*
1675 ** Print the value of a setting named zName
1676 */
1677 static void print_setting(const struct stControlSettings *ctrlSetting, int localOpen){
1678 Stmt q;
1679 if( g.repositoryOpen ){
1680 db_prepare(&q,
1681 "SELECT '(local)', value FROM config WHERE name=%Q"
1682 " UNION ALL "
1683 "SELECT '(global)', value FROM global_config WHERE name=%Q",
1684 ctrlSetting->name, ctrlSetting->name
1685 );
1686 }else{
1687 db_prepare(&q,
1688 "SELECT '(global)', value FROM global_config WHERE name=%Q",
1689 ctrlSetting->name
1690 );
1691 }
1692 if( db_step(&q)==SQLITE_ROW ){
1693 fossil_print("%-20s %-8s %s\n", ctrlSetting->name, db_column_text(&q, 0),
1694 db_column_text(&q, 1));
1695 }else{
1696 fossil_print("%-20s\n", ctrlSetting->name);
1697 }
1698 if( ctrlSetting->versionable && localOpen ){
1699 /* Check to see if this is overridden by a versionable settings file */
1700 Blob versionedPathname;
1701 blob_zero(&versionedPathname);
1702 blob_appendf(&versionedPathname, "%s/.fossil-settings/%s", g.zLocalRoot, ctrlSetting->name);
1703 if( file_size(blob_str(&versionedPathname))>=0 ){
1704 fossil_print(" (overridden by contents of file .fossil-settings/%s)\n", ctrlSetting->name);
1705 }
1706 }
1707 db_finalize(&q);
1708 }
1709
1710
@@ -1642,44 +1720,49 @@
1720 #if INTERFACE
1721 struct stControlSettings {
1722 char const *name; /* Name of the setting */
1723 char const *var; /* Internal variable name used by db_set() */
1724 int width; /* Width of display. 0 for boolean values */
1725 int versionable; /* Is this setting versionable? */
1726 char const *def; /* Default value */
1727 };
1728 #endif /* INTERFACE */
1729 struct stControlSettings const ctrlSettings[] = {
1730 { "access-log", 0, 0, 0, "off" },
1731 { "auto-captcha", "autocaptcha", 0, 0, "on" },
1732 { "auto-shun", 0, 0, 0, "on" },
1733 { "autosync", 0, 0, 0, "on" },
1734 { "binary-glob", 0, 32, 1, "" },
1735 { "clearsign", 0, 0, 0, "off" },
1736 { "case-sensitive",0, 0, 0, "on" },
1737 { "crnl-glob", 0, 16, 1, "" },
1738 { "default-perms", 0, 16, 0, "u" },
1739 { "diff-command", 0, 16, 0, "" },
1740 { "dont-push", 0, 0, 0, "off" },
1741 { "editor", 0, 16, 0, "" },
1742 { "gdiff-command", 0, 16, 0, "gdiff" },
1743 { "gmerge-command",0, 40, 0, "" },
1744 { "https-login", 0, 0, 0, "off" },
1745 { "ignore-glob", 0, 40, 1, "" },
1746 { "empty-dirs", 0, 40, 1, "" },
1747 { "http-port", 0, 16, 0, "8080" },
1748 { "localauth", 0, 0, 0, "off" },
1749 { "main-branch", 0, 40, 0, "trunk" },
1750 { "manifest", 0, 0, 1, "off" },
1751 { "max-upload", 0, 25, 0, "250000" },
1752 { "mtime-changes", 0, 0, 0, "on" },
1753 { "pgp-command", 0, 32, 0, "gpg --clearsign -o " },
1754 { "proxy", 0, 32, 0, "off" },
1755 { "relative-paths",0, 0, 0, "on" },
1756 { "repo-cksum", 0, 0, 0, "on" },
1757 { "self-register", 0, 0, 0, "off" },
1758 { "ssl-ca-location",0, 40, 0, "" },
1759 { "ssl-identity", 0, 40, 0, "" },
1760 { "ssh-command", 0, 32, 0, "" },
1761 { "web-browser", 0, 32, 0, "" },
1762 { "white-foreground", 0, 0, 0, "off" },
1763 { 0,0,0,0,0 }
1764 };
1765
1766 /*
1767 ** COMMAND: settings
1768 ** COMMAND: unset
@@ -1688,10 +1771,14 @@
1771 ** %fossil unset PROPERTY ?-global?
1772 **
1773 ** The "settings" command with no arguments lists all properties and their
1774 ** values. With just a property name it shows the value of that property.
1775 ** With a value argument it changes the property for the current repository.
1776 **
1777 ** Settings marked as versionable are overridden by the contents of the
1778 ** file named .fossil-settings/PROPERTY in the checked out files, if that
1779 ** file exists.
1780 **
1781 ** The "unset" command clears a property setting.
1782 **
1783 **
1784 ** auto-captcha If enabled, the Login page provides a button to
@@ -1705,13 +1792,13 @@
1792 ** or update and automatically push after commit or
1793 ** tag or branch creation. If the value is "pullonly"
1794 ** then only pull operations occur automatically.
1795 ** Default: on
1796 **
1797 ** binary-glob The VALUE is a comma or newline-separated list of
1798 ** (versionable) GLOB patterns that should be treated as binary files
1799 ** for merging purposes. Example: *.xml
1800 **
1801 ** case-sensitive If TRUE, the files whose names differ only in case
1802 ** care considered distinct. If FALSE files whose names
1803 ** differ only in case are the same file. Defaults to
1804 ** TRUE for unix and FALSE for windows and mac.
@@ -1718,12 +1805,12 @@
1805 **
1806 ** clearsign When enabled, fossil will attempt to sign all commits
1807 ** with gpg. When disabled (the default), commits will
1808 ** be unsigned. Default: off
1809 **
1810 ** crnl-glob A comma or newline-separated list of GLOB patterns for
1811 ** (versionable) text files in which it is ok to have CR+NL line endings.
1812 ** Set to "*" to disable CR+NL checking.
1813 **
1814 ** default-perms Permissions given automatically to new users. For more
1815 ** information on permissions see Users page in Server
1816 ** Administration of the HTTP UI. Default: u.
@@ -1731,10 +1818,15 @@
1818 ** diff-command External command to run when performing a diff.
1819 ** If undefined, the internal text diff will be used.
1820 **
1821 ** dont-push Prevent this repository from pushing from client to
1822 ** server. Useful when setting up a private branch.
1823 **
1824 ** empty-dirs A comma or newline-separated list of pathnames. On
1825 ** (versionable) update and checkout commands, if no file or directory
1826 ** exists with that name, an empty directory will be
1827 ** created.
1828 **
1829 ** editor Text editor command used for check-in comments.
1830 **
1831 ** gdiff-command External command to run when performing a graphical
1832 ** diff. If undefined, text diff will be used.
@@ -1749,23 +1841,23 @@
1841 ** and "ui" commands. Default: 8080
1842 **
1843 ** https-login Send login creditials using HTTPS instead of HTTP
1844 ** even if the login page request came via HTTP.
1845 **
1846 ** ignore-glob The VALUE is a comma or newline-separated list of GLOB
1847 ** (versionable) patterns specifying files that the "extra" command will
1848 ** ignore. Example: *.o,*.obj,*.exe
1849 **
1850 ** localauth If enabled, require that HTTP connections from
1851 ** 127.0.0.1 be authenticated by password. If
1852 ** false, all HTTP requests from localhost have
1853 ** unrestricted access to the repository.
1854 **
1855 ** main-branch The primary branch for the project. Default: trunk
1856 **
1857 ** manifest If enabled, automatically create files "manifest" and
1858 ** (versionable) "manifest.uuid" in every checkout. The SQLite and
1859 ** Fossil repositories both require this. Default: off.
1860 **
1861 ** max-upload A limit on the size of uplink HTTP requests. The
1862 ** default is 250000 bytes.
1863 **
@@ -1777,10 +1869,13 @@
1869 **
1870 ** proxy URL of the HTTP proxy. If undefined or "off" then
1871 ** the "http_proxy" environment variable is consulted.
1872 ** If the http_proxy environment variable is undefined
1873 ** then a direct HTTP connection is used.
1874 **
1875 ** relative-paths When showing changes and extras, report paths relative
1876 ** to the current working directory. Default: "on"
1877 **
1878 ** repo-cksum Compute checksums over all files in each checkout
1879 ** as a double-check of correctness. Defaults to "on".
1880 ** Disable on large repositories for a performance
1881 ** improvement.
@@ -1787,10 +1882,28 @@
1882 **
1883 ** self-register Allow users to register themselves through the HTTP UI.
1884 ** This is useful if you want to see other names than
1885 ** "Anonymous" in e.g. ticketing system. On the other hand
1886 ** users can not be deleted. Default: off.
1887 **
1888 ** ssl-ca-location The full pathname to a file containing PEM encoded
1889 ** CA root certificates, or a directory of certificates
1890 ** with filenames formed from the certificate hashes as
1891 ** required by OpenSSL.
1892 ** If set, this will override the OS default list of
1893 ** OpenSSL CAs. If unset, the default list will be used.
1894 ** Some platforms may add additional certificates.
1895 ** Check your platform behaviour is as required if the
1896 ** exact contents of the CA root is critical for your
1897 ** application.
1898 **
1899 ** ssl-identity The full pathname to a file containing a certificate
1900 ** and private key in PEM format. Create by concatenating
1901 ** the certificate and private key files.
1902 ** This identity will be presented to SSL servers to
1903 ** authenticate this client, in addition to the normal
1904 ** password authentication.
1905 **
1906 ** ssh-command Command used to talk to a remote machine with
1907 ** the "ssh://" protocol.
1908 **
1909 ** web-browser A shell command used to launch your preferred
@@ -1811,12 +1924,13 @@
1924 }
1925 if( unsetFlag && g.argc!=3 ){
1926 usage("PROPERTY ?-global?");
1927 }
1928 if( g.argc==2 ){
1929 int openLocal = db_open_local();
1930 for(i=0; ctrlSettings[i].name; i++){
1931 print_setting(&ctrlSettings[i], openLocal);
1932 }
1933 }else if( g.argc==3 || g.argc==4 ){
1934 const char *zName = g.argv[2];
1935 int isManifest;
1936 int n = strlen(zName);
@@ -1834,11 +1948,11 @@
1948 db_unset(ctrlSettings[i].name, globalFlag);
1949 }else if( g.argc==4 ){
1950 db_set(ctrlSettings[i].name, g.argv[3], globalFlag);
1951 }else{
1952 isManifest = 0;
1953 print_setting(&ctrlSettings[i], db_open_local());
1954 }
1955 if( isManifest && g.localOpen ){
1956 manifest_to_disk(db_lget_int("checkout", 0));
1957 }
1958 }else{
1959
+23 -4
--- src/file.c
+++ src/file.c
@@ -499,26 +499,45 @@
499499
}
500500
}
501501
}
502502
return 1;
503503
}
504
+
505
+/*
506
+** Return a pointer to the first character in a pathname past the
507
+** drive letter. This routine is a no-op on unix.
508
+*/
509
+char *file_without_drive_letter(char *zIn){
510
+#ifdef _WIN32
511
+ if( fossil_isalpha(zIn[0]) && zIn[1]==':' ) zIn += 2;
512
+#endif
513
+ return zIn;
514
+}
504515
505516
/*
506517
** Compute a pathname for a file or directory that is relative
507518
** to the current directory.
508519
*/
509520
void file_relative_name(const char *zOrigName, Blob *pOut){
510521
char *zPath;
511522
blob_set(pOut, zOrigName);
512523
blob_resize(pOut, file_simplify_name(blob_buffer(pOut), blob_size(pOut)));
513
- zPath = blob_buffer(pOut);
524
+ zPath = file_without_drive_letter(blob_buffer(pOut));
514525
if( zPath[0]=='/' ){
515526
int i, j;
516527
Blob tmp;
517
- char zPwd[2000];
518
- file_getcwd(zPwd, sizeof(zPwd)-20);
519
- for(i=1; zPath[i] && zPwd[i]==zPath[i]; i++){}
528
+ char *zPwd;
529
+ char zBuf[2000];
530
+ zPwd = zBuf;
531
+ file_getcwd(zBuf, sizeof(zBuf)-20);
532
+ zPwd = file_without_drive_letter(zBuf);
533
+ i = 1;
534
+#ifdef _WIN32
535
+ while( zPath[i] && fossil_tolower(zPwd[i])==fossil_tolower(zPath[i]) ) i++;
536
+#else
537
+ while( zPath[i] && zPwd[i]==zPath[i] ) i++;
538
+#endif
520539
if( zPath[i]==0 ){
521540
blob_reset(pOut);
522541
if( zPwd[i]==0 ){
523542
blob_append(pOut, ".", 1);
524543
}else{
525544
--- src/file.c
+++ src/file.c
@@ -499,26 +499,45 @@
499 }
500 }
501 }
502 return 1;
503 }
 
 
 
 
 
 
 
 
 
 
 
504
505 /*
506 ** Compute a pathname for a file or directory that is relative
507 ** to the current directory.
508 */
509 void file_relative_name(const char *zOrigName, Blob *pOut){
510 char *zPath;
511 blob_set(pOut, zOrigName);
512 blob_resize(pOut, file_simplify_name(blob_buffer(pOut), blob_size(pOut)));
513 zPath = blob_buffer(pOut);
514 if( zPath[0]=='/' ){
515 int i, j;
516 Blob tmp;
517 char zPwd[2000];
518 file_getcwd(zPwd, sizeof(zPwd)-20);
519 for(i=1; zPath[i] && zPwd[i]==zPath[i]; i++){}
 
 
 
 
 
 
 
 
520 if( zPath[i]==0 ){
521 blob_reset(pOut);
522 if( zPwd[i]==0 ){
523 blob_append(pOut, ".", 1);
524 }else{
525
--- src/file.c
+++ src/file.c
@@ -499,26 +499,45 @@
499 }
500 }
501 }
502 return 1;
503 }
504
505 /*
506 ** Return a pointer to the first character in a pathname past the
507 ** drive letter. This routine is a no-op on unix.
508 */
509 char *file_without_drive_letter(char *zIn){
510 #ifdef _WIN32
511 if( fossil_isalpha(zIn[0]) && zIn[1]==':' ) zIn += 2;
512 #endif
513 return zIn;
514 }
515
516 /*
517 ** Compute a pathname for a file or directory that is relative
518 ** to the current directory.
519 */
520 void file_relative_name(const char *zOrigName, Blob *pOut){
521 char *zPath;
522 blob_set(pOut, zOrigName);
523 blob_resize(pOut, file_simplify_name(blob_buffer(pOut), blob_size(pOut)));
524 zPath = file_without_drive_letter(blob_buffer(pOut));
525 if( zPath[0]=='/' ){
526 int i, j;
527 Blob tmp;
528 char *zPwd;
529 char zBuf[2000];
530 zPwd = zBuf;
531 file_getcwd(zBuf, sizeof(zBuf)-20);
532 zPwd = file_without_drive_letter(zBuf);
533 i = 1;
534 #ifdef _WIN32
535 while( zPath[i] && fossil_tolower(zPwd[i])==fossil_tolower(zPath[i]) ) i++;
536 #else
537 while( zPath[i] && zPwd[i]==zPath[i] ) i++;
538 #endif
539 if( zPath[i]==0 ){
540 blob_reset(pOut);
541 if( zPwd[i]==0 ){
542 blob_append(pOut, ".", 1);
543 }else{
544
+4 -4
--- src/glob.c
+++ src/glob.c
@@ -110,24 +110,24 @@
110110
p = fossil_malloc( sizeof(*p) + nList+1 );
111111
memset(p, 0, sizeof(*p));
112112
z = (char*)&p[1];
113113
memcpy(z, zPatternList, nList+1);
114114
while( z[0] ){
115
- while( z[0]==',' || z[0]==' ' ) z++; /* Skip leading spaces */
115
+ while( z[0]==',' || z[0]==' ' || z[0]=='\n' || z[0]=='\r' ) z++; /* Skip leading spaces and newlines */
116116
if( z[0]=='\'' || z[0]=='"' ){
117117
delimiter = z[0];
118118
z++;
119119
}else{
120120
delimiter = ',';
121121
}
122122
if( z[0]==0 ) break;
123123
p->azPattern = fossil_realloc(p->azPattern, (p->nPattern+1)*sizeof(char*) );
124124
p->azPattern[p->nPattern++] = z;
125
- for(i=0; z[i] && z[i]!=delimiter; i++){}
125
+ for(i=0; z[i] && z[i]!=delimiter && z[i]!='\n' && z[i]!='\r'; i++){}
126126
if( delimiter==',' ){
127
- /* Remove trailing spaces on a comma-delimited pattern */
128
- for(j=i; j>1 && z[j-1]==' '; j--){}
127
+ /* Remove trailing spaces / newlines on a comma-delimited pattern */
128
+ for(j=i; j>1 && (z[j-1]==' ' || z[j-1]=='\n' || z[j-1]=='\r'); j--){}
129129
if( j<i ) z[j] = 0;
130130
}
131131
if( z[i]==0 ) break;
132132
z[i] = 0;
133133
z += i+1;
134134
--- src/glob.c
+++ src/glob.c
@@ -110,24 +110,24 @@
110 p = fossil_malloc( sizeof(*p) + nList+1 );
111 memset(p, 0, sizeof(*p));
112 z = (char*)&p[1];
113 memcpy(z, zPatternList, nList+1);
114 while( z[0] ){
115 while( z[0]==',' || z[0]==' ' ) z++; /* Skip leading spaces */
116 if( z[0]=='\'' || z[0]=='"' ){
117 delimiter = z[0];
118 z++;
119 }else{
120 delimiter = ',';
121 }
122 if( z[0]==0 ) break;
123 p->azPattern = fossil_realloc(p->azPattern, (p->nPattern+1)*sizeof(char*) );
124 p->azPattern[p->nPattern++] = z;
125 for(i=0; z[i] && z[i]!=delimiter; i++){}
126 if( delimiter==',' ){
127 /* Remove trailing spaces on a comma-delimited pattern */
128 for(j=i; j>1 && z[j-1]==' '; j--){}
129 if( j<i ) z[j] = 0;
130 }
131 if( z[i]==0 ) break;
132 z[i] = 0;
133 z += i+1;
134
--- src/glob.c
+++ src/glob.c
@@ -110,24 +110,24 @@
110 p = fossil_malloc( sizeof(*p) + nList+1 );
111 memset(p, 0, sizeof(*p));
112 z = (char*)&p[1];
113 memcpy(z, zPatternList, nList+1);
114 while( z[0] ){
115 while( z[0]==',' || z[0]==' ' || z[0]=='\n' || z[0]=='\r' ) z++; /* Skip leading spaces and newlines */
116 if( z[0]=='\'' || z[0]=='"' ){
117 delimiter = z[0];
118 z++;
119 }else{
120 delimiter = ',';
121 }
122 if( z[0]==0 ) break;
123 p->azPattern = fossil_realloc(p->azPattern, (p->nPattern+1)*sizeof(char*) );
124 p->azPattern[p->nPattern++] = z;
125 for(i=0; z[i] && z[i]!=delimiter && z[i]!='\n' && z[i]!='\r'; i++){}
126 if( delimiter==',' ){
127 /* Remove trailing spaces / newlines on a comma-delimited pattern */
128 for(j=i; j>1 && (z[j-1]==' ' || z[j-1]=='\n' || z[j-1]=='\r'); j--){}
129 if( j<i ) z[j] = 0;
130 }
131 if( z[i]==0 ) break;
132 z[i] = 0;
133 z += i+1;
134
+61 -1
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -78,23 +78,76 @@
7878
** Return the current SSL error message
7979
*/
8080
const char *ssl_errmsg(void){
8181
return sslErrMsg;
8282
}
83
+
84
+/*
85
+** When a server requests a client certificate that hasn't been provided,
86
+** display a warning message explaining what to do next.
87
+*/
88
+static int ssl_client_cert_callback(SSL *ssl, X509 **x509, EVP_PKEY **pkey){
89
+ fossil_warning("The remote server requested a client certificate for "
90
+ "authentication. Specify the pathname to a file containing the PEM "
91
+ "encoded certificate and private key with the --ssl-identity option "
92
+ "or the ssl-identity setting.");
93
+ return 0; /* no cert available */
94
+}
8395
8496
/*
8597
** Call this routine once before any other use of the SSL interface.
8698
** This routine does initial configuration of the SSL module.
8799
*/
88100
void ssl_global_init(void){
101
+ const char *zCaSetting = 0, *zCaFile = 0, *zCaDirectory = 0;
102
+
89103
if( sslIsInit==0 ){
90104
SSL_library_init();
91105
SSL_load_error_strings();
92106
ERR_load_BIO_strings();
93107
OpenSSL_add_all_algorithms();
94108
sslCtx = SSL_CTX_new(SSLv23_client_method());
95
- X509_STORE_set_default_paths(SSL_CTX_get_cert_store(sslCtx));
109
+
110
+ /* Set up acceptable CA root certificates */
111
+ zCaSetting = db_get("ssl-ca-location", 0);
112
+ if( zCaSetting==0 || zCaSetting[0]=='\0' ){
113
+ /* CA location not specified, use platform's default certificate store */
114
+ X509_STORE_set_default_paths(SSL_CTX_get_cert_store(sslCtx));
115
+ }else{
116
+ /* User has specified a CA location, make sure it exists and use it */
117
+ switch( file_isdir(zCaSetting) ){
118
+ case 0: { /* doesn't exist */
119
+ fossil_fatal("ssl-ca-location is set to '%s', "
120
+ "but is not a file or directory", zCaSetting);
121
+ break;
122
+ }
123
+ case 1: { /* directory */
124
+ zCaDirectory = zCaSetting;
125
+ break;
126
+ }
127
+ case 2: { /* file */
128
+ zCaFile = zCaSetting;
129
+ break;
130
+ }
131
+ }
132
+ if( SSL_CTX_load_verify_locations(sslCtx, zCaFile, zCaDirectory)==0 ){
133
+ fossil_fatal("Failed to use CA root certificates from "
134
+ "ssl-ca-location '%s'", zCaSetting);
135
+ }
136
+ }
137
+
138
+ /* Load client SSL identity, preferring the filename specified on the command line */
139
+ const char *identityFile = ( g.zSSLIdentity!= 0) ? g.zSSLIdentity : db_get("ssl-identity", 0);
140
+ if( identityFile!=0 && identityFile[0]!='\0' ){
141
+ if( SSL_CTX_use_certificate_file(sslCtx, identityFile, SSL_FILETYPE_PEM)!= 1
142
+ || SSL_CTX_use_PrivateKey_file(sslCtx, identityFile, SSL_FILETYPE_PEM)!=1 ){
143
+ fossil_fatal("Could not load SSL identity from %s", identityFile);
144
+ }
145
+ }
146
+ /* Register a callback to tell the user what to do when the server asks for a cert */
147
+ SSL_CTX_set_client_cert_cb(sslCtx, ssl_client_cert_callback);
148
+
96149
sslIsInit = 1;
97150
}
98151
}
99152
100153
/*
@@ -204,10 +257,17 @@
204257
if( hasSavedCertificate ){
205258
warning = "WARNING: Certificate doesn't match the "
206259
"saved certificate for this host!";
207260
}
208261
prompt = mprintf("\nUnknown SSL certificate:\n\n%s\n\n%s\n"
262
+ "Either:\n"
263
+ " * verify the certificate is correct using the "
264
+ "SHA1 fingerprint above\n"
265
+ " * use the global ssl-ca-location setting to specify your CA root\n"
266
+ " certificates list\n\n"
267
+ "If you are not expecting this message, answer no and "
268
+ "contact your server\nadministrator.\n\n"
209269
"Accept certificate [a=always/y/N]? ", desc, warning);
210270
BIO_free(mem);
211271
212272
prompt_user(prompt, &ans);
213273
free(prompt);
214274
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -78,23 +78,76 @@
78 ** Return the current SSL error message
79 */
80 const char *ssl_errmsg(void){
81 return sslErrMsg;
82 }
 
 
 
 
 
 
 
 
 
 
 
 
83
84 /*
85 ** Call this routine once before any other use of the SSL interface.
86 ** This routine does initial configuration of the SSL module.
87 */
88 void ssl_global_init(void){
 
 
89 if( sslIsInit==0 ){
90 SSL_library_init();
91 SSL_load_error_strings();
92 ERR_load_BIO_strings();
93 OpenSSL_add_all_algorithms();
94 sslCtx = SSL_CTX_new(SSLv23_client_method());
95 X509_STORE_set_default_paths(SSL_CTX_get_cert_store(sslCtx));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96 sslIsInit = 1;
97 }
98 }
99
100 /*
@@ -204,10 +257,17 @@
204 if( hasSavedCertificate ){
205 warning = "WARNING: Certificate doesn't match the "
206 "saved certificate for this host!";
207 }
208 prompt = mprintf("\nUnknown SSL certificate:\n\n%s\n\n%s\n"
 
 
 
 
 
 
 
209 "Accept certificate [a=always/y/N]? ", desc, warning);
210 BIO_free(mem);
211
212 prompt_user(prompt, &ans);
213 free(prompt);
214
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -78,23 +78,76 @@
78 ** Return the current SSL error message
79 */
80 const char *ssl_errmsg(void){
81 return sslErrMsg;
82 }
83
84 /*
85 ** When a server requests a client certificate that hasn't been provided,
86 ** display a warning message explaining what to do next.
87 */
88 static int ssl_client_cert_callback(SSL *ssl, X509 **x509, EVP_PKEY **pkey){
89 fossil_warning("The remote server requested a client certificate for "
90 "authentication. Specify the pathname to a file containing the PEM "
91 "encoded certificate and private key with the --ssl-identity option "
92 "or the ssl-identity setting.");
93 return 0; /* no cert available */
94 }
95
96 /*
97 ** Call this routine once before any other use of the SSL interface.
98 ** This routine does initial configuration of the SSL module.
99 */
100 void ssl_global_init(void){
101 const char *zCaSetting = 0, *zCaFile = 0, *zCaDirectory = 0;
102
103 if( sslIsInit==0 ){
104 SSL_library_init();
105 SSL_load_error_strings();
106 ERR_load_BIO_strings();
107 OpenSSL_add_all_algorithms();
108 sslCtx = SSL_CTX_new(SSLv23_client_method());
109
110 /* Set up acceptable CA root certificates */
111 zCaSetting = db_get("ssl-ca-location", 0);
112 if( zCaSetting==0 || zCaSetting[0]=='\0' ){
113 /* CA location not specified, use platform's default certificate store */
114 X509_STORE_set_default_paths(SSL_CTX_get_cert_store(sslCtx));
115 }else{
116 /* User has specified a CA location, make sure it exists and use it */
117 switch( file_isdir(zCaSetting) ){
118 case 0: { /* doesn't exist */
119 fossil_fatal("ssl-ca-location is set to '%s', "
120 "but is not a file or directory", zCaSetting);
121 break;
122 }
123 case 1: { /* directory */
124 zCaDirectory = zCaSetting;
125 break;
126 }
127 case 2: { /* file */
128 zCaFile = zCaSetting;
129 break;
130 }
131 }
132 if( SSL_CTX_load_verify_locations(sslCtx, zCaFile, zCaDirectory)==0 ){
133 fossil_fatal("Failed to use CA root certificates from "
134 "ssl-ca-location '%s'", zCaSetting);
135 }
136 }
137
138 /* Load client SSL identity, preferring the filename specified on the command line */
139 const char *identityFile = ( g.zSSLIdentity!= 0) ? g.zSSLIdentity : db_get("ssl-identity", 0);
140 if( identityFile!=0 && identityFile[0]!='\0' ){
141 if( SSL_CTX_use_certificate_file(sslCtx, identityFile, SSL_FILETYPE_PEM)!= 1
142 || SSL_CTX_use_PrivateKey_file(sslCtx, identityFile, SSL_FILETYPE_PEM)!=1 ){
143 fossil_fatal("Could not load SSL identity from %s", identityFile);
144 }
145 }
146 /* Register a callback to tell the user what to do when the server asks for a cert */
147 SSL_CTX_set_client_cert_cb(sslCtx, ssl_client_cert_callback);
148
149 sslIsInit = 1;
150 }
151 }
152
153 /*
@@ -204,10 +257,17 @@
257 if( hasSavedCertificate ){
258 warning = "WARNING: Certificate doesn't match the "
259 "saved certificate for this host!";
260 }
261 prompt = mprintf("\nUnknown SSL certificate:\n\n%s\n\n%s\n"
262 "Either:\n"
263 " * verify the certificate is correct using the "
264 "SHA1 fingerprint above\n"
265 " * use the global ssl-ca-location setting to specify your CA root\n"
266 " certificates list\n\n"
267 "If you are not expecting this message, answer no and "
268 "contact your server\nadministrator.\n\n"
269 "Accept certificate [a=always/y/N]? ", desc, warning);
270 BIO_free(mem);
271
272 prompt_user(prompt, &ans);
273 free(prompt);
274
+2
--- src/main.c
+++ src/main.c
@@ -105,10 +105,11 @@
105105
char *urlProxyAuth; /* Proxy-Authorizer: string */
106106
char *urlFossil; /* The path of the ?fossil=path suffix on ssh: */
107107
int dontKeepUrl; /* Do not persist the URL */
108108
109109
const char *zLogin; /* Login name. "" if not logged in. */
110
+ const char *zSSLIdentity; /* Value of --ssl-identity option, filename of SSL client identity */
110111
int useLocalauth; /* No login required if from 127.0.0.1 */
111112
int noPswd; /* Logged in without password (on 127.0.0.1) */
112113
int userUid; /* Integer user id */
113114
114115
/* Information used to populate the RCVFROM table */
@@ -251,10 +252,11 @@
251252
g.fSystemTrace = find_option("systemtrace", 0, 0)!=0;
252253
if( g.fSqlTrace ) g.fSqlStats = 1;
253254
g.fSqlPrint = find_option("sqlprint", 0, 0)!=0;
254255
g.fHttpTrace = find_option("httptrace", 0, 0)!=0;
255256
g.zLogin = find_option("user", "U", 1);
257
+ g.zSSLIdentity = find_option("ssl-identity", 0, 1);
256258
if( find_option("help",0,0)!=0 ){
257259
/* --help anywhere on the command line is translated into
258260
** "fossil help argv[1] argv[2]..." */
259261
int i;
260262
char **zNewArgv = fossil_malloc( sizeof(char*)*(g.argc+2) );
261263
--- src/main.c
+++ src/main.c
@@ -105,10 +105,11 @@
105 char *urlProxyAuth; /* Proxy-Authorizer: string */
106 char *urlFossil; /* The path of the ?fossil=path suffix on ssh: */
107 int dontKeepUrl; /* Do not persist the URL */
108
109 const char *zLogin; /* Login name. "" if not logged in. */
 
110 int useLocalauth; /* No login required if from 127.0.0.1 */
111 int noPswd; /* Logged in without password (on 127.0.0.1) */
112 int userUid; /* Integer user id */
113
114 /* Information used to populate the RCVFROM table */
@@ -251,10 +252,11 @@
251 g.fSystemTrace = find_option("systemtrace", 0, 0)!=0;
252 if( g.fSqlTrace ) g.fSqlStats = 1;
253 g.fSqlPrint = find_option("sqlprint", 0, 0)!=0;
254 g.fHttpTrace = find_option("httptrace", 0, 0)!=0;
255 g.zLogin = find_option("user", "U", 1);
 
256 if( find_option("help",0,0)!=0 ){
257 /* --help anywhere on the command line is translated into
258 ** "fossil help argv[1] argv[2]..." */
259 int i;
260 char **zNewArgv = fossil_malloc( sizeof(char*)*(g.argc+2) );
261
--- src/main.c
+++ src/main.c
@@ -105,10 +105,11 @@
105 char *urlProxyAuth; /* Proxy-Authorizer: string */
106 char *urlFossil; /* The path of the ?fossil=path suffix on ssh: */
107 int dontKeepUrl; /* Do not persist the URL */
108
109 const char *zLogin; /* Login name. "" if not logged in. */
110 const char *zSSLIdentity; /* Value of --ssl-identity option, filename of SSL client identity */
111 int useLocalauth; /* No login required if from 127.0.0.1 */
112 int noPswd; /* Logged in without password (on 127.0.0.1) */
113 int userUid; /* Integer user id */
114
115 /* Information used to populate the RCVFROM table */
@@ -251,10 +252,11 @@
252 g.fSystemTrace = find_option("systemtrace", 0, 0)!=0;
253 if( g.fSqlTrace ) g.fSqlStats = 1;
254 g.fSqlPrint = find_option("sqlprint", 0, 0)!=0;
255 g.fHttpTrace = find_option("httptrace", 0, 0)!=0;
256 g.zLogin = find_option("user", "U", 1);
257 g.zSSLIdentity = find_option("ssl-identity", 0, 1);
258 if( find_option("help",0,0)!=0 ){
259 /* --help anywhere on the command line is translated into
260 ** "fossil help argv[1] argv[2]..." */
261 int i;
262 char **zNewArgv = fossil_malloc( sizeof(char*)*(g.argc+2) );
263
+11 -2
--- src/setup.c
+++ src/setup.c
@@ -1062,25 +1062,34 @@
10621062
for(pSet=ctrlSettings; pSet->name!=0; pSet++){
10631063
if( pSet->width==0 ){
10641064
onoff_attribute(pSet->name, pSet->name,
10651065
pSet->var!=0 ? pSet->var : pSet->name,
10661066
is_truth(pSet->def));
1067
- @ <br />
1067
+ if( pSet->versionable ){
1068
+ @ (v)<br />
1069
+ } else {
1070
+ @ <br />
1071
+ }
10681072
}
10691073
}
10701074
@ </td><td style="width: 30;"></td><td valign="top">
10711075
for(pSet=ctrlSettings; pSet->name!=0; pSet++){
10721076
if( pSet->width!=0 ){
10731077
entry_attribute(pSet->name, /*pSet->width*/ 40, pSet->name,
10741078
pSet->var!=0 ? pSet->var : pSet->name,
10751079
(char*)pSet->def);
1076
- @ <br />
1080
+ if( pSet->versionable ){
1081
+ @ (v)<br />
1082
+ } else {
1083
+ @ <br />
1084
+ }
10771085
}
10781086
}
10791087
@ </td></tr></table>
10801088
@ <p><input type="submit" name="submit" value="Apply Changes" /></p>
10811089
@ </div></form>
1090
+ @ <p>Settings marked with (v) are 'versionable' and will be overridden by the contents of files named <tt>.fossil-settings/PROPERTY</tt>.</p>
10821091
@ <hr /><p>
10831092
@ These settings work in the same way, as the <kbd>set</kbd> commandline:<br />
10841093
@ </p><pre>%s(zHelp_setting_cmd)</pre>
10851094
db_end_transaction(0);
10861095
style_footer();
10871096
--- src/setup.c
+++ src/setup.c
@@ -1062,25 +1062,34 @@
1062 for(pSet=ctrlSettings; pSet->name!=0; pSet++){
1063 if( pSet->width==0 ){
1064 onoff_attribute(pSet->name, pSet->name,
1065 pSet->var!=0 ? pSet->var : pSet->name,
1066 is_truth(pSet->def));
1067 @ <br />
 
 
 
 
1068 }
1069 }
1070 @ </td><td style="width: 30;"></td><td valign="top">
1071 for(pSet=ctrlSettings; pSet->name!=0; pSet++){
1072 if( pSet->width!=0 ){
1073 entry_attribute(pSet->name, /*pSet->width*/ 40, pSet->name,
1074 pSet->var!=0 ? pSet->var : pSet->name,
1075 (char*)pSet->def);
1076 @ <br />
 
 
 
 
1077 }
1078 }
1079 @ </td></tr></table>
1080 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
1081 @ </div></form>
 
1082 @ <hr /><p>
1083 @ These settings work in the same way, as the <kbd>set</kbd> commandline:<br />
1084 @ </p><pre>%s(zHelp_setting_cmd)</pre>
1085 db_end_transaction(0);
1086 style_footer();
1087
--- src/setup.c
+++ src/setup.c
@@ -1062,25 +1062,34 @@
1062 for(pSet=ctrlSettings; pSet->name!=0; pSet++){
1063 if( pSet->width==0 ){
1064 onoff_attribute(pSet->name, pSet->name,
1065 pSet->var!=0 ? pSet->var : pSet->name,
1066 is_truth(pSet->def));
1067 if( pSet->versionable ){
1068 @ (v)<br />
1069 } else {
1070 @ <br />
1071 }
1072 }
1073 }
1074 @ </td><td style="width: 30;"></td><td valign="top">
1075 for(pSet=ctrlSettings; pSet->name!=0; pSet++){
1076 if( pSet->width!=0 ){
1077 entry_attribute(pSet->name, /*pSet->width*/ 40, pSet->name,
1078 pSet->var!=0 ? pSet->var : pSet->name,
1079 (char*)pSet->def);
1080 if( pSet->versionable ){
1081 @ (v)<br />
1082 } else {
1083 @ <br />
1084 }
1085 }
1086 }
1087 @ </td></tr></table>
1088 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
1089 @ </div></form>
1090 @ <p>Settings marked with (v) are 'versionable' and will be overridden by the contents of files named <tt>.fossil-settings/PROPERTY</tt>.</p>
1091 @ <hr /><p>
1092 @ These settings work in the same way, as the <kbd>set</kbd> commandline:<br />
1093 @ </p><pre>%s(zHelp_setting_cmd)</pre>
1094 db_end_transaction(0);
1095 style_footer();
1096
+57
--- src/update.c
+++ src/update.c
@@ -115,10 +115,13 @@
115115
}
116116
if( !nochangeFlag && db_exists("SELECT 1 FROM vmerge") ){
117117
fossil_fatal("cannot update an uncommitted merge");
118118
}
119119
if( !nochangeFlag && !internalUpdate ) autosync(AUTOSYNC_PULL);
120
+
121
+ /* Create any empty directories now, as well as after the update, so changes in settings are reflected now */
122
+ ensure_empty_dirs_created();
120123
121124
if( internalUpdate ){
122125
tid = internalUpdate;
123126
}else if( g.argc>=3 ){
124127
if( fossil_strcmp(g.argv[2], "current")==0 ){
@@ -441,10 +444,11 @@
441444
** Clean up the mid and pid VFILE entries. Then commit the changes.
442445
*/
443446
if( nochangeFlag ){
444447
db_end_transaction(1); /* With --nochange, rollback changes */
445448
}else{
449
+ ensure_empty_dirs_created();
446450
if( g.argc<=3 ){
447451
/* All files updated. Shift the current checkout to the target. */
448452
db_multi_exec("DELETE FROM vfile WHERE vid!=%d", tid);
449453
checkout_set_all_exe(tid);
450454
manifest_to_disk(tid);
@@ -456,10 +460,63 @@
456460
}
457461
if( !internalUpdate ) undo_finish();
458462
db_end_transaction(0);
459463
}
460464
}
465
+
466
+/*
467
+** Make sure empty directories are created
468
+*/
469
+void ensure_empty_dirs_created(void){
470
+ /* Make empty directories? */
471
+ char *zEmptyDirs = db_get("empty-dirs", 0);
472
+ if( zEmptyDirs!=0 ){
473
+ char *bc;
474
+ Blob dirName;
475
+ Blob dirsList;
476
+
477
+ blob_zero(&dirsList);
478
+ blob_init(&dirsList, zEmptyDirs, strlen(zEmptyDirs));
479
+ /* Replace commas by spaces */
480
+ bc = blob_str(&dirsList);
481
+ while( (*bc)!='\0' ){
482
+ if( (*bc)==',' ) { *bc = ' '; }
483
+ ++bc;
484
+ }
485
+ /* Make directories */
486
+ blob_zero(&dirName);
487
+ while( blob_token(&dirsList, &dirName) ){
488
+ const char *zDir = blob_str(&dirName);
489
+ /* Make full pathname of the directory */
490
+ Blob path;
491
+ const char *zPath;
492
+
493
+ blob_zero(&path);
494
+ blob_appendf(&path, "%s/%s", g.zLocalRoot, zDir);
495
+ zPath = blob_str(&path);
496
+ /* Handle various cases of existence of the directory */
497
+ switch( file_isdir(zPath) ){
498
+ case 0: { /* doesn't exist */
499
+ if( file_mkdir(zPath, 0)!=0 ) {
500
+ fossil_warning("couldn't create directory %s as "
501
+ "required by empty-dirs setting", zDir);
502
+ }
503
+ break;
504
+ }
505
+ case 1: { /* exists, and is a directory */
506
+ /* do nothing - required directory exists already */
507
+ break;
508
+ }
509
+ case 2: { /* exists, but isn't a directory */
510
+ fossil_warning("file %s found, but a directory is required "
511
+ "by empty-dirs setting", zDir);
512
+ }
513
+ }
514
+ blob_reset(&path);
515
+ }
516
+ }
517
+}
461518
462519
463520
/*
464521
** Get the contents of a file within the checking "revision". If
465522
** revision==NULL then get the file content for the current checkout.
466523
--- src/update.c
+++ src/update.c
@@ -115,10 +115,13 @@
115 }
116 if( !nochangeFlag && db_exists("SELECT 1 FROM vmerge") ){
117 fossil_fatal("cannot update an uncommitted merge");
118 }
119 if( !nochangeFlag && !internalUpdate ) autosync(AUTOSYNC_PULL);
 
 
 
120
121 if( internalUpdate ){
122 tid = internalUpdate;
123 }else if( g.argc>=3 ){
124 if( fossil_strcmp(g.argv[2], "current")==0 ){
@@ -441,10 +444,11 @@
441 ** Clean up the mid and pid VFILE entries. Then commit the changes.
442 */
443 if( nochangeFlag ){
444 db_end_transaction(1); /* With --nochange, rollback changes */
445 }else{
 
446 if( g.argc<=3 ){
447 /* All files updated. Shift the current checkout to the target. */
448 db_multi_exec("DELETE FROM vfile WHERE vid!=%d", tid);
449 checkout_set_all_exe(tid);
450 manifest_to_disk(tid);
@@ -456,10 +460,63 @@
456 }
457 if( !internalUpdate ) undo_finish();
458 db_end_transaction(0);
459 }
460 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
461
462
463 /*
464 ** Get the contents of a file within the checking "revision". If
465 ** revision==NULL then get the file content for the current checkout.
466
--- src/update.c
+++ src/update.c
@@ -115,10 +115,13 @@
115 }
116 if( !nochangeFlag && db_exists("SELECT 1 FROM vmerge") ){
117 fossil_fatal("cannot update an uncommitted merge");
118 }
119 if( !nochangeFlag && !internalUpdate ) autosync(AUTOSYNC_PULL);
120
121 /* Create any empty directories now, as well as after the update, so changes in settings are reflected now */
122 ensure_empty_dirs_created();
123
124 if( internalUpdate ){
125 tid = internalUpdate;
126 }else if( g.argc>=3 ){
127 if( fossil_strcmp(g.argv[2], "current")==0 ){
@@ -441,10 +444,11 @@
444 ** Clean up the mid and pid VFILE entries. Then commit the changes.
445 */
446 if( nochangeFlag ){
447 db_end_transaction(1); /* With --nochange, rollback changes */
448 }else{
449 ensure_empty_dirs_created();
450 if( g.argc<=3 ){
451 /* All files updated. Shift the current checkout to the target. */
452 db_multi_exec("DELETE FROM vfile WHERE vid!=%d", tid);
453 checkout_set_all_exe(tid);
454 manifest_to_disk(tid);
@@ -456,10 +460,63 @@
460 }
461 if( !internalUpdate ) undo_finish();
462 db_end_transaction(0);
463 }
464 }
465
466 /*
467 ** Make sure empty directories are created
468 */
469 void ensure_empty_dirs_created(void){
470 /* Make empty directories? */
471 char *zEmptyDirs = db_get("empty-dirs", 0);
472 if( zEmptyDirs!=0 ){
473 char *bc;
474 Blob dirName;
475 Blob dirsList;
476
477 blob_zero(&dirsList);
478 blob_init(&dirsList, zEmptyDirs, strlen(zEmptyDirs));
479 /* Replace commas by spaces */
480 bc = blob_str(&dirsList);
481 while( (*bc)!='\0' ){
482 if( (*bc)==',' ) { *bc = ' '; }
483 ++bc;
484 }
485 /* Make directories */
486 blob_zero(&dirName);
487 while( blob_token(&dirsList, &dirName) ){
488 const char *zDir = blob_str(&dirName);
489 /* Make full pathname of the directory */
490 Blob path;
491 const char *zPath;
492
493 blob_zero(&path);
494 blob_appendf(&path, "%s/%s", g.zLocalRoot, zDir);
495 zPath = blob_str(&path);
496 /* Handle various cases of existence of the directory */
497 switch( file_isdir(zPath) ){
498 case 0: { /* doesn't exist */
499 if( file_mkdir(zPath, 0)!=0 ) {
500 fossil_warning("couldn't create directory %s as "
501 "required by empty-dirs setting", zDir);
502 }
503 break;
504 }
505 case 1: { /* exists, and is a directory */
506 /* do nothing - required directory exists already */
507 break;
508 }
509 case 2: { /* exists, but isn't a directory */
510 fossil_warning("file %s found, but a directory is required "
511 "by empty-dirs setting", zDir);
512 }
513 }
514 blob_reset(&path);
515 }
516 }
517 }
518
519
520 /*
521 ** Get the contents of a file within the checking "revision". If
522 ** revision==NULL then get the file content for the current checkout.
523
--- www/changes.wiki
+++ www/changes.wiki
@@ -3,10 +3,25 @@
33
<h2>Changes For Version 1.19 (pending)</h2>
44
55
* Added a ./configure script based on autosetup.
66
* Added the "[/help/winsrv | fossil winsrv]" command
77
for creating a Fossil service on windows systems.
8
+ * Added "versionable settings" where settings that affect
9
+ the local tree can be stored in versioned files in the
10
+ .fossil-settings directory.
11
+ * The status, changes and extras commands now show
12
+ pathnames relative to the current working directory,
13
+ unless overridden by command line options or the
14
+ "relative-paths" setting.<br><b>WARNING:</b> This
15
+ change will break scripts which rely on the current
16
+ output when the current working directory is not the
17
+ repository root.
18
+ * Added "empty-dirs" versionable setting.
19
+ * Added support for client-side SSL certificates with "ssl-identity"
20
+ setting and --ssl-identity option.
21
+ * Added "ssl-ca-location" setting to specify trusted root
22
+ SSL certificates.
823
924
<h2>Changes For Version 1.18 (2011-07-14)</h2>
1025
1126
* Added this Change Log
1227
* Added sequential version numbering
1328
--- www/changes.wiki
+++ www/changes.wiki
@@ -3,10 +3,25 @@
3 <h2>Changes For Version 1.19 (pending)</h2>
4
5 * Added a ./configure script based on autosetup.
6 * Added the "[/help/winsrv | fossil winsrv]" command
7 for creating a Fossil service on windows systems.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
9 <h2>Changes For Version 1.18 (2011-07-14)</h2>
10
11 * Added this Change Log
12 * Added sequential version numbering
13
--- www/changes.wiki
+++ www/changes.wiki
@@ -3,10 +3,25 @@
3 <h2>Changes For Version 1.19 (pending)</h2>
4
5 * Added a ./configure script based on autosetup.
6 * Added the "[/help/winsrv | fossil winsrv]" command
7 for creating a Fossil service on windows systems.
8 * Added "versionable settings" where settings that affect
9 the local tree can be stored in versioned files in the
10 .fossil-settings directory.
11 * The status, changes and extras commands now show
12 pathnames relative to the current working directory,
13 unless overridden by command line options or the
14 "relative-paths" setting.<br><b>WARNING:</b> This
15 change will break scripts which rely on the current
16 output when the current working directory is not the
17 repository root.
18 * Added "empty-dirs" versionable setting.
19 * Added support for client-side SSL certificates with "ssl-identity"
20 setting and --ssl-identity option.
21 * Added "ssl-ca-location" setting to specify trusted root
22 SSL certificates.
23
24 <h2>Changes For Version 1.18 (2011-07-14)</h2>
25
26 * Added this Change Log
27 * Added sequential version numbering
28
--- www/index.wiki
+++ www/index.wiki
@@ -127,10 +127,12 @@
127127
* The [./selfcheck.wiki | automatic self-check] mechanism
128128
helps insure project integrity.
129129
* Fossil contains a [./wikitheory.wiki | built-in wiki].
130130
* An [./event.wiki | Event] is a special kind of wiki page associated
131131
with a point in time rather than a name.
132
+ * [./settings.wiki | Settings] control the behaviour of fossil.
133
+ * [./ssl.wiki | Use SSL] to encrypt communication with the server.
132134
* There is a
133135
[http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users | mailing list] (with publicly readable
134136
[http://www.mail-archive.com/[email protected] | archives]
135137
available for discussing fossil issues.
136138
* [./stats.wiki | Performance statistics] taken from real-world projects
137139
--- www/index.wiki
+++ www/index.wiki
@@ -127,10 +127,12 @@
127 * The [./selfcheck.wiki | automatic self-check] mechanism
128 helps insure project integrity.
129 * Fossil contains a [./wikitheory.wiki | built-in wiki].
130 * An [./event.wiki | Event] is a special kind of wiki page associated
131 with a point in time rather than a name.
 
 
132 * There is a
133 [http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users | mailing list] (with publicly readable
134 [http://www.mail-archive.com/[email protected] | archives]
135 available for discussing fossil issues.
136 * [./stats.wiki | Performance statistics] taken from real-world projects
137
--- www/index.wiki
+++ www/index.wiki
@@ -127,10 +127,12 @@
127 * The [./selfcheck.wiki | automatic self-check] mechanism
128 helps insure project integrity.
129 * Fossil contains a [./wikitheory.wiki | built-in wiki].
130 * An [./event.wiki | Event] is a special kind of wiki page associated
131 with a point in time rather than a name.
132 * [./settings.wiki | Settings] control the behaviour of fossil.
133 * [./ssl.wiki | Use SSL] to encrypt communication with the server.
134 * There is a
135 [http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users | mailing list] (with publicly readable
136 [http://www.mail-archive.com/[email protected] | archives]
137 available for discussing fossil issues.
138 * [./stats.wiki | Performance statistics] taken from real-world projects
139
--- www/mkindex.tcl
+++ www/mkindex.tcl
@@ -9,10 +9,11 @@
99
set doclist {
1010
bugtheory.wiki {Bug Tracking In Fossil}
1111
branching.wiki {Branching, Forking, Merging, and Tagging}
1212
build.wiki {Building and Installing Fossil}
1313
checkin_names.wiki {Checkin And Version Names}
14
+ changes.wiki {Fossil Changelog}
1415
copyright-release.html {Contributor License Agreement}
1516
concepts.wiki {Fossil Core Concepts}
1617
contribute.wiki {Contributing Code or Documentation To The Fossil Project}
1718
custom_ticket.wiki {Customizing The Ticket System}
1819
delta_encoder_algorithm.wiki {Fossil Delta Encoding Algorithm}
@@ -35,13 +36,15 @@
3536
{Quotes: What People Are Saying About Fossil, Git, and DVCSes in General}
3637
../test/release-checklist.wiki {Pre-Release Testing Checklist}
3738
selfcheck.wiki {Fossil Repository Integrity Self Checks}
3839
selfhost.wiki {Fossil Self Hosting Repositories}
3940
server.wiki {How To Configure A Fossil Server}
41
+ settings.wiki {Fossil Settings}
4042
shunning.wiki {Shunning: Deleting Content From Fossil}
4143
stats.wiki {Performance Statistics}
4244
style.wiki {Source Code Style Guidelines}
45
+ ssl.wiki {Using SSL with Fossil}
4346
sync.wiki {The Fossil Sync Protocol}
4447
tech_overview.wiki {A Technical Overview Of The Design And Implementation
4548
Of Fossil}
4649
tech_overview.wiki {SQLite Databases Used By Fossil}
4750
theory1.wiki {Thoughts On The Design Of The Fossil DVCS}
4851
--- www/mkindex.tcl
+++ www/mkindex.tcl
@@ -9,10 +9,11 @@
9 set doclist {
10 bugtheory.wiki {Bug Tracking In Fossil}
11 branching.wiki {Branching, Forking, Merging, and Tagging}
12 build.wiki {Building and Installing Fossil}
13 checkin_names.wiki {Checkin And Version Names}
 
14 copyright-release.html {Contributor License Agreement}
15 concepts.wiki {Fossil Core Concepts}
16 contribute.wiki {Contributing Code or Documentation To The Fossil Project}
17 custom_ticket.wiki {Customizing The Ticket System}
18 delta_encoder_algorithm.wiki {Fossil Delta Encoding Algorithm}
@@ -35,13 +36,15 @@
35 {Quotes: What People Are Saying About Fossil, Git, and DVCSes in General}
36 ../test/release-checklist.wiki {Pre-Release Testing Checklist}
37 selfcheck.wiki {Fossil Repository Integrity Self Checks}
38 selfhost.wiki {Fossil Self Hosting Repositories}
39 server.wiki {How To Configure A Fossil Server}
 
40 shunning.wiki {Shunning: Deleting Content From Fossil}
41 stats.wiki {Performance Statistics}
42 style.wiki {Source Code Style Guidelines}
 
43 sync.wiki {The Fossil Sync Protocol}
44 tech_overview.wiki {A Technical Overview Of The Design And Implementation
45 Of Fossil}
46 tech_overview.wiki {SQLite Databases Used By Fossil}
47 theory1.wiki {Thoughts On The Design Of The Fossil DVCS}
48
--- www/mkindex.tcl
+++ www/mkindex.tcl
@@ -9,10 +9,11 @@
9 set doclist {
10 bugtheory.wiki {Bug Tracking In Fossil}
11 branching.wiki {Branching, Forking, Merging, and Tagging}
12 build.wiki {Building and Installing Fossil}
13 checkin_names.wiki {Checkin And Version Names}
14 changes.wiki {Fossil Changelog}
15 copyright-release.html {Contributor License Agreement}
16 concepts.wiki {Fossil Core Concepts}
17 contribute.wiki {Contributing Code or Documentation To The Fossil Project}
18 custom_ticket.wiki {Customizing The Ticket System}
19 delta_encoder_algorithm.wiki {Fossil Delta Encoding Algorithm}
@@ -35,13 +36,15 @@
36 {Quotes: What People Are Saying About Fossil, Git, and DVCSes in General}
37 ../test/release-checklist.wiki {Pre-Release Testing Checklist}
38 selfcheck.wiki {Fossil Repository Integrity Self Checks}
39 selfhost.wiki {Fossil Self Hosting Repositories}
40 server.wiki {How To Configure A Fossil Server}
41 settings.wiki {Fossil Settings}
42 shunning.wiki {Shunning: Deleting Content From Fossil}
43 stats.wiki {Performance Statistics}
44 style.wiki {Source Code Style Guidelines}
45 ssl.wiki {Using SSL with Fossil}
46 sync.wiki {The Fossil Sync Protocol}
47 tech_overview.wiki {A Technical Overview Of The Design And Implementation
48 Of Fossil}
49 tech_overview.wiki {SQLite Databases Used By Fossil}
50 theory1.wiki {Thoughts On The Design Of The Fossil DVCS}
51
--- www/permutedindex.wiki
+++ www/permutedindex.wiki
@@ -11,10 +11,11 @@
1111
<li><a href="private.wiki">Branches &#151; Creating, Syncing, and Deleting Private</a></li>
1212
<li><a href="branching.wiki">Branching, Forking, Merging, and Tagging</a></li>
1313
<li><a href="bugtheory.wiki">Bug Tracking In Fossil</a></li>
1414
<li><a href="makefile.wiki">Build Process &#151; The Fossil</a></li>
1515
<li><a href="build.wiki">Building and Installing Fossil</a></li>
16
+<li><a href="changes.wiki">Changelog &#151; Fossil</a></li>
1617
<li><a href="checkin_names.wiki">Checkin And Version Names</a></li>
1718
<li><a href="../test/release-checklist.wiki">Checklist &#151; Pre-Release Testing</a></li>
1819
<li><a href="foss-cklist.wiki">Checklist For Successful Open-Source Projects</a></li>
1920
<li><a href="selfcheck.wiki">Checks &#151; Fossil Repository Integrity Self</a></li>
2021
<li><a href="contribute.wiki">Code or Documentation To The Fossil Project &#151; Contributing</a></li>
@@ -44,17 +45,19 @@
4445
<li><a href="inout.wiki">Export To And From Git &#151; Import And</a></li>
4546
<li><a href="fileformat.wiki">File Format &#151; Fossil</a></li>
4647
<li><a href="branching.wiki">Forking, Merging, and Tagging &#151; Branching,</a></li>
4748
<li><a href="delta_format.wiki">Format &#151; Fossil Delta</a></li>
4849
<li><a href="fileformat.wiki">Format &#151; Fossil File</a></li>
50
+<li><a href="changes.wiki">Fossil Changelog</a></li>
4951
<li><a href="concepts.wiki">Fossil Core Concepts</a></li>
5052
<li><a href="delta_encoder_algorithm.wiki">Fossil Delta Encoding Algorithm</a></li>
5153
<li><a href="delta_format.wiki">Fossil Delta Format</a></li>
5254
<li><a href="fileformat.wiki">Fossil File Format</a></li>
5355
<li><a href="quickstart.wiki">Fossil Quick Start Guide</a></li>
5456
<li><a href="selfcheck.wiki">Fossil Repository Integrity Self Checks</a></li>
5557
<li><a href="selfhost.wiki">Fossil Self Hosting Repositories</a></li>
58
+<li><a href="settings.wiki">Fossil Settings</a></li>
5659
<li><a href="fossil-v-git.wiki">Fossil Versus Git</a></li>
5760
<li><a href="quotes.wiki">Fossil, Git, and DVCSes in General &#151; Quotes: What People Are Saying About</a></li>
5861
<li><a href="faq.wiki">Frequently Asked Questions</a></li>
5962
<li><a href="shunning.wiki">From Fossil &#151; Shunning: Deleting Content</a></li>
6063
<li><a href="inout.wiki">From Git &#151; Import And Export To And</a></li>
@@ -99,13 +102,15 @@
99102
<li><a href="selfcheck.wiki">Repository Integrity Self Checks &#151; Fossil</a></li>
100103
<li><a href="quotes.wiki">Saying About Fossil, Git, and DVCSes in General &#151; Quotes: What People Are</a></li>
101104
<li><a href="selfcheck.wiki">Self Checks &#151; Fossil Repository Integrity</a></li>
102105
<li><a href="selfhost.wiki">Self Hosting Repositories &#151; Fossil</a></li>
103106
<li><a href="server.wiki">Server &#151; How To Configure A Fossil</a></li>
107
+<li><a href="settings.wiki">Settings &#151; Fossil</a></li>
104108
<li><a href="shunning.wiki">Shunning: Deleting Content From Fossil</a></li>
105109
<li><a href="style.wiki">Source Code Style Guidelines</a></li>
106110
<li><a href="tech_overview.wiki">SQLite Databases Used By Fossil</a></li>
111
+<li><a href="ssl.wiki">SSL with Fossil &#151; Using</a></li>
107112
<li><a href="quickstart.wiki">Start Guide &#151; Fossil Quick</a></li>
108113
<li><a href="stats.wiki">Statistics &#151; Performance</a></li>
109114
<li><a href="style.wiki">Style Guidelines &#151; Source Code</a></li>
110115
<li><a href="foss-cklist.wiki">Successful Open-Source Projects &#151; Checklist For</a></li>
111116
<li><a href="sync.wiki">Sync Protocol &#151; The Fossil</a></li>
@@ -118,11 +123,13 @@
118123
<li><a href="sync.wiki">The Fossil Sync Protocol</a></li>
119124
<li><a href="webui.wiki">The Fossil Web Interface</a></li>
120125
<li><a href="theory1.wiki">Thoughts On The Design Of The Fossil DVCS</a></li>
121126
<li><a href="custom_ticket.wiki">Ticket System &#151; Customizing The</a></li>
122127
<li><a href="bugtheory.wiki">Tracking In Fossil &#151; Bug</a></li>
128
+<li><a href="ssl.wiki">Using SSL with Fossil</a></li>
123129
<li><a href="checkin_names.wiki">Version Names &#151; Checkin And</a></li>
124130
<li><a href="fossil-v-git.wiki">Versus Git &#151; Fossil</a></li>
125131
<li><a href="webui.wiki">Web Interface &#151; The Fossil</a></li>
126132
<li><a href="quotes.wiki">What People Are Saying About Fossil, Git, and DVCSes in General &#151; Quotes:</a></li>
127133
<li><a href="wikitheory.wiki">Wiki In Fossil</a></li>
134
+<li><a href="ssl.wiki">with Fossil &#151; Using SSL</a></li>
128135
</ul>
129136
--- www/permutedindex.wiki
+++ www/permutedindex.wiki
@@ -11,10 +11,11 @@
11 <li><a href="private.wiki">Branches &#151; Creating, Syncing, and Deleting Private</a></li>
12 <li><a href="branching.wiki">Branching, Forking, Merging, and Tagging</a></li>
13 <li><a href="bugtheory.wiki">Bug Tracking In Fossil</a></li>
14 <li><a href="makefile.wiki">Build Process &#151; The Fossil</a></li>
15 <li><a href="build.wiki">Building and Installing Fossil</a></li>
 
16 <li><a href="checkin_names.wiki">Checkin And Version Names</a></li>
17 <li><a href="../test/release-checklist.wiki">Checklist &#151; Pre-Release Testing</a></li>
18 <li><a href="foss-cklist.wiki">Checklist For Successful Open-Source Projects</a></li>
19 <li><a href="selfcheck.wiki">Checks &#151; Fossil Repository Integrity Self</a></li>
20 <li><a href="contribute.wiki">Code or Documentation To The Fossil Project &#151; Contributing</a></li>
@@ -44,17 +45,19 @@
44 <li><a href="inout.wiki">Export To And From Git &#151; Import And</a></li>
45 <li><a href="fileformat.wiki">File Format &#151; Fossil</a></li>
46 <li><a href="branching.wiki">Forking, Merging, and Tagging &#151; Branching,</a></li>
47 <li><a href="delta_format.wiki">Format &#151; Fossil Delta</a></li>
48 <li><a href="fileformat.wiki">Format &#151; Fossil File</a></li>
 
49 <li><a href="concepts.wiki">Fossil Core Concepts</a></li>
50 <li><a href="delta_encoder_algorithm.wiki">Fossil Delta Encoding Algorithm</a></li>
51 <li><a href="delta_format.wiki">Fossil Delta Format</a></li>
52 <li><a href="fileformat.wiki">Fossil File Format</a></li>
53 <li><a href="quickstart.wiki">Fossil Quick Start Guide</a></li>
54 <li><a href="selfcheck.wiki">Fossil Repository Integrity Self Checks</a></li>
55 <li><a href="selfhost.wiki">Fossil Self Hosting Repositories</a></li>
 
56 <li><a href="fossil-v-git.wiki">Fossil Versus Git</a></li>
57 <li><a href="quotes.wiki">Fossil, Git, and DVCSes in General &#151; Quotes: What People Are Saying About</a></li>
58 <li><a href="faq.wiki">Frequently Asked Questions</a></li>
59 <li><a href="shunning.wiki">From Fossil &#151; Shunning: Deleting Content</a></li>
60 <li><a href="inout.wiki">From Git &#151; Import And Export To And</a></li>
@@ -99,13 +102,15 @@
99 <li><a href="selfcheck.wiki">Repository Integrity Self Checks &#151; Fossil</a></li>
100 <li><a href="quotes.wiki">Saying About Fossil, Git, and DVCSes in General &#151; Quotes: What People Are</a></li>
101 <li><a href="selfcheck.wiki">Self Checks &#151; Fossil Repository Integrity</a></li>
102 <li><a href="selfhost.wiki">Self Hosting Repositories &#151; Fossil</a></li>
103 <li><a href="server.wiki">Server &#151; How To Configure A Fossil</a></li>
 
104 <li><a href="shunning.wiki">Shunning: Deleting Content From Fossil</a></li>
105 <li><a href="style.wiki">Source Code Style Guidelines</a></li>
106 <li><a href="tech_overview.wiki">SQLite Databases Used By Fossil</a></li>
 
107 <li><a href="quickstart.wiki">Start Guide &#151; Fossil Quick</a></li>
108 <li><a href="stats.wiki">Statistics &#151; Performance</a></li>
109 <li><a href="style.wiki">Style Guidelines &#151; Source Code</a></li>
110 <li><a href="foss-cklist.wiki">Successful Open-Source Projects &#151; Checklist For</a></li>
111 <li><a href="sync.wiki">Sync Protocol &#151; The Fossil</a></li>
@@ -118,11 +123,13 @@
118 <li><a href="sync.wiki">The Fossil Sync Protocol</a></li>
119 <li><a href="webui.wiki">The Fossil Web Interface</a></li>
120 <li><a href="theory1.wiki">Thoughts On The Design Of The Fossil DVCS</a></li>
121 <li><a href="custom_ticket.wiki">Ticket System &#151; Customizing The</a></li>
122 <li><a href="bugtheory.wiki">Tracking In Fossil &#151; Bug</a></li>
 
123 <li><a href="checkin_names.wiki">Version Names &#151; Checkin And</a></li>
124 <li><a href="fossil-v-git.wiki">Versus Git &#151; Fossil</a></li>
125 <li><a href="webui.wiki">Web Interface &#151; The Fossil</a></li>
126 <li><a href="quotes.wiki">What People Are Saying About Fossil, Git, and DVCSes in General &#151; Quotes:</a></li>
127 <li><a href="wikitheory.wiki">Wiki In Fossil</a></li>
 
128 </ul>
129
--- www/permutedindex.wiki
+++ www/permutedindex.wiki
@@ -11,10 +11,11 @@
11 <li><a href="private.wiki">Branches &#151; Creating, Syncing, and Deleting Private</a></li>
12 <li><a href="branching.wiki">Branching, Forking, Merging, and Tagging</a></li>
13 <li><a href="bugtheory.wiki">Bug Tracking In Fossil</a></li>
14 <li><a href="makefile.wiki">Build Process &#151; The Fossil</a></li>
15 <li><a href="build.wiki">Building and Installing Fossil</a></li>
16 <li><a href="changes.wiki">Changelog &#151; Fossil</a></li>
17 <li><a href="checkin_names.wiki">Checkin And Version Names</a></li>
18 <li><a href="../test/release-checklist.wiki">Checklist &#151; Pre-Release Testing</a></li>
19 <li><a href="foss-cklist.wiki">Checklist For Successful Open-Source Projects</a></li>
20 <li><a href="selfcheck.wiki">Checks &#151; Fossil Repository Integrity Self</a></li>
21 <li><a href="contribute.wiki">Code or Documentation To The Fossil Project &#151; Contributing</a></li>
@@ -44,17 +45,19 @@
45 <li><a href="inout.wiki">Export To And From Git &#151; Import And</a></li>
46 <li><a href="fileformat.wiki">File Format &#151; Fossil</a></li>
47 <li><a href="branching.wiki">Forking, Merging, and Tagging &#151; Branching,</a></li>
48 <li><a href="delta_format.wiki">Format &#151; Fossil Delta</a></li>
49 <li><a href="fileformat.wiki">Format &#151; Fossil File</a></li>
50 <li><a href="changes.wiki">Fossil Changelog</a></li>
51 <li><a href="concepts.wiki">Fossil Core Concepts</a></li>
52 <li><a href="delta_encoder_algorithm.wiki">Fossil Delta Encoding Algorithm</a></li>
53 <li><a href="delta_format.wiki">Fossil Delta Format</a></li>
54 <li><a href="fileformat.wiki">Fossil File Format</a></li>
55 <li><a href="quickstart.wiki">Fossil Quick Start Guide</a></li>
56 <li><a href="selfcheck.wiki">Fossil Repository Integrity Self Checks</a></li>
57 <li><a href="selfhost.wiki">Fossil Self Hosting Repositories</a></li>
58 <li><a href="settings.wiki">Fossil Settings</a></li>
59 <li><a href="fossil-v-git.wiki">Fossil Versus Git</a></li>
60 <li><a href="quotes.wiki">Fossil, Git, and DVCSes in General &#151; Quotes: What People Are Saying About</a></li>
61 <li><a href="faq.wiki">Frequently Asked Questions</a></li>
62 <li><a href="shunning.wiki">From Fossil &#151; Shunning: Deleting Content</a></li>
63 <li><a href="inout.wiki">From Git &#151; Import And Export To And</a></li>
@@ -99,13 +102,15 @@
102 <li><a href="selfcheck.wiki">Repository Integrity Self Checks &#151; Fossil</a></li>
103 <li><a href="quotes.wiki">Saying About Fossil, Git, and DVCSes in General &#151; Quotes: What People Are</a></li>
104 <li><a href="selfcheck.wiki">Self Checks &#151; Fossil Repository Integrity</a></li>
105 <li><a href="selfhost.wiki">Self Hosting Repositories &#151; Fossil</a></li>
106 <li><a href="server.wiki">Server &#151; How To Configure A Fossil</a></li>
107 <li><a href="settings.wiki">Settings &#151; Fossil</a></li>
108 <li><a href="shunning.wiki">Shunning: Deleting Content From Fossil</a></li>
109 <li><a href="style.wiki">Source Code Style Guidelines</a></li>
110 <li><a href="tech_overview.wiki">SQLite Databases Used By Fossil</a></li>
111 <li><a href="ssl.wiki">SSL with Fossil &#151; Using</a></li>
112 <li><a href="quickstart.wiki">Start Guide &#151; Fossil Quick</a></li>
113 <li><a href="stats.wiki">Statistics &#151; Performance</a></li>
114 <li><a href="style.wiki">Style Guidelines &#151; Source Code</a></li>
115 <li><a href="foss-cklist.wiki">Successful Open-Source Projects &#151; Checklist For</a></li>
116 <li><a href="sync.wiki">Sync Protocol &#151; The Fossil</a></li>
@@ -118,11 +123,13 @@
123 <li><a href="sync.wiki">The Fossil Sync Protocol</a></li>
124 <li><a href="webui.wiki">The Fossil Web Interface</a></li>
125 <li><a href="theory1.wiki">Thoughts On The Design Of The Fossil DVCS</a></li>
126 <li><a href="custom_ticket.wiki">Ticket System &#151; Customizing The</a></li>
127 <li><a href="bugtheory.wiki">Tracking In Fossil &#151; Bug</a></li>
128 <li><a href="ssl.wiki">Using SSL with Fossil</a></li>
129 <li><a href="checkin_names.wiki">Version Names &#151; Checkin And</a></li>
130 <li><a href="fossil-v-git.wiki">Versus Git &#151; Fossil</a></li>
131 <li><a href="webui.wiki">Web Interface &#151; The Fossil</a></li>
132 <li><a href="quotes.wiki">What People Are Saying About Fossil, Git, and DVCSes in General &#151; Quotes:</a></li>
133 <li><a href="wikitheory.wiki">Wiki In Fossil</a></li>
134 <li><a href="ssl.wiki">with Fossil &#151; Using SSL</a></li>
135 </ul>
136
--- www/server.wiki
+++ www/server.wiki
@@ -97,10 +97,13 @@
9797
If you are using "inetd" to serve your repository, then you simply need to add "/usr/bin/stunnel" (perhaps on a different path, depending on your setup) before the command line to launch Fossil.
9898
</p>
9999
<p>
100100
At this stage, the standalone server (e.g. "fossil server") does not support SSL.
101101
</p>
102
+<p>
103
+For more information, see <a href="./ssl.wiki">Using SSL with Fossil</a>.
104
+</p>
102105
</blockquote>
103106
104107
<h2>Various security concerns with hosted repositories</h2><blockquote>
105108
<p>
106109
There are two main concerns relating to usage of Fossil for sharing sensitive information (source or any other data):
107110
108111
ADDED www/settings.wiki
109112
ADDED www/ssl.wiki
--- www/server.wiki
+++ www/server.wiki
@@ -97,10 +97,13 @@
97 If you are using "inetd" to serve your repository, then you simply need to add "/usr/bin/stunnel" (perhaps on a different path, depending on your setup) before the command line to launch Fossil.
98 </p>
99 <p>
100 At this stage, the standalone server (e.g. "fossil server") does not support SSL.
101 </p>
 
 
 
102 </blockquote>
103
104 <h2>Various security concerns with hosted repositories</h2><blockquote>
105 <p>
106 There are two main concerns relating to usage of Fossil for sharing sensitive information (source or any other data):
107
108 DDED www/settings.wiki
109 DDED www/ssl.wiki
--- www/server.wiki
+++ www/server.wiki
@@ -97,10 +97,13 @@
97 If you are using "inetd" to serve your repository, then you simply need to add "/usr/bin/stunnel" (perhaps on a different path, depending on your setup) before the command line to launch Fossil.
98 </p>
99 <p>
100 At this stage, the standalone server (e.g. "fossil server") does not support SSL.
101 </p>
102 <p>
103 For more information, see <a href="./ssl.wiki">Using SSL with Fossil</a>.
104 </p>
105 </blockquote>
106
107 <h2>Various security concerns with hosted repositories</h2><blockquote>
108 <p>
109 There are two main concerns relating to usage of Fossil for sharing sensitive information (source or any other data):
110
111 DDED www/settings.wiki
112 DDED www/ssl.wiki
--- a/www/settings.wiki
+++ b/www/settings.wiki
@@ -0,0 +1,6 @@
1
+ command.
2
+ a repository on the web. b</tt>,
3
+ � �
4
+ddirectory < <title>Fossil S nl-glob</tt>,
5
+ � �
6
+ddirectory t ignorealso
--- a/www/settings.wiki
+++ b/www/settings.wiki
@@ -0,0 +1,6 @@
 
 
 
 
 
 
--- a/www/settings.wiki
+++ b/www/settings.wiki
@@ -0,0 +1,6 @@
1 command.
2 a repository on the web. b</tt>,
3 � �
4 ddirectory < <title>Fossil S nl-glob</tt>,
5 � �
6 ddirectory t ignorealso
+22
--- a/www/ssl.wiki
+++ b/www/ssl.wiki
@@ -0,0 +1,22 @@
1
+<title>SSL and Fossiluring a Repository wSSLyour repositge." This setting is not . This will protectessed via HTTP,
2
+sas well preventing eavesdropping of the contents of your repository.
3
+
4
+To host a repository with SSL, you need to use an web server which supports SSL in front of the Fossil server. You can host it using the CGI option or by proxying Fossil's built in HTTP server.
5
+
6
+Your fossil client must system Make sure scheme to ensure you're using SSL. from http as w important S front end proxy up again for access, which
7
+causes Fossil to see that it's being accessed via HTTP, so it redirects
8
+the client to detects
9
+
10
+
11
+If you wishto a Fossil web server, iayer, not by use of Fossil-
12
+shows one way to`ssl`SSL uses certificates.certificates you trustyou wishto a Fossil web server, iayer, not by use of Fossil-
13
+shows one way e of Fossil-
14
+shows one way to`ssl` using a certificate signed by a certificate authority, you need to specifyil-
15
+shows one was you trust with the <tt>ssl-ca-location</tt> setting. Set this globally with the <tt>-global</tt> option for convenience.
16
+
17
+This should be set to the location of a file containing all the PEM encoded certificates you trust. You can obtain a certificate using a web browser, for example, Firefox, or just refer to your system's trusted CA roots which are usually stored somewhere in <tt>/etc</tt>.
18
+
19
+
20
+<h2>C nications with Fossil</h2>
21
+
22
+If you are storing sensitive information T <title title>TLS and Fossiluring a Repository with TLS</title>
--- a/www/ssl.wiki
+++ b/www/ssl.wiki
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/www/ssl.wiki
+++ b/www/ssl.wiki
@@ -0,0 +1,22 @@
1 <title>SSL and Fossiluring a Repository wSSLyour repositge." This setting is not . This will protectessed via HTTP,
2 sas well preventing eavesdropping of the contents of your repository.
3
4 To host a repository with SSL, you need to use an web server which supports SSL in front of the Fossil server. You can host it using the CGI option or by proxying Fossil's built in HTTP server.
5
6 Your fossil client must system Make sure scheme to ensure you're using SSL. from http as w important S front end proxy up again for access, which
7 causes Fossil to see that it's being accessed via HTTP, so it redirects
8 the client to detects
9
10
11 If you wishto a Fossil web server, iayer, not by use of Fossil-
12 shows one way to`ssl`SSL uses certificates.certificates you trustyou wishto a Fossil web server, iayer, not by use of Fossil-
13 shows one way e of Fossil-
14 shows one way to`ssl` using a certificate signed by a certificate authority, you need to specifyil-
15 shows one was you trust with the <tt>ssl-ca-location</tt> setting. Set this globally with the <tt>-global</tt> option for convenience.
16
17 This should be set to the location of a file containing all the PEM encoded certificates you trust. You can obtain a certificate using a web browser, for example, Firefox, or just refer to your system's trusted CA roots which are usually stored somewhere in <tt>/etc</tt>.
18
19
20 <h2>C nications with Fossil</h2>
21
22 If you are storing sensitive information T <title title>TLS and Fossiluring a Repository with TLS</title>

Keyboard Shortcuts

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