[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] [PATCH] new selectors: "earlier or equal" and ?late

From: rghetta
Subject: Re: [Monotone-devel] [PATCH] new selectors: "earlier or equal" and ?later"
Date: Wed, 11 May 2005 12:02:39 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414

Nathaniel Smith wrote:

+static void
+sqlite3_normdate_fn(sqlite3_context *f, int nargs, sqlite3_value ** args)
What is this normdate stuff for?  Sqlite allows <= on strings, and it
compares as "strcmp", which seems it should work perfectly well for
normalized ISO dates?
Actually, my first try did just that, but I had problems getting the correct ranges to work. Converting to double did the trick, and while is less efficient than comparing directly the strings, I wasn't very concerned, given the intended use of this function. If you want, I can make another try using only strings; perhaps it was just some silly mistake on my part (coding at night has its drawbacks :-)

-    if (str.find_first_not_of(constants::legal_id_bytes) == std::string::npos
-       && str.size() == constants::idlen)
+    if (str.find_first_not_of (constants::legal_id_bytes) ==
+                               std::string::npos && str.size () == 

   ^^ these are literal tabs.  Please do not submit patches containing
tab characters?
(Among the other reasons to not use tabs, there's a fair amount of
noise in this patch from just this.)
I agree. I just hate tab intendenting. Unfortunately part of this patch was developed on a laptop and I forgot to configure it properly.
My apologies.

If you want to test the behavior of the default hooks, I suggest using
RAW_MONOTONE instead of MONOTONE (there are several tests that do this
already).  This is much better than copying the hook into the
testsuite, because if the standard version in monotone changes, then
we will be testing the version in the testsuite rather than the
version in monotone.  Which would make the test kind of pointless :-).
Oops, I haven't noticed RAW_MONOTONE. I'll look at that.
BTW there's a test macros documentation somewhere (other than test/README) ?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]