[darcs-devel] matching patches by dates
David Roundy
droundy at abridgegame.org
Sat Jul 3 08:16:42 PDT 2004
Hello all,
I've just added crude, ugly support for matching patches based on dates.
If there's anyone here who's interested in writing a parser for dates
and/or date ranges, that would be great. I hate writing parsers.
What I'd really like to have is support for specifications like "last
month", "January" (which would match any patches in the most recent
January), "last monday", etc.
Right now, the relevant function is
parseDateMatcher :: String -> IO (CalendarTime -> Bool)
but probably if it were done right, it would be
parseDateMatcher :: CharParser st (IO (CalendarTime -> Bool))
It needs the IO in order to find out what the current time is. On the
other hand, perhaps one should use unsafePerformIO to make it a pure
function. As it is, I use unsafePerformIO in PatchMatch.lhs to call
parseDateMatcher.
Anyhow, volunteers to work on this would be appreciated, if anyone's
looking for a non-overwhelming way to contribute to darcs.
BTW, I usually test this code usually using something like
darcs annotate --summary --match 'date "last week" && name remove'
--
David Roundy
http://www.abridgegame.org
More information about the darcs-devel
mailing list