Fossil SCM
Remove the --no-dir-symlinks option. This is a back-out of check-in [2375d6cbce933267] together with other cleanup changes.
Commit
b7272185ca664fcbc13161f699fd941c70272e98f3f2cfb18870e87eef73e55a
Parent
ffc252a663d6c05…
9 files changed
-4
+8
-10
+2
-7
+28
-41
-1
-2
-2
+7
-8
-1
-4
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -276,11 +276,10 @@ | ||
| 276 | 276 | ** -f|--force Add files without prompting |
| 277 | 277 | ** --ignore <CSG> Ignore unmanaged files matching patterns from |
| 278 | 278 | ** the comma separated list of glob patterns. |
| 279 | 279 | ** --clean <CSG> Also ignore files matching patterns from |
| 280 | 280 | ** the comma separated list of glob patterns. |
| 281 | -** --no-dir-symlinks Disables support for directory symlinks. | |
| 282 | 281 | ** |
| 283 | 282 | ** See also: addremove, rm |
| 284 | 283 | */ |
| 285 | 284 | void add_cmd(void){ |
| 286 | 285 | int i; /* Loop counter */ |
| @@ -442,11 +441,10 @@ | ||
| 442 | 441 | ** --soft Skip removing files from the checkout. |
| 443 | 442 | ** This supersedes the --hard option. |
| 444 | 443 | ** --hard Remove files from the checkout. |
| 445 | 444 | ** --case-sensitive <BOOL> Override the case-sensitive setting. |
| 446 | 445 | ** -n|--dry-run If given, display instead of run actions. |
| 447 | -** --no-dir-symlinks Disables support for directory symlinks. | |
| 448 | 446 | ** |
| 449 | 447 | ** See also: addremove, add |
| 450 | 448 | */ |
| 451 | 449 | void delete_cmd(void){ |
| 452 | 450 | int i; |
| @@ -624,11 +622,10 @@ | ||
| 624 | 622 | ** --ignore <CSG> Ignore unmanaged files matching patterns from |
| 625 | 623 | ** the comma separated list of glob patterns. |
| 626 | 624 | ** --clean <CSG> Also ignore files matching patterns from |
| 627 | 625 | ** the comma separated list of glob patterns. |
| 628 | 626 | ** -n|--dry-run If given, display instead of run actions. |
| 629 | -** --no-dir-symlinks Disables support for directory symlinks. | |
| 630 | 627 | ** |
| 631 | 628 | ** See also: add, rm |
| 632 | 629 | */ |
| 633 | 630 | void addremove_cmd(void){ |
| 634 | 631 | Blob path; |
| @@ -852,11 +849,10 @@ | ||
| 852 | 849 | ** --soft Skip moving files within the checkout. |
| 853 | 850 | ** This supersedes the --hard option. |
| 854 | 851 | ** --hard Move files within the checkout. |
| 855 | 852 | ** --case-sensitive <BOOL> Override the case-sensitive setting. |
| 856 | 853 | ** -n|--dry-run If given, display instead of run actions. |
| 857 | -** --no-dir-symlinks Disables support for directory symlinks. | |
| 858 | 854 | ** |
| 859 | 855 | ** See also: changes, status |
| 860 | 856 | */ |
| 861 | 857 | void mv_cmd(void){ |
| 862 | 858 | int i; |
| 863 | 859 |
| --- 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 @@ | ||
| 417 | 417 | ** --hash Verify file status using hashing rather than |
| 418 | 418 | ** relying on file mtimes. |
| 419 | 419 | ** --case-sensitive <BOOL> Override case-sensitive setting. |
| 420 | 420 | ** --dotfiles Include unmanaged files beginning with a dot. |
| 421 | 421 | ** --ignore <CSG> Ignore unmanaged files matching CSG glob patterns. |
| 422 | -** --no-dir-symlinks Disables support for directory symlinks. | |
| 423 | 422 | ** |
| 424 | 423 | ** Options specific to the changes command: |
| 425 | 424 | ** --header Identify the repository if report is non-empty. |
| 426 | 425 | ** -v|--verbose Say "(none)" if the change report is empty. |
| 427 | 426 | ** --classify Start each line with the file's change type. |
| @@ -826,11 +825,10 @@ | ||
| 826 | 825 | ** --abs-paths Display absolute pathnames. |
| 827 | 826 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 828 | 827 | ** --dotfiles include files beginning with a dot (".") |
| 829 | 828 | ** --header Identify the repository if there are extras |
| 830 | 829 | ** --ignore <CSG> ignore files matching patterns from the argument |
| 831 | -** --no-dir-symlinks Disables support for directory symlinks. | |
| 832 | 830 | ** --rel-paths Display pathnames relative to the current working |
| 833 | 831 | ** directory. |
| 834 | 832 | ** |
| 835 | 833 | ** See also: changes, clean, status |
| 836 | 834 | */ |
| @@ -856,10 +854,12 @@ | ||
| 856 | 854 | |
| 857 | 855 | if( zIgnoreFlag==0 ){ |
| 858 | 856 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 859 | 857 | } |
| 860 | 858 | pIgnore = glob_create(zIgnoreFlag); |
| 859 | + /* Always consider symlinks. */ | |
| 860 | + g.allowSymlinks = db_allow_symlinks_by_default(); | |
| 861 | 861 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore); |
| 862 | 862 | glob_free(pIgnore); |
| 863 | 863 | |
| 864 | 864 | blob_zero(&report); |
| 865 | 865 | status_report(&report, flags); |
| @@ -901,14 +901,13 @@ | ||
| 901 | 901 | ** |
| 902 | 902 | ** The default values for --clean, --ignore, and --keep are determined by |
| 903 | 903 | ** the (versionable) clean-glob, ignore-glob, and keep-glob settings. |
| 904 | 904 | ** |
| 905 | 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. | |
| 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. | |
| 910 | 909 | ** |
| 911 | 910 | ** Options: |
| 912 | 911 | ** --allckouts Check for empty directories within any checkouts |
| 913 | 912 | ** that may be nested within the current one. This |
| 914 | 913 | ** option should be used with great care because the |
| @@ -934,11 +933,11 @@ | ||
| 934 | 933 | ** -i|--prompt Prompt before removing each file. This option |
| 935 | 934 | ** implies the --disable-undo option. |
| 936 | 935 | ** -x|--verily WARNING: Removes everything that is not a managed |
| 937 | 936 | ** file or the repository itself. This option |
| 938 | 937 | ** implies the --force, --emptydirs, --dotfiles, and |
| 939 | -** --disable-undo, and --no-dir-symlinks options. | |
| 938 | +** --disable-undo options. | |
| 940 | 939 | ** Furthermore, it completely disregards the keep-glob |
| 941 | 940 | ** and ignore-glob settings. However, it does honor |
| 942 | 941 | ** the --ignore and --keep options. |
| 943 | 942 | ** --clean <CSG> WARNING: Never prompt to delete any files matching |
| 944 | 943 | ** this comma separated list of glob patterns. Also, |
| @@ -950,11 +949,10 @@ | ||
| 950 | 949 | ** list of glob patterns. |
| 951 | 950 | ** -n|--dry-run Delete nothing, but display what would have been |
| 952 | 951 | ** deleted. |
| 953 | 952 | ** --no-prompt This option disables prompting the user for input |
| 954 | 953 | ** and assumes an answer of 'No' for every question. |
| 955 | -** --no-dir-symlinks Disables support for directory symlinks. | |
| 956 | 954 | ** --temp Remove only Fossil-generated temporary files. |
| 957 | 955 | ** -v|--verbose Show all files as they are removed. |
| 958 | 956 | ** |
| 959 | 957 | ** See also: addremove, extras, status |
| 960 | 958 | */ |
| @@ -999,12 +997,10 @@ | ||
| 999 | 997 | verilyFlag = allFileFlag = allDirFlag = 1; |
| 1000 | 998 | emptyDirsFlag = 1; |
| 1001 | 999 | disableUndo = 1; |
| 1002 | 1000 | scanFlags |= SCAN_ALL; |
| 1003 | 1001 | zCleanFlag = 0; |
| 1004 | - g.fNoDirSymlinks = 1; /* Forbid symlink directory traversal. */ | |
| 1005 | - g.allowSymlinks = 1; /* Treat symlink files as content. */ | |
| 1006 | 1002 | } |
| 1007 | 1003 | if( zIgnoreFlag==0 && !verilyFlag ){ |
| 1008 | 1004 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 1009 | 1005 | } |
| 1010 | 1006 | if( zKeepFlag==0 && !verilyFlag ){ |
| @@ -1017,10 +1013,12 @@ | ||
| 1017 | 1013 | verify_all_options(); |
| 1018 | 1014 | pIgnore = glob_create(zIgnoreFlag); |
| 1019 | 1015 | pKeep = glob_create(zKeepFlag); |
| 1020 | 1016 | pClean = glob_create(zCleanFlag); |
| 1021 | 1017 | nRoot = (int)strlen(g.zLocalRoot); |
| 1018 | + /* Always consider symlinks. */ | |
| 1019 | + g.allowSymlinks = db_allow_symlinks_by_default(); | |
| 1022 | 1020 | if( !dirsOnlyFlag ){ |
| 1023 | 1021 | Stmt q; |
| 1024 | 1022 | Blob repo; |
| 1025 | 1023 | if( !dryRunFlag && !disableUndo ) undo_begin(); |
| 1026 | 1024 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore); |
| 1027 | 1025 |
| --- 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 |
M
src/db.c
+2
-7
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1475,17 +1475,12 @@ | ||
| 1475 | 1475 | } |
| 1476 | 1476 | |
| 1477 | 1477 | /* |
| 1478 | 1478 | ** Returns non-zero if support for symlinks is currently enabled. |
| 1479 | 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 | - } | |
| 1480 | +int db_allow_symlinks(void){ | |
| 1481 | + return g.allowSymlinks; | |
| 1487 | 1482 | } |
| 1488 | 1483 | |
| 1489 | 1484 | /* |
| 1490 | 1485 | ** Open the repository database given by zDbName. If zDbName==NULL then |
| 1491 | 1486 | ** get the name from the already open local database. |
| 1492 | 1487 |
| --- 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 @@ | ||
| 88 | 88 | ** |
| 89 | 89 | */ |
| 90 | 90 | static int fossil_stat( |
| 91 | 91 | const char *zFilename, /* name of file or directory to inspect. */ |
| 92 | 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. */ | |
| 93 | + int isWd /* non-zero to consider look at symlink itself. */ | |
| 95 | 94 | ){ |
| 96 | 95 | int rc; |
| 97 | 96 | void *zMbcs = fossil_utf8_to_path(zFilename, 0); |
| 98 | 97 | #if !defined(_WIN32) |
| 99 | - if( isWd && (forceWd || db_allow_symlinks(0)) ){ | |
| 98 | + if( isWd && db_allow_symlinks() ){ | |
| 100 | 99 | rc = lstat(zMbcs, buf); |
| 101 | 100 | }else{ |
| 102 | 101 | rc = stat(zMbcs, buf); |
| 103 | 102 | } |
| 104 | 103 | #else |
| @@ -128,11 +127,11 @@ | ||
| 128 | 127 | static int getStat(const char *zFilename, int isWd){ |
| 129 | 128 | int rc = 0; |
| 130 | 129 | if( zFilename==0 ){ |
| 131 | 130 | if( fileStatValid==0 ) rc = 1; |
| 132 | 131 | }else{ |
| 133 | - if( fossil_stat(zFilename, &fileStat, isWd, 0)!=0 ){ | |
| 132 | + if( fossil_stat(zFilename, &fileStat, isWd)!=0 ){ | |
| 134 | 133 | fileStatValid = 0; |
| 135 | 134 | rc = 1; |
| 136 | 135 | }else{ |
| 137 | 136 | fileStatValid = 1; |
| 138 | 137 | rc = 0; |
| @@ -220,11 +219,11 @@ | ||
| 220 | 219 | ** |
| 221 | 220 | ** Arguments: target file (symlink will point to it), link file |
| 222 | 221 | **/ |
| 223 | 222 | void symlink_create(const char *zTargetFile, const char *zLinkFile){ |
| 224 | 223 | #if !defined(_WIN32) |
| 225 | - if( db_allow_symlinks(0) ){ | |
| 224 | + if( db_allow_symlinks() ){ | |
| 226 | 225 | int i, nName; |
| 227 | 226 | char *zName, zBuf[1000]; |
| 228 | 227 | |
| 229 | 228 | nName = strlen(zLinkFile); |
| 230 | 229 | if( nName>=sizeof(zBuf) ){ |
| @@ -277,11 +276,11 @@ | ||
| 277 | 276 | int file_wd_perm(const char *zFilename){ |
| 278 | 277 | #if !defined(_WIN32) |
| 279 | 278 | if( !getStat(zFilename, 1) ){ |
| 280 | 279 | if( S_ISREG(fileStat.st_mode) && ((S_IXUSR)&fileStat.st_mode)!=0 ) |
| 281 | 280 | 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) ) | |
| 283 | 282 | return PERM_LNK; |
| 284 | 283 | } |
| 285 | 284 | #endif |
| 286 | 285 | return PERM_REG; |
| 287 | 286 | } |
| @@ -330,21 +329,19 @@ | ||
| 330 | 329 | ** but is something other than a directory. |
| 331 | 330 | */ |
| 332 | 331 | int file_wd_isdir(const char *zFilename){ |
| 333 | 332 | int rc; |
| 334 | 333 | char *zFN; |
| 335 | - struct fossilStat dirFileStat; | |
| 336 | 334 | |
| 337 | 335 | zFN = mprintf("%s", zFilename); |
| 338 | 336 | 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); | |
| 341 | 338 | if( rc ){ |
| 342 | 339 | rc = 0; /* It does not exist at all. */ |
| 343 | - }else if( S_ISDIR(dirFileStat.st_mode) ){ | |
| 340 | + }else if( S_ISDIR(fileStat.st_mode) ){ | |
| 344 | 341 | 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) ){ | |
| 346 | 343 | Blob content; |
| 347 | 344 | blob_read_link(&content, zFN); /* It exists and is a link. */ |
| 348 | 345 | rc = file_wd_isdir(blob_str(&content)); /* Points to directory? */ |
| 349 | 346 | blob_reset(&content); |
| 350 | 347 | }else{ |
| @@ -511,11 +508,11 @@ | ||
| 511 | 508 | */ |
| 512 | 509 | int file_wd_setexe(const char *zFilename, int onoff){ |
| 513 | 510 | int rc = 0; |
| 514 | 511 | #if !defined(_WIN32) |
| 515 | 512 | 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; | |
| 517 | 514 | if( onoff ){ |
| 518 | 515 | int targetMode = (buf.st_mode & 0444)>>2; |
| 519 | 516 | if( (buf.st_mode & 0100)==0 ){ |
| 520 | 517 | chmod(zFilename, buf.st_mode | targetMode); |
| 521 | 518 | rc = 1; |
| @@ -978,19 +975,19 @@ | ||
| 978 | 975 | blob_reset(&x); |
| 979 | 976 | if( raw ){ |
| 980 | 977 | int rc; |
| 981 | 978 | struct fossilStat testFileStat; |
| 982 | 979 | memset(&testFileStat, 0, sizeof(struct fossilStat)); |
| 983 | - rc = fossil_stat(zPath, &testFileStat, 0, 0); | |
| 980 | + rc = fossil_stat(zPath, &testFileStat, 0); | |
| 984 | 981 | fossil_print(" stat_rc = %d\n", rc); |
| 985 | 982 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", testFileStat.st_size); |
| 986 | 983 | fossil_print(" stat_size = %s\n", zBuf); |
| 987 | 984 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", testFileStat.st_mtime); |
| 988 | 985 | fossil_print(" stat_mtime = %s\n", zBuf); |
| 989 | 986 | fossil_print(" stat_mode = %d\n", testFileStat.st_mode); |
| 990 | 987 | memset(&testFileStat, 0, sizeof(struct fossilStat)); |
| 991 | - rc = fossil_stat(zPath, &testFileStat, 1, 1); | |
| 988 | + rc = fossil_stat(zPath, &testFileStat, 1); | |
| 992 | 989 | fossil_print(" l_stat_rc = %d\n", rc); |
| 993 | 990 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", testFileStat.st_size); |
| 994 | 991 | fossil_print(" l_stat_size = %s\n", zBuf); |
| 995 | 992 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", testFileStat.st_mtime); |
| 996 | 993 | fossil_print(" l_stat_mtime = %s\n", zBuf); |
| @@ -1022,33 +1019,23 @@ | ||
| 1022 | 1019 | ** Options: |
| 1023 | 1020 | ** |
| 1024 | 1021 | ** --open-config Open the configuration database first. |
| 1025 | 1022 | ** --slash Trailing slashes, if any, are retained. |
| 1026 | 1023 | ** --reset Reset cached stat() info for each file. |
| 1027 | -** --symlinks BOOLEAN Force allow-symlinks on or off | |
| 1028 | 1024 | */ |
| 1029 | 1025 | void cmd_test_file_environment(void){ |
| 1030 | 1026 | int i; |
| 1031 | 1027 | int slashFlag = find_option("slash",0,0)!=0; |
| 1032 | 1028 | int resetFlag = find_option("reset",0,0)!=0; |
| 1033 | - const char *forceSymlinks = find_option("symlinks",0,1); | |
| 1034 | 1029 | if( find_option("open-config", 0, 0)!=0 ){ |
| 1035 | 1030 | Th_OpenConfig(1); |
| 1036 | 1031 | } |
| 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 | 1032 | fossil_print("filenames_are_case_sensitive() = %d\n", |
| 1045 | 1033 | filenames_are_case_sensitive()); |
| 1046 | 1034 | fossil_print("db_allow_symlinks_by_default() = %d\n", |
| 1047 | 1035 | 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()); | |
| 1050 | 1037 | for(i=2; i<g.argc; i++){ |
| 1051 | 1038 | emitFileStat(g.argv[i], 1, slashFlag, resetFlag); |
| 1052 | 1039 | emitFileStat(g.argv[i], 0, slashFlag, resetFlag); |
| 1053 | 1040 | } |
| 1054 | 1041 | } |
| @@ -1058,26 +1045,31 @@ | ||
| 1058 | 1045 | ** |
| 1059 | 1046 | ** Usage: %fossil test-canonical-name FILENAME... |
| 1060 | 1047 | ** |
| 1061 | 1048 | ** Test the operation of the canonical name generator. |
| 1062 | 1049 | ** 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 | 1050 | */ |
| 1070 | 1051 | void cmd_test_canonical_name(void){ |
| 1071 | 1052 | int i; |
| 1053 | + Blob x; | |
| 1072 | 1054 | 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); | |
| 1077 | 1056 | 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)); | |
| 1079 | 1071 | } |
| 1080 | 1072 | } |
| 1081 | 1073 | |
| 1082 | 1074 | /* |
| 1083 | 1075 | ** Return TRUE if the given filename is canonical. |
| @@ -1188,14 +1180,10 @@ | ||
| 1188 | 1180 | |
| 1189 | 1181 | /* |
| 1190 | 1182 | ** COMMAND: test-relative-name |
| 1191 | 1183 | ** |
| 1192 | 1184 | ** Test the operation of the relative name generator. |
| 1193 | -** | |
| 1194 | -** Options: | |
| 1195 | -** | |
| 1196 | -** --slash Trailing slashes, if any, are retained. | |
| 1197 | 1185 | */ |
| 1198 | 1186 | void cmd_test_relative_name(void){ |
| 1199 | 1187 | int i; |
| 1200 | 1188 | Blob x; |
| 1201 | 1189 | int slashFlag = find_option("slash",0,0)!=0; |
| @@ -1311,11 +1299,10 @@ | ||
| 1311 | 1299 | ** |
| 1312 | 1300 | ** Options: |
| 1313 | 1301 | ** --absolute Return an absolute path instead of a relative one. |
| 1314 | 1302 | ** --case-sensitive B Enable or disable case-sensitive filenames. B is |
| 1315 | 1303 | ** a boolean: "yes", "no", "true", "false", etc. |
| 1316 | -** --no-dir-symlinks Disables support for directory symlinks. | |
| 1317 | 1304 | */ |
| 1318 | 1305 | void cmd_test_tree_name(void){ |
| 1319 | 1306 | int i; |
| 1320 | 1307 | Blob x; |
| 1321 | 1308 | int absoluteFlag = find_option("absolute",0,0)!=0; |
| 1322 | 1309 |
| --- 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 |
-1
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -45,11 +45,10 @@ | ||
| 45 | 45 | ** --case-sensitive B Enable or disable case-sensitive filenames. B is a |
| 46 | 46 | ** boolean: "yes", "no", "true", "false", etc. |
| 47 | 47 | ** -l|--log select log mode (the default) |
| 48 | 48 | ** -n|--limit N Display the first N changes (default unlimited). |
| 49 | 49 | ** N<=0 means no limit. |
| 50 | -** --no-dir-symlinks Disables support for directory symlinks. | |
| 51 | 50 | ** --offset P skip P changes |
| 52 | 51 | ** -p|--print select print mode |
| 53 | 52 | ** -r|--revision R print the given revision (or ckout, if none is given) |
| 54 | 53 | ** to stdout (only in print mode) |
| 55 | 54 | ** -s|--status select status mode (print a status indicator for FILE) |
| 56 | 55 |
| --- 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 @@ | ||
| 141 | 141 | char *zOpenRevision; /* Check-in version to use during database open */ |
| 142 | 142 | int localOpen; /* True if the local database is open */ |
| 143 | 143 | char *zLocalRoot; /* The directory holding the local database */ |
| 144 | 144 | int minPrefix; /* Number of digits needed for a distinct UUID */ |
| 145 | 145 | int eHashPolicy; /* Current hash policy. One of HPOLICY_* */ |
| 146 | - int fNoDirSymlinks; /* True if --no-dir-symlinks flag is present */ | |
| 147 | 146 | int fSqlTrace; /* True if --sqltrace flag is present */ |
| 148 | 147 | int fSqlStats; /* True if --sqltrace or --sqlstats are present */ |
| 149 | 148 | int fSqlPrint; /* True if -sqlprint flag is present */ |
| 150 | 149 | int fQuiet; /* True if -quiet flag is present */ |
| 151 | 150 | int fJail; /* True if running with a chroot jail */ |
| @@ -622,11 +621,10 @@ | ||
| 622 | 621 | fossil_exit(1); |
| 623 | 622 | }else{ |
| 624 | 623 | const char *zChdir = find_option("chdir",0,1); |
| 625 | 624 | g.isHTTP = 0; |
| 626 | 625 | g.rcvid = 0; |
| 627 | - g.fNoDirSymlinks = find_option("no-dir-symlinks", 0, 0)!=0; | |
| 628 | 626 | g.fQuiet = find_option("quiet", 0, 0)!=0; |
| 629 | 627 | g.fSqlTrace = find_option("sqltrace", 0, 0)!=0; |
| 630 | 628 | g.fSqlStats = find_option("sqlstats", 0, 0)!=0; |
| 631 | 629 | g.fSystemTrace = find_option("systemtrace", 0, 0)!=0; |
| 632 | 630 | g.fSshTrace = find_option("sshtrace", 0, 0)!=0; |
| 633 | 631 |
| --- 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 |
-2
| --- src/merge.c | ||
| +++ src/merge.c | ||
| @@ -206,12 +206,10 @@ | ||
| 206 | 206 | ** |
| 207 | 207 | ** --force-missing Force the merge even if there is missing content. |
| 208 | 208 | ** |
| 209 | 209 | ** --integrate Merged branch will be closed when committing. |
| 210 | 210 | ** |
| 211 | -** --no-dir-symlinks Disables support for directory symlinks. | |
| 212 | -** | |
| 213 | 211 | ** -n|--dry-run If given, display instead of run actions |
| 214 | 212 | ** |
| 215 | 213 | ** -v|--verbose Show additional details of the merge |
| 216 | 214 | */ |
| 217 | 215 | void merge_cmd(void){ |
| 218 | 216 |
| --- 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 @@ | ||
| 21 | 21 | #include "config.h" |
| 22 | 22 | #include "th_main.h" |
| 23 | 23 | #include "sqlite3.h" |
| 24 | 24 | |
| 25 | 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 | 26 | /* |
| 35 | 27 | ** Flag parameters to the Th_FossilInit() routine used to control the |
| 36 | 28 | ** interpreter creation and initialization process. |
| 37 | 29 | */ |
| 38 | 30 | #define TH_INIT_NONE ((u32)0x00000000) /* No flags. */ |
| @@ -67,10 +59,17 @@ | ||
| 67 | 59 | */ |
| 68 | 60 | #define NO_COMMAND_HOOK_ERROR "no such command: command_hook" |
| 69 | 61 | #define NO_WEBPAGE_HOOK_ERROR "no such command: webpage_hook" |
| 70 | 62 | #endif |
| 71 | 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 | + | |
| 72 | 71 | /* |
| 73 | 72 | ** Global variable counting the number of outstanding calls to malloc() |
| 74 | 73 | ** made by the th1 implementation. This is used to catch memory leaks |
| 75 | 74 | ** in the interpreter. Obviously, it also means th1 is not threadsafe. |
| 76 | 75 | */ |
| 77 | 76 |
| --- 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 |
-1
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -95,11 +95,10 @@ | ||
| 95 | 95 | ** Options: |
| 96 | 96 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 97 | 97 | ** --debug print debug information on stdout |
| 98 | 98 | ** --latest acceptable in place of VERSION, update to latest version |
| 99 | 99 | ** --force-missing force update if missing content after sync |
| 100 | -** --no-dir-symlinks Disables support for directory symlinks. | |
| 101 | 100 | ** -n|--dry-run If given, display instead of run actions |
| 102 | 101 | ** -v|--verbose print status information about all files |
| 103 | 102 | ** -W|--width <num> Width of lines (default is to auto-detect). Must be >20 |
| 104 | 103 | ** or 0 (= no limit, resulting in a single line per entry). |
| 105 | 104 | ** |
| 106 | 105 |
| --- 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 |