Re: date selectors using local time for comparison

Stephen Leake <[email protected]>
Newsgroups gmane.comp.version-control.monotone.devel
Message-ID <[email protected]>
Richard Hopkins <[email protected]> writes:

> I've run into an issue recently using the date selectors, try this
>
> $ mtn db init --db=test.db
> $ echo hello > test.txt
> $ mtn add test.txt
> $ mtn commit
> $ mtn log -r"l:5 minutes ago"
>
> I would expect to see revision I've just committed, however, nothing
> will be matched. The database shows the dates being in UTC (using
> sqlite3).

That's bad; the user input time should be converted to UTC before being
compared. I thought it was, back when this was added.

> Changing the query to
>
> $ mtn log -r"l:65 minutes ago"
>
> returns the commit because in the UK we are currently 1 hour ahead of UTC.
>
> What I'm confused about though is that adding the "5 minutes ago" test
> to "check_later_and_earlier_selectors" returns the correct revisions;
> in a separate terminal it returns nothing.

Hm. The tests must set some env variable so all times are UTC; that
would be required for consistency, with testers in several time zones.
But we should have at least one test that sets a different time zone, to
test stuff like this.

-- 
-- Stephe
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.