Hi,
This patch fixes the keyword expansion for LastChangedRevision when
updating and for Author, Date and Rev when using cat.
This shows up when using the info command on a file that has been
updated after its last change rev.
E:\svn-head>svn info tools/hook-scripts/mailer.py
Path: tools/hook-scripts/mailer.py
Name: mailer.py
Url: http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/mailer.py
Revision: 6309
Node Kind: file
Schedule: normal
Last Changed Author: cmpilato
Last Changed Rev: 6253
Last Changed Date: 2003-06-16 15:59:19 +0100 (Mon, 16 Jun 2003)
Text Last Updated: 2003-06-19 21:20:24 +0100 (Thu, 19 Jun 2003)
Properties Last Updated: 2003-06-19 21:20:24 +0100 (Thu, 19 Jun 2003)
Checksum: 257a0631a2108b460ec9e68fb04e0bf5
E:\svn-head>head tools/hook-scripts/mailer.py
#!/usr/bin/env python2
#
# mailer.py: send email describing a commit
#
# $HeadURL: http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/mailer.py $
# $LastChangedDate: 2003-06-16 15:59:19 +0100 (Mon, 16 Jun 2003) $
# $LastChangedBy: cmpilato $
# $LastChangedRevision: 6297 $
#
# USAGE: mailer.py REPOS-DIR REVISION [CONFIG-FILE]
As you can see the $LastChangedRevision$ keyword is different
Chris
Log:
Correct keyword expansion for update and cat.
* subversion/libsvn_client/cat.c:
(svn_client_cat): Get the keyword values from the entry props.
* subversion/libsvn_wc/translate.c
(svn_wc__get_keywords): Use the entry's cmt_rev.
Index: subversion/libsvn_client/cat.c
===================================================================
--- subversion/libsvn_client/cat.c (revision 6309)
+++ subversion/libsvn_client/cat.c (working copy)
@@ -128,25 +128,24 @@
if (keywords)
{
- svn_string_t *date, *author;
- apr_hash_t *revprops;
+ svn_string_t *cmt_rev, *cmt_date, *cmt_author;
apr_time_t when = 0;
- SVN_ERR (ra_lib->rev_proplist(session, rev, &revprops, pool));
-
- date = apr_hash_get (revprops, SVN_PROP_REVISION_DATE,
- APR_HASH_KEY_STRING);
- author = apr_hash_get (revprops, SVN_PROP_REVISION_AUTHOR,
- APR_HASH_KEY_STRING);
- if (date)
- SVN_ERR (svn_time_from_cstring (&when, date->data, pool));
+ cmt_rev = apr_hash_get (props, SVN_PROP_ENTRY_COMMITTED_REV,
+ APR_HASH_KEY_STRING);
+ cmt_date = apr_hash_get (props, SVN_PROP_ENTRY_COMMITTED_DATE,
+ APR_HASH_KEY_STRING);
+ cmt_author = apr_hash_get (props, SVN_PROP_ENTRY_LAST_AUTHOR,
+ APR_HASH_KEY_STRING);
+ if (cmt_date)
+ SVN_ERR (svn_time_from_cstring (&when, cmt_date->data, pool));
SVN_ERR (svn_subst_build_keywords
(&kw, keywords->data,
- apr_psprintf (pool, "%" SVN_REVNUM_T_FMT, rev),
+ cmt_rev->data,
url,
when,
- author ? author->data : NULL,
+ cmt_author ? cmt_author->data : NULL,
pool));
}
Index: subversion/libsvn_wc/translate.c
===================================================================
--- subversion/libsvn_wc/translate.c (revision 6309)
+++ subversion/libsvn_wc/translate.c (working copy)
@@ -211,7 +211,7 @@
SVN_ERR (svn_subst_build_keywords (&tmp_keywords,
list,
apr_psprintf (pool, "%" SVN_REVNUM_T_FMT,
- entry->revision),
+ entry->cmt_rev),
entry->url,
entry->cmt_date,
entry->cmt_author,
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Jun 21 10:18:10 2003