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

Newline in return value from propget, is it a bug?

From: Laker Netman <laker_netman_at_yahoo.com>
Date: Wed, 25 Jun 2008 08:30:43 -0700 (PDT)

I'm running Subversion 1.4.6 and checked the bug tracker under "propget", but didn't find anything relevent. I am having an issue where testing a value being returned by propget in a post-commit perl script always fails. The example below explains what is happening.

Here is my test script:
 my $repos = $ARGV[0];
 my $wcLoc = $ARGV[1];
 $wcType = `svn propget wcType svn://repoServer/$repos/$wcLoc`;
 my $updateType = $wcType eq "support" ? "" : $wcLoc eq "branches" ? "alpha" : "beta";
 print "WC type=\"$wcType\" and WC location=\"$wcLoc\" therefore updateType=\"$updateType\"\n";

Basically, if the repo has a wcType=support then there are no alpha or beta directories to deal with during my post-commit process. If wcType is something else, or doesn't exist, then based on the commit being made to "branches" or "trunk", I have to account for "alpha" or "beta" subdirectories (respectively) elsewhere in the script.

$repos is the repository name
$wcLoc is the repository directory where working copy is making the commit

When I run this against a repository without wcType set at all this is the result (as expected):
testprop.pl images trunk
WC type="" and WC location="trunk" therefore updateType="beta"

However, when I run this against a repository with wcType=support this is the (incorrect) result:
testprop.pl images trunk
WC type="support
" and WC location="trunk" therefore updateType="beta"

And I expected this:
testprop.pl images trunk
WC type="support" and WC location="trunk" therefore updateType=""

But the newline after "support" is messing up the first part of the ternary operation.

I know I can fiddle with the string returned by propget, but that seems like a workaround. It looks like propget is automatically appending a newline to the returned value. When I
edit the property via TortiseSVNs edit function no newline is present,
however, when I run "svn propget" in a perl script and dump the
variable to stdout, a newline is definitely present. I created a test repository and tried this out with the same result.

So, is this A) a bug, B) by design, or C) caused by something else?

Thanks,
Laker

      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-06-25 17:31: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.