|
a/ForgeSVN/forgesvn/model/svn.py |
|
b/ForgeSVN/forgesvn/model/svn.py |
|
... |
|
... |
94 |
def __str__(self):
|
94 |
def __str__(self):
|
95 |
return "Command: '%s' returned non-zero exit status %s\nSTDOUT: %s\nSTDERR: %s" % \
|
95 |
return "Command: '%s' returned non-zero exit status %s\nSTDOUT: %s\nSTDERR: %s" % \
|
96 |
(self.cmd, self.returncode, self.stdout, self.stderr)
|
96 |
(self.cmd, self.returncode, self.stdout, self.stderr)
|
97 |
|
97 |
|
98 |
|
98 |
|
|
|
99 |
class SVNLibWrapper(object):
|
|
|
100 |
"""Wrapper around pysvn, used for instrumentation."""
|
|
|
101 |
def __init__(self, client):
|
|
|
102 |
self.client = client
|
|
|
103 |
|
|
|
104 |
def checkout(self, *args, **kw):
|
|
|
105 |
return self.client.checkout(*args, **kw)
|
|
|
106 |
|
|
|
107 |
def add(self, *args, **kw):
|
|
|
108 |
return self.client.add(*args, **kw)
|
|
|
109 |
|
|
|
110 |
def checkin(self, *args, **kw):
|
|
|
111 |
return self.client.checkin(*args, **kw)
|
|
|
112 |
|
|
|
113 |
def info2(self, *args, **kw):
|
|
|
114 |
return self.client.info2(*args, **kw)
|
|
|
115 |
|
|
|
116 |
def log(self, *args, **kw):
|
|
|
117 |
return self.client.log(*args, **kw)
|
|
|
118 |
|
|
|
119 |
def cat(self, *args, **kw):
|
|
|
120 |
return self.client.cat(*args, **kw)
|
|
|
121 |
|
|
|
122 |
def list(self, *args, **kw):
|
|
|
123 |
return self.client.list(*args, **kw)
|
|
|
124 |
|
|
|
125 |
def __getattr__(self, name):
|
|
|
126 |
return getattr(self.client, name)
|
|
|
127 |
|
|
|
128 |
|
99 |
class SVNImplementation(M.RepositoryImplementation):
|
129 |
class SVNImplementation(M.RepositoryImplementation):
|
100 |
post_receive_template = string.Template(
|
130 |
post_receive_template = string.Template(
|
101 |
'#!/bin/bash\n'
|
131 |
'#!/bin/bash\n'
|
102 |
'# The following is required for site integration, do not remove/modify.\n'
|
132 |
'# The following is required for site integration, do not remove/modify.\n'
|
103 |
'# Place user hook code in post-commit-user and it will be called from here.\n'
|
133 |
'# Place user hook code in post-commit-user and it will be called from here.\n'
|
|
... |
|
... |
111 |
def __init__(self, repo):
|
141 |
def __init__(self, repo):
|
112 |
self._repo = repo
|
142 |
self._repo = repo
|
113 |
|
143 |
|
114 |
@LazyProperty
|
144 |
@LazyProperty
|
115 |
def _svn(self):
|
145 |
def _svn(self):
|
116 |
return pysvn.Client()
|
146 |
return SVNLibWrapper(pysvn.Client())
|
117 |
|
147 |
|
118 |
@LazyProperty
|
148 |
@LazyProperty
|
119 |
def _url(self):
|
149 |
def _url(self):
|
120 |
return 'file://%s%s' % (self._repo.fs_path, self._repo.name)
|
150 |
return 'file://%s%s' % (self._repo.fs_path, self._repo.name)
|
121 |
|
151 |
|