You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by David Menday <da...@pantor.com> on 2003/06/17 14:36:31 UTC

enhancement for svn:keywords add Revision as abbrev as well as Rev

The abbreviations Id, Author, Date all match the corresponding cvs keywords, but
Rev does not match CVS keyword $Revision$. 
I am guessing too many by now already use Rev so changing Rev to Revision is not doable.

Regards
David Menday
(not a member of this mailing list)


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

Re: enhancement for svn:keywords add Revision as abbrev as well as Rev

Posted by kf...@collab.net.
Robert Pluim <rp...@bigfoot.com> writes:
> Hmm, this has me wondering why the _LONG versions are all compared
> using strcmp, and the _SHORT ones all use strcasecmp in the existing
> code.  Is this a CVS hangover?

No, it's because the long ones are multiple words (so the case
provides the word boundaries), while the short ones are a single word
each.

Remember, what's being parsed in the code you quoted is not the
"$Foo$" substring from the file, but rather the value of the
svn:keywords property.  In the file contents, we only tolerate exact
matches: "$Date$" works but "$date$" does not.  But for the property
value, we wanted people to be able to do

   $ svn propset svn:keywords date foo.c

...and have it still work.

-Karl

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

Re: enhancement for svn:keywords add Revision as abbrev as well as Rev

Posted by Robert Pluim <rp...@bigfoot.com>.
plasma writes:
 > Index: subversion/libsvn_subr/subst.c
 > ===================================================================
 > --- subversion/libsvn_subr/subst.c	(revision 816)
 > +++ subversion/libsvn_subr/subst.c	(working copy)
 > @@ -131,6 +131,7 @@
 >        const char *keyword = APR_ARRAY_IDX (keyword_tokens, i, const char *);
 >  
 >        if ((! strcmp (keyword, SVN_KEYWORD_REVISION_LONG))
 > +          || (! strcasecmp (keyword, SVN_KEYWORD_REVISION_MEDIUM))
 >            || (! strcasecmp (keyword, SVN_KEYWORD_REVISION_SHORT)))

Hmm, this has me wondering why the _LONG versions are all compared
using strcmp, and the _SHORT ones all use strcasecmp in the existing
code.  Is this a CVS hangover?

Robert

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

Re: enhancement for svn:keywords add Revision as abbrev as well as Rev

Posted by plasma <pl...@pchome.com.tw>.
On Tue, Jun 17, 2003 at 12:24:33PM -0500, Ben Collins-Sussman wrote:
> 
> Maybe we can file as a pre-1.0 enhancement?  Should be a pretty small
> task for a volunteer to tackle.
> 

Here comes a volunteer.

plasma


LOG:

* Issue #1287.  A new abbrev 'Revision' for 'LastchangeRevision'.

  subversion/include/svn_types.h:
    Add a SVN_KEYWORD_REVISION_MEDIUM const.

  subversion/libsvn_subr/subst.c:
    svn_subst_build_keywords(), translate_keyword():
      Recognize SVN_KEYWORD_REVISION_MEDIUM.

PATCH:

Index: subversion/include/svn_types.h
===================================================================
--- subversion/include/svn_types.h	(revision 816)
+++ subversion/include/svn_types.h	(working copy)
@@ -217,6 +217,9 @@
 /** Short version of LastChangedRevision */
 #define SVN_KEYWORD_REVISION_SHORT   "Rev"
 
+/** Medium version of LastChangedRevision, matching the one CVS uses */
+#define SVN_KEYWORD_REVISION_MEDIUM  "Revision"
+
 /** The most recent date (repository time) when this file was changed. */
 #define SVN_KEYWORD_DATE_LONG        "LastChangedDate"
 
Index: subversion/libsvn_subr/subst.c
===================================================================
--- subversion/libsvn_subr/subst.c	(revision 816)
+++ subversion/libsvn_subr/subst.c	(working copy)
@@ -131,6 +131,7 @@
       const char *keyword = APR_ARRAY_IDX (keyword_tokens, i, const char *);
 
       if ((! strcmp (keyword, SVN_KEYWORD_REVISION_LONG))
+          || (! strcasecmp (keyword, SVN_KEYWORD_REVISION_MEDIUM))
           || (! strcasecmp (keyword, SVN_KEYWORD_REVISION_SHORT)))
         {
           kw->revision = svn_string_create (rev, pool);
@@ -346,6 +347,12 @@
         return TRUE;
 
       if (translate_keyword_subst (buf, len,
+                                   SVN_KEYWORD_REVISION_MEDIUM,
+                                   (sizeof (SVN_KEYWORD_REVISION_MEDIUM)) - 1,
+                                   expand ? keywords->revision : NULL))
+        return TRUE;
+
+      if (translate_keyword_subst (buf, len,
                                    SVN_KEYWORD_REVISION_SHORT,
                                    (sizeof (SVN_KEYWORD_REVISION_SHORT)) - 1,
                                    expand ? keywords->revision : NULL))

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

Re: enhancement for svn:keywords add Revision as abbrev as well as Rev

Posted by kf...@collab.net.
Ben Collins-Sussman <su...@collab.net> writes:
> I don't think that when we came up with svn keyword abbreviations, we
> were deliberately trying to match CVS keywords.  It's a happy
> coincidence that our "Id, Author, Date" abbreviations all happen to be
> CVS keywords.
> 
> That said, I don't see why we couldn't have *two* abbreviations for
> $LastChangedRevision$:  keep $Rev$, but also add $Revision$ for the
> CVS people out there.

I think we *were* trying to match the CVS keywords, actually, and in
the case of $Revision$ we deliberately decided not to use the same
word, because "revision" means something slightly different in the CVS
and Subversion worlds.  Not that that decision makes much sense to me
now... :-)

> Maybe we can file as a pre-1.0 enhancement?  Should be a pretty small
> task for a volunteer to tackle.

It's already filed, actually:

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

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

Re: enhancement for svn:keywords add Revision as abbrev as well as Rev

Posted by Ben Collins-Sussman <su...@collab.net>.
David Menday <da...@pantor.com> writes:

> The abbreviations Id, Author, Date all match the corresponding cvs
> keywords, but Rev does not match CVS keyword $Revision$.

I don't think that when we came up with svn keyword abbreviations, we
were deliberately trying to match CVS keywords.  It's a happy
coincidence that our "Id, Author, Date" abbreviations all happen to be
CVS keywords.

That said, I don't see why we couldn't have *two* abbreviations for
$LastChangedRevision$:  keep $Rev$, but also add $Revision$ for the
CVS people out there.

Maybe we can file as a pre-1.0 enhancement?  Should be a pretty small
task for a volunteer to tackle.

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