# # # patch "options_list.hh" # from [0d16e20cef1cca3e40f7f39c7a8cec68aaaa0c88] # to [09854be32f901676c97f66d3014c5e786d6b18fd] # # patch "tests/date_formatting/__driver__.lua" # from [cede0e6d9fbbdc70932cdd81089eb43915941b43] # to [69b27686e2336bae0ef015111d784239f64e33df] # ============================================================ --- options_list.hh 0d16e20cef1cca3e40f7f39c7a8cec68aaaa0c88 +++ options_list.hh 09854be32f901676c97f66d3014c5e786d6b18fd @@ -247,12 +247,17 @@ SIMPLE_OPTION(date, "date", date_t, SIMPLE_OPTION(date, "date", date_t, gettext_noop("override date/time for commit")) -// FIXME: --date-format and --no-format-dates should override eachother OPTSET(date_formats) OPTSET_REL(globals, date_formats) -GROUPED_SIMPLE_OPTION(date_formats, date_fmt, - "date-format", std::string, - gettext_noop("strftime(3) format specification for printing dates")) +OPTVAR(date_formats, std::string, date_fmt, ) +OPTION(date_formats, date_fmt, true, "date-format", + gettext_noop("strftime(3) format specification for printing dates")) +#ifdef option_bodies +{ + date_fmt = arg; + no_format_dates = false; +} +#endif GROUPED_SIMPLE_OPTION(date_formats, no_format_dates, "no-format-dates", bool, gettext_noop("print date certs exactly as stored in the database")) ============================================================ --- tests/date_formatting/__driver__.lua cede0e6d9fbbdc70932cdd81089eb43915941b43 +++ tests/date_formatting/__driver__.lua 69b27686e2336bae0ef015111d784239f64e33df @@ -24,6 +24,15 @@ test_tz_fmt(nil, "%Y-%m-%d %I:%M:%S", "1 test_tz_fmt(nil, "%Y-%m-%d %H:%M:%S", "1999-12-31 13:00:00") test_tz_fmt(nil, "%Y-%m-%d %I:%M:%S", "1999-12-31 01:00:00") +-- check that --date-format=xxx and --no-format-dates override eachother +check(mtn("log", "--brief", "--no-graph", "--date-format=%Y", "--no-format-dates"), + 0, true, false) +check(samelines("stdout", { rev .. " address@hidden 1999-12-31T13:00:00 B" })) +check(mtn("log", "--brief", "--no-graph", "--no-format-dates", "--date-format=%Y"), + 0, true, false) +check(samelines("stdout", { rev .. " address@hidden 1999 B" })) + + -- Windows' strftime() doesn't support %T, and MinGW uses the -- version provided by Windows rather than having its own. skip_if(ostype=="Windows")