Fossil SCM

Cygwin: the default value of the "case-sensitive" setting now depends on the case-sensitive setting of the windows kernel. See: [http://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-casesensitive]. Alphabetize some command documentation.

jan.nijtmans 2013-04-17 09:19 trunk
Commit 9359b41fd5fcdbc319d7799d9865d2bb7d7d7dad
+29 -10
--- src/add.c
+++ src/add.c
@@ -20,10 +20,16 @@
2020
*/
2121
#include "config.h"
2222
#include "add.h"
2323
#include <assert.h>
2424
#include <dirent.h>
25
+#ifdef __CYGWIN__
26
+ __declspec(dllimport) extern __stdcall int RegOpenKeyExW(void *, void *,
27
+ int, int, void *);
28
+ __declspec(dllimport) extern __stdcall int RegQueryValueExW(void *, void *,
29
+ int, void *, void *, void *);
30
+#endif
2531
2632
/*
2733
** This routine returns the names of files in a working checkout that
2834
** are created by Fossil itself, and hence should not be added, deleted,
2935
** or merge, and should be omitted from "clean" and "extra" lists.
@@ -262,16 +268,16 @@
262268
if( vid==0 ){
263269
fossil_panic("no checkout to add to");
264270
}
265271
db_begin_transaction();
266272
db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
267
-#if defined(_WIN32) || defined(__CYGWIN__)
268
- db_multi_exec(
269
- "CREATE INDEX IF NOT EXISTS vfile_pathname "
270
- " ON vfile(pathname COLLATE nocase)"
271
- );
272
-#endif
273
+ if( caseSensitive ){
274
+ db_multi_exec(
275
+ "CREATE INDEX IF NOT EXISTS vfile_pathname "
276
+ " ON vfile(pathname COLLATE nocase)"
277
+ );
278
+ }
273279
pIgnore = glob_create(zIgnoreFlag);
274280
nRoot = strlen(g.zLocalRoot);
275281
276282
/* Load the names of all files that are to be added into sfile temp table */
277283
for(i=2; i<g.argc; i++){
@@ -375,12 +381,14 @@
375381
** differ only in case should be considered the same name or not.
376382
**
377383
** The case-sensitive setting determines the default value. If
378384
** the case-sensitive setting is undefined, then case sensitivity
379385
** defaults off for Cygwin, Mac and Windows and on for all other unix.
386
+** If case-sensitivity is enabled in the windows kernel, the Cygwin port
387
+** of fossil.exe can detect that, and modifies the default to 'on'.
380388
**
381
-** The --case-sensitive BOOLEAN command-line option overrides any
389
+** The --case-sensitive <BOOL> command-line option overrides any
382390
** setting.
383391
*/
384392
int filenames_are_case_sensitive(void){
385393
static int caseSensitive;
386394
static int once = 1;
@@ -388,14 +396,25 @@
388396
if( once ){
389397
once = 0;
390398
if( zCaseSensitive ){
391399
caseSensitive = is_truth(zCaseSensitive);
392400
}else{
393
-#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__DARWIN__) && !defined(__APPLE__)
394
- caseSensitive = 1; /* Unix */
401
+#if defined(_WIN32) || defined(__DARWIN__) || defined(__APPLE__)
402
+ caseSensitive = 0; /* Mac and Windows */
403
+#elif defined(__CYGWIN__)
404
+ /* Cygwin can be configured to be case-sensitive, check this. */
405
+ void *hKey;
406
+ int value = 1, length = sizeof(int);
407
+ caseSensitive = 0; /* Cygwin default */
408
+ if( (RegOpenKeyExW((void *)0x80000002, L"SYSTEM\\CurrentControlSet\\"
409
+ "Control\\Session Manager\\kernel", 0, 1, (void *)&hKey)
410
+ == 0) && (RegQueryValueExW(hKey, L"obcaseinsensitive",
411
+ 0, NULL, (void *)&value, (void *)&length) == 0) && !value ){
412
+ caseSensitive = 1;
413
+ }
395414
#else
396
- caseSensitive = 0; /* Cygwin, Mac and Windows */
415
+ caseSensitive = 1; /* Unix */
397416
#endif
398417
caseSensitive = db_get_boolean("case-sensitive",caseSensitive);
399418
}
400419
}
401420
return caseSensitive;
402421
--- src/add.c
+++ src/add.c
@@ -20,10 +20,16 @@
20 */
21 #include "config.h"
22 #include "add.h"
23 #include <assert.h>
24 #include <dirent.h>
 
 
 
 
 
 
25
26 /*
27 ** This routine returns the names of files in a working checkout that
28 ** are created by Fossil itself, and hence should not be added, deleted,
29 ** or merge, and should be omitted from "clean" and "extra" lists.
@@ -262,16 +268,16 @@
262 if( vid==0 ){
263 fossil_panic("no checkout to add to");
264 }
265 db_begin_transaction();
266 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
267 #if defined(_WIN32) || defined(__CYGWIN__)
268 db_multi_exec(
269 "CREATE INDEX IF NOT EXISTS vfile_pathname "
270 " ON vfile(pathname COLLATE nocase)"
271 );
272 #endif
273 pIgnore = glob_create(zIgnoreFlag);
274 nRoot = strlen(g.zLocalRoot);
275
276 /* Load the names of all files that are to be added into sfile temp table */
277 for(i=2; i<g.argc; i++){
@@ -375,12 +381,14 @@
375 ** differ only in case should be considered the same name or not.
376 **
377 ** The case-sensitive setting determines the default value. If
378 ** the case-sensitive setting is undefined, then case sensitivity
379 ** defaults off for Cygwin, Mac and Windows and on for all other unix.
 
 
380 **
381 ** The --case-sensitive BOOLEAN command-line option overrides any
382 ** setting.
383 */
384 int filenames_are_case_sensitive(void){
385 static int caseSensitive;
386 static int once = 1;
@@ -388,14 +396,25 @@
388 if( once ){
389 once = 0;
390 if( zCaseSensitive ){
391 caseSensitive = is_truth(zCaseSensitive);
392 }else{
393 #if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__DARWIN__) && !defined(__APPLE__)
394 caseSensitive = 1; /* Unix */
 
 
 
 
 
 
 
 
 
 
 
395 #else
396 caseSensitive = 0; /* Cygwin, Mac and Windows */
397 #endif
398 caseSensitive = db_get_boolean("case-sensitive",caseSensitive);
399 }
400 }
401 return caseSensitive;
402
--- src/add.c
+++ src/add.c
@@ -20,10 +20,16 @@
20 */
21 #include "config.h"
22 #include "add.h"
23 #include <assert.h>
24 #include <dirent.h>
25 #ifdef __CYGWIN__
26 __declspec(dllimport) extern __stdcall int RegOpenKeyExW(void *, void *,
27 int, int, void *);
28 __declspec(dllimport) extern __stdcall int RegQueryValueExW(void *, void *,
29 int, void *, void *, void *);
30 #endif
31
32 /*
33 ** This routine returns the names of files in a working checkout that
34 ** are created by Fossil itself, and hence should not be added, deleted,
35 ** or merge, and should be omitted from "clean" and "extra" lists.
@@ -262,16 +268,16 @@
268 if( vid==0 ){
269 fossil_panic("no checkout to add to");
270 }
271 db_begin_transaction();
272 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
273 if( caseSensitive ){
274 db_multi_exec(
275 "CREATE INDEX IF NOT EXISTS vfile_pathname "
276 " ON vfile(pathname COLLATE nocase)"
277 );
278 }
279 pIgnore = glob_create(zIgnoreFlag);
280 nRoot = strlen(g.zLocalRoot);
281
282 /* Load the names of all files that are to be added into sfile temp table */
283 for(i=2; i<g.argc; i++){
@@ -375,12 +381,14 @@
381 ** differ only in case should be considered the same name or not.
382 **
383 ** The case-sensitive setting determines the default value. If
384 ** the case-sensitive setting is undefined, then case sensitivity
385 ** defaults off for Cygwin, Mac and Windows and on for all other unix.
386 ** If case-sensitivity is enabled in the windows kernel, the Cygwin port
387 ** of fossil.exe can detect that, and modifies the default to 'on'.
388 **
389 ** The --case-sensitive <BOOL> command-line option overrides any
390 ** setting.
391 */
392 int filenames_are_case_sensitive(void){
393 static int caseSensitive;
394 static int once = 1;
@@ -388,14 +396,25 @@
396 if( once ){
397 once = 0;
398 if( zCaseSensitive ){
399 caseSensitive = is_truth(zCaseSensitive);
400 }else{
401 #if defined(_WIN32) || defined(__DARWIN__) || defined(__APPLE__)
402 caseSensitive = 0; /* Mac and Windows */
403 #elif defined(__CYGWIN__)
404 /* Cygwin can be configured to be case-sensitive, check this. */
405 void *hKey;
406 int value = 1, length = sizeof(int);
407 caseSensitive = 0; /* Cygwin default */
408 if( (RegOpenKeyExW((void *)0x80000002, L"SYSTEM\\CurrentControlSet\\"
409 "Control\\Session Manager\\kernel", 0, 1, (void *)&hKey)
410 == 0) && (RegQueryValueExW(hKey, L"obcaseinsensitive",
411 0, NULL, (void *)&value, (void *)&length) == 0) && !value ){
412 caseSensitive = 1;
413 }
414 #else
415 caseSensitive = 1; /* Unix */
416 #endif
417 caseSensitive = db_get_boolean("case-sensitive",caseSensitive);
418 }
419 }
420 return caseSensitive;
421
+4 -4
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -736,23 +736,23 @@
736736
** The "--binary" option causes files matching the glob PATTERN to be treated
737737
** as binary when considering if they should be used with external diff program.
738738
** This option overrides the "binary-glob" setting.
739739
**
740740
** Options:
741
+** --binary PATTERN Treat files that match the glob PATTERN as binary
741742
** --branch BRANCH Show diff of all changes on BRANCH
742743
** --brief Show filenames only
743744
** --context|-c N Use N lines of context
745
+** --diff-binary BOOL Include binary files when using external commands
744746
** --from|-r VERSION select VERSION as source for the diff
745
-** -i use internal diff logic
747
+** --internal|-i use internal diff logic
746748
** --new-file|-N output complete text of added or deleted files
749
+** --side-by-side|-y side-by-side diff
747750
** --tk Launch a Tcl/Tk GUI for display
748751
** --to VERSION select VERSION as target for the diff
749
-** --side-by-side|-y side-by-side diff
750752
** --unified unified diff
751753
** --width|-W N Width of lines in side-by-side diff
752
-** --diff-binary BOOL Include binary files when using external commands
753
-** --binary PATTERN Treat files that match the glob PATTERN as binary
754754
*/
755755
void diff_cmd(void){
756756
int isGDiff; /* True for gdiff. False for normal diff */
757757
int isInternDiff; /* True for internal diff */
758758
int hasNFlag; /* True if -N or --new-file flag is used */
759759
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -736,23 +736,23 @@
736 ** The "--binary" option causes files matching the glob PATTERN to be treated
737 ** as binary when considering if they should be used with external diff program.
738 ** This option overrides the "binary-glob" setting.
739 **
740 ** Options:
 
741 ** --branch BRANCH Show diff of all changes on BRANCH
742 ** --brief Show filenames only
743 ** --context|-c N Use N lines of context
 
744 ** --from|-r VERSION select VERSION as source for the diff
745 ** -i use internal diff logic
746 ** --new-file|-N output complete text of added or deleted files
 
747 ** --tk Launch a Tcl/Tk GUI for display
748 ** --to VERSION select VERSION as target for the diff
749 ** --side-by-side|-y side-by-side diff
750 ** --unified unified diff
751 ** --width|-W N Width of lines in side-by-side diff
752 ** --diff-binary BOOL Include binary files when using external commands
753 ** --binary PATTERN Treat files that match the glob PATTERN as binary
754 */
755 void diff_cmd(void){
756 int isGDiff; /* True for gdiff. False for normal diff */
757 int isInternDiff; /* True for internal diff */
758 int hasNFlag; /* True if -N or --new-file flag is used */
759
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -736,23 +736,23 @@
736 ** The "--binary" option causes files matching the glob PATTERN to be treated
737 ** as binary when considering if they should be used with external diff program.
738 ** This option overrides the "binary-glob" setting.
739 **
740 ** Options:
741 ** --binary PATTERN Treat files that match the glob PATTERN as binary
742 ** --branch BRANCH Show diff of all changes on BRANCH
743 ** --brief Show filenames only
744 ** --context|-c N Use N lines of context
745 ** --diff-binary BOOL Include binary files when using external commands
746 ** --from|-r VERSION select VERSION as source for the diff
747 ** --internal|-i use internal diff logic
748 ** --new-file|-N output complete text of added or deleted files
749 ** --side-by-side|-y side-by-side diff
750 ** --tk Launch a Tcl/Tk GUI for display
751 ** --to VERSION select VERSION as target for the diff
 
752 ** --unified unified diff
753 ** --width|-W N Width of lines in side-by-side diff
 
 
754 */
755 void diff_cmd(void){
756 int isGDiff; /* True for gdiff. False for normal diff */
757 int isInternDiff; /* True for internal diff */
758 int hasNFlag; /* True if -N or --new-file flag is used */
759
+4 -4
--- src/finfo.c
+++ src/finfo.c
@@ -40,19 +40,19 @@
4040
** The specified version (or the latest checked out version) is printed
4141
** to stdout. The -p mode is another form of the "cat" command.
4242
**
4343
** Options:
4444
** --brief|-b display a brief (one line / revision) summary
45
+** --case-sensitive B Enable or disable case-sensitive filenames. B is a
46
+** boolean: "yes", "no", "true", "false", etc.
4547
** --limit N display the first N changes
4648
** --log|-l select log mode (the default)
4749
** --offset P skip P changes
48
-** -p select print mode
50
+** --print|-p select print mode
4951
** --revision|-r R print the given revision (or ckout, if none is given)
5052
** to stdout (only in print mode)
51
-** -s select status mode (print a status indicator for FILE)
52
-** --case-sensitive B Enable or disable case-sensitive filenames. B is a
53
-** boolean: "yes", "no", "true", "false", etc.
53
+** --status|-s select status mode (print a status indicator for FILE)
5454
**
5555
** See also: artifact, cat, descendants, info, leaves
5656
*/
5757
void finfo_cmd(void){
5858
capture_case_sensitive_option();
5959
--- src/finfo.c
+++ src/finfo.c
@@ -40,19 +40,19 @@
40 ** The specified version (or the latest checked out version) is printed
41 ** to stdout. The -p mode is another form of the "cat" command.
42 **
43 ** Options:
44 ** --brief|-b display a brief (one line / revision) summary
 
 
45 ** --limit N display the first N changes
46 ** --log|-l select log mode (the default)
47 ** --offset P skip P changes
48 ** -p select print mode
49 ** --revision|-r R print the given revision (or ckout, if none is given)
50 ** to stdout (only in print mode)
51 ** -s select status mode (print a status indicator for FILE)
52 ** --case-sensitive B Enable or disable case-sensitive filenames. B is a
53 ** boolean: "yes", "no", "true", "false", etc.
54 **
55 ** See also: artifact, cat, descendants, info, leaves
56 */
57 void finfo_cmd(void){
58 capture_case_sensitive_option();
59
--- src/finfo.c
+++ src/finfo.c
@@ -40,19 +40,19 @@
40 ** The specified version (or the latest checked out version) is printed
41 ** to stdout. The -p mode is another form of the "cat" command.
42 **
43 ** Options:
44 ** --brief|-b display a brief (one line / revision) summary
45 ** --case-sensitive B Enable or disable case-sensitive filenames. B is a
46 ** boolean: "yes", "no", "true", "false", etc.
47 ** --limit N display the first N changes
48 ** --log|-l select log mode (the default)
49 ** --offset P skip P changes
50 ** --print|-p select print mode
51 ** --revision|-r R print the given revision (or ckout, if none is given)
52 ** to stdout (only in print mode)
53 ** --status|-s select status mode (print a status indicator for FILE)
 
 
54 **
55 ** See also: artifact, cat, descendants, info, leaves
56 */
57 void finfo_cmd(void){
58 capture_case_sensitive_option();
59
+5 -5
--- src/merge.c
+++ src/merge.c
@@ -81,24 +81,24 @@
8181
** --baseline BASELINE Use BASELINE as the "pivot" of the merge instead
8282
** of the nearest common ancestor. This allows
8383
** a sequence of changes in a branch to be merged
8484
** without having to merge the entire branch.
8585
**
86
-** --detail Show additional details of the merge
87
-**
8886
** --binary GLOBPATTERN Treat files that match GLOBPATTERN as binary
8987
** and do not try to merge parallel changes. This
9088
** option overrides the "binary-glob" setting.
9189
**
92
-** --nochange | -n Dryrun: do not actually make any changes; just
93
-** show what would have happened.
94
-**
9590
** --case-sensitive BOOL Override the case-sensitive setting. If false,
9691
** files whose names differ only in case are taken
9792
** to be the same file.
93
+**
94
+** --detail Show additional details of the merge
9895
**
9996
** --force | -f Force the merge even if it would be a no-op.
97
+**
98
+** --nochange | -n Dryrun: do not actually make any changes; just
99
+** show what would have happened.
100100
*/
101101
void merge_cmd(void){
102102
int vid; /* Current version "V" */
103103
int mid; /* Version we are merging from "M" */
104104
int pid; /* The pivot version - most recent common ancestor P */
105105
--- src/merge.c
+++ src/merge.c
@@ -81,24 +81,24 @@
81 ** --baseline BASELINE Use BASELINE as the "pivot" of the merge instead
82 ** of the nearest common ancestor. This allows
83 ** a sequence of changes in a branch to be merged
84 ** without having to merge the entire branch.
85 **
86 ** --detail Show additional details of the merge
87 **
88 ** --binary GLOBPATTERN Treat files that match GLOBPATTERN as binary
89 ** and do not try to merge parallel changes. This
90 ** option overrides the "binary-glob" setting.
91 **
92 ** --nochange | -n Dryrun: do not actually make any changes; just
93 ** show what would have happened.
94 **
95 ** --case-sensitive BOOL Override the case-sensitive setting. If false,
96 ** files whose names differ only in case are taken
97 ** to be the same file.
 
 
98 **
99 ** --force | -f Force the merge even if it would be a no-op.
 
 
 
100 */
101 void merge_cmd(void){
102 int vid; /* Current version "V" */
103 int mid; /* Version we are merging from "M" */
104 int pid; /* The pivot version - most recent common ancestor P */
105
--- src/merge.c
+++ src/merge.c
@@ -81,24 +81,24 @@
81 ** --baseline BASELINE Use BASELINE as the "pivot" of the merge instead
82 ** of the nearest common ancestor. This allows
83 ** a sequence of changes in a branch to be merged
84 ** without having to merge the entire branch.
85 **
 
 
86 ** --binary GLOBPATTERN Treat files that match GLOBPATTERN as binary
87 ** and do not try to merge parallel changes. This
88 ** option overrides the "binary-glob" setting.
89 **
 
 
 
90 ** --case-sensitive BOOL Override the case-sensitive setting. If false,
91 ** files whose names differ only in case are taken
92 ** to be the same file.
93 **
94 ** --detail Show additional details of the merge
95 **
96 ** --force | -f Force the merge even if it would be a no-op.
97 **
98 ** --nochange | -n Dryrun: do not actually make any changes; just
99 ** show what would have happened.
100 */
101 void merge_cmd(void){
102 int vid; /* Current version "V" */
103 int mid; /* Version we are merging from "M" */
104 int pid; /* The pivot version - most recent common ancestor P */
105
--- www/changes.wiki
+++ www/changes.wiki
@@ -6,11 +6,13 @@
66
win32. This means that the win32 fossil.exe is better usable in a Cygwin
77
environment. See
88
[http://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-specialchars].
99
* Cygwin: Fossil now understands win32 absolute paths starting with a drive
1010
letter everywhere. The default value of the "case-sensitive" setting is
11
- now FALSE.
11
+ now FALSE, except when case-sensitivity is enabled in the Windows kernel.
12
+ See
13
+ [http://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-casesensitive]
1214
* Enhancements to /timeline.rss, adding more flags for filtering
1315
results, including the ability to subscribe to changes made
1416
to individual tickets. For example: [/timeline.rss?y=t&tkt=12fceeec82].
1517
* JSON API: added the 'status' command to report local checkout status.
1618
1719
--- www/changes.wiki
+++ www/changes.wiki
@@ -6,11 +6,13 @@
6 win32. This means that the win32 fossil.exe is better usable in a Cygwin
7 environment. See
8 [http://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-specialchars].
9 * Cygwin: Fossil now understands win32 absolute paths starting with a drive
10 letter everywhere. The default value of the "case-sensitive" setting is
11 now FALSE.
 
 
12 * Enhancements to /timeline.rss, adding more flags for filtering
13 results, including the ability to subscribe to changes made
14 to individual tickets. For example: [/timeline.rss?y=t&tkt=12fceeec82].
15 * JSON API: added the 'status' command to report local checkout status.
16
17
--- www/changes.wiki
+++ www/changes.wiki
@@ -6,11 +6,13 @@
6 win32. This means that the win32 fossil.exe is better usable in a Cygwin
7 environment. See
8 [http://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-specialchars].
9 * Cygwin: Fossil now understands win32 absolute paths starting with a drive
10 letter everywhere. The default value of the "case-sensitive" setting is
11 now FALSE, except when case-sensitivity is enabled in the Windows kernel.
12 See
13 [http://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-casesensitive]
14 * Enhancements to /timeline.rss, adding more flags for filtering
15 results, including the ability to subscribe to changes made
16 to individual tickets. For example: [/timeline.rss?y=t&tkt=12fceeec82].
17 * JSON API: added the 'status' command to report local checkout status.
18
19

Keyboard Shortcuts

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