subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1498608 - in /subversion/trunk/subversion: libsvn_ra_local/ra_local.h libsvn_ra_local/ra_plugin.c tests/cmdline/svnlook_tests.py
Date Mon, 01 Jul 2013 17:54:44 GMT
Author: danielsh
Date: Mon Jul  1 17:54:44 2013
New Revision: 1498608

URL: http://svn.apache.org/r1498608
Log:
Set svn:txn-user-agent under ra_local, for consistency with ra_svn and ra_serf.

* subversion/libsvn_ra_local/ra_local.h
  (svn_ra_local__session_baton_t): Add 'useragent' member.

* subversion/libsvn_ra_local/ra_plugin.c
  (USER_AGENT): New macro.

* subversion/tests/cmdline/svnlook_tests.py
  (svn_ra_local__open): Set 'useragent' member.
  (svn_ra_local__get_commit_editor): Set SVN_PROP_TXN_USER_AGENT.
* subversion/tests/cmdline/svnlook_tests.py
  (test_txn_flag): Expect the same output in every RA layer.

Modified:
    subversion/trunk/subversion/libsvn_ra_local/ra_local.h
    subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c
    subversion/trunk/subversion/tests/cmdline/svnlook_tests.py

Modified: subversion/trunk/subversion/libsvn_ra_local/ra_local.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_local/ra_local.h?rev=1498608&r1=1498607&r2=1498608&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_local/ra_local.h (original)
+++ subversion/trunk/subversion/libsvn_ra_local/ra_local.h Mon Jul  1 17:54:44 2013
@@ -62,6 +62,8 @@ typedef struct svn_ra_local__session_bat
   /* Callbacks/baton passed to svn_ra_open. */
   const svn_ra_callbacks2_t *callbacks;
   void *callback_baton;
+
+  const char *useragent;
 } svn_ra_local__session_baton_t;
 
 

Modified: subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c?rev=1498608&r1=1498607&r2=1498608&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c Mon Jul  1 17:54:44 2013
@@ -541,6 +541,9 @@ ignore_warnings(void *baton,
   return;
 }
 
+#define USER_AGENT "SVN/" SVN_VER_NUMBER " (" SVN_BUILD_TARGET ")" \
+                   " ra_local"
+
 static svn_error_t *
 svn_ra_local__open(svn_ra_session_t *session,
                    const char **corrected_url,
@@ -550,6 +553,7 @@ svn_ra_local__open(svn_ra_session_t *ses
                    apr_hash_t *config,
                    apr_pool_t *pool)
 {
+  const char *client_string;
   svn_ra_local__session_baton_t *sess;
   const char *fs_path;
   static volatile svn_atomic_t cache_init_state = 0;
@@ -592,6 +596,15 @@ svn_ra_local__open(svn_ra_session_t *ses
   /* Be sure username is NULL so we know to look it up / ask for it */
   sess->username = NULL;
 
+  if (sess->callbacks->get_client_string != NULL)
+    SVN_ERR(sess->callbacks->get_client_string(sess->callback_baton,
+                                               &client_string, pool));
+  if (client_string)
+    sess->useragent = apr_pstrcat(pool, USER_AGENT " ",
+                                  client_string, (char *)NULL);
+  else
+    sess->useragent = USER_AGENT;
+
   session->priv = sess;
   return SVN_NO_ERROR;
 }
@@ -765,6 +778,8 @@ svn_ra_local__get_commit_editor(svn_ra_s
                 svn_string_create(sess->username, pool));
   svn_hash_sets(revprop_table, SVN_PROP_TXN_CLIENT_COMPAT_VERSION,
                 svn_string_create(SVN_VER_NUMBER, pool));
+  svn_hash_sets(revprop_table, SVN_PROP_TXN_USER_AGENT,
+                svn_string_create(sess->useragent, pool));
 
   /* Get the repos commit-editor */
   return svn_repos_get_commit_editor5

Modified: subversion/trunk/subversion/tests/cmdline/svnlook_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnlook_tests.py?rev=1498608&r1=1498607&r2=1498608&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnlook_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnlook_tests.py Mon Jul  1 17:54:44 2013
@@ -709,10 +709,8 @@ fp.close()"""
                     '  bogus_rev_prop\n',
                     '  svn:date\n',
                     '  svn:txn-client-compat-version\n',
+                    '  svn:txn-user-agent\n',
                     ]
-  # ra_dav and ra_svn add the user-agent ephemeral property
-  if svntest.main.is_ra_type_dav() or svntest.main.is_ra_type_svn():
-    expected_data.append('  svn:txn-user-agent\n')
   verify_logfile(logfilepath, svntest.verify.UnorderedOutput(expected_data))
 
 def property_delete(sbox):



Mime
View raw message