Fossil SCM

Merge all changes from the wolfgangFormat2CSS_2 branch into the trunk.

drh 2010-09-29 13:30 trunk merge
Commit 5a48a9b27bcf0bc3f1f2f9198dc84d7194fa7e2d
+1 -3
--- src/add.c
+++ src/add.c
@@ -36,20 +36,18 @@
3636
Blob pathname;
3737
const char *zPath;
3838
3939
file_tree_name(zName, &pathname, 1);
4040
zPath = blob_str(&pathname);
41
- if( strcmp(zPath, "manifest")==0
42
- || strcmp(zPath, "_FOSSIL_")==0
41
+ if( strcmp(zPath, "_FOSSIL_")==0
4342
|| strcmp(zPath, "_FOSSIL_-journal")==0
4443
|| strcmp(zPath, "_FOSSIL_-wal")==0
4544
|| strcmp(zPath, "_FOSSIL_-shm")==0
4645
|| strcmp(zPath, ".fos")==0
4746
|| strcmp(zPath, ".fos-journal")==0
4847
|| strcmp(zPath, ".fos-wal")==0
4948
|| strcmp(zPath, ".fos-shm")==0
50
- || strcmp(zPath, "manifest.uuid")==0
5149
|| blob_compare(&pathname, pOmit)==0
5250
){
5351
fossil_warning("cannot add %s", zPath);
5452
}else{
5553
if( !file_is_simple_pathname(zPath) ){
5654
--- src/add.c
+++ src/add.c
@@ -36,20 +36,18 @@
36 Blob pathname;
37 const char *zPath;
38
39 file_tree_name(zName, &pathname, 1);
40 zPath = blob_str(&pathname);
41 if( strcmp(zPath, "manifest")==0
42 || strcmp(zPath, "_FOSSIL_")==0
43 || strcmp(zPath, "_FOSSIL_-journal")==0
44 || strcmp(zPath, "_FOSSIL_-wal")==0
45 || strcmp(zPath, "_FOSSIL_-shm")==0
46 || strcmp(zPath, ".fos")==0
47 || strcmp(zPath, ".fos-journal")==0
48 || strcmp(zPath, ".fos-wal")==0
49 || strcmp(zPath, ".fos-shm")==0
50 || strcmp(zPath, "manifest.uuid")==0
51 || blob_compare(&pathname, pOmit)==0
52 ){
53 fossil_warning("cannot add %s", zPath);
54 }else{
55 if( !file_is_simple_pathname(zPath) ){
56
--- src/add.c
+++ src/add.c
@@ -36,20 +36,18 @@
36 Blob pathname;
37 const char *zPath;
38
39 file_tree_name(zName, &pathname, 1);
40 zPath = blob_str(&pathname);
41 if( strcmp(zPath, "_FOSSIL_")==0
 
42 || strcmp(zPath, "_FOSSIL_-journal")==0
43 || strcmp(zPath, "_FOSSIL_-wal")==0
44 || strcmp(zPath, "_FOSSIL_-shm")==0
45 || strcmp(zPath, ".fos")==0
46 || strcmp(zPath, ".fos-journal")==0
47 || strcmp(zPath, ".fos-wal")==0
48 || strcmp(zPath, ".fos-shm")==0
 
49 || blob_compare(&pathname, pOmit)==0
50 ){
51 fossil_warning("cannot add %s", zPath);
52 }else{
53 if( !file_is_simple_pathname(zPath) ){
54
+22 -22
--- src/attach.c
+++ src/attach.c
@@ -270,25 +270,25 @@
270270
db_end_transaction(0);
271271
cgi_redirect(zFrom);
272272
}
273273
style_header("Add Attachment");
274274
@ <h2>Add Attachment To %s(zTargetType)</h2>
275
- @ <form action="%s(g.zBaseURL)/attachadd" method="POST"
276
- @ enctype="multipart/form-data">
275
+ @ <form action="%s(g.zBaseURL)/attachadd" method="post"
276
+ @ enctype="multipart/form-data"><div>
277277
@ File to Attach:
278
- @ <input type="file" name="f" size="60"><br />
278
+ @ <input type="file" name="f" size="60" /><br />
279279
@ Description:<br />
280
- @ <textarea name="comment" cols=80 rows=5 wrap="virtual"></textarea><br />
280
+ @ <textarea name="comment" cols="80" rows="5" wrap="virtual"></textarea><br />
281281
if( zTkt ){
282
- @ <input type="hidden" name="tkt" value="%h(zTkt)">
283
- }else{
284
- @ <input type="hidden" name="page" value="%h(zPage)">
285
- }
286
- @ <input type="hidden" name="from" value="%h(zFrom)">
287
- @ <input type="submit" name="ok" value="Add Attachment">
288
- @ <input type="submit" name="cancel" value="Cancel">
289
- @ </form>
282
+ @ <input type="hidden" name="tkt" value="%h(zTkt)" />
283
+ }else{
284
+ @ <input type="hidden" name="page" value="%h(zPage)" />
285
+ }
286
+ @ <input type="hidden" name="from" value="%h(zFrom)" />
287
+ @ <input type="submit" name="ok" value="Add Attachment" />
288
+ @ <input type="submit" name="cancel" value="Cancel" />
289
+ @ </div></form>
290290
style_footer();
291291
}
292292
293293
294294
/*
@@ -349,21 +349,21 @@
349349
manifest_crosslink(rid, &manifest);
350350
db_end_transaction(0);
351351
cgi_redirect(zFrom);
352352
}
353353
style_header("Delete Attachment");
354
- @ <form action="%s(g.zBaseURL)/attachdelete" method="POST">
354
+ @ <form action="%s(g.zBaseURL)/attachdelete" method="post"><div>
355355
@ <p>Confirm that you want to delete the attachment named
356356
@ "%h(zFile)" on %s(zTkt?"ticket":"wiki page") %h(zTarget):<br />
357357
if( zTkt ){
358
- @ <input type="hidden" name="tkt" value="%h(zTkt)">
359
- }else{
360
- @ <input type="hidden" name="page" value="%h(zPage)">
361
- }
362
- @ <input type="hidden" name="file" value="%h(zFile)">
363
- @ <input type="hidden" name="from" value="%h(zFrom)">
364
- @ <input type="submit" name="confirm" value="Delete">
365
- @ <input type="submit" name="cancel" value="Cancel">
366
- @ </form>
358
+ @ <input type="hidden" name="tkt" value="%h(zTkt)" />
359
+ }else{
360
+ @ <input type="hidden" name="page" value="%h(zPage)" />
361
+ }
362
+ @ <input type="hidden" name="file" value="%h(zFile)" />
363
+ @ <input type="hidden" name="from" value="%h(zFrom)" />
364
+ @ <input type="submit" name="confirm" value="Delete" />
365
+ @ <input type="submit" name="cancel" value="Cancel" />
366
+ @ </div></form>
367367
style_footer();
368368
369369
}
370370
--- src/attach.c
+++ src/attach.c
@@ -270,25 +270,25 @@
270 db_end_transaction(0);
271 cgi_redirect(zFrom);
272 }
273 style_header("Add Attachment");
274 @ <h2>Add Attachment To %s(zTargetType)</h2>
275 @ <form action="%s(g.zBaseURL)/attachadd" method="POST"
276 @ enctype="multipart/form-data">
277 @ File to Attach:
278 @ <input type="file" name="f" size="60"><br />
279 @ Description:<br />
280 @ <textarea name="comment" cols=80 rows=5 wrap="virtual"></textarea><br />
281 if( zTkt ){
282 @ <input type="hidden" name="tkt" value="%h(zTkt)">
283 }else{
284 @ <input type="hidden" name="page" value="%h(zPage)">
285 }
286 @ <input type="hidden" name="from" value="%h(zFrom)">
287 @ <input type="submit" name="ok" value="Add Attachment">
288 @ <input type="submit" name="cancel" value="Cancel">
289 @ </form>
290 style_footer();
291 }
292
293
294 /*
@@ -349,21 +349,21 @@
349 manifest_crosslink(rid, &manifest);
350 db_end_transaction(0);
351 cgi_redirect(zFrom);
352 }
353 style_header("Delete Attachment");
354 @ <form action="%s(g.zBaseURL)/attachdelete" method="POST">
355 @ <p>Confirm that you want to delete the attachment named
356 @ "%h(zFile)" on %s(zTkt?"ticket":"wiki page") %h(zTarget):<br />
357 if( zTkt ){
358 @ <input type="hidden" name="tkt" value="%h(zTkt)">
359 }else{
360 @ <input type="hidden" name="page" value="%h(zPage)">
361 }
362 @ <input type="hidden" name="file" value="%h(zFile)">
363 @ <input type="hidden" name="from" value="%h(zFrom)">
364 @ <input type="submit" name="confirm" value="Delete">
365 @ <input type="submit" name="cancel" value="Cancel">
366 @ </form>
367 style_footer();
368
369 }
370
--- src/attach.c
+++ src/attach.c
@@ -270,25 +270,25 @@
270 db_end_transaction(0);
271 cgi_redirect(zFrom);
272 }
273 style_header("Add Attachment");
274 @ <h2>Add Attachment To %s(zTargetType)</h2>
275 @ <form action="%s(g.zBaseURL)/attachadd" method="post"
276 @ enctype="multipart/form-data"><div>
277 @ File to Attach:
278 @ <input type="file" name="f" size="60" /><br />
279 @ Description:<br />
280 @ <textarea name="comment" cols="80" rows="5" wrap="virtual"></textarea><br />
281 if( zTkt ){
282 @ <input type="hidden" name="tkt" value="%h(zTkt)" />
283 }else{
284 @ <input type="hidden" name="page" value="%h(zPage)" />
285 }
286 @ <input type="hidden" name="from" value="%h(zFrom)" />
287 @ <input type="submit" name="ok" value="Add Attachment" />
288 @ <input type="submit" name="cancel" value="Cancel" />
289 @ </div></form>
290 style_footer();
291 }
292
293
294 /*
@@ -349,21 +349,21 @@
349 manifest_crosslink(rid, &manifest);
350 db_end_transaction(0);
351 cgi_redirect(zFrom);
352 }
353 style_header("Delete Attachment");
354 @ <form action="%s(g.zBaseURL)/attachdelete" method="post"><div>
355 @ <p>Confirm that you want to delete the attachment named
356 @ "%h(zFile)" on %s(zTkt?"ticket":"wiki page") %h(zTarget):<br />
357 if( zTkt ){
358 @ <input type="hidden" name="tkt" value="%h(zTkt)" />
359 }else{
360 @ <input type="hidden" name="page" value="%h(zPage)" />
361 }
362 @ <input type="hidden" name="file" value="%h(zFile)" />
363 @ <input type="hidden" name="from" value="%h(zFrom)" />
364 @ <input type="submit" name="confirm" value="Delete" />
365 @ <input type="submit" name="cancel" value="Cancel" />
366 @ </div></form>
367 style_footer();
368
369 }
370
+13 -5
--- src/browse.c
+++ src/browse.c
@@ -106,10 +106,11 @@
106106
int cnt, i;
107107
char *zPrefix;
108108
Stmt q;
109109
const char *zCI = P("ci");
110110
int rid = 0;
111
+ char *zUuid = 0;
111112
Blob content;
112113
Blob dirname;
113114
Manifest m;
114115
const char *zSubdirLink;
115116
@@ -120,16 +121,24 @@
120121
pathelementFunc, 0, 0);
121122
122123
/* If the name= parameter is an empty string, make it a NULL pointer */
123124
if( zD && strlen(zD)==0 ){ zD = 0; }
124125
125
- /* If a specific check-in is requested, fetch and parse it. */
126
- if( zCI && (rid = name_to_rid(zCI))!=0 && content_get(rid, &content) ){
127
- if( !manifest_parse(&m, &content) || m.type!=CFTYPE_MANIFEST ){
128
- zCI = 0;
126
+ /* If a specific check-in is requested, fetch and parse it. If the
127
+ ** specific check-in does not exist, clear zCI. zCI==0 will cause all
128
+ ** files from all check-ins to be displayed.
129
+ */
130
+ if( zCI ){
131
+ if( (rid = name_to_rid(zCI))==0 || content_get(rid, &content)==0 ){
132
+ zCI = 0; /* No artifact named zCI exists */
133
+ }else if( !manifest_parse(&m, &content) || m.type!=CFTYPE_MANIFEST ){
134
+ zCI = 0; /* The artifact exists but is not a manifest */
135
+ }else{
136
+ zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
129137
}
130138
}
139
+
131140
132141
/* Compute the title of the page */
133142
blob_zero(&dirname);
134143
if( zD ){
135144
blob_append(&dirname, "in directory ", -1);
@@ -138,11 +147,10 @@
138147
}else{
139148
blob_append(&dirname, "in the top-level directory", -1);
140149
zPrefix = "";
141150
}
142151
if( zCI ){
143
- char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
144152
char zShort[20];
145153
memcpy(zShort, zUuid, 10);
146154
zShort[10] = 0;
147155
@ <h2>Files of check-in [<a href="vinfo?name=%T(zUuid)">%s(zShort)</a>]
148156
@ %s(blob_str(&dirname))</h2>
149157
--- src/browse.c
+++ src/browse.c
@@ -106,10 +106,11 @@
106 int cnt, i;
107 char *zPrefix;
108 Stmt q;
109 const char *zCI = P("ci");
110 int rid = 0;
 
111 Blob content;
112 Blob dirname;
113 Manifest m;
114 const char *zSubdirLink;
115
@@ -120,16 +121,24 @@
120 pathelementFunc, 0, 0);
121
122 /* If the name= parameter is an empty string, make it a NULL pointer */
123 if( zD && strlen(zD)==0 ){ zD = 0; }
124
125 /* If a specific check-in is requested, fetch and parse it. */
126 if( zCI && (rid = name_to_rid(zCI))!=0 && content_get(rid, &content) ){
127 if( !manifest_parse(&m, &content) || m.type!=CFTYPE_MANIFEST ){
128 zCI = 0;
 
 
 
 
 
 
 
129 }
130 }
 
131
132 /* Compute the title of the page */
133 blob_zero(&dirname);
134 if( zD ){
135 blob_append(&dirname, "in directory ", -1);
@@ -138,11 +147,10 @@
138 }else{
139 blob_append(&dirname, "in the top-level directory", -1);
140 zPrefix = "";
141 }
142 if( zCI ){
143 char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
144 char zShort[20];
145 memcpy(zShort, zUuid, 10);
146 zShort[10] = 0;
147 @ <h2>Files of check-in [<a href="vinfo?name=%T(zUuid)">%s(zShort)</a>]
148 @ %s(blob_str(&dirname))</h2>
149
--- src/browse.c
+++ src/browse.c
@@ -106,10 +106,11 @@
106 int cnt, i;
107 char *zPrefix;
108 Stmt q;
109 const char *zCI = P("ci");
110 int rid = 0;
111 char *zUuid = 0;
112 Blob content;
113 Blob dirname;
114 Manifest m;
115 const char *zSubdirLink;
116
@@ -120,16 +121,24 @@
121 pathelementFunc, 0, 0);
122
123 /* If the name= parameter is an empty string, make it a NULL pointer */
124 if( zD && strlen(zD)==0 ){ zD = 0; }
125
126 /* If a specific check-in is requested, fetch and parse it. If the
127 ** specific check-in does not exist, clear zCI. zCI==0 will cause all
128 ** files from all check-ins to be displayed.
129 */
130 if( zCI ){
131 if( (rid = name_to_rid(zCI))==0 || content_get(rid, &content)==0 ){
132 zCI = 0; /* No artifact named zCI exists */
133 }else if( !manifest_parse(&m, &content) || m.type!=CFTYPE_MANIFEST ){
134 zCI = 0; /* The artifact exists but is not a manifest */
135 }else{
136 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
137 }
138 }
139
140
141 /* Compute the title of the page */
142 blob_zero(&dirname);
143 if( zD ){
144 blob_append(&dirname, "in directory ", -1);
@@ -138,11 +147,10 @@
147 }else{
148 blob_append(&dirname, "in the top-level directory", -1);
149 zPrefix = "";
150 }
151 if( zCI ){
 
152 char zShort[20];
153 memcpy(zShort, zUuid, 10);
154 zShort[10] = 0;
155 @ <h2>Files of check-in [<a href="vinfo?name=%T(zUuid)">%s(zShort)</a>]
156 @ %s(blob_str(&dirname))</h2>
157
+3
--- src/cgi.c
+++ src/cgi.c
@@ -42,10 +42,13 @@
4242
#endif
4343
#include <time.h>
4444
#include <stdio.h>
4545
#include <stdlib.h>
4646
#include <unistd.h>
47
+#if defined (__POCC__)
48
+# undef INTERFACE
49
+#endif
4750
#include "cgi.h"
4851
4952
#if INTERFACE
5053
/*
5154
** Shortcuts for cgi_parameter. P("x") returns the value of query parameter
5255
--- src/cgi.c
+++ src/cgi.c
@@ -42,10 +42,13 @@
42 #endif
43 #include <time.h>
44 #include <stdio.h>
45 #include <stdlib.h>
46 #include <unistd.h>
 
 
 
47 #include "cgi.h"
48
49 #if INTERFACE
50 /*
51 ** Shortcuts for cgi_parameter. P("x") returns the value of query parameter
52
--- src/cgi.c
+++ src/cgi.c
@@ -42,10 +42,13 @@
42 #endif
43 #include <time.h>
44 #include <stdio.h>
45 #include <stdlib.h>
46 #include <unistd.h>
47 #if defined (__POCC__)
48 # undef INTERFACE
49 #endif
50 #include "cgi.h"
51
52 #if INTERFACE
53 /*
54 ** Shortcuts for cgi_parameter. P("x") returns the value of query parameter
55
+28 -11
--- src/checkin.c
+++ src/checkin.c
@@ -535,10 +535,23 @@
535535
assert( strlen(zDate)==19 );
536536
assert( zDate[10]==' ' );
537537
zDate[10] = 'T';
538538
return zDate;
539539
}
540
+
541
+/*
542
+** Return TRUE (non-zero) if a file named "zFilename" exists in
543
+** the checkout identified by vid.
544
+**
545
+** The original purpose of this routine was to check for the presence of
546
+** a "checked-in" file named "manifest" or "manifest.uuid" so as to avoid
547
+** overwriting that file with automatically generated files.
548
+*/
549
+int file_exists_in_checkout(int vid, const char *zFilename){
550
+ return db_exists("SELECT 1 FROM vfile WHERE vid=%d AND pathname=%Q",
551
+ vid, zFilename);
552
+}
540553
541554
/*
542555
** COMMAND: ci
543556
** COMMAND: commit
544557
**
@@ -844,38 +857,42 @@
844857
db_finalize(&q);
845858
}
846859
blob_appendf(&manifest, "U %F\n", zUserOvrd ? zUserOvrd : g.zLogin);
847860
md5sum_blob(&manifest, &mcksum);
848861
blob_appendf(&manifest, "Z %b\n", &mcksum);
849
- zManifestFile = mprintf("%smanifest", g.zLocalRoot);
850862
if( !noSign && !g.markPrivate && clearsign(&manifest, &manifest) ){
851863
Blob ans;
852864
blob_zero(&ans);
853865
prompt_user("unable to sign manifest. continue (y/N)? ", &ans);
854866
if( blob_str(&ans)[0]!='y' ){
855867
fossil_exit(1);
856868
}
857869
}
858
- blob_write_to_file(&manifest, zManifestFile);
859
- blob_reset(&manifest);
860
- blob_read_from_file(&manifest, zManifestFile);
861
- free(zManifestFile);
870
+ if( !file_exists_in_checkout(vid, "manifest") ){
871
+ zManifestFile = mprintf("%smanifest", g.zLocalRoot);
872
+ blob_write_to_file(&manifest, zManifestFile);
873
+ blob_reset(&manifest);
874
+ blob_read_from_file(&manifest, zManifestFile);
875
+ free(zManifestFile);
876
+ }
862877
nvid = content_put(&manifest, 0, 0);
863878
if( nvid==0 ){
864879
fossil_panic("trouble committing manifest: %s", g.zErrMsg);
865880
}
866881
db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", nvid);
867882
manifest_crosslink(nvid, &manifest);
868883
content_deltify(vid, nvid, 0);
869884
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", nvid);
870885
printf("New_Version: %s\n", zUuid);
871
- zManifestFile = mprintf("%smanifest.uuid", g.zLocalRoot);
872
- blob_zero(&muuid);
873
- blob_appendf(&muuid, "%s\n", zUuid);
874
- blob_write_to_file(&muuid, zManifestFile);
875
- free(zManifestFile);
876
- blob_reset(&muuid);
886
+ if( !file_exists_in_checkout(vid, "manifest.uuid") ){
887
+ zManifestFile = mprintf("%smanifest.uuid", g.zLocalRoot);
888
+ blob_zero(&muuid);
889
+ blob_appendf(&muuid, "%s\n", zUuid);
890
+ blob_write_to_file(&muuid, zManifestFile);
891
+ free(zManifestFile);
892
+ blob_reset(&muuid);
893
+ }
877894
878895
879896
/* Update the vfile and vmerge tables */
880897
db_multi_exec(
881898
"DELETE FROM vfile WHERE (vid!=%d OR deleted) AND file_is_selected(id);"
882899
--- src/checkin.c
+++ src/checkin.c
@@ -535,10 +535,23 @@
535 assert( strlen(zDate)==19 );
536 assert( zDate[10]==' ' );
537 zDate[10] = 'T';
538 return zDate;
539 }
 
 
 
 
 
 
 
 
 
 
 
 
 
540
541 /*
542 ** COMMAND: ci
543 ** COMMAND: commit
544 **
@@ -844,38 +857,42 @@
844 db_finalize(&q);
845 }
846 blob_appendf(&manifest, "U %F\n", zUserOvrd ? zUserOvrd : g.zLogin);
847 md5sum_blob(&manifest, &mcksum);
848 blob_appendf(&manifest, "Z %b\n", &mcksum);
849 zManifestFile = mprintf("%smanifest", g.zLocalRoot);
850 if( !noSign && !g.markPrivate && clearsign(&manifest, &manifest) ){
851 Blob ans;
852 blob_zero(&ans);
853 prompt_user("unable to sign manifest. continue (y/N)? ", &ans);
854 if( blob_str(&ans)[0]!='y' ){
855 fossil_exit(1);
856 }
857 }
858 blob_write_to_file(&manifest, zManifestFile);
859 blob_reset(&manifest);
860 blob_read_from_file(&manifest, zManifestFile);
861 free(zManifestFile);
 
 
 
862 nvid = content_put(&manifest, 0, 0);
863 if( nvid==0 ){
864 fossil_panic("trouble committing manifest: %s", g.zErrMsg);
865 }
866 db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", nvid);
867 manifest_crosslink(nvid, &manifest);
868 content_deltify(vid, nvid, 0);
869 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", nvid);
870 printf("New_Version: %s\n", zUuid);
871 zManifestFile = mprintf("%smanifest.uuid", g.zLocalRoot);
872 blob_zero(&muuid);
873 blob_appendf(&muuid, "%s\n", zUuid);
874 blob_write_to_file(&muuid, zManifestFile);
875 free(zManifestFile);
876 blob_reset(&muuid);
 
 
877
878
879 /* Update the vfile and vmerge tables */
880 db_multi_exec(
881 "DELETE FROM vfile WHERE (vid!=%d OR deleted) AND file_is_selected(id);"
882
--- src/checkin.c
+++ src/checkin.c
@@ -535,10 +535,23 @@
535 assert( strlen(zDate)==19 );
536 assert( zDate[10]==' ' );
537 zDate[10] = 'T';
538 return zDate;
539 }
540
541 /*
542 ** Return TRUE (non-zero) if a file named "zFilename" exists in
543 ** the checkout identified by vid.
544 **
545 ** The original purpose of this routine was to check for the presence of
546 ** a "checked-in" file named "manifest" or "manifest.uuid" so as to avoid
547 ** overwriting that file with automatically generated files.
548 */
549 int file_exists_in_checkout(int vid, const char *zFilename){
550 return db_exists("SELECT 1 FROM vfile WHERE vid=%d AND pathname=%Q",
551 vid, zFilename);
552 }
553
554 /*
555 ** COMMAND: ci
556 ** COMMAND: commit
557 **
@@ -844,38 +857,42 @@
857 db_finalize(&q);
858 }
859 blob_appendf(&manifest, "U %F\n", zUserOvrd ? zUserOvrd : g.zLogin);
860 md5sum_blob(&manifest, &mcksum);
861 blob_appendf(&manifest, "Z %b\n", &mcksum);
 
862 if( !noSign && !g.markPrivate && clearsign(&manifest, &manifest) ){
863 Blob ans;
864 blob_zero(&ans);
865 prompt_user("unable to sign manifest. continue (y/N)? ", &ans);
866 if( blob_str(&ans)[0]!='y' ){
867 fossil_exit(1);
868 }
869 }
870 if( !file_exists_in_checkout(vid, "manifest") ){
871 zManifestFile = mprintf("%smanifest", g.zLocalRoot);
872 blob_write_to_file(&manifest, zManifestFile);
873 blob_reset(&manifest);
874 blob_read_from_file(&manifest, zManifestFile);
875 free(zManifestFile);
876 }
877 nvid = content_put(&manifest, 0, 0);
878 if( nvid==0 ){
879 fossil_panic("trouble committing manifest: %s", g.zErrMsg);
880 }
881 db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", nvid);
882 manifest_crosslink(nvid, &manifest);
883 content_deltify(vid, nvid, 0);
884 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", nvid);
885 printf("New_Version: %s\n", zUuid);
886 if( !file_exists_in_checkout(vid, "manifest.uuid") ){
887 zManifestFile = mprintf("%smanifest.uuid", g.zLocalRoot);
888 blob_zero(&muuid);
889 blob_appendf(&muuid, "%s\n", zUuid);
890 blob_write_to_file(&muuid, zManifestFile);
891 free(zManifestFile);
892 blob_reset(&muuid);
893 }
894
895
896 /* Update the vfile and vmerge tables */
897 db_multi_exec(
898 "DELETE FROM vfile WHERE (vid!=%d OR deleted) AND file_is_selected(id);"
899
+32 -12
--- src/checkout.c
+++ src/checkout.c
@@ -97,34 +97,33 @@
9797
db_multi_exec("UPDATE vfile SET isexe=%d WHERE vid=%d and pathname=%Q",
9898
onoff, vid, zFilename);
9999
}
100100
101101
/*
102
-** Read the manifest file given by vid out of the repository
103
-** and store it in the root of the local check-out.
102
+** Set or clear the execute permission bit (as appropriate) for all
103
+** files in the current check-out.
104
+**
105
+** If the checkout does not have explicit files named "manifest" and
106
+** "manifest.uuid" then automatically generate files with those names
107
+** containing, respectively, the text of the manifest and the artifact
108
+** ID of the manifest.
104109
*/
105110
void manifest_to_disk(int vid){
106111
char *zManFile;
107112
Blob manifest;
108113
Blob hash;
109114
Blob filename;
110115
int baseLen;
111116
int i;
117
+ int seenManifest = 0;
118
+ int seenManifestUuid = 0;
112119
Manifest m;
113120
121
+ /* Check the EXE permission status of all files
122
+ */
114123
blob_zero(&manifest);
115
- zManFile = mprintf("%smanifest", g.zLocalRoot);
116124
content_get(vid, &manifest);
117
- blob_write_to_file(&manifest, zManFile);
118
- free(zManFile);
119
- blob_zero(&hash);
120
- sha1sum_blob(&manifest, &hash);
121
- zManFile = mprintf("%smanifest.uuid", g.zLocalRoot);
122
- blob_append(&hash, "\n", 1);
123
- blob_write_to_file(&hash, zManFile);
124
- free(zManFile);
125
- blob_reset(&hash);
126125
manifest_parse(&m, &manifest);
127126
blob_zero(&filename);
128127
blob_appendf(&filename, "%s/", g.zLocalRoot);
129128
baseLen = blob_size(&filename);
130129
for(i=0; i<m.nFile; i++){
@@ -132,13 +131,34 @@
132131
blob_append(&filename, m.aFile[i].zName, -1);
133132
isExe = m.aFile[i].zPerm && strstr(m.aFile[i].zPerm, "x");
134133
file_setexe(blob_str(&filename), isExe);
135134
set_or_clear_isexe(m.aFile[i].zName, vid, isExe);
136135
blob_resize(&filename, baseLen);
136
+ if( memcmp(m.aFile[i].zName, "manifest", 8)==0 ){
137
+ if( m.aFile[i].zName[8]==0 ) seenManifest = 1;
138
+ if( strcmp(&m.aFile[i].zName[8], ".uuid")==0 ) seenManifestUuid = 1;
139
+ }
137140
}
138141
blob_reset(&filename);
139142
manifest_clear(&m);
143
+
144
+ blob_zero(&manifest);
145
+ content_get(vid, &manifest);
146
+ if( !seenManifest ){
147
+ zManFile = mprintf("%smanifest", g.zLocalRoot);
148
+ blob_write_to_file(&manifest, zManFile);
149
+ free(zManFile);
150
+ }
151
+ if( !seenManifestUuid ){
152
+ blob_zero(&hash);
153
+ sha1sum_blob(&manifest, &hash);
154
+ zManFile = mprintf("%smanifest.uuid", g.zLocalRoot);
155
+ blob_append(&hash, "\n", 1);
156
+ blob_write_to_file(&hash, zManFile);
157
+ free(zManFile);
158
+ blob_reset(&hash);
159
+ }
140160
}
141161
142162
/*
143163
** COMMAND: checkout
144164
** COMMAND: co
145165
--- src/checkout.c
+++ src/checkout.c
@@ -97,34 +97,33 @@
97 db_multi_exec("UPDATE vfile SET isexe=%d WHERE vid=%d and pathname=%Q",
98 onoff, vid, zFilename);
99 }
100
101 /*
102 ** Read the manifest file given by vid out of the repository
103 ** and store it in the root of the local check-out.
 
 
 
 
 
104 */
105 void manifest_to_disk(int vid){
106 char *zManFile;
107 Blob manifest;
108 Blob hash;
109 Blob filename;
110 int baseLen;
111 int i;
 
 
112 Manifest m;
113
 
 
114 blob_zero(&manifest);
115 zManFile = mprintf("%smanifest", g.zLocalRoot);
116 content_get(vid, &manifest);
117 blob_write_to_file(&manifest, zManFile);
118 free(zManFile);
119 blob_zero(&hash);
120 sha1sum_blob(&manifest, &hash);
121 zManFile = mprintf("%smanifest.uuid", g.zLocalRoot);
122 blob_append(&hash, "\n", 1);
123 blob_write_to_file(&hash, zManFile);
124 free(zManFile);
125 blob_reset(&hash);
126 manifest_parse(&m, &manifest);
127 blob_zero(&filename);
128 blob_appendf(&filename, "%s/", g.zLocalRoot);
129 baseLen = blob_size(&filename);
130 for(i=0; i<m.nFile; i++){
@@ -132,13 +131,34 @@
132 blob_append(&filename, m.aFile[i].zName, -1);
133 isExe = m.aFile[i].zPerm && strstr(m.aFile[i].zPerm, "x");
134 file_setexe(blob_str(&filename), isExe);
135 set_or_clear_isexe(m.aFile[i].zName, vid, isExe);
136 blob_resize(&filename, baseLen);
 
 
 
 
137 }
138 blob_reset(&filename);
139 manifest_clear(&m);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140 }
141
142 /*
143 ** COMMAND: checkout
144 ** COMMAND: co
145
--- src/checkout.c
+++ src/checkout.c
@@ -97,34 +97,33 @@
97 db_multi_exec("UPDATE vfile SET isexe=%d WHERE vid=%d and pathname=%Q",
98 onoff, vid, zFilename);
99 }
100
101 /*
102 ** Set or clear the execute permission bit (as appropriate) for all
103 ** files in the current check-out.
104 **
105 ** If the checkout does not have explicit files named "manifest" and
106 ** "manifest.uuid" then automatically generate files with those names
107 ** containing, respectively, the text of the manifest and the artifact
108 ** ID of the manifest.
109 */
110 void manifest_to_disk(int vid){
111 char *zManFile;
112 Blob manifest;
113 Blob hash;
114 Blob filename;
115 int baseLen;
116 int i;
117 int seenManifest = 0;
118 int seenManifestUuid = 0;
119 Manifest m;
120
121 /* Check the EXE permission status of all files
122 */
123 blob_zero(&manifest);
 
124 content_get(vid, &manifest);
 
 
 
 
 
 
 
 
 
125 manifest_parse(&m, &manifest);
126 blob_zero(&filename);
127 blob_appendf(&filename, "%s/", g.zLocalRoot);
128 baseLen = blob_size(&filename);
129 for(i=0; i<m.nFile; i++){
@@ -132,13 +131,34 @@
131 blob_append(&filename, m.aFile[i].zName, -1);
132 isExe = m.aFile[i].zPerm && strstr(m.aFile[i].zPerm, "x");
133 file_setexe(blob_str(&filename), isExe);
134 set_or_clear_isexe(m.aFile[i].zName, vid, isExe);
135 blob_resize(&filename, baseLen);
136 if( memcmp(m.aFile[i].zName, "manifest", 8)==0 ){
137 if( m.aFile[i].zName[8]==0 ) seenManifest = 1;
138 if( strcmp(&m.aFile[i].zName[8], ".uuid")==0 ) seenManifestUuid = 1;
139 }
140 }
141 blob_reset(&filename);
142 manifest_clear(&m);
143
144 blob_zero(&manifest);
145 content_get(vid, &manifest);
146 if( !seenManifest ){
147 zManFile = mprintf("%smanifest", g.zLocalRoot);
148 blob_write_to_file(&manifest, zManFile);
149 free(zManFile);
150 }
151 if( !seenManifestUuid ){
152 blob_zero(&hash);
153 sha1sum_blob(&manifest, &hash);
154 zManFile = mprintf("%smanifest.uuid", g.zLocalRoot);
155 blob_append(&hash, "\n", 1);
156 blob_write_to_file(&hash, zManFile);
157 free(zManFile);
158 blob_reset(&hash);
159 }
160 }
161
162 /*
163 ** COMMAND: checkout
164 ** COMMAND: co
165
+2 -2
--- src/config.h
+++ src/config.h
@@ -36,12 +36,12 @@
3636
#include <stdlib.h>
3737
#include <ctype.h>
3838
#include <string.h>
3939
#include <stdarg.h>
4040
#include <assert.h>
41
-#if defined( __MINGW32__) || defined(__DMC__) || defined(_MSC_VER)
42
-# if defined(__DMC__) || defined(_MSC_VER)
41
+#if defined( __MINGW32__) || defined(__DMC__) || defined(_MSC_VER) || defined(__POCC__)
42
+# if defined(__DMC__) || defined(_MSC_VER) || defined(__POCC__)
4343
typedef int socklen_t;
4444
# endif
4545
# ifndef _WIN32
4646
# define _WIN32
4747
# endif
4848
--- src/config.h
+++ src/config.h
@@ -36,12 +36,12 @@
36 #include <stdlib.h>
37 #include <ctype.h>
38 #include <string.h>
39 #include <stdarg.h>
40 #include <assert.h>
41 #if defined( __MINGW32__) || defined(__DMC__) || defined(_MSC_VER)
42 # if defined(__DMC__) || defined(_MSC_VER)
43 typedef int socklen_t;
44 # endif
45 # ifndef _WIN32
46 # define _WIN32
47 # endif
48
--- src/config.h
+++ src/config.h
@@ -36,12 +36,12 @@
36 #include <stdlib.h>
37 #include <ctype.h>
38 #include <string.h>
39 #include <stdarg.h>
40 #include <assert.h>
41 #if defined( __MINGW32__) || defined(__DMC__) || defined(_MSC_VER) || defined(__POCC__)
42 # if defined(__DMC__) || defined(_MSC_VER) || defined(__POCC__)
43 typedef int socklen_t;
44 # endif
45 # ifndef _WIN32
46 # define _WIN32
47 # endif
48
+44 -24
--- src/info.c
+++ src/info.c
@@ -1306,12 +1306,14 @@
13061306
{ "#d0c0ff", "#d0c0ff" },
13071307
{ "#ffc0ff", "#ffc0ff" },
13081308
{ "#ffc0d0", "#ffc0d0" },
13091309
{ "#fff0c0", "#fff0c0" },
13101310
{ "#c0c0c0", "#c0c0c0" },
1311
+ { "custom", "##" },
13111312
};
1312
- int nColor = sizeof(aColor)/sizeof(aColor[0]);
1313
+ int nColor = sizeof(aColor)/sizeof(aColor[0])-1;
1314
+ int stdClrFound;
13131315
int i;
13141316
13151317
login_check_credentials();
13161318
if( !g.okWrite ){ login_needed(); return; }
13171319
rid = name_to_rid(P("r"));
@@ -1332,10 +1334,13 @@
13321334
if( zDate==0 ) fossil_redirect_home();
13331335
zNewDate = PD("dt",zDate);
13341336
zColor = db_text("", "SELECT bgcolor"
13351337
" FROM event WHERE objid=%d", rid);
13361338
zNewColor = PD("clr",zColor);
1339
+ if( strcmp(zNewColor,aColor[nColor].zColor)==0 ){
1340
+ zNewColor = P("clrcust");
1341
+ }
13371342
fPropagateColor = P("pclr")!=0;
13381343
zNewTagFlag = P("newtag") ? " checked" : "";
13391344
zNewTag = PD("tagname","");
13401345
zNewBrFlag = P("newbr") ? " checked" : "";
13411346
zNewBranch = PD("brname","");
@@ -1474,66 +1479,81 @@
14741479
@ <hr />
14751480
blob_reset(&suffix);
14761481
}
14771482
@ <p>Make changes to attributes of check-in
14781483
@ [<a href="ci?name=%s(zUuid)">%s(zUuid)</a>]:</p>
1479
- @ <form action="%s(g.zBaseURL)/ci_edit" method="POST">
1484
+ @ <form action="%s(g.zBaseURL)/ci_edit" method="post"><div>
14801485
login_insert_csrf_secret();
1481
- @ <input type="hidden" name="r" value="%S(zUuid)">
1486
+ @ <input type="hidden" name="r" value="%S(zUuid)" />
14821487
@ <table border="0" cellspacing="10">
14831488
14841489
@ <tr><td align="right" valign="top"><b>User:</b></td>
14851490
@ <td valign="top">
1486
- @ <input type="text" name="u" size="20" value="%h(zNewUser)">
1491
+ @ <input type="text" name="u" size="20" value="%h(zNewUser)" />
14871492
@ </td></tr>
14881493
14891494
@ <tr><td align="right" valign="top"><b>Comment:</b></td>
14901495
@ <td valign="top">
14911496
@ <textarea name="c" rows="10" cols="80">%h(zNewComment)</textarea>
14921497
@ </td></tr>
14931498
14941499
@ <tr><td align="right" valign="top"><b>Check-in Time:</b></td>
14951500
@ <td valign="top">
1496
- @ <input type="text" name="dt" size="20" value="%h(zNewDate)">
1501
+ @ <input type="text" name="dt" size="20" value="%h(zNewDate)" />
14971502
@ </td></tr>
14981503
14991504
@ <tr><td align="right" valign="top"><b>Background Color:</b></td>
15001505
@ <td valign="top">
1501
- @ <table border=0 cellpadding=0 cellspacing=1>
1506
+ @ <table border="0" cellpadding="0" cellspacing="1">
15021507
@ <tr><td colspan="6" align="left">
15031508
if( fPropagateColor ){
1504
- @ <input type="checkbox" name="pclr" checked>
1509
+ @ <input type="checkbox" name="pclr" checked="checked" />
15051510
}else{
1506
- @ <input type="checkbox" name="pclr">
1511
+ @ <input type="checkbox" name="pclr" />
15071512
}
1508
- @ Propagate color to descendants</input></td></tr>
1513
+ @ Propagate color to descendants</td></tr>
15091514
@ <tr>
1510
- for(i=0; i<nColor; i++){
1515
+ for(i=0,stdClrFound=0; i<nColor; i++){
15111516
if( aColor[i].zColor[0] ){
15121517
@ <td style="background-color: %h(aColor[i].zColor);">
15131518
}else{
15141519
@ <td>
15151520
}
15161521
if( strcmp(zNewColor, aColor[i].zColor)==0 ){
1517
- @ <input type="radio" name="clr" value="%h(aColor[i].zColor)" checked>
1522
+ @ <input type="radio" name="clr" value="%h(aColor[i].zColor)"
1523
+ @ checked="checked" />
1524
+ stdClrFound=1;
15181525
}else{
1519
- @ <input type="radio" name="clr" value="%h(aColor[i].zColor)">
1526
+ @ <input type="radio" name="clr" value="%h(aColor[i].zColor)" />
15201527
}
1521
- @ %h(aColor[i].zCName)</input></td>
1528
+ @ %h(aColor[i].zCName)</td>
15221529
if( (i%6)==5 && i+1<nColor ){
15231530
@ </tr><tr>
15241531
}
15251532
}
1533
+ @ </tr><tr>
1534
+ if (stdClrFound){
1535
+ @ <td colspan="6">
1536
+ @ <input type="radio" name="clr" value="%h(aColor[nColor].zColor)" />
1537
+ }else{
1538
+ @ <td style="background-color: %h(zNewColor);" colspan="6">
1539
+ @ <input type="radio" name="clr" value="%h(aColor[nColor].zColor)"
1540
+ @ checked="checked" />
1541
+ }
1542
+ @ %h(aColor[i].zCName)&nbsp;
1543
+ @ <input type="text" name="clrcust" id="clrcust" class="checkinUserColor"
1544
+ @ value="%h(stdClrFound?"":zNewColor)" />
1545
+ @ </td>
15261546
@ </tr>
15271547
@ </table>
15281548
@ </td></tr>
15291549
15301550
@ <tr><td align="right" valign="top"><b>Tags:</b></td>
15311551
@ <td valign="top">
1532
- @ <input type="checkbox" name="newtag"%s(zNewTagFlag)>
1552
+ @ <input type="checkbox" name="newtag"%s(zNewTagFlag) />
15331553
@ Add the following new tag name to this check-in:
1534
- @ <input type="text" width="15" name="tagname" value="%h(zNewTag)">
1554
+ @ <input type="text" style="width:15;" name="tagname" value="%h(zNewTag)" />
15351555
db_prepare(&q,
15361556
"SELECT tag.tagid, tagname FROM tagxref, tag"
15371557
" WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid"
15381558
" ORDER BY CASE WHEN tagname GLOB 'sym-*' THEN substr(tagname,5)"
15391559
" ELSE tagname END",
@@ -1543,13 +1563,13 @@
15431563
int tagid = db_column_int(&q, 0);
15441564
const char *zTagName = db_column_text(&q, 1);
15451565
char zLabel[30];
15461566
sprintf(zLabel, "c%d", tagid);
15471567
if( P(zLabel) ){
1548
- @ <br /><input type="checkbox" name="c%d(tagid)" checked>
1568
+ @ <br /><input type="checkbox" name="c%d(tagid)" checked="checked" />
15491569
}else{
1550
- @ <br /><input type="checkbox" name="c%d(tagid)">
1570
+ @ <br /><input type="checkbox" name="c%d(tagid)" />
15511571
}
15521572
if( strncmp(zTagName, "sym-", 4)==0 ){
15531573
@ Cancel tag <b>%h(&zTagName[4])</b>
15541574
}else{
15551575
@ Cancel special tag <b>%h(zTagName)</b>
@@ -1558,33 +1578,33 @@
15581578
db_finalize(&q);
15591579
@ </td></tr>
15601580
15611581
@ <tr><td align="right" valign="top"><b>Branching:</b></td>
15621582
@ <td valign="top">
1563
- @ <input type="checkbox" name="newbr"%s(zNewBrFlag)>
1583
+ @ <input type="checkbox" name="newbr"%s(zNewBrFlag) />
15641584
@ Make this check-in the start of a new branch named:
1565
- @ <input type="text" width="15" name="brname" value="%h(zNewBranch)">
1585
+ @ <input type="text" style="width:15;" name="brname" value="%h(zNewBranch)" />
15661586
@ </td></tr>
15671587
15681588
if( is_a_leaf(rid)
15691589
&& !db_exists("SELECT 1 FROM tagxref "
15701590
" WHERE tagid=%d AND rid=%d AND tagtype>0",
15711591
TAG_CLOSED, rid)
15721592
){
15731593
@ <tr><td align="right" valign="top"><b>Leaf Closure:</b></td>
15741594
@ <td valign="top">
1575
- @ <input type="checkbox" name="close"%s(zCloseFlag)>
1595
+ @ <input type="checkbox" name="close"%s(zCloseFlag) />
15761596
@ Mark this leaf as "closed" so that it no longer appears on the
15771597
@ "leaves" page and is no longer labeled as a "<b>Leaf</b>".
15781598
@ </td></tr>
15791599
}
15801600
15811601
15821602
@ <tr><td colspan="2">
1583
- @ <input type="submit" name="preview" value="Preview">
1584
- @ <input type="submit" name="apply" value="Apply Changes">
1585
- @ <input type="submit" name="cancel" value="Cancel">
1603
+ @ <input type="submit" name="preview" value="Preview" />
1604
+ @ <input type="submit" name="apply" value="Apply Changes" />
1605
+ @ <input type="submit" name="cancel" value="Cancel" />
15861606
@ </td></tr>
15871607
@ </table>
1588
- @ </form>
1608
+ @ </div></form>
15891609
style_footer();
15901610
}
15911611
--- src/info.c
+++ src/info.c
@@ -1306,12 +1306,14 @@
1306 { "#d0c0ff", "#d0c0ff" },
1307 { "#ffc0ff", "#ffc0ff" },
1308 { "#ffc0d0", "#ffc0d0" },
1309 { "#fff0c0", "#fff0c0" },
1310 { "#c0c0c0", "#c0c0c0" },
 
1311 };
1312 int nColor = sizeof(aColor)/sizeof(aColor[0]);
 
1313 int i;
1314
1315 login_check_credentials();
1316 if( !g.okWrite ){ login_needed(); return; }
1317 rid = name_to_rid(P("r"));
@@ -1332,10 +1334,13 @@
1332 if( zDate==0 ) fossil_redirect_home();
1333 zNewDate = PD("dt",zDate);
1334 zColor = db_text("", "SELECT bgcolor"
1335 " FROM event WHERE objid=%d", rid);
1336 zNewColor = PD("clr",zColor);
 
 
 
1337 fPropagateColor = P("pclr")!=0;
1338 zNewTagFlag = P("newtag") ? " checked" : "";
1339 zNewTag = PD("tagname","");
1340 zNewBrFlag = P("newbr") ? " checked" : "";
1341 zNewBranch = PD("brname","");
@@ -1474,66 +1479,81 @@
1474 @ <hr />
1475 blob_reset(&suffix);
1476 }
1477 @ <p>Make changes to attributes of check-in
1478 @ [<a href="ci?name=%s(zUuid)">%s(zUuid)</a>]:</p>
1479 @ <form action="%s(g.zBaseURL)/ci_edit" method="POST">
1480 login_insert_csrf_secret();
1481 @ <input type="hidden" name="r" value="%S(zUuid)">
1482 @ <table border="0" cellspacing="10">
1483
1484 @ <tr><td align="right" valign="top"><b>User:</b></td>
1485 @ <td valign="top">
1486 @ <input type="text" name="u" size="20" value="%h(zNewUser)">
1487 @ </td></tr>
1488
1489 @ <tr><td align="right" valign="top"><b>Comment:</b></td>
1490 @ <td valign="top">
1491 @ <textarea name="c" rows="10" cols="80">%h(zNewComment)</textarea>
1492 @ </td></tr>
1493
1494 @ <tr><td align="right" valign="top"><b>Check-in Time:</b></td>
1495 @ <td valign="top">
1496 @ <input type="text" name="dt" size="20" value="%h(zNewDate)">
1497 @ </td></tr>
1498
1499 @ <tr><td align="right" valign="top"><b>Background Color:</b></td>
1500 @ <td valign="top">
1501 @ <table border=0 cellpadding=0 cellspacing=1>
1502 @ <tr><td colspan="6" align="left">
1503 if( fPropagateColor ){
1504 @ <input type="checkbox" name="pclr" checked>
1505 }else{
1506 @ <input type="checkbox" name="pclr">
1507 }
1508 @ Propagate color to descendants</input></td></tr>
1509 @ <tr>
1510 for(i=0; i<nColor; i++){
1511 if( aColor[i].zColor[0] ){
1512 @ <td style="background-color: %h(aColor[i].zColor);">
1513 }else{
1514 @ <td>
1515 }
1516 if( strcmp(zNewColor, aColor[i].zColor)==0 ){
1517 @ <input type="radio" name="clr" value="%h(aColor[i].zColor)" checked>
 
 
1518 }else{
1519 @ <input type="radio" name="clr" value="%h(aColor[i].zColor)">
1520 }
1521 @ %h(aColor[i].zCName)</input></td>
1522 if( (i%6)==5 && i+1<nColor ){
1523 @ </tr><tr>
1524 }
1525 }
 
 
 
 
 
 
 
 
 
 
 
 
 
1526 @ </tr>
1527 @ </table>
1528 @ </td></tr>
1529
1530 @ <tr><td align="right" valign="top"><b>Tags:</b></td>
1531 @ <td valign="top">
1532 @ <input type="checkbox" name="newtag"%s(zNewTagFlag)>
1533 @ Add the following new tag name to this check-in:
1534 @ <input type="text" width="15" name="tagname" value="%h(zNewTag)">
1535 db_prepare(&q,
1536 "SELECT tag.tagid, tagname FROM tagxref, tag"
1537 " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid"
1538 " ORDER BY CASE WHEN tagname GLOB 'sym-*' THEN substr(tagname,5)"
1539 " ELSE tagname END",
@@ -1543,13 +1563,13 @@
1543 int tagid = db_column_int(&q, 0);
1544 const char *zTagName = db_column_text(&q, 1);
1545 char zLabel[30];
1546 sprintf(zLabel, "c%d", tagid);
1547 if( P(zLabel) ){
1548 @ <br /><input type="checkbox" name="c%d(tagid)" checked>
1549 }else{
1550 @ <br /><input type="checkbox" name="c%d(tagid)">
1551 }
1552 if( strncmp(zTagName, "sym-", 4)==0 ){
1553 @ Cancel tag <b>%h(&zTagName[4])</b>
1554 }else{
1555 @ Cancel special tag <b>%h(zTagName)</b>
@@ -1558,33 +1578,33 @@
1558 db_finalize(&q);
1559 @ </td></tr>
1560
1561 @ <tr><td align="right" valign="top"><b>Branching:</b></td>
1562 @ <td valign="top">
1563 @ <input type="checkbox" name="newbr"%s(zNewBrFlag)>
1564 @ Make this check-in the start of a new branch named:
1565 @ <input type="text" width="15" name="brname" value="%h(zNewBranch)">
1566 @ </td></tr>
1567
1568 if( is_a_leaf(rid)
1569 && !db_exists("SELECT 1 FROM tagxref "
1570 " WHERE tagid=%d AND rid=%d AND tagtype>0",
1571 TAG_CLOSED, rid)
1572 ){
1573 @ <tr><td align="right" valign="top"><b>Leaf Closure:</b></td>
1574 @ <td valign="top">
1575 @ <input type="checkbox" name="close"%s(zCloseFlag)>
1576 @ Mark this leaf as "closed" so that it no longer appears on the
1577 @ "leaves" page and is no longer labeled as a "<b>Leaf</b>".
1578 @ </td></tr>
1579 }
1580
1581
1582 @ <tr><td colspan="2">
1583 @ <input type="submit" name="preview" value="Preview">
1584 @ <input type="submit" name="apply" value="Apply Changes">
1585 @ <input type="submit" name="cancel" value="Cancel">
1586 @ </td></tr>
1587 @ </table>
1588 @ </form>
1589 style_footer();
1590 }
1591
--- src/info.c
+++ src/info.c
@@ -1306,12 +1306,14 @@
1306 { "#d0c0ff", "#d0c0ff" },
1307 { "#ffc0ff", "#ffc0ff" },
1308 { "#ffc0d0", "#ffc0d0" },
1309 { "#fff0c0", "#fff0c0" },
1310 { "#c0c0c0", "#c0c0c0" },
1311 { "custom", "##" },
1312 };
1313 int nColor = sizeof(aColor)/sizeof(aColor[0])-1;
1314 int stdClrFound;
1315 int i;
1316
1317 login_check_credentials();
1318 if( !g.okWrite ){ login_needed(); return; }
1319 rid = name_to_rid(P("r"));
@@ -1332,10 +1334,13 @@
1334 if( zDate==0 ) fossil_redirect_home();
1335 zNewDate = PD("dt",zDate);
1336 zColor = db_text("", "SELECT bgcolor"
1337 " FROM event WHERE objid=%d", rid);
1338 zNewColor = PD("clr",zColor);
1339 if( strcmp(zNewColor,aColor[nColor].zColor)==0 ){
1340 zNewColor = P("clrcust");
1341 }
1342 fPropagateColor = P("pclr")!=0;
1343 zNewTagFlag = P("newtag") ? " checked" : "";
1344 zNewTag = PD("tagname","");
1345 zNewBrFlag = P("newbr") ? " checked" : "";
1346 zNewBranch = PD("brname","");
@@ -1474,66 +1479,81 @@
1479 @ <hr />
1480 blob_reset(&suffix);
1481 }
1482 @ <p>Make changes to attributes of check-in
1483 @ [<a href="ci?name=%s(zUuid)">%s(zUuid)</a>]:</p>
1484 @ <form action="%s(g.zBaseURL)/ci_edit" method="post"><div>
1485 login_insert_csrf_secret();
1486 @ <input type="hidden" name="r" value="%S(zUuid)" />
1487 @ <table border="0" cellspacing="10">
1488
1489 @ <tr><td align="right" valign="top"><b>User:</b></td>
1490 @ <td valign="top">
1491 @ <input type="text" name="u" size="20" value="%h(zNewUser)" />
1492 @ </td></tr>
1493
1494 @ <tr><td align="right" valign="top"><b>Comment:</b></td>
1495 @ <td valign="top">
1496 @ <textarea name="c" rows="10" cols="80">%h(zNewComment)</textarea>
1497 @ </td></tr>
1498
1499 @ <tr><td align="right" valign="top"><b>Check-in Time:</b></td>
1500 @ <td valign="top">
1501 @ <input type="text" name="dt" size="20" value="%h(zNewDate)" />
1502 @ </td></tr>
1503
1504 @ <tr><td align="right" valign="top"><b>Background Color:</b></td>
1505 @ <td valign="top">
1506 @ <table border="0" cellpadding="0" cellspacing="1">
1507 @ <tr><td colspan="6" align="left">
1508 if( fPropagateColor ){
1509 @ <input type="checkbox" name="pclr" checked="checked" />
1510 }else{
1511 @ <input type="checkbox" name="pclr" />
1512 }
1513 @ Propagate color to descendants</td></tr>
1514 @ <tr>
1515 for(i=0,stdClrFound=0; i<nColor; i++){
1516 if( aColor[i].zColor[0] ){
1517 @ <td style="background-color: %h(aColor[i].zColor);">
1518 }else{
1519 @ <td>
1520 }
1521 if( strcmp(zNewColor, aColor[i].zColor)==0 ){
1522 @ <input type="radio" name="clr" value="%h(aColor[i].zColor)"
1523 @ checked="checked" />
1524 stdClrFound=1;
1525 }else{
1526 @ <input type="radio" name="clr" value="%h(aColor[i].zColor)" />
1527 }
1528 @ %h(aColor[i].zCName)</td>
1529 if( (i%6)==5 && i+1<nColor ){
1530 @ </tr><tr>
1531 }
1532 }
1533 @ </tr><tr>
1534 if (stdClrFound){
1535 @ <td colspan="6">
1536 @ <input type="radio" name="clr" value="%h(aColor[nColor].zColor)" />
1537 }else{
1538 @ <td style="background-color: %h(zNewColor);" colspan="6">
1539 @ <input type="radio" name="clr" value="%h(aColor[nColor].zColor)"
1540 @ checked="checked" />
1541 }
1542 @ %h(aColor[i].zCName)&nbsp;
1543 @ <input type="text" name="clrcust" id="clrcust" class="checkinUserColor"
1544 @ value="%h(stdClrFound?"":zNewColor)" />
1545 @ </td>
1546 @ </tr>
1547 @ </table>
1548 @ </td></tr>
1549
1550 @ <tr><td align="right" valign="top"><b>Tags:</b></td>
1551 @ <td valign="top">
1552 @ <input type="checkbox" name="newtag"%s(zNewTagFlag) />
1553 @ Add the following new tag name to this check-in:
1554 @ <input type="text" style="width:15;" name="tagname" value="%h(zNewTag)" />
1555 db_prepare(&q,
1556 "SELECT tag.tagid, tagname FROM tagxref, tag"
1557 " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid"
1558 " ORDER BY CASE WHEN tagname GLOB 'sym-*' THEN substr(tagname,5)"
1559 " ELSE tagname END",
@@ -1543,13 +1563,13 @@
1563 int tagid = db_column_int(&q, 0);
1564 const char *zTagName = db_column_text(&q, 1);
1565 char zLabel[30];
1566 sprintf(zLabel, "c%d", tagid);
1567 if( P(zLabel) ){
1568 @ <br /><input type="checkbox" name="c%d(tagid)" checked="checked" />
1569 }else{
1570 @ <br /><input type="checkbox" name="c%d(tagid)" />
1571 }
1572 if( strncmp(zTagName, "sym-", 4)==0 ){
1573 @ Cancel tag <b>%h(&zTagName[4])</b>
1574 }else{
1575 @ Cancel special tag <b>%h(zTagName)</b>
@@ -1558,33 +1578,33 @@
1578 db_finalize(&q);
1579 @ </td></tr>
1580
1581 @ <tr><td align="right" valign="top"><b>Branching:</b></td>
1582 @ <td valign="top">
1583 @ <input type="checkbox" name="newbr"%s(zNewBrFlag) />
1584 @ Make this check-in the start of a new branch named:
1585 @ <input type="text" style="width:15;" name="brname" value="%h(zNewBranch)" />
1586 @ </td></tr>
1587
1588 if( is_a_leaf(rid)
1589 && !db_exists("SELECT 1 FROM tagxref "
1590 " WHERE tagid=%d AND rid=%d AND tagtype>0",
1591 TAG_CLOSED, rid)
1592 ){
1593 @ <tr><td align="right" valign="top"><b>Leaf Closure:</b></td>
1594 @ <td valign="top">
1595 @ <input type="checkbox" name="close"%s(zCloseFlag) />
1596 @ Mark this leaf as "closed" so that it no longer appears on the
1597 @ "leaves" page and is no longer labeled as a "<b>Leaf</b>".
1598 @ </td></tr>
1599 }
1600
1601
1602 @ <tr><td colspan="2">
1603 @ <input type="submit" name="preview" value="Preview" />
1604 @ <input type="submit" name="apply" value="Apply Changes" />
1605 @ <input type="submit" name="cancel" value="Cancel" />
1606 @ </td></tr>
1607 @ </table>
1608 @ </div></form>
1609 style_footer();
1610 }
1611
+4 -4
--- src/main.c
+++ src/main.c
@@ -290,11 +290,11 @@
290290
va_start(ap, zFormat);
291291
z = vmprintf(zFormat, ap);
292292
va_end(ap);
293293
if( g.cgiOutput && once ){
294294
once = 0;
295
- cgi_printf("<p><font color=\"red\">%h</font></p>", z);
295
+ cgi_printf("<p class=\"generalError\">%h</p>", z);
296296
cgi_reply();
297297
}else{
298298
fprintf(stderr, "%s: %s\n", g.argv[0], z);
299299
}
300300
db_force_rollback();
@@ -307,11 +307,11 @@
307307
va_start(ap, zFormat);
308308
z = vmprintf(zFormat, ap);
309309
va_end(ap);
310310
if( g.cgiOutput ){
311311
g.cgiOutput = 0;
312
- cgi_printf("<p><font color=\"red\">%h</font></p>", z);
312
+ cgi_printf("<p class=\"generalError\">%h</p>", z);
313313
cgi_reply();
314314
}else{
315315
fprintf(stderr, "%s: %s\n", g.argv[0], z);
316316
}
317317
db_force_rollback();
@@ -335,11 +335,11 @@
335335
va_start(ap, zFormat);
336336
z = vmprintf(zFormat, ap);
337337
va_end(ap);
338338
if( g.cgiOutput ){
339339
g.cgiOutput = 0;
340
- cgi_printf("<p><font color=\"red\">%h</font></p>", z);
340
+ cgi_printf("<p class=\"generalError\">%h</p>", z);
341341
cgi_reply();
342342
}else{
343343
fprintf(stderr, "%s: %s\n", g.argv[0], z);
344344
}
345345
db_force_rollback();
@@ -353,11 +353,11 @@
353353
va_list ap;
354354
va_start(ap, zFormat);
355355
z = vmprintf(zFormat, ap);
356356
va_end(ap);
357357
if( g.cgiOutput ){
358
- cgi_printf("<p><font color=\"red\">%h</font></p>", z);
358
+ cgi_printf("<p class=\"generalError\">%h</p>", z);
359359
}else{
360360
fprintf(stderr, "%s: %s\n", g.argv[0], z);
361361
}
362362
}
363363
364364
--- src/main.c
+++ src/main.c
@@ -290,11 +290,11 @@
290 va_start(ap, zFormat);
291 z = vmprintf(zFormat, ap);
292 va_end(ap);
293 if( g.cgiOutput && once ){
294 once = 0;
295 cgi_printf("<p><font color=\"red\">%h</font></p>", z);
296 cgi_reply();
297 }else{
298 fprintf(stderr, "%s: %s\n", g.argv[0], z);
299 }
300 db_force_rollback();
@@ -307,11 +307,11 @@
307 va_start(ap, zFormat);
308 z = vmprintf(zFormat, ap);
309 va_end(ap);
310 if( g.cgiOutput ){
311 g.cgiOutput = 0;
312 cgi_printf("<p><font color=\"red\">%h</font></p>", z);
313 cgi_reply();
314 }else{
315 fprintf(stderr, "%s: %s\n", g.argv[0], z);
316 }
317 db_force_rollback();
@@ -335,11 +335,11 @@
335 va_start(ap, zFormat);
336 z = vmprintf(zFormat, ap);
337 va_end(ap);
338 if( g.cgiOutput ){
339 g.cgiOutput = 0;
340 cgi_printf("<p><font color=\"red\">%h</font></p>", z);
341 cgi_reply();
342 }else{
343 fprintf(stderr, "%s: %s\n", g.argv[0], z);
344 }
345 db_force_rollback();
@@ -353,11 +353,11 @@
353 va_list ap;
354 va_start(ap, zFormat);
355 z = vmprintf(zFormat, ap);
356 va_end(ap);
357 if( g.cgiOutput ){
358 cgi_printf("<p><font color=\"red\">%h</font></p>", z);
359 }else{
360 fprintf(stderr, "%s: %s\n", g.argv[0], z);
361 }
362 }
363
364
--- src/main.c
+++ src/main.c
@@ -290,11 +290,11 @@
290 va_start(ap, zFormat);
291 z = vmprintf(zFormat, ap);
292 va_end(ap);
293 if( g.cgiOutput && once ){
294 once = 0;
295 cgi_printf("<p class=\"generalError\">%h</p>", z);
296 cgi_reply();
297 }else{
298 fprintf(stderr, "%s: %s\n", g.argv[0], z);
299 }
300 db_force_rollback();
@@ -307,11 +307,11 @@
307 va_start(ap, zFormat);
308 z = vmprintf(zFormat, ap);
309 va_end(ap);
310 if( g.cgiOutput ){
311 g.cgiOutput = 0;
312 cgi_printf("<p class=\"generalError\">%h</p>", z);
313 cgi_reply();
314 }else{
315 fprintf(stderr, "%s: %s\n", g.argv[0], z);
316 }
317 db_force_rollback();
@@ -335,11 +335,11 @@
335 va_start(ap, zFormat);
336 z = vmprintf(zFormat, ap);
337 va_end(ap);
338 if( g.cgiOutput ){
339 g.cgiOutput = 0;
340 cgi_printf("<p class=\"generalError\">%h</p>", z);
341 cgi_reply();
342 }else{
343 fprintf(stderr, "%s: %s\n", g.argv[0], z);
344 }
345 db_force_rollback();
@@ -353,11 +353,11 @@
353 va_list ap;
354 va_start(ap, zFormat);
355 z = vmprintf(zFormat, ap);
356 va_end(ap);
357 if( g.cgiOutput ){
358 cgi_printf("<p class=\"generalError\">%h</p>", z);
359 }else{
360 fprintf(stderr, "%s: %s\n", g.argv[0], z);
361 }
362 }
363
364
+126 -27
--- src/rebuild.c
+++ src/rebuild.c
@@ -401,26 +401,63 @@
401401
}else{
402402
rebuild_db(0, 1);
403403
db_end_transaction(0);
404404
}
405405
}
406
+
407
+/*
408
+** help function for reconstruct for recursiv directory
409
+** reading.
410
+*/
411
+void recon_read_dir(char * zPath){
412
+ DIR *d;
413
+ struct dirent *pEntry;
414
+ Blob aContent; /* content of the just read artifact */
415
+
416
+ d = opendir(zPath);
417
+ if( d ){
418
+ while( (pEntry=readdir(d))!=0 ){
419
+ Blob path;
420
+ char *zSubpath;
421
+
422
+ if( pEntry->d_name[0]=='.' ){
423
+ continue;
424
+ }
425
+ zSubpath = mprintf("%s/%s",zPath,pEntry->d_name);
426
+ if( file_isdir(zSubpath)==1 ){
427
+ recon_read_dir(zSubpath);
428
+ }
429
+ blob_init(&path, 0, 0);
430
+ blob_appendf(&path, "%s", zSubpath);
431
+ if( blob_read_from_file(&aContent, blob_str(&path))==-1 ){
432
+ fossil_panic("some unknown error occurred while reading \"%s\"",
433
+ blob_str(&path));
434
+ }
435
+ content_put(&aContent, 0, 0);
436
+ blob_reset(&path);
437
+ blob_reset(&aContent);
438
+ free(zSubpath);
439
+ }
440
+ }else {
441
+ fossil_panic("encountered error %d while trying to open \"%s\".",
442
+ errno, g.argv[3]);
443
+ }
444
+}
406445
407446
/*
408447
** COMMAND: reconstruct
409448
**
410449
** Usage: %fossil reconstruct FILENAME DIRECTORY
411450
**
412451
** This command studies the artifacts (files) in DIRECTORY and
413452
** reconstructs the fossil record from them. It places the new
414
-** fossil repository in FILENAME
453
+** fossil repository in FILENAME. Subdirectories are read, files
454
+** with leading '.' in the filename are ignored.
415455
**
416456
*/
417457
void reconstruct_cmd(void) {
418458
char *zPassword;
419
- DIR *d;
420
- struct dirent *pEntry;
421
- Blob aContent; /* content of the just read artifact */
422459
if( g.argc!=4 ){
423460
usage("FILENAME DIRECTORY");
424461
}
425462
if( file_isdir(g.argv[3])!=1 ){
426463
printf("\"%s\" is not a directory\n\n", g.argv[3]);
@@ -430,37 +467,99 @@
430467
db_open_repository(g.argv[2]);
431468
db_open_config(0);
432469
db_begin_transaction();
433470
db_initial_setup(0, 0, 1);
434471
435
- d = opendir(g.argv[3]);
436
- if( d ){
437
- while( (pEntry=readdir(d))!=0 ){
438
- Blob path;
439
- blob_init(&path, 0, 0);
440
- if( pEntry->d_name[0]=='.' ){
441
- continue;
442
- }
443
- if( file_isdir(pEntry->d_name)==1 ){
444
- continue;
445
- }
446
- blob_appendf(&path, "%s/%s", g.argv[3], pEntry->d_name);
447
- if( blob_read_from_file(&aContent, blob_str(&path))==-1 ){
448
- fossil_panic("Some unknown error occurred while reading \"%s\"", blob_str(&path));
449
- }
450
- content_put(&aContent, 0, 0);
451
- blob_reset(&path);
452
- blob_reset(&aContent);
453
- }
454
- }
455
- else {
456
- fossil_panic("Encountered error %d while trying to open \"%s\".", errno, g.argv[3]);
457
- }
472
+ recon_read_dir(g.argv[3]);
458473
459474
rebuild_db(0, 1);
460475
461476
db_end_transaction(0);
462477
printf("project-id: %s\n", db_get("project-code", 0));
463478
printf("server-id: %s\n", db_get("server-code", 0));
464479
zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
465480
printf("admin-user: %s (initial password is \"%s\")\n", g.zLogin, zPassword);
466481
}
482
+
483
+/*
484
+** COMMAND: deconstruct
485
+**
486
+** Usage %fossil deconstruct ?-R|--repository REPOSITORY? ?-L|--prefixlength N? DESTINATION
487
+**
488
+** This command exports all artifacts of o given repository and
489
+** writes all artifacts to the file system. The DESTINATION directory
490
+** will be populated with subdirectories AA and files AA/BBBBBBBBB.., where
491
+** AABBBBBBBBB.. is the 40 character artifact ID, AA the first 2 characters.
492
+** If -L|--prefixlength is given, the length (default 2) of the directory
493
+** prefix can be set to 0,1,..,9 characters.
494
+*/
495
+void deconstruct_cmd(void){
496
+ const char *zDestDir;
497
+ const char *zPrefixOpt;
498
+ int prefixLength = 0;
499
+ char *zAFileOutFormat;
500
+ Stmt q;
501
+
502
+ /* check number of arguments */
503
+ if( (g.argc != 3) && (g.argc != 5) && (g.argc != 7)){
504
+ usage ("?-R|--repository REPOSITORY? ?-L|--prefixlength N? DESTINATION");
505
+ }
506
+ /* get and check argument destination directory */
507
+ zDestDir = g.argv[g.argc-1];
508
+ if( !*zDestDir || !file_isdir(zDestDir)) {
509
+ fossil_panic("DESTINATION(%s) is not a directory!",zDestDir);
510
+ }
511
+ /* get and check prefix length argument and build format string */
512
+ zPrefixOpt=find_option("prefixlength","L",1);
513
+ if( !zPrefixOpt ){
514
+ prefixLength = 2;
515
+ }else{
516
+ if( zPrefixOpt[0]>='0' && zPrefixOpt[0]<='9' && !zPrefixOpt[1] ){
517
+ prefixLength = (int)(*zPrefixOpt-'0');
518
+ }else{
519
+ fossil_panic("N(%s) is not a a valid prefix length!",zPrefixOpt);
520
+ }
521
+ }
522
+ if( prefixLength ){
523
+ zAFileOutFormat = mprintf("%%s/%%.%ds/%%s",prefixLength);
524
+ }else{
525
+ zAFileOutFormat = mprintf("%%s/%%s");
526
+ }
527
+#ifndef _WIN32
528
+ if( access(zDestDir, W_OK) ){
529
+ fossil_panic("DESTINATION(%s) is not writeable!",zDestDir);
530
+ }
531
+#else
532
+ /* write access on windows is not checked, errors will be
533
+ ** dected on blob_write_to_file
534
+ */
535
+#endif
536
+ /* open repository and open query for all artifacts */
537
+ db_find_and_open_repository(1);
538
+ db_prepare(&q, "SELECT rid,uuid FROM blob");
539
+ /* loop over artifacts and write them to single files */
540
+ while( db_step(&q)==SQLITE_ROW ){
541
+ int aRid;
542
+ const char *zAUuid;
543
+ char *zAFName;
544
+ Blob zACont;
545
+
546
+ /* get data from query */
547
+ aRid = db_column_int (&q, 0);
548
+ zAUuid = db_column_text(&q, 1);
549
+
550
+ /* construct output filename */
551
+ zAFName = mprintf(zAFileOutFormat, zDestDir, zAUuid, zAUuid + prefixLength);
552
+
553
+ /* read artifact contents from db and write to file */
554
+ content_get(aRid,&zACont);
555
+ blob_write_to_file(&zACont,zAFName);
556
+ blob_reset(&zACont);
557
+
558
+ /* free artifact filename string */
559
+ free(zAFName);
560
+ }
561
+ /* close query statement */
562
+ db_finalize(&q);
563
+ /* free filename format string */
564
+ free(zAFileOutFormat);
565
+}
467566
--- src/rebuild.c
+++ src/rebuild.c
@@ -401,26 +401,63 @@
401 }else{
402 rebuild_db(0, 1);
403 db_end_transaction(0);
404 }
405 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
406
407 /*
408 ** COMMAND: reconstruct
409 **
410 ** Usage: %fossil reconstruct FILENAME DIRECTORY
411 **
412 ** This command studies the artifacts (files) in DIRECTORY and
413 ** reconstructs the fossil record from them. It places the new
414 ** fossil repository in FILENAME
 
415 **
416 */
417 void reconstruct_cmd(void) {
418 char *zPassword;
419 DIR *d;
420 struct dirent *pEntry;
421 Blob aContent; /* content of the just read artifact */
422 if( g.argc!=4 ){
423 usage("FILENAME DIRECTORY");
424 }
425 if( file_isdir(g.argv[3])!=1 ){
426 printf("\"%s\" is not a directory\n\n", g.argv[3]);
@@ -430,37 +467,99 @@
430 db_open_repository(g.argv[2]);
431 db_open_config(0);
432 db_begin_transaction();
433 db_initial_setup(0, 0, 1);
434
435 d = opendir(g.argv[3]);
436 if( d ){
437 while( (pEntry=readdir(d))!=0 ){
438 Blob path;
439 blob_init(&path, 0, 0);
440 if( pEntry->d_name[0]=='.' ){
441 continue;
442 }
443 if( file_isdir(pEntry->d_name)==1 ){
444 continue;
445 }
446 blob_appendf(&path, "%s/%s", g.argv[3], pEntry->d_name);
447 if( blob_read_from_file(&aContent, blob_str(&path))==-1 ){
448 fossil_panic("Some unknown error occurred while reading \"%s\"", blob_str(&path));
449 }
450 content_put(&aContent, 0, 0);
451 blob_reset(&path);
452 blob_reset(&aContent);
453 }
454 }
455 else {
456 fossil_panic("Encountered error %d while trying to open \"%s\".", errno, g.argv[3]);
457 }
458
459 rebuild_db(0, 1);
460
461 db_end_transaction(0);
462 printf("project-id: %s\n", db_get("project-code", 0));
463 printf("server-id: %s\n", db_get("server-code", 0));
464 zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
465 printf("admin-user: %s (initial password is \"%s\")\n", g.zLogin, zPassword);
466 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
467
--- src/rebuild.c
+++ src/rebuild.c
@@ -401,26 +401,63 @@
401 }else{
402 rebuild_db(0, 1);
403 db_end_transaction(0);
404 }
405 }
406
407 /*
408 ** help function for reconstruct for recursiv directory
409 ** reading.
410 */
411 void recon_read_dir(char * zPath){
412 DIR *d;
413 struct dirent *pEntry;
414 Blob aContent; /* content of the just read artifact */
415
416 d = opendir(zPath);
417 if( d ){
418 while( (pEntry=readdir(d))!=0 ){
419 Blob path;
420 char *zSubpath;
421
422 if( pEntry->d_name[0]=='.' ){
423 continue;
424 }
425 zSubpath = mprintf("%s/%s",zPath,pEntry->d_name);
426 if( file_isdir(zSubpath)==1 ){
427 recon_read_dir(zSubpath);
428 }
429 blob_init(&path, 0, 0);
430 blob_appendf(&path, "%s", zSubpath);
431 if( blob_read_from_file(&aContent, blob_str(&path))==-1 ){
432 fossil_panic("some unknown error occurred while reading \"%s\"",
433 blob_str(&path));
434 }
435 content_put(&aContent, 0, 0);
436 blob_reset(&path);
437 blob_reset(&aContent);
438 free(zSubpath);
439 }
440 }else {
441 fossil_panic("encountered error %d while trying to open \"%s\".",
442 errno, g.argv[3]);
443 }
444 }
445
446 /*
447 ** COMMAND: reconstruct
448 **
449 ** Usage: %fossil reconstruct FILENAME DIRECTORY
450 **
451 ** This command studies the artifacts (files) in DIRECTORY and
452 ** reconstructs the fossil record from them. It places the new
453 ** fossil repository in FILENAME. Subdirectories are read, files
454 ** with leading '.' in the filename are ignored.
455 **
456 */
457 void reconstruct_cmd(void) {
458 char *zPassword;
 
 
 
459 if( g.argc!=4 ){
460 usage("FILENAME DIRECTORY");
461 }
462 if( file_isdir(g.argv[3])!=1 ){
463 printf("\"%s\" is not a directory\n\n", g.argv[3]);
@@ -430,37 +467,99 @@
467 db_open_repository(g.argv[2]);
468 db_open_config(0);
469 db_begin_transaction();
470 db_initial_setup(0, 0, 1);
471
472 recon_read_dir(g.argv[3]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
473
474 rebuild_db(0, 1);
475
476 db_end_transaction(0);
477 printf("project-id: %s\n", db_get("project-code", 0));
478 printf("server-id: %s\n", db_get("server-code", 0));
479 zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
480 printf("admin-user: %s (initial password is \"%s\")\n", g.zLogin, zPassword);
481 }
482
483 /*
484 ** COMMAND: deconstruct
485 **
486 ** Usage %fossil deconstruct ?-R|--repository REPOSITORY? ?-L|--prefixlength N? DESTINATION
487 **
488 ** This command exports all artifacts of o given repository and
489 ** writes all artifacts to the file system. The DESTINATION directory
490 ** will be populated with subdirectories AA and files AA/BBBBBBBBB.., where
491 ** AABBBBBBBBB.. is the 40 character artifact ID, AA the first 2 characters.
492 ** If -L|--prefixlength is given, the length (default 2) of the directory
493 ** prefix can be set to 0,1,..,9 characters.
494 */
495 void deconstruct_cmd(void){
496 const char *zDestDir;
497 const char *zPrefixOpt;
498 int prefixLength = 0;
499 char *zAFileOutFormat;
500 Stmt q;
501
502 /* check number of arguments */
503 if( (g.argc != 3) && (g.argc != 5) && (g.argc != 7)){
504 usage ("?-R|--repository REPOSITORY? ?-L|--prefixlength N? DESTINATION");
505 }
506 /* get and check argument destination directory */
507 zDestDir = g.argv[g.argc-1];
508 if( !*zDestDir || !file_isdir(zDestDir)) {
509 fossil_panic("DESTINATION(%s) is not a directory!",zDestDir);
510 }
511 /* get and check prefix length argument and build format string */
512 zPrefixOpt=find_option("prefixlength","L",1);
513 if( !zPrefixOpt ){
514 prefixLength = 2;
515 }else{
516 if( zPrefixOpt[0]>='0' && zPrefixOpt[0]<='9' && !zPrefixOpt[1] ){
517 prefixLength = (int)(*zPrefixOpt-'0');
518 }else{
519 fossil_panic("N(%s) is not a a valid prefix length!",zPrefixOpt);
520 }
521 }
522 if( prefixLength ){
523 zAFileOutFormat = mprintf("%%s/%%.%ds/%%s",prefixLength);
524 }else{
525 zAFileOutFormat = mprintf("%%s/%%s");
526 }
527 #ifndef _WIN32
528 if( access(zDestDir, W_OK) ){
529 fossil_panic("DESTINATION(%s) is not writeable!",zDestDir);
530 }
531 #else
532 /* write access on windows is not checked, errors will be
533 ** dected on blob_write_to_file
534 */
535 #endif
536 /* open repository and open query for all artifacts */
537 db_find_and_open_repository(1);
538 db_prepare(&q, "SELECT rid,uuid FROM blob");
539 /* loop over artifacts and write them to single files */
540 while( db_step(&q)==SQLITE_ROW ){
541 int aRid;
542 const char *zAUuid;
543 char *zAFName;
544 Blob zACont;
545
546 /* get data from query */
547 aRid = db_column_int (&q, 0);
548 zAUuid = db_column_text(&q, 1);
549
550 /* construct output filename */
551 zAFName = mprintf(zAFileOutFormat, zDestDir, zAUuid, zAUuid + prefixLength);
552
553 /* read artifact contents from db and write to file */
554 content_get(aRid,&zACont);
555 blob_write_to_file(&zACont,zAFName);
556 blob_reset(&zACont);
557
558 /* free artifact filename string */
559 free(zAFName);
560 }
561 /* close query statement */
562 db_finalize(&q);
563 /* free filename format string */
564 free(zAFileOutFormat);
565 }
566
+25 -25
--- src/report.c
+++ src/report.c
@@ -328,11 +328,11 @@
328328
zTitle = db_text(0, "SELECT title FROM reportfmt "
329329
"WHERE rn=%d", rn);
330330
if( zTitle==0 ) cgi_redirect("reportlist");
331331
332332
style_header("Are You Sure?");
333
- @ <form action="rptedit" method="POST">
333
+ @ <form action="rptedit" method="post">
334334
@ <p>You are about to delete all traces of the report
335335
@ <strong>%h(zTitle)</strong> from
336336
@ the database. This is an irreversible operation. All records
337337
@ related to this report will be removed and cannot be recovered.</p>
338338
@
@@ -397,26 +397,26 @@
397397
if( rn>0 ){
398398
style_submenu_element("Delete", "Delete", "rptedit?rn=%d&amp;del1=1", rn);
399399
}
400400
style_header(rn>0 ? "Edit Report Format":"Create New Report Format");
401401
if( zErr ){
402
- @ <blockquote><font color="#ff0000"><b>%h(zErr)</b></font></blockquote>
402
+ @ <blockquote class="reportError">%h(zErr)</blockquote>
403403
}
404
- @ <form action="rptedit" method="POST">
405
- @ <input type="hidden" name="rn" value="%d(rn)">
404
+ @ <form action="rptedit" method="post"><div>
405
+ @ <input type="hidden" name="rn" value="%d(rn)" />
406406
@ <p>Report Title:<br />
407
- @ <input type="text" name="t" value="%h(zTitle)" size="60"></p>
407
+ @ <input type="text" name="t" value="%h(zTitle)" size="60" /></p>
408408
@ <p>Enter a complete SQL query statement against the "TICKET" table:<br />
409409
@ <textarea name="s" rows="20" cols="80">%h(zSQL)</textarea>
410410
@ </p>
411411
login_insert_csrf_secret();
412412
if( g.okAdmin ){
413413
@ <p>Report owner:
414
- @ <input type="text" name="w" size="20" value="%h(zOwner)">
414
+ @ <input type="text" name="w" size="20" value="%h(zOwner)" />
415415
@ </p>
416416
} else {
417
- @ <input type="hidden" name="w" value="%h(zOwner)">
417
+ @ <input type="hidden" name="w" value="%h(zOwner)" />
418418
}
419419
@ <p>Enter an optional color key in the following box. (If blank, no
420420
@ color key is displayed.) Each line contains the text for a single
421421
@ entry in the key. The first token of each line is the background
422422
@ color for that line.<br />
@@ -428,15 +428,15 @@
428428
@ </form>
429429
report_format_hints();
430430
style_footer();
431431
return;
432432
}
433
- @ <input type="submit" value="Apply Changes">
433
+ @ <input type="submit" value="Apply Changes" />
434434
if( rn>0 ){
435
- @ <input type="submit" value="Delete This Report" name="del1">
435
+ @ <input type="submit" value="Delete This Report" name="del1" />
436436
}
437
- @ </form>
437
+ @ </div></form>
438438
report_format_hints();
439439
style_footer();
440440
}
441441
442442
/*
@@ -478,17 +478,17 @@
478478
@ <p>In this example, the first column in the result set is named
479479
@ "bgcolor". The value of this column is not displayed. Instead, it
480480
@ selects the background color of each row based on the TICKET.STATUS
481481
@ field of the database. The color key at the right shows the various
482482
@ color codes.</p>
483
- @ <table align="right" style="margin: 0 5px;" border=1 cellspacing=0 width=125>
484
- @ <tr bgcolor="#f2dcdc"><td align="center">new or active</td></tr>
485
- @ <tr bgcolor="#e8e8bd"><td align="center">review</td></tr>
486
- @ <tr bgcolor="#cfe8bd"><td align="center">fixed</td></tr>
487
- @ <tr bgcolor="#bde5d6"><td align="center">tested</td></tr>
488
- @ <tr bgcolor="#cacae5"><td align="center">defer</td></tr>
489
- @ <tr bgcolor="#c8c8c8"><td align="center">closed</td></tr>
483
+ @ <table class="rpteditex">
484
+ @ <tr style="background-color:#f2dcdc;"><td class="rpteditex">new or active</td></tr>
485
+ @ <tr style="background-color:#e8e8bd;"><td class="rpteditex">review</td></tr>
486
+ @ <tr style="background-color:#cfe8bd;"><td class="rpteditex">fixed</td></tr>
487
+ @ <tr style="background-color:#bde5d6;"><td class="rpteditex">tested</td></tr>
488
+ @ <tr style="background-color:#cacae5;"><td class="rpteditex">defer</td></tr>
489
+ @ <tr style="background-color:#c8c8c8;"><td class="rpteditex">closed</td></tr>
490490
@ </table>
491491
@ <blockquote><pre>
492492
@ SELECT
493493
@ CASE WHEN status IN ('new','active') THEN '#f2dcdc'
494494
@ WHEN status='review' THEN '#e8e8bd'
@@ -510,16 +510,16 @@
510510
@ FROM ticket
511511
@ </pre></blockquote>
512512
@ <p>To base the background color on the TICKET.PRIORITY or
513513
@ TICKET.SEVERITY fields, substitute the following code for the
514514
@ first column of the query:</p>
515
- @ <table align="right" style="margin: 0 5px;" border=1 cellspacing=0 width=125>
516
- @ <tr bgcolor="#f2dcdc"><td align="center">1</td></tr>
517
- @ <tr bgcolor="#e8e8bd"><td align="center">2</td></tr>
518
- @ <tr bgcolor="#cfe8bd"><td align="center">3</td></tr>
519
- @ <tr bgcolor="#cacae5"><td align="center">4</td></tr>
520
- @ <tr bgcolor="#c8c8c8"><td align="center">5</td></tr>
515
+ @ <table class="rpteditex">
516
+ @ <tr style="background-color:#f2dcdc;"><td class="rpteditex">1</td></tr>
517
+ @ <tr style="background-color:#e8e8bd;"><td class="rpteditex">2</td></tr>
518
+ @ <tr style="background-color:#cfe8bd;"><td class="rpteditex">3</td></tr>
519
+ @ <tr style="background-color:#cacae5;"><td class="rpteditex">4</td></tr>
520
+ @ <tr style="background-color:#c8c8c8;"><td class="rpteditex">5</td></tr>
521521
@ </table>
522522
@ <blockquote><pre>
523523
@ SELECT
524524
@ CASE priority WHEN 1 THEN '#f2dcdc'
525525
@ WHEN 2 THEN '#e8e8bd'
@@ -930,17 +930,17 @@
930930
sqlite3_set_authorizer(g.db, report_query_authorizer, (void*)&zErr1);
931931
sqlite3_exec(g.db, zSql, generate_html, &sState, &zErr2);
932932
sqlite3_set_authorizer(g.db, 0, 0);
933933
@ </table>
934934
if( zErr1 ){
935
- @ <p><font color="red"><b>Error: %h(zErr1)</b></font></p>
935
+ @ <p class="reportError">Error: %h(zErr1)</p>
936936
}else if( zErr2 ){
937
- @ <p><font color="red"><b>Error: %h(zErr2)</b></font></p>
937
+ @ <p class="reportError">Error: %h(zErr2)</p>
938938
}
939939
style_footer();
940940
}else{
941941
sqlite3_set_authorizer(g.db, report_query_authorizer, (void*)&zErr1);
942942
sqlite3_exec(g.db, zSql, output_tab_separated, &count, &zErr2);
943943
sqlite3_set_authorizer(g.db, 0, 0);
944944
cgi_set_content_type("text/plain");
945945
}
946946
}
947947
--- src/report.c
+++ src/report.c
@@ -328,11 +328,11 @@
328 zTitle = db_text(0, "SELECT title FROM reportfmt "
329 "WHERE rn=%d", rn);
330 if( zTitle==0 ) cgi_redirect("reportlist");
331
332 style_header("Are You Sure?");
333 @ <form action="rptedit" method="POST">
334 @ <p>You are about to delete all traces of the report
335 @ <strong>%h(zTitle)</strong> from
336 @ the database. This is an irreversible operation. All records
337 @ related to this report will be removed and cannot be recovered.</p>
338 @
@@ -397,26 +397,26 @@
397 if( rn>0 ){
398 style_submenu_element("Delete", "Delete", "rptedit?rn=%d&amp;del1=1", rn);
399 }
400 style_header(rn>0 ? "Edit Report Format":"Create New Report Format");
401 if( zErr ){
402 @ <blockquote><font color="#ff0000"><b>%h(zErr)</b></font></blockquote>
403 }
404 @ <form action="rptedit" method="POST">
405 @ <input type="hidden" name="rn" value="%d(rn)">
406 @ <p>Report Title:<br />
407 @ <input type="text" name="t" value="%h(zTitle)" size="60"></p>
408 @ <p>Enter a complete SQL query statement against the "TICKET" table:<br />
409 @ <textarea name="s" rows="20" cols="80">%h(zSQL)</textarea>
410 @ </p>
411 login_insert_csrf_secret();
412 if( g.okAdmin ){
413 @ <p>Report owner:
414 @ <input type="text" name="w" size="20" value="%h(zOwner)">
415 @ </p>
416 } else {
417 @ <input type="hidden" name="w" value="%h(zOwner)">
418 }
419 @ <p>Enter an optional color key in the following box. (If blank, no
420 @ color key is displayed.) Each line contains the text for a single
421 @ entry in the key. The first token of each line is the background
422 @ color for that line.<br />
@@ -428,15 +428,15 @@
428 @ </form>
429 report_format_hints();
430 style_footer();
431 return;
432 }
433 @ <input type="submit" value="Apply Changes">
434 if( rn>0 ){
435 @ <input type="submit" value="Delete This Report" name="del1">
436 }
437 @ </form>
438 report_format_hints();
439 style_footer();
440 }
441
442 /*
@@ -478,17 +478,17 @@
478 @ <p>In this example, the first column in the result set is named
479 @ "bgcolor". The value of this column is not displayed. Instead, it
480 @ selects the background color of each row based on the TICKET.STATUS
481 @ field of the database. The color key at the right shows the various
482 @ color codes.</p>
483 @ <table align="right" style="margin: 0 5px;" border=1 cellspacing=0 width=125>
484 @ <tr bgcolor="#f2dcdc"><td align="center">new or active</td></tr>
485 @ <tr bgcolor="#e8e8bd"><td align="center">review</td></tr>
486 @ <tr bgcolor="#cfe8bd"><td align="center">fixed</td></tr>
487 @ <tr bgcolor="#bde5d6"><td align="center">tested</td></tr>
488 @ <tr bgcolor="#cacae5"><td align="center">defer</td></tr>
489 @ <tr bgcolor="#c8c8c8"><td align="center">closed</td></tr>
490 @ </table>
491 @ <blockquote><pre>
492 @ SELECT
493 @ CASE WHEN status IN ('new','active') THEN '#f2dcdc'
494 @ WHEN status='review' THEN '#e8e8bd'
@@ -510,16 +510,16 @@
510 @ FROM ticket
511 @ </pre></blockquote>
512 @ <p>To base the background color on the TICKET.PRIORITY or
513 @ TICKET.SEVERITY fields, substitute the following code for the
514 @ first column of the query:</p>
515 @ <table align="right" style="margin: 0 5px;" border=1 cellspacing=0 width=125>
516 @ <tr bgcolor="#f2dcdc"><td align="center">1</td></tr>
517 @ <tr bgcolor="#e8e8bd"><td align="center">2</td></tr>
518 @ <tr bgcolor="#cfe8bd"><td align="center">3</td></tr>
519 @ <tr bgcolor="#cacae5"><td align="center">4</td></tr>
520 @ <tr bgcolor="#c8c8c8"><td align="center">5</td></tr>
521 @ </table>
522 @ <blockquote><pre>
523 @ SELECT
524 @ CASE priority WHEN 1 THEN '#f2dcdc'
525 @ WHEN 2 THEN '#e8e8bd'
@@ -930,17 +930,17 @@
930 sqlite3_set_authorizer(g.db, report_query_authorizer, (void*)&zErr1);
931 sqlite3_exec(g.db, zSql, generate_html, &sState, &zErr2);
932 sqlite3_set_authorizer(g.db, 0, 0);
933 @ </table>
934 if( zErr1 ){
935 @ <p><font color="red"><b>Error: %h(zErr1)</b></font></p>
936 }else if( zErr2 ){
937 @ <p><font color="red"><b>Error: %h(zErr2)</b></font></p>
938 }
939 style_footer();
940 }else{
941 sqlite3_set_authorizer(g.db, report_query_authorizer, (void*)&zErr1);
942 sqlite3_exec(g.db, zSql, output_tab_separated, &count, &zErr2);
943 sqlite3_set_authorizer(g.db, 0, 0);
944 cgi_set_content_type("text/plain");
945 }
946 }
947
--- src/report.c
+++ src/report.c
@@ -328,11 +328,11 @@
328 zTitle = db_text(0, "SELECT title FROM reportfmt "
329 "WHERE rn=%d", rn);
330 if( zTitle==0 ) cgi_redirect("reportlist");
331
332 style_header("Are You Sure?");
333 @ <form action="rptedit" method="post">
334 @ <p>You are about to delete all traces of the report
335 @ <strong>%h(zTitle)</strong> from
336 @ the database. This is an irreversible operation. All records
337 @ related to this report will be removed and cannot be recovered.</p>
338 @
@@ -397,26 +397,26 @@
397 if( rn>0 ){
398 style_submenu_element("Delete", "Delete", "rptedit?rn=%d&amp;del1=1", rn);
399 }
400 style_header(rn>0 ? "Edit Report Format":"Create New Report Format");
401 if( zErr ){
402 @ <blockquote class="reportError">%h(zErr)</blockquote>
403 }
404 @ <form action="rptedit" method="post"><div>
405 @ <input type="hidden" name="rn" value="%d(rn)" />
406 @ <p>Report Title:<br />
407 @ <input type="text" name="t" value="%h(zTitle)" size="60" /></p>
408 @ <p>Enter a complete SQL query statement against the "TICKET" table:<br />
409 @ <textarea name="s" rows="20" cols="80">%h(zSQL)</textarea>
410 @ </p>
411 login_insert_csrf_secret();
412 if( g.okAdmin ){
413 @ <p>Report owner:
414 @ <input type="text" name="w" size="20" value="%h(zOwner)" />
415 @ </p>
416 } else {
417 @ <input type="hidden" name="w" value="%h(zOwner)" />
418 }
419 @ <p>Enter an optional color key in the following box. (If blank, no
420 @ color key is displayed.) Each line contains the text for a single
421 @ entry in the key. The first token of each line is the background
422 @ color for that line.<br />
@@ -428,15 +428,15 @@
428 @ </form>
429 report_format_hints();
430 style_footer();
431 return;
432 }
433 @ <input type="submit" value="Apply Changes" />
434 if( rn>0 ){
435 @ <input type="submit" value="Delete This Report" name="del1" />
436 }
437 @ </div></form>
438 report_format_hints();
439 style_footer();
440 }
441
442 /*
@@ -478,17 +478,17 @@
478 @ <p>In this example, the first column in the result set is named
479 @ "bgcolor". The value of this column is not displayed. Instead, it
480 @ selects the background color of each row based on the TICKET.STATUS
481 @ field of the database. The color key at the right shows the various
482 @ color codes.</p>
483 @ <table class="rpteditex">
484 @ <tr style="background-color:#f2dcdc;"><td class="rpteditex">new or active</td></tr>
485 @ <tr style="background-color:#e8e8bd;"><td class="rpteditex">review</td></tr>
486 @ <tr style="background-color:#cfe8bd;"><td class="rpteditex">fixed</td></tr>
487 @ <tr style="background-color:#bde5d6;"><td class="rpteditex">tested</td></tr>
488 @ <tr style="background-color:#cacae5;"><td class="rpteditex">defer</td></tr>
489 @ <tr style="background-color:#c8c8c8;"><td class="rpteditex">closed</td></tr>
490 @ </table>
491 @ <blockquote><pre>
492 @ SELECT
493 @ CASE WHEN status IN ('new','active') THEN '#f2dcdc'
494 @ WHEN status='review' THEN '#e8e8bd'
@@ -510,16 +510,16 @@
510 @ FROM ticket
511 @ </pre></blockquote>
512 @ <p>To base the background color on the TICKET.PRIORITY or
513 @ TICKET.SEVERITY fields, substitute the following code for the
514 @ first column of the query:</p>
515 @ <table class="rpteditex">
516 @ <tr style="background-color:#f2dcdc;"><td class="rpteditex">1</td></tr>
517 @ <tr style="background-color:#e8e8bd;"><td class="rpteditex">2</td></tr>
518 @ <tr style="background-color:#cfe8bd;"><td class="rpteditex">3</td></tr>
519 @ <tr style="background-color:#cacae5;"><td class="rpteditex">4</td></tr>
520 @ <tr style="background-color:#c8c8c8;"><td class="rpteditex">5</td></tr>
521 @ </table>
522 @ <blockquote><pre>
523 @ SELECT
524 @ CASE priority WHEN 1 THEN '#f2dcdc'
525 @ WHEN 2 THEN '#e8e8bd'
@@ -930,17 +930,17 @@
930 sqlite3_set_authorizer(g.db, report_query_authorizer, (void*)&zErr1);
931 sqlite3_exec(g.db, zSql, generate_html, &sState, &zErr2);
932 sqlite3_set_authorizer(g.db, 0, 0);
933 @ </table>
934 if( zErr1 ){
935 @ <p class="reportError">Error: %h(zErr1)</p>
936 }else if( zErr2 ){
937 @ <p class="reportError">Error: %h(zErr2)</p>
938 }
939 style_footer();
940 }else{
941 sqlite3_set_authorizer(g.db, report_query_authorizer, (void*)&zErr1);
942 sqlite3_exec(g.db, zSql, output_tab_separated, &count, &zErr2);
943 sqlite3_set_authorizer(g.db, 0, 0);
944 cgi_set_content_type("text/plain");
945 }
946 }
947
+6 -6
--- src/setup.c
+++ src/setup.c
@@ -507,14 +507,14 @@
507507
@ </div></form>
508508
@ </div>
509509
@ <h2>Privileges And Capabilities:</h2>
510510
@ <ul>
511511
if( higherUser ){
512
- @ <li><p><font color="blue"><b>
512
+ @ <li><p class=missingPriv">
513513
@ User %h(zLogin) has Setup privileges and you only have Admin privileges
514514
@ so you are not permitted to make changes to %h(zLogin).
515
- @ </b></font></p></li>
515
+ @ </p></li>
516516
@
517517
}
518518
@ <li><p>
519519
@ The <span class="capability">Setup</span> user can make arbitrary
520520
@ configuration changes. An <span class="usertype">Admin</span> user
@@ -881,25 +881,25 @@
881881
pSet->var!=0 ? pSet->var : pSet->name,
882882
pSet->def[0]=='1');
883883
@ <br />
884884
}
885885
}
886
- @ </td><td width="30"></td><td valign="top">
886
+ @ </td><td style="width: 30;"></td><td valign="top">
887887
for(pSet=ctrlSettings; pSet->name!=0; pSet++){
888888
if( pSet->width!=0 ){
889889
entry_attribute(pSet->name, /*pSet->width*/ 40, pSet->name,
890890
pSet->var!=0 ? pSet->var : pSet->name,
891891
(char*)pSet->def);
892892
@ <br />
893893
}
894894
}
895
- @ </tr></table>
895
+ @ </td></tr></table>
896896
@ <p><input type="submit" name="submit" value="Apply Changes" /></p>
897897
@ </div></form>
898898
@ <hr /><p>
899
- @ These settings work in the same way, as the <kbd>set</kbd> commandline:<br>
900
- @ <pre>%s(zHelp_setting_cmd)</pre></p>
899
+ @ These settings work in the same way, as the <kbd>set</kbd> commandline:<br />
900
+ @ </p><pre>%s(zHelp_setting_cmd)</pre>
901901
db_end_transaction(0);
902902
style_footer();
903903
}
904904
905905
/*
906906
--- src/setup.c
+++ src/setup.c
@@ -507,14 +507,14 @@
507 @ </div></form>
508 @ </div>
509 @ <h2>Privileges And Capabilities:</h2>
510 @ <ul>
511 if( higherUser ){
512 @ <li><p><font color="blue"><b>
513 @ User %h(zLogin) has Setup privileges and you only have Admin privileges
514 @ so you are not permitted to make changes to %h(zLogin).
515 @ </b></font></p></li>
516 @
517 }
518 @ <li><p>
519 @ The <span class="capability">Setup</span> user can make arbitrary
520 @ configuration changes. An <span class="usertype">Admin</span> user
@@ -881,25 +881,25 @@
881 pSet->var!=0 ? pSet->var : pSet->name,
882 pSet->def[0]=='1');
883 @ <br />
884 }
885 }
886 @ </td><td width="30"></td><td valign="top">
887 for(pSet=ctrlSettings; pSet->name!=0; pSet++){
888 if( pSet->width!=0 ){
889 entry_attribute(pSet->name, /*pSet->width*/ 40, pSet->name,
890 pSet->var!=0 ? pSet->var : pSet->name,
891 (char*)pSet->def);
892 @ <br />
893 }
894 }
895 @ </tr></table>
896 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
897 @ </div></form>
898 @ <hr /><p>
899 @ These settings work in the same way, as the <kbd>set</kbd> commandline:<br>
900 @ <pre>%s(zHelp_setting_cmd)</pre></p>
901 db_end_transaction(0);
902 style_footer();
903 }
904
905 /*
906
--- src/setup.c
+++ src/setup.c
@@ -507,14 +507,14 @@
507 @ </div></form>
508 @ </div>
509 @ <h2>Privileges And Capabilities:</h2>
510 @ <ul>
511 if( higherUser ){
512 @ <li><p class=missingPriv">
513 @ User %h(zLogin) has Setup privileges and you only have Admin privileges
514 @ so you are not permitted to make changes to %h(zLogin).
515 @ </p></li>
516 @
517 }
518 @ <li><p>
519 @ The <span class="capability">Setup</span> user can make arbitrary
520 @ configuration changes. An <span class="usertype">Admin</span> user
@@ -881,25 +881,25 @@
881 pSet->var!=0 ? pSet->var : pSet->name,
882 pSet->def[0]=='1');
883 @ <br />
884 }
885 }
886 @ </td><td style="width: 30;"></td><td valign="top">
887 for(pSet=ctrlSettings; pSet->name!=0; pSet++){
888 if( pSet->width!=0 ){
889 entry_attribute(pSet->name, /*pSet->width*/ 40, pSet->name,
890 pSet->var!=0 ? pSet->var : pSet->name,
891 (char*)pSet->def);
892 @ <br />
893 }
894 }
895 @ </td></tr></table>
896 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
897 @ </div></form>
898 @ <hr /><p>
899 @ These settings work in the same way, as the <kbd>set</kbd> commandline:<br />
900 @ </p><pre>%s(zHelp_setting_cmd)</pre>
901 db_end_transaction(0);
902 style_footer();
903 }
904
905 /*
906
+6 -6
--- src/shun.c
+++ src/shun.c
@@ -69,29 +69,29 @@
6969
style_header("Shunned Artifacts");
7070
if( zUuid && P("sub") ){
7171
login_verify_csrf_secret();
7272
db_multi_exec("DELETE FROM shun WHERE uuid='%s'", zUuid);
7373
if( db_exists("SELECT 1 FROM blob WHERE uuid='%s'", zUuid) ){
74
- @ <p><font color="blue">Artifact
74
+ @ <p class="noMoreShun">Artifact
7575
@ <a href="%s(g.zBaseURL)/artifact/%s(zUuid)">%s(zUuid)</a> is no
76
- @ longer being shunned.</font></p>
76
+ @ longer being shunned.</p>
7777
}else{
78
- @ <p><font color="blue">Artifact %s(zUuid)</a> will no longer
78
+ @ <p class="noMoreShun">Artifact %s(zUuid) will no longer
7979
@ be shunned. But it does not exist in the repository. It
8080
@ may be necessary to rebuild the repository using the
8181
@ <b>fossil rebuild</b> command-line before the artifact content
82
- @ can pulled in from other respositories.</font></p>
82
+ @ can pulled in from other respositories.</p>
8383
}
8484
}
8585
if( zUuid && P("add") ){
8686
login_verify_csrf_secret();
8787
db_multi_exec("INSERT OR IGNORE INTO shun VALUES('%s')", zUuid);
88
- @ <p><font color="blue">Artifact
88
+ @ <p class="shunned">Artifact
8989
@ <a href="%s(g.zBaseURL)/artifact/%s(zUuid)">%s(zUuid)</a> has been
9090
@ shunned. It will no longer be pushed.
9191
@ It will be removed from the repository the next time the respository
92
- @ is rebuilt using the <b>fossil rebuild</b> command-line</font></p>
92
+ @ is rebuilt using the <b>fossil rebuild</b> command-line</p>
9393
}
9494
@ <p>A shunned artifact will not be pushed nor accepted in a pull and the
9595
@ artifact content will be purged from the repository the next time the
9696
@ repository is rebuilt. A list of shunned artifacts can be seen at the
9797
@ bottom of this page.</p>
9898
--- src/shun.c
+++ src/shun.c
@@ -69,29 +69,29 @@
69 style_header("Shunned Artifacts");
70 if( zUuid && P("sub") ){
71 login_verify_csrf_secret();
72 db_multi_exec("DELETE FROM shun WHERE uuid='%s'", zUuid);
73 if( db_exists("SELECT 1 FROM blob WHERE uuid='%s'", zUuid) ){
74 @ <p><font color="blue">Artifact
75 @ <a href="%s(g.zBaseURL)/artifact/%s(zUuid)">%s(zUuid)</a> is no
76 @ longer being shunned.</font></p>
77 }else{
78 @ <p><font color="blue">Artifact %s(zUuid)</a> will no longer
79 @ be shunned. But it does not exist in the repository. It
80 @ may be necessary to rebuild the repository using the
81 @ <b>fossil rebuild</b> command-line before the artifact content
82 @ can pulled in from other respositories.</font></p>
83 }
84 }
85 if( zUuid && P("add") ){
86 login_verify_csrf_secret();
87 db_multi_exec("INSERT OR IGNORE INTO shun VALUES('%s')", zUuid);
88 @ <p><font color="blue">Artifact
89 @ <a href="%s(g.zBaseURL)/artifact/%s(zUuid)">%s(zUuid)</a> has been
90 @ shunned. It will no longer be pushed.
91 @ It will be removed from the repository the next time the respository
92 @ is rebuilt using the <b>fossil rebuild</b> command-line</font></p>
93 }
94 @ <p>A shunned artifact will not be pushed nor accepted in a pull and the
95 @ artifact content will be purged from the repository the next time the
96 @ repository is rebuilt. A list of shunned artifacts can be seen at the
97 @ bottom of this page.</p>
98
--- src/shun.c
+++ src/shun.c
@@ -69,29 +69,29 @@
69 style_header("Shunned Artifacts");
70 if( zUuid && P("sub") ){
71 login_verify_csrf_secret();
72 db_multi_exec("DELETE FROM shun WHERE uuid='%s'", zUuid);
73 if( db_exists("SELECT 1 FROM blob WHERE uuid='%s'", zUuid) ){
74 @ <p class="noMoreShun">Artifact
75 @ <a href="%s(g.zBaseURL)/artifact/%s(zUuid)">%s(zUuid)</a> is no
76 @ longer being shunned.</p>
77 }else{
78 @ <p class="noMoreShun">Artifact %s(zUuid) will no longer
79 @ be shunned. But it does not exist in the repository. It
80 @ may be necessary to rebuild the repository using the
81 @ <b>fossil rebuild</b> command-line before the artifact content
82 @ can pulled in from other respositories.</p>
83 }
84 }
85 if( zUuid && P("add") ){
86 login_verify_csrf_secret();
87 db_multi_exec("INSERT OR IGNORE INTO shun VALUES('%s')", zUuid);
88 @ <p class="shunned">Artifact
89 @ <a href="%s(g.zBaseURL)/artifact/%s(zUuid)">%s(zUuid)</a> has been
90 @ shunned. It will no longer be pushed.
91 @ It will be removed from the repository the next time the respository
92 @ is rebuilt using the <b>fossil rebuild</b> command-line</p>
93 }
94 @ <p>A shunned artifact will not be pushed nor accepted in a pull and the
95 @ artifact content will be purged from the repository the next time the
96 @ repository is rebuilt. A list of shunned artifacts can be seen at the
97 @ bottom of this page.</p>
98
+1 -1
--- src/skins.c
+++ src/skins.c
@@ -830,11 +830,11 @@
830830
const char *zN = db_column_text(&q, 0);
831831
const char *zV = db_column_text(&q, 1);
832832
if( strcmp(zV, zCurrent)==0 ){
833833
@ <li><p>%h(zN).&nbsp;&nbsp; <b>Currently In Use</b></p>
834834
}else{
835
- @ <li><form action="%s(g.zBaseURL)/setup_skin" method="POST">
835
+ @ <li><form action="%s(g.zBaseURL)/setup_skin" method="post">
836836
@ %h(zN).&nbsp;&nbsp;
837837
@ <input type="hidden" name="sn" value="%h(zN)">
838838
@ <input type="submit" name="load" value="Use This Skin">
839839
@ <input type="submit" name="del1" value="Delete This Skin">
840840
@ </form></li>
841841
--- src/skins.c
+++ src/skins.c
@@ -830,11 +830,11 @@
830 const char *zN = db_column_text(&q, 0);
831 const char *zV = db_column_text(&q, 1);
832 if( strcmp(zV, zCurrent)==0 ){
833 @ <li><p>%h(zN).&nbsp;&nbsp; <b>Currently In Use</b></p>
834 }else{
835 @ <li><form action="%s(g.zBaseURL)/setup_skin" method="POST">
836 @ %h(zN).&nbsp;&nbsp;
837 @ <input type="hidden" name="sn" value="%h(zN)">
838 @ <input type="submit" name="load" value="Use This Skin">
839 @ <input type="submit" name="del1" value="Delete This Skin">
840 @ </form></li>
841
--- src/skins.c
+++ src/skins.c
@@ -830,11 +830,11 @@
830 const char *zN = db_column_text(&q, 0);
831 const char *zV = db_column_text(&q, 1);
832 if( strcmp(zV, zCurrent)==0 ){
833 @ <li><p>%h(zN).&nbsp;&nbsp; <b>Currently In Use</b></p>
834 }else{
835 @ <li><form action="%s(g.zBaseURL)/setup_skin" method="post">
836 @ %h(zN).&nbsp;&nbsp;
837 @ <input type="hidden" name="sn" value="%h(zN)">
838 @ <input type="submit" name="load" value="Use This Skin">
839 @ <input type="submit" name="del1" value="Delete This Skin">
840 @ </form></li>
841
+89 -9
--- src/style.c
+++ src/style.c
@@ -40,10 +40,15 @@
4040
** Remember that the header has been generated. The footer is omitted
4141
** if an error occurs before the header.
4242
*/
4343
static int headerHasBeenGenerated = 0;
4444
45
+/*
46
+** remember, if a sidebox was used
47
+*/
48
+static int sideboxUsed = 0;
49
+
4550
/*
4651
** Add a new element to the submenu
4752
*/
4853
void style_submenu_element(
4954
const char *zLabel,
@@ -106,10 +111,11 @@
106111
if( g.thTrace ) Th_Trace("END_HEADER<br />\n", -1);
107112
Th_Unstore("title"); /* Avoid collisions with ticket field names */
108113
cgi_destination(CGI_BODY);
109114
g.cgiOutput = 1;
110115
headerHasBeenGenerated = 1;
116
+ sideboxUsed = 0;
111117
}
112118
113119
/*
114120
** Draw the footer at the bottom of the page.
115121
*/
@@ -138,35 +144,38 @@
138144
@ </div>
139145
}
140146
@ <div class="content">
141147
cgi_destination(CGI_BODY);
142148
143
- /* Put the footer at the bottom of the page.
144
- ** the additional clear/both is needed to extend the content
145
- ** part to the end of an optional sidebox.
146
- */
147
- @ <div style="clear: both;"></div>
149
+ if (sideboxUsed) {
150
+ /* Put the footer at the bottom of the page.
151
+ ** the additional clear/both is needed to extend the content
152
+ ** part to the end of an optional sidebox.
153
+ */
154
+ @ <div class="endContent"></div>
155
+ }
148156
@ </div>
149157
zFooter = db_get("footer", (char*)zDefaultFooter);
150158
if( g.thTrace ) Th_Trace("BEGIN_FOOTER<br />\n", -1);
151159
Th_Render(zFooter);
152160
if( g.thTrace ) Th_Trace("END_FOOTER<br />\n", -1);
153161
154162
/* Render trace log if TH1 tracing is enabled. */
155163
if( g.thTrace ){
156
- cgi_append_content("<font color=\"red\"><hr />\n", -1);
164
+ cgi_append_content("<span class=\"thTrace\"><hr />\n", -1);
157165
cgi_append_content(blob_str(&g.thLog), blob_size(&g.thLog));
158
- cgi_append_content("</font>\n", -1);
166
+ cgi_append_content("</span>\n", -1);
159167
}
160168
}
161169
162170
/*
163171
** Begin a side-box on the right-hand side of a page. The title and
164172
** the width of the box are given as arguments. The width is usually
165173
** a percentage of total screen width.
166174
*/
167175
void style_sidebox_begin(const char *zTitle, const char *zWidth){
176
+ sideboxUsed = 1;
168177
@ <div class="sidebox" style="width:%s(zWidth)">
169178
@ <div class="sideboxTitle">%h(zTitle)</div>
170179
}
171180
172181
/* End the side-box
@@ -360,10 +369,11 @@
360369
@ white-space: nowrap;
361370
@ }
362371
@
363372
@ /* The footer at the very bottom of the page */
364373
@ div.footer {
374
+@ clear: both;
365375
@ font-size: 0.8em;
366376
@ margin-top: 12px;
367377
@ padding: 5px 10px 5px 10px;
368378
@ text-align: right;
369379
@ background-color: #558195;
@@ -521,13 +531,13 @@
521531
},
522532
{ "table.captcha",
523533
"format for the layout table, used for the captcha display",
524534
@ margin: auto;
525535
@ padding: 10px;
526
- @ border-width: 1;
536
+ @ border-width: 4px;
527537
@ border-style: double;
528
- @ bordor-color: black;
538
+ @ border-color: black;
529539
},
530540
{ "td.login_out_label",
531541
"format for the label cells in the login/out table",
532542
@ text-align: center;
533543
},
@@ -629,10 +639,14 @@
629639
@ content:"'";
630640
},
631641
{ "span.usertype:after",
632642
"trailing text for user types, mentioned on the user edit page",
633643
@ content:"'";
644
+ },
645
+ { "p.missingPriv",
646
+ "format for missing priviliges note on user setup page",
647
+ @ color: blue;
634648
},
635649
{ "span.wikiruleHead",
636650
"format for leading text in wikirules definitions",
637651
@ font-weight: bold;
638652
},
@@ -648,10 +662,76 @@
648662
},
649663
{ "span.tktError",
650664
"format for ticket error messages",
651665
@ color: red;
652666
@ font-weight: bold;
667
+ },
668
+ { "table.rpteditex",
669
+ "format for example tables on the report edit page",
670
+ @ float: right;
671
+ @ margin: 0;
672
+ @ padding: 0;
673
+ @ width: 125px;
674
+ @ text-align: center;
675
+ @ border-collapse: collapse;
676
+ @ border-spacing: 0;
677
+ },
678
+ { "td.rpteditex",
679
+ "format for example table cells on the report edit page",
680
+ @ border-width: thin;
681
+ @ border-color: #000000;
682
+ @ border-style: solid;
683
+ },
684
+ { "input.checkinUserColor",
685
+ "format for user color input on checkin edit page",
686
+ @ # no special definitions, class defined, to enable color pickers, f.e.:
687
+ @ # add the color picker found at http:jscolor.com as java script include
688
+ @ # to the header and configure the java script file with
689
+ @ # 1. use as bindClass :checkinUserColor
690
+ @ # 2. change the default hash adding behaviour to ON
691
+ @ # or change the class defition of element identified by id="clrcust"
692
+ @ # to a standard jscolor definition with java script in the footer.
693
+ },
694
+ { "div.endContent",
695
+ "format for end of content area, to be used to clear page flow(sidebox on branch,..",
696
+ @ clear: both;
697
+ },
698
+ { "p.generalError",
699
+ "format for general errors",
700
+ @ color: red;
701
+ },
702
+ { "p.tktsetupError",
703
+ "format for tktsetup errors",
704
+ @ color: red;
705
+ @ font-weight: bold;
706
+ },
707
+ { "p.thmainError",
708
+ "format for th script errors",
709
+ @ color: red;
710
+ @ font-weight: bold;
711
+ },
712
+ { "span.thTrace",
713
+ "format for th script trace messages",
714
+ @ color: red;
715
+ },
716
+ { "p:reportError",
717
+ "format for report configuration errors",
718
+ @ color: red;
719
+ @ font-weight: bold;
720
+ },
721
+ { "blockquote.reportError",
722
+ "format for report configuration errors",
723
+ @ color: red;
724
+ @ font-weight: bold;
725
+ },
726
+ { "p.noMoreShun",
727
+ "format for artifact lines, no longer shunned",
728
+ @ color: blue;
729
+ },
730
+ { "p.shunned",
731
+ "format for artifact lines beeing shunned",
732
+ @ color: blue;
653733
},
654734
{ 0,
655735
0,
656736
0
657737
}
658738
--- src/style.c
+++ src/style.c
@@ -40,10 +40,15 @@
40 ** Remember that the header has been generated. The footer is omitted
41 ** if an error occurs before the header.
42 */
43 static int headerHasBeenGenerated = 0;
44
 
 
 
 
 
45 /*
46 ** Add a new element to the submenu
47 */
48 void style_submenu_element(
49 const char *zLabel,
@@ -106,10 +111,11 @@
106 if( g.thTrace ) Th_Trace("END_HEADER<br />\n", -1);
107 Th_Unstore("title"); /* Avoid collisions with ticket field names */
108 cgi_destination(CGI_BODY);
109 g.cgiOutput = 1;
110 headerHasBeenGenerated = 1;
 
111 }
112
113 /*
114 ** Draw the footer at the bottom of the page.
115 */
@@ -138,35 +144,38 @@
138 @ </div>
139 }
140 @ <div class="content">
141 cgi_destination(CGI_BODY);
142
143 /* Put the footer at the bottom of the page.
144 ** the additional clear/both is needed to extend the content
145 ** part to the end of an optional sidebox.
146 */
147 @ <div style="clear: both;"></div>
 
 
148 @ </div>
149 zFooter = db_get("footer", (char*)zDefaultFooter);
150 if( g.thTrace ) Th_Trace("BEGIN_FOOTER<br />\n", -1);
151 Th_Render(zFooter);
152 if( g.thTrace ) Th_Trace("END_FOOTER<br />\n", -1);
153
154 /* Render trace log if TH1 tracing is enabled. */
155 if( g.thTrace ){
156 cgi_append_content("<font color=\"red\"><hr />\n", -1);
157 cgi_append_content(blob_str(&g.thLog), blob_size(&g.thLog));
158 cgi_append_content("</font>\n", -1);
159 }
160 }
161
162 /*
163 ** Begin a side-box on the right-hand side of a page. The title and
164 ** the width of the box are given as arguments. The width is usually
165 ** a percentage of total screen width.
166 */
167 void style_sidebox_begin(const char *zTitle, const char *zWidth){
 
168 @ <div class="sidebox" style="width:%s(zWidth)">
169 @ <div class="sideboxTitle">%h(zTitle)</div>
170 }
171
172 /* End the side-box
@@ -360,10 +369,11 @@
360 @ white-space: nowrap;
361 @ }
362 @
363 @ /* The footer at the very bottom of the page */
364 @ div.footer {
 
365 @ font-size: 0.8em;
366 @ margin-top: 12px;
367 @ padding: 5px 10px 5px 10px;
368 @ text-align: right;
369 @ background-color: #558195;
@@ -521,13 +531,13 @@
521 },
522 { "table.captcha",
523 "format for the layout table, used for the captcha display",
524 @ margin: auto;
525 @ padding: 10px;
526 @ border-width: 1;
527 @ border-style: double;
528 @ bordor-color: black;
529 },
530 { "td.login_out_label",
531 "format for the label cells in the login/out table",
532 @ text-align: center;
533 },
@@ -629,10 +639,14 @@
629 @ content:"'";
630 },
631 { "span.usertype:after",
632 "trailing text for user types, mentioned on the user edit page",
633 @ content:"'";
 
 
 
 
634 },
635 { "span.wikiruleHead",
636 "format for leading text in wikirules definitions",
637 @ font-weight: bold;
638 },
@@ -648,10 +662,76 @@
648 },
649 { "span.tktError",
650 "format for ticket error messages",
651 @ color: red;
652 @ font-weight: bold;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
653 },
654 { 0,
655 0,
656 0
657 }
658
--- src/style.c
+++ src/style.c
@@ -40,10 +40,15 @@
40 ** Remember that the header has been generated. The footer is omitted
41 ** if an error occurs before the header.
42 */
43 static int headerHasBeenGenerated = 0;
44
45 /*
46 ** remember, if a sidebox was used
47 */
48 static int sideboxUsed = 0;
49
50 /*
51 ** Add a new element to the submenu
52 */
53 void style_submenu_element(
54 const char *zLabel,
@@ -106,10 +111,11 @@
111 if( g.thTrace ) Th_Trace("END_HEADER<br />\n", -1);
112 Th_Unstore("title"); /* Avoid collisions with ticket field names */
113 cgi_destination(CGI_BODY);
114 g.cgiOutput = 1;
115 headerHasBeenGenerated = 1;
116 sideboxUsed = 0;
117 }
118
119 /*
120 ** Draw the footer at the bottom of the page.
121 */
@@ -138,35 +144,38 @@
144 @ </div>
145 }
146 @ <div class="content">
147 cgi_destination(CGI_BODY);
148
149 if (sideboxUsed) {
150 /* Put the footer at the bottom of the page.
151 ** the additional clear/both is needed to extend the content
152 ** part to the end of an optional sidebox.
153 */
154 @ <div class="endContent"></div>
155 }
156 @ </div>
157 zFooter = db_get("footer", (char*)zDefaultFooter);
158 if( g.thTrace ) Th_Trace("BEGIN_FOOTER<br />\n", -1);
159 Th_Render(zFooter);
160 if( g.thTrace ) Th_Trace("END_FOOTER<br />\n", -1);
161
162 /* Render trace log if TH1 tracing is enabled. */
163 if( g.thTrace ){
164 cgi_append_content("<span class=\"thTrace\"><hr />\n", -1);
165 cgi_append_content(blob_str(&g.thLog), blob_size(&g.thLog));
166 cgi_append_content("</span>\n", -1);
167 }
168 }
169
170 /*
171 ** Begin a side-box on the right-hand side of a page. The title and
172 ** the width of the box are given as arguments. The width is usually
173 ** a percentage of total screen width.
174 */
175 void style_sidebox_begin(const char *zTitle, const char *zWidth){
176 sideboxUsed = 1;
177 @ <div class="sidebox" style="width:%s(zWidth)">
178 @ <div class="sideboxTitle">%h(zTitle)</div>
179 }
180
181 /* End the side-box
@@ -360,10 +369,11 @@
369 @ white-space: nowrap;
370 @ }
371 @
372 @ /* The footer at the very bottom of the page */
373 @ div.footer {
374 @ clear: both;
375 @ font-size: 0.8em;
376 @ margin-top: 12px;
377 @ padding: 5px 10px 5px 10px;
378 @ text-align: right;
379 @ background-color: #558195;
@@ -521,13 +531,13 @@
531 },
532 { "table.captcha",
533 "format for the layout table, used for the captcha display",
534 @ margin: auto;
535 @ padding: 10px;
536 @ border-width: 4px;
537 @ border-style: double;
538 @ border-color: black;
539 },
540 { "td.login_out_label",
541 "format for the label cells in the login/out table",
542 @ text-align: center;
543 },
@@ -629,10 +639,14 @@
639 @ content:"'";
640 },
641 { "span.usertype:after",
642 "trailing text for user types, mentioned on the user edit page",
643 @ content:"'";
644 },
645 { "p.missingPriv",
646 "format for missing priviliges note on user setup page",
647 @ color: blue;
648 },
649 { "span.wikiruleHead",
650 "format for leading text in wikirules definitions",
651 @ font-weight: bold;
652 },
@@ -648,10 +662,76 @@
662 },
663 { "span.tktError",
664 "format for ticket error messages",
665 @ color: red;
666 @ font-weight: bold;
667 },
668 { "table.rpteditex",
669 "format for example tables on the report edit page",
670 @ float: right;
671 @ margin: 0;
672 @ padding: 0;
673 @ width: 125px;
674 @ text-align: center;
675 @ border-collapse: collapse;
676 @ border-spacing: 0;
677 },
678 { "td.rpteditex",
679 "format for example table cells on the report edit page",
680 @ border-width: thin;
681 @ border-color: #000000;
682 @ border-style: solid;
683 },
684 { "input.checkinUserColor",
685 "format for user color input on checkin edit page",
686 @ # no special definitions, class defined, to enable color pickers, f.e.:
687 @ # add the color picker found at http:jscolor.com as java script include
688 @ # to the header and configure the java script file with
689 @ # 1. use as bindClass :checkinUserColor
690 @ # 2. change the default hash adding behaviour to ON
691 @ # or change the class defition of element identified by id="clrcust"
692 @ # to a standard jscolor definition with java script in the footer.
693 },
694 { "div.endContent",
695 "format for end of content area, to be used to clear page flow(sidebox on branch,..",
696 @ clear: both;
697 },
698 { "p.generalError",
699 "format for general errors",
700 @ color: red;
701 },
702 { "p.tktsetupError",
703 "format for tktsetup errors",
704 @ color: red;
705 @ font-weight: bold;
706 },
707 { "p.thmainError",
708 "format for th script errors",
709 @ color: red;
710 @ font-weight: bold;
711 },
712 { "span.thTrace",
713 "format for th script trace messages",
714 @ color: red;
715 },
716 { "p:reportError",
717 "format for report configuration errors",
718 @ color: red;
719 @ font-weight: bold;
720 },
721 { "blockquote.reportError",
722 "format for report configuration errors",
723 @ color: red;
724 @ font-weight: bold;
725 },
726 { "p.noMoreShun",
727 "format for artifact lines, no longer shunned",
728 @ color: blue;
729 },
730 { "p.shunned",
731 "format for artifact lines beeing shunned",
732 @ color: blue;
733 },
734 { 0,
735 0,
736 0
737 }
738
+2 -2
--- src/th_main.c
+++ src/th_main.c
@@ -504,14 +504,14 @@
504504
}else{
505505
i++;
506506
}
507507
}
508508
if( rc==TH_ERROR ){
509
- sendText("<hr><p><font color=\"red\"><b>ERROR: ", -1, 0);
509
+ sendText("<hr><p class=\"thmainError\">ERROR: ", -1, 0);
510510
zResult = (char*)Th_GetResult(g.interp, &n);
511511
sendText((char*)zResult, n, 1);
512
- sendText("</b></font></p>", -1, 0);
512
+ sendText("</p>", -1, 0);
513513
}else{
514514
sendText(z, i, 0);
515515
}
516516
return rc;
517517
}
518518
--- src/th_main.c
+++ src/th_main.c
@@ -504,14 +504,14 @@
504 }else{
505 i++;
506 }
507 }
508 if( rc==TH_ERROR ){
509 sendText("<hr><p><font color=\"red\"><b>ERROR: ", -1, 0);
510 zResult = (char*)Th_GetResult(g.interp, &n);
511 sendText((char*)zResult, n, 1);
512 sendText("</b></font></p>", -1, 0);
513 }else{
514 sendText(z, i, 0);
515 }
516 return rc;
517 }
518
--- src/th_main.c
+++ src/th_main.c
@@ -504,14 +504,14 @@
504 }else{
505 i++;
506 }
507 }
508 if( rc==TH_ERROR ){
509 sendText("<hr><p class=\"thmainError\">ERROR: ", -1, 0);
510 zResult = (char*)Th_GetResult(g.interp, &n);
511 sendText((char*)zResult, n, 1);
512 sendText("</p>", -1, 0);
513 }else{
514 sendText(z, i, 0);
515 }
516 return rc;
517 }
518
+1 -1
--- src/tkt.c
+++ src/tkt.c
@@ -567,11 +567,11 @@
567567
@ <span class="tktError">No such ticket: \"%h(zName)\"</span>
568568
style_footer();
569569
return;
570570
}
571571
if( nRec>1 ){
572
- @ <span class="tktError"><b>%d(nRec) tickets begin with:
572
+ @ <span class="tktError">%d(nRec) tickets begin with:
573573
@ \"%h(zName)\"</span>
574574
style_footer();
575575
return;
576576
}
577577
if( g.thTrace ) Th_Trace("BEGIN_TKTEDIT<br />\n", -1);
578578
--- src/tkt.c
+++ src/tkt.c
@@ -567,11 +567,11 @@
567 @ <span class="tktError">No such ticket: \"%h(zName)\"</span>
568 style_footer();
569 return;
570 }
571 if( nRec>1 ){
572 @ <span class="tktError"><b>%d(nRec) tickets begin with:
573 @ \"%h(zName)\"</span>
574 style_footer();
575 return;
576 }
577 if( g.thTrace ) Th_Trace("BEGIN_TKTEDIT<br />\n", -1);
578
--- src/tkt.c
+++ src/tkt.c
@@ -567,11 +567,11 @@
567 @ <span class="tktError">No such ticket: \"%h(zName)\"</span>
568 style_footer();
569 return;
570 }
571 if( nRec>1 ){
572 @ <span class="tktError">%d(nRec) tickets begin with:
573 @ \"%h(zName)\"</span>
574 style_footer();
575 return;
576 }
577 if( g.thTrace ) Th_Trace("BEGIN_TKTEDIT<br />\n", -1);
578
+1 -1
--- src/tktsetup.c
+++ src/tktsetup.c
@@ -123,11 +123,11 @@
123123
z = zDfltValue;
124124
}else if( isSubmit ){
125125
char *zErr = 0;
126126
login_verify_csrf_secret();
127127
if( xText && (zErr = xText(z))!=0 ){
128
- @ <p><font color="red"><b>ERROR: %h(zErr)</b></font></p>
128
+ @ <p class="tktsetupError">ERROR: %h(zErr)</p>
129129
}else{
130130
db_set(zDbField, z, 0);
131131
if( xRebuild ) xRebuild();
132132
cgi_redirect("tktsetup");
133133
}
134134
--- src/tktsetup.c
+++ src/tktsetup.c
@@ -123,11 +123,11 @@
123 z = zDfltValue;
124 }else if( isSubmit ){
125 char *zErr = 0;
126 login_verify_csrf_secret();
127 if( xText && (zErr = xText(z))!=0 ){
128 @ <p><font color="red"><b>ERROR: %h(zErr)</b></font></p>
129 }else{
130 db_set(zDbField, z, 0);
131 if( xRebuild ) xRebuild();
132 cgi_redirect("tktsetup");
133 }
134
--- src/tktsetup.c
+++ src/tktsetup.c
@@ -123,11 +123,11 @@
123 z = zDfltValue;
124 }else if( isSubmit ){
125 char *zErr = 0;
126 login_verify_csrf_secret();
127 if( xText && (zErr = xText(z))!=0 ){
128 @ <p class="tktsetupError">ERROR: %h(zErr)</p>
129 }else{
130 db_set(zDbField, z, 0);
131 if( xRebuild ) xRebuild();
132 cgi_redirect("tktsetup");
133 }
134
+6 -6
--- src/wiki.c
+++ src/wiki.c
@@ -533,22 +533,22 @@
533533
wiki_convert(&preview, 0, 0);
534534
@ <hr>
535535
blob_reset(&preview);
536536
}
537537
zUser = PD("u", g.zLogin);
538
- @ <form method="POST" action="%s(g.zBaseURL)/wikiappend">
538
+ @ <form method="post" action="%s(g.zBaseURL)/wikiappend">
539539
login_insert_csrf_secret();
540
- @ <input type="hidden" name="name" value="%h(zPageName)">
540
+ @ <input type="hidden" name="name" value="%h(zPageName)" />
541541
@ Your Name:
542
- @ <input type="text" name="u" size="20" value="%h(zUser)"><br />
542
+ @ <input type="text" name="u" size="20" value="%h(zUser)" /><br />
543543
@ Comment to append:<br />
544544
@ <textarea name="r" class="wikiedit" cols="80"
545545
@ rows="10" wrap="virtual">%h(PD("r",""))</textarea>
546546
@ <br />
547
- @ <input type="submit" name="preview" value="Preview Your Comment">
548
- @ <input type="submit" name="submit" value="Append Your Changes">
549
- @ <input type="submit" name="cancel" value="Cancel">
547
+ @ <input type="submit" name="preview" value="Preview Your Comment" />
548
+ @ <input type="submit" name="submit" value="Append Your Changes" />
549
+ @ <input type="submit" name="cancel" value="Cancel" />
550550
@ </form>
551551
style_footer();
552552
}
553553
554554
/*
555555
556556
ADDED win/Makefile.PellesCGMake
--- src/wiki.c
+++ src/wiki.c
@@ -533,22 +533,22 @@
533 wiki_convert(&preview, 0, 0);
534 @ <hr>
535 blob_reset(&preview);
536 }
537 zUser = PD("u", g.zLogin);
538 @ <form method="POST" action="%s(g.zBaseURL)/wikiappend">
539 login_insert_csrf_secret();
540 @ <input type="hidden" name="name" value="%h(zPageName)">
541 @ Your Name:
542 @ <input type="text" name="u" size="20" value="%h(zUser)"><br />
543 @ Comment to append:<br />
544 @ <textarea name="r" class="wikiedit" cols="80"
545 @ rows="10" wrap="virtual">%h(PD("r",""))</textarea>
546 @ <br />
547 @ <input type="submit" name="preview" value="Preview Your Comment">
548 @ <input type="submit" name="submit" value="Append Your Changes">
549 @ <input type="submit" name="cancel" value="Cancel">
550 @ </form>
551 style_footer();
552 }
553
554 /*
555
556 DDED win/Makefile.PellesCGMake
--- src/wiki.c
+++ src/wiki.c
@@ -533,22 +533,22 @@
533 wiki_convert(&preview, 0, 0);
534 @ <hr>
535 blob_reset(&preview);
536 }
537 zUser = PD("u", g.zLogin);
538 @ <form method="post" action="%s(g.zBaseURL)/wikiappend">
539 login_insert_csrf_secret();
540 @ <input type="hidden" name="name" value="%h(zPageName)" />
541 @ Your Name:
542 @ <input type="text" name="u" size="20" value="%h(zUser)" /><br />
543 @ Comment to append:<br />
544 @ <textarea name="r" class="wikiedit" cols="80"
545 @ rows="10" wrap="virtual">%h(PD("r",""))</textarea>
546 @ <br />
547 @ <input type="submit" name="preview" value="Preview Your Comment" />
548 @ <input type="submit" name="submit" value="Append Your Changes" />
549 @ <input type="submit" name="cancel" value="Cancel" />
550 @ </form>
551 style_footer();
552 }
553
554 /*
555
556 DDED win/Makefile.PellesCGMake
--- a/win/Makefile.PellesCGMake
+++ b/win/Makefile.PellesCGMake
@@ -0,0 +1,81 @@
1
+# LITE3.h ../src/jim.h VERSION.h
2
+ -DSQLITE_ENABjim
3
+#
4
+# HowTo
5
+# -----
6
+#
7
+
8
+
9
+
10
+
11
+
12
+# =sqlite3DEFINES=C# LITE3.h ../src/jim.hh VERSION.h
13
+ -DSQLITE_ENABjim
14
+#
15
+# HowTo
16
+# -----
17
+#
18
+
19
+
20
+
21
+
22
+
23
+# =sqlite3DEFC
24
+SRC=add.c allrepo.c attach.c bag.c blob.c branch.c browse.c captcha.c cgi.c checkin.c checkout.c clearsign.c clone.c comformat.c configure.c content.c db.c delta.c deltacmd.c descendants.c diff.c diffcmd.c doc.c encode.c file.c finfo.c graph.c http.c http_socket.c http_ssl.c http_transport.c info.c login.c main.c manifest.c md5.c merge.c merge3.c name.c pivot.c popen.c pqueue.c printf.c rebuild.c report.c rss.c schema.c search.c setup.c sha1.c shun.c skins.c stat.c style.c sync.c tag.c th_main.c timeline.c tkt.c tktsetup.c undo.c update.c url.c user.c verify.c vfile.c wiki.c wikiformat.c winhttp.c xfer.c zip.c
25
+ORIGSRC=$(foreach sf,$(m.h VERSION.h
26
+ -DSQLITE_ENABjim
27
+#
28
+# HowTo
29
+# -----
30
+#
31
+
32
+
33
+
34
+
35
+
36
+# =sqlite3DEFINES=C# LITE3# LITE3.h ../src/jim.h VERSION.h
37
+ -DSQLITE_ENABjim
38
+#
39
+# HowTo
40
+# -----
41
+#
42
+
43
+
44
+
45
+
46
+
47
+# =sqlite3DEFINES=C# LITE3.h ../src/jim.hh VERSION.h
48
+ -DSQLITE_ENABjim
49
+#
50
+# HowTo
51
+# -----
52
+#
53
+
54
+
55
+
56
+
57
+
58
+# =sqlite3DEF$(UTILS)
59
+#
60
+
61
+
62
+
63
+
64
+
65
+# =sqlite3DEFINES=C# LITE3.h ../src/jim.hh VERSION.h
66
+ -DSQLITE_EN# LITE3.h ../src/jim.h VERSION.h
67
+ -DSQLITE_ENABjim
68
+#
69
+# HowTo
70
+# -----
71
+#
72
+
73
+
74
+
75
+
76
+
77
+# LITE3.h ../src/jim versionh@12T,1E@15T,1d@1F8,3L@1IY,5g@1No,1E@1Vc,2t@1YS,3Z@1bl,1q68LG;
78
+
79
+
80
+
81
+# =sqlite3DEFINES=C# LITE3E:/fossil-w32LITE3.h ..
--- a/win/Makefile.PellesCGMake
+++ b/win/Makefile.PellesCGMake
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/win/Makefile.PellesCGMake
+++ b/win/Makefile.PellesCGMake
@@ -0,0 +1,81 @@
1 # LITE3.h ../src/jim.h VERSION.h
2 -DSQLITE_ENABjim
3 #
4 # HowTo
5 # -----
6 #
7
8
9
10
11
12 # =sqlite3DEFINES=C# LITE3.h ../src/jim.hh VERSION.h
13 -DSQLITE_ENABjim
14 #
15 # HowTo
16 # -----
17 #
18
19
20
21
22
23 # =sqlite3DEFC
24 SRC=add.c allrepo.c attach.c bag.c blob.c branch.c browse.c captcha.c cgi.c checkin.c checkout.c clearsign.c clone.c comformat.c configure.c content.c db.c delta.c deltacmd.c descendants.c diff.c diffcmd.c doc.c encode.c file.c finfo.c graph.c http.c http_socket.c http_ssl.c http_transport.c info.c login.c main.c manifest.c md5.c merge.c merge3.c name.c pivot.c popen.c pqueue.c printf.c rebuild.c report.c rss.c schema.c search.c setup.c sha1.c shun.c skins.c stat.c style.c sync.c tag.c th_main.c timeline.c tkt.c tktsetup.c undo.c update.c url.c user.c verify.c vfile.c wiki.c wikiformat.c winhttp.c xfer.c zip.c
25 ORIGSRC=$(foreach sf,$(m.h VERSION.h
26 -DSQLITE_ENABjim
27 #
28 # HowTo
29 # -----
30 #
31
32
33
34
35
36 # =sqlite3DEFINES=C# LITE3# LITE3.h ../src/jim.h VERSION.h
37 -DSQLITE_ENABjim
38 #
39 # HowTo
40 # -----
41 #
42
43
44
45
46
47 # =sqlite3DEFINES=C# LITE3.h ../src/jim.hh VERSION.h
48 -DSQLITE_ENABjim
49 #
50 # HowTo
51 # -----
52 #
53
54
55
56
57
58 # =sqlite3DEF$(UTILS)
59 #
60
61
62
63
64
65 # =sqlite3DEFINES=C# LITE3.h ../src/jim.hh VERSION.h
66 -DSQLITE_EN# LITE3.h ../src/jim.h VERSION.h
67 -DSQLITE_ENABjim
68 #
69 # HowTo
70 # -----
71 #
72
73
74
75
76
77 # LITE3.h ../src/jim versionh@12T,1E@15T,1d@1F8,3L@1IY,5g@1No,1E@1Vc,2t@1YS,3Z@1bl,1q68LG;
78
79
80
81 # =sqlite3DEFINES=C# LITE3E:/fossil-w32LITE3.h ..

Keyboard Shortcuts

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