[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: accessing svn config settings programmatically?

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Mon, 18 Jan 2016 02:25:59 +0000

Karl Berry wrote on Sat, Jan 16, 2016 at 23:31:10 +0000:
> Is it possible to read (no need to write) svn configuration settings via
> some svn command?
>

Not with the cmdline client. It's possible with the bindings
(svn_config_*).

> That is, something better than trying to discover the location of the
> configuration file(s) and grepping or otherwise parsing them. That's a
> road I don't want to go down.
>
> Specifically, what I want to know is the active value of
> use-commit-times, so that my configure script and/or Makefile can inform
> users who try to do a build from a checkout without it. (Yes, the info
> is in my documentation, but few people read documentation.)
>

Strictly speaking, you should care about the value at the time of the
last update/checkout that touched each file, not about the value in the
config.

There's no record of the historical values use-commit-times. However,
you can simply check whether the effect is present:

    % svn up --config-option=config:miscellany:use-commit-times=true README
    % svn info README
    ⋮
    Last Changed Date: 2013-02-21 23:12:27 +0000 (Thu, 21 Feb 2013)
    Text Last Updated: 2013-02-21 23:12:27 +0000 (Thu, 21 Feb 2013)

These values are also available as $LastChangedDate$ and stat().st_mtime
respectively.

Cheers,

Daniel

> I feel like I'm missing something obvious, but I've looked through the
> svn book, mail archives, stack exchange, etc., with no luck.
>
> Any help appreciated. Thanks, Karl.
>
> P.S. I'm not subscribed to this list, so please cc me explicitly on
> replies. Thanks.
>
Received on 2016-01-18 03:26:01 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.