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

Re: Is there some keyword providing the local path within the working copy?

From: Thorsten Schöning <tschoening_at_am-soft.de>
Date: Fri, 26 Jan 2018 08:50:35 +0100

Guten Tag Johan Corveleyn,
am Donnerstag, 25. Januar 2018 um 20:40 schrieben Sie:

> But I don't understand what you're trying to do. You want to include
> the WC-root-relative path to *another dir* inside some config file,
> while you're checking out or updating that config file? That's weird.

One use case is simply providing e.g. systemd service files in a dir
structure like the following, while working around some limitations of
systemd[1]:

> /[...]/someProject
> .svn
> [...]
> config
> appConfig.xml
> upstart.conf
> systemd.service
> startTheApp.sh

The problem is that "systemd.service" needs the absolute path to
"startTheApp.sh" in it's file and that path is unknown on commit time,
because of very generic tags, but known during checkouts and updates.
So if something like "%R" for the root of the repo would be available
for the root of the working copy, e.g. "%LR" for "local root" or such,
getting the path itself dynamically into the file without additional
build steps would be a bit easier.

The "$...$" syntax for expanded keywords would be more of a problem.
For the use case "ExecStart" one can surely work around that problem
by invoking a shell and forwarding the path with "$" removed as some
arg. For other supported directives with paths this is not possible,
so some very special support to actually remove the "$" would be great
as well.

Breaking things like moving the whole working copy to some other place
can easily be ignored at least in my use cases, it simply doesn't
happen (very often).

> The keywords in SVN are only able to include information that's
> directly related to the file in question, not information about
> another file or dir.

The working copy root is a property of the file in question and
everything else would be something like the following:

> ExecStart=$%LR$/some/other/dir/burnTheHouse.sh

With a keyword providing the path to the file itself only, one might
be able to use the following:

> ExecStart=$%Lu$/../some/other/dir/burnTheHouse.sh

> But regardless, this sounds to me more like something you should solve
> with a build script or somesuch ...

The problem with a build script generating some unversioned file is
that each user needs to do it for each working copy and each update
chaning something on the file "systemd.service". I hoped there would
be some way to avoid that for very easy cases like those for path,
which in theory SVN alreadys knows about.

[1]: https://github.com/systemd/systemd/issues/6308

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail: Thorsten.Schoening_at_AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/
Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04
AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow
Received on 2018-01-26 08:50:43 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.