Synopsis:  co(1) -M sets working file mtime with UTC+1 regardless of DST and 
ignores -z
Category:  user
Environment:
    OpenBSD 7.8-current amd64 (snapshot as of 2025-09-17)
    Locale/timezone used below: TZ=Europe/Prague (CEST, UTC+2 on 2025-09-15)

Description:
`co -M` should set the working file’s modification time to the date of the
retrieved revision, honoring the selected timezone (e.g. `-zLT`) and DST.
Currently, it appears to apply UTC+1 (CET) unconditionally: the resulting mtime
is +1 hour from UTC even on a date where local time in Europe/Prague is CEST 
(UTC+2).
It also seems to ignore `-z` (including `-zLT`).

Minimal reproducible transcript:

    $ uname -a
    OpenBSD host 7.8 GENERIC.MP#... amd64

    # Fresh RCS file with a known timestamp:
    $ printf 'x\n' > bb
    $ ci -i -t- -mbase bb
    RCS/bb,v <-- bb
    initial revision: 1.1

    # Check in revision with explicit local time including offset +0200
    # => stored UTC should be 14:57:41
    $ co -l bb
    $ printf 'y\n' >> bb
    $ ci -d '2025-09-15 16:57:41 +0200' -mX bb
    RCS/bb,v  <--  bb
    new revision: 1.2; previous revision: 1.1

    # rlog shows UTC as expected (14:57:41)
    $ rlog -r bb | grep date:
    date: 2025/09/15 14:57:41;  author: ...

    # Now check out with -M and ask for local time formatting (-zLT)
    $ TZ=Europe/Prague co -M -zLT bb > /dev/null

    # Inspect working file mtime precisely (seconds and zone):
    $ stat -f '%Sm' -t '%Y-%m-%d %H:%M:%S %Z' bb
    2025-09-15 15:57:41 CEST

Actual result:
- Working file mtime is `15:57:41 CEST` (UTC+1 applied to 14:57:41Z),
  i.e. as if CET was used, not CEST.
- The result is the same regardless of `-z`, e.g. `-z`, `-zLT`, or `-z'+02:00'`.

Expected result:
- On 2025-09-15 in Europe/Prague (DST in effect), mtime should be
  `16:57:41 CEST`, i.e. UTC+2 from 14:57:41Z, and `-zLT` should reflect local 
time.
- `-z` should influence the zone used for the working file timestamp (or the
  manual should explicitly document that it does not).

Notes:
- This looks like `co -M` uses a fixed UTC+1 conversion and/or ignores DST,
  and also ignores `-z`. Related behavior was observed with `ci -d` vs. `-z`,
  reported separately.

Proposed next steps:
- Confirm whether `-M` is intended to honor DST and `-z` (especially `-zLT`).
- If yes, adjust time conversion to use localtime with DST and respect `-z`.
- At minimum, clarify the manpage if the current behavior is by design.

Thank you.

Reply via email to