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

RE: implementing pre-commit-hook to prevent overwriting files under tags-dir

From: Marc Lustig <ml_at_marclustig.com>
Date: Sat, 26 Sep 2009 12:41:16 -0700 (PDT)

Could somebody advise me how to extract
aaa/bbb/tags/version
from
aaa/bbb/tags/version/xxx
using some bash-command like sed.

The string before tags and after tags is arbitrary.
I need this in order to check with svnlook if this version under tags
already exists in the repo.

Marc Lustig wrote:
>
> You are right, of course. It's so obvious....
> I will try to simplify the logic...
> thanks, guys.
>
>
> Johan Corveleyn wrote:
>>
>>> Van: Marc Lustig [mailto:ml_at_marclustig.com]
>>>
>>> TAGS_REGEX='tags/[^/]\+'
>>> # Get list of transactions in the 'tag' directory
>>> TAGS_CHANGES=`"$SVNLOOK" changed -t "$TXN" "$REPOS" 2>/dev/null | \
>>> awk '{ print $2; }' 2>/dev/null | \
>>> grep ^tags/ 2>/dev/null | \
>>> sed -e "s!^\($TAGS_REGEX\).*!\1!" | \
>>> sort | \
>>> uniq`
>>>
>>>
>>> I figured out, when I commit a file, the variable TAGS_CHANGES is
>>> empty.
>>>
>>> The command
>>> $SVNLOOK" changed -t "$TXN" "$REPOS"
>>> prints out the list of committed files properly. LIke
>>> U project/tags/1.1.1/file.xml
>>
>> It's the grep part of the command: "grep ^tags/" will not match
>> "project/tags/...". It only matches if "tags" is at the very beginning of
>> the line (because "^" matches beginning of line).
>>
>> So I guess that snippet only works for repositories that have "tags" at
>> the root of the repository, and not below individual project folders...
>>
>> Johan
>>
>> ------------------------------------------------------
>> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2400186
>>
>> To unsubscribe from this discussion, e-mail:
>> [users-unsubscribe_at_subversion.tigris.org].
>>
>>
>
>

-- 
View this message in context: http://www.nabble.com/implementing-pre-commit-hook-to-prevent-overwriting-files-under-tags-dir-tp25570855p25628231.html
Sent from the Subversion Users mailing list archive at Nabble.com.
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2400781
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-09-26 21:42:14 CEST

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.