Fossil SCM
Semantics of the progress display extended to allow an empty maximum to signal use of an infinite (open-ended) display.
Commit
ebb94f75cb229fddf31e3eb8d81b9cf056593b2e
Parent
f76192b24597c6c…
1 file changed
+7
-1
+7
-1
| --- tools/lib/log.tcl | ||
| +++ tools/lib/log.tcl | ||
| @@ -12,10 +12,12 @@ | ||
| 12 | 12 | |
| 13 | 13 | # Feedback generation. |
| 14 | 14 | # |
| 15 | 15 | # vc::tools::log::write verbosity system text - Write message to the log. |
| 16 | 16 | # vc::tools::log::progress verbosity system n max - Drive a progress display. |
| 17 | +# | |
| 18 | +# Note: max empty => infinite progress display, otherwise a finite display. | |
| 17 | 19 | |
| 18 | 20 | # Administrative operations. |
| 19 | 21 | # |
| 20 | 22 | # vc::tools::log::verbosity level - Set the verbosity level of the application. |
| 21 | 23 | # vc::tools::log::verbosity? - Query the verbosity level of the application. |
| @@ -122,11 +124,15 @@ | ||
| 122 | 124 | |
| 123 | 125 | # Progress handler. Uses \r to return to the beginning of the current |
| 124 | 126 | # line without advancing. |
| 125 | 127 | |
| 126 | 128 | proc ::vc::tools::log::OUT/progress {system n max} { |
| 127 | - puts -nonewline "$system [format %[string length $max]s $n]/$max\r" | |
| 129 | + if {$max eq {}} { | |
| 130 | + puts -nonewline "$system $n\r" | |
| 131 | + } else { | |
| 132 | + puts -nonewline "$system [format %[string length $max]s $n]/$max\r" | |
| 133 | + } | |
| 128 | 134 | flush stdout |
| 129 | 135 | return |
| 130 | 136 | } |
| 131 | 137 | |
| 132 | 138 | # ----------------------------------------------------------------------------- |
| 133 | 139 |
| --- tools/lib/log.tcl | |
| +++ tools/lib/log.tcl | |
| @@ -12,10 +12,12 @@ | |
| 12 | |
| 13 | # Feedback generation. |
| 14 | # |
| 15 | # vc::tools::log::write verbosity system text - Write message to the log. |
| 16 | # vc::tools::log::progress verbosity system n max - Drive a progress display. |
| 17 | |
| 18 | # Administrative operations. |
| 19 | # |
| 20 | # vc::tools::log::verbosity level - Set the verbosity level of the application. |
| 21 | # vc::tools::log::verbosity? - Query the verbosity level of the application. |
| @@ -122,11 +124,15 @@ | |
| 122 | |
| 123 | # Progress handler. Uses \r to return to the beginning of the current |
| 124 | # line without advancing. |
| 125 | |
| 126 | proc ::vc::tools::log::OUT/progress {system n max} { |
| 127 | puts -nonewline "$system [format %[string length $max]s $n]/$max\r" |
| 128 | flush stdout |
| 129 | return |
| 130 | } |
| 131 | |
| 132 | # ----------------------------------------------------------------------------- |
| 133 |
| --- tools/lib/log.tcl | |
| +++ tools/lib/log.tcl | |
| @@ -12,10 +12,12 @@ | |
| 12 | |
| 13 | # Feedback generation. |
| 14 | # |
| 15 | # vc::tools::log::write verbosity system text - Write message to the log. |
| 16 | # vc::tools::log::progress verbosity system n max - Drive a progress display. |
| 17 | # |
| 18 | # Note: max empty => infinite progress display, otherwise a finite display. |
| 19 | |
| 20 | # Administrative operations. |
| 21 | # |
| 22 | # vc::tools::log::verbosity level - Set the verbosity level of the application. |
| 23 | # vc::tools::log::verbosity? - Query the verbosity level of the application. |
| @@ -122,11 +124,15 @@ | |
| 124 | |
| 125 | # Progress handler. Uses \r to return to the beginning of the current |
| 126 | # line without advancing. |
| 127 | |
| 128 | proc ::vc::tools::log::OUT/progress {system n max} { |
| 129 | if {$max eq {}} { |
| 130 | puts -nonewline "$system $n\r" |
| 131 | } else { |
| 132 | puts -nonewline "$system [format %[string length $max]s $n]/$max\r" |
| 133 | } |
| 134 | flush stdout |
| 135 | return |
| 136 | } |
| 137 | |
| 138 | # ----------------------------------------------------------------------------- |
| 139 |