Fossil SCM

merge trunk

jan.nijtmans 2013-02-07 09:39 improve_commit_warning merge
Commit 8994f3680a47bcf60644cbece53501738d7b1973
+2 -1
--- auto.def
+++ auto.def
@@ -193,11 +193,11 @@
193193
if {$found} {
194194
define FOSSIL_ENABLE_SSL
195195
define-append EXTRA_CFLAGS $cflags
196196
define-append EXTRA_LDFLAGS $ldflags
197197
define-append LIBS -lssl -lcrypto
198
- msg-result "HTTP support enabled"
198
+ msg-result "HTTPS support enabled"
199199
200200
# Silence OpenSSL deprecation warnings on Mac OS X 10.7.
201201
if {[string match *-darwin* [get-define host]]} {
202202
if {[cctest -cflags {-Wdeprecated-declarations}]} {
203203
define-append EXTRA_CFLAGS -Wdeprecated-declarations
@@ -233,8 +233,9 @@
233233
# Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars
234234
if {![cc-check-functions getpassphrase]} {
235235
# Haiku needs this
236236
cc-check-function-in-lib getpass bsd
237237
}
238
+cc-check-function-in-lib dlopen dl
238239
239240
make-template Makefile.in
240241
make-config-header autoconfig.h -auto {USE_* FOSSIL_*}
241242
--- auto.def
+++ auto.def
@@ -193,11 +193,11 @@
193 if {$found} {
194 define FOSSIL_ENABLE_SSL
195 define-append EXTRA_CFLAGS $cflags
196 define-append EXTRA_LDFLAGS $ldflags
197 define-append LIBS -lssl -lcrypto
198 msg-result "HTTP support enabled"
199
200 # Silence OpenSSL deprecation warnings on Mac OS X 10.7.
201 if {[string match *-darwin* [get-define host]]} {
202 if {[cctest -cflags {-Wdeprecated-declarations}]} {
203 define-append EXTRA_CFLAGS -Wdeprecated-declarations
@@ -233,8 +233,9 @@
233 # Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars
234 if {![cc-check-functions getpassphrase]} {
235 # Haiku needs this
236 cc-check-function-in-lib getpass bsd
237 }
 
238
239 make-template Makefile.in
240 make-config-header autoconfig.h -auto {USE_* FOSSIL_*}
241
--- auto.def
+++ auto.def
@@ -193,11 +193,11 @@
193 if {$found} {
194 define FOSSIL_ENABLE_SSL
195 define-append EXTRA_CFLAGS $cflags
196 define-append EXTRA_LDFLAGS $ldflags
197 define-append LIBS -lssl -lcrypto
198 msg-result "HTTPS support enabled"
199
200 # Silence OpenSSL deprecation warnings on Mac OS X 10.7.
201 if {[string match *-darwin* [get-define host]]} {
202 if {[cctest -cflags {-Wdeprecated-declarations}]} {
203 define-append EXTRA_CFLAGS -Wdeprecated-declarations
@@ -233,8 +233,9 @@
233 # Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars
234 if {![cc-check-functions getpassphrase]} {
235 # Haiku needs this
236 cc-check-function-in-lib getpass bsd
237 }
238 cc-check-function-in-lib dlopen dl
239
240 make-template Makefile.in
241 make-config-header autoconfig.h -auto {USE_* FOSSIL_*}
242
--- compat/zlib/configure
+++ compat/zlib/configure
@@ -814,5 +814,6 @@
814814
/^mandir *=/s#=.*#=$mandir#
815815
/^LDFLAGS *=/s#=.*#=$LDFLAGS#
816816
" | sed -e "
817817
s/\@VERSION\@/$VER/g;
818818
" > zlib.pc
819
+#
819820
--- compat/zlib/configure
+++ compat/zlib/configure
@@ -814,5 +814,6 @@
814 /^mandir *=/s#=.*#=$mandir#
815 /^LDFLAGS *=/s#=.*#=$LDFLAGS#
816 " | sed -e "
817 s/\@VERSION\@/$VER/g;
818 " > zlib.pc
 
819
--- compat/zlib/configure
+++ compat/zlib/configure
@@ -814,5 +814,6 @@
814 /^mandir *=/s#=.*#=$mandir#
815 /^LDFLAGS *=/s#=.*#=$LDFLAGS#
816 " | sed -e "
817 s/\@VERSION\@/$VER/g;
818 " > zlib.pc
819 #
820
--- compat/zlib/configure
+++ compat/zlib/configure
@@ -814,5 +814,6 @@
814814
/^mandir *=/s#=.*#=$mandir#
815815
/^LDFLAGS *=/s#=.*#=$LDFLAGS#
816816
" | sed -e "
817817
s/\@VERSION\@/$VER/g;
818818
" > zlib.pc
819
+#
819820
--- compat/zlib/configure
+++ compat/zlib/configure
@@ -814,5 +814,6 @@
814 /^mandir *=/s#=.*#=$mandir#
815 /^LDFLAGS *=/s#=.*#=$LDFLAGS#
816 " | sed -e "
817 s/\@VERSION\@/$VER/g;
818 " > zlib.pc
 
819
--- compat/zlib/configure
+++ compat/zlib/configure
@@ -814,5 +814,6 @@
814 /^mandir *=/s#=.*#=$mandir#
815 /^LDFLAGS *=/s#=.*#=$LDFLAGS#
816 " | sed -e "
817 s/\@VERSION\@/$VER/g;
818 " > zlib.pc
819 #
820
--- src/allrepo.c
+++ src/allrepo.c
@@ -144,10 +144,11 @@
144144
collect_argument(&extra, "compress");
145145
collect_argument(&extra, "noverify");
146146
collect_argument_value(&extra, "pagesize");
147147
collect_argument(&extra, "vacuum");
148148
collect_argument(&extra, "deanalyze");
149
+ collect_argument(&extra, "analyze");
149150
collect_argument(&extra, "wal");
150151
collect_argument(&extra, "stat");
151152
}else if( strncmp(zCmd, "sync", n)==0 ){
152153
zCmd = "sync -autourl -R";
153154
collect_argument(&extra, "verbose");
154155
--- src/allrepo.c
+++ src/allrepo.c
@@ -144,10 +144,11 @@
144 collect_argument(&extra, "compress");
145 collect_argument(&extra, "noverify");
146 collect_argument_value(&extra, "pagesize");
147 collect_argument(&extra, "vacuum");
148 collect_argument(&extra, "deanalyze");
 
149 collect_argument(&extra, "wal");
150 collect_argument(&extra, "stat");
151 }else if( strncmp(zCmd, "sync", n)==0 ){
152 zCmd = "sync -autourl -R";
153 collect_argument(&extra, "verbose");
154
--- src/allrepo.c
+++ src/allrepo.c
@@ -144,10 +144,11 @@
144 collect_argument(&extra, "compress");
145 collect_argument(&extra, "noverify");
146 collect_argument_value(&extra, "pagesize");
147 collect_argument(&extra, "vacuum");
148 collect_argument(&extra, "deanalyze");
149 collect_argument(&extra, "analyze");
150 collect_argument(&extra, "wal");
151 collect_argument(&extra, "stat");
152 }else if( strncmp(zCmd, "sync", n)==0 ){
153 zCmd = "sync -autourl -R";
154 collect_argument(&extra, "verbose");
155
+12 -17
--- src/blob.c
+++ src/blob.c
@@ -1150,35 +1150,30 @@
11501150
** done. If useMbcs is false and there is no BOM, the input string is assumed
11511151
** to be UTF-8 already, so no conversion is done.
11521152
*/
11531153
void blob_to_utf8_no_bom(Blob *pBlob, int useMbcs){
11541154
char *zUtf8;
1155
- int bomSize = 0;
1156
- if( starts_with_utf8_bom(pBlob, &bomSize) ){
1155
+ int bomSize = starts_with_bom(pBlob);
1156
+ if( bomSize == 3 ){
11571157
struct Blob temp;
11581158
zUtf8 = blob_str(pBlob) + bomSize;
11591159
blob_zero(&temp);
11601160
blob_append(&temp, zUtf8, -1);
11611161
blob_swap(pBlob, &temp);
11621162
blob_reset(&temp);
11631163
#ifdef _WIN32
1164
- }else if( starts_with_utf16le_bom(pBlob, &bomSize) ){
1165
- /* Make sure the blob contains two terminating 0-bytes */
1166
- blob_append(pBlob, "", 1);
1167
- zUtf8 = blob_str(pBlob) + bomSize;
1168
- zUtf8 = fossil_unicode_to_utf8(zUtf8);
1169
- blob_zero(pBlob);
1170
- blob_append(pBlob, zUtf8, -1);
1171
- fossil_unicode_free(zUtf8);
1172
- }else if( starts_with_utf16be_bom(pBlob, &bomSize) ){
1173
- unsigned int i = blob_size(pBlob);
1164
+ }else if( bomSize == 2 ){
11741165
zUtf8 = blob_buffer(pBlob);
1175
- while( i > 0 ){
1176
- /* swap bytes of unicode representation */
1177
- char zTemp = zUtf8[--i];
1178
- zUtf8[i] = zUtf8[i-1];
1179
- zUtf8[--i] = zTemp;
1166
+ if (*((unsigned short *)zUtf8) == 0xfffe) {
1167
+ /* Found BOM, but with reversed bytes */
1168
+ unsigned int i = blob_size(pBlob);
1169
+ while( i > 0 ){
1170
+ /* swap bytes of unicode representation */
1171
+ char zTemp = zUtf8[--i];
1172
+ zUtf8[i] = zUtf8[i-1];
1173
+ zUtf8[--i] = zTemp;
1174
+ }
11801175
}
11811176
/* Make sure the blob contains two terminating 0-bytes */
11821177
blob_append(pBlob, "", 1);
11831178
zUtf8 = blob_str(pBlob) + bomSize;
11841179
zUtf8 = fossil_unicode_to_utf8(zUtf8);
11851180
--- src/blob.c
+++ src/blob.c
@@ -1150,35 +1150,30 @@
1150 ** done. If useMbcs is false and there is no BOM, the input string is assumed
1151 ** to be UTF-8 already, so no conversion is done.
1152 */
1153 void blob_to_utf8_no_bom(Blob *pBlob, int useMbcs){
1154 char *zUtf8;
1155 int bomSize = 0;
1156 if( starts_with_utf8_bom(pBlob, &bomSize) ){
1157 struct Blob temp;
1158 zUtf8 = blob_str(pBlob) + bomSize;
1159 blob_zero(&temp);
1160 blob_append(&temp, zUtf8, -1);
1161 blob_swap(pBlob, &temp);
1162 blob_reset(&temp);
1163 #ifdef _WIN32
1164 }else if( starts_with_utf16le_bom(pBlob, &bomSize) ){
1165 /* Make sure the blob contains two terminating 0-bytes */
1166 blob_append(pBlob, "", 1);
1167 zUtf8 = blob_str(pBlob) + bomSize;
1168 zUtf8 = fossil_unicode_to_utf8(zUtf8);
1169 blob_zero(pBlob);
1170 blob_append(pBlob, zUtf8, -1);
1171 fossil_unicode_free(zUtf8);
1172 }else if( starts_with_utf16be_bom(pBlob, &bomSize) ){
1173 unsigned int i = blob_size(pBlob);
1174 zUtf8 = blob_buffer(pBlob);
1175 while( i > 0 ){
1176 /* swap bytes of unicode representation */
1177 char zTemp = zUtf8[--i];
1178 zUtf8[i] = zUtf8[i-1];
1179 zUtf8[--i] = zTemp;
 
 
 
 
1180 }
1181 /* Make sure the blob contains two terminating 0-bytes */
1182 blob_append(pBlob, "", 1);
1183 zUtf8 = blob_str(pBlob) + bomSize;
1184 zUtf8 = fossil_unicode_to_utf8(zUtf8);
1185
--- src/blob.c
+++ src/blob.c
@@ -1150,35 +1150,30 @@
1150 ** done. If useMbcs is false and there is no BOM, the input string is assumed
1151 ** to be UTF-8 already, so no conversion is done.
1152 */
1153 void blob_to_utf8_no_bom(Blob *pBlob, int useMbcs){
1154 char *zUtf8;
1155 int bomSize = starts_with_bom(pBlob);
1156 if( bomSize == 3 ){
1157 struct Blob temp;
1158 zUtf8 = blob_str(pBlob) + bomSize;
1159 blob_zero(&temp);
1160 blob_append(&temp, zUtf8, -1);
1161 blob_swap(pBlob, &temp);
1162 blob_reset(&temp);
1163 #ifdef _WIN32
1164 }else if( bomSize == 2 ){
 
 
 
 
 
 
 
 
 
1165 zUtf8 = blob_buffer(pBlob);
1166 if (*((unsigned short *)zUtf8) == 0xfffe) {
1167 /* Found BOM, but with reversed bytes */
1168 unsigned int i = blob_size(pBlob);
1169 while( i > 0 ){
1170 /* swap bytes of unicode representation */
1171 char zTemp = zUtf8[--i];
1172 zUtf8[i] = zUtf8[i-1];
1173 zUtf8[--i] = zTemp;
1174 }
1175 }
1176 /* Make sure the blob contains two terminating 0-bytes */
1177 blob_append(pBlob, "", 1);
1178 zUtf8 = blob_str(pBlob) + bomSize;
1179 zUtf8 = fossil_unicode_to_utf8(zUtf8);
1180
+12 -17
--- src/blob.c
+++ src/blob.c
@@ -1150,35 +1150,30 @@
11501150
** done. If useMbcs is false and there is no BOM, the input string is assumed
11511151
** to be UTF-8 already, so no conversion is done.
11521152
*/
11531153
void blob_to_utf8_no_bom(Blob *pBlob, int useMbcs){
11541154
char *zUtf8;
1155
- int bomSize = 0;
1156
- if( starts_with_utf8_bom(pBlob, &bomSize) ){
1155
+ int bomSize = starts_with_bom(pBlob);
1156
+ if( bomSize == 3 ){
11571157
struct Blob temp;
11581158
zUtf8 = blob_str(pBlob) + bomSize;
11591159
blob_zero(&temp);
11601160
blob_append(&temp, zUtf8, -1);
11611161
blob_swap(pBlob, &temp);
11621162
blob_reset(&temp);
11631163
#ifdef _WIN32
1164
- }else if( starts_with_utf16le_bom(pBlob, &bomSize) ){
1165
- /* Make sure the blob contains two terminating 0-bytes */
1166
- blob_append(pBlob, "", 1);
1167
- zUtf8 = blob_str(pBlob) + bomSize;
1168
- zUtf8 = fossil_unicode_to_utf8(zUtf8);
1169
- blob_zero(pBlob);
1170
- blob_append(pBlob, zUtf8, -1);
1171
- fossil_unicode_free(zUtf8);
1172
- }else if( starts_with_utf16be_bom(pBlob, &bomSize) ){
1173
- unsigned int i = blob_size(pBlob);
1164
+ }else if( bomSize == 2 ){
11741165
zUtf8 = blob_buffer(pBlob);
1175
- while( i > 0 ){
1176
- /* swap bytes of unicode representation */
1177
- char zTemp = zUtf8[--i];
1178
- zUtf8[i] = zUtf8[i-1];
1179
- zUtf8[--i] = zTemp;
1166
+ if (*((unsigned short *)zUtf8) == 0xfffe) {
1167
+ /* Found BOM, but with reversed bytes */
1168
+ unsigned int i = blob_size(pBlob);
1169
+ while( i > 0 ){
1170
+ /* swap bytes of unicode representation */
1171
+ char zTemp = zUtf8[--i];
1172
+ zUtf8[i] = zUtf8[i-1];
1173
+ zUtf8[--i] = zTemp;
1174
+ }
11801175
}
11811176
/* Make sure the blob contains two terminating 0-bytes */
11821177
blob_append(pBlob, "", 1);
11831178
zUtf8 = blob_str(pBlob) + bomSize;
11841179
zUtf8 = fossil_unicode_to_utf8(zUtf8);
11851180
--- src/blob.c
+++ src/blob.c
@@ -1150,35 +1150,30 @@
1150 ** done. If useMbcs is false and there is no BOM, the input string is assumed
1151 ** to be UTF-8 already, so no conversion is done.
1152 */
1153 void blob_to_utf8_no_bom(Blob *pBlob, int useMbcs){
1154 char *zUtf8;
1155 int bomSize = 0;
1156 if( starts_with_utf8_bom(pBlob, &bomSize) ){
1157 struct Blob temp;
1158 zUtf8 = blob_str(pBlob) + bomSize;
1159 blob_zero(&temp);
1160 blob_append(&temp, zUtf8, -1);
1161 blob_swap(pBlob, &temp);
1162 blob_reset(&temp);
1163 #ifdef _WIN32
1164 }else if( starts_with_utf16le_bom(pBlob, &bomSize) ){
1165 /* Make sure the blob contains two terminating 0-bytes */
1166 blob_append(pBlob, "", 1);
1167 zUtf8 = blob_str(pBlob) + bomSize;
1168 zUtf8 = fossil_unicode_to_utf8(zUtf8);
1169 blob_zero(pBlob);
1170 blob_append(pBlob, zUtf8, -1);
1171 fossil_unicode_free(zUtf8);
1172 }else if( starts_with_utf16be_bom(pBlob, &bomSize) ){
1173 unsigned int i = blob_size(pBlob);
1174 zUtf8 = blob_buffer(pBlob);
1175 while( i > 0 ){
1176 /* swap bytes of unicode representation */
1177 char zTemp = zUtf8[--i];
1178 zUtf8[i] = zUtf8[i-1];
1179 zUtf8[--i] = zTemp;
 
 
 
 
1180 }
1181 /* Make sure the blob contains two terminating 0-bytes */
1182 blob_append(pBlob, "", 1);
1183 zUtf8 = blob_str(pBlob) + bomSize;
1184 zUtf8 = fossil_unicode_to_utf8(zUtf8);
1185
--- src/blob.c
+++ src/blob.c
@@ -1150,35 +1150,30 @@
1150 ** done. If useMbcs is false and there is no BOM, the input string is assumed
1151 ** to be UTF-8 already, so no conversion is done.
1152 */
1153 void blob_to_utf8_no_bom(Blob *pBlob, int useMbcs){
1154 char *zUtf8;
1155 int bomSize = starts_with_bom(pBlob);
1156 if( bomSize == 3 ){
1157 struct Blob temp;
1158 zUtf8 = blob_str(pBlob) + bomSize;
1159 blob_zero(&temp);
1160 blob_append(&temp, zUtf8, -1);
1161 blob_swap(pBlob, &temp);
1162 blob_reset(&temp);
1163 #ifdef _WIN32
1164 }else if( bomSize == 2 ){
 
 
 
 
 
 
 
 
 
1165 zUtf8 = blob_buffer(pBlob);
1166 if (*((unsigned short *)zUtf8) == 0xfffe) {
1167 /* Found BOM, but with reversed bytes */
1168 unsigned int i = blob_size(pBlob);
1169 while( i > 0 ){
1170 /* swap bytes of unicode representation */
1171 char zTemp = zUtf8[--i];
1172 zUtf8[i] = zUtf8[i-1];
1173 zUtf8[--i] = zTemp;
1174 }
1175 }
1176 /* Make sure the blob contains two terminating 0-bytes */
1177 blob_append(pBlob, "", 1);
1178 zUtf8 = blob_str(pBlob) + bomSize;
1179 zUtf8 = fossil_unicode_to_utf8(zUtf8);
1180
+26 -16
--- src/checkin.c
+++ src/checkin.c
@@ -895,42 +895,46 @@
895895
*/
896896
static int commit_warning(
897897
Blob *p, /* The content of the file being committed. */
898898
int crnlOk, /* Non-zero if CR/NL warnings should be disabled. */
899899
int binOk, /* Non-zero if binary warnings should be disabled. */
900
- int unicodeOk, /* Non-zero if unicode warnings should be disabled. */
900
+ int encodingOk, /* Non-zero if encoding warnings should be disabled. */
901901
const char *zFilename /* The full name of the file being committed. */
902902
){
903903
int eType; /* return value of looks_like_utf8/utf16() */
904
- int fUnicode; /* return value of starts_with_utf16_bom() */
904
+ int fUnicode; /* 1 if blob starts with UTF-16 BOM */
905905
char *zMsg; /* Warning message */
906906
Blob fname; /* Relative pathname of the file */
907907
static int allOk = 0; /* Set to true to disable this routine */
908908
909909
if( allOk ) return 0;
910
- fUnicode = starts_with_utf16_bom(p, 0);
910
+ fUnicode = (starts_with_bom(p) == 2);
911911
eType = fUnicode ? looks_like_utf16(p) : looks_like_utf8(p);
912912
if( eType<-2){
913913
const char *zWarning;
914
+ const char *zDisable;
914915
const char *zConvert;
915916
Blob ans;
916917
char cReply;
917918
918919
if(eType==-4){
919920
if (binOk) goto go_on;
920921
zWarning = "long lines";
922
+ zDisable = "\"binary-glob\" setting";
921923
zConvert = "";
922924
}else{
923
- if (unicodeOk) goto go_on;
925
+ if (encodingOk) goto go_on;
924926
zWarning = "invalid UTF-8";
927
+ zDisable = "\"encoding-glob\" setting";
925928
zConvert = "c=convert/";
926929
}
927930
blob_zero(&ans);
928931
file_relative_name(zFilename, &fname, 0);
929932
zMsg = mprintf(
930
- "%s appears to be text, but contains %s. commit anyhow (%sy/N)? ",
931
- blob_str(&fname), zWarning, zConvert);
933
+ "%s appears to be text, but contains %s. Use --no-warnings or the"
934
+ " %s to disable this warning.\nCommit anyhow (a=all/%sy/N)? ",
935
+ blob_str(&fname), zWarning, zDisable, zConvert);
932936
prompt_user(zMsg, &ans);
933937
fossil_free(zMsg);
934938
cReply = blob_str(&ans)[0];
935939
if( *zConvert && (cReply=='c' || cReply=='C') ){
936940
char *zOrig = file_newname(zFilename, "original", 1);
@@ -950,44 +954,50 @@
950954
go_on:
951955
eType +=4 ;
952956
}
953957
if( eType==0 || eType==-1 || fUnicode ){
954958
const char *zWarning;
959
+ const char *zDisable;
955960
const char *zConvert = "c=convert/";
956961
Blob ans;
957962
char cReply;
958963
959964
if( eType==-1 && fUnicode ){
960
- if ( crnlOk && unicodeOk ){
961
- return 0; /* We don't want Unicode/CR/NL warnings for this file. */
965
+ if ( crnlOk && encodingOk ){
966
+ return 0; /* We don't want CR/NL and Unicode warnings for this file. */
962967
}
963
- zWarning = "Unicode and CR/NL line endings";
968
+ zWarning = "CR/NL line endings and Unicode";
969
+ zDisable = "\"crnl-glob\" and \"encoding-glob\" settings";
964970
}else if( eType==-1 ){
965971
if( crnlOk ){
966972
return 0; /* We don't want CR/NL warnings for this file. */
967973
}
968974
zWarning = "CR/NL line endings";
975
+ zDisable = "\"crnl-glob\" setting";
969976
}else if( eType==0 ){
970977
if( binOk ){
971978
return 0; /* We don't want binary warnings for this file. */
972979
}
973980
zWarning = "binary data";
981
+ zDisable = "\"binary-glob\" setting";
974982
zConvert = ""; /* We cannot convert binary files. */
975983
}else{
976
- if ( unicodeOk ){
977
- return 0; /* We don't want unicode warnings for this file. */
984
+ if ( encodingOk ){
985
+ return 0; /* We don't want encoding warnings for this file. */
978986
}
979987
zWarning = "Unicode";
988
+ zDisable = "\"encoding-glob\" setting";
980989
#ifndef _WIN32
981990
zConvert = ""; /* On Unix, we cannot easily convert Unicode files. */
982991
#endif
983992
}
984993
file_relative_name(zFilename, &fname, 0);
985994
blob_zero(&ans);
986995
zMsg = mprintf(
987
- "%s contains %s. commit anyhow (a=all/%sy/N)? ",
988
- blob_str(&fname), zWarning, zConvert);
996
+ "%s contains %s. Use --no-warnings or the %s to disable this warning.\n"
997
+ "Commit anyhow (a=all/%sy/N)? ",
998
+ blob_str(&fname), zWarning, zDisable, zConvert);
989999
prompt_user(zMsg, &ans);
9901000
fossil_free(zMsg);
9911001
cReply = blob_str(&ans)[0];
9921002
if( cReply=='a' || cReply=='A' ){
9931003
allOk = 1;
@@ -1361,19 +1371,19 @@
13611371
);
13621372
while( db_step(&q)==SQLITE_ROW ){
13631373
int id, rid;
13641374
const char *zFullname;
13651375
Blob content;
1366
- int crnlOk, binOk, unicodeOk, chnged;
1376
+ int crnlOk, binOk, encodingOk, chnged;
13671377
13681378
id = db_column_int(&q, 0);
13691379
zFullname = db_column_text(&q, 1);
13701380
rid = db_column_int(&q, 2);
13711381
crnlOk = db_column_int(&q, 3);
13721382
chnged = db_column_int(&q, 4);
13731383
binOk = db_column_int(&q, 5);
1374
- unicodeOk = db_column_int(&q, 6);
1384
+ encodingOk = db_column_int(&q, 6);
13751385
13761386
blob_zero(&content);
13771387
if( file_wd_islink(zFullname) ){
13781388
/* Instead of file content, put link destination path */
13791389
blob_read_link(&content, zFullname);
@@ -1381,11 +1391,11 @@
13811391
blob_read_from_file(&content, zFullname);
13821392
}
13831393
/* Do not emit any warnings when they are disabled. */
13841394
if( !noWarningFlag ){
13851395
abortCommit |= commit_warning(&content, crnlOk, binOk,
1386
- unicodeOk, zFullname);
1396
+ encodingOk, zFullname);
13871397
}
13881398
if( chnged==1 && contains_merge_marker(&content) ){
13891399
Blob fname; /* Relative pathname of the file */
13901400
13911401
nConflict++;
13921402
--- src/checkin.c
+++ src/checkin.c
@@ -895,42 +895,46 @@
895 */
896 static int commit_warning(
897 Blob *p, /* The content of the file being committed. */
898 int crnlOk, /* Non-zero if CR/NL warnings should be disabled. */
899 int binOk, /* Non-zero if binary warnings should be disabled. */
900 int unicodeOk, /* Non-zero if unicode warnings should be disabled. */
901 const char *zFilename /* The full name of the file being committed. */
902 ){
903 int eType; /* return value of looks_like_utf8/utf16() */
904 int fUnicode; /* return value of starts_with_utf16_bom() */
905 char *zMsg; /* Warning message */
906 Blob fname; /* Relative pathname of the file */
907 static int allOk = 0; /* Set to true to disable this routine */
908
909 if( allOk ) return 0;
910 fUnicode = starts_with_utf16_bom(p, 0);
911 eType = fUnicode ? looks_like_utf16(p) : looks_like_utf8(p);
912 if( eType<-2){
913 const char *zWarning;
 
914 const char *zConvert;
915 Blob ans;
916 char cReply;
917
918 if(eType==-4){
919 if (binOk) goto go_on;
920 zWarning = "long lines";
 
921 zConvert = "";
922 }else{
923 if (unicodeOk) goto go_on;
924 zWarning = "invalid UTF-8";
 
925 zConvert = "c=convert/";
926 }
927 blob_zero(&ans);
928 file_relative_name(zFilename, &fname, 0);
929 zMsg = mprintf(
930 "%s appears to be text, but contains %s. commit anyhow (%sy/N)? ",
931 blob_str(&fname), zWarning, zConvert);
 
932 prompt_user(zMsg, &ans);
933 fossil_free(zMsg);
934 cReply = blob_str(&ans)[0];
935 if( *zConvert && (cReply=='c' || cReply=='C') ){
936 char *zOrig = file_newname(zFilename, "original", 1);
@@ -950,44 +954,50 @@
950 go_on:
951 eType +=4 ;
952 }
953 if( eType==0 || eType==-1 || fUnicode ){
954 const char *zWarning;
 
955 const char *zConvert = "c=convert/";
956 Blob ans;
957 char cReply;
958
959 if( eType==-1 && fUnicode ){
960 if ( crnlOk && unicodeOk ){
961 return 0; /* We don't want Unicode/CR/NL warnings for this file. */
962 }
963 zWarning = "Unicode and CR/NL line endings";
 
964 }else if( eType==-1 ){
965 if( crnlOk ){
966 return 0; /* We don't want CR/NL warnings for this file. */
967 }
968 zWarning = "CR/NL line endings";
 
969 }else if( eType==0 ){
970 if( binOk ){
971 return 0; /* We don't want binary warnings for this file. */
972 }
973 zWarning = "binary data";
 
974 zConvert = ""; /* We cannot convert binary files. */
975 }else{
976 if ( unicodeOk ){
977 return 0; /* We don't want unicode warnings for this file. */
978 }
979 zWarning = "Unicode";
 
980 #ifndef _WIN32
981 zConvert = ""; /* On Unix, we cannot easily convert Unicode files. */
982 #endif
983 }
984 file_relative_name(zFilename, &fname, 0);
985 blob_zero(&ans);
986 zMsg = mprintf(
987 "%s contains %s. commit anyhow (a=all/%sy/N)? ",
988 blob_str(&fname), zWarning, zConvert);
 
989 prompt_user(zMsg, &ans);
990 fossil_free(zMsg);
991 cReply = blob_str(&ans)[0];
992 if( cReply=='a' || cReply=='A' ){
993 allOk = 1;
@@ -1361,19 +1371,19 @@
1361 );
1362 while( db_step(&q)==SQLITE_ROW ){
1363 int id, rid;
1364 const char *zFullname;
1365 Blob content;
1366 int crnlOk, binOk, unicodeOk, chnged;
1367
1368 id = db_column_int(&q, 0);
1369 zFullname = db_column_text(&q, 1);
1370 rid = db_column_int(&q, 2);
1371 crnlOk = db_column_int(&q, 3);
1372 chnged = db_column_int(&q, 4);
1373 binOk = db_column_int(&q, 5);
1374 unicodeOk = db_column_int(&q, 6);
1375
1376 blob_zero(&content);
1377 if( file_wd_islink(zFullname) ){
1378 /* Instead of file content, put link destination path */
1379 blob_read_link(&content, zFullname);
@@ -1381,11 +1391,11 @@
1381 blob_read_from_file(&content, zFullname);
1382 }
1383 /* Do not emit any warnings when they are disabled. */
1384 if( !noWarningFlag ){
1385 abortCommit |= commit_warning(&content, crnlOk, binOk,
1386 unicodeOk, zFullname);
1387 }
1388 if( chnged==1 && contains_merge_marker(&content) ){
1389 Blob fname; /* Relative pathname of the file */
1390
1391 nConflict++;
1392
--- src/checkin.c
+++ src/checkin.c
@@ -895,42 +895,46 @@
895 */
896 static int commit_warning(
897 Blob *p, /* The content of the file being committed. */
898 int crnlOk, /* Non-zero if CR/NL warnings should be disabled. */
899 int binOk, /* Non-zero if binary warnings should be disabled. */
900 int encodingOk, /* Non-zero if encoding warnings should be disabled. */
901 const char *zFilename /* The full name of the file being committed. */
902 ){
903 int eType; /* return value of looks_like_utf8/utf16() */
904 int fUnicode; /* 1 if blob starts with UTF-16 BOM */
905 char *zMsg; /* Warning message */
906 Blob fname; /* Relative pathname of the file */
907 static int allOk = 0; /* Set to true to disable this routine */
908
909 if( allOk ) return 0;
910 fUnicode = (starts_with_bom(p) == 2);
911 eType = fUnicode ? looks_like_utf16(p) : looks_like_utf8(p);
912 if( eType<-2){
913 const char *zWarning;
914 const char *zDisable;
915 const char *zConvert;
916 Blob ans;
917 char cReply;
918
919 if(eType==-4){
920 if (binOk) goto go_on;
921 zWarning = "long lines";
922 zDisable = "\"binary-glob\" setting";
923 zConvert = "";
924 }else{
925 if (encodingOk) goto go_on;
926 zWarning = "invalid UTF-8";
927 zDisable = "\"encoding-glob\" setting";
928 zConvert = "c=convert/";
929 }
930 blob_zero(&ans);
931 file_relative_name(zFilename, &fname, 0);
932 zMsg = mprintf(
933 "%s appears to be text, but contains %s. Use --no-warnings or the"
934 " %s to disable this warning.\nCommit anyhow (a=all/%sy/N)? ",
935 blob_str(&fname), zWarning, zDisable, zConvert);
936 prompt_user(zMsg, &ans);
937 fossil_free(zMsg);
938 cReply = blob_str(&ans)[0];
939 if( *zConvert && (cReply=='c' || cReply=='C') ){
940 char *zOrig = file_newname(zFilename, "original", 1);
@@ -950,44 +954,50 @@
954 go_on:
955 eType +=4 ;
956 }
957 if( eType==0 || eType==-1 || fUnicode ){
958 const char *zWarning;
959 const char *zDisable;
960 const char *zConvert = "c=convert/";
961 Blob ans;
962 char cReply;
963
964 if( eType==-1 && fUnicode ){
965 if ( crnlOk && encodingOk ){
966 return 0; /* We don't want CR/NL and Unicode warnings for this file. */
967 }
968 zWarning = "CR/NL line endings and Unicode";
969 zDisable = "\"crnl-glob\" and \"encoding-glob\" settings";
970 }else if( eType==-1 ){
971 if( crnlOk ){
972 return 0; /* We don't want CR/NL warnings for this file. */
973 }
974 zWarning = "CR/NL line endings";
975 zDisable = "\"crnl-glob\" setting";
976 }else if( eType==0 ){
977 if( binOk ){
978 return 0; /* We don't want binary warnings for this file. */
979 }
980 zWarning = "binary data";
981 zDisable = "\"binary-glob\" setting";
982 zConvert = ""; /* We cannot convert binary files. */
983 }else{
984 if ( encodingOk ){
985 return 0; /* We don't want encoding warnings for this file. */
986 }
987 zWarning = "Unicode";
988 zDisable = "\"encoding-glob\" setting";
989 #ifndef _WIN32
990 zConvert = ""; /* On Unix, we cannot easily convert Unicode files. */
991 #endif
992 }
993 file_relative_name(zFilename, &fname, 0);
994 blob_zero(&ans);
995 zMsg = mprintf(
996 "%s contains %s. Use --no-warnings or the %s to disable this warning.\n"
997 "Commit anyhow (a=all/%sy/N)? ",
998 blob_str(&fname), zWarning, zDisable, zConvert);
999 prompt_user(zMsg, &ans);
1000 fossil_free(zMsg);
1001 cReply = blob_str(&ans)[0];
1002 if( cReply=='a' || cReply=='A' ){
1003 allOk = 1;
@@ -1361,19 +1371,19 @@
1371 );
1372 while( db_step(&q)==SQLITE_ROW ){
1373 int id, rid;
1374 const char *zFullname;
1375 Blob content;
1376 int crnlOk, binOk, encodingOk, chnged;
1377
1378 id = db_column_int(&q, 0);
1379 zFullname = db_column_text(&q, 1);
1380 rid = db_column_int(&q, 2);
1381 crnlOk = db_column_int(&q, 3);
1382 chnged = db_column_int(&q, 4);
1383 binOk = db_column_int(&q, 5);
1384 encodingOk = db_column_int(&q, 6);
1385
1386 blob_zero(&content);
1387 if( file_wd_islink(zFullname) ){
1388 /* Instead of file content, put link destination path */
1389 blob_read_link(&content, zFullname);
@@ -1381,11 +1391,11 @@
1391 blob_read_from_file(&content, zFullname);
1392 }
1393 /* Do not emit any warnings when they are disabled. */
1394 if( !noWarningFlag ){
1395 abortCommit |= commit_warning(&content, crnlOk, binOk,
1396 encodingOk, zFullname);
1397 }
1398 if( chnged==1 && contains_merge_marker(&content) ){
1399 Blob fname; /* Relative pathname of the file */
1400
1401 nConflict++;
1402
+26 -16
--- src/checkin.c
+++ src/checkin.c
@@ -895,42 +895,46 @@
895895
*/
896896
static int commit_warning(
897897
Blob *p, /* The content of the file being committed. */
898898
int crnlOk, /* Non-zero if CR/NL warnings should be disabled. */
899899
int binOk, /* Non-zero if binary warnings should be disabled. */
900
- int unicodeOk, /* Non-zero if unicode warnings should be disabled. */
900
+ int encodingOk, /* Non-zero if encoding warnings should be disabled. */
901901
const char *zFilename /* The full name of the file being committed. */
902902
){
903903
int eType; /* return value of looks_like_utf8/utf16() */
904
- int fUnicode; /* return value of starts_with_utf16_bom() */
904
+ int fUnicode; /* 1 if blob starts with UTF-16 BOM */
905905
char *zMsg; /* Warning message */
906906
Blob fname; /* Relative pathname of the file */
907907
static int allOk = 0; /* Set to true to disable this routine */
908908
909909
if( allOk ) return 0;
910
- fUnicode = starts_with_utf16_bom(p, 0);
910
+ fUnicode = (starts_with_bom(p) == 2);
911911
eType = fUnicode ? looks_like_utf16(p) : looks_like_utf8(p);
912912
if( eType<-2){
913913
const char *zWarning;
914
+ const char *zDisable;
914915
const char *zConvert;
915916
Blob ans;
916917
char cReply;
917918
918919
if(eType==-4){
919920
if (binOk) goto go_on;
920921
zWarning = "long lines";
922
+ zDisable = "\"binary-glob\" setting";
921923
zConvert = "";
922924
}else{
923
- if (unicodeOk) goto go_on;
925
+ if (encodingOk) goto go_on;
924926
zWarning = "invalid UTF-8";
927
+ zDisable = "\"encoding-glob\" setting";
925928
zConvert = "c=convert/";
926929
}
927930
blob_zero(&ans);
928931
file_relative_name(zFilename, &fname, 0);
929932
zMsg = mprintf(
930
- "%s appears to be text, but contains %s. commit anyhow (%sy/N)? ",
931
- blob_str(&fname), zWarning, zConvert);
933
+ "%s appears to be text, but contains %s. Use --no-warnings or the"
934
+ " %s to disable this warning.\nCommit anyhow (a=all/%sy/N)? ",
935
+ blob_str(&fname), zWarning, zDisable, zConvert);
932936
prompt_user(zMsg, &ans);
933937
fossil_free(zMsg);
934938
cReply = blob_str(&ans)[0];
935939
if( *zConvert && (cReply=='c' || cReply=='C') ){
936940
char *zOrig = file_newname(zFilename, "original", 1);
@@ -950,44 +954,50 @@
950954
go_on:
951955
eType +=4 ;
952956
}
953957
if( eType==0 || eType==-1 || fUnicode ){
954958
const char *zWarning;
959
+ const char *zDisable;
955960
const char *zConvert = "c=convert/";
956961
Blob ans;
957962
char cReply;
958963
959964
if( eType==-1 && fUnicode ){
960
- if ( crnlOk && unicodeOk ){
961
- return 0; /* We don't want Unicode/CR/NL warnings for this file. */
965
+ if ( crnlOk && encodingOk ){
966
+ return 0; /* We don't want CR/NL and Unicode warnings for this file. */
962967
}
963
- zWarning = "Unicode and CR/NL line endings";
968
+ zWarning = "CR/NL line endings and Unicode";
969
+ zDisable = "\"crnl-glob\" and \"encoding-glob\" settings";
964970
}else if( eType==-1 ){
965971
if( crnlOk ){
966972
return 0; /* We don't want CR/NL warnings for this file. */
967973
}
968974
zWarning = "CR/NL line endings";
975
+ zDisable = "\"crnl-glob\" setting";
969976
}else if( eType==0 ){
970977
if( binOk ){
971978
return 0; /* We don't want binary warnings for this file. */
972979
}
973980
zWarning = "binary data";
981
+ zDisable = "\"binary-glob\" setting";
974982
zConvert = ""; /* We cannot convert binary files. */
975983
}else{
976
- if ( unicodeOk ){
977
- return 0; /* We don't want unicode warnings for this file. */
984
+ if ( encodingOk ){
985
+ return 0; /* We don't want encoding warnings for this file. */
978986
}
979987
zWarning = "Unicode";
988
+ zDisable = "\"encoding-glob\" setting";
980989
#ifndef _WIN32
981990
zConvert = ""; /* On Unix, we cannot easily convert Unicode files. */
982991
#endif
983992
}
984993
file_relative_name(zFilename, &fname, 0);
985994
blob_zero(&ans);
986995
zMsg = mprintf(
987
- "%s contains %s. commit anyhow (a=all/%sy/N)? ",
988
- blob_str(&fname), zWarning, zConvert);
996
+ "%s contains %s. Use --no-warnings or the %s to disable this warning.\n"
997
+ "Commit anyhow (a=all/%sy/N)? ",
998
+ blob_str(&fname), zWarning, zDisable, zConvert);
989999
prompt_user(zMsg, &ans);
9901000
fossil_free(zMsg);
9911001
cReply = blob_str(&ans)[0];
9921002
if( cReply=='a' || cReply=='A' ){
9931003
allOk = 1;
@@ -1361,19 +1371,19 @@
13611371
);
13621372
while( db_step(&q)==SQLITE_ROW ){
13631373
int id, rid;
13641374
const char *zFullname;
13651375
Blob content;
1366
- int crnlOk, binOk, unicodeOk, chnged;
1376
+ int crnlOk, binOk, encodingOk, chnged;
13671377
13681378
id = db_column_int(&q, 0);
13691379
zFullname = db_column_text(&q, 1);
13701380
rid = db_column_int(&q, 2);
13711381
crnlOk = db_column_int(&q, 3);
13721382
chnged = db_column_int(&q, 4);
13731383
binOk = db_column_int(&q, 5);
1374
- unicodeOk = db_column_int(&q, 6);
1384
+ encodingOk = db_column_int(&q, 6);
13751385
13761386
blob_zero(&content);
13771387
if( file_wd_islink(zFullname) ){
13781388
/* Instead of file content, put link destination path */
13791389
blob_read_link(&content, zFullname);
@@ -1381,11 +1391,11 @@
13811391
blob_read_from_file(&content, zFullname);
13821392
}
13831393
/* Do not emit any warnings when they are disabled. */
13841394
if( !noWarningFlag ){
13851395
abortCommit |= commit_warning(&content, crnlOk, binOk,
1386
- unicodeOk, zFullname);
1396
+ encodingOk, zFullname);
13871397
}
13881398
if( chnged==1 && contains_merge_marker(&content) ){
13891399
Blob fname; /* Relative pathname of the file */
13901400
13911401
nConflict++;
13921402
--- src/checkin.c
+++ src/checkin.c
@@ -895,42 +895,46 @@
895 */
896 static int commit_warning(
897 Blob *p, /* The content of the file being committed. */
898 int crnlOk, /* Non-zero if CR/NL warnings should be disabled. */
899 int binOk, /* Non-zero if binary warnings should be disabled. */
900 int unicodeOk, /* Non-zero if unicode warnings should be disabled. */
901 const char *zFilename /* The full name of the file being committed. */
902 ){
903 int eType; /* return value of looks_like_utf8/utf16() */
904 int fUnicode; /* return value of starts_with_utf16_bom() */
905 char *zMsg; /* Warning message */
906 Blob fname; /* Relative pathname of the file */
907 static int allOk = 0; /* Set to true to disable this routine */
908
909 if( allOk ) return 0;
910 fUnicode = starts_with_utf16_bom(p, 0);
911 eType = fUnicode ? looks_like_utf16(p) : looks_like_utf8(p);
912 if( eType<-2){
913 const char *zWarning;
 
914 const char *zConvert;
915 Blob ans;
916 char cReply;
917
918 if(eType==-4){
919 if (binOk) goto go_on;
920 zWarning = "long lines";
 
921 zConvert = "";
922 }else{
923 if (unicodeOk) goto go_on;
924 zWarning = "invalid UTF-8";
 
925 zConvert = "c=convert/";
926 }
927 blob_zero(&ans);
928 file_relative_name(zFilename, &fname, 0);
929 zMsg = mprintf(
930 "%s appears to be text, but contains %s. commit anyhow (%sy/N)? ",
931 blob_str(&fname), zWarning, zConvert);
 
932 prompt_user(zMsg, &ans);
933 fossil_free(zMsg);
934 cReply = blob_str(&ans)[0];
935 if( *zConvert && (cReply=='c' || cReply=='C') ){
936 char *zOrig = file_newname(zFilename, "original", 1);
@@ -950,44 +954,50 @@
950 go_on:
951 eType +=4 ;
952 }
953 if( eType==0 || eType==-1 || fUnicode ){
954 const char *zWarning;
 
955 const char *zConvert = "c=convert/";
956 Blob ans;
957 char cReply;
958
959 if( eType==-1 && fUnicode ){
960 if ( crnlOk && unicodeOk ){
961 return 0; /* We don't want Unicode/CR/NL warnings for this file. */
962 }
963 zWarning = "Unicode and CR/NL line endings";
 
964 }else if( eType==-1 ){
965 if( crnlOk ){
966 return 0; /* We don't want CR/NL warnings for this file. */
967 }
968 zWarning = "CR/NL line endings";
 
969 }else if( eType==0 ){
970 if( binOk ){
971 return 0; /* We don't want binary warnings for this file. */
972 }
973 zWarning = "binary data";
 
974 zConvert = ""; /* We cannot convert binary files. */
975 }else{
976 if ( unicodeOk ){
977 return 0; /* We don't want unicode warnings for this file. */
978 }
979 zWarning = "Unicode";
 
980 #ifndef _WIN32
981 zConvert = ""; /* On Unix, we cannot easily convert Unicode files. */
982 #endif
983 }
984 file_relative_name(zFilename, &fname, 0);
985 blob_zero(&ans);
986 zMsg = mprintf(
987 "%s contains %s. commit anyhow (a=all/%sy/N)? ",
988 blob_str(&fname), zWarning, zConvert);
 
989 prompt_user(zMsg, &ans);
990 fossil_free(zMsg);
991 cReply = blob_str(&ans)[0];
992 if( cReply=='a' || cReply=='A' ){
993 allOk = 1;
@@ -1361,19 +1371,19 @@
1361 );
1362 while( db_step(&q)==SQLITE_ROW ){
1363 int id, rid;
1364 const char *zFullname;
1365 Blob content;
1366 int crnlOk, binOk, unicodeOk, chnged;
1367
1368 id = db_column_int(&q, 0);
1369 zFullname = db_column_text(&q, 1);
1370 rid = db_column_int(&q, 2);
1371 crnlOk = db_column_int(&q, 3);
1372 chnged = db_column_int(&q, 4);
1373 binOk = db_column_int(&q, 5);
1374 unicodeOk = db_column_int(&q, 6);
1375
1376 blob_zero(&content);
1377 if( file_wd_islink(zFullname) ){
1378 /* Instead of file content, put link destination path */
1379 blob_read_link(&content, zFullname);
@@ -1381,11 +1391,11 @@
1381 blob_read_from_file(&content, zFullname);
1382 }
1383 /* Do not emit any warnings when they are disabled. */
1384 if( !noWarningFlag ){
1385 abortCommit |= commit_warning(&content, crnlOk, binOk,
1386 unicodeOk, zFullname);
1387 }
1388 if( chnged==1 && contains_merge_marker(&content) ){
1389 Blob fname; /* Relative pathname of the file */
1390
1391 nConflict++;
1392
--- src/checkin.c
+++ src/checkin.c
@@ -895,42 +895,46 @@
895 */
896 static int commit_warning(
897 Blob *p, /* The content of the file being committed. */
898 int crnlOk, /* Non-zero if CR/NL warnings should be disabled. */
899 int binOk, /* Non-zero if binary warnings should be disabled. */
900 int encodingOk, /* Non-zero if encoding warnings should be disabled. */
901 const char *zFilename /* The full name of the file being committed. */
902 ){
903 int eType; /* return value of looks_like_utf8/utf16() */
904 int fUnicode; /* 1 if blob starts with UTF-16 BOM */
905 char *zMsg; /* Warning message */
906 Blob fname; /* Relative pathname of the file */
907 static int allOk = 0; /* Set to true to disable this routine */
908
909 if( allOk ) return 0;
910 fUnicode = (starts_with_bom(p) == 2);
911 eType = fUnicode ? looks_like_utf16(p) : looks_like_utf8(p);
912 if( eType<-2){
913 const char *zWarning;
914 const char *zDisable;
915 const char *zConvert;
916 Blob ans;
917 char cReply;
918
919 if(eType==-4){
920 if (binOk) goto go_on;
921 zWarning = "long lines";
922 zDisable = "\"binary-glob\" setting";
923 zConvert = "";
924 }else{
925 if (encodingOk) goto go_on;
926 zWarning = "invalid UTF-8";
927 zDisable = "\"encoding-glob\" setting";
928 zConvert = "c=convert/";
929 }
930 blob_zero(&ans);
931 file_relative_name(zFilename, &fname, 0);
932 zMsg = mprintf(
933 "%s appears to be text, but contains %s. Use --no-warnings or the"
934 " %s to disable this warning.\nCommit anyhow (a=all/%sy/N)? ",
935 blob_str(&fname), zWarning, zDisable, zConvert);
936 prompt_user(zMsg, &ans);
937 fossil_free(zMsg);
938 cReply = blob_str(&ans)[0];
939 if( *zConvert && (cReply=='c' || cReply=='C') ){
940 char *zOrig = file_newname(zFilename, "original", 1);
@@ -950,44 +954,50 @@
954 go_on:
955 eType +=4 ;
956 }
957 if( eType==0 || eType==-1 || fUnicode ){
958 const char *zWarning;
959 const char *zDisable;
960 const char *zConvert = "c=convert/";
961 Blob ans;
962 char cReply;
963
964 if( eType==-1 && fUnicode ){
965 if ( crnlOk && encodingOk ){
966 return 0; /* We don't want CR/NL and Unicode warnings for this file. */
967 }
968 zWarning = "CR/NL line endings and Unicode";
969 zDisable = "\"crnl-glob\" and \"encoding-glob\" settings";
970 }else if( eType==-1 ){
971 if( crnlOk ){
972 return 0; /* We don't want CR/NL warnings for this file. */
973 }
974 zWarning = "CR/NL line endings";
975 zDisable = "\"crnl-glob\" setting";
976 }else if( eType==0 ){
977 if( binOk ){
978 return 0; /* We don't want binary warnings for this file. */
979 }
980 zWarning = "binary data";
981 zDisable = "\"binary-glob\" setting";
982 zConvert = ""; /* We cannot convert binary files. */
983 }else{
984 if ( encodingOk ){
985 return 0; /* We don't want encoding warnings for this file. */
986 }
987 zWarning = "Unicode";
988 zDisable = "\"encoding-glob\" setting";
989 #ifndef _WIN32
990 zConvert = ""; /* On Unix, we cannot easily convert Unicode files. */
991 #endif
992 }
993 file_relative_name(zFilename, &fname, 0);
994 blob_zero(&ans);
995 zMsg = mprintf(
996 "%s contains %s. Use --no-warnings or the %s to disable this warning.\n"
997 "Commit anyhow (a=all/%sy/N)? ",
998 blob_str(&fname), zWarning, zDisable, zConvert);
999 prompt_user(zMsg, &ans);
1000 fossil_free(zMsg);
1001 cReply = blob_str(&ans)[0];
1002 if( cReply=='a' || cReply=='A' ){
1003 allOk = 1;
@@ -1361,19 +1371,19 @@
1371 );
1372 while( db_step(&q)==SQLITE_ROW ){
1373 int id, rid;
1374 const char *zFullname;
1375 Blob content;
1376 int crnlOk, binOk, encodingOk, chnged;
1377
1378 id = db_column_int(&q, 0);
1379 zFullname = db_column_text(&q, 1);
1380 rid = db_column_int(&q, 2);
1381 crnlOk = db_column_int(&q, 3);
1382 chnged = db_column_int(&q, 4);
1383 binOk = db_column_int(&q, 5);
1384 encodingOk = db_column_int(&q, 6);
1385
1386 blob_zero(&content);
1387 if( file_wd_islink(zFullname) ){
1388 /* Instead of file content, put link destination path */
1389 blob_read_link(&content, zFullname);
@@ -1381,11 +1391,11 @@
1391 blob_read_from_file(&content, zFullname);
1392 }
1393 /* Do not emit any warnings when they are disabled. */
1394 if( !noWarningFlag ){
1395 abortCommit |= commit_warning(&content, crnlOk, binOk,
1396 encodingOk, zFullname);
1397 }
1398 if( chnged==1 && contains_merge_marker(&content) ){
1399 Blob fname; /* Relative pathname of the file */
1400
1401 nConflict++;
1402
--- src/cson_amalgamation.h
+++ src/cson_amalgamation.h
@@ -1,6 +1,9 @@
11
#ifdef FOSSIL_ENABLE_JSON
2
+#ifndef CSON_FOSSIL_MODE
3
+#define CSON_FOSSIL_MODE
4
+#endif
25
/* auto-generated! Do not edit! */
36
/* begin file include/wh/cson/cson.h */
47
#if !defined(WANDERINGHORSE_NET_CSON_H_INCLUDED)
58
#define WANDERINGHORSE_NET_CSON_H_INCLUDED 1
69
710
--- src/cson_amalgamation.h
+++ src/cson_amalgamation.h
@@ -1,6 +1,9 @@
1 #ifdef FOSSIL_ENABLE_JSON
 
 
 
2 /* auto-generated! Do not edit! */
3 /* begin file include/wh/cson/cson.h */
4 #if !defined(WANDERINGHORSE_NET_CSON_H_INCLUDED)
5 #define WANDERINGHORSE_NET_CSON_H_INCLUDED 1
6
7
--- src/cson_amalgamation.h
+++ src/cson_amalgamation.h
@@ -1,6 +1,9 @@
1 #ifdef FOSSIL_ENABLE_JSON
2 #ifndef CSON_FOSSIL_MODE
3 #define CSON_FOSSIL_MODE
4 #endif
5 /* auto-generated! Do not edit! */
6 /* begin file include/wh/cson/cson.h */
7 #if !defined(WANDERINGHORSE_NET_CSON_H_INCLUDED)
8 #define WANDERINGHORSE_NET_CSON_H_INCLUDED 1
9
10
+15 -15
--- src/db.c
+++ src/db.c
@@ -2064,16 +2064,17 @@
20642064
{ "default-perms", 0, 16, 0, "u" },
20652065
{ "diff-binary", 0, 0, 0, "on" },
20662066
{ "diff-command", 0, 40, 0, "" },
20672067
{ "dont-push", 0, 0, 0, "off" },
20682068
{ "editor", 0, 32, 0, "" },
2069
+ { "empty-dirs", 0, 40, 1, "" },
2070
+ { "encoding-glob", 0, 40, 1, "" },
20692071
{ "gdiff-command", 0, 40, 0, "gdiff" },
20702072
{ "gmerge-command",0, 40, 0, "" },
2073
+ { "http-port", 0, 16, 0, "8080" },
20712074
{ "https-login", 0, 0, 0, "off" },
20722075
{ "ignore-glob", 0, 40, 1, "" },
2073
- { "empty-dirs", 0, 40, 1, "" },
2074
- { "http-port", 0, 16, 0, "8080" },
20752076
{ "localauth", 0, 0, 0, "off" },
20762077
{ "main-branch", 0, 40, 0, "trunk" },
20772078
{ "manifest", 0, 0, 1, "off" },
20782079
#ifdef FOSSIL_ENABLE_MARKDOWN
20792080
{ "markdown", 0, 0, 0, "off" },
@@ -2083,19 +2084,18 @@
20832084
{ "pgp-command", 0, 40, 0, "gpg --clearsign -o " },
20842085
{ "proxy", 0, 32, 0, "off" },
20852086
{ "relative-paths",0, 0, 0, "on" },
20862087
{ "repo-cksum", 0, 0, 0, "on" },
20872088
{ "self-register", 0, 0, 0, "off" },
2089
+ { "ssh-command", 0, 40, 0, "" },
20882090
{ "ssl-ca-location",0, 40, 0, "" },
20892091
{ "ssl-identity", 0, 40, 0, "" },
2090
- { "ssh-command", 0, 40, 0, "" },
2091
- { "th1-setup", 0, 40, 0, "" },
20922092
#ifdef FOSSIL_ENABLE_TCL
20932093
{ "tcl", 0, 0, 0, "off" },
20942094
{ "tcl-setup", 0, 40, 0, "" },
20952095
#endif
2096
- { "encoding-glob", 0, 40, 1, "" },
2096
+ { "th1-setup", 0, 40, 0, "" },
20972097
{ "web-browser", 0, 32, 0, "" },
20982098
{ "white-foreground", 0, 0, 0, "off" },
20992099
{ 0,0,0,0,0 }
21002100
};
21012101
@@ -2172,17 +2172,23 @@
21722172
** diff-command External command to run when performing a diff.
21732173
** If undefined, the internal text diff will be used.
21742174
**
21752175
** dont-push Prevent this repository from pushing from client to
21762176
** server. Useful when setting up a private branch.
2177
+**
2178
+** editor Text editor command used for check-in comments.
21772179
**
21782180
** empty-dirs A comma or newline-separated list of pathnames. On
21792181
** (versionable) update and checkout commands, if no file or directory
21802182
** exists with that name, an empty directory will be
21812183
** created.
21822184
**
2183
-** editor Text editor command used for check-in comments.
2185
+** encoding-glob The VALUE is a comma or newline-separated list of GLOB
2186
+** (versionable) patterns specifying files that the "commit" command will
2187
+** ignore when issuing warnings about text files that may
2188
+** use another encoding than ASCII or UTF-8. Set to "*"
2189
+** to disable encoding checking.
21842190
**
21852191
** gdiff-command External command to run when performing a graphical
21862192
** diff. If undefined, text diff will be used.
21872193
**
21882194
** gmerge-command A graphical merge conflict resolver command operating
@@ -2241,10 +2247,13 @@
22412247
**
22422248
** self-register Allow users to register themselves through the HTTP UI.
22432249
** This is useful if you want to see other names than
22442250
** "Anonymous" in e.g. ticketing system. On the other hand
22452251
** users can not be deleted. Default: off.
2252
+**
2253
+** ssh-command Command used to talk to a remote machine with
2254
+** the "ssh://" protocol.
22462255
**
22472256
** ssl-ca-location The full pathname to a file containing PEM encoded
22482257
** CA root certificates, or a directory of certificates
22492258
** with filenames formed from the certificate hashes as
22502259
** required by OpenSSL.
@@ -2260,13 +2269,10 @@
22602269
** the certificate and private key files.
22612270
** This identity will be presented to SSL servers to
22622271
** authenticate this client, in addition to the normal
22632272
** password authentication.
22642273
**
2265
-** ssh-command Command used to talk to a remote machine with
2266
-** the "ssh://" protocol.
2267
-**
22682274
** tcl If enabled (and Fossil was compiled with Tcl support),
22692275
** Tcl integration commands will be added to the TH1
22702276
** interpreter, allowing arbitrary Tcl expressions and
22712277
** scripts to be evaluated from TH1. Additionally, the Tcl
22722278
** interpreter will be able to evaluate arbitrary TH1
@@ -2278,16 +2284,10 @@
22782284
**
22792285
** th1-setup This is the setup script to be evaluated after creating
22802286
** and initializing the TH1 interpreter. By default, this
22812287
** is empty and no extra setup is performed.
22822288
**
2283
-** encoding-glob The VALUE is a comma or newline-separated list of GLOB
2284
-** (versionable) patterns specifying files that the "commit" command will
2285
-** ignore when issuing warnings about text files that may
2286
-** use an encoding other than ASCII or UTF-8 . Set to "*"
2287
-** to disable encoding checking.
2288
-**
22892289
** web-browser A shell command used to launch your preferred
22902290
** web browser when given a URL as an argument.
22912291
** Defaults to "start" on windows, "open" on Mac,
22922292
** and "firefox" on Unix.
22932293
**
22942294
--- src/db.c
+++ src/db.c
@@ -2064,16 +2064,17 @@
2064 { "default-perms", 0, 16, 0, "u" },
2065 { "diff-binary", 0, 0, 0, "on" },
2066 { "diff-command", 0, 40, 0, "" },
2067 { "dont-push", 0, 0, 0, "off" },
2068 { "editor", 0, 32, 0, "" },
 
 
2069 { "gdiff-command", 0, 40, 0, "gdiff" },
2070 { "gmerge-command",0, 40, 0, "" },
 
2071 { "https-login", 0, 0, 0, "off" },
2072 { "ignore-glob", 0, 40, 1, "" },
2073 { "empty-dirs", 0, 40, 1, "" },
2074 { "http-port", 0, 16, 0, "8080" },
2075 { "localauth", 0, 0, 0, "off" },
2076 { "main-branch", 0, 40, 0, "trunk" },
2077 { "manifest", 0, 0, 1, "off" },
2078 #ifdef FOSSIL_ENABLE_MARKDOWN
2079 { "markdown", 0, 0, 0, "off" },
@@ -2083,19 +2084,18 @@
2083 { "pgp-command", 0, 40, 0, "gpg --clearsign -o " },
2084 { "proxy", 0, 32, 0, "off" },
2085 { "relative-paths",0, 0, 0, "on" },
2086 { "repo-cksum", 0, 0, 0, "on" },
2087 { "self-register", 0, 0, 0, "off" },
 
2088 { "ssl-ca-location",0, 40, 0, "" },
2089 { "ssl-identity", 0, 40, 0, "" },
2090 { "ssh-command", 0, 40, 0, "" },
2091 { "th1-setup", 0, 40, 0, "" },
2092 #ifdef FOSSIL_ENABLE_TCL
2093 { "tcl", 0, 0, 0, "off" },
2094 { "tcl-setup", 0, 40, 0, "" },
2095 #endif
2096 { "encoding-glob", 0, 40, 1, "" },
2097 { "web-browser", 0, 32, 0, "" },
2098 { "white-foreground", 0, 0, 0, "off" },
2099 { 0,0,0,0,0 }
2100 };
2101
@@ -2172,17 +2172,23 @@
2172 ** diff-command External command to run when performing a diff.
2173 ** If undefined, the internal text diff will be used.
2174 **
2175 ** dont-push Prevent this repository from pushing from client to
2176 ** server. Useful when setting up a private branch.
 
 
2177 **
2178 ** empty-dirs A comma or newline-separated list of pathnames. On
2179 ** (versionable) update and checkout commands, if no file or directory
2180 ** exists with that name, an empty directory will be
2181 ** created.
2182 **
2183 ** editor Text editor command used for check-in comments.
 
 
 
 
2184 **
2185 ** gdiff-command External command to run when performing a graphical
2186 ** diff. If undefined, text diff will be used.
2187 **
2188 ** gmerge-command A graphical merge conflict resolver command operating
@@ -2241,10 +2247,13 @@
2241 **
2242 ** self-register Allow users to register themselves through the HTTP UI.
2243 ** This is useful if you want to see other names than
2244 ** "Anonymous" in e.g. ticketing system. On the other hand
2245 ** users can not be deleted. Default: off.
 
 
 
2246 **
2247 ** ssl-ca-location The full pathname to a file containing PEM encoded
2248 ** CA root certificates, or a directory of certificates
2249 ** with filenames formed from the certificate hashes as
2250 ** required by OpenSSL.
@@ -2260,13 +2269,10 @@
2260 ** the certificate and private key files.
2261 ** This identity will be presented to SSL servers to
2262 ** authenticate this client, in addition to the normal
2263 ** password authentication.
2264 **
2265 ** ssh-command Command used to talk to a remote machine with
2266 ** the "ssh://" protocol.
2267 **
2268 ** tcl If enabled (and Fossil was compiled with Tcl support),
2269 ** Tcl integration commands will be added to the TH1
2270 ** interpreter, allowing arbitrary Tcl expressions and
2271 ** scripts to be evaluated from TH1. Additionally, the Tcl
2272 ** interpreter will be able to evaluate arbitrary TH1
@@ -2278,16 +2284,10 @@
2278 **
2279 ** th1-setup This is the setup script to be evaluated after creating
2280 ** and initializing the TH1 interpreter. By default, this
2281 ** is empty and no extra setup is performed.
2282 **
2283 ** encoding-glob The VALUE is a comma or newline-separated list of GLOB
2284 ** (versionable) patterns specifying files that the "commit" command will
2285 ** ignore when issuing warnings about text files that may
2286 ** use an encoding other than ASCII or UTF-8 . Set to "*"
2287 ** to disable encoding checking.
2288 **
2289 ** web-browser A shell command used to launch your preferred
2290 ** web browser when given a URL as an argument.
2291 ** Defaults to "start" on windows, "open" on Mac,
2292 ** and "firefox" on Unix.
2293 **
2294
--- src/db.c
+++ src/db.c
@@ -2064,16 +2064,17 @@
2064 { "default-perms", 0, 16, 0, "u" },
2065 { "diff-binary", 0, 0, 0, "on" },
2066 { "diff-command", 0, 40, 0, "" },
2067 { "dont-push", 0, 0, 0, "off" },
2068 { "editor", 0, 32, 0, "" },
2069 { "empty-dirs", 0, 40, 1, "" },
2070 { "encoding-glob", 0, 40, 1, "" },
2071 { "gdiff-command", 0, 40, 0, "gdiff" },
2072 { "gmerge-command",0, 40, 0, "" },
2073 { "http-port", 0, 16, 0, "8080" },
2074 { "https-login", 0, 0, 0, "off" },
2075 { "ignore-glob", 0, 40, 1, "" },
 
 
2076 { "localauth", 0, 0, 0, "off" },
2077 { "main-branch", 0, 40, 0, "trunk" },
2078 { "manifest", 0, 0, 1, "off" },
2079 #ifdef FOSSIL_ENABLE_MARKDOWN
2080 { "markdown", 0, 0, 0, "off" },
@@ -2083,19 +2084,18 @@
2084 { "pgp-command", 0, 40, 0, "gpg --clearsign -o " },
2085 { "proxy", 0, 32, 0, "off" },
2086 { "relative-paths",0, 0, 0, "on" },
2087 { "repo-cksum", 0, 0, 0, "on" },
2088 { "self-register", 0, 0, 0, "off" },
2089 { "ssh-command", 0, 40, 0, "" },
2090 { "ssl-ca-location",0, 40, 0, "" },
2091 { "ssl-identity", 0, 40, 0, "" },
 
 
2092 #ifdef FOSSIL_ENABLE_TCL
2093 { "tcl", 0, 0, 0, "off" },
2094 { "tcl-setup", 0, 40, 0, "" },
2095 #endif
2096 { "th1-setup", 0, 40, 0, "" },
2097 { "web-browser", 0, 32, 0, "" },
2098 { "white-foreground", 0, 0, 0, "off" },
2099 { 0,0,0,0,0 }
2100 };
2101
@@ -2172,17 +2172,23 @@
2172 ** diff-command External command to run when performing a diff.
2173 ** If undefined, the internal text diff will be used.
2174 **
2175 ** dont-push Prevent this repository from pushing from client to
2176 ** server. Useful when setting up a private branch.
2177 **
2178 ** editor Text editor command used for check-in comments.
2179 **
2180 ** empty-dirs A comma or newline-separated list of pathnames. On
2181 ** (versionable) update and checkout commands, if no file or directory
2182 ** exists with that name, an empty directory will be
2183 ** created.
2184 **
2185 ** encoding-glob The VALUE is a comma or newline-separated list of GLOB
2186 ** (versionable) patterns specifying files that the "commit" command will
2187 ** ignore when issuing warnings about text files that may
2188 ** use another encoding than ASCII or UTF-8. Set to "*"
2189 ** to disable encoding checking.
2190 **
2191 ** gdiff-command External command to run when performing a graphical
2192 ** diff. If undefined, text diff will be used.
2193 **
2194 ** gmerge-command A graphical merge conflict resolver command operating
@@ -2241,10 +2247,13 @@
2247 **
2248 ** self-register Allow users to register themselves through the HTTP UI.
2249 ** This is useful if you want to see other names than
2250 ** "Anonymous" in e.g. ticketing system. On the other hand
2251 ** users can not be deleted. Default: off.
2252 **
2253 ** ssh-command Command used to talk to a remote machine with
2254 ** the "ssh://" protocol.
2255 **
2256 ** ssl-ca-location The full pathname to a file containing PEM encoded
2257 ** CA root certificates, or a directory of certificates
2258 ** with filenames formed from the certificate hashes as
2259 ** required by OpenSSL.
@@ -2260,13 +2269,10 @@
2269 ** the certificate and private key files.
2270 ** This identity will be presented to SSL servers to
2271 ** authenticate this client, in addition to the normal
2272 ** password authentication.
2273 **
 
 
 
2274 ** tcl If enabled (and Fossil was compiled with Tcl support),
2275 ** Tcl integration commands will be added to the TH1
2276 ** interpreter, allowing arbitrary Tcl expressions and
2277 ** scripts to be evaluated from TH1. Additionally, the Tcl
2278 ** interpreter will be able to evaluate arbitrary TH1
@@ -2278,16 +2284,10 @@
2284 **
2285 ** th1-setup This is the setup script to be evaluated after creating
2286 ** and initializing the TH1 interpreter. By default, this
2287 ** is empty and no extra setup is performed.
2288 **
 
 
 
 
 
 
2289 ** web-browser A shell command used to launch your preferred
2290 ** web browser when given a URL as an argument.
2291 ** Defaults to "start" on windows, "open" on Mac,
2292 ** and "firefox" on Unix.
2293 **
2294
+19 -60
--- src/diff.c
+++ src/diff.c
@@ -378,72 +378,31 @@
378378
if( pnByte ) *pnByte = 3;
379379
return bom;
380380
}
381381
382382
/*
383
-** This function returns non-zero if the blob starts with a UTF-8
384
-** byte-order-mark (BOM).
383
+** This function returns detected BOM size if the blob starts with
384
+** a UTF-8, UTF-16le or UTF-16be byte-order-mark (BOM).
385385
*/
386
-int starts_with_utf8_bom(const Blob *pContent, int *pnByte){
386
+int starts_with_bom(const Blob *pContent){
387387
const char *z = blob_buffer(pContent);
388
- int bomSize = 0;
388
+ int c1, bomSize = 0;
389389
const unsigned char *bom = get_utf8_bom(&bomSize);
390390
391
- if( pnByte ) *pnByte = bomSize;
392
- if( blob_size(pContent)<bomSize ) return 0;
393
- return memcmp(z, bom, bomSize)==0;
394
-}
395
-
396
-/*
397
-** This function returns non-zero if the blob starts with a UTF-16le or
398
-** UTF-16be byte-order-mark (BOM).
399
-*/
400
-int starts_with_utf16_bom(const Blob *pContent, int *pnByte){
401
- const char *z = blob_buffer(pContent);
402
- int c1, c2;
403
-
404
- if( pnByte ) *pnByte = 2;
405
- if( blob_size(pContent)<2 ) return 0;
406
- c1 = z[0]; c2 = z[1];
407
- if( (c1==(char)0xff) && (c2==(char)0xfe) ){
408
- return 1;
409
- }else if( (c1==(char)0xfe) && (c2==(char)0xff) ){
410
- return 1;
411
- }
412
- return 0;
413
-}
414
-
415
-/*
416
-** This function returns non-zero if the blob starts with a UTF-16le
417
-** byte-order-mark (BOM).
418
-*/
419
-int starts_with_utf16le_bom(const Blob *pContent, int *pnByte){
420
- const char *z = blob_buffer(pContent);
421
- int c1, c2;
422
-
423
- if( pnByte ) *pnByte = 2;
424
- if( blob_size(pContent)<2 ) return 0;
425
- c1 = z[0]; c2 = z[1];
426
- if( (c1==(char)0xff) && (c2==(char)0xfe) ){
427
- return 1;
428
- }
429
- return 0;
430
-}
431
-
432
-/*
433
-** This function returns non-zero if the blob starts with a UTF-16be
434
-** byte-order-mark (BOM).
435
-*/
436
-int starts_with_utf16be_bom(const Blob *pContent, int *pnByte){
437
- const char *z = blob_buffer(pContent);
438
- int c1, c2;
439
-
440
- if( pnByte ) *pnByte = 2;
441
- if( blob_size(pContent)<2 ) return 0;
442
- c1 = z[0]; c2 = z[1];
443
- if( (c1==(char)0xfe) && (c2==(char)0xff) ){
444
- return 1;
391
+ if( (blob_size(pContent)>=bomSize)
392
+ && (memcmp(z, bom, bomSize)==0) ){
393
+ return bomSize;
394
+ }
395
+ /* Only accept UTF-16 BOM if the blob has an even number of bytes */
396
+ if( (blob_size(pContent)<2) || (blob_size(pContent)&1) ) return 0;
397
+ c1 = *((unsigned short *)z);
398
+ if( (c1==0xfffe) || (c1==0xfeff) ){
399
+ if( blob_size(pContent)>=4 ){
400
+ /* For UTF-32 BOM, always return 0. */
401
+ if( ((unsigned short *)z)[1] == 0 ) return 0;
402
+ }
403
+ return 2;
445404
}
446405
return 0;
447406
}
448407
449408
/*
@@ -2407,11 +2366,11 @@
24072366
if( zLimit==0 || zLimit[0]==0 ) zLimit = "-1";
24082367
iLimit = atoi(zLimit);
24092368
showLog = find_option("log",0,0)!=0;
24102369
fileVers = find_option("filevers",0,0)!=0;
24112370
db_must_be_within_tree();
2412
- if (g.argc<3) {
2371
+ if( g.argc<3 ){
24132372
usage("FILENAME");
24142373
}
24152374
file_tree_name(g.argv[2], &treename, 1);
24162375
zFilename = blob_str(&treename);
24172376
fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename);
@@ -2421,11 +2380,11 @@
24212380
fid = db_int(0, "SELECT rid FROM vfile WHERE pathname=%Q", zFilename);
24222381
if( fid==0 ){
24232382
fossil_fatal("not part of current checkout: %s", zFilename);
24242383
}
24252384
cid = db_lget_int("checkout", 0);
2426
- if (cid == 0){
2385
+ if( cid == 0 ){
24272386
fossil_fatal("Not in a checkout");
24282387
}
24292388
if( iLimit<=0 ) iLimit = 1000000000;
24302389
compute_direct_ancestors(cid, iLimit);
24312390
mid = db_int(0, "SELECT mlink.mid FROM mlink, ancestor "
24322391
--- src/diff.c
+++ src/diff.c
@@ -378,72 +378,31 @@
378 if( pnByte ) *pnByte = 3;
379 return bom;
380 }
381
382 /*
383 ** This function returns non-zero if the blob starts with a UTF-8
384 ** byte-order-mark (BOM).
385 */
386 int starts_with_utf8_bom(const Blob *pContent, int *pnByte){
387 const char *z = blob_buffer(pContent);
388 int bomSize = 0;
389 const unsigned char *bom = get_utf8_bom(&bomSize);
390
391 if( pnByte ) *pnByte = bomSize;
392 if( blob_size(pContent)<bomSize ) return 0;
393 return memcmp(z, bom, bomSize)==0;
394 }
395
396 /*
397 ** This function returns non-zero if the blob starts with a UTF-16le or
398 ** UTF-16be byte-order-mark (BOM).
399 */
400 int starts_with_utf16_bom(const Blob *pContent, int *pnByte){
401 const char *z = blob_buffer(pContent);
402 int c1, c2;
403
404 if( pnByte ) *pnByte = 2;
405 if( blob_size(pContent)<2 ) return 0;
406 c1 = z[0]; c2 = z[1];
407 if( (c1==(char)0xff) && (c2==(char)0xfe) ){
408 return 1;
409 }else if( (c1==(char)0xfe) && (c2==(char)0xff) ){
410 return 1;
411 }
412 return 0;
413 }
414
415 /*
416 ** This function returns non-zero if the blob starts with a UTF-16le
417 ** byte-order-mark (BOM).
418 */
419 int starts_with_utf16le_bom(const Blob *pContent, int *pnByte){
420 const char *z = blob_buffer(pContent);
421 int c1, c2;
422
423 if( pnByte ) *pnByte = 2;
424 if( blob_size(pContent)<2 ) return 0;
425 c1 = z[0]; c2 = z[1];
426 if( (c1==(char)0xff) && (c2==(char)0xfe) ){
427 return 1;
428 }
429 return 0;
430 }
431
432 /*
433 ** This function returns non-zero if the blob starts with a UTF-16be
434 ** byte-order-mark (BOM).
435 */
436 int starts_with_utf16be_bom(const Blob *pContent, int *pnByte){
437 const char *z = blob_buffer(pContent);
438 int c1, c2;
439
440 if( pnByte ) *pnByte = 2;
441 if( blob_size(pContent)<2 ) return 0;
442 c1 = z[0]; c2 = z[1];
443 if( (c1==(char)0xfe) && (c2==(char)0xff) ){
444 return 1;
445 }
446 return 0;
447 }
448
449 /*
@@ -2407,11 +2366,11 @@
2407 if( zLimit==0 || zLimit[0]==0 ) zLimit = "-1";
2408 iLimit = atoi(zLimit);
2409 showLog = find_option("log",0,0)!=0;
2410 fileVers = find_option("filevers",0,0)!=0;
2411 db_must_be_within_tree();
2412 if (g.argc<3) {
2413 usage("FILENAME");
2414 }
2415 file_tree_name(g.argv[2], &treename, 1);
2416 zFilename = blob_str(&treename);
2417 fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename);
@@ -2421,11 +2380,11 @@
2421 fid = db_int(0, "SELECT rid FROM vfile WHERE pathname=%Q", zFilename);
2422 if( fid==0 ){
2423 fossil_fatal("not part of current checkout: %s", zFilename);
2424 }
2425 cid = db_lget_int("checkout", 0);
2426 if (cid == 0){
2427 fossil_fatal("Not in a checkout");
2428 }
2429 if( iLimit<=0 ) iLimit = 1000000000;
2430 compute_direct_ancestors(cid, iLimit);
2431 mid = db_int(0, "SELECT mlink.mid FROM mlink, ancestor "
2432
--- src/diff.c
+++ src/diff.c
@@ -378,72 +378,31 @@
378 if( pnByte ) *pnByte = 3;
379 return bom;
380 }
381
382 /*
383 ** This function returns detected BOM size if the blob starts with
384 ** a UTF-8, UTF-16le or UTF-16be byte-order-mark (BOM).
385 */
386 int starts_with_bom(const Blob *pContent){
387 const char *z = blob_buffer(pContent);
388 int c1, bomSize = 0;
389 const unsigned char *bom = get_utf8_bom(&bomSize);
390
391 if( (blob_size(pContent)>=bomSize)
392 && (memcmp(z, bom, bomSize)==0) ){
393 return bomSize;
394 }
395 /* Only accept UTF-16 BOM if the blob has an even number of bytes */
396 if( (blob_size(pContent)<2) || (blob_size(pContent)&1) ) return 0;
397 c1 = *((unsigned short *)z);
398 if( (c1==0xfffe) || (c1==0xfeff) ){
399 if( blob_size(pContent)>=4 ){
400 /* For UTF-32 BOM, always return 0. */
401 if( ((unsigned short *)z)[1] == 0 ) return 0;
402 }
403 return 2;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
404 }
405 return 0;
406 }
407
408 /*
@@ -2407,11 +2366,11 @@
2366 if( zLimit==0 || zLimit[0]==0 ) zLimit = "-1";
2367 iLimit = atoi(zLimit);
2368 showLog = find_option("log",0,0)!=0;
2369 fileVers = find_option("filevers",0,0)!=0;
2370 db_must_be_within_tree();
2371 if( g.argc<3 ){
2372 usage("FILENAME");
2373 }
2374 file_tree_name(g.argv[2], &treename, 1);
2375 zFilename = blob_str(&treename);
2376 fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename);
@@ -2421,11 +2380,11 @@
2380 fid = db_int(0, "SELECT rid FROM vfile WHERE pathname=%Q", zFilename);
2381 if( fid==0 ){
2382 fossil_fatal("not part of current checkout: %s", zFilename);
2383 }
2384 cid = db_lget_int("checkout", 0);
2385 if( cid == 0 ){
2386 fossil_fatal("Not in a checkout");
2387 }
2388 if( iLimit<=0 ) iLimit = 1000000000;
2389 compute_direct_ancestors(cid, iLimit);
2390 mid = db_int(0, "SELECT mlink.mid FROM mlink, ancestor "
2391
+19 -60
--- src/diff.c
+++ src/diff.c
@@ -378,72 +378,31 @@
378378
if( pnByte ) *pnByte = 3;
379379
return bom;
380380
}
381381
382382
/*
383
-** This function returns non-zero if the blob starts with a UTF-8
384
-** byte-order-mark (BOM).
383
+** This function returns detected BOM size if the blob starts with
384
+** a UTF-8, UTF-16le or UTF-16be byte-order-mark (BOM).
385385
*/
386
-int starts_with_utf8_bom(const Blob *pContent, int *pnByte){
386
+int starts_with_bom(const Blob *pContent){
387387
const char *z = blob_buffer(pContent);
388
- int bomSize = 0;
388
+ int c1, bomSize = 0;
389389
const unsigned char *bom = get_utf8_bom(&bomSize);
390390
391
- if( pnByte ) *pnByte = bomSize;
392
- if( blob_size(pContent)<bomSize ) return 0;
393
- return memcmp(z, bom, bomSize)==0;
394
-}
395
-
396
-/*
397
-** This function returns non-zero if the blob starts with a UTF-16le or
398
-** UTF-16be byte-order-mark (BOM).
399
-*/
400
-int starts_with_utf16_bom(const Blob *pContent, int *pnByte){
401
- const char *z = blob_buffer(pContent);
402
- int c1, c2;
403
-
404
- if( pnByte ) *pnByte = 2;
405
- if( blob_size(pContent)<2 ) return 0;
406
- c1 = z[0]; c2 = z[1];
407
- if( (c1==(char)0xff) && (c2==(char)0xfe) ){
408
- return 1;
409
- }else if( (c1==(char)0xfe) && (c2==(char)0xff) ){
410
- return 1;
411
- }
412
- return 0;
413
-}
414
-
415
-/*
416
-** This function returns non-zero if the blob starts with a UTF-16le
417
-** byte-order-mark (BOM).
418
-*/
419
-int starts_with_utf16le_bom(const Blob *pContent, int *pnByte){
420
- const char *z = blob_buffer(pContent);
421
- int c1, c2;
422
-
423
- if( pnByte ) *pnByte = 2;
424
- if( blob_size(pContent)<2 ) return 0;
425
- c1 = z[0]; c2 = z[1];
426
- if( (c1==(char)0xff) && (c2==(char)0xfe) ){
427
- return 1;
428
- }
429
- return 0;
430
-}
431
-
432
-/*
433
-** This function returns non-zero if the blob starts with a UTF-16be
434
-** byte-order-mark (BOM).
435
-*/
436
-int starts_with_utf16be_bom(const Blob *pContent, int *pnByte){
437
- const char *z = blob_buffer(pContent);
438
- int c1, c2;
439
-
440
- if( pnByte ) *pnByte = 2;
441
- if( blob_size(pContent)<2 ) return 0;
442
- c1 = z[0]; c2 = z[1];
443
- if( (c1==(char)0xfe) && (c2==(char)0xff) ){
444
- return 1;
391
+ if( (blob_size(pContent)>=bomSize)
392
+ && (memcmp(z, bom, bomSize)==0) ){
393
+ return bomSize;
394
+ }
395
+ /* Only accept UTF-16 BOM if the blob has an even number of bytes */
396
+ if( (blob_size(pContent)<2) || (blob_size(pContent)&1) ) return 0;
397
+ c1 = *((unsigned short *)z);
398
+ if( (c1==0xfffe) || (c1==0xfeff) ){
399
+ if( blob_size(pContent)>=4 ){
400
+ /* For UTF-32 BOM, always return 0. */
401
+ if( ((unsigned short *)z)[1] == 0 ) return 0;
402
+ }
403
+ return 2;
445404
}
446405
return 0;
447406
}
448407
449408
/*
@@ -2407,11 +2366,11 @@
24072366
if( zLimit==0 || zLimit[0]==0 ) zLimit = "-1";
24082367
iLimit = atoi(zLimit);
24092368
showLog = find_option("log",0,0)!=0;
24102369
fileVers = find_option("filevers",0,0)!=0;
24112370
db_must_be_within_tree();
2412
- if (g.argc<3) {
2371
+ if( g.argc<3 ){
24132372
usage("FILENAME");
24142373
}
24152374
file_tree_name(g.argv[2], &treename, 1);
24162375
zFilename = blob_str(&treename);
24172376
fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename);
@@ -2421,11 +2380,11 @@
24212380
fid = db_int(0, "SELECT rid FROM vfile WHERE pathname=%Q", zFilename);
24222381
if( fid==0 ){
24232382
fossil_fatal("not part of current checkout: %s", zFilename);
24242383
}
24252384
cid = db_lget_int("checkout", 0);
2426
- if (cid == 0){
2385
+ if( cid == 0 ){
24272386
fossil_fatal("Not in a checkout");
24282387
}
24292388
if( iLimit<=0 ) iLimit = 1000000000;
24302389
compute_direct_ancestors(cid, iLimit);
24312390
mid = db_int(0, "SELECT mlink.mid FROM mlink, ancestor "
24322391
--- src/diff.c
+++ src/diff.c
@@ -378,72 +378,31 @@
378 if( pnByte ) *pnByte = 3;
379 return bom;
380 }
381
382 /*
383 ** This function returns non-zero if the blob starts with a UTF-8
384 ** byte-order-mark (BOM).
385 */
386 int starts_with_utf8_bom(const Blob *pContent, int *pnByte){
387 const char *z = blob_buffer(pContent);
388 int bomSize = 0;
389 const unsigned char *bom = get_utf8_bom(&bomSize);
390
391 if( pnByte ) *pnByte = bomSize;
392 if( blob_size(pContent)<bomSize ) return 0;
393 return memcmp(z, bom, bomSize)==0;
394 }
395
396 /*
397 ** This function returns non-zero if the blob starts with a UTF-16le or
398 ** UTF-16be byte-order-mark (BOM).
399 */
400 int starts_with_utf16_bom(const Blob *pContent, int *pnByte){
401 const char *z = blob_buffer(pContent);
402 int c1, c2;
403
404 if( pnByte ) *pnByte = 2;
405 if( blob_size(pContent)<2 ) return 0;
406 c1 = z[0]; c2 = z[1];
407 if( (c1==(char)0xff) && (c2==(char)0xfe) ){
408 return 1;
409 }else if( (c1==(char)0xfe) && (c2==(char)0xff) ){
410 return 1;
411 }
412 return 0;
413 }
414
415 /*
416 ** This function returns non-zero if the blob starts with a UTF-16le
417 ** byte-order-mark (BOM).
418 */
419 int starts_with_utf16le_bom(const Blob *pContent, int *pnByte){
420 const char *z = blob_buffer(pContent);
421 int c1, c2;
422
423 if( pnByte ) *pnByte = 2;
424 if( blob_size(pContent)<2 ) return 0;
425 c1 = z[0]; c2 = z[1];
426 if( (c1==(char)0xff) && (c2==(char)0xfe) ){
427 return 1;
428 }
429 return 0;
430 }
431
432 /*
433 ** This function returns non-zero if the blob starts with a UTF-16be
434 ** byte-order-mark (BOM).
435 */
436 int starts_with_utf16be_bom(const Blob *pContent, int *pnByte){
437 const char *z = blob_buffer(pContent);
438 int c1, c2;
439
440 if( pnByte ) *pnByte = 2;
441 if( blob_size(pContent)<2 ) return 0;
442 c1 = z[0]; c2 = z[1];
443 if( (c1==(char)0xfe) && (c2==(char)0xff) ){
444 return 1;
445 }
446 return 0;
447 }
448
449 /*
@@ -2407,11 +2366,11 @@
2407 if( zLimit==0 || zLimit[0]==0 ) zLimit = "-1";
2408 iLimit = atoi(zLimit);
2409 showLog = find_option("log",0,0)!=0;
2410 fileVers = find_option("filevers",0,0)!=0;
2411 db_must_be_within_tree();
2412 if (g.argc<3) {
2413 usage("FILENAME");
2414 }
2415 file_tree_name(g.argv[2], &treename, 1);
2416 zFilename = blob_str(&treename);
2417 fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename);
@@ -2421,11 +2380,11 @@
2421 fid = db_int(0, "SELECT rid FROM vfile WHERE pathname=%Q", zFilename);
2422 if( fid==0 ){
2423 fossil_fatal("not part of current checkout: %s", zFilename);
2424 }
2425 cid = db_lget_int("checkout", 0);
2426 if (cid == 0){
2427 fossil_fatal("Not in a checkout");
2428 }
2429 if( iLimit<=0 ) iLimit = 1000000000;
2430 compute_direct_ancestors(cid, iLimit);
2431 mid = db_int(0, "SELECT mlink.mid FROM mlink, ancestor "
2432
--- src/diff.c
+++ src/diff.c
@@ -378,72 +378,31 @@
378 if( pnByte ) *pnByte = 3;
379 return bom;
380 }
381
382 /*
383 ** This function returns detected BOM size if the blob starts with
384 ** a UTF-8, UTF-16le or UTF-16be byte-order-mark (BOM).
385 */
386 int starts_with_bom(const Blob *pContent){
387 const char *z = blob_buffer(pContent);
388 int c1, bomSize = 0;
389 const unsigned char *bom = get_utf8_bom(&bomSize);
390
391 if( (blob_size(pContent)>=bomSize)
392 && (memcmp(z, bom, bomSize)==0) ){
393 return bomSize;
394 }
395 /* Only accept UTF-16 BOM if the blob has an even number of bytes */
396 if( (blob_size(pContent)<2) || (blob_size(pContent)&1) ) return 0;
397 c1 = *((unsigned short *)z);
398 if( (c1==0xfffe) || (c1==0xfeff) ){
399 if( blob_size(pContent)>=4 ){
400 /* For UTF-32 BOM, always return 0. */
401 if( ((unsigned short *)z)[1] == 0 ) return 0;
402 }
403 return 2;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
404 }
405 return 0;
406 }
407
408 /*
@@ -2407,11 +2366,11 @@
2366 if( zLimit==0 || zLimit[0]==0 ) zLimit = "-1";
2367 iLimit = atoi(zLimit);
2368 showLog = find_option("log",0,0)!=0;
2369 fileVers = find_option("filevers",0,0)!=0;
2370 db_must_be_within_tree();
2371 if( g.argc<3 ){
2372 usage("FILENAME");
2373 }
2374 file_tree_name(g.argv[2], &treename, 1);
2375 zFilename = blob_str(&treename);
2376 fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename);
@@ -2421,11 +2380,11 @@
2380 fid = db_int(0, "SELECT rid FROM vfile WHERE pathname=%Q", zFilename);
2381 if( fid==0 ){
2382 fossil_fatal("not part of current checkout: %s", zFilename);
2383 }
2384 cid = db_lget_int("checkout", 0);
2385 if( cid == 0 ){
2386 fossil_fatal("Not in a checkout");
2387 }
2388 if( iLimit<=0 ) iLimit = 1000000000;
2389 compute_direct_ancestors(cid, iLimit);
2390 mid = db_int(0, "SELECT mlink.mid FROM mlink, ancestor "
2391
+7 -3
--- src/doc.c
+++ src/doc.c
@@ -122,11 +122,13 @@
122122
{ "deb", 3, "application/x-debian-package" },
123123
{ "dir", 3, "application/x-director" },
124124
{ "dl", 2, "video/dl" },
125125
{ "dms", 3, "application/octet-stream" },
126126
{ "doc", 3, "application/msword" },
127
- { "docx", 4, "application/msword" },
127
+ { "docx", 4, "application/vnd.openxmlformats-officedocument.wordprocessingml.document"},
128
+ { "dot", 3, "application/msword" },
129
+ { "dotx", 4, "application/vnd.openxmlformats-officedocument.wordprocessingml.template"},
128130
{ "drw", 3, "application/drafting" },
129131
{ "dvi", 3, "application/x-dvi" },
130132
{ "dwg", 3, "application/acad" },
131133
{ "dxf", 3, "application/dxf" },
132134
{ "dxr", 3, "application/x-director" },
@@ -199,14 +201,16 @@
199201
{ "pl", 2, "application/x-perl" },
200202
{ "pm", 2, "application/x-perl" },
201203
{ "png", 3, "image/png" },
202204
{ "pnm", 3, "image/x-portable-anymap" },
203205
{ "pot", 3, "application/mspowerpoint" },
206
+ { "potx", 4, "application/vnd.openxmlformats-officedocument.presentationml.template"},
204207
{ "ppm", 3, "image/x-portable-pixmap" },
205208
{ "pps", 3, "application/mspowerpoint" },
209
+ { "ppsx", 4, "application/vnd.openxmlformats-officedocument.presentationml.slideshow"},
206210
{ "ppt", 3, "application/mspowerpoint" },
207
- { "pptx", 4, "application/mspowerpoint" },
211
+ { "pptx", 4, "application/vnd.openxmlformats-officedocument.presentationml.presentation"},
208212
{ "ppz", 3, "application/mspowerpoint" },
209213
{ "pre", 3, "application/x-freelance" },
210214
{ "prt", 3, "application/pro_eng" },
211215
{ "ps", 2, "application/postscript" },
212216
{ "qt", 2, "video/quicktime" },
@@ -277,11 +281,11 @@
277281
{ "xbm", 3, "image/x-xbitmap" },
278282
{ "xlc", 3, "application/vnd.ms-excel" },
279283
{ "xll", 3, "application/vnd.ms-excel" },
280284
{ "xlm", 3, "application/vnd.ms-excel" },
281285
{ "xls", 3, "application/vnd.ms-excel" },
282
- { "xlsx", 4, "application/vnd.ms-excel" },
286
+ { "xlsx", 4, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},
283287
{ "xlw", 3, "application/vnd.ms-excel" },
284288
{ "xml", 3, "text/xml" },
285289
{ "xpm", 3, "image/x-xpixmap" },
286290
{ "xwd", 3, "image/x-xwindowdump" },
287291
{ "xyz", 3, "chemical/x-pdb" },
288292
--- src/doc.c
+++ src/doc.c
@@ -122,11 +122,13 @@
122 { "deb", 3, "application/x-debian-package" },
123 { "dir", 3, "application/x-director" },
124 { "dl", 2, "video/dl" },
125 { "dms", 3, "application/octet-stream" },
126 { "doc", 3, "application/msword" },
127 { "docx", 4, "application/msword" },
 
 
128 { "drw", 3, "application/drafting" },
129 { "dvi", 3, "application/x-dvi" },
130 { "dwg", 3, "application/acad" },
131 { "dxf", 3, "application/dxf" },
132 { "dxr", 3, "application/x-director" },
@@ -199,14 +201,16 @@
199 { "pl", 2, "application/x-perl" },
200 { "pm", 2, "application/x-perl" },
201 { "png", 3, "image/png" },
202 { "pnm", 3, "image/x-portable-anymap" },
203 { "pot", 3, "application/mspowerpoint" },
 
204 { "ppm", 3, "image/x-portable-pixmap" },
205 { "pps", 3, "application/mspowerpoint" },
 
206 { "ppt", 3, "application/mspowerpoint" },
207 { "pptx", 4, "application/mspowerpoint" },
208 { "ppz", 3, "application/mspowerpoint" },
209 { "pre", 3, "application/x-freelance" },
210 { "prt", 3, "application/pro_eng" },
211 { "ps", 2, "application/postscript" },
212 { "qt", 2, "video/quicktime" },
@@ -277,11 +281,11 @@
277 { "xbm", 3, "image/x-xbitmap" },
278 { "xlc", 3, "application/vnd.ms-excel" },
279 { "xll", 3, "application/vnd.ms-excel" },
280 { "xlm", 3, "application/vnd.ms-excel" },
281 { "xls", 3, "application/vnd.ms-excel" },
282 { "xlsx", 4, "application/vnd.ms-excel" },
283 { "xlw", 3, "application/vnd.ms-excel" },
284 { "xml", 3, "text/xml" },
285 { "xpm", 3, "image/x-xpixmap" },
286 { "xwd", 3, "image/x-xwindowdump" },
287 { "xyz", 3, "chemical/x-pdb" },
288
--- src/doc.c
+++ src/doc.c
@@ -122,11 +122,13 @@
122 { "deb", 3, "application/x-debian-package" },
123 { "dir", 3, "application/x-director" },
124 { "dl", 2, "video/dl" },
125 { "dms", 3, "application/octet-stream" },
126 { "doc", 3, "application/msword" },
127 { "docx", 4, "application/vnd.openxmlformats-officedocument.wordprocessingml.document"},
128 { "dot", 3, "application/msword" },
129 { "dotx", 4, "application/vnd.openxmlformats-officedocument.wordprocessingml.template"},
130 { "drw", 3, "application/drafting" },
131 { "dvi", 3, "application/x-dvi" },
132 { "dwg", 3, "application/acad" },
133 { "dxf", 3, "application/dxf" },
134 { "dxr", 3, "application/x-director" },
@@ -199,14 +201,16 @@
201 { "pl", 2, "application/x-perl" },
202 { "pm", 2, "application/x-perl" },
203 { "png", 3, "image/png" },
204 { "pnm", 3, "image/x-portable-anymap" },
205 { "pot", 3, "application/mspowerpoint" },
206 { "potx", 4, "application/vnd.openxmlformats-officedocument.presentationml.template"},
207 { "ppm", 3, "image/x-portable-pixmap" },
208 { "pps", 3, "application/mspowerpoint" },
209 { "ppsx", 4, "application/vnd.openxmlformats-officedocument.presentationml.slideshow"},
210 { "ppt", 3, "application/mspowerpoint" },
211 { "pptx", 4, "application/vnd.openxmlformats-officedocument.presentationml.presentation"},
212 { "ppz", 3, "application/mspowerpoint" },
213 { "pre", 3, "application/x-freelance" },
214 { "prt", 3, "application/pro_eng" },
215 { "ps", 2, "application/postscript" },
216 { "qt", 2, "video/quicktime" },
@@ -277,11 +281,11 @@
281 { "xbm", 3, "image/x-xbitmap" },
282 { "xlc", 3, "application/vnd.ms-excel" },
283 { "xll", 3, "application/vnd.ms-excel" },
284 { "xlm", 3, "application/vnd.ms-excel" },
285 { "xls", 3, "application/vnd.ms-excel" },
286 { "xlsx", 4, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},
287 { "xlw", 3, "application/vnd.ms-excel" },
288 { "xml", 3, "text/xml" },
289 { "xpm", 3, "image/x-xpixmap" },
290 { "xwd", 3, "image/x-xwindowdump" },
291 { "xyz", 3, "chemical/x-pdb" },
292
+52 -29
--- src/file.c
+++ src/file.c
@@ -490,45 +490,68 @@
490490
** * Does not contain two or more "/" characters in a row.
491491
** * Contains at least one character
492492
**
493493
** Invalid UTF8 characters result in a false return if bStrictUtf8 is
494494
** true. If bStrictUtf8 is false, invalid UTF8 characters are silently
495
-** ignored.
495
+** ignored. See http://en.wikipedia.org/wiki/UTF-8#Invalid_byte_sequences
496
+** and http://en.wikipedia.org/wiki/Unicode (for the noncharacters)
497
+**
498
+** The bStrictUtf8 flag is true for new inputs, but is false when parsing
499
+** legacy manifests, for backwards compatibility.
496500
*/
497501
int file_is_simple_pathname(const char *z, int bStrictUtf8){
498502
int i;
499
- char c = z[0];
503
+ unsigned char c = (unsigned char) z[0];
500504
char maskNonAscii = bStrictUtf8 ? 0x80 : 0x00;
501505
if( c=='/' || c==0 ) return 0;
502506
if( c=='.' ){
503507
if( z[1]=='/' || z[1]==0 ) return 0;
504508
if( z[1]=='.' && (z[2]=='/' || z[2]==0) ) return 0;
505509
}
506
- for(i=0; (c=z[i])!=0; i++){
507
- if( c & maskNonAscii ){
508
- if( (c & 0xf0) == 0xf0 ) {
509
- /* Unicode characters > U+FFFF are not supported.
510
- * Windows XP and earlier cannot handle them.
511
- */
512
- return 0;
513
- }
514
- if( (c & 0xf0) == 0xe0 ) {
515
- /* This is a 3-byte UTF-8 character */
516
- if ( (c & 0xfe) == 0xee ){
517
- /* Range U+E000 - U+FFFF (Starting with 0xee or 0xef in UTF-8 ) */
518
- if ( !(c & 1) || ((z[i+1] & 0xff) < 0xa4) ){
519
- /* Unicode character in the range U+E000 - U+F8FF are for
520
- * private use, they shouldn't occur in filenames. */
521
- return 0;
522
- }
523
- }else if( ((c & 0xff) == 0xed) && ((z[i+1] & 0xe0) == 0xa0) ){
524
- /* Unicode character in the range U+D800 - U+DFFF are for
525
- * surrogate pairs, they shouldn't occur in filenames. */
526
- return 0;
527
- }
528
- }
529
- }else if( c=='\\' ){
510
+ for(i=0; (c=(unsigned char)z[i])!=0; i++){
511
+ if( c & maskNonAscii ){
512
+ if( (z[++i]&0xc0)!=0x80 ){
513
+ /* Invalid first continuation byte */
514
+ return 0;
515
+ }
516
+ if( c<0xc2 ){
517
+ /* Invalid 1-byte UTF-8 sequence, or 2-byte overlong form. */
518
+ return 0;
519
+ }else if( (c&0xe0)==0xe0 ){
520
+ /* 3-byte or more */
521
+ int unicode;
522
+ if( c&0x10 ){
523
+ /* Unicode characters > U+FFFF are not supported.
524
+ * Windows XP and earlier cannot handle them.
525
+ */
526
+ return 0;
527
+ }
528
+ /* This is a 3-byte UTF-8 character */
529
+ unicode = ((c&0x0f)<<12) + ((z[i]&0x3f)<<6) + (z[i+1]&0x3f);
530
+ if( unicode <= 0x07ff ){
531
+ /* overlong form */
532
+ return 0;
533
+ }else if( unicode>=0xe000 ){
534
+ /* U+E000..U+FFFF */
535
+ if( (unicode<=0xf8ff) || (unicode>=0xfffe) ){
536
+ /* U+E000..U+F8FF are for private use.
537
+ * U+FFFE..U+FFFF are noncharacters. */
538
+ return 0;
539
+ } else if( (unicode>=0xfdd0) && (unicode<=0xfdef) ){
540
+ /* U+FDD0..U+FDEF are noncharacters. */
541
+ return 0;
542
+ }
543
+ }else if( (unicode>=0xd800) && (unicode<=0xdfff) ){
544
+ /* U+D800..U+DFFF are for surrogate pairs. */
545
+ return 0;
546
+ }
547
+ if( (z[++i]&0xc0)!=0x80 ){
548
+ /* Invalid second continuation byte */
549
+ return 0;
550
+ }
551
+ }
552
+ }else if( bStrictUtf8 && (c=='\\') ){
530553
return 0;
531554
}
532555
if( c=='/' ){
533556
if( z[i+1]=='/' ) return 0;
534557
if( z[i+1]=='.' ){
@@ -578,11 +601,11 @@
578601
if( z[i]=='\\' ) z[i] = '/';
579602
}
580603
#endif
581604
582605
/* Removing trailing "/" characters */
583
- if ( !slash ){
606
+ if( !slash ){
584607
while( n>1 && z[n-1]=='/' ){ n--; }
585608
}
586609
587610
/* Remove duplicate '/' characters. Except, two // at the beginning
588611
** of a pathname is allowed since this is important on windows. */
@@ -835,11 +858,11 @@
835858
if( zPwd[i]==0 ){
836859
blob_append(pOut, ".", 1);
837860
}else{
838861
blob_append(pOut, "..", 2);
839862
for(j=i+1; zPwd[j]; j++){
840
- if( zPwd[j]=='/' ) {
863
+ if( zPwd[j]=='/' ){
841864
blob_append(pOut, "/..", 3);
842865
}
843866
}
844867
}
845868
return;
@@ -852,11 +875,11 @@
852875
return;
853876
}
854877
while( zPath[i-1]!='/' ){ i--; }
855878
blob_set(&tmp, "../");
856879
for(j=i; zPwd[j]; j++){
857
- if( zPwd[j]=='/' ) {
880
+ if( zPwd[j]=='/' ){
858881
blob_append(&tmp, "../", 3);
859882
}
860883
}
861884
blob_append(&tmp, &zPath[i], -1);
862885
blob_reset(pOut);
863886
--- src/file.c
+++ src/file.c
@@ -490,45 +490,68 @@
490 ** * Does not contain two or more "/" characters in a row.
491 ** * Contains at least one character
492 **
493 ** Invalid UTF8 characters result in a false return if bStrictUtf8 is
494 ** true. If bStrictUtf8 is false, invalid UTF8 characters are silently
495 ** ignored.
 
 
 
 
496 */
497 int file_is_simple_pathname(const char *z, int bStrictUtf8){
498 int i;
499 char c = z[0];
500 char maskNonAscii = bStrictUtf8 ? 0x80 : 0x00;
501 if( c=='/' || c==0 ) return 0;
502 if( c=='.' ){
503 if( z[1]=='/' || z[1]==0 ) return 0;
504 if( z[1]=='.' && (z[2]=='/' || z[2]==0) ) return 0;
505 }
506 for(i=0; (c=z[i])!=0; i++){
507 if( c & maskNonAscii ){
508 if( (c & 0xf0) == 0xf0 ) {
509 /* Unicode characters > U+FFFF are not supported.
510 * Windows XP and earlier cannot handle them.
511 */
512 return 0;
513 }
514 if( (c & 0xf0) == 0xe0 ) {
515 /* This is a 3-byte UTF-8 character */
516 if ( (c & 0xfe) == 0xee ){
517 /* Range U+E000 - U+FFFF (Starting with 0xee or 0xef in UTF-8 ) */
518 if ( !(c & 1) || ((z[i+1] & 0xff) < 0xa4) ){
519 /* Unicode character in the range U+E000 - U+F8FF are for
520 * private use, they shouldn't occur in filenames. */
521 return 0;
522 }
523 }else if( ((c & 0xff) == 0xed) && ((z[i+1] & 0xe0) == 0xa0) ){
524 /* Unicode character in the range U+D800 - U+DFFF are for
525 * surrogate pairs, they shouldn't occur in filenames. */
526 return 0;
527 }
528 }
529 }else if( c=='\\' ){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
530 return 0;
531 }
532 if( c=='/' ){
533 if( z[i+1]=='/' ) return 0;
534 if( z[i+1]=='.' ){
@@ -578,11 +601,11 @@
578 if( z[i]=='\\' ) z[i] = '/';
579 }
580 #endif
581
582 /* Removing trailing "/" characters */
583 if ( !slash ){
584 while( n>1 && z[n-1]=='/' ){ n--; }
585 }
586
587 /* Remove duplicate '/' characters. Except, two // at the beginning
588 ** of a pathname is allowed since this is important on windows. */
@@ -835,11 +858,11 @@
835 if( zPwd[i]==0 ){
836 blob_append(pOut, ".", 1);
837 }else{
838 blob_append(pOut, "..", 2);
839 for(j=i+1; zPwd[j]; j++){
840 if( zPwd[j]=='/' ) {
841 blob_append(pOut, "/..", 3);
842 }
843 }
844 }
845 return;
@@ -852,11 +875,11 @@
852 return;
853 }
854 while( zPath[i-1]!='/' ){ i--; }
855 blob_set(&tmp, "../");
856 for(j=i; zPwd[j]; j++){
857 if( zPwd[j]=='/' ) {
858 blob_append(&tmp, "../", 3);
859 }
860 }
861 blob_append(&tmp, &zPath[i], -1);
862 blob_reset(pOut);
863
--- src/file.c
+++ src/file.c
@@ -490,45 +490,68 @@
490 ** * Does not contain two or more "/" characters in a row.
491 ** * Contains at least one character
492 **
493 ** Invalid UTF8 characters result in a false return if bStrictUtf8 is
494 ** true. If bStrictUtf8 is false, invalid UTF8 characters are silently
495 ** ignored. See http://en.wikipedia.org/wiki/UTF-8#Invalid_byte_sequences
496 ** and http://en.wikipedia.org/wiki/Unicode (for the noncharacters)
497 **
498 ** The bStrictUtf8 flag is true for new inputs, but is false when parsing
499 ** legacy manifests, for backwards compatibility.
500 */
501 int file_is_simple_pathname(const char *z, int bStrictUtf8){
502 int i;
503 unsigned char c = (unsigned char) z[0];
504 char maskNonAscii = bStrictUtf8 ? 0x80 : 0x00;
505 if( c=='/' || c==0 ) return 0;
506 if( c=='.' ){
507 if( z[1]=='/' || z[1]==0 ) return 0;
508 if( z[1]=='.' && (z[2]=='/' || z[2]==0) ) return 0;
509 }
510 for(i=0; (c=(unsigned char)z[i])!=0; i++){
511 if( c & maskNonAscii ){
512 if( (z[++i]&0xc0)!=0x80 ){
513 /* Invalid first continuation byte */
514 return 0;
515 }
516 if( c<0xc2 ){
517 /* Invalid 1-byte UTF-8 sequence, or 2-byte overlong form. */
518 return 0;
519 }else if( (c&0xe0)==0xe0 ){
520 /* 3-byte or more */
521 int unicode;
522 if( c&0x10 ){
523 /* Unicode characters > U+FFFF are not supported.
524 * Windows XP and earlier cannot handle them.
525 */
526 return 0;
527 }
528 /* This is a 3-byte UTF-8 character */
529 unicode = ((c&0x0f)<<12) + ((z[i]&0x3f)<<6) + (z[i+1]&0x3f);
530 if( unicode <= 0x07ff ){
531 /* overlong form */
532 return 0;
533 }else if( unicode>=0xe000 ){
534 /* U+E000..U+FFFF */
535 if( (unicode<=0xf8ff) || (unicode>=0xfffe) ){
536 /* U+E000..U+F8FF are for private use.
537 * U+FFFE..U+FFFF are noncharacters. */
538 return 0;
539 } else if( (unicode>=0xfdd0) && (unicode<=0xfdef) ){
540 /* U+FDD0..U+FDEF are noncharacters. */
541 return 0;
542 }
543 }else if( (unicode>=0xd800) && (unicode<=0xdfff) ){
544 /* U+D800..U+DFFF are for surrogate pairs. */
545 return 0;
546 }
547 if( (z[++i]&0xc0)!=0x80 ){
548 /* Invalid second continuation byte */
549 return 0;
550 }
551 }
552 }else if( bStrictUtf8 && (c=='\\') ){
553 return 0;
554 }
555 if( c=='/' ){
556 if( z[i+1]=='/' ) return 0;
557 if( z[i+1]=='.' ){
@@ -578,11 +601,11 @@
601 if( z[i]=='\\' ) z[i] = '/';
602 }
603 #endif
604
605 /* Removing trailing "/" characters */
606 if( !slash ){
607 while( n>1 && z[n-1]=='/' ){ n--; }
608 }
609
610 /* Remove duplicate '/' characters. Except, two // at the beginning
611 ** of a pathname is allowed since this is important on windows. */
@@ -835,11 +858,11 @@
858 if( zPwd[i]==0 ){
859 blob_append(pOut, ".", 1);
860 }else{
861 blob_append(pOut, "..", 2);
862 for(j=i+1; zPwd[j]; j++){
863 if( zPwd[j]=='/' ){
864 blob_append(pOut, "/..", 3);
865 }
866 }
867 }
868 return;
@@ -852,11 +875,11 @@
875 return;
876 }
877 while( zPath[i-1]!='/' ){ i--; }
878 blob_set(&tmp, "../");
879 for(j=i; zPwd[j]; j++){
880 if( zPwd[j]=='/' ){
881 blob_append(&tmp, "../", 3);
882 }
883 }
884 blob_append(&tmp, &zPath[i], -1);
885 blob_reset(pOut);
886
+6 -2
--- src/http.c
+++ src/http.c
@@ -130,11 +130,11 @@
130130
**
131131
** The server address is contain in the "g" global structure. The
132132
** url_parse() routine should have been called prior to this routine
133133
** in order to fill this structure appropriately.
134134
*/
135
-int http_exchange(Blob *pSend, Blob *pReply, int useLogin){
135
+int http_exchange(Blob *pSend, Blob *pReply, int useLogin, int maxRedirect){
136136
Blob login; /* The login card */
137137
Blob payload; /* The complete payload including login card */
138138
Blob hdr; /* The HTTP request header */
139139
int closeConnection; /* True to close the connection when done */
140140
int iLength; /* Length of the reply payload */
@@ -231,10 +231,14 @@
231231
}else if( c=='k' || c=='K' ){
232232
closeConnection = 0;
233233
}
234234
}else if( rc==302 && fossil_strnicmp(zLine, "location:", 9)==0 ){
235235
int i, j;
236
+
237
+ if ( --maxRedirect == 0){
238
+ fossil_fatal("redirect limit exceeded");
239
+ }
236240
for(i=9; zLine[i] && zLine[i]==' '; i++){}
237241
if( zLine[i]==0 ) fossil_fatal("malformed redirect: %s", zLine);
238242
j = strlen(zLine) - 1;
239243
while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){
240244
j -= 4;
@@ -241,11 +245,11 @@
241245
zLine[j] = 0;
242246
}
243247
fossil_print("redirect to %s\n", &zLine[i]);
244248
url_parse(&zLine[i]);
245249
transport_close();
246
- return http_exchange(pSend, pReply, useLogin);
250
+ return http_exchange(pSend, pReply, useLogin, maxRedirect);
247251
}else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){
248252
if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){
249253
isCompressed = 0;
250254
}else if( fossil_strnicmp(&zLine[14],
251255
"application/x-fossil-uncompressed", -1)==0 ){
252256
--- src/http.c
+++ src/http.c
@@ -130,11 +130,11 @@
130 **
131 ** The server address is contain in the "g" global structure. The
132 ** url_parse() routine should have been called prior to this routine
133 ** in order to fill this structure appropriately.
134 */
135 int http_exchange(Blob *pSend, Blob *pReply, int useLogin){
136 Blob login; /* The login card */
137 Blob payload; /* The complete payload including login card */
138 Blob hdr; /* The HTTP request header */
139 int closeConnection; /* True to close the connection when done */
140 int iLength; /* Length of the reply payload */
@@ -231,10 +231,14 @@
231 }else if( c=='k' || c=='K' ){
232 closeConnection = 0;
233 }
234 }else if( rc==302 && fossil_strnicmp(zLine, "location:", 9)==0 ){
235 int i, j;
 
 
 
 
236 for(i=9; zLine[i] && zLine[i]==' '; i++){}
237 if( zLine[i]==0 ) fossil_fatal("malformed redirect: %s", zLine);
238 j = strlen(zLine) - 1;
239 while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){
240 j -= 4;
@@ -241,11 +245,11 @@
241 zLine[j] = 0;
242 }
243 fossil_print("redirect to %s\n", &zLine[i]);
244 url_parse(&zLine[i]);
245 transport_close();
246 return http_exchange(pSend, pReply, useLogin);
247 }else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){
248 if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){
249 isCompressed = 0;
250 }else if( fossil_strnicmp(&zLine[14],
251 "application/x-fossil-uncompressed", -1)==0 ){
252
--- src/http.c
+++ src/http.c
@@ -130,11 +130,11 @@
130 **
131 ** The server address is contain in the "g" global structure. The
132 ** url_parse() routine should have been called prior to this routine
133 ** in order to fill this structure appropriately.
134 */
135 int http_exchange(Blob *pSend, Blob *pReply, int useLogin, int maxRedirect){
136 Blob login; /* The login card */
137 Blob payload; /* The complete payload including login card */
138 Blob hdr; /* The HTTP request header */
139 int closeConnection; /* True to close the connection when done */
140 int iLength; /* Length of the reply payload */
@@ -231,10 +231,14 @@
231 }else if( c=='k' || c=='K' ){
232 closeConnection = 0;
233 }
234 }else if( rc==302 && fossil_strnicmp(zLine, "location:", 9)==0 ){
235 int i, j;
236
237 if ( --maxRedirect == 0){
238 fossil_fatal("redirect limit exceeded");
239 }
240 for(i=9; zLine[i] && zLine[i]==' '; i++){}
241 if( zLine[i]==0 ) fossil_fatal("malformed redirect: %s", zLine);
242 j = strlen(zLine) - 1;
243 while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){
244 j -= 4;
@@ -241,11 +245,11 @@
245 zLine[j] = 0;
246 }
247 fossil_print("redirect to %s\n", &zLine[i]);
248 url_parse(&zLine[i]);
249 transport_close();
250 return http_exchange(pSend, pReply, useLogin, maxRedirect);
251 }else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){
252 if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){
253 isCompressed = 0;
254 }else if( fossil_strnicmp(&zLine[14],
255 "application/x-fossil-uncompressed", -1)==0 ){
256
--- src/http_transport.c
+++ src/http_transport.c
@@ -183,10 +183,11 @@
183183
** and run an SSH command to talk to the remote machine.
184184
*/
185185
const char *zSsh; /* The base SSH command */
186186
Blob zCmd; /* The SSH command */
187187
char *zHost; /* The host name to contact */
188
+ int n; /* Size of prefix string */
188189
189190
zSsh = db_get("ssh-command", zDefaultSshCmd);
190191
blob_init(&zCmd, zSsh, -1);
191192
if( g.urlPort!=g.urlDfltPort ){
192193
#ifdef __MINGW32__
@@ -219,22 +220,63 @@
219220
}
220221
#endif
221222
}else{
222223
zHost = mprintf("%s", g.urlName);
223224
}
225
+ n = blob_size(&zCmd);
224226
blob_append(&zCmd, " ", 1);
225227
shell_escape(&zCmd, zHost);
226
- fossil_print(" %s\n", zHost); /* Show the conclusion of the SSH command */
228
+ if( g.urlShell ){
229
+ blob_appendf(&zCmd, " %s", g.urlShell);
230
+ }else{
231
+#if defined(FOSSIL_ENABLE_SSH_FAR_SIDE)
232
+ /* The following works. But only if the fossil on the remote side
233
+ ** is recent enough to support the test-ssh-far-side command. That
234
+ ** command was added on 2013-02-06. We will leave this turned off
235
+ ** until most fossil servers have upgraded to that version or a later
236
+ ** version. The sync will still work as long as the shell on the far
237
+ ** side is bash and not tcsh. And if the default far side shell is
238
+ ** tcsh, then the shell=/bin/bash query parameter can be used as a
239
+ ** work-around. Enable this code after about a year...
240
+ */
241
+ blob_appendf(&zCmd, " exec %s test-ssh-far-side", g.urlFossil);
242
+#endif
243
+ }
244
+ fossil_print("%s\n", blob_str(&zCmd)+n); /* Show tail of SSH command */
227245
free(zHost);
228246
popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid);
229247
if( sshPid==0 ){
230248
fossil_fatal("cannot start ssh tunnel using [%b]", &zCmd);
231249
}
232250
blob_reset(&zCmd);
233251
transport_ssh_startup();
234252
}
235253
}
254
+
255
+/*
256
+** COMMAND: test-ssh-far-side
257
+**
258
+** Read lines of input text, one by one, and evaluate each line using
259
+** system(). The ssh: sync protocol uses this on the far side of the
260
+** SSH link.
261
+*/
262
+void test_ssh_far_side_cmd(void){
263
+ int i = 0;
264
+ int got;
265
+ char zLine[5000];
266
+ while( i<sizeof(zLine) ){
267
+ got = read(0, zLine+i, 1);
268
+ if( got==0 ) return;
269
+ if( zLine[i]=='\n' ){
270
+ zLine[i] = 0;
271
+ system(zLine);
272
+ i = 0;
273
+ }else{
274
+ i++;
275
+ }
276
+ }
277
+}
236278
237279
/*
238280
** Open a connection to the server. The server is defined by the following
239281
** global variables:
240282
**
@@ -251,13 +293,13 @@
251293
Blob cmd;
252294
blob_zero(&cmd);
253295
shell_escape(&cmd, g.urlFossil);
254296
blob_append(&cmd, " test-http ", -1);
255297
shell_escape(&cmd, g.urlPath);
256
- /* printf("%s\n", blob_str(&cmd)); fflush(stdout); */
257
- fprintf(sshOut, "%s\n", blob_str(&cmd));
298
+ fprintf(sshOut, "%s || true\n", blob_str(&cmd));
258299
fflush(sshOut);
300
+ if( g.fSshTrace ) printf("Sent: [%s]\n", blob_str(&cmd));
259301
blob_reset(&cmd);
260302
}else if( g.urlIsHttps ){
261303
#ifdef FOSSIL_ENABLE_SSL
262304
rc = ssl_open();
263305
if( rc==0 ) transport.isOpen = 1;
@@ -403,11 +445,10 @@
403445
int got;
404446
if( sshIn ){
405447
int x;
406448
int wanted = N;
407449
got = 0;
408
- /* printf("want %d bytes...\n", wanted); fflush(stdout); */
409450
while( wanted>0 ){
410451
x = read(sshIn, &zBuf[got], wanted);
411452
if( x<=0 ) break;
412453
got += x;
413454
wanted -= x;
@@ -438,11 +479,14 @@
438479
int transport_receive(char *zBuf, int N){
439480
int onHand; /* Bytes current held in the transport buffer */
440481
int nByte = 0; /* Bytes of content received */
441482
442483
onHand = transport.nUsed - transport.iCursor;
443
- /* printf("request %d with %d on hand\n", N, onHand); fflush(stdout); */
484
+ if( g.fSshTrace){
485
+ printf("Reading %d bytes with %d on hand... ", N, onHand);
486
+ fflush(stdout);
487
+ }
444488
if( onHand>0 ){
445489
int toMove = onHand;
446490
if( toMove>N ) toMove = N;
447491
/* printf("bytes on hand: %d of %d\n", toMove, N); fflush(stdout); */
448492
memcpy(zBuf, &transport.pBuf[transport.iCursor], toMove);
@@ -460,10 +504,11 @@
460504
if( got>0 ){
461505
nByte += got;
462506
transport.nRcvd += got;
463507
}
464508
}
509
+ if( g.fSshTrace ) printf("Got %d bytes\n", nByte);
465510
return nByte;
466511
}
467512
468513
/*
469514
** Load up to N new bytes of content into the transport.pBuf buffer.
@@ -532,11 +577,11 @@
532577
}
533578
break;
534579
}
535580
i++;
536581
}
537
- /* printf("Got line: [%s]\n", &transport.pBuf[iStart]); */
582
+ if( g.fSshTrace ) printf("Got line: [%s]\n", &transport.pBuf[iStart]);
538583
return &transport.pBuf[iStart];
539584
}
540585
541586
void transport_global_shutdown(void){
542587
if( g.urlIsSsh && sshPid ){
543588
--- src/http_transport.c
+++ src/http_transport.c
@@ -183,10 +183,11 @@
183 ** and run an SSH command to talk to the remote machine.
184 */
185 const char *zSsh; /* The base SSH command */
186 Blob zCmd; /* The SSH command */
187 char *zHost; /* The host name to contact */
 
188
189 zSsh = db_get("ssh-command", zDefaultSshCmd);
190 blob_init(&zCmd, zSsh, -1);
191 if( g.urlPort!=g.urlDfltPort ){
192 #ifdef __MINGW32__
@@ -219,22 +220,63 @@
219 }
220 #endif
221 }else{
222 zHost = mprintf("%s", g.urlName);
223 }
 
224 blob_append(&zCmd, " ", 1);
225 shell_escape(&zCmd, zHost);
226 fossil_print(" %s\n", zHost); /* Show the conclusion of the SSH command */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
227 free(zHost);
228 popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid);
229 if( sshPid==0 ){
230 fossil_fatal("cannot start ssh tunnel using [%b]", &zCmd);
231 }
232 blob_reset(&zCmd);
233 transport_ssh_startup();
234 }
235 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
237 /*
238 ** Open a connection to the server. The server is defined by the following
239 ** global variables:
240 **
@@ -251,13 +293,13 @@
251 Blob cmd;
252 blob_zero(&cmd);
253 shell_escape(&cmd, g.urlFossil);
254 blob_append(&cmd, " test-http ", -1);
255 shell_escape(&cmd, g.urlPath);
256 /* printf("%s\n", blob_str(&cmd)); fflush(stdout); */
257 fprintf(sshOut, "%s\n", blob_str(&cmd));
258 fflush(sshOut);
 
259 blob_reset(&cmd);
260 }else if( g.urlIsHttps ){
261 #ifdef FOSSIL_ENABLE_SSL
262 rc = ssl_open();
263 if( rc==0 ) transport.isOpen = 1;
@@ -403,11 +445,10 @@
403 int got;
404 if( sshIn ){
405 int x;
406 int wanted = N;
407 got = 0;
408 /* printf("want %d bytes...\n", wanted); fflush(stdout); */
409 while( wanted>0 ){
410 x = read(sshIn, &zBuf[got], wanted);
411 if( x<=0 ) break;
412 got += x;
413 wanted -= x;
@@ -438,11 +479,14 @@
438 int transport_receive(char *zBuf, int N){
439 int onHand; /* Bytes current held in the transport buffer */
440 int nByte = 0; /* Bytes of content received */
441
442 onHand = transport.nUsed - transport.iCursor;
443 /* printf("request %d with %d on hand\n", N, onHand); fflush(stdout); */
 
 
 
444 if( onHand>0 ){
445 int toMove = onHand;
446 if( toMove>N ) toMove = N;
447 /* printf("bytes on hand: %d of %d\n", toMove, N); fflush(stdout); */
448 memcpy(zBuf, &transport.pBuf[transport.iCursor], toMove);
@@ -460,10 +504,11 @@
460 if( got>0 ){
461 nByte += got;
462 transport.nRcvd += got;
463 }
464 }
 
465 return nByte;
466 }
467
468 /*
469 ** Load up to N new bytes of content into the transport.pBuf buffer.
@@ -532,11 +577,11 @@
532 }
533 break;
534 }
535 i++;
536 }
537 /* printf("Got line: [%s]\n", &transport.pBuf[iStart]); */
538 return &transport.pBuf[iStart];
539 }
540
541 void transport_global_shutdown(void){
542 if( g.urlIsSsh && sshPid ){
543
--- src/http_transport.c
+++ src/http_transport.c
@@ -183,10 +183,11 @@
183 ** and run an SSH command to talk to the remote machine.
184 */
185 const char *zSsh; /* The base SSH command */
186 Blob zCmd; /* The SSH command */
187 char *zHost; /* The host name to contact */
188 int n; /* Size of prefix string */
189
190 zSsh = db_get("ssh-command", zDefaultSshCmd);
191 blob_init(&zCmd, zSsh, -1);
192 if( g.urlPort!=g.urlDfltPort ){
193 #ifdef __MINGW32__
@@ -219,22 +220,63 @@
220 }
221 #endif
222 }else{
223 zHost = mprintf("%s", g.urlName);
224 }
225 n = blob_size(&zCmd);
226 blob_append(&zCmd, " ", 1);
227 shell_escape(&zCmd, zHost);
228 if( g.urlShell ){
229 blob_appendf(&zCmd, " %s", g.urlShell);
230 }else{
231 #if defined(FOSSIL_ENABLE_SSH_FAR_SIDE)
232 /* The following works. But only if the fossil on the remote side
233 ** is recent enough to support the test-ssh-far-side command. That
234 ** command was added on 2013-02-06. We will leave this turned off
235 ** until most fossil servers have upgraded to that version or a later
236 ** version. The sync will still work as long as the shell on the far
237 ** side is bash and not tcsh. And if the default far side shell is
238 ** tcsh, then the shell=/bin/bash query parameter can be used as a
239 ** work-around. Enable this code after about a year...
240 */
241 blob_appendf(&zCmd, " exec %s test-ssh-far-side", g.urlFossil);
242 #endif
243 }
244 fossil_print("%s\n", blob_str(&zCmd)+n); /* Show tail of SSH command */
245 free(zHost);
246 popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid);
247 if( sshPid==0 ){
248 fossil_fatal("cannot start ssh tunnel using [%b]", &zCmd);
249 }
250 blob_reset(&zCmd);
251 transport_ssh_startup();
252 }
253 }
254
255 /*
256 ** COMMAND: test-ssh-far-side
257 **
258 ** Read lines of input text, one by one, and evaluate each line using
259 ** system(). The ssh: sync protocol uses this on the far side of the
260 ** SSH link.
261 */
262 void test_ssh_far_side_cmd(void){
263 int i = 0;
264 int got;
265 char zLine[5000];
266 while( i<sizeof(zLine) ){
267 got = read(0, zLine+i, 1);
268 if( got==0 ) return;
269 if( zLine[i]=='\n' ){
270 zLine[i] = 0;
271 system(zLine);
272 i = 0;
273 }else{
274 i++;
275 }
276 }
277 }
278
279 /*
280 ** Open a connection to the server. The server is defined by the following
281 ** global variables:
282 **
@@ -251,13 +293,13 @@
293 Blob cmd;
294 blob_zero(&cmd);
295 shell_escape(&cmd, g.urlFossil);
296 blob_append(&cmd, " test-http ", -1);
297 shell_escape(&cmd, g.urlPath);
298 fprintf(sshOut, "%s || true\n", blob_str(&cmd));
 
299 fflush(sshOut);
300 if( g.fSshTrace ) printf("Sent: [%s]\n", blob_str(&cmd));
301 blob_reset(&cmd);
302 }else if( g.urlIsHttps ){
303 #ifdef FOSSIL_ENABLE_SSL
304 rc = ssl_open();
305 if( rc==0 ) transport.isOpen = 1;
@@ -403,11 +445,10 @@
445 int got;
446 if( sshIn ){
447 int x;
448 int wanted = N;
449 got = 0;
 
450 while( wanted>0 ){
451 x = read(sshIn, &zBuf[got], wanted);
452 if( x<=0 ) break;
453 got += x;
454 wanted -= x;
@@ -438,11 +479,14 @@
479 int transport_receive(char *zBuf, int N){
480 int onHand; /* Bytes current held in the transport buffer */
481 int nByte = 0; /* Bytes of content received */
482
483 onHand = transport.nUsed - transport.iCursor;
484 if( g.fSshTrace){
485 printf("Reading %d bytes with %d on hand... ", N, onHand);
486 fflush(stdout);
487 }
488 if( onHand>0 ){
489 int toMove = onHand;
490 if( toMove>N ) toMove = N;
491 /* printf("bytes on hand: %d of %d\n", toMove, N); fflush(stdout); */
492 memcpy(zBuf, &transport.pBuf[transport.iCursor], toMove);
@@ -460,10 +504,11 @@
504 if( got>0 ){
505 nByte += got;
506 transport.nRcvd += got;
507 }
508 }
509 if( g.fSshTrace ) printf("Got %d bytes\n", nByte);
510 return nByte;
511 }
512
513 /*
514 ** Load up to N new bytes of content into the transport.pBuf buffer.
@@ -532,11 +577,11 @@
577 }
578 break;
579 }
580 i++;
581 }
582 if( g.fSshTrace ) printf("Got line: [%s]\n", &transport.pBuf[iStart]);
583 return &transport.pBuf[iStart];
584 }
585
586 void transport_global_shutdown(void){
587 if( g.urlIsSsh && sshPid ){
588
--- src/json_detail.h
+++ src/json_detail.h
@@ -199,11 +199,11 @@
199199
char const * requestId;
200200
char const * resultCode;
201201
char const * resultText;
202202
char const * timestamp;
203203
} FossilJsonKeys_;
204
-const FossilJsonKeys_ FossilJsonKeys;
204
+extern const FossilJsonKeys_ FossilJsonKeys;
205205
206206
/*
207207
** A page/command dispatch helper for fossil_json_f() implementations.
208208
** pages must be an array of JsonPageDef commands which we can
209209
** dispatch. The final item in the array MUST have a NULL name
210210
--- src/json_detail.h
+++ src/json_detail.h
@@ -199,11 +199,11 @@
199 char const * requestId;
200 char const * resultCode;
201 char const * resultText;
202 char const * timestamp;
203 } FossilJsonKeys_;
204 const FossilJsonKeys_ FossilJsonKeys;
205
206 /*
207 ** A page/command dispatch helper for fossil_json_f() implementations.
208 ** pages must be an array of JsonPageDef commands which we can
209 ** dispatch. The final item in the array MUST have a NULL name
210
--- src/json_detail.h
+++ src/json_detail.h
@@ -199,11 +199,11 @@
199 char const * requestId;
200 char const * resultCode;
201 char const * resultText;
202 char const * timestamp;
203 } FossilJsonKeys_;
204 extern const FossilJsonKeys_ FossilJsonKeys;
205
206 /*
207 ** A page/command dispatch helper for fossil_json_f() implementations.
208 ** pages must be an array of JsonPageDef commands which we can
209 ** dispatch. The final item in the array MUST have a NULL name
210
+3 -2
--- src/main.c
+++ src/main.c
@@ -170,11 +170,12 @@
170170
char *urlPath; /* Pathname for http: */
171171
char *urlUser; /* User id for http: */
172172
char *urlPasswd; /* Password for http: */
173173
char *urlCanonical; /* Canonical representation of the URL */
174174
char *urlProxyAuth; /* Proxy-Authorizer: string */
175
- char *urlFossil; /* The path of the ?fossil=path suffix on ssh: */
175
+ char *urlFossil; /* The fossil query parameter on ssh: */
176
+ char *urlShell; /* The shell query parameter on ssh: */
176177
int dontKeepUrl; /* Do not persist the URL */
177178
178179
const char *zLogin; /* Login name. "" if not logged in. */
179180
const char *zSSLIdentity; /* Value of --ssl-identity option, filename of SSL client identity */
180181
int useLocalauth; /* No login required if from 127.0.0.1 */
@@ -963,11 +964,11 @@
963964
**
964965
** Display information on how to use COMMAND. To display a list of
965966
** available commands one of:
966967
**
967968
** %fossil help Show common commands
968
-** %fossil help --all Show both command and auxiliary commands
969
+** %fossil help --all Show both common and auxiliary commands
969970
** %fossil help --test Show test commands only
970971
** %fossil help --aux Show auxiliary commands only
971972
*/
972973
void help_cmd(void){
973974
int rc, idx;
974975
--- src/main.c
+++ src/main.c
@@ -170,11 +170,12 @@
170 char *urlPath; /* Pathname for http: */
171 char *urlUser; /* User id for http: */
172 char *urlPasswd; /* Password for http: */
173 char *urlCanonical; /* Canonical representation of the URL */
174 char *urlProxyAuth; /* Proxy-Authorizer: string */
175 char *urlFossil; /* The path of the ?fossil=path suffix on ssh: */
 
176 int dontKeepUrl; /* Do not persist the URL */
177
178 const char *zLogin; /* Login name. "" if not logged in. */
179 const char *zSSLIdentity; /* Value of --ssl-identity option, filename of SSL client identity */
180 int useLocalauth; /* No login required if from 127.0.0.1 */
@@ -963,11 +964,11 @@
963 **
964 ** Display information on how to use COMMAND. To display a list of
965 ** available commands one of:
966 **
967 ** %fossil help Show common commands
968 ** %fossil help --all Show both command and auxiliary commands
969 ** %fossil help --test Show test commands only
970 ** %fossil help --aux Show auxiliary commands only
971 */
972 void help_cmd(void){
973 int rc, idx;
974
--- src/main.c
+++ src/main.c
@@ -170,11 +170,12 @@
170 char *urlPath; /* Pathname for http: */
171 char *urlUser; /* User id for http: */
172 char *urlPasswd; /* Password for http: */
173 char *urlCanonical; /* Canonical representation of the URL */
174 char *urlProxyAuth; /* Proxy-Authorizer: string */
175 char *urlFossil; /* The fossil query parameter on ssh: */
176 char *urlShell; /* The shell query parameter on ssh: */
177 int dontKeepUrl; /* Do not persist the URL */
178
179 const char *zLogin; /* Login name. "" if not logged in. */
180 const char *zSSLIdentity; /* Value of --ssl-identity option, filename of SSL client identity */
181 int useLocalauth; /* No login required if from 127.0.0.1 */
@@ -963,11 +964,11 @@
964 **
965 ** Display information on how to use COMMAND. To display a list of
966 ** available commands one of:
967 **
968 ** %fossil help Show common commands
969 ** %fossil help --all Show both common and auxiliary commands
970 ** %fossil help --test Show test commands only
971 ** %fossil help --aux Show auxiliary commands only
972 */
973 void help_cmd(void){
974 int rc, idx;
975
+1 -1
--- src/main.mk
+++ src/main.mk
@@ -1146,11 +1146,11 @@
11461146
$(OBJDIR)/th_tcl.o: $(SRCDIR)/th_tcl.c
11471147
$(XTCC) -c $(SRCDIR)/th_tcl.c -o $(OBJDIR)/th_tcl.o
11481148
11491149
11501150
$(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c
1151
- $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE
1151
+ $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o
11521152
11531153
#
11541154
# The list of all the targets that do not correspond to real files. This stops
11551155
# 'make' from getting confused when someone makes an error in a rule.
11561156
#
11571157
--- src/main.mk
+++ src/main.mk
@@ -1146,11 +1146,11 @@
1146 $(OBJDIR)/th_tcl.o: $(SRCDIR)/th_tcl.c
1147 $(XTCC) -c $(SRCDIR)/th_tcl.c -o $(OBJDIR)/th_tcl.o
1148
1149
1150 $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c
1151 $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE
1152
1153 #
1154 # The list of all the targets that do not correspond to real files. This stops
1155 # 'make' from getting confused when someone makes an error in a rule.
1156 #
1157
--- src/main.mk
+++ src/main.mk
@@ -1146,11 +1146,11 @@
1146 $(OBJDIR)/th_tcl.o: $(SRCDIR)/th_tcl.c
1147 $(XTCC) -c $(SRCDIR)/th_tcl.c -o $(OBJDIR)/th_tcl.o
1148
1149
1150 $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c
1151 $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o
1152
1153 #
1154 # The list of all the targets that do not correspond to real files. This stops
1155 # 'make' from getting confused when someone makes an error in a rule.
1156 #
1157
+34 -15
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -308,11 +308,11 @@
308308
writeln "\t\$(XTCC) -c \$(SRCDIR)/th_tcl.c -o \$(OBJDIR)/th_tcl.o\n"
309309
310310
set opt {}
311311
writeln {
312312
$(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c
313
- $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE
313
+ $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o
314314
315315
#
316316
# The list of all the targets that do not correspond to real files. This stops
317317
# 'make' from getting confused when someone makes an error in a rule.
318318
#
@@ -340,15 +340,15 @@
340340
#
341341
# This file is automatically generated. Instead of editing this
342342
# file, edit "makemake.tcl" then run "tclsh makemake.tcl"
343343
# to regenerate this file.
344344
#
345
-# This is a makefile for use on Windows/Linux/Darwin/Cygwin using MinGW or
346
-# MinGW-w64.
345
+# This is a makefile for use on Cygwin/Darwin/FreeBSD/Linux/Windows using
346
+# MinGW or MinGW-w64.
347347
#
348348
349
-#### Select one of MinGW, MinGW-64 (32-bit) or MinGW-w64 (64-bit) compilers.
349
+#### Select one of MinGW, MinGW-w64 (32-bit) or MinGW-w64 (64-bit) compilers.
350350
# By default, this is an empty string (i.e. use the native compiler).
351351
#
352352
PREFIX =
353353
# PREFIX = mingw32-
354354
# PREFIX = i686-pc-mingw32-
@@ -694,11 +694,11 @@
694694
ifdef FOSSIL_ENABLE_TCL
695695
EXTRAOBJ += $(OBJDIR)/th_tcl.o
696696
endif
697697
698698
zlib:
699
- make -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
699
+ $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
700700
701701
$(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib
702702
$(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o
703703
704704
# This rule prevents make from using its default rules to try build
@@ -751,11 +751,11 @@
751751
set opt $SQLITE_OPTIONS
752752
writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/sqlite3.c -o \$(OBJDIR)/sqlite3.o\n"
753753
754754
set opt {}
755755
writeln "\$(OBJDIR)/cson_amalgamation.o:\t\$(SRCDIR)/cson_amalgamation.c"
756
-writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/cson_amalgamation.c -o \$(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE\n"
756
+writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/cson_amalgamation.c -o \$(OBJDIR)/cson_amalgamation.o\n"
757757
writeln "\$(OBJDIR)/json.o \$(OBJDIR)/json_artifact.o \$(OBJDIR)/json_branch.o \$(OBJDIR)/json_config.o \$(OBJDIR)/json_diff.o \$(OBJDIR)/json_dir.o \$(OBJDIR)/jsos_finfo.o \$(OBJDIR)/json_login.o \$(OBJDIR)/json_query.o \$(OBJDIR)/json_report.o \$(OBJDIR)/json_tag.o \$(OBJDIR)/json_timeline.o \$(OBJDIR)/json_user.o \$(OBJDIR)/json_wiki.o : \$(SRCDIR)/json_detail.h\n"
758758
759759
writeln "\$(OBJDIR)/shell.o:\t\$(SRCDIR)/shell.c \$(SRCDIR)/sqlite3.h"
760760
set opt {-Dmain=sqlite3_shell}
761761
append opt " -DSQLITE_OMIT_LOAD_EXTENSION=1"
@@ -959,18 +959,35 @@
959959
960960
# zlib options
961961
ZINCDIR = $(B)\compat\zlib
962962
ZLIBDIR = $(B)\compat\zlib
963963
ZLIB = zlib.lib
964
+
965
+# Uncomment to enable JSON API
966
+# FOSSIL_ENABLE_JSON = 1
967
+
968
+# Uncomment to enable markdown support
969
+# FOSSIL_ENABLE_MARKDOWN = 1
964970
965971
INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR)
966972
967973
CFLAGS = -nologo -MT -O2
968974
BCC = $(CC) $(CFLAGS)
969975
TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL)
976
+RCC = rc -D_WIN32 -D_MSC_VER $(INCL)
970977
LIBS = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB)
971978
LIBDIR = -LIBPATH:$(ZLIBDIR)
979
+
980
+!ifdef FOSSIL_ENABLE_JSON
981
+TCC = $(TCC) -DFOSSIL_ENABLE_JSON
982
+RCC = $(RCC) -DFOSSIL_ENABLE_JSON
983
+!endif
984
+
985
+!ifdef FOSSIL_ENABLE_MARKDOWN
986
+TCC = $(TCC) -DFOSSIL_ENABLE_MARKDOWN
987
+RCC = $(RCC) -DFOSSIL_ENABLE_MARKDOWN
988
+!endif
972989
}
973990
regsub -all {[-]D} $SQLITE_OPTIONS {/D} MSC_SQLITE_OPTIONS
974991
set j " \\\n "
975992
writeln "SQLITE_OPTIONS = [join $MSC_SQLITE_OPTIONS $j]\n"
976993
writeln -nonewline "SRC = "
@@ -981,24 +998,22 @@
981998
writeln -nonewline " "
982999
}
9831000
writeln -nonewline "${s}_.c"; incr i
9841001
}
9851002
writeln "\n"
1003
+set AdditionalObj [list shell sqlite3 th th_lang cson_amalgamation]
9861004
writeln -nonewline "OBJ = "
9871005
set i 0
988
-foreach s [lsort $src] {
1006
+foreach s [lsort [concat $src $AdditionalObj]] {
9891007
if {$i > 0} {
9901008
writeln " \\"
9911009
writeln -nonewline " "
9921010
}
9931011
writeln -nonewline "\$(OX)\\$s\$O"; incr i
9941012
}
9951013
writeln " \\"
996
-writeln " \$(OX)\\shell\$O \\"
997
-writeln " \$(OX)\\sqlite3\$O \\"
998
-writeln " \$(OX)\\th\$O \\"
999
-writeln " \$(OX)\\th_lang\$O"
1014
+writeln -nonewline " \$(OX)\\fossil.res\n"
10001015
writeln {
10011016
APPNAME = $(OX)\fossil$(E)
10021017
10031018
all: $(OX) $(APPNAME)
10041019
@@ -1006,15 +1021,15 @@
10061021
@echo Building zlib from "$(ZLIBDIR)"...
10071022
@pushd "$(ZLIBDIR)" && nmake /f win32\Makefile.msc $(ZLIB) && popd
10081023
10091024
$(APPNAME) : translate$E mkindex$E headers $(OBJ) $(OX)\linkopts zlib
10101025
cd $(OX)
1011
- link /NODEFAULTLIB:msvcrt -OUT:$@ $(LIBDIR) Wsetargv.obj @linkopts
1026
+ link /NODEFAULTLIB:msvcrt -OUT:$@ $(LIBDIR) Wsetargv.obj fossil.res @linkopts
10121027
10131028
$(OX)\linkopts: $B\win\Makefile.msc}
10141029
set redir {>}
1015
-foreach s [lsort [concat $src {shell sqlite3 th th_lang}]] {
1030
+foreach s [lsort [concat $src $AdditionalObj]] {
10161031
writeln "\techo \$(OX)\\$s.obj $redir \$@"
10171032
set redir {>>}
10181033
}
10191034
writeln "\techo \$(LIBS) >> \$@\n\n"
10201035
@@ -1047,12 +1062,12 @@
10471062
$(OX)\th_lang$O : $(SRCDIR)\th_lang.c
10481063
$(TCC) /Fo$@ -c $**
10491064
10501065
VERSION.h : mkversion$E $B\manifest.uuid $B\manifest $B\VERSION
10511066
$** > $@
1052
-$(OBJDIR)\cson_amalgamation.h : $(SRCDIR)\cson_amalgamation.h
1053
- cp $(SRCDIR)\cson_amalgamation.h $@
1067
+$(OX)\cson_amalgamation$O : $(SRCDIR)\cson_amalgamation.c
1068
+ $(TCC) /Fo$@ -c $**
10541069
10551070
page_index.h: mkindex$E $(SRC)
10561071
$** > $@
10571072
10581073
clean:
@@ -1062,10 +1077,11 @@
10621077
-del *.h
10631078
-del *.map
10641079
-del *.manifest
10651080
-del headers
10661081
-del linkopts
1082
+ -del *.res
10671083
10681084
realclean: clean
10691085
-del $(APPNAME)
10701086
-del translate$E
10711087
-del mkindex$E
@@ -1092,10 +1108,13 @@
10921108
writeln "\$(OX)\\$s\$O : ${s}_.c ${s}.h"
10931109
writeln "\t\$(TCC) /Fo\$@ -c ${s}_.c\n"
10941110
writeln "${s}_.c : \$(SRCDIR)\\$s.c"
10951111
writeln "\ttranslate\$E \$** > \$@\n"
10961112
}
1113
+
1114
+writeln "fossil.res : \$B\\win\\fossil.rc"
1115
+writeln "\t\$(RCC) -fo \$@ \$**"
10971116
10981117
writeln "headers: makeheaders\$E page_index.h VERSION.h"
10991118
writeln -nonewline "\tmakeheaders\$E "
11001119
set i 0
11011120
foreach s [lsort $src] {
11021121
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -308,11 +308,11 @@
308 writeln "\t\$(XTCC) -c \$(SRCDIR)/th_tcl.c -o \$(OBJDIR)/th_tcl.o\n"
309
310 set opt {}
311 writeln {
312 $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c
313 $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE
314
315 #
316 # The list of all the targets that do not correspond to real files. This stops
317 # 'make' from getting confused when someone makes an error in a rule.
318 #
@@ -340,15 +340,15 @@
340 #
341 # This file is automatically generated. Instead of editing this
342 # file, edit "makemake.tcl" then run "tclsh makemake.tcl"
343 # to regenerate this file.
344 #
345 # This is a makefile for use on Windows/Linux/Darwin/Cygwin using MinGW or
346 # MinGW-w64.
347 #
348
349 #### Select one of MinGW, MinGW-64 (32-bit) or MinGW-w64 (64-bit) compilers.
350 # By default, this is an empty string (i.e. use the native compiler).
351 #
352 PREFIX =
353 # PREFIX = mingw32-
354 # PREFIX = i686-pc-mingw32-
@@ -694,11 +694,11 @@
694 ifdef FOSSIL_ENABLE_TCL
695 EXTRAOBJ += $(OBJDIR)/th_tcl.o
696 endif
697
698 zlib:
699 make -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
700
701 $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib
702 $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o
703
704 # This rule prevents make from using its default rules to try build
@@ -751,11 +751,11 @@
751 set opt $SQLITE_OPTIONS
752 writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/sqlite3.c -o \$(OBJDIR)/sqlite3.o\n"
753
754 set opt {}
755 writeln "\$(OBJDIR)/cson_amalgamation.o:\t\$(SRCDIR)/cson_amalgamation.c"
756 writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/cson_amalgamation.c -o \$(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE\n"
757 writeln "\$(OBJDIR)/json.o \$(OBJDIR)/json_artifact.o \$(OBJDIR)/json_branch.o \$(OBJDIR)/json_config.o \$(OBJDIR)/json_diff.o \$(OBJDIR)/json_dir.o \$(OBJDIR)/jsos_finfo.o \$(OBJDIR)/json_login.o \$(OBJDIR)/json_query.o \$(OBJDIR)/json_report.o \$(OBJDIR)/json_tag.o \$(OBJDIR)/json_timeline.o \$(OBJDIR)/json_user.o \$(OBJDIR)/json_wiki.o : \$(SRCDIR)/json_detail.h\n"
758
759 writeln "\$(OBJDIR)/shell.o:\t\$(SRCDIR)/shell.c \$(SRCDIR)/sqlite3.h"
760 set opt {-Dmain=sqlite3_shell}
761 append opt " -DSQLITE_OMIT_LOAD_EXTENSION=1"
@@ -959,18 +959,35 @@
959
960 # zlib options
961 ZINCDIR = $(B)\compat\zlib
962 ZLIBDIR = $(B)\compat\zlib
963 ZLIB = zlib.lib
 
 
 
 
 
 
964
965 INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR)
966
967 CFLAGS = -nologo -MT -O2
968 BCC = $(CC) $(CFLAGS)
969 TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL)
 
970 LIBS = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB)
971 LIBDIR = -LIBPATH:$(ZLIBDIR)
 
 
 
 
 
 
 
 
 
 
972 }
973 regsub -all {[-]D} $SQLITE_OPTIONS {/D} MSC_SQLITE_OPTIONS
974 set j " \\\n "
975 writeln "SQLITE_OPTIONS = [join $MSC_SQLITE_OPTIONS $j]\n"
976 writeln -nonewline "SRC = "
@@ -981,24 +998,22 @@
981 writeln -nonewline " "
982 }
983 writeln -nonewline "${s}_.c"; incr i
984 }
985 writeln "\n"
 
986 writeln -nonewline "OBJ = "
987 set i 0
988 foreach s [lsort $src] {
989 if {$i > 0} {
990 writeln " \\"
991 writeln -nonewline " "
992 }
993 writeln -nonewline "\$(OX)\\$s\$O"; incr i
994 }
995 writeln " \\"
996 writeln " \$(OX)\\shell\$O \\"
997 writeln " \$(OX)\\sqlite3\$O \\"
998 writeln " \$(OX)\\th\$O \\"
999 writeln " \$(OX)\\th_lang\$O"
1000 writeln {
1001 APPNAME = $(OX)\fossil$(E)
1002
1003 all: $(OX) $(APPNAME)
1004
@@ -1006,15 +1021,15 @@
1006 @echo Building zlib from "$(ZLIBDIR)"...
1007 @pushd "$(ZLIBDIR)" && nmake /f win32\Makefile.msc $(ZLIB) && popd
1008
1009 $(APPNAME) : translate$E mkindex$E headers $(OBJ) $(OX)\linkopts zlib
1010 cd $(OX)
1011 link /NODEFAULTLIB:msvcrt -OUT:$@ $(LIBDIR) Wsetargv.obj @linkopts
1012
1013 $(OX)\linkopts: $B\win\Makefile.msc}
1014 set redir {>}
1015 foreach s [lsort [concat $src {shell sqlite3 th th_lang}]] {
1016 writeln "\techo \$(OX)\\$s.obj $redir \$@"
1017 set redir {>>}
1018 }
1019 writeln "\techo \$(LIBS) >> \$@\n\n"
1020
@@ -1047,12 +1062,12 @@
1047 $(OX)\th_lang$O : $(SRCDIR)\th_lang.c
1048 $(TCC) /Fo$@ -c $**
1049
1050 VERSION.h : mkversion$E $B\manifest.uuid $B\manifest $B\VERSION
1051 $** > $@
1052 $(OBJDIR)\cson_amalgamation.h : $(SRCDIR)\cson_amalgamation.h
1053 cp $(SRCDIR)\cson_amalgamation.h $@
1054
1055 page_index.h: mkindex$E $(SRC)
1056 $** > $@
1057
1058 clean:
@@ -1062,10 +1077,11 @@
1062 -del *.h
1063 -del *.map
1064 -del *.manifest
1065 -del headers
1066 -del linkopts
 
1067
1068 realclean: clean
1069 -del $(APPNAME)
1070 -del translate$E
1071 -del mkindex$E
@@ -1092,10 +1108,13 @@
1092 writeln "\$(OX)\\$s\$O : ${s}_.c ${s}.h"
1093 writeln "\t\$(TCC) /Fo\$@ -c ${s}_.c\n"
1094 writeln "${s}_.c : \$(SRCDIR)\\$s.c"
1095 writeln "\ttranslate\$E \$** > \$@\n"
1096 }
 
 
 
1097
1098 writeln "headers: makeheaders\$E page_index.h VERSION.h"
1099 writeln -nonewline "\tmakeheaders\$E "
1100 set i 0
1101 foreach s [lsort $src] {
1102
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -308,11 +308,11 @@
308 writeln "\t\$(XTCC) -c \$(SRCDIR)/th_tcl.c -o \$(OBJDIR)/th_tcl.o\n"
309
310 set opt {}
311 writeln {
312 $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c
313 $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o
314
315 #
316 # The list of all the targets that do not correspond to real files. This stops
317 # 'make' from getting confused when someone makes an error in a rule.
318 #
@@ -340,15 +340,15 @@
340 #
341 # This file is automatically generated. Instead of editing this
342 # file, edit "makemake.tcl" then run "tclsh makemake.tcl"
343 # to regenerate this file.
344 #
345 # This is a makefile for use on Cygwin/Darwin/FreeBSD/Linux/Windows using
346 # MinGW or MinGW-w64.
347 #
348
349 #### Select one of MinGW, MinGW-w64 (32-bit) or MinGW-w64 (64-bit) compilers.
350 # By default, this is an empty string (i.e. use the native compiler).
351 #
352 PREFIX =
353 # PREFIX = mingw32-
354 # PREFIX = i686-pc-mingw32-
@@ -694,11 +694,11 @@
694 ifdef FOSSIL_ENABLE_TCL
695 EXTRAOBJ += $(OBJDIR)/th_tcl.o
696 endif
697
698 zlib:
699 $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
700
701 $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib
702 $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o
703
704 # This rule prevents make from using its default rules to try build
@@ -751,11 +751,11 @@
751 set opt $SQLITE_OPTIONS
752 writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/sqlite3.c -o \$(OBJDIR)/sqlite3.o\n"
753
754 set opt {}
755 writeln "\$(OBJDIR)/cson_amalgamation.o:\t\$(SRCDIR)/cson_amalgamation.c"
756 writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/cson_amalgamation.c -o \$(OBJDIR)/cson_amalgamation.o\n"
757 writeln "\$(OBJDIR)/json.o \$(OBJDIR)/json_artifact.o \$(OBJDIR)/json_branch.o \$(OBJDIR)/json_config.o \$(OBJDIR)/json_diff.o \$(OBJDIR)/json_dir.o \$(OBJDIR)/jsos_finfo.o \$(OBJDIR)/json_login.o \$(OBJDIR)/json_query.o \$(OBJDIR)/json_report.o \$(OBJDIR)/json_tag.o \$(OBJDIR)/json_timeline.o \$(OBJDIR)/json_user.o \$(OBJDIR)/json_wiki.o : \$(SRCDIR)/json_detail.h\n"
758
759 writeln "\$(OBJDIR)/shell.o:\t\$(SRCDIR)/shell.c \$(SRCDIR)/sqlite3.h"
760 set opt {-Dmain=sqlite3_shell}
761 append opt " -DSQLITE_OMIT_LOAD_EXTENSION=1"
@@ -959,18 +959,35 @@
959
960 # zlib options
961 ZINCDIR = $(B)\compat\zlib
962 ZLIBDIR = $(B)\compat\zlib
963 ZLIB = zlib.lib
964
965 # Uncomment to enable JSON API
966 # FOSSIL_ENABLE_JSON = 1
967
968 # Uncomment to enable markdown support
969 # FOSSIL_ENABLE_MARKDOWN = 1
970
971 INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR)
972
973 CFLAGS = -nologo -MT -O2
974 BCC = $(CC) $(CFLAGS)
975 TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL)
976 RCC = rc -D_WIN32 -D_MSC_VER $(INCL)
977 LIBS = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB)
978 LIBDIR = -LIBPATH:$(ZLIBDIR)
979
980 !ifdef FOSSIL_ENABLE_JSON
981 TCC = $(TCC) -DFOSSIL_ENABLE_JSON
982 RCC = $(RCC) -DFOSSIL_ENABLE_JSON
983 !endif
984
985 !ifdef FOSSIL_ENABLE_MARKDOWN
986 TCC = $(TCC) -DFOSSIL_ENABLE_MARKDOWN
987 RCC = $(RCC) -DFOSSIL_ENABLE_MARKDOWN
988 !endif
989 }
990 regsub -all {[-]D} $SQLITE_OPTIONS {/D} MSC_SQLITE_OPTIONS
991 set j " \\\n "
992 writeln "SQLITE_OPTIONS = [join $MSC_SQLITE_OPTIONS $j]\n"
993 writeln -nonewline "SRC = "
@@ -981,24 +998,22 @@
998 writeln -nonewline " "
999 }
1000 writeln -nonewline "${s}_.c"; incr i
1001 }
1002 writeln "\n"
1003 set AdditionalObj [list shell sqlite3 th th_lang cson_amalgamation]
1004 writeln -nonewline "OBJ = "
1005 set i 0
1006 foreach s [lsort [concat $src $AdditionalObj]] {
1007 if {$i > 0} {
1008 writeln " \\"
1009 writeln -nonewline " "
1010 }
1011 writeln -nonewline "\$(OX)\\$s\$O"; incr i
1012 }
1013 writeln " \\"
1014 writeln -nonewline " \$(OX)\\fossil.res\n"
 
 
 
1015 writeln {
1016 APPNAME = $(OX)\fossil$(E)
1017
1018 all: $(OX) $(APPNAME)
1019
@@ -1006,15 +1021,15 @@
1021 @echo Building zlib from "$(ZLIBDIR)"...
1022 @pushd "$(ZLIBDIR)" && nmake /f win32\Makefile.msc $(ZLIB) && popd
1023
1024 $(APPNAME) : translate$E mkindex$E headers $(OBJ) $(OX)\linkopts zlib
1025 cd $(OX)
1026 link /NODEFAULTLIB:msvcrt -OUT:$@ $(LIBDIR) Wsetargv.obj fossil.res @linkopts
1027
1028 $(OX)\linkopts: $B\win\Makefile.msc}
1029 set redir {>}
1030 foreach s [lsort [concat $src $AdditionalObj]] {
1031 writeln "\techo \$(OX)\\$s.obj $redir \$@"
1032 set redir {>>}
1033 }
1034 writeln "\techo \$(LIBS) >> \$@\n\n"
1035
@@ -1047,12 +1062,12 @@
1062 $(OX)\th_lang$O : $(SRCDIR)\th_lang.c
1063 $(TCC) /Fo$@ -c $**
1064
1065 VERSION.h : mkversion$E $B\manifest.uuid $B\manifest $B\VERSION
1066 $** > $@
1067 $(OX)\cson_amalgamation$O : $(SRCDIR)\cson_amalgamation.c
1068 $(TCC) /Fo$@ -c $**
1069
1070 page_index.h: mkindex$E $(SRC)
1071 $** > $@
1072
1073 clean:
@@ -1062,10 +1077,11 @@
1077 -del *.h
1078 -del *.map
1079 -del *.manifest
1080 -del headers
1081 -del linkopts
1082 -del *.res
1083
1084 realclean: clean
1085 -del $(APPNAME)
1086 -del translate$E
1087 -del mkindex$E
@@ -1092,10 +1108,13 @@
1108 writeln "\$(OX)\\$s\$O : ${s}_.c ${s}.h"
1109 writeln "\t\$(TCC) /Fo\$@ -c ${s}_.c\n"
1110 writeln "${s}_.c : \$(SRCDIR)\\$s.c"
1111 writeln "\ttranslate\$E \$** > \$@\n"
1112 }
1113
1114 writeln "fossil.res : \$B\\win\\fossil.rc"
1115 writeln "\t\$(RCC) -fo \$@ \$**"
1116
1117 writeln "headers: makeheaders\$E page_index.h VERSION.h"
1118 writeln -nonewline "\tmakeheaders\$E "
1119 set i 0
1120 foreach s [lsort $src] {
1121
+1 -1
--- src/printf.c
+++ src/printf.c
@@ -848,11 +848,11 @@
848848
fwrite(z, 1, n, toStdErr ? stderr : stdout);
849849
fflush(toStdErr ? stderr : stdout);
850850
}
851851
852852
/*
853
-** Force the the standard output cursor to move to the beginning
853
+** Force the standard output cursor to move to the beginning
854854
** of a line, if it is not there already.
855855
*/
856856
void fossil_force_newline(void){
857857
if( g.cgiOutput==0 && stdoutAtBOL==0 ) fossil_puts("\n", 0);
858858
}
859859
--- src/printf.c
+++ src/printf.c
@@ -848,11 +848,11 @@
848 fwrite(z, 1, n, toStdErr ? stderr : stdout);
849 fflush(toStdErr ? stderr : stdout);
850 }
851
852 /*
853 ** Force the the standard output cursor to move to the beginning
854 ** of a line, if it is not there already.
855 */
856 void fossil_force_newline(void){
857 if( g.cgiOutput==0 && stdoutAtBOL==0 ) fossil_puts("\n", 0);
858 }
859
--- src/printf.c
+++ src/printf.c
@@ -848,11 +848,11 @@
848 fwrite(z, 1, n, toStdErr ? stderr : stdout);
849 fflush(toStdErr ? stderr : stdout);
850 }
851
852 /*
853 ** Force the standard output cursor to move to the beginning
854 ** of a line, if it is not there already.
855 */
856 void fossil_force_newline(void){
857 if( g.cgiOutput==0 && stdoutAtBOL==0 ) fossil_puts("\n", 0);
858 }
859
+8 -3
--- src/rebuild.c
+++ src/rebuild.c
@@ -524,10 +524,11 @@
524524
** --noverify Skip the verification of changes to the BLOB table
525525
** --pagesize N Set the database pagesize to N. (512..65536 and power of 2)
526526
** --randomize Scan artifacts in a random order
527527
** --vacuum Run VACUUM on the database after rebuilding
528528
** --deanalyze Remove ANALYZE tables from the database
529
+** --analyze Run ANALYZE on the database after rebuilding
529530
** --wal Set Write-Ahead-Log journalling mode on the database
530531
** --stats Show artifact statistics after rebuilding
531532
**
532533
** See also: deconstruct, reconstruct
533534
*/
@@ -540,19 +541,21 @@
540541
const char *zPagesize;
541542
int newPagesize = 0;
542543
int activateWal;
543544
int runVacuum;
544545
int runDeanalyze;
546
+ int runAnalyze;
545547
int runCompress;
546548
int showStats;
547549
548550
omitVerify = find_option("noverify",0,0)!=0;
549551
forceFlag = find_option("force","f",0)!=0;
550552
randomizeFlag = find_option("randomize", 0, 0)!=0;
551553
doClustering = find_option("cluster", 0, 0)!=0;
552554
runVacuum = find_option("vacuum",0,0)!=0;
553555
runDeanalyze = find_option("deanalyze",0,0)!=0;
556
+ runAnalyze = find_option("analyze",0,0)!=0;
554557
runCompress = find_option("compress",0,0)!=0;
555558
zPagesize = find_option("pagesize",0,1);
556559
showStats = find_option("stats",0,0)!=0;
557560
if( zPagesize ){
558561
newPagesize = atoi(zPagesize);
@@ -605,22 +608,24 @@
605608
}
606609
if( runDeanalyze ){
607610
db_multi_exec("DROP TABLE IF EXISTS sqlite_stat1;"
608611
"DROP TABLE IF EXISTS sqlite_stat3;");
609612
}
613
+ if( runAnalyze ){
614
+ fossil_print("Analyzing the database... "); fflush(stdout);
615
+ db_multi_exec("ANALYZE;");
616
+ fossil_print("done\n");
617
+ }
610618
if( runVacuum ){
611619
fossil_print("Vacuuming the database... "); fflush(stdout);
612620
db_multi_exec("VACUUM");
613621
fossil_print("done\n");
614622
}
615623
if( activateWal ){
616624
db_multi_exec("PRAGMA journal_mode=WAL;");
617625
}
618626
}
619
- fossil_print("Analyzing the database... "); fflush(stdout);
620
- db_multi_exec("analyze");
621
- fossil_print("done\n");
622627
if( showStats ){
623628
static struct { int idx; const char *zLabel; } aStat[] = {
624629
{ CFTYPE_ANY, "Artifacts:" },
625630
{ CFTYPE_MANIFEST, "Manifests:" },
626631
{ CFTYPE_CLUSTER, "Clusters:" },
627632
--- src/rebuild.c
+++ src/rebuild.c
@@ -524,10 +524,11 @@
524 ** --noverify Skip the verification of changes to the BLOB table
525 ** --pagesize N Set the database pagesize to N. (512..65536 and power of 2)
526 ** --randomize Scan artifacts in a random order
527 ** --vacuum Run VACUUM on the database after rebuilding
528 ** --deanalyze Remove ANALYZE tables from the database
 
529 ** --wal Set Write-Ahead-Log journalling mode on the database
530 ** --stats Show artifact statistics after rebuilding
531 **
532 ** See also: deconstruct, reconstruct
533 */
@@ -540,19 +541,21 @@
540 const char *zPagesize;
541 int newPagesize = 0;
542 int activateWal;
543 int runVacuum;
544 int runDeanalyze;
 
545 int runCompress;
546 int showStats;
547
548 omitVerify = find_option("noverify",0,0)!=0;
549 forceFlag = find_option("force","f",0)!=0;
550 randomizeFlag = find_option("randomize", 0, 0)!=0;
551 doClustering = find_option("cluster", 0, 0)!=0;
552 runVacuum = find_option("vacuum",0,0)!=0;
553 runDeanalyze = find_option("deanalyze",0,0)!=0;
 
554 runCompress = find_option("compress",0,0)!=0;
555 zPagesize = find_option("pagesize",0,1);
556 showStats = find_option("stats",0,0)!=0;
557 if( zPagesize ){
558 newPagesize = atoi(zPagesize);
@@ -605,22 +608,24 @@
605 }
606 if( runDeanalyze ){
607 db_multi_exec("DROP TABLE IF EXISTS sqlite_stat1;"
608 "DROP TABLE IF EXISTS sqlite_stat3;");
609 }
 
 
 
 
 
610 if( runVacuum ){
611 fossil_print("Vacuuming the database... "); fflush(stdout);
612 db_multi_exec("VACUUM");
613 fossil_print("done\n");
614 }
615 if( activateWal ){
616 db_multi_exec("PRAGMA journal_mode=WAL;");
617 }
618 }
619 fossil_print("Analyzing the database... "); fflush(stdout);
620 db_multi_exec("analyze");
621 fossil_print("done\n");
622 if( showStats ){
623 static struct { int idx; const char *zLabel; } aStat[] = {
624 { CFTYPE_ANY, "Artifacts:" },
625 { CFTYPE_MANIFEST, "Manifests:" },
626 { CFTYPE_CLUSTER, "Clusters:" },
627
--- src/rebuild.c
+++ src/rebuild.c
@@ -524,10 +524,11 @@
524 ** --noverify Skip the verification of changes to the BLOB table
525 ** --pagesize N Set the database pagesize to N. (512..65536 and power of 2)
526 ** --randomize Scan artifacts in a random order
527 ** --vacuum Run VACUUM on the database after rebuilding
528 ** --deanalyze Remove ANALYZE tables from the database
529 ** --analyze Run ANALYZE on the database after rebuilding
530 ** --wal Set Write-Ahead-Log journalling mode on the database
531 ** --stats Show artifact statistics after rebuilding
532 **
533 ** See also: deconstruct, reconstruct
534 */
@@ -540,19 +541,21 @@
541 const char *zPagesize;
542 int newPagesize = 0;
543 int activateWal;
544 int runVacuum;
545 int runDeanalyze;
546 int runAnalyze;
547 int runCompress;
548 int showStats;
549
550 omitVerify = find_option("noverify",0,0)!=0;
551 forceFlag = find_option("force","f",0)!=0;
552 randomizeFlag = find_option("randomize", 0, 0)!=0;
553 doClustering = find_option("cluster", 0, 0)!=0;
554 runVacuum = find_option("vacuum",0,0)!=0;
555 runDeanalyze = find_option("deanalyze",0,0)!=0;
556 runAnalyze = find_option("analyze",0,0)!=0;
557 runCompress = find_option("compress",0,0)!=0;
558 zPagesize = find_option("pagesize",0,1);
559 showStats = find_option("stats",0,0)!=0;
560 if( zPagesize ){
561 newPagesize = atoi(zPagesize);
@@ -605,22 +608,24 @@
608 }
609 if( runDeanalyze ){
610 db_multi_exec("DROP TABLE IF EXISTS sqlite_stat1;"
611 "DROP TABLE IF EXISTS sqlite_stat3;");
612 }
613 if( runAnalyze ){
614 fossil_print("Analyzing the database... "); fflush(stdout);
615 db_multi_exec("ANALYZE;");
616 fossil_print("done\n");
617 }
618 if( runVacuum ){
619 fossil_print("Vacuuming the database... "); fflush(stdout);
620 db_multi_exec("VACUUM");
621 fossil_print("done\n");
622 }
623 if( activateWal ){
624 db_multi_exec("PRAGMA journal_mode=WAL;");
625 }
626 }
 
 
 
627 if( showStats ){
628 static struct { int idx; const char *zLabel; } aStat[] = {
629 { CFTYPE_ANY, "Artifacts:" },
630 { CFTYPE_MANIFEST, "Manifests:" },
631 { CFTYPE_CLUSTER, "Clusters:" },
632
--- src/setup.c
+++ src/setup.c
@@ -917,10 +917,19 @@
917917
@ to this many bytes, uncompressed. If the client requires more data
918918
@ than this, then the client will issue multiple HTTP requests.
919919
@ Values below 1 million are not recommended. 5 million is a
920920
@ reasonable number.</p>
921921
922
+ @ <hr />
923
+ entry_attribute("Download time limit", 11, "max-download-time", "mxdwnt",
924
+ "30");
925
+
926
+ @ <p>Fossil tries to spend less than this many seconds gathering
927
+ @ the out-bound data of sync, clone, and pull packets.
928
+ @ If the client request takes longer, a partial reply is given similar
929
+ @ to the download packet limit. 30s is a reasonable default.</p>
930
+
922931
@ <hr />
923932
onoff_attribute(
924933
"Enable hyperlinks for \"nobody\" based on User-Agent and Javascript",
925934
"auto-hyperlink", "autohyperlink", 1);
926935
@ <p>Enable hyperlinks (the equivalent of the "h" permission) for all users
927936
--- src/setup.c
+++ src/setup.c
@@ -917,10 +917,19 @@
917 @ to this many bytes, uncompressed. If the client requires more data
918 @ than this, then the client will issue multiple HTTP requests.
919 @ Values below 1 million are not recommended. 5 million is a
920 @ reasonable number.</p>
921
 
 
 
 
 
 
 
 
 
922 @ <hr />
923 onoff_attribute(
924 "Enable hyperlinks for \"nobody\" based on User-Agent and Javascript",
925 "auto-hyperlink", "autohyperlink", 1);
926 @ <p>Enable hyperlinks (the equivalent of the "h" permission) for all users
927
--- src/setup.c
+++ src/setup.c
@@ -917,10 +917,19 @@
917 @ to this many bytes, uncompressed. If the client requires more data
918 @ than this, then the client will issue multiple HTTP requests.
919 @ Values below 1 million are not recommended. 5 million is a
920 @ reasonable number.</p>
921
922 @ <hr />
923 entry_attribute("Download time limit", 11, "max-download-time", "mxdwnt",
924 "30");
925
926 @ <p>Fossil tries to spend less than this many seconds gathering
927 @ the out-bound data of sync, clone, and pull packets.
928 @ If the client request takes longer, a partial reply is given similar
929 @ to the download packet limit. 30s is a reasonable default.</p>
930
931 @ <hr />
932 onoff_attribute(
933 "Enable hyperlinks for \"nobody\" based on User-Agent and Javascript",
934 "auto-hyperlink", "autohyperlink", 1);
935 @ <p>Enable hyperlinks (the equivalent of the "h" permission) for all users
936
+8 -1
--- src/stat.c
+++ src/stat.c
@@ -140,11 +140,18 @@
140140
}
141141
142142
/*
143143
** COMMAND: dbstat*
144144
**
145
-** Show statistics and global information about the repository.
145
+** Usage: %fossil dbstat ?-brief | -b?
146
+**
147
+** Shows statistics and global information about the repository.
148
+**
149
+** The (-brief|-b) option removes any "long-running" statistics, namely
150
+** those whose calculations are known to slow down as the repository
151
+** grows.
152
+**
146153
*/
147154
void dbstat_cmd(void){
148155
i64 t, fsize;
149156
int n, m;
150157
int szMax, szAvg;
151158
--- src/stat.c
+++ src/stat.c
@@ -140,11 +140,18 @@
140 }
141
142 /*
143 ** COMMAND: dbstat*
144 **
145 ** Show statistics and global information about the repository.
 
 
 
 
 
 
 
146 */
147 void dbstat_cmd(void){
148 i64 t, fsize;
149 int n, m;
150 int szMax, szAvg;
151
--- src/stat.c
+++ src/stat.c
@@ -140,11 +140,18 @@
140 }
141
142 /*
143 ** COMMAND: dbstat*
144 **
145 ** Usage: %fossil dbstat ?-brief | -b?
146 **
147 ** Shows statistics and global information about the repository.
148 **
149 ** The (-brief|-b) option removes any "long-running" statistics, namely
150 ** those whose calculations are known to slow down as the repository
151 ** grows.
152 **
153 */
154 void dbstat_cmd(void){
155 i64 t, fsize;
156 int n, m;
157 int szMax, szAvg;
158
+25 -6
--- src/update.c
+++ src/update.c
@@ -667,10 +667,13 @@
667667
** Usage: %fossil revert ?-r REVISION? ?FILE ...?
668668
**
669669
** Revert to the current repository version of FILE, or to
670670
** the version associated with baseline REVISION if the -r flag
671671
** appears.
672
+**
673
+** If FILE was part of a rename operation, both the original file
674
+** and the renamed file are reverted.
672675
**
673676
** Revert all files if no file name is provided.
674677
**
675678
** If a file is reverted accidently, it can be restored using
676679
** the "fossil undo" command.
@@ -706,11 +709,22 @@
706709
if( g.argc>2 ){
707710
for(i=2; i<g.argc; i++){
708711
Blob fname;
709712
zFile = mprintf("%/", g.argv[i]);
710713
file_tree_name(zFile, &fname, 1);
711
- db_multi_exec("REPLACE INTO torevert VALUES(%B)", &fname);
714
+ db_multi_exec(
715
+ "REPLACE INTO torevert VALUES(%B);"
716
+ "INSERT OR IGNORE INTO torevert"
717
+ " SELECT pathname"
718
+ " FROM vfile"
719
+ " WHERE origname IN(%B)"
720
+ " UNION ALL"
721
+ " SELECT origname"
722
+ " FROM vfile"
723
+ " WHERE pathname IN(%B) AND origname IS NOT NULL;",
724
+ &fname, &fname, &fname
725
+ );
712726
blob_reset(&fname);
713727
}
714728
}else{
715729
int vid;
716730
vid = db_lget_int("checkout", 0);
@@ -748,11 +762,17 @@
748762
}else{
749763
undo_save(zFile);
750764
file_delete(zFull);
751765
fossil_print("DELETE: %s\n", zFile);
752766
}
753
- db_multi_exec("DELETE FROM vfile WHERE pathname=%Q", zFile);
767
+ db_multi_exec(
768
+ "UPDATE vfile"
769
+ " SET pathname=origname, origname=NULL"
770
+ " WHERE pathname=%Q AND origname!=pathname AND origname IS NOT NULL;"
771
+ "DELETE FROM vfile WHERE pathname=%Q",
772
+ zFile, zFile
773
+ );
754774
}else{
755775
sqlite3_int64 mtime;
756776
undo_save(zFile);
757777
if( file_wd_size(zFull)>=0 && (isLink || file_wd_islink(zFull)) ){
758778
file_delete(zFull);
@@ -765,18 +785,17 @@
765785
file_wd_setexe(zFull, isExe);
766786
fossil_print("REVERTED: %s\n", zFile);
767787
mtime = file_wd_mtime(zFull);
768788
db_multi_exec(
769789
"UPDATE vfile"
770
- " SET mtime=%lld, chnged=0, deleted=0, isexe=%d, islink=%d,mrid=rid,"
771
- " pathname=coalesce(origname,pathname), origname=NULL"
772
- " WHERE pathname=%Q",
773
- mtime, isExe, isLink, zFile
790
+ " SET mtime=%lld, chnged=0, deleted=0, isexe=%d, islink=%d,mrid=rid"
791
+ " WHERE pathname=%Q OR origname=%Q",
792
+ mtime, isExe, isLink, zFile, zFile
774793
);
775794
}
776795
blob_reset(&record);
777796
free(zFull);
778797
}
779798
db_finalize(&q);
780799
undo_finish();
781800
db_end_transaction(0);
782801
}
783802
--- src/update.c
+++ src/update.c
@@ -667,10 +667,13 @@
667 ** Usage: %fossil revert ?-r REVISION? ?FILE ...?
668 **
669 ** Revert to the current repository version of FILE, or to
670 ** the version associated with baseline REVISION if the -r flag
671 ** appears.
 
 
 
672 **
673 ** Revert all files if no file name is provided.
674 **
675 ** If a file is reverted accidently, it can be restored using
676 ** the "fossil undo" command.
@@ -706,11 +709,22 @@
706 if( g.argc>2 ){
707 for(i=2; i<g.argc; i++){
708 Blob fname;
709 zFile = mprintf("%/", g.argv[i]);
710 file_tree_name(zFile, &fname, 1);
711 db_multi_exec("REPLACE INTO torevert VALUES(%B)", &fname);
 
 
 
 
 
 
 
 
 
 
 
712 blob_reset(&fname);
713 }
714 }else{
715 int vid;
716 vid = db_lget_int("checkout", 0);
@@ -748,11 +762,17 @@
748 }else{
749 undo_save(zFile);
750 file_delete(zFull);
751 fossil_print("DELETE: %s\n", zFile);
752 }
753 db_multi_exec("DELETE FROM vfile WHERE pathname=%Q", zFile);
 
 
 
 
 
 
754 }else{
755 sqlite3_int64 mtime;
756 undo_save(zFile);
757 if( file_wd_size(zFull)>=0 && (isLink || file_wd_islink(zFull)) ){
758 file_delete(zFull);
@@ -765,18 +785,17 @@
765 file_wd_setexe(zFull, isExe);
766 fossil_print("REVERTED: %s\n", zFile);
767 mtime = file_wd_mtime(zFull);
768 db_multi_exec(
769 "UPDATE vfile"
770 " SET mtime=%lld, chnged=0, deleted=0, isexe=%d, islink=%d,mrid=rid,"
771 " pathname=coalesce(origname,pathname), origname=NULL"
772 " WHERE pathname=%Q",
773 mtime, isExe, isLink, zFile
774 );
775 }
776 blob_reset(&record);
777 free(zFull);
778 }
779 db_finalize(&q);
780 undo_finish();
781 db_end_transaction(0);
782 }
783
--- src/update.c
+++ src/update.c
@@ -667,10 +667,13 @@
667 ** Usage: %fossil revert ?-r REVISION? ?FILE ...?
668 **
669 ** Revert to the current repository version of FILE, or to
670 ** the version associated with baseline REVISION if the -r flag
671 ** appears.
672 **
673 ** If FILE was part of a rename operation, both the original file
674 ** and the renamed file are reverted.
675 **
676 ** Revert all files if no file name is provided.
677 **
678 ** If a file is reverted accidently, it can be restored using
679 ** the "fossil undo" command.
@@ -706,11 +709,22 @@
709 if( g.argc>2 ){
710 for(i=2; i<g.argc; i++){
711 Blob fname;
712 zFile = mprintf("%/", g.argv[i]);
713 file_tree_name(zFile, &fname, 1);
714 db_multi_exec(
715 "REPLACE INTO torevert VALUES(%B);"
716 "INSERT OR IGNORE INTO torevert"
717 " SELECT pathname"
718 " FROM vfile"
719 " WHERE origname IN(%B)"
720 " UNION ALL"
721 " SELECT origname"
722 " FROM vfile"
723 " WHERE pathname IN(%B) AND origname IS NOT NULL;",
724 &fname, &fname, &fname
725 );
726 blob_reset(&fname);
727 }
728 }else{
729 int vid;
730 vid = db_lget_int("checkout", 0);
@@ -748,11 +762,17 @@
762 }else{
763 undo_save(zFile);
764 file_delete(zFull);
765 fossil_print("DELETE: %s\n", zFile);
766 }
767 db_multi_exec(
768 "UPDATE vfile"
769 " SET pathname=origname, origname=NULL"
770 " WHERE pathname=%Q AND origname!=pathname AND origname IS NOT NULL;"
771 "DELETE FROM vfile WHERE pathname=%Q",
772 zFile, zFile
773 );
774 }else{
775 sqlite3_int64 mtime;
776 undo_save(zFile);
777 if( file_wd_size(zFull)>=0 && (isLink || file_wd_islink(zFull)) ){
778 file_delete(zFull);
@@ -765,18 +785,17 @@
785 file_wd_setexe(zFull, isExe);
786 fossil_print("REVERTED: %s\n", zFile);
787 mtime = file_wd_mtime(zFull);
788 db_multi_exec(
789 "UPDATE vfile"
790 " SET mtime=%lld, chnged=0, deleted=0, isexe=%d, islink=%d,mrid=rid"
791 " WHERE pathname=%Q OR origname=%Q",
792 mtime, isExe, isLink, zFile, zFile
 
793 );
794 }
795 blob_reset(&record);
796 free(zFull);
797 }
798 db_finalize(&q);
799 undo_finish();
800 db_end_transaction(0);
801 }
802
+10 -1
--- src/url.c
+++ src/url.c
@@ -63,10 +63,11 @@
6363
|| strncmp(zUrl, "ssh://", 6)==0
6464
){
6565
int iStart;
6666
char *zLogin;
6767
char *zExe;
68
+ char cQuerySep = '?';
6869
6970
g.urlIsFile = 0;
7071
if( zUrl[4]=='s' ){
7172
g.urlIsHttps = 1;
7273
g.urlProtocol = "https";
@@ -75,10 +76,11 @@
7576
}else if( zUrl[0]=='s' ){
7677
g.urlIsSsh = 1;
7778
g.urlProtocol = "ssh";
7879
g.urlDfltPort = 22;
7980
g.urlFossil = "fossil";
81
+ g.urlShell = 0;
8082
iStart = 6;
8183
}else{
8284
g.urlIsHttps = 0;
8385
g.urlProtocol = "http";
8486
g.urlDfltPort = 80;
@@ -144,11 +146,18 @@
144146
i++;
145147
}
146148
if( fossil_strcmp(zName,"fossil")==0 ){
147149
g.urlFossil = zValue;
148150
dehttpize(g.urlFossil);
149
- zExe = mprintf("?fossil=%T", g.urlFossil);
151
+ zExe = mprintf("%cfossil=%T", cQuerySep, g.urlFossil);
152
+ cQuerySep = '&';
153
+ }
154
+ if( fossil_strcmp(zName,"shell")==0 ){
155
+ g.urlShell = zValue;
156
+ dehttpize(g.urlShell);
157
+ zExe = mprintf("%cshell=%T", cQuerySep, g.urlFossil);
158
+ cQuerySep = '&';
150159
}
151160
}
152161
153162
dehttpize(g.urlPath);
154163
if( g.urlDfltPort==g.urlPort ){
155164
--- src/url.c
+++ src/url.c
@@ -63,10 +63,11 @@
63 || strncmp(zUrl, "ssh://", 6)==0
64 ){
65 int iStart;
66 char *zLogin;
67 char *zExe;
 
68
69 g.urlIsFile = 0;
70 if( zUrl[4]=='s' ){
71 g.urlIsHttps = 1;
72 g.urlProtocol = "https";
@@ -75,10 +76,11 @@
75 }else if( zUrl[0]=='s' ){
76 g.urlIsSsh = 1;
77 g.urlProtocol = "ssh";
78 g.urlDfltPort = 22;
79 g.urlFossil = "fossil";
 
80 iStart = 6;
81 }else{
82 g.urlIsHttps = 0;
83 g.urlProtocol = "http";
84 g.urlDfltPort = 80;
@@ -144,11 +146,18 @@
144 i++;
145 }
146 if( fossil_strcmp(zName,"fossil")==0 ){
147 g.urlFossil = zValue;
148 dehttpize(g.urlFossil);
149 zExe = mprintf("?fossil=%T", g.urlFossil);
 
 
 
 
 
 
 
150 }
151 }
152
153 dehttpize(g.urlPath);
154 if( g.urlDfltPort==g.urlPort ){
155
--- src/url.c
+++ src/url.c
@@ -63,10 +63,11 @@
63 || strncmp(zUrl, "ssh://", 6)==0
64 ){
65 int iStart;
66 char *zLogin;
67 char *zExe;
68 char cQuerySep = '?';
69
70 g.urlIsFile = 0;
71 if( zUrl[4]=='s' ){
72 g.urlIsHttps = 1;
73 g.urlProtocol = "https";
@@ -75,10 +76,11 @@
76 }else if( zUrl[0]=='s' ){
77 g.urlIsSsh = 1;
78 g.urlProtocol = "ssh";
79 g.urlDfltPort = 22;
80 g.urlFossil = "fossil";
81 g.urlShell = 0;
82 iStart = 6;
83 }else{
84 g.urlIsHttps = 0;
85 g.urlProtocol = "http";
86 g.urlDfltPort = 80;
@@ -144,11 +146,18 @@
146 i++;
147 }
148 if( fossil_strcmp(zName,"fossil")==0 ){
149 g.urlFossil = zValue;
150 dehttpize(g.urlFossil);
151 zExe = mprintf("%cfossil=%T", cQuerySep, g.urlFossil);
152 cQuerySep = '&';
153 }
154 if( fossil_strcmp(zName,"shell")==0 ){
155 g.urlShell = zValue;
156 dehttpize(g.urlShell);
157 zExe = mprintf("%cshell=%T", cQuerySep, g.urlFossil);
158 cQuerySep = '&';
159 }
160 }
161
162 dehttpize(g.urlPath);
163 if( g.urlDfltPort==g.urlPort ){
164
+19 -3
--- src/xfer.c
+++ src/xfer.c
@@ -18,10 +18,18 @@
1818
** This file contains code to implement the file transfer protocol.
1919
*/
2020
#include "config.h"
2121
#include "xfer.h"
2222
23
+#include <time.h>
24
+
25
+/*
26
+** Maximum number of HTTP redirects that any http_exchange() call will
27
+** follow before throwing a fatal error. Most browsers use a limit of 20.
28
+*/
29
+#define MAX_REDIRECTS 20
30
+
2331
/*
2432
** This structure holds information about the current state of either
2533
** a client or a server that is participating in xfer.
2634
*/
2735
typedef struct Xfer Xfer;
@@ -40,10 +48,11 @@
4048
int nDeltaRcvd; /* Number of deltas received */
4149
int nDanglingFile; /* Number of dangling deltas received */
4250
int mxSend; /* Stop sending "file" with pOut reaches this size */
4351
u8 syncPrivate; /* True to enable syncing private content */
4452
u8 nextIsPrivate; /* If true, next "file" received is a private */
53
+ time_t maxTime; /* Time when this transfer should be finished */
4554
};
4655
4756
4857
/*
4958
** The input blob contains a UUID. Convert it into a record ID.
@@ -393,11 +402,12 @@
393402
}
394403
if( uuid_is_shunned(blob_str(pUuid)) ){
395404
blob_reset(&uuid);
396405
return;
397406
}
398
- if( pXfer->mxSend<=blob_size(pXfer->pOut) ){
407
+ if( (pXfer->maxTime != -1 && time(NULL) >= pXfer->maxTime) ||
408
+ pXfer->mxSend<=blob_size(pXfer->pOut) ){
399409
const char *zFormat = isPriv ? "igot %b 1\n" : "igot %b\n";
400410
blob_appendf(pXfer->pOut, zFormat, pUuid);
401411
pXfer->nIGotSent++;
402412
blob_reset(&uuid);
403413
return;
@@ -867,10 +877,13 @@
867877
}
868878
blob_zero(&xfer.err);
869879
xfer.pIn = &g.cgiIn;
870880
xfer.pOut = cgi_output_blob();
871881
xfer.mxSend = db_get_int("max-download", 5000000);
882
+ xfer.maxTime = db_get_int("max-download-time", 30);
883
+ if( xfer.maxTime<1 ) xfer.maxTime = 1;
884
+ xfer.maxTime += time(NULL);
872885
g.xferPanic = 1;
873886
874887
db_begin_transaction();
875888
db_multi_exec(
876889
"CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);"
@@ -1034,11 +1047,12 @@
10341047
if( iVers>=3 ){
10351048
cgi_set_content_type("application/x-fossil-uncompressed");
10361049
}
10371050
blob_is_int(&xfer.aToken[2], &seqno);
10381051
max = db_int(0, "SELECT max(rid) FROM blob");
1039
- while( xfer.mxSend>blob_size(xfer.pOut) && seqno<=max ){
1052
+ while( xfer.mxSend>blob_size(xfer.pOut) && seqno<=max){
1053
+ if( time(NULL) >= xfer.maxTime ) break;
10401054
if( iVers>=3 ){
10411055
send_compressed_file(&xfer, seqno);
10421056
}else{
10431057
send_file(&xfer, seqno, 0, 1);
10441058
}
@@ -1328,10 +1342,11 @@
13281342
socket_global_init();
13291343
memset(&xfer, 0, sizeof(xfer));
13301344
xfer.pIn = &recv;
13311345
xfer.pOut = &send;
13321346
xfer.mxSend = db_get_int("max-upload", 250000);
1347
+ xfer.maxTime = -1;
13331348
if( syncFlags & SYNC_PRIVATE ){
13341349
g.perm.Private = 1;
13351350
xfer.syncPrivate = 1;
13361351
}
13371352
@@ -1471,11 +1486,12 @@
14711486
xfer.nIGotSent = 0;
14721487
if( syncFlags & SYNC_VERBOSE ){
14731488
fossil_print("waiting for server...");
14741489
}
14751490
fflush(stdout);
1476
- if( http_exchange(&send, &recv, (syncFlags & SYNC_CLONE)==0 || nCycle>0) ){
1491
+ if( http_exchange(&send, &recv, (syncFlags & SYNC_CLONE)==0 || nCycle>0,
1492
+ MAX_REDIRECTS) ){
14771493
nErr++;
14781494
break;
14791495
}
14801496
lastPctDone = -1;
14811497
blob_reset(&send);
14821498
14831499
ADDED test/revert.test
--- src/xfer.c
+++ src/xfer.c
@@ -18,10 +18,18 @@
18 ** This file contains code to implement the file transfer protocol.
19 */
20 #include "config.h"
21 #include "xfer.h"
22
 
 
 
 
 
 
 
 
23 /*
24 ** This structure holds information about the current state of either
25 ** a client or a server that is participating in xfer.
26 */
27 typedef struct Xfer Xfer;
@@ -40,10 +48,11 @@
40 int nDeltaRcvd; /* Number of deltas received */
41 int nDanglingFile; /* Number of dangling deltas received */
42 int mxSend; /* Stop sending "file" with pOut reaches this size */
43 u8 syncPrivate; /* True to enable syncing private content */
44 u8 nextIsPrivate; /* If true, next "file" received is a private */
 
45 };
46
47
48 /*
49 ** The input blob contains a UUID. Convert it into a record ID.
@@ -393,11 +402,12 @@
393 }
394 if( uuid_is_shunned(blob_str(pUuid)) ){
395 blob_reset(&uuid);
396 return;
397 }
398 if( pXfer->mxSend<=blob_size(pXfer->pOut) ){
 
399 const char *zFormat = isPriv ? "igot %b 1\n" : "igot %b\n";
400 blob_appendf(pXfer->pOut, zFormat, pUuid);
401 pXfer->nIGotSent++;
402 blob_reset(&uuid);
403 return;
@@ -867,10 +877,13 @@
867 }
868 blob_zero(&xfer.err);
869 xfer.pIn = &g.cgiIn;
870 xfer.pOut = cgi_output_blob();
871 xfer.mxSend = db_get_int("max-download", 5000000);
 
 
 
872 g.xferPanic = 1;
873
874 db_begin_transaction();
875 db_multi_exec(
876 "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);"
@@ -1034,11 +1047,12 @@
1034 if( iVers>=3 ){
1035 cgi_set_content_type("application/x-fossil-uncompressed");
1036 }
1037 blob_is_int(&xfer.aToken[2], &seqno);
1038 max = db_int(0, "SELECT max(rid) FROM blob");
1039 while( xfer.mxSend>blob_size(xfer.pOut) && seqno<=max ){
 
1040 if( iVers>=3 ){
1041 send_compressed_file(&xfer, seqno);
1042 }else{
1043 send_file(&xfer, seqno, 0, 1);
1044 }
@@ -1328,10 +1342,11 @@
1328 socket_global_init();
1329 memset(&xfer, 0, sizeof(xfer));
1330 xfer.pIn = &recv;
1331 xfer.pOut = &send;
1332 xfer.mxSend = db_get_int("max-upload", 250000);
 
1333 if( syncFlags & SYNC_PRIVATE ){
1334 g.perm.Private = 1;
1335 xfer.syncPrivate = 1;
1336 }
1337
@@ -1471,11 +1486,12 @@
1471 xfer.nIGotSent = 0;
1472 if( syncFlags & SYNC_VERBOSE ){
1473 fossil_print("waiting for server...");
1474 }
1475 fflush(stdout);
1476 if( http_exchange(&send, &recv, (syncFlags & SYNC_CLONE)==0 || nCycle>0) ){
 
1477 nErr++;
1478 break;
1479 }
1480 lastPctDone = -1;
1481 blob_reset(&send);
1482
1483 DDED test/revert.test
--- src/xfer.c
+++ src/xfer.c
@@ -18,10 +18,18 @@
18 ** This file contains code to implement the file transfer protocol.
19 */
20 #include "config.h"
21 #include "xfer.h"
22
23 #include <time.h>
24
25 /*
26 ** Maximum number of HTTP redirects that any http_exchange() call will
27 ** follow before throwing a fatal error. Most browsers use a limit of 20.
28 */
29 #define MAX_REDIRECTS 20
30
31 /*
32 ** This structure holds information about the current state of either
33 ** a client or a server that is participating in xfer.
34 */
35 typedef struct Xfer Xfer;
@@ -40,10 +48,11 @@
48 int nDeltaRcvd; /* Number of deltas received */
49 int nDanglingFile; /* Number of dangling deltas received */
50 int mxSend; /* Stop sending "file" with pOut reaches this size */
51 u8 syncPrivate; /* True to enable syncing private content */
52 u8 nextIsPrivate; /* If true, next "file" received is a private */
53 time_t maxTime; /* Time when this transfer should be finished */
54 };
55
56
57 /*
58 ** The input blob contains a UUID. Convert it into a record ID.
@@ -393,11 +402,12 @@
402 }
403 if( uuid_is_shunned(blob_str(pUuid)) ){
404 blob_reset(&uuid);
405 return;
406 }
407 if( (pXfer->maxTime != -1 && time(NULL) >= pXfer->maxTime) ||
408 pXfer->mxSend<=blob_size(pXfer->pOut) ){
409 const char *zFormat = isPriv ? "igot %b 1\n" : "igot %b\n";
410 blob_appendf(pXfer->pOut, zFormat, pUuid);
411 pXfer->nIGotSent++;
412 blob_reset(&uuid);
413 return;
@@ -867,10 +877,13 @@
877 }
878 blob_zero(&xfer.err);
879 xfer.pIn = &g.cgiIn;
880 xfer.pOut = cgi_output_blob();
881 xfer.mxSend = db_get_int("max-download", 5000000);
882 xfer.maxTime = db_get_int("max-download-time", 30);
883 if( xfer.maxTime<1 ) xfer.maxTime = 1;
884 xfer.maxTime += time(NULL);
885 g.xferPanic = 1;
886
887 db_begin_transaction();
888 db_multi_exec(
889 "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);"
@@ -1034,11 +1047,12 @@
1047 if( iVers>=3 ){
1048 cgi_set_content_type("application/x-fossil-uncompressed");
1049 }
1050 blob_is_int(&xfer.aToken[2], &seqno);
1051 max = db_int(0, "SELECT max(rid) FROM blob");
1052 while( xfer.mxSend>blob_size(xfer.pOut) && seqno<=max){
1053 if( time(NULL) >= xfer.maxTime ) break;
1054 if( iVers>=3 ){
1055 send_compressed_file(&xfer, seqno);
1056 }else{
1057 send_file(&xfer, seqno, 0, 1);
1058 }
@@ -1328,10 +1342,11 @@
1342 socket_global_init();
1343 memset(&xfer, 0, sizeof(xfer));
1344 xfer.pIn = &recv;
1345 xfer.pOut = &send;
1346 xfer.mxSend = db_get_int("max-upload", 250000);
1347 xfer.maxTime = -1;
1348 if( syncFlags & SYNC_PRIVATE ){
1349 g.perm.Private = 1;
1350 xfer.syncPrivate = 1;
1351 }
1352
@@ -1471,11 +1486,12 @@
1486 xfer.nIGotSent = 0;
1487 if( syncFlags & SYNC_VERBOSE ){
1488 fossil_print("waiting for server...");
1489 }
1490 fflush(stdout);
1491 if( http_exchange(&send, &recv, (syncFlags & SYNC_CLONE)==0 || nCycle>0,
1492 MAX_REDIRECTS) ){
1493 nErr++;
1494 break;
1495 }
1496 lastPctDone = -1;
1497 blob_reset(&send);
1498
1499 DDED test/revert.test
--- a/test/revert.test
+++ b/test/revert.test
@@ -0,0 +1,26 @@
1
+puts res=$# Fossil will write dexec rm f1po_init# Copytcatch {exec $::exec mvitory} $res]} {
2
+ puts stderr "Cannot ris test within anif {[llength $args] % 2} {
3
+ set revertArgs [lindex $args 0]
4
+ set args [lrange $args 1 end]
5
+ } else {
6
+ set revertArgs {}
7
+ }VERTED: f3
8
+ DELETE:j@Uy,1X@Se,4:: f0G@YW,21@UT,3:ED:1w@WW,3:ED:3t@YT,G:ED: f3
9
+ DELETE:K@hF,O@YG:ED: f3
10
+ DELETE:K@hF,O@Yl,1
11
+ DELETE:a@nd,1WvoIq;-testnormalize-status-list]
12
+ set r]
13
+ if {$result ne $expected} {
14
+ set passed 0
15
+ protOut " Expected:\n [join $expected "\n "]"
16
+ protOut " Got:\n [joh {exec $::fossilexe info} res
17
+if {![regexp {use --repository} $res]} {
18
+ puts stderr "Cannot run this test within an open checkout"
19
+ return
20
+}
21
+repo_init# Copytcatch {exec $::fossilexe info} res
22
+if {![regexp {use --repository} $res]} {
23
+ puts stderr "Cannot run this test witt# Copytcatch {exec $::fossilexe info} res
24
+if {![regexp {use --repository} $res]} {
25
+ put12 f03 f1 {exec $::fossilexe info}t# Copytcatch {exec $::foss4 f2 {exec $::ft# Copytcatch {exec $::foss5 f3 {exec $::fossilexe info} res
26
+if {![re
--- a/test/revert.test
+++ b/test/revert.test
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/test/revert.test
+++ b/test/revert.test
@@ -0,0 +1,26 @@
1 puts res=$# Fossil will write dexec rm f1po_init# Copytcatch {exec $::exec mvitory} $res]} {
2 puts stderr "Cannot ris test within anif {[llength $args] % 2} {
3 set revertArgs [lindex $args 0]
4 set args [lrange $args 1 end]
5 } else {
6 set revertArgs {}
7 }VERTED: f3
8 DELETE:j@Uy,1X@Se,4:: f0G@YW,21@UT,3:ED:1w@WW,3:ED:3t@YT,G:ED: f3
9 DELETE:K@hF,O@YG:ED: f3
10 DELETE:K@hF,O@Yl,1
11 DELETE:a@nd,1WvoIq;-testnormalize-status-list]
12 set r]
13 if {$result ne $expected} {
14 set passed 0
15 protOut " Expected:\n [join $expected "\n "]"
16 protOut " Got:\n [joh {exec $::fossilexe info} res
17 if {![regexp {use --repository} $res]} {
18 puts stderr "Cannot run this test within an open checkout"
19 return
20 }
21 repo_init# Copytcatch {exec $::fossilexe info} res
22 if {![regexp {use --repository} $res]} {
23 puts stderr "Cannot run this test witt# Copytcatch {exec $::fossilexe info} res
24 if {![regexp {use --repository} $res]} {
25 put12 f03 f1 {exec $::fossilexe info}t# Copytcatch {exec $::foss4 f2 {exec $::ft# Copytcatch {exec $::foss5 f3 {exec $::fossilexe info} res
26 if {![re
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -6,15 +6,15 @@
66
#
77
# This file is automatically generated. Instead of editing this
88
# file, edit "makemake.tcl" then run "tclsh makemake.tcl"
99
# to regenerate this file.
1010
#
11
-# This is a makefile for use on Windows/Linux/Darwin/Cygwin using MinGW or
12
-# MinGW-w64.
11
+# This is a makefile for use on Cygwin/Darwin/FreeBSD/Linux/Windows using
12
+# MinGW or MinGW-w64.
1313
#
1414
15
-#### Select one of MinGW, MinGW-64 (32-bit) or MinGW-w64 (64-bit) compilers.
15
+#### Select one of MinGW, MinGW-w64 (32-bit) or MinGW-w64 (64-bit) compilers.
1616
# By default, this is an empty string (i.e. use the native compiler).
1717
#
1818
PREFIX =
1919
# PREFIX = mingw32-
2020
# PREFIX = i686-pc-mingw32-
@@ -657,11 +657,11 @@
657657
ifdef FOSSIL_ENABLE_TCL
658658
EXTRAOBJ += $(OBJDIR)/th_tcl.o
659659
endif
660660
661661
zlib:
662
- make -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
662
+ $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
663663
664664
$(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib
665665
$(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o
666666
667667
# This rule prevents make from using its default rules to try build
@@ -1633,11 +1633,11 @@
16331633
16341634
$(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c
16351635
$(XTCC) -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_STAT3 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o
16361636
16371637
$(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c
1638
- $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE
1638
+ $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o
16391639
16401640
$(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_dir.o $(OBJDIR)/jsos_finfo.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h
16411641
16421642
$(OBJDIR)/shell.o: $(SRCDIR)/shell.c $(SRCDIR)/sqlite3.h
16431643
$(XTCC) -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -c $(SRCDIR)/shell.c -o $(OBJDIR)/shell.o
16441644
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -6,15 +6,15 @@
6 #
7 # This file is automatically generated. Instead of editing this
8 # file, edit "makemake.tcl" then run "tclsh makemake.tcl"
9 # to regenerate this file.
10 #
11 # This is a makefile for use on Windows/Linux/Darwin/Cygwin using MinGW or
12 # MinGW-w64.
13 #
14
15 #### Select one of MinGW, MinGW-64 (32-bit) or MinGW-w64 (64-bit) compilers.
16 # By default, this is an empty string (i.e. use the native compiler).
17 #
18 PREFIX =
19 # PREFIX = mingw32-
20 # PREFIX = i686-pc-mingw32-
@@ -657,11 +657,11 @@
657 ifdef FOSSIL_ENABLE_TCL
658 EXTRAOBJ += $(OBJDIR)/th_tcl.o
659 endif
660
661 zlib:
662 make -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
663
664 $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib
665 $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o
666
667 # This rule prevents make from using its default rules to try build
@@ -1633,11 +1633,11 @@
1633
1634 $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c
1635 $(XTCC) -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_STAT3 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o
1636
1637 $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c
1638 $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE
1639
1640 $(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_dir.o $(OBJDIR)/jsos_finfo.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h
1641
1642 $(OBJDIR)/shell.o: $(SRCDIR)/shell.c $(SRCDIR)/sqlite3.h
1643 $(XTCC) -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -c $(SRCDIR)/shell.c -o $(OBJDIR)/shell.o
1644
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -6,15 +6,15 @@
6 #
7 # This file is automatically generated. Instead of editing this
8 # file, edit "makemake.tcl" then run "tclsh makemake.tcl"
9 # to regenerate this file.
10 #
11 # This is a makefile for use on Cygwin/Darwin/FreeBSD/Linux/Windows using
12 # MinGW or MinGW-w64.
13 #
14
15 #### Select one of MinGW, MinGW-w64 (32-bit) or MinGW-w64 (64-bit) compilers.
16 # By default, this is an empty string (i.e. use the native compiler).
17 #
18 PREFIX =
19 # PREFIX = mingw32-
20 # PREFIX = i686-pc-mingw32-
@@ -657,11 +657,11 @@
657 ifdef FOSSIL_ENABLE_TCL
658 EXTRAOBJ += $(OBJDIR)/th_tcl.o
659 endif
660
661 zlib:
662 $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
663
664 $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib
665 $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o
666
667 # This rule prevents make from using its default rules to try build
@@ -1633,11 +1633,11 @@
1633
1634 $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c
1635 $(XTCC) -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_STAT3 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o
1636
1637 $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c
1638 $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o
1639
1640 $(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_dir.o $(OBJDIR)/jsos_finfo.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h
1641
1642 $(OBJDIR)/shell.o: $(SRCDIR)/shell.c $(SRCDIR)/sqlite3.h
1643 $(XTCC) -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -c $(SRCDIR)/shell.c -o $(OBJDIR)/shell.o
1644
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -6,15 +6,15 @@
66
#
77
# This file is automatically generated. Instead of editing this
88
# file, edit "makemake.tcl" then run "tclsh makemake.tcl"
99
# to regenerate this file.
1010
#
11
-# This is a makefile for use on Windows/Linux/Darwin/Cygwin using MinGW or
12
-# MinGW-w64.
11
+# This is a makefile for use on Cygwin/Darwin/FreeBSD/Linux/Windows using
12
+# MinGW or MinGW-w64.
1313
#
1414
15
-#### Select one of MinGW, MinGW-64 (32-bit) or MinGW-w64 (64-bit) compilers.
15
+#### Select one of MinGW, MinGW-w64 (32-bit) or MinGW-w64 (64-bit) compilers.
1616
# By default, this is an empty string (i.e. use the native compiler).
1717
#
1818
PREFIX =
1919
# PREFIX = mingw32-
2020
# PREFIX = i686-pc-mingw32-
@@ -657,11 +657,11 @@
657657
ifdef FOSSIL_ENABLE_TCL
658658
EXTRAOBJ += $(OBJDIR)/th_tcl.o
659659
endif
660660
661661
zlib:
662
- make -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
662
+ $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
663663
664664
$(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib
665665
$(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o
666666
667667
# This rule prevents make from using its default rules to try build
@@ -1633,11 +1633,11 @@
16331633
16341634
$(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c
16351635
$(XTCC) -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_STAT3 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o
16361636
16371637
$(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c
1638
- $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE
1638
+ $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o
16391639
16401640
$(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_dir.o $(OBJDIR)/jsos_finfo.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h
16411641
16421642
$(OBJDIR)/shell.o: $(SRCDIR)/shell.c $(SRCDIR)/sqlite3.h
16431643
$(XTCC) -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -c $(SRCDIR)/shell.c -o $(OBJDIR)/shell.o
16441644
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -6,15 +6,15 @@
6 #
7 # This file is automatically generated. Instead of editing this
8 # file, edit "makemake.tcl" then run "tclsh makemake.tcl"
9 # to regenerate this file.
10 #
11 # This is a makefile for use on Windows/Linux/Darwin/Cygwin using MinGW or
12 # MinGW-w64.
13 #
14
15 #### Select one of MinGW, MinGW-64 (32-bit) or MinGW-w64 (64-bit) compilers.
16 # By default, this is an empty string (i.e. use the native compiler).
17 #
18 PREFIX =
19 # PREFIX = mingw32-
20 # PREFIX = i686-pc-mingw32-
@@ -657,11 +657,11 @@
657 ifdef FOSSIL_ENABLE_TCL
658 EXTRAOBJ += $(OBJDIR)/th_tcl.o
659 endif
660
661 zlib:
662 make -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
663
664 $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib
665 $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o
666
667 # This rule prevents make from using its default rules to try build
@@ -1633,11 +1633,11 @@
1633
1634 $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c
1635 $(XTCC) -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_STAT3 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o
1636
1637 $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c
1638 $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE
1639
1640 $(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_dir.o $(OBJDIR)/jsos_finfo.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h
1641
1642 $(OBJDIR)/shell.o: $(SRCDIR)/shell.c $(SRCDIR)/sqlite3.h
1643 $(XTCC) -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -c $(SRCDIR)/shell.c -o $(OBJDIR)/shell.o
1644
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -6,15 +6,15 @@
6 #
7 # This file is automatically generated. Instead of editing this
8 # file, edit "makemake.tcl" then run "tclsh makemake.tcl"
9 # to regenerate this file.
10 #
11 # This is a makefile for use on Cygwin/Darwin/FreeBSD/Linux/Windows using
12 # MinGW or MinGW-w64.
13 #
14
15 #### Select one of MinGW, MinGW-w64 (32-bit) or MinGW-w64 (64-bit) compilers.
16 # By default, this is an empty string (i.e. use the native compiler).
17 #
18 PREFIX =
19 # PREFIX = mingw32-
20 # PREFIX = i686-pc-mingw32-
@@ -657,11 +657,11 @@
657 ifdef FOSSIL_ENABLE_TCL
658 EXTRAOBJ += $(OBJDIR)/th_tcl.o
659 endif
660
661 zlib:
662 $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
663
664 $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib
665 $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o
666
667 # This rule prevents make from using its default rules to try build
@@ -1633,11 +1633,11 @@
1633
1634 $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c
1635 $(XTCC) -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_STAT3 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o
1636
1637 $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c
1638 $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o
1639
1640 $(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_dir.o $(OBJDIR)/jsos_finfo.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h
1641
1642 $(OBJDIR)/shell.o: $(SRCDIR)/shell.c $(SRCDIR)/sqlite3.h
1643 $(XTCC) -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -c $(SRCDIR)/shell.c -o $(OBJDIR)/shell.o
1644
+30 -7
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -22,18 +22,35 @@
2222
2323
# zlib options
2424
ZINCDIR = $(B)\compat\zlib
2525
ZLIBDIR = $(B)\compat\zlib
2626
ZLIB = zlib.lib
27
+
28
+# Uncomment to enable JSON API
29
+# FOSSIL_ENABLE_JSON = 1
30
+
31
+# Uncomment to enable markdown support
32
+# FOSSIL_ENABLE_MARKDOWN = 1
2733
2834
INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR)
2935
3036
CFLAGS = -nologo -MT -O2
3137
BCC = $(CC) $(CFLAGS)
3238
TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL)
39
+RCC = rc -D_WIN32 -D_MSC_VER $(INCL)
3340
LIBS = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB)
3441
LIBDIR = -LIBPATH:$(ZLIBDIR)
42
+
43
+!ifdef FOSSIL_ENABLE_JSON
44
+TCC = $(TCC) -DFOSSIL_ENABLE_JSON
45
+RCC = $(RCC) -DFOSSIL_ENABLE_JSON
46
+!endif
47
+
48
+!ifdef FOSSIL_ENABLE_MARKDOWN
49
+TCC = $(TCC) -DFOSSIL_ENABLE_MARKDOWN
50
+RCC = $(RCC) -DFOSSIL_ENABLE_MARKDOWN
51
+!endif
3552
3653
SQLITE_OPTIONS = /DSQLITE_OMIT_LOAD_EXTENSION=1 \
3754
/DSQLITE_THREADSAFE=0 \
3855
/DSQLITE_DEFAULT_FILE_FORMAT=4 \
3956
/DSQLITE_ENABLE_STAT3 \
@@ -160,10 +177,11 @@
160177
$(OX)\clearsign$O \
161178
$(OX)\clone$O \
162179
$(OX)\comformat$O \
163180
$(OX)\configure$O \
164181
$(OX)\content$O \
182
+ $(OX)\cson_amalgamation$O \
165183
$(OX)\db$O \
166184
$(OX)\delta$O \
167185
$(OX)\deltacmd$O \
168186
$(OX)\descendants$O \
169187
$(OX)\diff$O \
@@ -219,19 +237,23 @@
219237
$(OX)\rss$O \
220238
$(OX)\schema$O \
221239
$(OX)\search$O \
222240
$(OX)\setup$O \
223241
$(OX)\sha1$O \
242
+ $(OX)\shell$O \
224243
$(OX)\shun$O \
225244
$(OX)\skins$O \
226245
$(OX)\sqlcmd$O \
246
+ $(OX)\sqlite3$O \
227247
$(OX)\stash$O \
228248
$(OX)\stat$O \
229249
$(OX)\style$O \
230250
$(OX)\sync$O \
231251
$(OX)\tag$O \
232252
$(OX)\tar$O \
253
+ $(OX)\th$O \
254
+ $(OX)\th_lang$O \
233255
$(OX)\th_main$O \
234256
$(OX)\timeline$O \
235257
$(OX)\tkt$O \
236258
$(OX)\tktsetup$O \
237259
$(OX)\undo$O \
@@ -247,14 +269,11 @@
247269
$(OX)\winhttp$O \
248270
$(OX)\wysiwyg$O \
249271
$(OX)\xfer$O \
250272
$(OX)\xfersetup$O \
251273
$(OX)\zip$O \
252
- $(OX)\shell$O \
253
- $(OX)\sqlite3$O \
254
- $(OX)\th$O \
255
- $(OX)\th_lang$O
274
+ $(OX)\fossil.res
256275
257276
APPNAME = $(OX)\fossil$(E)
258277
259278
all: $(OX) $(APPNAME)
260279
@@ -262,11 +281,11 @@
262281
@echo Building zlib from "$(ZLIBDIR)"...
263282
@pushd "$(ZLIBDIR)" && nmake /f win32\Makefile.msc $(ZLIB) && popd
264283
265284
$(APPNAME) : translate$E mkindex$E headers $(OBJ) $(OX)\linkopts zlib
266285
cd $(OX)
267
- link /NODEFAULTLIB:msvcrt -OUT:$@ $(LIBDIR) Wsetargv.obj @linkopts
286
+ link /NODEFAULTLIB:msvcrt -OUT:$@ $(LIBDIR) Wsetargv.obj fossil.res @linkopts
268287
269288
$(OX)\linkopts: $B\win\Makefile.msc
270289
echo $(OX)\add.obj > $@
271290
echo $(OX)\allrepo.obj >> $@
272291
echo $(OX)\attach.obj >> $@
@@ -282,10 +301,11 @@
282301
echo $(OX)\clearsign.obj >> $@
283302
echo $(OX)\clone.obj >> $@
284303
echo $(OX)\comformat.obj >> $@
285304
echo $(OX)\configure.obj >> $@
286305
echo $(OX)\content.obj >> $@
306
+ echo $(OX)\cson_amalgamation.obj >> $@
287307
echo $(OX)\db.obj >> $@
288308
echo $(OX)\delta.obj >> $@
289309
echo $(OX)\deltacmd.obj >> $@
290310
echo $(OX)\descendants.obj >> $@
291311
echo $(OX)\diff.obj >> $@
@@ -407,12 +427,12 @@
407427
$(OX)\th_lang$O : $(SRCDIR)\th_lang.c
408428
$(TCC) /Fo$@ -c $**
409429
410430
VERSION.h : mkversion$E $B\manifest.uuid $B\manifest $B\VERSION
411431
$** > $@
412
-$(OBJDIR)\cson_amalgamation.h : $(SRCDIR)\cson_amalgamation.h
413
- cp $(SRCDIR)\cson_amalgamation.h $@
432
+$(OX)\cson_amalgamation$O : $(SRCDIR)\cson_amalgamation.c
433
+ $(TCC) /Fo$@ -c $**
414434
415435
page_index.h: mkindex$E $(SRC)
416436
$** > $@
417437
418438
clean:
@@ -422,10 +442,11 @@
422442
-del *.h
423443
-del *.map
424444
-del *.manifest
425445
-del headers
426446
-del linkopts
447
+ -del *.res
427448
428449
realclean: clean
429450
-del $(APPNAME)
430451
-del translate$E
431452
-del mkindex$E
@@ -1070,10 +1091,12 @@
10701091
$(TCC) /Fo$@ -c zip_.c
10711092
10721093
zip_.c : $(SRCDIR)\zip.c
10731094
translate$E $** > $@
10741095
1096
+fossil.res : $B\win\fossil.rc
1097
+ $(RCC) -fo $@ $**
10751098
headers: makeheaders$E page_index.h VERSION.h
10761099
makeheaders$E add_.c:add.h \
10771100
allrepo_.c:allrepo.h \
10781101
attach_.c:attach.h \
10791102
bag_.c:bag.h \
10801103
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -22,18 +22,35 @@
22
23 # zlib options
24 ZINCDIR = $(B)\compat\zlib
25 ZLIBDIR = $(B)\compat\zlib
26 ZLIB = zlib.lib
 
 
 
 
 
 
27
28 INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR)
29
30 CFLAGS = -nologo -MT -O2
31 BCC = $(CC) $(CFLAGS)
32 TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL)
 
33 LIBS = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB)
34 LIBDIR = -LIBPATH:$(ZLIBDIR)
 
 
 
 
 
 
 
 
 
 
35
36 SQLITE_OPTIONS = /DSQLITE_OMIT_LOAD_EXTENSION=1 \
37 /DSQLITE_THREADSAFE=0 \
38 /DSQLITE_DEFAULT_FILE_FORMAT=4 \
39 /DSQLITE_ENABLE_STAT3 \
@@ -160,10 +177,11 @@
160 $(OX)\clearsign$O \
161 $(OX)\clone$O \
162 $(OX)\comformat$O \
163 $(OX)\configure$O \
164 $(OX)\content$O \
 
165 $(OX)\db$O \
166 $(OX)\delta$O \
167 $(OX)\deltacmd$O \
168 $(OX)\descendants$O \
169 $(OX)\diff$O \
@@ -219,19 +237,23 @@
219 $(OX)\rss$O \
220 $(OX)\schema$O \
221 $(OX)\search$O \
222 $(OX)\setup$O \
223 $(OX)\sha1$O \
 
224 $(OX)\shun$O \
225 $(OX)\skins$O \
226 $(OX)\sqlcmd$O \
 
227 $(OX)\stash$O \
228 $(OX)\stat$O \
229 $(OX)\style$O \
230 $(OX)\sync$O \
231 $(OX)\tag$O \
232 $(OX)\tar$O \
 
 
233 $(OX)\th_main$O \
234 $(OX)\timeline$O \
235 $(OX)\tkt$O \
236 $(OX)\tktsetup$O \
237 $(OX)\undo$O \
@@ -247,14 +269,11 @@
247 $(OX)\winhttp$O \
248 $(OX)\wysiwyg$O \
249 $(OX)\xfer$O \
250 $(OX)\xfersetup$O \
251 $(OX)\zip$O \
252 $(OX)\shell$O \
253 $(OX)\sqlite3$O \
254 $(OX)\th$O \
255 $(OX)\th_lang$O
256
257 APPNAME = $(OX)\fossil$(E)
258
259 all: $(OX) $(APPNAME)
260
@@ -262,11 +281,11 @@
262 @echo Building zlib from "$(ZLIBDIR)"...
263 @pushd "$(ZLIBDIR)" && nmake /f win32\Makefile.msc $(ZLIB) && popd
264
265 $(APPNAME) : translate$E mkindex$E headers $(OBJ) $(OX)\linkopts zlib
266 cd $(OX)
267 link /NODEFAULTLIB:msvcrt -OUT:$@ $(LIBDIR) Wsetargv.obj @linkopts
268
269 $(OX)\linkopts: $B\win\Makefile.msc
270 echo $(OX)\add.obj > $@
271 echo $(OX)\allrepo.obj >> $@
272 echo $(OX)\attach.obj >> $@
@@ -282,10 +301,11 @@
282 echo $(OX)\clearsign.obj >> $@
283 echo $(OX)\clone.obj >> $@
284 echo $(OX)\comformat.obj >> $@
285 echo $(OX)\configure.obj >> $@
286 echo $(OX)\content.obj >> $@
 
287 echo $(OX)\db.obj >> $@
288 echo $(OX)\delta.obj >> $@
289 echo $(OX)\deltacmd.obj >> $@
290 echo $(OX)\descendants.obj >> $@
291 echo $(OX)\diff.obj >> $@
@@ -407,12 +427,12 @@
407 $(OX)\th_lang$O : $(SRCDIR)\th_lang.c
408 $(TCC) /Fo$@ -c $**
409
410 VERSION.h : mkversion$E $B\manifest.uuid $B\manifest $B\VERSION
411 $** > $@
412 $(OBJDIR)\cson_amalgamation.h : $(SRCDIR)\cson_amalgamation.h
413 cp $(SRCDIR)\cson_amalgamation.h $@
414
415 page_index.h: mkindex$E $(SRC)
416 $** > $@
417
418 clean:
@@ -422,10 +442,11 @@
422 -del *.h
423 -del *.map
424 -del *.manifest
425 -del headers
426 -del linkopts
 
427
428 realclean: clean
429 -del $(APPNAME)
430 -del translate$E
431 -del mkindex$E
@@ -1070,10 +1091,12 @@
1070 $(TCC) /Fo$@ -c zip_.c
1071
1072 zip_.c : $(SRCDIR)\zip.c
1073 translate$E $** > $@
1074
 
 
1075 headers: makeheaders$E page_index.h VERSION.h
1076 makeheaders$E add_.c:add.h \
1077 allrepo_.c:allrepo.h \
1078 attach_.c:attach.h \
1079 bag_.c:bag.h \
1080
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -22,18 +22,35 @@
22
23 # zlib options
24 ZINCDIR = $(B)\compat\zlib
25 ZLIBDIR = $(B)\compat\zlib
26 ZLIB = zlib.lib
27
28 # Uncomment to enable JSON API
29 # FOSSIL_ENABLE_JSON = 1
30
31 # Uncomment to enable markdown support
32 # FOSSIL_ENABLE_MARKDOWN = 1
33
34 INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR)
35
36 CFLAGS = -nologo -MT -O2
37 BCC = $(CC) $(CFLAGS)
38 TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL)
39 RCC = rc -D_WIN32 -D_MSC_VER $(INCL)
40 LIBS = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB)
41 LIBDIR = -LIBPATH:$(ZLIBDIR)
42
43 !ifdef FOSSIL_ENABLE_JSON
44 TCC = $(TCC) -DFOSSIL_ENABLE_JSON
45 RCC = $(RCC) -DFOSSIL_ENABLE_JSON
46 !endif
47
48 !ifdef FOSSIL_ENABLE_MARKDOWN
49 TCC = $(TCC) -DFOSSIL_ENABLE_MARKDOWN
50 RCC = $(RCC) -DFOSSIL_ENABLE_MARKDOWN
51 !endif
52
53 SQLITE_OPTIONS = /DSQLITE_OMIT_LOAD_EXTENSION=1 \
54 /DSQLITE_THREADSAFE=0 \
55 /DSQLITE_DEFAULT_FILE_FORMAT=4 \
56 /DSQLITE_ENABLE_STAT3 \
@@ -160,10 +177,11 @@
177 $(OX)\clearsign$O \
178 $(OX)\clone$O \
179 $(OX)\comformat$O \
180 $(OX)\configure$O \
181 $(OX)\content$O \
182 $(OX)\cson_amalgamation$O \
183 $(OX)\db$O \
184 $(OX)\delta$O \
185 $(OX)\deltacmd$O \
186 $(OX)\descendants$O \
187 $(OX)\diff$O \
@@ -219,19 +237,23 @@
237 $(OX)\rss$O \
238 $(OX)\schema$O \
239 $(OX)\search$O \
240 $(OX)\setup$O \
241 $(OX)\sha1$O \
242 $(OX)\shell$O \
243 $(OX)\shun$O \
244 $(OX)\skins$O \
245 $(OX)\sqlcmd$O \
246 $(OX)\sqlite3$O \
247 $(OX)\stash$O \
248 $(OX)\stat$O \
249 $(OX)\style$O \
250 $(OX)\sync$O \
251 $(OX)\tag$O \
252 $(OX)\tar$O \
253 $(OX)\th$O \
254 $(OX)\th_lang$O \
255 $(OX)\th_main$O \
256 $(OX)\timeline$O \
257 $(OX)\tkt$O \
258 $(OX)\tktsetup$O \
259 $(OX)\undo$O \
@@ -247,14 +269,11 @@
269 $(OX)\winhttp$O \
270 $(OX)\wysiwyg$O \
271 $(OX)\xfer$O \
272 $(OX)\xfersetup$O \
273 $(OX)\zip$O \
274 $(OX)\fossil.res
 
 
 
275
276 APPNAME = $(OX)\fossil$(E)
277
278 all: $(OX) $(APPNAME)
279
@@ -262,11 +281,11 @@
281 @echo Building zlib from "$(ZLIBDIR)"...
282 @pushd "$(ZLIBDIR)" && nmake /f win32\Makefile.msc $(ZLIB) && popd
283
284 $(APPNAME) : translate$E mkindex$E headers $(OBJ) $(OX)\linkopts zlib
285 cd $(OX)
286 link /NODEFAULTLIB:msvcrt -OUT:$@ $(LIBDIR) Wsetargv.obj fossil.res @linkopts
287
288 $(OX)\linkopts: $B\win\Makefile.msc
289 echo $(OX)\add.obj > $@
290 echo $(OX)\allrepo.obj >> $@
291 echo $(OX)\attach.obj >> $@
@@ -282,10 +301,11 @@
301 echo $(OX)\clearsign.obj >> $@
302 echo $(OX)\clone.obj >> $@
303 echo $(OX)\comformat.obj >> $@
304 echo $(OX)\configure.obj >> $@
305 echo $(OX)\content.obj >> $@
306 echo $(OX)\cson_amalgamation.obj >> $@
307 echo $(OX)\db.obj >> $@
308 echo $(OX)\delta.obj >> $@
309 echo $(OX)\deltacmd.obj >> $@
310 echo $(OX)\descendants.obj >> $@
311 echo $(OX)\diff.obj >> $@
@@ -407,12 +427,12 @@
427 $(OX)\th_lang$O : $(SRCDIR)\th_lang.c
428 $(TCC) /Fo$@ -c $**
429
430 VERSION.h : mkversion$E $B\manifest.uuid $B\manifest $B\VERSION
431 $** > $@
432 $(OX)\cson_amalgamation$O : $(SRCDIR)\cson_amalgamation.c
433 $(TCC) /Fo$@ -c $**
434
435 page_index.h: mkindex$E $(SRC)
436 $** > $@
437
438 clean:
@@ -422,10 +442,11 @@
442 -del *.h
443 -del *.map
444 -del *.manifest
445 -del headers
446 -del linkopts
447 -del *.res
448
449 realclean: clean
450 -del $(APPNAME)
451 -del translate$E
452 -del mkindex$E
@@ -1070,10 +1091,12 @@
1091 $(TCC) /Fo$@ -c zip_.c
1092
1093 zip_.c : $(SRCDIR)\zip.c
1094 translate$E $** > $@
1095
1096 fossil.res : $B\win\fossil.rc
1097 $(RCC) -fo $@ $**
1098 headers: makeheaders$E page_index.h VERSION.h
1099 makeheaders$E add_.c:add.h \
1100 allrepo_.c:allrepo.h \
1101 attach_.c:attach.h \
1102 bag_.c:bag.h \
1103
--- win/include/dirent.h
+++ win/include/dirent.h
@@ -866,18 +866,18 @@
866866
/* Set errno variable */
867867
static void
868868
dirent_set_errno(
869869
int error)
870870
{
871
-#if defined(_MSC_VER)
871
+#if defined(_MSC_VER) && _MSC_VER >= 1400
872872
873
- /* Microsoft Visual Studio */
873
+ /* Microsoft Visual Studio 2005 and later */
874874
_set_errno (error);
875875
876876
#else
877877
878
- /* Non-Microsoft compiler */
878
+ /* Non-Microsoft compiler or older Microsoft compiler */
879879
errno = error;
880880
881881
#endif
882882
}
883883
884884
--- win/include/dirent.h
+++ win/include/dirent.h
@@ -866,18 +866,18 @@
866 /* Set errno variable */
867 static void
868 dirent_set_errno(
869 int error)
870 {
871 #if defined(_MSC_VER)
872
873 /* Microsoft Visual Studio */
874 _set_errno (error);
875
876 #else
877
878 /* Non-Microsoft compiler */
879 errno = error;
880
881 #endif
882 }
883
884
--- win/include/dirent.h
+++ win/include/dirent.h
@@ -866,18 +866,18 @@
866 /* Set errno variable */
867 static void
868 dirent_set_errno(
869 int error)
870 {
871 #if defined(_MSC_VER) && _MSC_VER >= 1400
872
873 /* Microsoft Visual Studio 2005 and later */
874 _set_errno (error);
875
876 #else
877
878 /* Non-Microsoft compiler or older Microsoft compiler */
879 errno = error;
880
881 #endif
882 }
883
884
+2 -2
--- www/build.wiki
+++ www/build.wiki
@@ -54,11 +54,11 @@
5454
</ol>
5555
5656
<h2>2.0 Compiling</h2>
5757
5858
<ol>
59
-<li value="6">
59
+<li value="5">
6060
<p>Unpack the ZIP or tarball you downloaded then
6161
<b>cd</b> into the directory created.</p></li>
6262
6363
<li><i>(Optional, unix only)</i>
6464
Run <b>./configure</b> to construct a makefile.
@@ -101,11 +101,11 @@
101101
</ol>
102102
103103
<h2>3.0 Installing</h2>
104104
105105
<ol>
106
-<li value="9">
106
+<li value="8">
107107
<p>The finished binary is named "fossil" (or "fossil.exe" on windows).
108108
Put this binary in a
109109
directory that is somewhere on your PATH environment variable.
110110
It does not matter where.</p>
111111
112112
--- www/build.wiki
+++ www/build.wiki
@@ -54,11 +54,11 @@
54 </ol>
55
56 <h2>2.0 Compiling</h2>
57
58 <ol>
59 <li value="6">
60 <p>Unpack the ZIP or tarball you downloaded then
61 <b>cd</b> into the directory created.</p></li>
62
63 <li><i>(Optional, unix only)</i>
64 Run <b>./configure</b> to construct a makefile.
@@ -101,11 +101,11 @@
101 </ol>
102
103 <h2>3.0 Installing</h2>
104
105 <ol>
106 <li value="9">
107 <p>The finished binary is named "fossil" (or "fossil.exe" on windows).
108 Put this binary in a
109 directory that is somewhere on your PATH environment variable.
110 It does not matter where.</p>
111
112
--- www/build.wiki
+++ www/build.wiki
@@ -54,11 +54,11 @@
54 </ol>
55
56 <h2>2.0 Compiling</h2>
57
58 <ol>
59 <li value="5">
60 <p>Unpack the ZIP or tarball you downloaded then
61 <b>cd</b> into the directory created.</p></li>
62
63 <li><i>(Optional, unix only)</i>
64 Run <b>./configure</b> to construct a makefile.
@@ -101,11 +101,11 @@
101 </ol>
102
103 <h2>3.0 Installing</h2>
104
105 <ol>
106 <li value="8">
107 <p>The finished binary is named "fossil" (or "fossil.exe" on windows).
108 Put this binary in a
109 directory that is somewhere on your PATH environment variable.
110 It does not matter where.</p>
111
112

Keyboard Shortcuts

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