Svn:externals do not set properly despite affirmative confirmation [Linux]

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Svn:externals do not set properly despite affirmative confirmation [Linux]

thinkpipes
Hello,

--- PROBLEM
After creating a tag from a branch, I want to set the svn:externals property on that tagged branch to have the contents of a file (I call the file "ext.def").

--- SYNOPSIS
Overwriting the existing svn:externals property does not work despite receiving the message "property 'svn:externals' set on repository revision 83966"

--- STEPS
1) Loops through each repository (there are 12) and detect (with svn pg) if the repo has the svn:externals property set
2) If so, set svn:externals with the values from file ext.def


--- SCRIPT DETAILS

...tags get set here...

BASE="svn+ssh://server/repos"
REPS=`svn list $BASE`

for i in ${REPS}; do
        PROPS=(`svn pg "svn:externals" $BASE/$i/tag`)
        if [ $PROPS -gt 0 ]; then
                svn ps --force --revprop -r HEAD svn:externals -F ext.def $BASE/$i/tag
        if
done


--- OUTPUT
property 'svn:externals' set on repository revision 83981
property 'svn:externals' set on repository revision 83981
...
property 'svn:externals' set on repository revision 83981

However, when I view svn:externals on one of the repos that has supposed been changed, the externals still have their original value, NOT the new values from ext.def


--- USER INFO
Operating system -- Linux 64-bit: 2.6.18-128.el5xen x86_64 GNU/Linux
Svn release;: 1.6.5 (server is 1.4.3)
No compilation/configuration options - used pre-packaged binary.
Using FSFS
Only 1 hook in use: Pre-revprop-change -- contains the following:

REPOS="$1"
REV="$2"
USER="$3"
PROPNAME="$4"
ACTION="$5"

if [ "$ACTION" == "M" -a "$PROPNAME" == "svn:log" ]; then exit 0; fi

if [ "$ACTION" == "A" -o "$ACTION" == "M" ]; then
        if [ "$PROPNAME" == "svn:externals" ]; then
                if [ "$USER" == "me" ]; then
                        exit 0;
                else
                        echo "User $USER is not authorized to add svn:externals."
                        exit 1;
                fi
        fi
fi

echo "$USER: Please contact your SVN Administrator ($REV, $PROPNAME, $ACTION)" >&2

exit 1

Please let me know if this is expected behavior, as it looks like a bug.

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Svn:externals do not set properly despite affirmative confirmation [Linux]

djcbecroft
On Thu, Oct 22, 2009 at 11:06 AM, Ted Sheibar <[hidden email]> wrote:
Hello,

--- PROBLEM
After creating a tag from a branch, I want to set the svn:externals property on that tagged branch to have the contents of a file (I call the file "ext.def").

--- SYNOPSIS
Overwriting the existing svn:externals property does not work despite receiving the message "property 'svn:externals' set on repository revision 83966"

--- STEPS
1) Loops through each repository (there are 12) and detect (with svn pg) if the repo has the svn:externals property set
2) If so, set svn:externals with the values from file ext.def


--- SCRIPT DETAILS

...tags get set here...

BASE="svn+ssh://server/repos"
REPS=`svn list $BASE`

for i in ${REPS}; do
        PROPS=(`svn pg "svn:externals" $BASE/$i/tag`)
        if [ $PROPS -gt 0 ]; then
                svn ps --force --revprop -r HEAD svn:externals -F ext.def $BASE/$i/tag
        if
done


'svn:externals' is not a revision property, so the use of the --revprop and -r switches here is incorrect. I don't think that "svn propset" can be used with versioned properties via URLs, either (although I could be wrong here), so you'll probably need to checkout a working copy to do this.
 
I think the bug here is that "svn propset" displays the "property set" message, when I would be expecting an error.

<snipped />

Cheers,
Daniel B.
Reply | Threaded
Open this post in threaded view
|

Re: Svn:externals do not set properly despite affirmative confirmation [Linux]

Ryan Schmidt-60
On Oct 21, 2009, at 20:37, Daniel Becroft wrote:

> 'svn:externals' is not a revision property, so the use of the --
> revprop and -r switches here is incorrect.

Exactly.

> I don't think that "svn propset" can be used with versioned  
> properties via URLs, either (although I could be wrong here), so  
> you'll probably need to checkout a working copy to do this.

My reading of issue 2238 is that propset and propdel don't yet work on  
URLs and there's no consensus yet on whether that should be allowed.  
propedit should work on URLs as of Subversion 1.5.0.

http://subversion.tigris.org/issues/show_bug.cgi?id=2238


> I think the bug here is that "svn propset" displays the "property  
> set" message, when I would be expecting an error.

Well, Subversion did successfully do exactly what was asked: it set a  
property on a revision. Granted, in this case that didn't have the  
effect the user expected. This is not the first time I have seen  
someone confuse revision properties and versioned properties, and I  
would be in favor of the command line client printing a warning if one  
of the known svn: properties is used in the wrong place.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2410043

To unsubscribe from this discussion, e-mail: [[hidden email]].
Reply | Threaded
Open this post in threaded view
|

Re: Svn:externals do not set properly despite affirmative confirmation [Linux]

Ryan Schmidt-60
In reply to this post by thinkpipes
On Oct 21, 2009, at 20:06, Ted Sheibar wrote:

> 1) Loops through each repository (there are 12) and detect (with svn  
> pg) if the repo has the svn:externals property set

Note that svn:externals could be set anywhere in a repository, not  
just on its root. You're only checking the root.

> Only 1 hook in use: Pre-revprop-change -- contains the following:
>
> REPOS="$1"
> REV="$2"
> USER="$3"
> PROPNAME="$4"
> ACTION="$5"
>
> if [ "$ACTION" == "M" -a "$PROPNAME" == "svn:log" ]; then exit 0; fi
>
> if [ "$ACTION" == "A" -o "$ACTION" == "M" ]; then
>         if [ "$PROPNAME" == "svn:externals" ]; then
>                 if [ "$USER" == "me" ]; then
>                         exit 0;
>                 else
>                         echo "User $USER is not authorized to add  
> svn:externals."
>                         exit 1;
>                 fi
>         fi
> fi
>
> echo "$USER: Please contact your SVN Administrator ($REV, $PROPNAME,  
> $ACTION)" >&2
>
> exit 1

You can delete your entire pre-revprop-change hook, since as discussed  
in the previous mail, svn:externals is a versioned property, not a  
revision property. If your goal is to prevent people from adding  
svn:externals, you'll need to write a pre-commit hook which uses  
"svnlook dirs-changed" to see what directories changed, and see if any  
of them has svn:externals set in the transaction but did not before.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2410044

To unsubscribe from this discussion, e-mail: [[hidden email]].