Fossil SCM
The touch command no longer treats missing files as a fatal error, instead emitting a warning message.
Commit
56530e9b6d061abbc79ea902354ef241acd9271579bb25f08843a39cd64977c3
Parent
847423edfaae1dd…
1 file changed
+8
-8
+8
-8
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -1810,17 +1810,16 @@ | ||
| 1810 | 1810 | ** or subdir-relative filename. |
| 1811 | 1811 | ** |
| 1812 | 1812 | ** newMTime is the file's new timestamp (Unix epoch). |
| 1813 | 1813 | ** |
| 1814 | 1814 | ** Returns 1 if it sets zAbsName's mtime, 0 if it does not (indicating |
| 1815 | -** that the file already has that timestamp or a warning was emitted). | |
| 1816 | -** Dies fatally if given an unresolvable filename. If dryRunFlag is | |
| 1817 | -** true then it outputs the name of the file it would have timestamped | |
| 1818 | -** but does not stamp the file. If verboseFlag is true, it outputs a | |
| 1819 | -** message if the file's timestamp is actually modified. If quietFlag | |
| 1820 | -** is true then the output of non-fatal warning messages is | |
| 1821 | -** suppressed. | |
| 1815 | +** that the file already has that timestamp or a warning was emitted | |
| 1816 | +** or was not found). If dryRunFlag is true then it outputs the name | |
| 1817 | +** of the file it would have timestamped but does not stamp the | |
| 1818 | +** file. If verboseFlag is true, it outputs a message if the file's | |
| 1819 | +** timestamp is actually modified. If quietFlag is true then the | |
| 1820 | +** output of non-fatal warning messages is suppressed. | |
| 1822 | 1821 | ** |
| 1823 | 1822 | ** As a special case, if newMTime is 0 then this function emits a |
| 1824 | 1823 | ** warning (unless quietFlag is true), does NOT set the timestamp, and |
| 1825 | 1824 | ** returns 0. The timestamp is known to be zero when |
| 1826 | 1825 | ** mtime_of_manifest_file() is asked to provide the timestamp for a |
| @@ -1839,11 +1838,12 @@ | ||
| 1839 | 1838 | } |
| 1840 | 1839 | return 0; |
| 1841 | 1840 | } |
| 1842 | 1841 | currentMtime = file_mtime(zAbsName, 0); |
| 1843 | 1842 | if(currentMtime<0){ |
| 1844 | - fossil_fatal("Cannot stat file: %s\n", zAbsName); | |
| 1843 | + fossil_print("SKIPPING: cannot stat file: %s\n", zAbsName); | |
| 1844 | + return 0; | |
| 1845 | 1845 | }else if(currentMtime==newMtime){ |
| 1846 | 1846 | return 0; |
| 1847 | 1847 | }else if( dryRunFlag!=0 ){ |
| 1848 | 1848 | fossil_print( "dry-run: %s\n", zTreeName ); |
| 1849 | 1849 | }else{ |
| 1850 | 1850 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -1810,17 +1810,16 @@ | |
| 1810 | ** or subdir-relative filename. |
| 1811 | ** |
| 1812 | ** newMTime is the file's new timestamp (Unix epoch). |
| 1813 | ** |
| 1814 | ** Returns 1 if it sets zAbsName's mtime, 0 if it does not (indicating |
| 1815 | ** that the file already has that timestamp or a warning was emitted). |
| 1816 | ** Dies fatally if given an unresolvable filename. If dryRunFlag is |
| 1817 | ** true then it outputs the name of the file it would have timestamped |
| 1818 | ** but does not stamp the file. If verboseFlag is true, it outputs a |
| 1819 | ** message if the file's timestamp is actually modified. If quietFlag |
| 1820 | ** is true then the output of non-fatal warning messages is |
| 1821 | ** suppressed. |
| 1822 | ** |
| 1823 | ** As a special case, if newMTime is 0 then this function emits a |
| 1824 | ** warning (unless quietFlag is true), does NOT set the timestamp, and |
| 1825 | ** returns 0. The timestamp is known to be zero when |
| 1826 | ** mtime_of_manifest_file() is asked to provide the timestamp for a |
| @@ -1839,11 +1838,12 @@ | |
| 1839 | } |
| 1840 | return 0; |
| 1841 | } |
| 1842 | currentMtime = file_mtime(zAbsName, 0); |
| 1843 | if(currentMtime<0){ |
| 1844 | fossil_fatal("Cannot stat file: %s\n", zAbsName); |
| 1845 | }else if(currentMtime==newMtime){ |
| 1846 | return 0; |
| 1847 | }else if( dryRunFlag!=0 ){ |
| 1848 | fossil_print( "dry-run: %s\n", zTreeName ); |
| 1849 | }else{ |
| 1850 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -1810,17 +1810,16 @@ | |
| 1810 | ** or subdir-relative filename. |
| 1811 | ** |
| 1812 | ** newMTime is the file's new timestamp (Unix epoch). |
| 1813 | ** |
| 1814 | ** Returns 1 if it sets zAbsName's mtime, 0 if it does not (indicating |
| 1815 | ** that the file already has that timestamp or a warning was emitted |
| 1816 | ** or was not found). If dryRunFlag is true then it outputs the name |
| 1817 | ** of the file it would have timestamped but does not stamp the |
| 1818 | ** file. If verboseFlag is true, it outputs a message if the file's |
| 1819 | ** timestamp is actually modified. If quietFlag is true then the |
| 1820 | ** output of non-fatal warning messages is suppressed. |
| 1821 | ** |
| 1822 | ** As a special case, if newMTime is 0 then this function emits a |
| 1823 | ** warning (unless quietFlag is true), does NOT set the timestamp, and |
| 1824 | ** returns 0. The timestamp is known to be zero when |
| 1825 | ** mtime_of_manifest_file() is asked to provide the timestamp for a |
| @@ -1839,11 +1838,12 @@ | |
| 1838 | } |
| 1839 | return 0; |
| 1840 | } |
| 1841 | currentMtime = file_mtime(zAbsName, 0); |
| 1842 | if(currentMtime<0){ |
| 1843 | fossil_print("SKIPPING: cannot stat file: %s\n", zAbsName); |
| 1844 | return 0; |
| 1845 | }else if(currentMtime==newMtime){ |
| 1846 | return 0; |
| 1847 | }else if( dryRunFlag!=0 ){ |
| 1848 | fossil_print( "dry-run: %s\n", zTreeName ); |
| 1849 | }else{ |
| 1850 |