0
問題:使用pysvn.Client更新分支(http://svn.exemple.com/root/workspace/branch)時,它會請求svn root(http: /svn.exemple.com/root),並接收適用的ClientError(403 Forbidden)。pysvn請求SVN ROOT請求分支時
它發生在linux-2.6(redhat-5.6-Final)上,當我在Windows 7上測試時,代碼運行良好。
這樣的代碼:
def _initClient(self):
self._client = pysvn.Client()
self._client.exception_style = 1
self._client.set_default_username(self.configObj.SVN_USER)
self._client.set_default_password(self.configObj.SVN_PASSWD)
try:
self.cur_revision_number = self._client.info(self._workcopy)["revision"].number
except pysvn.ClientError:
self.cur_revision_number = self._client.checkout(self.configObj.SVN_SERVER,self._workcopy).number
def update(self, pathname=None, **kwargs):
'''
Update workcopy
Extra kwargs are:
recurse=True,
revision=version("head"),
ignore_externals=False,
depth=depth
'''
if not pathname:
path = self._workcopy
elif os.path.isabs(pathname):
path = pathname
if self._workcopy not in path:
raise ValueError("Unkown workcopy \"%s\"" % pathname)
else:
path = os.path.join(self._workcopy, pathname)
self.cur_revision_number = self._client.update(
path, **kwargs
)[-1].number
favicon.ico已被重命名,但403錯誤仍然存在。 – Mapleaf