Joey Hess wrote:
> Trent W. Buck wrote:
>> When Darcs 2.3 or higher is available (as in Debian), darcs.pm
>> should include --max-count 1 in its filtered "darcs changes" calls
>> (that is, in &darcs_info and &rcs_getctime).  For non-trivial
>> repositories, this will significantly reduce the resource
>> consumption (especially memory) needed for these operations.
>
> Is there any cheap way that ikiwiki can tell if a new enough darcs
> is available to use this feature?

You can compare darcs --version to a minimum version.  The first
stable release to support --max-count was 2.3.0.  This version is in
Sid, but won't migrate to Squeeze until the GHC 6.10 transition.

    $ x=$(darcs --version)
    $ dpkg --compare-versions ${x%% *} ge 2.3.0
    $ echo $?
    0

It was also present in the 2.3.0 alphas and betas, which are versioned
as 2.2.98.x and 2.2.99.x, but pre-releases aren't packaged for Debian
and aren't widely deployed in /usr/local.

Alternatively, you could simply try to use it and detect failure, by
looking at stderr or the exit status.  IMO this is less robust,
because error messages might change and the exit status might be
non-zero for a different reason.

    $ darcs changes --max-count 1 2>&1 >/dev/null |
      grep unrecognized.option..--max-count
    darcs failed:  unrecognized option `--max-count'

>> You may want to look at filestore[...]
> I am skeptical that VCS abstraction libraries can be useful [...]

No worries.  It was merely a "it may have some good ideas to steal"
rather than a "you should migrate to this library".



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to