Announcement

Collapse
No announcement yet.

User_Agent string in svn client tools

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • User_Agent string in svn client tools

    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

  • #2
    For clients that use an svn_client_context_t you can set the client_name member:
    Code:
    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:
    Code:
    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;
     }

    Comment


    • #3
      Thanks a lot Philip..

      How can we set the same for svnsync.exe ?

      Thanks...

      Comment


      • #4
        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().

        Comment


        • #5
          Yes....It's working....

          Thanks again philip...

          Comment

          Working...
          X