User_Agent string in svn client tools

satheesh
satheesh
Hi,    we need to set our own custom user-agent string in svn client tools(svn.exe,svnmucc.exe,svnsync.exe,etc). But we don't want to use dlls for this User-Agent String(but we use dlls for other operations). How can we set custom the user agent string to executable itself(svn.exe,svnsync,...) while building the subversion sources.    Thanks in advance

Last updated

philip
philip
For clients that use an svn_client_context_t you can set the client_name member:    Index: subversion/svn/main.c  ===================================================================  --- subversion/svn/main.c (revision 1484423)  +++ subversion/svn/main.c (working copy)  @@ -2302,6 +2302,7 @@   if ((err = svn_client_create_context(&ctx, pool)))   return svn_cmdline_handle_exit_error(err, pool, "svn: ");   command_baton.ctx = ctx;  + ctx->client_name = "zigzag";     /* If we're running a command that could result in a commit, verify   that any log message we were given on the command line makes    For clients that use svn_ra_callbacks2_t directly you can set the get_client_string member:    Index: subversion/svnmucc/svnmucc.c  ===================================================================  --- subversion/svnmucc/svnmucc.c (revision 1484423)  +++ subversion/svnmucc/svnmucc.c (working copy)  @@ -103,6 +103,15 @@   }     static svn_error_t *  +get_client_string(void *baton,  + const char **name,  + apr_pool_t *pool)  +{  + *name = "foobar";  + return SVN_NO_ERROR;  +}  +  +static svn_error_t *   create_ra_callbacks(svn_ra_callbacks2_t **callbacks,   const char *username,   const char *password,  @@ -123,6 +132,7 @@   cfg_config, NULL, NULL, pool));     (*callbacks)->open_tmp_file = open_tmp_file;  + (*callbacks)->get_client_string = get_client_string;     return SVN_NO_ERROR;   }  
satheesh
satheesh
Thanks a lot Philip..  How can we set the same for svnsync.exe ?  Thanks...
philip
philip
svnsync uses svn_ra_callbacks2_t directly so is similar to svnmucc, set source_callbacks.get_client_string and sync_callbacks.get_client_string in make_subcommand_baton().
satheesh
satheesh
Yes....It's working....  Thanks again philip...

1-5 of 5

Reply to this discussion

You cannot edit posts or make replies: You should be logged in before you can post.