[PATCH] finddate bug?
Matt Mackall
mpm at selenic.com
Fri Jan 11 17:47:14 UTC 2008
On Fri, 2008-01-11 at 01:59 +0000, Mark Williamson wrote:
> Hi all,
>
> I got the following error:
>
> mark at maw48:~/scratch/hgtest/testa$ hg update -d "<2008-01-09 00:00:00"
> abort: invalid date: '2008-01-09 00:00:00 to <2008-01-09 00:00:00'
>
> I tracked the source of this down to finddate. I couldn't see any obvious
> reason why finddate would need to pass down (date + " to " + date) so I
> applied this small patch, which seems to have made hg update do what I
> expected.
It's magic. If you specify "Oct 31", rather than looking for a commit at
"Oct 31 2007 00:00:00", it turns it into a range: "Oct 31 to Oct 31",
which is then internally converted to "Oct 31 2007 00:00:00 to Oct 31
2007 23:59:59". Similarly, if you say "2005", it turns into "Jan 1 2005
00:00:00 to Dec 31 2005 23:59:59".
But it's apparently redundant magic as util.matchdate will effectively
add the "to" itself if it doesn't find one of "< > to -". So your patch
is good.
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial
mailing list