Index: subversion/libsvn_subr/subst.c =================================================================== --- subversion/libsvn_subr/subst.c (revision 13208) +++ subversion/libsvn_subr/subst.c (working copy) @@ -137,13 +137,13 @@ { const char *keyword = APR_ARRAY_IDX (keyword_tokens, i, const char *); - if ((! strcmp (keyword, SVN_KEYWORD_REVISION_LONG)) - || (! strcmp (keyword, SVN_KEYWORD_REVISION_MEDIUM)) + if ((! strcasecmp (keyword, SVN_KEYWORD_REVISION_LONG)) + || (! strcasecmp (keyword, SVN_KEYWORD_REVISION_MEDIUM)) || (! strcasecmp (keyword, SVN_KEYWORD_REVISION_SHORT))) { kw->revision = svn_string_create (rev, pool); } - else if ((! strcmp (keyword, SVN_KEYWORD_DATE_LONG)) + else if ((! strcasecmp (keyword, SVN_KEYWORD_DATE_LONG)) || (! strcasecmp (keyword, SVN_KEYWORD_DATE_SHORT))) { if (date) @@ -157,12 +157,12 @@ else kw->date = svn_string_create ("", pool); } - else if ((! strcmp (keyword, SVN_KEYWORD_AUTHOR_LONG)) + else if ((! strcasecmp (keyword, SVN_KEYWORD_AUTHOR_LONG)) || (! strcasecmp (keyword, SVN_KEYWORD_AUTHOR_SHORT))) { kw->author = svn_string_create (author ? author : "", pool); } - else if ((! strcmp (keyword, SVN_KEYWORD_URL_LONG)) + else if ((! strcasecmp (keyword, SVN_KEYWORD_URL_LONG)) || (! strcasecmp (keyword, SVN_KEYWORD_URL_SHORT))) { kw->url = svn_string_create (url ? url : "", pool); Index: subversion/tests/clients/cmdline/trans_tests.py =================================================================== --- subversion/tests/clients/cmdline/trans_tests.py (revision 13208) +++ subversion/tests/clients/cmdline/trans_tests.py (working copy) @@ -714,7 +714,133 @@ expected_status = svntest.actions.get_virginal_state(wc_dir, 1) svntest.actions.run_and_verify_status(wc_dir, expected_status) + +#---------------------------------------------------------------------- +# Testing for canonicalized input to svn:keywords +# Propset a case-different keyword and check if +# expansion works +def canonicalize_keywords_prop(sbox): + "test canonocalization of the svn:keywords input" + + sbox.build() + wc_dir = sbox.wc_dir + + # The bug didn't occur if there were multiple files in the + # directory, so setup an empty directory. + Z_path = os.path.join(wc_dir, 'Z') + svntest.actions.run_and_verify_svn (None, None, [], 'mkdir', Z_path) + # Add the file that has the keyword to be expanded + url_path = os.path.join(Z_path, 'url') + svntest.main.file_append (url_path, """This is the file : url. + +LastChangedRevision:$LastChangedRevision$ +lastchangedrevision:$lastchangedrevision$ +Revision:$Revision$ +revision:$revision$ +Rev:$Rev$ +rev:$rev$ + +LastChangedDate:$LastChangedDate$ +lastchangeddate:$lastchangeddate$ +Date:$Date$ +date:$date$ + +LastChangedBy:$LastChangedBy$ +lastchangedby:$lastchangedby$ +Author:$Author$ +author:$author$ + +HeadURL:$HeadURL$ +headurl:$headurl$ +URL:$URL$ +url:$url$ +""") + svntest.main.file_append (url_path, "$url$\n") + svntest.actions.run_and_verify_svn (None, None, [], 'add', url_path) + svntest.actions.run_and_verify_svn(None, None, [], 'propset', + "svn:keywords", + "lastchangedrevision lastchangeddate lastchangedby headurl", + url_path) + + + svntest.actions.run_and_verify_svn(None, None, [], + 'ci', '-m', 'log msg', wc_dir) + + # Check keyword got expanded (and thus the mkdir, add, ps, commit + # etc. worked) + fp = open(url_path, 'r') + lines = fp.readlines() + if (len(lines) == 24): + # LastChangedRevision + if(re.match("LastChangedRevision:\$LastChangedRevision\$", lines[2])): + print "LastChangedRevision expansion failed for", url_path + raise svntest.Failure + if not (re.match("lastchangedrevision:\$lastchangedrevision\$", lines[3])): + print "lastchangedrevision expansion failed for", url_path + raise svntest.Failure + #Revision + if(re.match("Revision:\$Revision\$", lines[4])): + print "Revision expansion failed for", url_path + raise svntest.Failure + if not (re.match("revision:\$revision\$", lines[5])): + print "revision expansion failed for", url_path + raise svntest.Failure + #Rev + if(re.match("Rev:\$Rev\$", lines[6])): + print "Rev expansion failed for", url_path + raise svntest.Failure + if not (re.match("rev:\$rev\$", lines[7])): + print "rev expansion failed for", url_path + raise svntest.Failure + #LastChangedDate + if(re.match("LastChangedDate:\$LastChangedDate\$", lines[9])): + print "LastChangedDate expansion failed for", url_path + raise svntest.Failure + if not (re.match("lastchangeddate:\$lastchangeddate\$", lines[10])): + print "lastchangeddate expansion failed for", url_path + raise svntest.Failure + #Date + if(re.match("Date:\$Date\$", lines[11])): + print "Date expansion failed for", url_path + raise svntest.Failure + if not (re.match("date:\$date\$", lines[12])): + print "date expansion failed for", url_path + raise svntest.Failure + #LastChangedBy + if(re.match("LastChangedBy:\$LastChangedBy\$", lines[14])): + print "LastChangedBy expansion failed for", url_path + raise svntest.Failure + if not (re.match("lastchangedby:\$lastchangedby\$", lines[15])): + print "lastchangedby expansion failed for", url_path + raise svntest.Failure + #Author + if(re.match("Author:\$Author\$", lines[16])): + print "Author expansion failed for", url_path + raise svntest.Failure + if not (re.match("author:\$author\$", lines[17])): + print "author expansion failed for", url_path + raise svntest.Failure + #HeadURL + if not (re.match("HeadURL:\$HeadURL: (http|file|svn|svn\\+ssh)://", lines[19])): + print "HeadURL expansion failed for", url_path + raise svntest.Failure + if not (re.match("headurl:\$headurl\$", lines[20])): + print "headurl expansion failed for", url_path + raise svntest.Failure + if not (re.match("URL:\$URL: (http|file|svn|svn\\+ssh)://", lines[21])): + print "URL expansion failed for", url_path + raise svntest.Failure + if not (re.match("url:\$url\$", lines[22])): + print "url expansion failed for", url_path + raise svntest.Failure + else: + print "File is in an inconsistent state" + raise svntest.Failure + fp.close() + + + ######################################################################## # Run the tests @@ -732,6 +858,7 @@ copy_propset_commit, propset_commit_checkout_nocrash, propset_revert_noerror, + canonicalize_keywords_prop, ] if __name__ == '__main__':