[svnbook] r5386 committed - branches/1.8/zh/book/ch03-advanced-topics.xml
wuzhouhui at users.sourceforge.net
wuzhouhui at users.sourceforge.net
Sat Aug 5 23:02:13 CDT 2017
Revision: 5386
http://sourceforge.net/p/svnbook/source/5386
Author: wuzhouhui
Date: 2017-08-06 04:02:13 +0000 (Sun, 06 Aug 2017)
Log Message:
-----------
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-08-05 04:16:28 UTC (rev 5385)
+++ branches/1.8/zh/book/ch03-advanced-topics.xml 2017-08-06 04:02:13 UTC (rev 5386)
@@ -4659,6 +4659,7 @@
<varlistentry>
<term><literal>Date</literal></term>
<listitem>
+ <!--
<para>This keyword describes the last time the file was
known to have been changed in the repository, and is of
the form <literal>$Date: 2006-07-22 21:42:37 -0700 (Sat,
@@ -4667,11 +4668,18 @@
<literal>Id</literal> keyword, which uses UTC, the
<literal>Date</literal> keyword displays dates using the
local time zone.</para>
+ -->
+ <para>这个关键字描述了仓库中的文件已知的最后一次被修改的时间, 格式是
+ <literal>$Date: 2006-07-22 21:42:37 -0700 (Sat, 22 Jul 2006) $
+ </literal>. 它的别名是 <literal>LastChangedDate</literal>. 和关
+ 键字 <literal>Id</literal> 不同 (<literal>Id</literal> 使用 UTC
+ 时间), <literal>Date</literal> 会按照本地时区显示日期.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>Revision</literal></term>
<listitem>
+ <!--
<para>This keyword describes the last known revision in
which this file changed in the repository, and looks
something like <literal>$Revision: 144 $</literal>.
@@ -4678,21 +4686,33 @@
It may also be specified as
<literal>LastChangedRevision</literal> or
<literal>Rev</literal>.</para>
+ -->
+ <para>这个关键字描述了仓库中的文件已知的最后一次被修改的版本号, 显
+ 示格式
+ 类似于 <literal>$Revision: 144 $</literal>, 它的别名有 <literal>
+ LastChangedRevision</literal> 和 <literal>Rev</literal>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>Author</literal></term>
<listitem>
+ <!--
<para>This keyword describes the last known user to
change this file in the repository, and looks
something like <literal>$Author: harry $</literal>.
It may also be specified as
<literal>LastChangedBy</literal>.</para>
+ -->
+ <para>这个关键字描述了仓库中的文件已知的最后一次是被谁修改的, 显示
+ 格式类似
+ 于 <literal>$Author: harry $</literal>, 它的别名是 <literal>
+ LastChangedBy</literal>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>HeadURL</literal></term>
<listitem>
+ <!--
<para>This keyword describes the full URL to the latest
version of the file in the repository, and looks
something like <literal>$HeadURL:
@@ -4699,11 +4719,17 @@
http://svn.example.com/repos/trunk/calc.c $</literal>.
It may be abbreviated as
<literal>URL</literal>.</para>
+ -->
+ <para>这个关键字描述了仓库中的文件的最新版本的完整 URL 路径, 显示格式
+ 类似于 <literal>$HeadURL:
+ http://svn.example.com/repos/trunk/calc.c $</literal>, 它的别名是
+ <literal>URL</literal>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>Id</literal></term>
<listitem>
+ <!--
<para>This keyword is a compressed combination of the other
keywords. Its substitution looks something like
<literal>$Id: calc.c 148 2006-07-28 21:30:43Z sally
@@ -4714,11 +4740,19 @@
keyword is in UTC, unlike that of the
<literal>Date</literal> keyword (which uses the local time
zone).</para>
+ -->
+ <para>这个关键字是几个关键字的组合, 它显示的内容类似于
+ <literal>$Id: calc.c 148 2006-07-28 21:30:43Z sally $</literal>,
+ 例子的意思是文件 <filename>calc.c</filename> 最后一次修改是在
+ 2006 年, 7 月 28 日, 版本号 148, 作者是 <literal>sally</literal>.
+ <literal>Id</literal> 使用 UTC 时间, 而 <literal>Date</literal>
+ 使用本地时区.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>Header</literal></term>
<listitem>
+ <!--
<para>This keyword is similar to the <literal>Id</literal>
keyword but contains the full URL of the latest revision
of the item, identical to <literal>HeadURL</literal>.
@@ -4725,10 +4759,16 @@
Its substitution looks something like <literal>$Header:
http://svn.example.com/repos/trunk/calc.c
148 2006-07-28 21:30:43Z sally $</literal>.</para>
+ -->
+ <para>这个关键字和 <literal>Id</literal> 类似, 但是增加了 <literal>
+ HeadURL</literal> 的内容, 看起来就像 <literal>$Header:
+ http://svn.example.com/repos/trunk/calc.c
+ 148 2006-07-28 21:30:43Z sally $</literal>.</para>
</listitem>
</varlistentry>
</variablelist>
+ <!--
<para>Several of the preceding descriptions use the phrase
<quote>last known</quote> or similar wording. Keep in mind that
keyword expansion is a client-side operation, and your client
@@ -4738,10 +4778,19 @@
keywords will never expand to different values even if those
versioned files are being changed regularly in the
repository.</para>
+ -->
+ <para>在介绍关键字时, (隐式的或显式的) 用到了形容词 <quote>已知的</quote>,
+ 这是因为关键字替换是一个客户端操作, 客户端只能知道最近一次更新工作副本
+ 时从仓库中获取的信息. 如果工作副本一直得不到更新, 即使仓库中的文件已经
+ 修改了, 工作副本里的关键字也不会替换成更新的信息.</para>
<sidebar>
+ <!--
<title>Where's $GlobalRev$?</title>
+ -->
+ <title>$GlobalRev$ 在哪儿?</title>
+ <!--
<para>New users are often confused by how the
<literal>$Rev$</literal> keyword works. Since the repository
has a single, globally increasing revision number, many people
@@ -4754,7 +4803,16 @@
support of a Subversion keyword to do so, how can you
automatically get the global revision number into your
files?</para>
+ -->
+ <para>新手常常弄不清楚 <literal>$Rev$</literal> 的工作方式. 因为
+ Subversion 有一个全局增长的版本号, 很多新用户以为 <literal>
+ $Rev$</literal> 显示的是版本号的全局最大值. 但实际上 <literal>
+ $Rev$</literal> 被替换成文件最后一次被 <emphasis>修改</emphasis>
+ 时的版本号, 只要理解了这点就不会再有疑惑. 但是还有一个问题没有解决
+ —缺少了关键字的支持, 用户应该如何在文件中自动获取全局最新的版本
+ 号?</para>
+ <!--
<para>To do this, you need external processing. Subversion
ships with a tool called <command>svnversion</command>, which
was designed for just this purpose. It crawls your working
@@ -4763,9 +4821,16 @@
that revision information into your files. For more
information on <command>svnversion</command>, see <xref
linkend="svn.ref.svnversion"/>.</para>
+ -->
+ <para>完成这项工作需要借助另一个工具, <command>svnversion</command>.
+ <command>svnversion</command> 遍历工作副本, 然后输出最新的版本号. 利用
+ 这个命令, 再加上一些额外的工具, 用户就可以把版本号信息插入到文件中,
+ 关于 <command>svnversion</command> 的更多信息, 见
+ <xref linkend="svn.ref.svnversion"/>.</para>
</sidebar>
+ <!--
<para>In addition to previous set of stock keyword definitions and
aliases, Subversion 1.8 allows you the freedom to define and use
custom keywords. To define a custom keyword, add a token to the
@@ -4777,89 +4842,137 @@
and <replaceable>FORMAT</replaceable> is a format string into
which information will be substituted when your keyword is
expanded inside your file.</para>
+ -->
+ <para>除了前面几个预定义的关键字, Subversion 1.8 允许用户定义新的关键字.
+ 为了定义一个关键字, 给属性 <literal>svn:keywords</literal> 新的记号,
+ 记号的格式是 <userinput><replaceable>MyKeyword</replaceable>=
+ <replaceable>FORMAT</replaceable></userinput>, 其中 <replaceable>
+ MyKeyword</replaceable> 是关键字的名字 (关键字锚点需要),
+ <replaceable>FORMAT</replaceable> 是一个格式化的字符串, 替换文件中的关
+ 键字时会根据格式字符进行替换.</para>
+ <!--
<para>The format string syntax used for custom keywords supports
the following format codes:</para>
+ -->
+ <para>格式化字符串支持的格式控制符有以下这些:</para>
<variablelist>
<varlistentry>
<term><literal>%a</literal></term>
<listitem>
+ <!--
<para>The author of the revision given
by <literal>%r</literal>.</para>
+ -->
+ <para>由 <literal>%r</literal> 指定的版本号的作者.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>%b</literal></term>
<listitem>
+ <!--
<para>The basename of the URL of the file.</para>
+ -->
+ <para>文件的 URL 的基本名 (basename).</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>%d</literal></term>
<listitem>
+ <!--
<para>Short format of the date of the revision given by
<literal>%r</literal>.</para>
+ -->
+ <para>由 <literal>%r</literal> 指定的版本号的日期的短格式.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>%D</literal></term>
<listitem>
+ <!--
<para>Long format of the date of the revision given by
<literal>%r</literal>.</para>
+ -->
+ <para>由 <literal>%r</literal> 指定的版本号的日期的长格式.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>%P</literal></term>
<listitem>
+ <!--
<para>The file's path, relative to the repository
root.</para>
+ -->
+ <para>文件相对于仓库根目录的路径.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>%r</literal></term>
<listitem>
+ <!--
<para>The last known revision in which this file changed in
the repository. (This is the same revision which would be
substituted for the <literal>Revision</literal>
keyword.)</para>
+ -->
+ <para>已知的文件最后一次被修改时的版本号 (和用来替换 <literal>Revision
+ </literal> 的版本号相同).</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>%R</literal></term>
<listitem>
+ <!--
<para>The URL to the root of the repository.</para>
+ -->
+ <para>仓库根目录的 URL.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>%u</literal></term>
<listitem>
+ <!--
<para>The URL of the file.</para>
+ -->
+ <para>文件的 URL.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>%_</literal></term>
<listitem>
+ <!--
<para>A space character. (Keyword definitions cannot contain
a literal space character.)</para>
+ -->
+ <para>一个空格符 (定义关键字的字符串中不能包含字面空格).</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>%%</literal></term>
<listitem>
+ <!--
<para>A literal percent sign ('<literal>%</literal>').</para>
+ -->
+ <para>一个百分号 (<literal>%</literal>).</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>%H</literal></term>
<listitem>
+ <!--
<para>Equivalent to <literal>%P%_%r%_%d%_%a</literal>.</para>
+ -->
+ <para>等价于 <literal>%P%_%r%_%d%_%a</literal>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>%I</literal></term>
<listitem>
+ <!--
<para>Equivalent to <literal>%b%_%r%_%d%_%a</literal>.</para>
+ -->
+ <para>等价于 <literal>%b%_%r%_%d%_%a</literal>.</para>
</listitem>
</varlistentry>
</variablelist>
More information about the svnbook-dev
mailing list