Fossil SCM

The touch command no longer treats missing files as a fatal error, instead emitting a warning message.

stephan 2019-06-17 07:09 trunk
Commit 56530e9b6d061abbc79ea902354ef241acd9271579bb25f08843a39cd64977c3
1 file changed +8 -8
+8 -8
--- src/file.c
+++ src/file.c
@@ -1810,17 +1810,16 @@
18101810
** or subdir-relative filename.
18111811
**
18121812
** newMTime is the file's new timestamp (Unix epoch).
18131813
**
18141814
** 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.
18221821
**
18231822
** As a special case, if newMTime is 0 then this function emits a
18241823
** warning (unless quietFlag is true), does NOT set the timestamp, and
18251824
** returns 0. The timestamp is known to be zero when
18261825
** mtime_of_manifest_file() is asked to provide the timestamp for a
@@ -1839,11 +1838,12 @@
18391838
}
18401839
return 0;
18411840
}
18421841
currentMtime = file_mtime(zAbsName, 0);
18431842
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;
18451845
}else if(currentMtime==newMtime){
18461846
return 0;
18471847
}else if( dryRunFlag!=0 ){
18481848
fossil_print( "dry-run: %s\n", zTreeName );
18491849
}else{
18501850
--- 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

Keyboard Shortcuts

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