Fossil SCM
Coding style, removing superfluous 'then' clauses from tester.tcl.
Commit
4946b5b186cdd2f24a37bd5a8a273c7f9f8a7bbf
Parent
b0081d9786a665d…
1 file changed
+6
-6
+6
-6
| --- test/tester.tcl | ||
| +++ test/tester.tcl | ||
| @@ -793,25 +793,25 @@ | ||
| 793 | 793 | # NOTE: On Windows, the "stop argument" must be the name of a file |
| 794 | 794 | # that does NOT already exist. |
| 795 | 795 | # |
| 796 | 796 | if {[string length $stopArg] > 0 && \ |
| 797 | 797 | ![file exists $stopArg] && \ |
| 798 | - [catch {write_file $stopArg [clock seconds]}] == 0} then { | |
| 798 | + [catch {write_file $stopArg [clock seconds]}] == 0} { | |
| 799 | 799 | while {1} { |
| 800 | 800 | if {[catch { |
| 801 | 801 | # |
| 802 | 802 | # NOTE: Using the TaskList utility requires Windows XP or |
| 803 | 803 | # later. |
| 804 | 804 | # |
| 805 | 805 | exec tasklist.exe /FI "PID eq $pid" |
| 806 | - } result] != 0 || ![regexp -- " $pid " $result]} then { | |
| 806 | + } result] != 0 || ![regexp -- " $pid " $result]} { | |
| 807 | 807 | break |
| 808 | 808 | } |
| 809 | 809 | after 1000; # wait a bit... |
| 810 | 810 | } |
| 811 | 811 | file delete $stopArg |
| 812 | - if {[string length $fileName] > 0} then { | |
| 812 | + if {[string length $fileName] > 0} { | |
| 813 | 813 | file delete $fileName |
| 814 | 814 | } |
| 815 | 815 | return true |
| 816 | 816 | } |
| 817 | 817 | } else { |
| @@ -818,24 +818,24 @@ | ||
| 818 | 818 | # |
| 819 | 819 | # NOTE: On Unix, the "stop argument" must be an integer identifier |
| 820 | 820 | # that refers to an existing process. |
| 821 | 821 | # |
| 822 | 822 | if {[regexp {^(?:-)?\d+$} $stopArg] && \ |
| 823 | - [catch {exec kill -TERM $stopArg}] == 0} then { | |
| 823 | + [catch {exec kill -TERM $stopArg}] == 0} { | |
| 824 | 824 | while {1} { |
| 825 | 825 | if {[catch { |
| 826 | 826 | # |
| 827 | 827 | # TODO: Is this portable to all the supported variants of |
| 828 | 828 | # Unix? It should be, it's POSIX. |
| 829 | 829 | # |
| 830 | 830 | exec ps -p $pid |
| 831 | - } result] != 0 || ![regexp -- "(?:^$pid| $pid) " $result]} then { | |
| 831 | + } result] != 0 || ![regexp -- "(?:^$pid| $pid) " $result]} { | |
| 832 | 832 | break |
| 833 | 833 | } |
| 834 | 834 | after 1000; # wait a bit... |
| 835 | 835 | } |
| 836 | - if {[string length $fileName] > 0} then { | |
| 836 | + if {[string length $fileName] > 0} { | |
| 837 | 837 | file delete $fileName |
| 838 | 838 | } |
| 839 | 839 | return true |
| 840 | 840 | } |
| 841 | 841 | } |
| 842 | 842 |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -793,25 +793,25 @@ | |
| 793 | # NOTE: On Windows, the "stop argument" must be the name of a file |
| 794 | # that does NOT already exist. |
| 795 | # |
| 796 | if {[string length $stopArg] > 0 && \ |
| 797 | ![file exists $stopArg] && \ |
| 798 | [catch {write_file $stopArg [clock seconds]}] == 0} then { |
| 799 | while {1} { |
| 800 | if {[catch { |
| 801 | # |
| 802 | # NOTE: Using the TaskList utility requires Windows XP or |
| 803 | # later. |
| 804 | # |
| 805 | exec tasklist.exe /FI "PID eq $pid" |
| 806 | } result] != 0 || ![regexp -- " $pid " $result]} then { |
| 807 | break |
| 808 | } |
| 809 | after 1000; # wait a bit... |
| 810 | } |
| 811 | file delete $stopArg |
| 812 | if {[string length $fileName] > 0} then { |
| 813 | file delete $fileName |
| 814 | } |
| 815 | return true |
| 816 | } |
| 817 | } else { |
| @@ -818,24 +818,24 @@ | |
| 818 | # |
| 819 | # NOTE: On Unix, the "stop argument" must be an integer identifier |
| 820 | # that refers to an existing process. |
| 821 | # |
| 822 | if {[regexp {^(?:-)?\d+$} $stopArg] && \ |
| 823 | [catch {exec kill -TERM $stopArg}] == 0} then { |
| 824 | while {1} { |
| 825 | if {[catch { |
| 826 | # |
| 827 | # TODO: Is this portable to all the supported variants of |
| 828 | # Unix? It should be, it's POSIX. |
| 829 | # |
| 830 | exec ps -p $pid |
| 831 | } result] != 0 || ![regexp -- "(?:^$pid| $pid) " $result]} then { |
| 832 | break |
| 833 | } |
| 834 | after 1000; # wait a bit... |
| 835 | } |
| 836 | if {[string length $fileName] > 0} then { |
| 837 | file delete $fileName |
| 838 | } |
| 839 | return true |
| 840 | } |
| 841 | } |
| 842 |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -793,25 +793,25 @@ | |
| 793 | # NOTE: On Windows, the "stop argument" must be the name of a file |
| 794 | # that does NOT already exist. |
| 795 | # |
| 796 | if {[string length $stopArg] > 0 && \ |
| 797 | ![file exists $stopArg] && \ |
| 798 | [catch {write_file $stopArg [clock seconds]}] == 0} { |
| 799 | while {1} { |
| 800 | if {[catch { |
| 801 | # |
| 802 | # NOTE: Using the TaskList utility requires Windows XP or |
| 803 | # later. |
| 804 | # |
| 805 | exec tasklist.exe /FI "PID eq $pid" |
| 806 | } result] != 0 || ![regexp -- " $pid " $result]} { |
| 807 | break |
| 808 | } |
| 809 | after 1000; # wait a bit... |
| 810 | } |
| 811 | file delete $stopArg |
| 812 | if {[string length $fileName] > 0} { |
| 813 | file delete $fileName |
| 814 | } |
| 815 | return true |
| 816 | } |
| 817 | } else { |
| @@ -818,24 +818,24 @@ | |
| 818 | # |
| 819 | # NOTE: On Unix, the "stop argument" must be an integer identifier |
| 820 | # that refers to an existing process. |
| 821 | # |
| 822 | if {[regexp {^(?:-)?\d+$} $stopArg] && \ |
| 823 | [catch {exec kill -TERM $stopArg}] == 0} { |
| 824 | while {1} { |
| 825 | if {[catch { |
| 826 | # |
| 827 | # TODO: Is this portable to all the supported variants of |
| 828 | # Unix? It should be, it's POSIX. |
| 829 | # |
| 830 | exec ps -p $pid |
| 831 | } result] != 0 || ![regexp -- "(?:^$pid| $pid) " $result]} { |
| 832 | break |
| 833 | } |
| 834 | after 1000; # wait a bit... |
| 835 | } |
| 836 | if {[string length $fileName] > 0} { |
| 837 | file delete $fileName |
| 838 | } |
| 839 | return true |
| 840 | } |
| 841 | } |
| 842 |