You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by tn...@lexmark.com on 2003/11/13 21:01:35 UTC

Possible Problem with auto-props

Hi SVN Team:

I know that the Auto Properties is "new", so I'm not picking at you ...

Just wanted to pass along a little problem I've observed with it ...
(BTW, subversion-0.32.1 on RedHat 8.0 ...)

Here is the contents of a binary file, tryit.c:

|  Hex|     0 1  2 3  4 5  6 7  8 9  A B  C D  E F          |   Dec|0123456789ABCDEF|
========================================================================
|    0|     0000 0000 0024 5265 7624 0002 8894 0208         |     0|.....$Rev$......|
16|$.(@.......$R..$|
|   20|     0035 0395 0903 9059 3059 0395 0950 9350         |    32|.5.....Y0Y...P.P|
|   30|     0000 0000 000A AAAA AAAA AAAA AA** ****         |    48|.............***|

As you can see, the sequence 24527624 is "$Rev$".

I have auto props enabled in my ~/.subversion/config file,  as follows:
[miscellany]
enable-auto-props = yes
*.c = svn:eol-style=native;svn:keywords=Date Rev Author URL Id

So, when I do the svn add, here is what I get:

mls:/users/tnoell/cebu/mls_wc/src/trysvn->svn status
?      tryit.c
mls:/users/tnoell/cebu/mls_wc/src/trysvn->svn add tryit.c
subversion/libsvn_wc/props.c:990: (apr_err=200009)
svn: Illegal target for the requested operation
svn: File 'tryit.c' has binary mimetype property
mls:/users/tnoell/cebu/mls_wc/src/trysvn->svn status
A      tryit.c
mls:/users/tnoell/cebu/mls_wc/src/trysvn->svn commit -m 'added tryit.c'
Adding  (bin)  tryit.c
Transmitting file data .svn
Committed revision 283.
mls:/users/tnoell/cebu/mls_wc/src/trysvn->svn pl -v tryit.c
Properties on 'tryit.c':
  svn:mime-type : application/octet-stream
  svn:keywords : Date Rev Author URL Id
mls:/users/tnoell/cebu/mls_wc/src/trysvn->

File contents are now:

|  Hex|     0 1  2 3  4 5  6 7  8 9  A B  C D  E F          |   Dec|0123456789ABCDEF|
========================================================================
|    0|     0000 0000 0024 5265 763A 2032 3833 2024   |     0|.....$Rev: 283 $|
|   10|     0002 8894 0208 2480 2840 0200 0000 0000   |    16|......$.(@......|
32|.$R..$.5.....Y0Y|
|   30|     0395 0950 9350 0000 0000 000A AAAA AAAA   |    48|...P.P..........|
64|...*************|


Notes;
- obviously, I don't want to check in a binary file ending in *.c.
Just trying to test out auto-props, and see how well (or not) it is integrated with the rest of svn.

Observations:
1. While svn add complained, it still applied the svn:keywords property and did the add.
     Seems like it should tell me "no no" and die.
2. Keyword substitution is done on a file that svn knows is binary.  Seems to me it should never do that.

What I am trying to do:
I'm thinking about using auto-props so that users are not burdened with having to do
svn ps svn:keywords "blah1 blah2 ..."
but since the user can edit their .subversion/config file, I don't want them to be able to do
anything dumb (like the above) by mistake.
Currently, I am wrapping svn add with a perl script, so unless this gets fixed
(or maybe it is a feature?  I could be missing a requirement or some background, admittedly :)
I need an alternative.

So, is there any way to get subversion to detect mime type w/o doing the svn add?
I could do it in the wrapper, or I guess I could learn
how to modify the client, but that is my least attractive choice ...
What do you folks think?

Overall, I am tickled with Subversion and glad we are looking at using it.
Thanks to the community for all your hard work so far (and all the hard work yet to come :)

Tim




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Possible Problem with auto-props

Posted by Branko Čibej <br...@xbc.nu>.
tnoell@lexmark.com wrote:

>Observations:
>1. While svn add complained, it still applied the svn:keywords property and did the add.
>     Seems like it should tell me "no no" and die.
>  
>
That's right. You get the error because we don't allow setting
svn:eol-style on a binary file.

>2. Keyword substitution is done on a file that svn knows is binary.  Seems to me it should never do that.
>  
>
It's not Subversion's place to decide whether a nominaly binary file can
contain keywords or not. It's different with svn:eol-style because a
binary format by implication does not contain text lines.

Of course, you could argue that the auto-props pattern should be ignored
if svn can't process all its members.


-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org