u123
u123

Reputation: 16327

time for hg log --date

I generate hg logs for some repositories (on the remote server where all local repos push their changes to) using this command:

hg log -R "path-to-repo" -b somebranch --date "$YESTERDAY to $TODAY"

where :

YESTERDAY=$(date +%Y-%m-%d -d "yesterday")
TODAY=$(date +%Y-%m-%d)

As an example this could be:

hg log -R "path-to-repo" -b somebranch --date "2012-11-27 to 2012-11-28"

But at what time: hour:minutes:seconds does the generated log start when specifying --date? End would be the time when the command is executed.

The reason I ask is that the log was empty when I ran the above at 10:00 but when I ran it 11:10 it found changes.

Upvotes: 0

Views: 4520

Answers (1)

Lazy Badger
Lazy Badger

Reputation: 97292

You forgot about local timezone: date without TZ for mercurial is some predefined timezone (probably GMT)

BTW, "from yesterday" (without TZ-related headache) for hg log is static line --date "-1"

Example of log, when committer isn't from my local TZ

hg log --date "2012-11-04" --template "{date|date}\n"
Sat Nov 03 22:36:13 2012 -0400
Sat Nov 03 22:22:43 2012 -0400
Sat Nov 03 19:25:13 2012 -0400
Sat Nov 03 19:20:52 2012 -0400
Sat Nov 03 19:20:39 2012 -0400
Sat Nov 03 19:14:17 2012 -0400
Sat Nov 03 19:12:08 2012 -0400
Sat Nov 03 19:11:50 2012 -0400

Upvotes: 3

Related Questions