Index: subversion/clients/cmdline/main.c
===================================================================
--- subversion/clients/cmdline/main.c	(revision 15373)
+++ subversion/clients/cmdline/main.c	(working copy)
@@ -29,6 +29,7 @@
 #include <apr_tables.h>
 #include <apr_general.h>
 #include <apr_signal.h>
+#include <apr_env.h>
 
 #include "svn_cmdline.h"
 #include "svn_pools.h"
@@ -815,6 +816,7 @@
   const svn_opt_subcommand_desc_t *subcommand = NULL;
   const char *dash_m_arg = NULL, *dash_F_arg = NULL;
   const char *path_utf8;
+  char *auth_username;
   apr_status_t apr_err;
   svn_cl__cmd_baton_t command_baton;
   svn_auth_baton_t *ab;
@@ -1395,6 +1397,11 @@
     svn_auth_open (&ab, providers, pool);
     ctx->auth_baton = ab;
 
+    /* use enironment variable SVN_USERNAME as default login */
+    if (APR_ENOTIMPL != apr_env_get(&auth_username, "SVN_USERNAME", pool))
+      svn_auth_set_parameter(ab, SVN_AUTH_PARAM_DEFAULT_USERNAME,
+                             auth_username);
+
     /* Place any default --username or --password credentials into the
        auth_baton's run-time parameter hash. */
     if (opt_state.auth_username)


