[svnbook] r5874 committed - branches/1.8/zh/book/ch08-embedding-svn.xml
wuzhouhui at users.sourceforge.net
wuzhouhui at users.sourceforge.net
Fri Feb 8 03:51:37 CST 2019
Revision: 5874
http://sourceforge.net/p/svnbook/source/5874
Author: wuzhouhui
Date: 2019-02-08 09:51:35 +0000 (Fri, 08 Feb 2019)
Log Message:
-----------
1.8/zh: translation of chapter 8 in progress
Modified Paths:
--------------
branches/1.8/zh/book/ch08-embedding-svn.xml
Modified: branches/1.8/zh/book/ch08-embedding-svn.xml
===================================================================
--- branches/1.8/zh/book/ch08-embedding-svn.xml 2019-02-07 15:06:26 UTC (rev 5873)
+++ branches/1.8/zh/book/ch08-embedding-svn.xml 2019-02-08 09:51:35 UTC (rev 5874)
@@ -1415,6 +1415,7 @@
和应用程序, Subversion GUI 客户端和其他第三方工具都已经成功地把
Subversion 语言绑定应用到它们的 Subversion 集成中.</para>
+ <!--
<para>It's worth noting here that there are other options for
interfacing with Subversion using other languages: alternative
bindings for Subversion that aren't provided by the
@@ -1428,10 +1429,22 @@
implementation of Subversion, check out SVNKit (<ulink
url="http://svnkit.com/" />), which is Subversion rewritten
from the ground up in Java.</para>
+ -->
+ <para>为了使用其他语言与 Subversion 交互, 如果我们还能有其他一些选择,
+ 那将会是一件非常有价值的事情, 例如不是由 Subversion 开发社区提供的
+ 语言绑定, 其他有两个值得我们关注. 第一个是 Barry Scott 开发的 PySVN
+ 绑定 (<ulink url="http://pysvn.tigris.org/" />), 一种很流行的
+ Python 绑定. 与 Subversion 所提供的 Python 相比, PySVN 呈现的接口
+ 更具有 Python 风格. 如果你正在寻找一种纯 Java 实现的 Subversion,
+ 可以试试 SVNKit (<ulink url="http://svnkit.com/" />).</para>
<sidebar>
+ <!--
<title>SVNKit Versus javahl</title>
+ -->
+ <title>SVNKit 与 javahl</title>
+ <!--
<para>In 2005, a small company called TMate announced the
1.0.0 release of JavaSVN—a pure Java implementation of
Subversion. Since then, the project has been renamed to
@@ -1439,7 +1452,14 @@
and has seen great success as a provider of Subversion
functionality to various Subversion clients, IDE
integrations, and other third-party tools.</para>
+ -->
+ <para>2005 年, 一个叫做 TMate 的小公司宣布发行 JavaSVN 1.0.0
+ —它是 Subversion 的纯 Java 语言实现. 从那时起, 该项目被重
+ 命名为 SVNKit (官网是 <ulink url="http://svnkit.com/" />),
+ SVNKit 获得了巨大的成功, 它为不同的 Subversion 客户端, IDE 集成
+ 和第三方工具提供 Subversion 功能.</para>
+ <!--
<para>The SVNKit library is interesting in that, unlike the
javahl library, it is not merely a wrapper around the
official Subversion core libraries. In fact, it shares no
@@ -1450,6 +1470,7 @@
ways. First, while SVNKit is developed as open source
software just like Subversion, SVNKit's license is more
restrictive than that of
+ ### TODO (footnote)
Subversion.<footnote><para>Redistributions in any form must
be accompanied by information on how to obtain complete
source code for the software that uses SVNKit and any
@@ -1464,7 +1485,20 @@
protocol because there's no pure Java implementation of
Berkeley DB that is file-format-compatible with the native
implementation of that library.</para>
+ -->
+ <para>与 javahl 的不同点在于 SVNKit 不是 Subversion 核心函数库的封装,
+ 事实上 SVNKit 与 Subversion 没有共享一行代码, 但是人们还是很容易
+ 混淆 SVNKit 和 javahl, 甚至搞不清楚自己正在用的是哪个函数库. 读者
+ 必须清醒地认识到 SVNKit 和 javahl 在某些方面非常不同, 首先, SVNKit
+ 和 Subversion 一样都是开源软件, 但 SVNKit 的授权更加严格. 然后,
+ SVNKit 的目标是完全用 Java 实现, 因此在复制 Subversion 的功能时,
+ 既要跟上官方 Subversion 的脚步, 也要考虑用 Java 实现相同功能的可
+ 行性. 例如 SVNKit 无法通过 <literal>file://</literal> 协议访问
+ 使用 Berkeley DB 作为后端存储的仓库, 因为不存在纯 Java 实现的
+ Berkeley DB, 其文件格式可以完全兼容 Berkeley DB 的原生语言实现.
+ </para>
+ <!--
<para>That said, SVNKit has a well-established track record of
reliability. And a pure Java solution is much more robust
in the face of programming errors—a bug in SVNKit
@@ -1473,6 +1507,13 @@
down your entire Java Runtime Environment. So, weigh the
costs when choosing a Java-based Subversion
implementation.</para>
+ -->
+ <para>SVNKit 具有完善的可靠性记录跟踪机制. 作为一个纯 Java 实现的
+ 软件, 在面对编程错误时将更加健壮—SVNKit 的错误会产生一个
+ 可捕获的 Java 异常, 而如果通过 javahl 使用 Subversion 核心函数库
+ 时发生了错误, 可能会导致整个 JRE (Java Runtime Environment) 崩溃.
+ 所以说在选择基于 Java 的 Subversion 实现时, 应该仔细衡量代价.
+ </para>
</sidebar>
@@ -1480,8 +1521,12 @@
<!-- =============================================================== -->
<sect2 id="svn.developer.usingapi.codesamples">
+ <!--
<title>Code Samples</title>
+ -->
+ <title>代码示例</title>
+ <!--
<para><xref linkend="svn.developer.layerlib.repos.ex-1" />
contains a code segment (written in C) that illustrates some
of the concepts we've been discussing. It uses both the
@@ -1495,9 +1540,21 @@
handling—all Subversion errors must be explicitly
handled to avoid memory leakage (and in some cases,
application failure).</para>
+ -->
+ <para><xref linkend="svn.developer.layerlib.repos.ex-1" /> 展示了一
+ 个用 C 语言编写的代码示例, 说明了我们已经介绍过的几个概念. 示例
+ 同时使用了仓库和文件系统接口 (可以从函数名的
+ <literal>svn_repos_</literal> 和 <literal>svn_fs_</literal> 前缀
+ 看出) 来创建一个新的版本号, 该版本号添加了一个新目录. 你可以从示例
+ 里看到 APR 内存池的用法—它们只是作为参数被传递给 Subversion
+ 库函数. 示例还展示了 Subversion 较为晦涩的错误处理—必须显式
+ 处理所有的 Subversion 错误, 以避免出现内存泄漏 (或程序失败).</para>
<example id="svn.developer.layerlib.repos.ex-1">
+ <!--
<title>Using the repository layer</title>
+ -->
+ <title>使用仓库层</title>
<programlisting>
/* Convert a Subversion error into a simple boolean error code.
More information about the svnbook-dev
mailing list