comparison svnwrap/svn_swig_wrapper.py @ 233:80a700398995

Fix SubversionRepo to actually use provided username
author Daniel Tang <dytang@cs.purdue.edu>
date Mon, 06 Apr 2009 02:50:22 -0400
parents f71af18c4379
children 33e885f5f86a
comparison
equal deleted inserted replaced
232:c0063328587f 233:80a700398995
118 This uses the SWIG Python bindings, and will only work on svn >= 1.4. 118 This uses the SWIG Python bindings, and will only work on svn >= 1.4.
119 It takes a required param, the URL. 119 It takes a required param, the URL.
120 """ 120 """
121 def __init__(self, url='', username=''): 121 def __init__(self, url='', username=''):
122 self.svn_url = url 122 self.svn_url = url
123 self.uname = username 123 self.username = username
124 self.auth_baton_pool = core.Pool() 124 self.auth_baton_pool = core.Pool()
125 self.auth_baton = _create_auth_baton(self.auth_baton_pool) 125 self.auth_baton = _create_auth_baton(self.auth_baton_pool)
126 126
127 self.init_ra_and_client() 127 self.init_ra_and_client()
128 self.uuid = ra.get_uuid(self.ra, self.pool) 128 self.uuid = ra.get_uuid(self.ra, self.pool)
137 """Initializes the RA and client layers, because sometimes getting 137 """Initializes the RA and client layers, because sometimes getting
138 unified diffs runs the remote server out of open files. 138 unified diffs runs the remote server out of open files.
139 """ 139 """
140 # while we're in here we'll recreate our pool 140 # while we're in here we'll recreate our pool
141 self.pool = core.Pool() 141 self.pool = core.Pool()
142 if self.username:
143 core.svn_auth_set_parameter(self.auth_baton,
144 core.SVN_AUTH_PARAM_DEFAULT_USERNAME,
145 self.username)
142 self.client_context = client.create_context() 146 self.client_context = client.create_context()
143 147
144 self.client_context.auth_baton = self.auth_baton 148 self.client_context.auth_baton = self.auth_baton
145 self.client_context.config = svn_config 149 self.client_context.config = svn_config
146 callbacks = RaCallbacks() 150 callbacks = RaCallbacks()