Fossil SCM

Remove the --no-dir-symlinks option. This is a back-out of check-in [2375d6cbce933267] together with other cleanup changes.

drh 2017-08-30 12:02 trunk
Commit b7272185ca664fcbc13161f699fd941c70272e98f3f2cfb18870e87eef73e55a
-4
--- src/add.c
+++ src/add.c
@@ -276,11 +276,10 @@
276276
** -f|--force Add files without prompting
277277
** --ignore <CSG> Ignore unmanaged files matching patterns from
278278
** the comma separated list of glob patterns.
279279
** --clean <CSG> Also ignore files matching patterns from
280280
** the comma separated list of glob patterns.
281
-** --no-dir-symlinks Disables support for directory symlinks.
282281
**
283282
** See also: addremove, rm
284283
*/
285284
void add_cmd(void){
286285
int i; /* Loop counter */
@@ -442,11 +441,10 @@
442441
** --soft Skip removing files from the checkout.
443442
** This supersedes the --hard option.
444443
** --hard Remove files from the checkout.
445444
** --case-sensitive <BOOL> Override the case-sensitive setting.
446445
** -n|--dry-run If given, display instead of run actions.
447
-** --no-dir-symlinks Disables support for directory symlinks.
448446
**
449447
** See also: addremove, add
450448
*/
451449
void delete_cmd(void){
452450
int i;
@@ -624,11 +622,10 @@
624622
** --ignore <CSG> Ignore unmanaged files matching patterns from
625623
** the comma separated list of glob patterns.
626624
** --clean <CSG> Also ignore files matching patterns from
627625
** the comma separated list of glob patterns.
628626
** -n|--dry-run If given, display instead of run actions.
629
-** --no-dir-symlinks Disables support for directory symlinks.
630627
**
631628
** See also: add, rm
632629
*/
633630
void addremove_cmd(void){
634631
Blob path;
@@ -852,11 +849,10 @@
852849
** --soft Skip moving files within the checkout.
853850
** This supersedes the --hard option.
854851
** --hard Move files within the checkout.
855852
** --case-sensitive <BOOL> Override the case-sensitive setting.
856853
** -n|--dry-run If given, display instead of run actions.
857
-** --no-dir-symlinks Disables support for directory symlinks.
858854
**
859855
** See also: changes, status
860856
*/
861857
void mv_cmd(void){
862858
int i;
863859
--- src/add.c
+++ src/add.c
@@ -276,11 +276,10 @@
276 ** -f|--force Add files without prompting
277 ** --ignore <CSG> Ignore unmanaged files matching patterns from
278 ** the comma separated list of glob patterns.
279 ** --clean <CSG> Also ignore files matching patterns from
280 ** the comma separated list of glob patterns.
281 ** --no-dir-symlinks Disables support for directory symlinks.
282 **
283 ** See also: addremove, rm
284 */
285 void add_cmd(void){
286 int i; /* Loop counter */
@@ -442,11 +441,10 @@
442 ** --soft Skip removing files from the checkout.
443 ** This supersedes the --hard option.
444 ** --hard Remove files from the checkout.
445 ** --case-sensitive <BOOL> Override the case-sensitive setting.
446 ** -n|--dry-run If given, display instead of run actions.
447 ** --no-dir-symlinks Disables support for directory symlinks.
448 **
449 ** See also: addremove, add
450 */
451 void delete_cmd(void){
452 int i;
@@ -624,11 +622,10 @@
624 ** --ignore <CSG> Ignore unmanaged files matching patterns from
625 ** the comma separated list of glob patterns.
626 ** --clean <CSG> Also ignore files matching patterns from
627 ** the comma separated list of glob patterns.
628 ** -n|--dry-run If given, display instead of run actions.
629 ** --no-dir-symlinks Disables support for directory symlinks.
630 **
631 ** See also: add, rm
632 */
633 void addremove_cmd(void){
634 Blob path;
@@ -852,11 +849,10 @@
852 ** --soft Skip moving files within the checkout.
853 ** This supersedes the --hard option.
854 ** --hard Move files within the checkout.
855 ** --case-sensitive <BOOL> Override the case-sensitive setting.
856 ** -n|--dry-run If given, display instead of run actions.
857 ** --no-dir-symlinks Disables support for directory symlinks.
858 **
859 ** See also: changes, status
860 */
861 void mv_cmd(void){
862 int i;
863
--- src/add.c
+++ src/add.c
@@ -276,11 +276,10 @@
276 ** -f|--force Add files without prompting
277 ** --ignore <CSG> Ignore unmanaged files matching patterns from
278 ** the comma separated list of glob patterns.
279 ** --clean <CSG> Also ignore files matching patterns from
280 ** the comma separated list of glob patterns.
 
281 **
282 ** See also: addremove, rm
283 */
284 void add_cmd(void){
285 int i; /* Loop counter */
@@ -442,11 +441,10 @@
441 ** --soft Skip removing files from the checkout.
442 ** This supersedes the --hard option.
443 ** --hard Remove files from the checkout.
444 ** --case-sensitive <BOOL> Override the case-sensitive setting.
445 ** -n|--dry-run If given, display instead of run actions.
 
446 **
447 ** See also: addremove, add
448 */
449 void delete_cmd(void){
450 int i;
@@ -624,11 +622,10 @@
622 ** --ignore <CSG> Ignore unmanaged files matching patterns from
623 ** the comma separated list of glob patterns.
624 ** --clean <CSG> Also ignore files matching patterns from
625 ** the comma separated list of glob patterns.
626 ** -n|--dry-run If given, display instead of run actions.
 
627 **
628 ** See also: add, rm
629 */
630 void addremove_cmd(void){
631 Blob path;
@@ -852,11 +849,10 @@
849 ** --soft Skip moving files within the checkout.
850 ** This supersedes the --hard option.
851 ** --hard Move files within the checkout.
852 ** --case-sensitive <BOOL> Override the case-sensitive setting.
853 ** -n|--dry-run If given, display instead of run actions.
 
854 **
855 ** See also: changes, status
856 */
857 void mv_cmd(void){
858 int i;
859
+8 -10
--- src/checkin.c
+++ src/checkin.c
@@ -417,11 +417,10 @@
417417
** --hash Verify file status using hashing rather than
418418
** relying on file mtimes.
419419
** --case-sensitive <BOOL> Override case-sensitive setting.
420420
** --dotfiles Include unmanaged files beginning with a dot.
421421
** --ignore <CSG> Ignore unmanaged files matching CSG glob patterns.
422
-** --no-dir-symlinks Disables support for directory symlinks.
423422
**
424423
** Options specific to the changes command:
425424
** --header Identify the repository if report is non-empty.
426425
** -v|--verbose Say "(none)" if the change report is empty.
427426
** --classify Start each line with the file's change type.
@@ -826,11 +825,10 @@
826825
** --abs-paths Display absolute pathnames.
827826
** --case-sensitive <BOOL> override case-sensitive setting
828827
** --dotfiles include files beginning with a dot (".")
829828
** --header Identify the repository if there are extras
830829
** --ignore <CSG> ignore files matching patterns from the argument
831
-** --no-dir-symlinks Disables support for directory symlinks.
832830
** --rel-paths Display pathnames relative to the current working
833831
** directory.
834832
**
835833
** See also: changes, clean, status
836834
*/
@@ -856,10 +854,12 @@
856854
857855
if( zIgnoreFlag==0 ){
858856
zIgnoreFlag = db_get("ignore-glob", 0);
859857
}
860858
pIgnore = glob_create(zIgnoreFlag);
859
+ /* Always consider symlinks. */
860
+ g.allowSymlinks = db_allow_symlinks_by_default();
861861
locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
862862
glob_free(pIgnore);
863863
864864
blob_zero(&report);
865865
status_report(&report, flags);
@@ -901,14 +901,13 @@
901901
**
902902
** The default values for --clean, --ignore, and --keep are determined by
903903
** the (versionable) clean-glob, ignore-glob, and keep-glob settings.
904904
**
905905
** The --verily option ignores the keep-glob and ignore-glob settings and
906
-** turns on the options --force, --emptydirs, --dotfiles, --disable-undo,
907
-** and --no-dir-symlinks. Use the --verily option when you really want
908
-** to clean up everything. Extreme care should be exercised when using
909
-** the --verily option.
906
+** turns on --force, --emptydirs, --dotfiles, and --disable-undo. Use the
907
+** --verily option when you really want to clean up everything. Extreme
908
+** care should be exercised when using the --verily option.
910909
**
911910
** Options:
912911
** --allckouts Check for empty directories within any checkouts
913912
** that may be nested within the current one. This
914913
** option should be used with great care because the
@@ -934,11 +933,11 @@
934933
** -i|--prompt Prompt before removing each file. This option
935934
** implies the --disable-undo option.
936935
** -x|--verily WARNING: Removes everything that is not a managed
937936
** file or the repository itself. This option
938937
** implies the --force, --emptydirs, --dotfiles, and
939
-** --disable-undo, and --no-dir-symlinks options.
938
+** --disable-undo options.
940939
** Furthermore, it completely disregards the keep-glob
941940
** and ignore-glob settings. However, it does honor
942941
** the --ignore and --keep options.
943942
** --clean <CSG> WARNING: Never prompt to delete any files matching
944943
** this comma separated list of glob patterns. Also,
@@ -950,11 +949,10 @@
950949
** list of glob patterns.
951950
** -n|--dry-run Delete nothing, but display what would have been
952951
** deleted.
953952
** --no-prompt This option disables prompting the user for input
954953
** and assumes an answer of 'No' for every question.
955
-** --no-dir-symlinks Disables support for directory symlinks.
956954
** --temp Remove only Fossil-generated temporary files.
957955
** -v|--verbose Show all files as they are removed.
958956
**
959957
** See also: addremove, extras, status
960958
*/
@@ -999,12 +997,10 @@
999997
verilyFlag = allFileFlag = allDirFlag = 1;
1000998
emptyDirsFlag = 1;
1001999
disableUndo = 1;
10021000
scanFlags |= SCAN_ALL;
10031001
zCleanFlag = 0;
1004
- g.fNoDirSymlinks = 1; /* Forbid symlink directory traversal. */
1005
- g.allowSymlinks = 1; /* Treat symlink files as content. */
10061002
}
10071003
if( zIgnoreFlag==0 && !verilyFlag ){
10081004
zIgnoreFlag = db_get("ignore-glob", 0);
10091005
}
10101006
if( zKeepFlag==0 && !verilyFlag ){
@@ -1017,10 +1013,12 @@
10171013
verify_all_options();
10181014
pIgnore = glob_create(zIgnoreFlag);
10191015
pKeep = glob_create(zKeepFlag);
10201016
pClean = glob_create(zCleanFlag);
10211017
nRoot = (int)strlen(g.zLocalRoot);
1018
+ /* Always consider symlinks. */
1019
+ g.allowSymlinks = db_allow_symlinks_by_default();
10221020
if( !dirsOnlyFlag ){
10231021
Stmt q;
10241022
Blob repo;
10251023
if( !dryRunFlag && !disableUndo ) undo_begin();
10261024
locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
10271025
--- src/checkin.c
+++ src/checkin.c
@@ -417,11 +417,10 @@
417 ** --hash Verify file status using hashing rather than
418 ** relying on file mtimes.
419 ** --case-sensitive <BOOL> Override case-sensitive setting.
420 ** --dotfiles Include unmanaged files beginning with a dot.
421 ** --ignore <CSG> Ignore unmanaged files matching CSG glob patterns.
422 ** --no-dir-symlinks Disables support for directory symlinks.
423 **
424 ** Options specific to the changes command:
425 ** --header Identify the repository if report is non-empty.
426 ** -v|--verbose Say "(none)" if the change report is empty.
427 ** --classify Start each line with the file's change type.
@@ -826,11 +825,10 @@
826 ** --abs-paths Display absolute pathnames.
827 ** --case-sensitive <BOOL> override case-sensitive setting
828 ** --dotfiles include files beginning with a dot (".")
829 ** --header Identify the repository if there are extras
830 ** --ignore <CSG> ignore files matching patterns from the argument
831 ** --no-dir-symlinks Disables support for directory symlinks.
832 ** --rel-paths Display pathnames relative to the current working
833 ** directory.
834 **
835 ** See also: changes, clean, status
836 */
@@ -856,10 +854,12 @@
856
857 if( zIgnoreFlag==0 ){
858 zIgnoreFlag = db_get("ignore-glob", 0);
859 }
860 pIgnore = glob_create(zIgnoreFlag);
 
 
861 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
862 glob_free(pIgnore);
863
864 blob_zero(&report);
865 status_report(&report, flags);
@@ -901,14 +901,13 @@
901 **
902 ** The default values for --clean, --ignore, and --keep are determined by
903 ** the (versionable) clean-glob, ignore-glob, and keep-glob settings.
904 **
905 ** The --verily option ignores the keep-glob and ignore-glob settings and
906 ** turns on the options --force, --emptydirs, --dotfiles, --disable-undo,
907 ** and --no-dir-symlinks. Use the --verily option when you really want
908 ** to clean up everything. Extreme care should be exercised when using
909 ** the --verily option.
910 **
911 ** Options:
912 ** --allckouts Check for empty directories within any checkouts
913 ** that may be nested within the current one. This
914 ** option should be used with great care because the
@@ -934,11 +933,11 @@
934 ** -i|--prompt Prompt before removing each file. This option
935 ** implies the --disable-undo option.
936 ** -x|--verily WARNING: Removes everything that is not a managed
937 ** file or the repository itself. This option
938 ** implies the --force, --emptydirs, --dotfiles, and
939 ** --disable-undo, and --no-dir-symlinks options.
940 ** Furthermore, it completely disregards the keep-glob
941 ** and ignore-glob settings. However, it does honor
942 ** the --ignore and --keep options.
943 ** --clean <CSG> WARNING: Never prompt to delete any files matching
944 ** this comma separated list of glob patterns. Also,
@@ -950,11 +949,10 @@
950 ** list of glob patterns.
951 ** -n|--dry-run Delete nothing, but display what would have been
952 ** deleted.
953 ** --no-prompt This option disables prompting the user for input
954 ** and assumes an answer of 'No' for every question.
955 ** --no-dir-symlinks Disables support for directory symlinks.
956 ** --temp Remove only Fossil-generated temporary files.
957 ** -v|--verbose Show all files as they are removed.
958 **
959 ** See also: addremove, extras, status
960 */
@@ -999,12 +997,10 @@
999 verilyFlag = allFileFlag = allDirFlag = 1;
1000 emptyDirsFlag = 1;
1001 disableUndo = 1;
1002 scanFlags |= SCAN_ALL;
1003 zCleanFlag = 0;
1004 g.fNoDirSymlinks = 1; /* Forbid symlink directory traversal. */
1005 g.allowSymlinks = 1; /* Treat symlink files as content. */
1006 }
1007 if( zIgnoreFlag==0 && !verilyFlag ){
1008 zIgnoreFlag = db_get("ignore-glob", 0);
1009 }
1010 if( zKeepFlag==0 && !verilyFlag ){
@@ -1017,10 +1013,12 @@
1017 verify_all_options();
1018 pIgnore = glob_create(zIgnoreFlag);
1019 pKeep = glob_create(zKeepFlag);
1020 pClean = glob_create(zCleanFlag);
1021 nRoot = (int)strlen(g.zLocalRoot);
 
 
1022 if( !dirsOnlyFlag ){
1023 Stmt q;
1024 Blob repo;
1025 if( !dryRunFlag && !disableUndo ) undo_begin();
1026 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
1027
--- src/checkin.c
+++ src/checkin.c
@@ -417,11 +417,10 @@
417 ** --hash Verify file status using hashing rather than
418 ** relying on file mtimes.
419 ** --case-sensitive <BOOL> Override case-sensitive setting.
420 ** --dotfiles Include unmanaged files beginning with a dot.
421 ** --ignore <CSG> Ignore unmanaged files matching CSG glob patterns.
 
422 **
423 ** Options specific to the changes command:
424 ** --header Identify the repository if report is non-empty.
425 ** -v|--verbose Say "(none)" if the change report is empty.
426 ** --classify Start each line with the file's change type.
@@ -826,11 +825,10 @@
825 ** --abs-paths Display absolute pathnames.
826 ** --case-sensitive <BOOL> override case-sensitive setting
827 ** --dotfiles include files beginning with a dot (".")
828 ** --header Identify the repository if there are extras
829 ** --ignore <CSG> ignore files matching patterns from the argument
 
830 ** --rel-paths Display pathnames relative to the current working
831 ** directory.
832 **
833 ** See also: changes, clean, status
834 */
@@ -856,10 +854,12 @@
854
855 if( zIgnoreFlag==0 ){
856 zIgnoreFlag = db_get("ignore-glob", 0);
857 }
858 pIgnore = glob_create(zIgnoreFlag);
859 /* Always consider symlinks. */
860 g.allowSymlinks = db_allow_symlinks_by_default();
861 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
862 glob_free(pIgnore);
863
864 blob_zero(&report);
865 status_report(&report, flags);
@@ -901,14 +901,13 @@
901 **
902 ** The default values for --clean, --ignore, and --keep are determined by
903 ** the (versionable) clean-glob, ignore-glob, and keep-glob settings.
904 **
905 ** The --verily option ignores the keep-glob and ignore-glob settings and
906 ** turns on --force, --emptydirs, --dotfiles, and --disable-undo. Use the
907 ** --verily option when you really want to clean up everything. Extreme
908 ** care should be exercised when using the --verily option.
 
909 **
910 ** Options:
911 ** --allckouts Check for empty directories within any checkouts
912 ** that may be nested within the current one. This
913 ** option should be used with great care because the
@@ -934,11 +933,11 @@
933 ** -i|--prompt Prompt before removing each file. This option
934 ** implies the --disable-undo option.
935 ** -x|--verily WARNING: Removes everything that is not a managed
936 ** file or the repository itself. This option
937 ** implies the --force, --emptydirs, --dotfiles, and
938 ** --disable-undo options.
939 ** Furthermore, it completely disregards the keep-glob
940 ** and ignore-glob settings. However, it does honor
941 ** the --ignore and --keep options.
942 ** --clean <CSG> WARNING: Never prompt to delete any files matching
943 ** this comma separated list of glob patterns. Also,
@@ -950,11 +949,10 @@
949 ** list of glob patterns.
950 ** -n|--dry-run Delete nothing, but display what would have been
951 ** deleted.
952 ** --no-prompt This option disables prompting the user for input
953 ** and assumes an answer of 'No' for every question.
 
954 ** --temp Remove only Fossil-generated temporary files.
955 ** -v|--verbose Show all files as they are removed.
956 **
957 ** See also: addremove, extras, status
958 */
@@ -999,12 +997,10 @@
997 verilyFlag = allFileFlag = allDirFlag = 1;
998 emptyDirsFlag = 1;
999 disableUndo = 1;
1000 scanFlags |= SCAN_ALL;
1001 zCleanFlag = 0;
 
 
1002 }
1003 if( zIgnoreFlag==0 && !verilyFlag ){
1004 zIgnoreFlag = db_get("ignore-glob", 0);
1005 }
1006 if( zKeepFlag==0 && !verilyFlag ){
@@ -1017,10 +1013,12 @@
1013 verify_all_options();
1014 pIgnore = glob_create(zIgnoreFlag);
1015 pKeep = glob_create(zKeepFlag);
1016 pClean = glob_create(zCleanFlag);
1017 nRoot = (int)strlen(g.zLocalRoot);
1018 /* Always consider symlinks. */
1019 g.allowSymlinks = db_allow_symlinks_by_default();
1020 if( !dirsOnlyFlag ){
1021 Stmt q;
1022 Blob repo;
1023 if( !dryRunFlag && !disableUndo ) undo_begin();
1024 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
1025
+2 -7
--- src/db.c
+++ src/db.c
@@ -1475,17 +1475,12 @@
14751475
}
14761476
14771477
/*
14781478
** Returns non-zero if support for symlinks is currently enabled.
14791479
*/
1480
-int db_allow_symlinks(int traversal){
1481
- if( traversal ){
1482
- if( g.allowSymlinks ) return 1;
1483
- return g.fNoDirSymlinks;
1484
- }else{
1485
- return g.allowSymlinks;
1486
- }
1480
+int db_allow_symlinks(void){
1481
+ return g.allowSymlinks;
14871482
}
14881483
14891484
/*
14901485
** Open the repository database given by zDbName. If zDbName==NULL then
14911486
** get the name from the already open local database.
14921487
--- src/db.c
+++ src/db.c
@@ -1475,17 +1475,12 @@
1475 }
1476
1477 /*
1478 ** Returns non-zero if support for symlinks is currently enabled.
1479 */
1480 int db_allow_symlinks(int traversal){
1481 if( traversal ){
1482 if( g.allowSymlinks ) return 1;
1483 return g.fNoDirSymlinks;
1484 }else{
1485 return g.allowSymlinks;
1486 }
1487 }
1488
1489 /*
1490 ** Open the repository database given by zDbName. If zDbName==NULL then
1491 ** get the name from the already open local database.
1492
--- src/db.c
+++ src/db.c
@@ -1475,17 +1475,12 @@
1475 }
1476
1477 /*
1478 ** Returns non-zero if support for symlinks is currently enabled.
1479 */
1480 int db_allow_symlinks(void){
1481 return g.allowSymlinks;
 
 
 
 
 
1482 }
1483
1484 /*
1485 ** Open the repository database given by zDbName. If zDbName==NULL then
1486 ** get the name from the already open local database.
1487
+28 -41
--- src/file.c
+++ src/file.c
@@ -88,17 +88,16 @@
8888
**
8989
*/
9090
static int fossil_stat(
9191
const char *zFilename, /* name of file or directory to inspect. */
9292
struct fossilStat *buf, /* pointer to buffer where info should go. */
93
- int isWd, /* non-zero to consider look at symlink itself. */
94
- int forceWd /* non-zero to force look at symlink itself. */
93
+ int isWd /* non-zero to consider look at symlink itself. */
9594
){
9695
int rc;
9796
void *zMbcs = fossil_utf8_to_path(zFilename, 0);
9897
#if !defined(_WIN32)
99
- if( isWd && (forceWd || db_allow_symlinks(0)) ){
98
+ if( isWd && db_allow_symlinks() ){
10099
rc = lstat(zMbcs, buf);
101100
}else{
102101
rc = stat(zMbcs, buf);
103102
}
104103
#else
@@ -128,11 +127,11 @@
128127
static int getStat(const char *zFilename, int isWd){
129128
int rc = 0;
130129
if( zFilename==0 ){
131130
if( fileStatValid==0 ) rc = 1;
132131
}else{
133
- if( fossil_stat(zFilename, &fileStat, isWd, 0)!=0 ){
132
+ if( fossil_stat(zFilename, &fileStat, isWd)!=0 ){
134133
fileStatValid = 0;
135134
rc = 1;
136135
}else{
137136
fileStatValid = 1;
138137
rc = 0;
@@ -220,11 +219,11 @@
220219
**
221220
** Arguments: target file (symlink will point to it), link file
222221
**/
223222
void symlink_create(const char *zTargetFile, const char *zLinkFile){
224223
#if !defined(_WIN32)
225
- if( db_allow_symlinks(0) ){
224
+ if( db_allow_symlinks() ){
226225
int i, nName;
227226
char *zName, zBuf[1000];
228227
229228
nName = strlen(zLinkFile);
230229
if( nName>=sizeof(zBuf) ){
@@ -277,11 +276,11 @@
277276
int file_wd_perm(const char *zFilename){
278277
#if !defined(_WIN32)
279278
if( !getStat(zFilename, 1) ){
280279
if( S_ISREG(fileStat.st_mode) && ((S_IXUSR)&fileStat.st_mode)!=0 )
281280
return PERM_EXE;
282
- else if( db_allow_symlinks(0) && S_ISLNK(fileStat.st_mode) )
281
+ else if( db_allow_symlinks() && S_ISLNK(fileStat.st_mode) )
283282
return PERM_LNK;
284283
}
285284
#endif
286285
return PERM_REG;
287286
}
@@ -330,21 +329,19 @@
330329
** but is something other than a directory.
331330
*/
332331
int file_wd_isdir(const char *zFilename){
333332
int rc;
334333
char *zFN;
335
- struct fossilStat dirFileStat;
336334
337335
zFN = mprintf("%s", zFilename);
338336
file_simplify_name(zFN, -1, 0);
339
- memset(&dirFileStat, 0, sizeof(struct fossilStat));
340
- rc = fossil_stat(zFN, &dirFileStat, 1, 1);
337
+ rc = getStat(zFN, 1);
341338
if( rc ){
342339
rc = 0; /* It does not exist at all. */
343
- }else if( S_ISDIR(dirFileStat.st_mode) ){
340
+ }else if( S_ISDIR(fileStat.st_mode) ){
344341
rc = 1; /* It exists and is a real directory. */
345
- }else if( !db_allow_symlinks(1) && S_ISLNK(dirFileStat.st_mode) ){
342
+ }else if( S_ISLNK(fileStat.st_mode) ){
346343
Blob content;
347344
blob_read_link(&content, zFN); /* It exists and is a link. */
348345
rc = file_wd_isdir(blob_str(&content)); /* Points to directory? */
349346
blob_reset(&content);
350347
}else{
@@ -511,11 +508,11 @@
511508
*/
512509
int file_wd_setexe(const char *zFilename, int onoff){
513510
int rc = 0;
514511
#if !defined(_WIN32)
515512
struct stat buf;
516
- if( fossil_stat(zFilename, &buf, 1, 0)!=0 || S_ISLNK(buf.st_mode) ) return 0;
513
+ if( fossil_stat(zFilename, &buf, 1)!=0 || S_ISLNK(buf.st_mode) ) return 0;
517514
if( onoff ){
518515
int targetMode = (buf.st_mode & 0444)>>2;
519516
if( (buf.st_mode & 0100)==0 ){
520517
chmod(zFilename, buf.st_mode | targetMode);
521518
rc = 1;
@@ -978,19 +975,19 @@
978975
blob_reset(&x);
979976
if( raw ){
980977
int rc;
981978
struct fossilStat testFileStat;
982979
memset(&testFileStat, 0, sizeof(struct fossilStat));
983
- rc = fossil_stat(zPath, &testFileStat, 0, 0);
980
+ rc = fossil_stat(zPath, &testFileStat, 0);
984981
fossil_print(" stat_rc = %d\n", rc);
985982
sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", testFileStat.st_size);
986983
fossil_print(" stat_size = %s\n", zBuf);
987984
sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", testFileStat.st_mtime);
988985
fossil_print(" stat_mtime = %s\n", zBuf);
989986
fossil_print(" stat_mode = %d\n", testFileStat.st_mode);
990987
memset(&testFileStat, 0, sizeof(struct fossilStat));
991
- rc = fossil_stat(zPath, &testFileStat, 1, 1);
988
+ rc = fossil_stat(zPath, &testFileStat, 1);
992989
fossil_print(" l_stat_rc = %d\n", rc);
993990
sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", testFileStat.st_size);
994991
fossil_print(" l_stat_size = %s\n", zBuf);
995992
sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", testFileStat.st_mtime);
996993
fossil_print(" l_stat_mtime = %s\n", zBuf);
@@ -1022,33 +1019,23 @@
10221019
** Options:
10231020
**
10241021
** --open-config Open the configuration database first.
10251022
** --slash Trailing slashes, if any, are retained.
10261023
** --reset Reset cached stat() info for each file.
1027
-** --symlinks BOOLEAN Force allow-symlinks on or off
10281024
*/
10291025
void cmd_test_file_environment(void){
10301026
int i;
10311027
int slashFlag = find_option("slash",0,0)!=0;
10321028
int resetFlag = find_option("reset",0,0)!=0;
1033
- const char *forceSymlinks = find_option("symlinks",0,1);
10341029
if( find_option("open-config", 0, 0)!=0 ){
10351030
Th_OpenConfig(1);
10361031
}
1037
- if( forceSymlinks ){
1038
- if( is_truth(forceSymlinks) ) g.allowSymlinks = 1;
1039
- if( is_false(forceSymlinks) ) g.allowSymlinks = 0;
1040
- }
1041
- fossil_print("Th_IsLocalOpen() = %d\n", Th_IsLocalOpen());
1042
- fossil_print("Th_IsRepositoryOpen() = %d\n", Th_IsRepositoryOpen());
1043
- fossil_print("Th_IsConfigOpen() = %d\n", Th_IsConfigOpen());
10441032
fossil_print("filenames_are_case_sensitive() = %d\n",
10451033
filenames_are_case_sensitive());
10461034
fossil_print("db_allow_symlinks_by_default() = %d\n",
10471035
db_allow_symlinks_by_default());
1048
- fossil_print("db_allow_symlinks(0) = %d\n", db_allow_symlinks(0));
1049
- fossil_print("db_allow_symlinks(1) = %d\n", db_allow_symlinks(1));
1036
+ fossil_print("db_allow_symlinks() = %d\n", db_allow_symlinks());
10501037
for(i=2; i<g.argc; i++){
10511038
emitFileStat(g.argv[i], 1, slashFlag, resetFlag);
10521039
emitFileStat(g.argv[i], 0, slashFlag, resetFlag);
10531040
}
10541041
}
@@ -1058,26 +1045,31 @@
10581045
**
10591046
** Usage: %fossil test-canonical-name FILENAME...
10601047
**
10611048
** Test the operation of the canonical name generator.
10621049
** Also test Fossil's ability to measure attributes of a file.
1063
-**
1064
-** Options:
1065
-**
1066
-** --open-config Open the configuration database first.
1067
-** --slash Trailing slashes, if any, are retained.
1068
-** --reset Reset cached stat() info for each file.
10691050
*/
10701051
void cmd_test_canonical_name(void){
10711052
int i;
1053
+ Blob x;
10721054
int slashFlag = find_option("slash",0,0)!=0;
1073
- int resetFlag = find_option("reset",0,0)!=0;
1074
- if( find_option("open-config", 0, 0)!=0 ){
1075
- Th_OpenConfig(1);
1076
- }
1055
+ blob_zero(&x);
10771056
for(i=2; i<g.argc; i++){
1078
- emitFileStat(g.argv[i], 0, slashFlag, resetFlag);
1057
+ char zBuf[100];
1058
+ const char *zName = g.argv[i];
1059
+ file_canonical_name(zName, &x, slashFlag);
1060
+ fossil_print("[%s] -> [%s]\n", zName, blob_buffer(&x));
1061
+ blob_reset(&x);
1062
+ sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_size(zName));
1063
+ fossil_print(" file_size = %s\n", zBuf);
1064
+ sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_mtime(zName));
1065
+ fossil_print(" file_mtime = %s\n", zBuf);
1066
+ fossil_print(" file_isfile = %d\n", file_wd_isfile(zName));
1067
+ fossil_print(" file_isfile_or_link = %d\n",file_wd_isfile_or_link(zName));
1068
+ fossil_print(" file_islink = %d\n", file_wd_islink(zName));
1069
+ fossil_print(" file_isexe = %d\n", file_wd_isexe(zName));
1070
+ fossil_print(" file_isdir = %d\n", file_wd_isdir(zName));
10791071
}
10801072
}
10811073
10821074
/*
10831075
** Return TRUE if the given filename is canonical.
@@ -1188,14 +1180,10 @@
11881180
11891181
/*
11901182
** COMMAND: test-relative-name
11911183
**
11921184
** Test the operation of the relative name generator.
1193
-**
1194
-** Options:
1195
-**
1196
-** --slash Trailing slashes, if any, are retained.
11971185
*/
11981186
void cmd_test_relative_name(void){
11991187
int i;
12001188
Blob x;
12011189
int slashFlag = find_option("slash",0,0)!=0;
@@ -1311,11 +1299,10 @@
13111299
**
13121300
** Options:
13131301
** --absolute Return an absolute path instead of a relative one.
13141302
** --case-sensitive B Enable or disable case-sensitive filenames. B is
13151303
** a boolean: "yes", "no", "true", "false", etc.
1316
-** --no-dir-symlinks Disables support for directory symlinks.
13171304
*/
13181305
void cmd_test_tree_name(void){
13191306
int i;
13201307
Blob x;
13211308
int absoluteFlag = find_option("absolute",0,0)!=0;
13221309
--- src/file.c
+++ src/file.c
@@ -88,17 +88,16 @@
88 **
89 */
90 static int fossil_stat(
91 const char *zFilename, /* name of file or directory to inspect. */
92 struct fossilStat *buf, /* pointer to buffer where info should go. */
93 int isWd, /* non-zero to consider look at symlink itself. */
94 int forceWd /* non-zero to force look at symlink itself. */
95 ){
96 int rc;
97 void *zMbcs = fossil_utf8_to_path(zFilename, 0);
98 #if !defined(_WIN32)
99 if( isWd && (forceWd || db_allow_symlinks(0)) ){
100 rc = lstat(zMbcs, buf);
101 }else{
102 rc = stat(zMbcs, buf);
103 }
104 #else
@@ -128,11 +127,11 @@
128 static int getStat(const char *zFilename, int isWd){
129 int rc = 0;
130 if( zFilename==0 ){
131 if( fileStatValid==0 ) rc = 1;
132 }else{
133 if( fossil_stat(zFilename, &fileStat, isWd, 0)!=0 ){
134 fileStatValid = 0;
135 rc = 1;
136 }else{
137 fileStatValid = 1;
138 rc = 0;
@@ -220,11 +219,11 @@
220 **
221 ** Arguments: target file (symlink will point to it), link file
222 **/
223 void symlink_create(const char *zTargetFile, const char *zLinkFile){
224 #if !defined(_WIN32)
225 if( db_allow_symlinks(0) ){
226 int i, nName;
227 char *zName, zBuf[1000];
228
229 nName = strlen(zLinkFile);
230 if( nName>=sizeof(zBuf) ){
@@ -277,11 +276,11 @@
277 int file_wd_perm(const char *zFilename){
278 #if !defined(_WIN32)
279 if( !getStat(zFilename, 1) ){
280 if( S_ISREG(fileStat.st_mode) && ((S_IXUSR)&fileStat.st_mode)!=0 )
281 return PERM_EXE;
282 else if( db_allow_symlinks(0) && S_ISLNK(fileStat.st_mode) )
283 return PERM_LNK;
284 }
285 #endif
286 return PERM_REG;
287 }
@@ -330,21 +329,19 @@
330 ** but is something other than a directory.
331 */
332 int file_wd_isdir(const char *zFilename){
333 int rc;
334 char *zFN;
335 struct fossilStat dirFileStat;
336
337 zFN = mprintf("%s", zFilename);
338 file_simplify_name(zFN, -1, 0);
339 memset(&dirFileStat, 0, sizeof(struct fossilStat));
340 rc = fossil_stat(zFN, &dirFileStat, 1, 1);
341 if( rc ){
342 rc = 0; /* It does not exist at all. */
343 }else if( S_ISDIR(dirFileStat.st_mode) ){
344 rc = 1; /* It exists and is a real directory. */
345 }else if( !db_allow_symlinks(1) && S_ISLNK(dirFileStat.st_mode) ){
346 Blob content;
347 blob_read_link(&content, zFN); /* It exists and is a link. */
348 rc = file_wd_isdir(blob_str(&content)); /* Points to directory? */
349 blob_reset(&content);
350 }else{
@@ -511,11 +508,11 @@
511 */
512 int file_wd_setexe(const char *zFilename, int onoff){
513 int rc = 0;
514 #if !defined(_WIN32)
515 struct stat buf;
516 if( fossil_stat(zFilename, &buf, 1, 0)!=0 || S_ISLNK(buf.st_mode) ) return 0;
517 if( onoff ){
518 int targetMode = (buf.st_mode & 0444)>>2;
519 if( (buf.st_mode & 0100)==0 ){
520 chmod(zFilename, buf.st_mode | targetMode);
521 rc = 1;
@@ -978,19 +975,19 @@
978 blob_reset(&x);
979 if( raw ){
980 int rc;
981 struct fossilStat testFileStat;
982 memset(&testFileStat, 0, sizeof(struct fossilStat));
983 rc = fossil_stat(zPath, &testFileStat, 0, 0);
984 fossil_print(" stat_rc = %d\n", rc);
985 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", testFileStat.st_size);
986 fossil_print(" stat_size = %s\n", zBuf);
987 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", testFileStat.st_mtime);
988 fossil_print(" stat_mtime = %s\n", zBuf);
989 fossil_print(" stat_mode = %d\n", testFileStat.st_mode);
990 memset(&testFileStat, 0, sizeof(struct fossilStat));
991 rc = fossil_stat(zPath, &testFileStat, 1, 1);
992 fossil_print(" l_stat_rc = %d\n", rc);
993 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", testFileStat.st_size);
994 fossil_print(" l_stat_size = %s\n", zBuf);
995 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", testFileStat.st_mtime);
996 fossil_print(" l_stat_mtime = %s\n", zBuf);
@@ -1022,33 +1019,23 @@
1022 ** Options:
1023 **
1024 ** --open-config Open the configuration database first.
1025 ** --slash Trailing slashes, if any, are retained.
1026 ** --reset Reset cached stat() info for each file.
1027 ** --symlinks BOOLEAN Force allow-symlinks on or off
1028 */
1029 void cmd_test_file_environment(void){
1030 int i;
1031 int slashFlag = find_option("slash",0,0)!=0;
1032 int resetFlag = find_option("reset",0,0)!=0;
1033 const char *forceSymlinks = find_option("symlinks",0,1);
1034 if( find_option("open-config", 0, 0)!=0 ){
1035 Th_OpenConfig(1);
1036 }
1037 if( forceSymlinks ){
1038 if( is_truth(forceSymlinks) ) g.allowSymlinks = 1;
1039 if( is_false(forceSymlinks) ) g.allowSymlinks = 0;
1040 }
1041 fossil_print("Th_IsLocalOpen() = %d\n", Th_IsLocalOpen());
1042 fossil_print("Th_IsRepositoryOpen() = %d\n", Th_IsRepositoryOpen());
1043 fossil_print("Th_IsConfigOpen() = %d\n", Th_IsConfigOpen());
1044 fossil_print("filenames_are_case_sensitive() = %d\n",
1045 filenames_are_case_sensitive());
1046 fossil_print("db_allow_symlinks_by_default() = %d\n",
1047 db_allow_symlinks_by_default());
1048 fossil_print("db_allow_symlinks(0) = %d\n", db_allow_symlinks(0));
1049 fossil_print("db_allow_symlinks(1) = %d\n", db_allow_symlinks(1));
1050 for(i=2; i<g.argc; i++){
1051 emitFileStat(g.argv[i], 1, slashFlag, resetFlag);
1052 emitFileStat(g.argv[i], 0, slashFlag, resetFlag);
1053 }
1054 }
@@ -1058,26 +1045,31 @@
1058 **
1059 ** Usage: %fossil test-canonical-name FILENAME...
1060 **
1061 ** Test the operation of the canonical name generator.
1062 ** Also test Fossil's ability to measure attributes of a file.
1063 **
1064 ** Options:
1065 **
1066 ** --open-config Open the configuration database first.
1067 ** --slash Trailing slashes, if any, are retained.
1068 ** --reset Reset cached stat() info for each file.
1069 */
1070 void cmd_test_canonical_name(void){
1071 int i;
 
1072 int slashFlag = find_option("slash",0,0)!=0;
1073 int resetFlag = find_option("reset",0,0)!=0;
1074 if( find_option("open-config", 0, 0)!=0 ){
1075 Th_OpenConfig(1);
1076 }
1077 for(i=2; i<g.argc; i++){
1078 emitFileStat(g.argv[i], 0, slashFlag, resetFlag);
 
 
 
 
 
 
 
 
 
 
 
 
 
1079 }
1080 }
1081
1082 /*
1083 ** Return TRUE if the given filename is canonical.
@@ -1188,14 +1180,10 @@
1188
1189 /*
1190 ** COMMAND: test-relative-name
1191 **
1192 ** Test the operation of the relative name generator.
1193 **
1194 ** Options:
1195 **
1196 ** --slash Trailing slashes, if any, are retained.
1197 */
1198 void cmd_test_relative_name(void){
1199 int i;
1200 Blob x;
1201 int slashFlag = find_option("slash",0,0)!=0;
@@ -1311,11 +1299,10 @@
1311 **
1312 ** Options:
1313 ** --absolute Return an absolute path instead of a relative one.
1314 ** --case-sensitive B Enable or disable case-sensitive filenames. B is
1315 ** a boolean: "yes", "no", "true", "false", etc.
1316 ** --no-dir-symlinks Disables support for directory symlinks.
1317 */
1318 void cmd_test_tree_name(void){
1319 int i;
1320 Blob x;
1321 int absoluteFlag = find_option("absolute",0,0)!=0;
1322
--- src/file.c
+++ src/file.c
@@ -88,17 +88,16 @@
88 **
89 */
90 static int fossil_stat(
91 const char *zFilename, /* name of file or directory to inspect. */
92 struct fossilStat *buf, /* pointer to buffer where info should go. */
93 int isWd /* non-zero to consider look at symlink itself. */
 
94 ){
95 int rc;
96 void *zMbcs = fossil_utf8_to_path(zFilename, 0);
97 #if !defined(_WIN32)
98 if( isWd && db_allow_symlinks() ){
99 rc = lstat(zMbcs, buf);
100 }else{
101 rc = stat(zMbcs, buf);
102 }
103 #else
@@ -128,11 +127,11 @@
127 static int getStat(const char *zFilename, int isWd){
128 int rc = 0;
129 if( zFilename==0 ){
130 if( fileStatValid==0 ) rc = 1;
131 }else{
132 if( fossil_stat(zFilename, &fileStat, isWd)!=0 ){
133 fileStatValid = 0;
134 rc = 1;
135 }else{
136 fileStatValid = 1;
137 rc = 0;
@@ -220,11 +219,11 @@
219 **
220 ** Arguments: target file (symlink will point to it), link file
221 **/
222 void symlink_create(const char *zTargetFile, const char *zLinkFile){
223 #if !defined(_WIN32)
224 if( db_allow_symlinks() ){
225 int i, nName;
226 char *zName, zBuf[1000];
227
228 nName = strlen(zLinkFile);
229 if( nName>=sizeof(zBuf) ){
@@ -277,11 +276,11 @@
276 int file_wd_perm(const char *zFilename){
277 #if !defined(_WIN32)
278 if( !getStat(zFilename, 1) ){
279 if( S_ISREG(fileStat.st_mode) && ((S_IXUSR)&fileStat.st_mode)!=0 )
280 return PERM_EXE;
281 else if( db_allow_symlinks() && S_ISLNK(fileStat.st_mode) )
282 return PERM_LNK;
283 }
284 #endif
285 return PERM_REG;
286 }
@@ -330,21 +329,19 @@
329 ** but is something other than a directory.
330 */
331 int file_wd_isdir(const char *zFilename){
332 int rc;
333 char *zFN;
 
334
335 zFN = mprintf("%s", zFilename);
336 file_simplify_name(zFN, -1, 0);
337 rc = getStat(zFN, 1);
 
338 if( rc ){
339 rc = 0; /* It does not exist at all. */
340 }else if( S_ISDIR(fileStat.st_mode) ){
341 rc = 1; /* It exists and is a real directory. */
342 }else if( S_ISLNK(fileStat.st_mode) ){
343 Blob content;
344 blob_read_link(&content, zFN); /* It exists and is a link. */
345 rc = file_wd_isdir(blob_str(&content)); /* Points to directory? */
346 blob_reset(&content);
347 }else{
@@ -511,11 +508,11 @@
508 */
509 int file_wd_setexe(const char *zFilename, int onoff){
510 int rc = 0;
511 #if !defined(_WIN32)
512 struct stat buf;
513 if( fossil_stat(zFilename, &buf, 1)!=0 || S_ISLNK(buf.st_mode) ) return 0;
514 if( onoff ){
515 int targetMode = (buf.st_mode & 0444)>>2;
516 if( (buf.st_mode & 0100)==0 ){
517 chmod(zFilename, buf.st_mode | targetMode);
518 rc = 1;
@@ -978,19 +975,19 @@
975 blob_reset(&x);
976 if( raw ){
977 int rc;
978 struct fossilStat testFileStat;
979 memset(&testFileStat, 0, sizeof(struct fossilStat));
980 rc = fossil_stat(zPath, &testFileStat, 0);
981 fossil_print(" stat_rc = %d\n", rc);
982 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", testFileStat.st_size);
983 fossil_print(" stat_size = %s\n", zBuf);
984 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", testFileStat.st_mtime);
985 fossil_print(" stat_mtime = %s\n", zBuf);
986 fossil_print(" stat_mode = %d\n", testFileStat.st_mode);
987 memset(&testFileStat, 0, sizeof(struct fossilStat));
988 rc = fossil_stat(zPath, &testFileStat, 1);
989 fossil_print(" l_stat_rc = %d\n", rc);
990 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", testFileStat.st_size);
991 fossil_print(" l_stat_size = %s\n", zBuf);
992 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", testFileStat.st_mtime);
993 fossil_print(" l_stat_mtime = %s\n", zBuf);
@@ -1022,33 +1019,23 @@
1019 ** Options:
1020 **
1021 ** --open-config Open the configuration database first.
1022 ** --slash Trailing slashes, if any, are retained.
1023 ** --reset Reset cached stat() info for each file.
 
1024 */
1025 void cmd_test_file_environment(void){
1026 int i;
1027 int slashFlag = find_option("slash",0,0)!=0;
1028 int resetFlag = find_option("reset",0,0)!=0;
 
1029 if( find_option("open-config", 0, 0)!=0 ){
1030 Th_OpenConfig(1);
1031 }
 
 
 
 
 
 
 
1032 fossil_print("filenames_are_case_sensitive() = %d\n",
1033 filenames_are_case_sensitive());
1034 fossil_print("db_allow_symlinks_by_default() = %d\n",
1035 db_allow_symlinks_by_default());
1036 fossil_print("db_allow_symlinks() = %d\n", db_allow_symlinks());
 
1037 for(i=2; i<g.argc; i++){
1038 emitFileStat(g.argv[i], 1, slashFlag, resetFlag);
1039 emitFileStat(g.argv[i], 0, slashFlag, resetFlag);
1040 }
1041 }
@@ -1058,26 +1045,31 @@
1045 **
1046 ** Usage: %fossil test-canonical-name FILENAME...
1047 **
1048 ** Test the operation of the canonical name generator.
1049 ** Also test Fossil's ability to measure attributes of a file.
 
 
 
 
 
 
1050 */
1051 void cmd_test_canonical_name(void){
1052 int i;
1053 Blob x;
1054 int slashFlag = find_option("slash",0,0)!=0;
1055 blob_zero(&x);
 
 
 
1056 for(i=2; i<g.argc; i++){
1057 char zBuf[100];
1058 const char *zName = g.argv[i];
1059 file_canonical_name(zName, &x, slashFlag);
1060 fossil_print("[%s] -> [%s]\n", zName, blob_buffer(&x));
1061 blob_reset(&x);
1062 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_size(zName));
1063 fossil_print(" file_size = %s\n", zBuf);
1064 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_mtime(zName));
1065 fossil_print(" file_mtime = %s\n", zBuf);
1066 fossil_print(" file_isfile = %d\n", file_wd_isfile(zName));
1067 fossil_print(" file_isfile_or_link = %d\n",file_wd_isfile_or_link(zName));
1068 fossil_print(" file_islink = %d\n", file_wd_islink(zName));
1069 fossil_print(" file_isexe = %d\n", file_wd_isexe(zName));
1070 fossil_print(" file_isdir = %d\n", file_wd_isdir(zName));
1071 }
1072 }
1073
1074 /*
1075 ** Return TRUE if the given filename is canonical.
@@ -1188,14 +1180,10 @@
1180
1181 /*
1182 ** COMMAND: test-relative-name
1183 **
1184 ** Test the operation of the relative name generator.
 
 
 
 
1185 */
1186 void cmd_test_relative_name(void){
1187 int i;
1188 Blob x;
1189 int slashFlag = find_option("slash",0,0)!=0;
@@ -1311,11 +1299,10 @@
1299 **
1300 ** Options:
1301 ** --absolute Return an absolute path instead of a relative one.
1302 ** --case-sensitive B Enable or disable case-sensitive filenames. B is
1303 ** a boolean: "yes", "no", "true", "false", etc.
 
1304 */
1305 void cmd_test_tree_name(void){
1306 int i;
1307 Blob x;
1308 int absoluteFlag = find_option("absolute",0,0)!=0;
1309
--- src/finfo.c
+++ src/finfo.c
@@ -45,11 +45,10 @@
4545
** --case-sensitive B Enable or disable case-sensitive filenames. B is a
4646
** boolean: "yes", "no", "true", "false", etc.
4747
** -l|--log select log mode (the default)
4848
** -n|--limit N Display the first N changes (default unlimited).
4949
** N<=0 means no limit.
50
-** --no-dir-symlinks Disables support for directory symlinks.
5150
** --offset P skip P changes
5251
** -p|--print select print mode
5352
** -r|--revision R print the given revision (or ckout, if none is given)
5453
** to stdout (only in print mode)
5554
** -s|--status select status mode (print a status indicator for FILE)
5655
--- src/finfo.c
+++ src/finfo.c
@@ -45,11 +45,10 @@
45 ** --case-sensitive B Enable or disable case-sensitive filenames. B is a
46 ** boolean: "yes", "no", "true", "false", etc.
47 ** -l|--log select log mode (the default)
48 ** -n|--limit N Display the first N changes (default unlimited).
49 ** N<=0 means no limit.
50 ** --no-dir-symlinks Disables support for directory symlinks.
51 ** --offset P skip P changes
52 ** -p|--print select print mode
53 ** -r|--revision R print the given revision (or ckout, if none is given)
54 ** to stdout (only in print mode)
55 ** -s|--status select status mode (print a status indicator for FILE)
56
--- src/finfo.c
+++ src/finfo.c
@@ -45,11 +45,10 @@
45 ** --case-sensitive B Enable or disable case-sensitive filenames. B is a
46 ** boolean: "yes", "no", "true", "false", etc.
47 ** -l|--log select log mode (the default)
48 ** -n|--limit N Display the first N changes (default unlimited).
49 ** N<=0 means no limit.
 
50 ** --offset P skip P changes
51 ** -p|--print select print mode
52 ** -r|--revision R print the given revision (or ckout, if none is given)
53 ** to stdout (only in print mode)
54 ** -s|--status select status mode (print a status indicator for FILE)
55
-2
--- src/main.c
+++ src/main.c
@@ -141,11 +141,10 @@
141141
char *zOpenRevision; /* Check-in version to use during database open */
142142
int localOpen; /* True if the local database is open */
143143
char *zLocalRoot; /* The directory holding the local database */
144144
int minPrefix; /* Number of digits needed for a distinct UUID */
145145
int eHashPolicy; /* Current hash policy. One of HPOLICY_* */
146
- int fNoDirSymlinks; /* True if --no-dir-symlinks flag is present */
147146
int fSqlTrace; /* True if --sqltrace flag is present */
148147
int fSqlStats; /* True if --sqltrace or --sqlstats are present */
149148
int fSqlPrint; /* True if -sqlprint flag is present */
150149
int fQuiet; /* True if -quiet flag is present */
151150
int fJail; /* True if running with a chroot jail */
@@ -622,11 +621,10 @@
622621
fossil_exit(1);
623622
}else{
624623
const char *zChdir = find_option("chdir",0,1);
625624
g.isHTTP = 0;
626625
g.rcvid = 0;
627
- g.fNoDirSymlinks = find_option("no-dir-symlinks", 0, 0)!=0;
628626
g.fQuiet = find_option("quiet", 0, 0)!=0;
629627
g.fSqlTrace = find_option("sqltrace", 0, 0)!=0;
630628
g.fSqlStats = find_option("sqlstats", 0, 0)!=0;
631629
g.fSystemTrace = find_option("systemtrace", 0, 0)!=0;
632630
g.fSshTrace = find_option("sshtrace", 0, 0)!=0;
633631
--- src/main.c
+++ src/main.c
@@ -141,11 +141,10 @@
141 char *zOpenRevision; /* Check-in version to use during database open */
142 int localOpen; /* True if the local database is open */
143 char *zLocalRoot; /* The directory holding the local database */
144 int minPrefix; /* Number of digits needed for a distinct UUID */
145 int eHashPolicy; /* Current hash policy. One of HPOLICY_* */
146 int fNoDirSymlinks; /* True if --no-dir-symlinks flag is present */
147 int fSqlTrace; /* True if --sqltrace flag is present */
148 int fSqlStats; /* True if --sqltrace or --sqlstats are present */
149 int fSqlPrint; /* True if -sqlprint flag is present */
150 int fQuiet; /* True if -quiet flag is present */
151 int fJail; /* True if running with a chroot jail */
@@ -622,11 +621,10 @@
622 fossil_exit(1);
623 }else{
624 const char *zChdir = find_option("chdir",0,1);
625 g.isHTTP = 0;
626 g.rcvid = 0;
627 g.fNoDirSymlinks = find_option("no-dir-symlinks", 0, 0)!=0;
628 g.fQuiet = find_option("quiet", 0, 0)!=0;
629 g.fSqlTrace = find_option("sqltrace", 0, 0)!=0;
630 g.fSqlStats = find_option("sqlstats", 0, 0)!=0;
631 g.fSystemTrace = find_option("systemtrace", 0, 0)!=0;
632 g.fSshTrace = find_option("sshtrace", 0, 0)!=0;
633
--- src/main.c
+++ src/main.c
@@ -141,11 +141,10 @@
141 char *zOpenRevision; /* Check-in version to use during database open */
142 int localOpen; /* True if the local database is open */
143 char *zLocalRoot; /* The directory holding the local database */
144 int minPrefix; /* Number of digits needed for a distinct UUID */
145 int eHashPolicy; /* Current hash policy. One of HPOLICY_* */
 
146 int fSqlTrace; /* True if --sqltrace flag is present */
147 int fSqlStats; /* True if --sqltrace or --sqlstats are present */
148 int fSqlPrint; /* True if -sqlprint flag is present */
149 int fQuiet; /* True if -quiet flag is present */
150 int fJail; /* True if running with a chroot jail */
@@ -622,11 +621,10 @@
621 fossil_exit(1);
622 }else{
623 const char *zChdir = find_option("chdir",0,1);
624 g.isHTTP = 0;
625 g.rcvid = 0;
 
626 g.fQuiet = find_option("quiet", 0, 0)!=0;
627 g.fSqlTrace = find_option("sqltrace", 0, 0)!=0;
628 g.fSqlStats = find_option("sqlstats", 0, 0)!=0;
629 g.fSystemTrace = find_option("systemtrace", 0, 0)!=0;
630 g.fSshTrace = find_option("sshtrace", 0, 0)!=0;
631
--- src/merge.c
+++ src/merge.c
@@ -206,12 +206,10 @@
206206
**
207207
** --force-missing Force the merge even if there is missing content.
208208
**
209209
** --integrate Merged branch will be closed when committing.
210210
**
211
-** --no-dir-symlinks Disables support for directory symlinks.
212
-**
213211
** -n|--dry-run If given, display instead of run actions
214212
**
215213
** -v|--verbose Show additional details of the merge
216214
*/
217215
void merge_cmd(void){
218216
--- src/merge.c
+++ src/merge.c
@@ -206,12 +206,10 @@
206 **
207 ** --force-missing Force the merge even if there is missing content.
208 **
209 ** --integrate Merged branch will be closed when committing.
210 **
211 ** --no-dir-symlinks Disables support for directory symlinks.
212 **
213 ** -n|--dry-run If given, display instead of run actions
214 **
215 ** -v|--verbose Show additional details of the merge
216 */
217 void merge_cmd(void){
218
--- src/merge.c
+++ src/merge.c
@@ -206,12 +206,10 @@
206 **
207 ** --force-missing Force the merge even if there is missing content.
208 **
209 ** --integrate Merged branch will be closed when committing.
210 **
 
 
211 ** -n|--dry-run If given, display instead of run actions
212 **
213 ** -v|--verbose Show additional details of the merge
214 */
215 void merge_cmd(void){
216
+7 -8
--- src/th_main.c
+++ src/th_main.c
@@ -21,18 +21,10 @@
2121
#include "config.h"
2222
#include "th_main.h"
2323
#include "sqlite3.h"
2424
2525
#if INTERFACE
26
-/*
27
-** These macros are used within this file to detect if the repository and
28
-** configuration ("user") database are currently open.
29
-*/
30
-#define Th_IsLocalOpen() (g.localOpen)
31
-#define Th_IsRepositoryOpen() (g.repositoryOpen)
32
-#define Th_IsConfigOpen() (g.zConfigDbName!=0)
33
-
3426
/*
3527
** Flag parameters to the Th_FossilInit() routine used to control the
3628
** interpreter creation and initialization process.
3729
*/
3830
#define TH_INIT_NONE ((u32)0x00000000) /* No flags. */
@@ -67,10 +59,17 @@
6759
*/
6860
#define NO_COMMAND_HOOK_ERROR "no such command: command_hook"
6961
#define NO_WEBPAGE_HOOK_ERROR "no such command: webpage_hook"
7062
#endif
7163
64
+/*
65
+** These macros are used within this file to detect if the repository and
66
+** configuration ("user") database are currently open.
67
+*/
68
+#define Th_IsRepositoryOpen() (g.repositoryOpen)
69
+#define Th_IsConfigOpen() (g.zConfigDbName!=0)
70
+
7271
/*
7372
** Global variable counting the number of outstanding calls to malloc()
7473
** made by the th1 implementation. This is used to catch memory leaks
7574
** in the interpreter. Obviously, it also means th1 is not threadsafe.
7675
*/
7776
--- src/th_main.c
+++ src/th_main.c
@@ -21,18 +21,10 @@
21 #include "config.h"
22 #include "th_main.h"
23 #include "sqlite3.h"
24
25 #if INTERFACE
26 /*
27 ** These macros are used within this file to detect if the repository and
28 ** configuration ("user") database are currently open.
29 */
30 #define Th_IsLocalOpen() (g.localOpen)
31 #define Th_IsRepositoryOpen() (g.repositoryOpen)
32 #define Th_IsConfigOpen() (g.zConfigDbName!=0)
33
34 /*
35 ** Flag parameters to the Th_FossilInit() routine used to control the
36 ** interpreter creation and initialization process.
37 */
38 #define TH_INIT_NONE ((u32)0x00000000) /* No flags. */
@@ -67,10 +59,17 @@
67 */
68 #define NO_COMMAND_HOOK_ERROR "no such command: command_hook"
69 #define NO_WEBPAGE_HOOK_ERROR "no such command: webpage_hook"
70 #endif
71
 
 
 
 
 
 
 
72 /*
73 ** Global variable counting the number of outstanding calls to malloc()
74 ** made by the th1 implementation. This is used to catch memory leaks
75 ** in the interpreter. Obviously, it also means th1 is not threadsafe.
76 */
77
--- src/th_main.c
+++ src/th_main.c
@@ -21,18 +21,10 @@
21 #include "config.h"
22 #include "th_main.h"
23 #include "sqlite3.h"
24
25 #if INTERFACE
 
 
 
 
 
 
 
 
26 /*
27 ** Flag parameters to the Th_FossilInit() routine used to control the
28 ** interpreter creation and initialization process.
29 */
30 #define TH_INIT_NONE ((u32)0x00000000) /* No flags. */
@@ -67,10 +59,17 @@
59 */
60 #define NO_COMMAND_HOOK_ERROR "no such command: command_hook"
61 #define NO_WEBPAGE_HOOK_ERROR "no such command: webpage_hook"
62 #endif
63
64 /*
65 ** These macros are used within this file to detect if the repository and
66 ** configuration ("user") database are currently open.
67 */
68 #define Th_IsRepositoryOpen() (g.repositoryOpen)
69 #define Th_IsConfigOpen() (g.zConfigDbName!=0)
70
71 /*
72 ** Global variable counting the number of outstanding calls to malloc()
73 ** made by the th1 implementation. This is used to catch memory leaks
74 ** in the interpreter. Obviously, it also means th1 is not threadsafe.
75 */
76
--- src/update.c
+++ src/update.c
@@ -95,11 +95,10 @@
9595
** Options:
9696
** --case-sensitive <BOOL> override case-sensitive setting
9797
** --debug print debug information on stdout
9898
** --latest acceptable in place of VERSION, update to latest version
9999
** --force-missing force update if missing content after sync
100
-** --no-dir-symlinks Disables support for directory symlinks.
101100
** -n|--dry-run If given, display instead of run actions
102101
** -v|--verbose print status information about all files
103102
** -W|--width <num> Width of lines (default is to auto-detect). Must be >20
104103
** or 0 (= no limit, resulting in a single line per entry).
105104
**
106105
--- src/update.c
+++ src/update.c
@@ -95,11 +95,10 @@
95 ** Options:
96 ** --case-sensitive <BOOL> override case-sensitive setting
97 ** --debug print debug information on stdout
98 ** --latest acceptable in place of VERSION, update to latest version
99 ** --force-missing force update if missing content after sync
100 ** --no-dir-symlinks Disables support for directory symlinks.
101 ** -n|--dry-run If given, display instead of run actions
102 ** -v|--verbose print status information about all files
103 ** -W|--width <num> Width of lines (default is to auto-detect). Must be >20
104 ** or 0 (= no limit, resulting in a single line per entry).
105 **
106
--- src/update.c
+++ src/update.c
@@ -95,11 +95,10 @@
95 ** Options:
96 ** --case-sensitive <BOOL> override case-sensitive setting
97 ** --debug print debug information on stdout
98 ** --latest acceptable in place of VERSION, update to latest version
99 ** --force-missing force update if missing content after sync
 
100 ** -n|--dry-run If given, display instead of run actions
101 ** -v|--verbose print status information about all files
102 ** -W|--width <num> Width of lines (default is to auto-detect). Must be >20
103 ** or 0 (= no limit, resulting in a single line per entry).
104 **
105

Keyboard Shortcuts

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