Revert "Show ETA only if it is smart status"
Revert submission 2853087 Reason for revert: not necessary Reverted changes: /q/submissionid:2853087 Change-Id: I747948ce5bec656851bf9a50e136bf7e3aae8df6
This commit is contained in:
committed by
Gerrit Code Review
parent
0ba68e40bb
commit
b6d5ff505d
@@ -25,7 +25,6 @@ import (
|
|||||||
type formatter struct {
|
type formatter struct {
|
||||||
format string
|
format string
|
||||||
quiet bool
|
quiet bool
|
||||||
smart bool
|
|
||||||
start time.Time
|
start time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,11 +32,10 @@ type formatter struct {
|
|||||||
// the terminal in a format similar to Ninja.
|
// the terminal in a format similar to Ninja.
|
||||||
// format takes nearly all the same options as NINJA_STATUS.
|
// format takes nearly all the same options as NINJA_STATUS.
|
||||||
// %c is currently unsupported.
|
// %c is currently unsupported.
|
||||||
func newFormatter(format string, quiet bool, smart bool) formatter {
|
func newFormatter(format string, quiet bool) formatter {
|
||||||
return formatter{
|
return formatter{
|
||||||
format: format,
|
format: format,
|
||||||
quiet: quiet,
|
quiet: quiet,
|
||||||
smart: smart,
|
|
||||||
start: time.Now(),
|
start: time.Now(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -63,9 +61,8 @@ func remainingTimeString(t time.Time) string {
|
|||||||
func (s formatter) progress(counts status.Counts) string {
|
func (s formatter) progress(counts status.Counts) string {
|
||||||
if s.format == "" {
|
if s.format == "" {
|
||||||
output := fmt.Sprintf("[%3d%% %d/%d", 100*counts.FinishedActions/counts.TotalActions, counts.FinishedActions, counts.TotalActions)
|
output := fmt.Sprintf("[%3d%% %d/%d", 100*counts.FinishedActions/counts.TotalActions, counts.FinishedActions, counts.TotalActions)
|
||||||
// Not to break parsing logic in the build bot
|
|
||||||
// TODO(b/313981966): make buildbot more flexible for output format
|
if !counts.EstimatedTime.IsZero() {
|
||||||
if s.smart && !counts.EstimatedTime.IsZero() {
|
|
||||||
output += fmt.Sprintf(" %s remaining", remainingTimeString(counts.EstimatedTime))
|
output += fmt.Sprintf(" %s remaining", remainingTimeString(counts.EstimatedTime))
|
||||||
}
|
}
|
||||||
output += "] "
|
output += "] "
|
||||||
|
@@ -27,10 +27,9 @@ import (
|
|||||||
// statusFormat takes nearly all the same options as NINJA_STATUS.
|
// statusFormat takes nearly all the same options as NINJA_STATUS.
|
||||||
// %c is currently unsupported.
|
// %c is currently unsupported.
|
||||||
func NewStatusOutput(w io.Writer, statusFormat string, forceSimpleOutput, quietBuild, forceKeepANSI bool) status.StatusOutput {
|
func NewStatusOutput(w io.Writer, statusFormat string, forceSimpleOutput, quietBuild, forceKeepANSI bool) status.StatusOutput {
|
||||||
useSmartStatus := !forceSimpleOutput && isSmartTerminal(w)
|
formatter := newFormatter(statusFormat, quietBuild)
|
||||||
formatter := newFormatter(statusFormat, quietBuild, useSmartStatus)
|
|
||||||
|
|
||||||
if useSmartStatus {
|
if !forceSimpleOutput && isSmartTerminal(w) {
|
||||||
return NewSmartStatusOutput(w, formatter)
|
return NewSmartStatusOutput(w, formatter)
|
||||||
} else {
|
} else {
|
||||||
return NewSimpleStatusOutput(w, formatter, forceKeepANSI)
|
return NewSimpleStatusOutput(w, formatter, forceKeepANSI)
|
||||||
|
Reference in New Issue
Block a user