diff svnwrap/svn_swig_wrapper.py @ 6:1a5bb173170b

Fixes for win32 compatibility. Changes suggested by Shun-ichi GOTO, with some alterations by me.
author Augie Fackler <durin42@gmail.com>
date Thu, 02 Oct 2008 09:13:08 -0500
parents f2636cfed115
children 9eb6bf2be1e7
line wrap: on
line diff
--- a/svnwrap/svn_swig_wrapper.py
+++ b/svnwrap/svn_swig_wrapper.py
@@ -1,7 +1,6 @@
 import cStringIO
 import getpass
 import os
-import pwd
 import shutil
 import sys
 import tempfile
@@ -69,8 +68,9 @@ class SubversionRepo(object):
     This uses the SWIG Python bindings, and will only work on svn >= 1.4.
     It takes a required param, the URL.
     """
-    def __init__(self, url=''):
+    def __init__(self, url='', username=''):
         self.svn_url = url
+        self.uname = username
         self.auth_baton_pool = core.Pool()
         self.auth_baton = _create_auth_baton(self.auth_baton_pool)
 
@@ -89,7 +89,6 @@ class SubversionRepo(object):
         # while we're in here we'll recreate our pool
         self.pool = core.Pool()
         self.client_context = client.create_context()
-        self.uname = str(pwd.getpwuid(os.getuid())[0])
         core.svn_auth_set_parameter(self.auth_baton,
                                     core.SVN_AUTH_PARAM_DEFAULT_USERNAME,
                                     self.uname)