comparing dates in a mercurial hook
EHASZLA at transunion.com
Fri Oct 14 13:41:06 CDT 2011
> -----Original Message-----
> From: Matt Mackall [mailto:mpm at selenic.com]
> Why does everyone want to write hooks in Python?
> On the command line, you can do this with something like:
> hg id -r "$SOMENODE and not date('-180')"
> and get a non-zero return code if the set is empty.
I have pre-existing hookthat needs to work on both unix and windows.
They do more than just the date check (env variable check, regexp check of the description, works for both commit and push, etc...), and I thought the best practice for a portable hook was to use python.
Is that not the case?
> A datetime is presumably a number in seconds since (the local) UNIX
> epoch. Mercurial dates are all of the form:
> (seconds since epoch in GMT, seconds offset from GMT)
> so this comparison won't work. You should instead use
Ok, thanks, I'll give that a shot.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 474 bytes
Desc: not available
More information about the Mercurial-devel