subversion python绑定文档? [英] subversion python bindings documentation?
问题描述
我在哪里可以找到使用subversion python绑定的好的介绍?
Where can I find a good introduction to using the subversion python bindings?
我发现 svnbook中的一节,介绍它;以及一些 1.3中的基本示例。
是否有一些更彻底和最新的东西?
Is there something a bit more thorough and up-to-date?
推荐答案
只是想在这里添加一点澄清。
Just wanted to add a little clarification here.
感谢上述两个答案( @BenjaminWohlwend 和< a href =https://stackoverflow.com/a/7356388/277826> @Logan ),我发现Subversion有不止一套Python绑定/接口;我在我的Ubuntu 11.04框上这样做:
Thanks to the above two answers (@BenjaminWohlwend and @Logan), I became aware there are more than one set of Python bindings/interfaces for Subversion; I did this on my Ubuntu 11.04 box:
$ apt-cache search '[Ss]vn|[Ss]ubversion' | grep -i python
python-svn - A(nother) Python interface to Subversion
python-svn-dbg - A(nother) Python interface to Subversion (debug extension)
python-subversion - Python bindings for Subversion
python-subversion-dbg - Python bindings for Subversion (debug extension)
python-opster - a python command line parsing speedster
python-py - Advanced Python testing tool and networking lib
python-rope - Python refactoring library
python-subvertpy - Alternative Python bindings for Subversion
可以看看Debian软件包文件列表,以确定这些引用的库;所以我们有:
One can look at the Debian package filelist, to determine which libraries these refer to; so we have:
-
python-subversion
- 或SWIG绑定(或libsvn
,libsvn_swig_py
)文件列表
- 示例: http://svn.apache.org/repos/asf/subversion/trunk/tools/examples/ , http://svn.apache.org/repos/ asf / subversion / trunk / subversion / bindings / swig / python / tests /
-
import svn.core,svn.client
;从svn import fs,core,repos
python-subversion
- or SWIG bindings (orlibsvn
,libsvn_swig_py
) filelist- Examples: http://svn.apache.org/repos/asf/subversion/trunk/tools/examples/ , http://svn.apache.org/repos/asf/subversion/trunk/subversion/bindings/swig/python/tests/
import svn.core, svn.client
;from svn import fs, core, repos
- 示例: http://sourcecodebrowser.com/pysvn/1.4.1/dir_cd55444703d7fb2488815f1970d01a75.html , http://pysvn.tigris.org/docs/pysvn_prog_guide.html
-
import pysvn
- Examples: http://sourcecodebrowser.com/pysvn/1.4.1/dir_cd55444703d7fb2488815f1970d01a75.html , http://pysvn.tigris.org/docs/pysvn_prog_guide.html
import pysvn
- 示例: http://sourcecodebrowser.com/subvertpy/0.7.2/dir_22b88615bda8eebb370e96884c00fb89.html
-
from subvertpy import delta,repos
,from subvertpy.ra import RemoteAccess,Auth
- Examples: http://sourcecodebrowser.com/subvertpy/0.7.2/dir_22b88615bda8eebb370e96884c00fb89.html
from subvertpy import delta, repos
,from subvertpy.ra import RemoteAccess, Auth
...我还在存储库中找到另一个:
... and I also found another in the repository:
-
ctypes-python
- 或csvn
源
- 示例: http://svn.apache.org/repos/asf/subversion/trunk / subversion / bindings / ctypes-python / examples /
-
import csvn.core
,来自csvn.repos import *
ctypes-python
- orcsvn
source- Examples: http://svn.apache.org/repos/asf/subversion/trunk/subversion/bindings/ctypes-python/examples/
import csvn.core
,from csvn.repos import *
链接 http://svn.apache.org/repos/asf/subversion (我从 @BenjaminWohlwend )显然是Subversion源代码本身的Apache Software Foundation(asf?)Subversion存储库。
The link http://svn.apache.org/repos/asf/subversion (which I got from @BenjaminWohlwend) is apparently the Apache Software Foundation (asf?) Subversion repository for Subversion source code itself.
OP对文档的追求似乎与
python-subversion
(或SWIG绑定(或libsvn
);其源自源代码的说明在 @Logan 的帖子中。我找不到更好的文档源,从 svn.developer :使用OP中已经引用的API ,除了 bindings / swig / python / README ;它解释了SWIG如何从C生成Python接口:The OP's quest for documentation seems related to
python-subversion
(or SWIG bindings (orlibsvn
); whose build-from-source instructions are in @Logan's post. I couldn't find much better documentation source from the svn.developer: Using the APIs already referred in the OP, except for the bindings/swig/python/README; it explains how SWIG generates Python interfaces from C:
TRANSLATING PARAMETER LISTS
TRANSLATING PARAMETER LISTS
SWIG绑定的论证裁决法则如下
this:The argument-reductions laws of the SWIG bindings something go like
this:- The module prefix can be omitted. o: void *some_C_function = svn_client_foo; becomes: import svn.client func = svn.client.foo
[...]
然后,可以看看, a href =http://svn.apache.org/repos/asf/subversion/trunk/subversion/bindings/swig/python/svn/core.py =nofollow noreferrer> svn / core.py ,并找到函数(和明确定义的符号),如
svn_mergeinfo_merge
;注意到core.py
importlibsvn.core
- 其中libsvn
可能是指从C文件构建的共享对象(.so
)文件 libsvn_swig_py / swigutil_py.c 。Then, one could look in, say, svn/core.py, and find functions (and "Symbols defined explicitly") like
svn_mergeinfo_merge
; noting thatcore.py
importslibsvn.core
- wherelibsvn
probably refers to the shared object (.so
) files built from the C file libsvn_swig_py/swigutil_py.c.然后,我们可以查找
svn_mergeinfo_merge
,并找到一个提交消息,如 SVNSearch:Subversion(commit 23570 05.03.2007),它引用该函数,并且svn_mergeinfo.h
;查找该文件进一步,我们在ASF存储库中找到它: svn_mergeinfo.h ,其确实包含:Then, we can look up
svn_mergeinfo_merge
, and find a commit message like SVNSearch: Subversion (commit 23570 05.03.2007), which refers to that function, and asvn_mergeinfo.h
; looking up that file further, we find it in the ASF repository: svn_mergeinfo.h, which indeed contains:/** Like svn_mergeinfo_merge2, but uses only one pool. * * @deprecated Provided for backward compatibility with the 1.5 API. */ SVN_DEPRECATED svn_error_t * svn_mergeinfo_merge(svn_mergeinfo_t mergeinfo, svn_mergeinfo_t changes, apr_pool_t *pool);
看到
DEPRECATED
那里,这可能很好参考 svn commit:r1175903(2011年9月26日):Seeing
DEPRECATED
there, it's probably good here to refer to svn commit: r1175903 (Mon Sep 26 2011):
-
subversion / libsvn_subr /mergeinfo.c
subversion/libsvn_subr/mergeinfo.c
(svn_mergeinfo_merge2):新增。
(svn_mergeinfo_merge2): New.
(svn_mergeinfo_merge):移至deprecated.c。
(svn_mergeinfo_merge): Move to deprecated.c.
(svn_mergeinfo_catalog_merge):使用新的API。
(svn_mergeinfo_catalog_merge): Use the new API.
这是 - 在2011年已经不推荐使用这个特殊功能 - 所以希望Python的SVN绑定和SVN安装应该匹配...
That is - that particular function has been deprecated in 2011 - so hopefully, one's Python SVN bindings and SVN installation should be matching...
这篇关于subversion python绑定文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!