monotone-devel
[Top][All Lists]
Advanced

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

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


From: Nathaniel Smith
Subject: Re: [Monotone-devel] [PATCH] new selectors: "earlier or equal" and ?later"
Date: Wed, 11 May 2005 02:24:52 -0700
User-agent: Mutt/1.5.9i

On Sat, May 07, 2005 at 11:05:11AM +0200, rghetta wrote:
> The following patch adds two new selectors, e: and l: taking a date
> expression and meaning respectively "earlier or equal than" and
> "strictly later than".
> They can be used togheter to form a range [earlier, later). The "later"
> end of the range is open.

Cool.

> +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?

> --- monotone.texi
> +++ monotone.texi
> @@ -2292,7 +2292,20 @@
>  @code{branch} certs where the cert value begins with @code{net.venge}.
>  @item Date selection
>  Uses selector type @code{d}. For example, @code{d:2004-04} matches
> address@hidden certs where the cert value begins with @code{2004-04}.
> address@hidden certs where the cert value begins with
> address@hidden This selector also accepts expanded date syntax (see below).
> address@hidden "Earlier or equal than" selection
> +Uses selector type @code{e}. For example, @code{e:2004-04-25} matches
> address@hidden certs where the cert value is less or equal than
> address@hidden:00:00}. If the time component is unspecified,
> +monotone will assume 00:00:00. This selector also accepts expanded date
> +syntax (see below)
                     ^ missing period
> address@hidden "Later than" selection
> +Uses selector type @code{l}. For example, @code{l:2004-04-25} matches
> address@hidden certs where the cert value is strictly less than
> address@hidden:00:00}. If the time component is unspecified,
> +monotone will assume 00:00:00. This selector also accepts expanded date
> +syntax (see below)
                     ^ likewise
>  @item Identifier selection
>  Uses selector type @code{i}. For example, @code{i:0f3a} matches
>  revision IDs which begin with @code{0f3a}.
> @@ -2325,6 +2338,37 @@
>  addresses, branch names, or date specifications. For the complete
>  source code of the hook, see @ref{Hook Reference}.
>  
> address@hidden Expanding dates

Thanks for documenting this!

> -    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 () == 
> constants::idlen)
   ^^ 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.)

> --- testsuite.at
> +++ testsuite.at
> @@ -136,6 +136,54 @@
>      io.write(string.format("test_attr:%s:%s\n", filename, value))
>    end
>  
> +function expand_date(str)

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 :-).

-- Nathaniel

-- 
Eternity is very long, especially towards the end.
  -- Woody Allen




reply via email to

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