26
def create_auth_svn_client(username, password):
27
"""Create a new pysvn client which is set up to automatically authenticate
28
with the supplied credentials.
30
username = str(username)
31
password = str(password)
32
def get_login(_realm, existing_login, _may_save):
33
"""Callback function used by pysvn for authentication.
34
realm, existing_login, _may_save: The 3 arguments passed by pysvn to
36
The following has been determined empirically, not from docs:
37
existing_login will be the name of the user who owns the process on
38
the first attempt, "" on subsequent attempts. We use this fact.
40
# Only provide credentials on the _first_ attempt.
41
# If we're being asked again, then it means the credentials failed for
42
# some reason and we should just fail. (This is not desirable, but it's
43
# better than being asked an infinite number of times).
44
return (existing_login != "", username, password, True)
46
svnclient = pysvn.Client()
47
svnclient.callback_get_login = get_login
26
50
def revision_from_string(r_str):