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

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

From: plasma <plasmaball_at_pchome.com.tw>
Date: 2003-06-20 11:40:57 CEST

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
Received on Fri Jun 20 11:42:03 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.