From 8a97b0cb2ccedc74c8fc6565a1cb6ef03706169a Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Sat, 2 Mar 2019 03:18:17 -0500 Subject: [PATCH] redo-ifchange regression: if REDO_LOG is not set, assume it's 1. At some point this got broken during a refactoring. The result was that redo-ifchange, run from the command line (as opposed to inside a .do script) would fail to start the log prettifier. --- redo/env.py | 2 +- t/100-args/all.do | 2 +- t/100-args/clean.do | 2 +- t/100-args/noargs/all.do | 1 + t/100-args/noargs/run.do | 3 +++ 5 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 t/100-args/noargs/all.do create mode 100644 t/100-args/noargs/run.do diff --git a/redo/env.py b/redo/env.py index 104f532..ca416d4 100644 --- a/redo/env.py +++ b/redo/env.py @@ -35,7 +35,7 @@ class Env(object): self.VERBOSE = _get_bool('REDO_VERBOSE', '') self.XTRACE = _get_bool('REDO_XTRACE', '') self.KEEP_GOING = _get_bool('REDO_KEEP_GOING', '') - self.LOG = _get_int('REDO_LOG', '') + self.LOG = _get_int('REDO_LOG', '1') self.LOG_INODE = _get('REDO_LOG_INODE', '') self.COLOR = _get_int('REDO_COLOR', '') self.PRETTY = _get_int('REDO_PRETTY', '') diff --git a/t/100-args/all.do b/t/100-args/all.do index bcb13f5..ac34ba3 100644 --- a/t/100-args/all.do +++ b/t/100-args/all.do @@ -1,2 +1,2 @@ -redo test.args test2.args passfailtest +redo test.args test2.args passfailtest noargs/run . ../skip-if-minimal-do.sh diff --git a/t/100-args/clean.do b/t/100-args/clean.do index 655f41d..c9914e6 100644 --- a/t/100-args/clean.do +++ b/t/100-args/clean.do @@ -1 +1 @@ -rm -f passfail *~ .*~ +rm -f passfail *~ .*~ */*~ */.*~ noargs/all diff --git a/t/100-args/noargs/all.do b/t/100-args/noargs/all.do new file mode 100644 index 0000000..fa6c74c --- /dev/null +++ b/t/100-args/noargs/all.do @@ -0,0 +1 @@ +echo RAN >$3 diff --git a/t/100-args/noargs/run.do b/t/100-args/noargs/run.do new file mode 100644 index 0000000..f365ebf --- /dev/null +++ b/t/100-args/noargs/run.do @@ -0,0 +1,3 @@ +rm -f all +redo-ifchange # should not default to 'all' since not running from top level +[ ! -e all ] || exit 11