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

Re: automatic keyword un-expansion on 'svn {ps,pd,pe} svn:keywords'?

From: <kfogel_at_collab.net>
Date: 2006-03-15 22:36:48 CET

Peter Samuelson <peter@p12n.org> writes:
> [kfogel@collab.net]
> > Hmmm. What you say makes me think that showing a "local mod" (the
> > still-expanded keyword) after the propdel might be at least as useful
> > as automatically contracting the keyword. And showing the local mod
> > alerts the user that there's a conscious decision to be made here.
>
> True. The only frustrating thing is that you can't use 'svn revert' to
> get rid of the local mod. You're left with 'svn diff {f} | patch -R'
> or recopying the text-base file manually.
>
> I tried to do a repository-side 'svn propdel' and of course that
> doesn't exist, for reasons I only remembered afterwards. If it did
> exist, though, obviously it *would* unexpand the keywords, and thus
> would make an argument for WC-side 'svn propdel' doing the same.

Wow.

I truly do not know what the right answer here is, if there is one,
which there clearly isn't.

The repository wouldn't exactly unexpand the keywords, since they're
not stored expanded anyway. It could just cause future updates to
unexpand them in a working copy, which would be a case where receiving
a prop-only modification *would* affect the text of a file. Let's
see, according to the script below run with head-of-trunk SVN... Nope!
Updating to receive the removal of the property doesn't affect the
text of the working file either:

--------------------8-<-------cut-here---------8-<-----------------------
#!/bin/sh

SVN=${HOME}/src/subversion/subversion/svn/svn
SVNADMIN=${HOME}/src/subversion/subversion/svnadmin/svnadmin

URL=file:///`pwd`/repos

rm -rf repos wc wc-other

${SVNADMIN} create repos
${SVN} co -q ${URL}/ wc

cd wc
echo '$Revision$' >> newfile
${SVN} add -q newfile
${SVN} propset -q svn:keywords "rev" newfile
${SVN} ci -q -m "Add newfile, with keywords property."
echo ""
echo "The property has been set. The keyword should be expanded:"
echo ""
cat newfile
cd ..

# Unset the prop from another working copy.
${SVN} co -q ${URL} wc-other
cd wc-other
${SVN} propdel -q svn:keywords newfile
${SVN} ci -q -m "Remove keywords property from newfile."
cd ..

# Update the original working copy.
cd wc
${SVN} update -q
echo ""
echo "The property has been updated away. What happened to the keyword?:"
echo ""
cat newfile

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Mar 16 00:25:58 2006

This is an archived mail posted to the Subversion Dev mailing list.