[svnbook] r5349 committed - branches/1.8/zh/book/ch03-advanced-topics.xml
wuzhouhui at users.sourceforge.net
wuzhouhui at users.sourceforge.net
Thu Jul 6 20:45:07 CDT 2017
Revision: 5349
http://sourceforge.net/p/svnbook/source/5349
Author: wuzhouhui
Date: 2017-07-07 01:45:07 +0000 (Fri, 07 Jul 2017)
Log Message:
-----------
Branch 1.8/zh: translation of chapter 3 in progress
Modified Paths:
--------------
branches/1.8/zh/book/ch03-advanced-topics.xml
Modified: branches/1.8/zh/book/ch03-advanced-topics.xml
===================================================================
--- branches/1.8/zh/book/ch03-advanced-topics.xml 2017-07-06 04:24:42 UTC (rev 5348)
+++ branches/1.8/zh/book/ch03-advanced-topics.xml 2017-07-07 01:45:07 UTC (rev 5349)
@@ -1316,9 +1316,14 @@
</informalexample>
<sidebar>
+ <!--
<title>Searchability (or, Why <emphasis>Not</emphasis>
Properties)</title>
+ -->
+ <title>可搜索性 (或者说, 为什么 <emphasis>不</emphasis> 使用属性)
+ </title>
+ <!--
<para>For all their utility, Subversion properties—or,
more accurately, the available interfaces to them—have
a major shortcoming: while it is a simple matter to
@@ -1325,16 +1330,29 @@
<emphasis>set</emphasis> a custom property,
<emphasis>finding</emphasis> that property later is a whole
different ball of wax.</para>
+ -->
+ <para>与 Subversion 属性相关的所有工具—说得更准确点就是所有可
+ 用的接口—都有一个比较严重的问题: 虽然 <emphasis>设置</emphasis>
+ 一个自定义属性非常简单, 但是 <emphasis>搜索</emphasis> 自定义属性就
+ 完全是另一回事了.</para>
+ <!--
<para>Trying to locate a custom revision property generally
involves performing a linear walk across all the revisions
of the repository, asking of each revision, <quote>Do you
have the property I'm looking for?</quote> Use
- the <option>--with-all-revprops</option> option with
+ the <option>- -with-all-revprops</option> option with
the <command>svn log</command> command's XML output mode to
facilitate this search. Notice the presence of the custom
revision property <literal>testresults</literal> in the
following output:</para>
+ -->
+ <para>为了定位一个自定义版本号属性, 通常需要线性访问仓库的所有版本号,
+ 询问每一个版本号 <quote>你有没有我要找的属性?</quote>. 为了帮助
+ 搜索, 给命令 <command>svn log</command> 带上选项
+ <option>--with-all-revprops</option>, 再把输出模式调成 XML. 在下面
+ 的输出中可以看到自定义属性 <literal>testresults</literal> 的信息:
+ </para>
<informalexample>
<screen>
@@ -1356,6 +1374,7 @@
</screen>
</informalexample>
+ <!--
<para>Trying to find a custom versioned property is painful,
too, and often involves a recursive <command>svn
propget</command> across an entire working copy. In your
@@ -1364,7 +1383,13 @@
in terms of both performance and likelihood of success,
especially if the scope of your search would require a
working copy from the root of your repository.</para>
+ -->
+ <para>查找自定义的版本化属性也很痛苦, 经常要在整个工作副本中递归地调用
+ <command>svn propget</command>. 也许递归访问不会像线性访问那样糟糕,
+ 但在性能和成功率上仍然还有很大的提升空间, 尤其是当搜索是从仓库的根
+ 目录开始时.</para>
+ <!--
<para>For this reason, you might choose—especially in
the revision property use case—to simply add your
metadata to the revision's log message using some
@@ -1372,6 +1397,11 @@
formatting that is designed to be quickly parsed from the
output of <command>svn log</command>. It is quite common to
see the following in Subversion log messages:</para>
+ -->
+ <para>由于这个原因, 用户可能会选择—特别是版本号属性—把元
+ 数据直接写到日志消息里, 为了方便从日志消息里解析出元数据, 要使用一
+ 些策略驱动 (可能还会通过程序施加强制性) 的书写格式, 例如下面的
+ Subversion 日志消息格式就很常见:</para>
<informalexample>
<programlisting>
@@ -1383,10 +1413,15 @@
</programlisting>
</informalexample>
+ <!--
<para>But here again lies some misfortune. Subversion doesn't
yet provide a log message templating mechanism, which would
go a long way toward helping users be consistent with the
formatting of their log-embedded revision metadata.</para>
+ -->
+ <para>但是问题仍然存在, Subversion 没有日志消息模版机制, 所以用户必须
+ 自己协商出一套统一的, 嵌入版本号元数据的日志消息格式, 在使用时也只
+ 能由用户自己来保证格式的一致性.</para>
</sidebar>
More information about the svnbook-dev
mailing list