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

Property values for boolean properties.

From: Karl Fogel <kfogel_at_red-bean.com>
Date: 2007-06-18 05:57:50 CEST

Subversion has two versioned properties interpreted as booleans --
'svn:executable' and 'svn:needs-lock'. (I'm ignoring 'svn:special'
here, since users don't touch it directly.)

Their property values are always normalized to "*", no matter what
value you actually gave. Thus:

   $ svn propset svn:needs-lock "StrawberryFieldsForever" artwork.jpg
   $ svn proplist -v artwork.jpg
   Properties on 'artwork.jpg':
     svn:needs-lock : *
   $

This presents users with the conundrum of what property value to use.
Since you can use anything and it won't matter, what *should* you use?
In practice, we often seem to recommend the word "on", for example:

   $ svn propset svn:executable ON somescript
   property 'svn:executable' set on 'somescript'
   (from http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.propset.html)

But the problem is that the word "off" doesn't turn the property off;
instead, "off" turns it on too! You have to use 'svn propdel' to turn
the property off.

I'm not sure what we can do about this. Obviously, "off" doesn't mean
"off" in all languages, and we wouldn't normally want potentially
scripted command-line client behaviors to depend on the locale. On
the other hand, "off" and "no" are widely-known English words, and the
rest of the command-line client interface depends on English words.
So we could have

   svn propset on artwork.jpg --> sets the property
   svn propset yes artwork.jpg --> sets the property

   svn propset off artwork.jpg --> deletes the property
   svn propset no artwork.jpg --> deletes the property

...with the second two being special cases.

Yes, yes, I realize that's lame. Thoughts? Creative solutions?
Should we just live with it, and try to find another word besides
"on" to use in our examples?

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jun 18 05:57:51 2007

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.