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

Re: Help with post-commit script

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Tue, 3 Dec 2013 22:32:35 +0200

Andrew Reedick wrote on Tue, Dec 03, 2013 at 15:04:13 -0500:
>
>
> > -----Original Message-----
> > From: Daniel Shahaf [mailto:d.s_at_daniel.shahaf.name]
> > Sent: Tuesday, December 03, 2013 1:14 PM
> > To: Andrew Reedick
> > Cc: Alfred von Campe; users_at_subversion.apache.org
> > Subject: Re: Help with post-commit script
> >
> >
> > > svnlook changed ... > $CHANGED_LIST || exit 1 cat $CHANGED_LIST | sed
> > > 's/^....//g' | perl -ne 'print "$1$2\n" if
> > > /^(trunk)\/|^(branches\/[^\/]*)\//' | sort -u | xargs -n 1 -i svnlook
> > > propget $REPOS_PATH my:filelist_prop "{}" > $FILES_TO_REPORT_ON ||
> > > exit 1
> > >
> > > cat $CHANGED_LIST | while read i
> >
> > 'read' splits on whitespace, so filenames that contain spaces won't
> > DTRT.
>
> Close. Read will drop leading/trailing whitespace. It does respect
> "internal" whitespace though.
>

Thanks for the correction.

> How does 'svnlook changed' output filenames with embedded newlines
> anyway?

It doesn't, but in FSFS repositories they can't be added in the first
place.

> The entries in the filelist svn property would need to be in a regex format. So everything would be escaped already.
>

The pattern is $i, which comes from the dirs-changed output, not from
the property. (I agree with the 'grep -qF' solution, though.)

> SVNLOOK_CMD=/path/to/svnlook

You still need to make sure grep, perl, etc are in the path (or use
abspaths to them). perl won't be in the pth, for example.
Received on 2013-12-03 21:33:14 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.