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

Re: propedit on svn:mime-type

From: Branko Čibej <brane_at_xbc.nu>
Date: 2003-03-03 23:29:48 CET

Alex Waugh wrote:

>Hi
>
>If you do a svn propedit svn:mime-type on a file then it is quite likely
>that after editing there will be a trailing newline. However, the
>validation on the mimetype will reject the property if the final
>character isn't alphanumeric. Wouldn't it be better if any trailing
>(and leading?) whitespace was stripped before the validation?
>

Well, well, well. Didn't I propose that a long time ago, then got
slammed down by the infamous Chicago Three to the tune that it was
unnecessary? Revenge is sweet. :-)

>If someone points me to the best place to do the stripping[1] then I
>might be tempted to produce a patch.
>
>
Value translation for svn: propsis in
subversion/clients/cmdline/propset-cmd.c:svn_cl__propset, but I think
stripping leading and trailing whitespace (or clearing the value
altogether, in the case of svn:executable) should probably go into
subversion/libsvn_wc/props.c:svn_wc_prop_set, where we already do some
semantic checking on the props. My suggestion some time ago was:

    * svn:executable: Always make the value an empty string, since we
      only ever check if the property exists, we don't care about the value
    * svn:mime-type, svn:eol-style: Strip all leading and trailing
      whitespace. I suggest looking at apr_collapse_spaces in
      apr_strings.h -- it might actually do the right thing.
    * svn:ignore, svn:externals: Make sure that the last line in the
      prop value ends in a newline.
    * svn:keywords: strip leading and trailing whitespace (but not
      internal whitespace!) Don't know about ending this value with a
      newline; IIRC; it must be a single line, so just stripping
      trailing spaces should be fine.

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Mar 3 23:32:36 2003

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.