Mercurial > hgsubversion
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 5:0548662e2f34 | 6:1a5bb173170b |
|---|---|
| 1 import cStringIO | 1 import cStringIO |
| 2 import getpass | 2 import getpass |
| 3 import os | 3 import os |
| 4 import pwd | |
| 5 import shutil | 4 import shutil |
| 6 import sys | 5 import sys |
| 7 import tempfile | 6 import tempfile |
| 8 | 7 |
| 9 from svn import client | 8 from svn import client |
| 67 """Wrapper for a Subversion repository. | 66 """Wrapper for a Subversion repository. |
| 68 | 67 |
| 69 This uses the SWIG Python bindings, and will only work on svn >= 1.4. | 68 This uses the SWIG Python bindings, and will only work on svn >= 1.4. |
| 70 It takes a required param, the URL. | 69 It takes a required param, the URL. |
| 71 """ | 70 """ |
| 72 def __init__(self, url=''): | 71 def __init__(self, url='', username=''): |
| 73 self.svn_url = url | 72 self.svn_url = url |
| 73 self.uname = username | |
| 74 self.auth_baton_pool = core.Pool() | 74 self.auth_baton_pool = core.Pool() |
| 75 self.auth_baton = _create_auth_baton(self.auth_baton_pool) | 75 self.auth_baton = _create_auth_baton(self.auth_baton_pool) |
| 76 | 76 |
| 77 self.init_ra_and_client() | 77 self.init_ra_and_client() |
| 78 self.uuid = ra.get_uuid(self.ra, self.pool) | 78 self.uuid = ra.get_uuid(self.ra, self.pool) |
| 87 unified diffs runs the remote server out of open files. | 87 unified diffs runs the remote server out of open files. |
| 88 """ | 88 """ |
| 89 # while we're in here we'll recreate our pool | 89 # while we're in here we'll recreate our pool |
| 90 self.pool = core.Pool() | 90 self.pool = core.Pool() |
| 91 self.client_context = client.create_context() | 91 self.client_context = client.create_context() |
| 92 self.uname = str(pwd.getpwuid(os.getuid())[0]) | |
| 93 core.svn_auth_set_parameter(self.auth_baton, | 92 core.svn_auth_set_parameter(self.auth_baton, |
| 94 core.SVN_AUTH_PARAM_DEFAULT_USERNAME, | 93 core.SVN_AUTH_PARAM_DEFAULT_USERNAME, |
| 95 self.uname) | 94 self.uname) |
| 96 | 95 |
| 97 self.client_context.auth_baton = self.auth_baton | 96 self.client_context.auth_baton = self.auth_baton |
