Improve 'redo -v' output whitespace.

It was too hard to tell when an ifchange ended and the commands from the
prior level started running again.  Now it's a little better.
This commit is contained in:
Avery Pennarun 2010-11-18 23:06:38 -08:00
commit c4287b9d81
3 changed files with 11 additions and 9 deletions

View file

@ -33,23 +33,21 @@ def mkdirp(d, mode=None):
raise
def _log(s):
def log_(s):
sys.stdout.flush()
sys.stderr.write(s)
sys.stderr.flush()
def _clog(s):
if vars.VERBOSE: _log('\n')
_log('\x1b[32mredo %s\x1b[1m%s\x1b[m' % (vars.DEPTH, s))
log_('\x1b[32mredo %s\x1b[1m%s\x1b[m' % (vars.DEPTH, s))
def _bwlog(s):
if vars.VERBOSE: _log('\n')
_log('redo %s%s' % (vars.DEPTH, s))
log_('redo %s%s' % (vars.DEPTH, s))
def _cerr(s):
_log('\x1b[31mredo: %s\x1b[1m%s\x1b[m' % (vars.DEPTH, s))
log_('\x1b[31mredo: %s\x1b[1m%s\x1b[m' % (vars.DEPTH, s))
def _bwerr(s):
_log('redo: %s%s' % (vars.DEPTH, s))
log_('redo: %s%s' % (vars.DEPTH, s))
if os.isatty(2):
@ -62,10 +60,10 @@ else:
def debug(s):
if vars.DEBUG >= 1:
_log('redo: %s%s' % (vars.DEPTH, s))
log_('redo: %s%s' % (vars.DEPTH, s))
def debug2(s):
if vars.DEBUG >= 2:
_log('redo: %s%s' % (vars.DEPTH, s))
log_('redo: %s%s' % (vars.DEPTH, s))
def relpath(t, base):