[svnbook commit] r1618 - trunk/src/zh/book
rocksun
svnbook-dev at red-bean.com
Wed Aug 17 12:23:35 CDT 2005
Author: rocksun
Date: Wed Aug 17 12:23:34 2005
New Revision: 1618
Modified:
trunk/src/zh/book/ch07.xml
Log:
* zh/book/ch07.xml: translated to svn-ch-7-sect-2.3.5
Modified: trunk/src/zh/book/ch07.xml
==============================================================================
--- trunk/src/zh/book/ch07.xml (original)
+++ trunk/src/zh/book/ch07.xml Wed Aug 17 12:23:34 2005
@@ -1,40 +1,16 @@
-<chapter id="svn-ch-7">
- <title>Advanced Topics</title>
+<chapter id="svn-ch-7">
+ <title>高级主题</title>
<simplesect>
- <para>If you've been reading this book chapter by chapter, from
- start to finish, you should by now have acquired enough
- knowledge to use the Subversion client to perform the most
- common version control operations. You understand how to
- checkout a working copy from a Subversion repository. You are
- comfortable with submitting and receiving changes using the
- <command>svn commit</command> and <command>svn update</command>
- functions. You've probably even developed a reflex which causes
- you to run the <command>svn status</command> command almost
- unconsciously. For all intents and purposes, you are ready to
- use Subversion in a typical environment.</para>
-
- <para>But the Subversion feature set doesn't stop at <quote>common
- version control operations</quote>.</para>
-
- <para>This chapter highlights some of Subversion's features that
- aren't quite so regularly used. In it, we will discuss
- Subversion's property (or <quote>metadata</quote>) support, and
- how to modify Subversion's default behaviors by tweaking its
- run-time configuration area. We will describe how you can use
- externals definitions to instruct Subversion to pull data from
- multiple repositories. We'll cover in detail some of the
- additional client- and server-side tools that are part of the
- Subversion distribution.</para>
-
- <para>Before reading this chapter, you should be familiar with the
- basic file and directory versioning capabilities of Subversion.
- If you haven't already read about those, or if you need a
- refresher, we recommend that you check out <xref
- linkend="svn-ch-2" /> and <xref linkend="svn-ch-3" />. Once
- you've mastered the basics and consumed this chapter, you'll be
- a Subversion power-user!
+ <para>如果你是从头到尾按章节阅读本书,你一定已经具备了使用Subversion客户端执行大多数不同的版本控制操作足够的知识,你理解了怎样从Subversion版本库取出一个工作拷贝,你已经熟悉了通过<command>svn commit</command>和<command>svn update</command>来提交和接收修改,你一定也养成了使用<command>svn status</command>在的无意识的条件反射,为了所有的目的和意图,你已经准备好了在普通环境中使用Subversion。</para>
+
+ <para>但是Subversion的特性集不只是<quote>普通的版本控制操作</quote>。</para>
+
+ <para>本章重点介绍一些Subversion不常用的特性,在这里,我们会讨论Subversion的属性(或者说<quote>元数据</quote>)支持,和怎样通过更改它的运行中配置区域来修改Subversion的缺省行为方式,我们会描述怎样使用外部定义来指导Subversion从多个版本库得到数据,我们会覆盖一些Subversion分发版本附加的客户端和服务器端的工具的细节。</para>
+
+ <para>在阅读本章之前,你一定要熟悉Subversion对文件和目录的基本版本操作能力,如果你已经阅读了哪些,或者是你需要一个复习,我们建议你检查<xref
+ linkend="svn-ch-2" />和<xref linkend="svn-ch-3" />,一旦你已经掌握了基础知识和本章,你会是一个Subversion的超级用户!
</para>
</simplesect>
@@ -43,163 +19,67 @@
<!-- *** SECTION 1: RUNTIME CONFIGURATION AREA *** -->
<!-- ******************************************************************* -->
<sect1 id="svn-ch-7-sect-1">
- <title>Runtime Configuration Area</title>
+ <title>运行中配置区域</title>
- <para>Subversion provides many optional behaviors that can be
- controlled by the user. Many of these options are of the kind
- that a user would wish to apply to all Subversion operations.
- So, rather than forcing users to remember command-line arguments
- for specifying these options, and to use them for each and every
- operation they perform, Subversion uses configuration files,
- segregated into a Subversion configuration area.</para>
-
- <para>The Subversion <firstterm>configuration area</firstterm> is
- a two-tiered hierarchy of option names and their values.
- Usually, this boils down to a special directory that contains
- <firstterm>configuration files</firstterm> (the first tier),
- which are just text files in standard INI format (with
- <quote>sections</quote> providing the second tier). These files
- can be easily edited using your favorite text editor (such as
- Emacs or vi), and contain directives read by the client to
- determine which of several optional behaviors the user
- prefers.</para>
+ <para>Subversion提供了许多用户可以控制的可选行为方式,许多是那种用户希望添加到所有的Subversion操作中的选项,所以胜于强制用户记住命令行参数并且使用这些选项,并且在每个命令中使用,Subversion使用配置文件各离岛Subversion的配置区域。</para>
+
+ <para>Subversion<firstterm>配置区域</firstterm>是一个双重层次选项名称和他们的值。通常,这归结为一个保存<firstterm>配置文件</firstterm>的特殊目录(第一层),知识一些标准的INI格式(包含<quote>部分</quote>支持第二层)的文本文件。这些文件可以简单用你喜欢的文本编辑器编辑(如Emacs或vi),而且保存了客户端可以读取的指示,用来指导用户的一些行为选项。</para>
<!-- ***************************************************************** -->
<sect2 id="svn-ch-7-sect-1.1">
- <title>Configuration Area Layout</title>
+ <title>配置区域布局</title>
- <para>The first time that the <command>svn</command>
- command-line client is executed, it creates a per-user
- configuration area. On Unix-like systems, this area appears
- as a directory named <filename>.subversion</filename> in the
- user's home directory. On Win32 systems, Subversion creates a
- folder named <filename>Subversion</filename>, typically inside
- the <filename>Application Data</filename> area of the user's
- profile directory (which, by the way, is usually a hidden
- directory). However, on this platform the exact location
- differs from system to system, and is dictated by the Windows
- registry.
+ <para><command>svn</command>命令行客户端第一次执行时,它会创建一个每用户的配置区域,在类Unix系统,这个区域在用户主目录,是一个名字为<filename>.subversion</filename>的目录。在Win32系统,Subversion在创建了一个<filename>Subversion</filename>目录,通常是在用户的profile目录(顺便说一句,通常是一个隐藏目录)的<filename>Application Data</filename>区域。然而,在这个平台上具体的位置在各个系统是不一样的,是Windows注册表决定的。
<footnote>
- <para>The <literal>APPDATA</literal> environment variable
- points to the <filename>Application Data</filename> area,
- so you can always refer to this folder as
- <filename>%APPDATA%\Subversion</filename>.</para>
+ <para><literal>APPDATA</literal>环境变量指向<filename>Application Data</filename>区域,所以你可以一直通过<filename>%APPDATA%\Subversion</filename>引用这个目录。
+ </para>
</footnote>
- We will refer to the per-user configuration area using its Unix
- name, <filename>.subversion</filename>.</para>
+ 我们会通过它的Unix名字<filename>.subversion</filename>来饮用每用户配置区域。
+ </para>
- <para>In addition to the per-user configuration area, Subversion
- also recognizes the existence of a system-wide configuration
- area. This gives system administrators the ability to
- establish defaults for all users on a given machine. Note
- that the system-wide configuration area does not alone dictate
- mandatory policy—the settings in the per-user
- configuration area override those in the system-wide one, and
- command-line arguments supplied to the <command>svn</command>
- program have the final word on behavior. On Unix-like
- platforms, the system-wide configuration area is
- expected to be the <filename>/etc/subversion</filename>
- directory; on Windows machines, it looks for a
- <filename>Subversion</filename> directory inside the common
- <filename>Application Data</filename> location (again, as
- specified by the Windows Registry). Unlike the per-user
- case, the <command>svn</command> program does not attempt
- to create the system-wide configuration area.</para>
-
- <para>The configuration area currently contains three
- files—two configuration files (<filename>config</filename> and
- <filename>servers</filename>), and a <filename>README.txt</filename>
- file which describes the INI format. At the time of their
- creation, the files contain default values for each of the
- supported Subversion options, mostly commented out and grouped
- with textual descriptions about how the values for the key
- affect Subversion's behavior. To change a certain behavior,
- you need only to load the appropriate configuration file into
- a text editor, and modify the desired option's value. If at
- any time you wish to have the default configuration settings
- restored, you can simply remove (or rename) your configuration
- directory and then run some innocuous <command>svn</command>
- command, such as <command>svn --version</command>. A new
- configuration directory with the default contents will be
- created.</para>
-
- <para>The per-user configuration area also contains a cache of
- authentication data. The <filename>auth</filename> directory
- holds a set of subdirectories that contain pieces of cached
- information used by Subversion's various supported
- authentication methods. This directory is created in such a
- way that only the user herself has permission to read its
- contents.</para>
+ <para>除了每用户的配置区域,Subversion也会识别系统级的配置区域,这给了系统管理员有能力来建立缺省值给所有的给定机器的用户,注意那个系统级的配置区域不会规定不变的策略—每用户的配置区域会覆盖系统级的配置,<command>svn</command>命令行的参数决定最后的行为。在类Unix的平台,系统级的配置区域会在<filename>/etc/subversion</filename>目录,在Windows的机器,它会寻找<filename>Application Data</filename>(再说一次,是由Windows注册表决定)的<filename>Subversion</filename>目录。不像每用户的情况,<command>svn</command>不会试图创建系统级的配置区域。</para>
+
+ <para>配置区域现在保存三个文件—两个配置文件(<filename>config</filename>和<filename>servers</filename>),和一个描述INI格式的<filename>README.txt</filename>文件。他们创建的时候,文件保存缺省的Subversion选项,大多数已经加了注释,并且用文字描述分组,记述了这些值对Subversion的关键影响,为了修改期望的选项值,如果在任何时候你希望恢复缺省的配置,可以直接删除(或者重命名)你的配置目录,并且运行一些无影响的<command>svn</command>命令,如<command>svn --version</command>,一个包含缺省值的新配置目录就会创建起来。</para>
+
+ <para>每用户配置区域也保存了认证数据的一个缓存,<filename>auth</filename>目录保存了一些子目录中缓存了一些Subversion各种支持的认证方法的信息,这个目录创建为只可以被它的用户读取内容。</para>
</sect2>
<!-- ***************************************************************** -->
<sect2 id="svn-ch-7-sect-1.2">
- <title>Configuration and the Windows Registry</title>
+ <title>配置和Windows注册表</title>
+
+ <para>作为INI为基础的配置趋于的补充,运行在Windows平台Subversion客户端也可以使用Windows猪膘来保存配置数据,选项名称和它们的值与INI文件的一样,<quote>file/section</quote>层级也已经保存,尽管使用不同的样式—在这种模式里,文件和小节也是注册表树的层级。</para>
- <para>In addition to the usual INI-based configuration area,
- Subversion clients running on Windows platforms may also use
- the Windows registry to hold the configuration data. The
- option names and their values are the same as in the INI
- files. The <quote>file/section</quote> hierarchy is
- preserved as well, though addressed in a slightly different
- fashion—in this schema, files and sections are just
- levels in the registry key tree.</para>
-
- <para>Subversion looks for system-wide configuration values
- under the
- <literal>HKEY_LOCAL_MACHINE\Software\Tigris.org\Subversion</literal>
- key. For example, the <literal>global-ignores</literal> option,
- which is in the <literal>miscellany</literal> section of the
- <filename>config</filename> file, would be found at
- <literal>HKEY_LOCAL_MACHINE\Software\Tigris.org\Subversion\Config\Miscellany\global-ignores</literal>.
- Per-user configuration values should be stored under
- <literal>HKEY_CURRENT_USER\Software\Tigris.org\Subversion</literal>.
+ <para>Subversion查找系统级的配置值得位置是键<literal>HKEY_LOCAL_MACHINE\Software\Tigris.org\Subversion</literal>,举个例子,<literal>global-ignores</literal>选项是在<filename>config</filename>文件的<literal>miscellany</literal>小节,会在<literal>HKEY_LOCAL_MACHINE\Software\Tigris.org\Subversion\Config\Miscellany\global-ignores</literal>看到,每用户的配置值是存放在<literal>HKEY_CURRENT_USER\Software\Tigris.org\Subversion</literal>下。
</para>
- <para>Registry-based configuration options are parsed
- <emphasis>before</emphasis> their file-based counterparts,
- so are overridden by values found in the configuration
- files. In other words, configuration priority is granted in
- the following order on a Windows system:</para>
+ <para>注册表为基础的配置选项在它的文件为基础的对应部分<emphasis>之前</emphasis>被解析,所以会被配置文件中的值覆盖,换句话说,在Windows系统下配置级别是下面的次序:</para>
<orderedlist>
<listitem>
- <para>Command-line options</para>
+ <para>命令行选项</para>
</listitem>
<listitem>
- <para>The per-user INI files</para>
+ <para>每用户INI文件</para>
</listitem>
<listitem>
- <para>The per-user Registry values</para>
+ <para>每用户注册表值</para>
</listitem>
<listitem>
- <para>The system-wide INI files</para>
+ <para>系统级INI文件</para>
</listitem>
<listitem>
- <para>The system-wide Registry values</para>
+ <para>系统级注册表值</para>
</listitem>
</orderedlist>
- <para>Also, the Windows Registry doesn't really support the
- notion of something being <quote>commented out</quote>.
- However, Subversion will ignore any option key whose name
- begins with a hash (<literal>#</literal>) character. This
- allows you to effectively comment out a Subversion option
- without deleting the entire key from the Registry, obviously
- simplifying the process of restoring that option.</para>
-
- <para>The <command>svn</command> command-line client never
- attempts to write to the Windows Registry, and will not
- attempt to create a default configuration area there. You can
- create the keys you need using the <command>REGEDIT</command>
- program. Alternatively, you can create a
- <filename>.reg</filename> file, and then double-click on that
- file from the Explorer shell, which will cause the data to be
- merged into your registry.</para>
+ <para>所以,Windows注册表不会真的支持<quote>注释掉了</quote>这种概念,但是Subversion会忽略所有以井号(<literal>#</literal>)开始的字符,这允许你快速的取消一个选项而不需要删除整个注册表,很明显简化了保存选项的过程。</para>
+
+ <para><command>svn</command>命令行客户端决不会尝试写Windows注册表,不会创建你需要使用<command>REGEDIT</command>创建的键,作为选择,你可以创建一个<filename>.reg</filename>文件,并且双击这个文件,这回倒这数据合并到你的注册表。</para>
<example id="svn-ch-7-sect-1.2-ex-1">
- <title>Sample Registration Entries (.reg) File.</title>
+ <title>注册表条目(.reg)样本文件。</title>
<programlisting>
REGEDIT4
@@ -242,41 +122,20 @@
</programlisting>
</example>
- <para>The previous example shows the contents of a
- <filename>.reg</filename> file which contains some of the most
- commonly used configuration options and their default values.
- Note the presence of both system-wide (for network
- proxy-related options) and per-user settings (editor programs
- and password storage, among others). Also note that all the
- options are effectively commented out. You need only to
- remove the hash (<literal>#</literal>) character from the
- beginning of the option names, and set the values as you
- desire.</para>
+ <para>前一个例子里展现了<filename>.reg</filename>文件的内容,保存了一些最常用的配置选项和它们的缺省值,注意包括了系统级(关于网络代理相关的选项)和每用户的设置(编辑器程序和密码保存,还有其它)。也应该注意所有的选项已经有效的注释掉了,你只需要删除选项名称前面的井号(<literal>#</literal>),然后设置你希望的值就可以了。</para>
</sect2>
<!-- ***************************************************************** -->
<sect2 id="svn-ch-7-sect-1.3">
- <title>Configuration Options</title>
+ <title>配置选项</title>
- <para>In this section, we will discuss the specific
- run-time configuration options that are currently supported
- by Subversion.</para>
+ <para>在本小节,我们会详细讨论Subversion目前支持的运行配置选项。</para>
<sect3 id="svn-ch-7-sect-1.3.1">
- <title>Servers</title>
+ <title>服务器</title>
- <para>The <filename>servers</filename> file contains
- Subversion configuration options related to the network
- layers. There are two special section names in this
- file—<literal>groups</literal> and
- <literal>global</literal>. The <literal>groups</literal>
- section is essentially a cross-reference table. The keys in
- this section are the names of other sections in the file;
- their values are <firstterm>globs</firstterm>—textual
- tokens which possibly contain wildcard
- characters—that are compared against the hostnames of
- the machine to which Subversion requests are sent.</para>
+ <para><filename>servers</filename>文件保存了Subversion关于网络层的配置选项,这个文件有两个特别的小节—<literal>groups</literal> 和<literal>global</literal>,<literal>groups</literal>小节是一个交叉引用表,这个小节的关键字是这个文件其它的小节的名称;它们的值是一个组合—文本符号有可能包含通配符字符—对应Subversion请求发送的到的主机名。</para>
<programlisting>
[groups]
@@ -290,339 +149,183 @@
…
</programlisting>
- <para>When Subversion is used over a network, it attempts to
- match the name of the server it is trying to reach with a
- group name under the <literal>groups</literal> section. If
- a match is made, Subversion then looks for a section in the
- <filename>servers</filename> file whose name is the matched
- group's name. From that section it reads the actual network
- configuration settings.</para>
-
- <para>The <literal>global</literal> section contains the
- settings that are meant for all of the servers not matched
- by one of the globs under the <literal>groups</literal>
- section. The options available in this section are
- exactly the same as those valid for the other server
- sections in the file (except, of course, the special
- <literal>groups</literal> section), and are as
- follows:</para>
+ <para>当Subversion是通过网络使用的,它会设法用正在尝试连接的服务器的名字和<literal>groups</literal>小节的组名称匹配,如果发现匹配,Subversion会在<filename>servers</filename>文件的查找匹配这个group名称的小节,在那个小节它会去读取真实的网络配置设置。</para>
+
+ <para><literal>global</literal>小节保存了没有<literal>groups</literal>小节匹配时的设置,这个小节存在的选项与其他服务器一样(当然是除了<literal>groups</literal>小节),是以下这些:</para>
<variablelist>
<varlistentry>
<term><literal>http-proxy-host</literal></term>
<listitem>
- <para>This specifies the hostname of the proxy computer
- through which your HTTP-based Subversion requests must
- pass. It defaults to an empty value, which means that
- Subversion will not attempt to route HTTP requests
- through a proxy computer, and will instead attempt to
- contact the destination machine directly.</para>
+ <para>代理服务器的详细主机名,是HTTP为基础的Subversion请求必须通过的,缺省值是空的,意味着Subversion不会去尝试通过代理服务器进行HTTP请求,而会直接尝试去连接目标机器。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>http-proxy-port</literal></term>
<listitem>
- <para>This specifies the port number on the proxy host
- to use. It defaults to an empty value.</para>
+ <para>代理服务器的详细端口,缺省值是空。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>http-proxy-username</literal></term>
<listitem>
- <para>This specifies the username to supply to the proxy
- machine. It defaults to an empty value.</para>
+ <para>代理服务器的用户名,缺省值是空。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>http-proxy-password</literal></term>
<listitem>
- <para>This specifies the password to supply to the proxy
- machine. It defaults to an empty value.</para>
+ <para>代理服务器使用的密码,缺省是空。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>http-timeout</literal></term>
<listitem>
- <para>This specifies the amount of time, in seconds, to
- wait for a server response. If you experience
- problems with a slow network connection causing
- Subversion operations to timeout, you should increase
- the value of this option. The default value is
- <literal>0</literal>, which instructs the underlying
- HTTP library, Neon, to use its default timeout
- setting.</para>
+ <para>等待服务器响应的时间,以秒为单位,如果你经历到过慢的网络速度,导致Subversion的操作超时,你可以增加这个值,缺省值是<literal>0</literal>会告诉HTTP库Neon使用自己的缺省值。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>http-compression</literal></term>
<listitem>
- <para>This specifies whether or not Subversion should
- attempt to compress network requests made to DAV-ready
- servers. The default value is <literal>yes</literal>
- (though compression will only occur if that capability
- is compiled into the network layer). Set this to
- <literal>no</literal> to disable compression, such as
- when debugging network transmissions.</para>
+ <para>这说明是否在与设置好DAV的服务器通讯时使用网络压缩请求,缺省值是<literal>yes</literal>(尽管只有在这个能力编译到网络层时压缩才会有效),设置<literal>no</literal>来关闭压缩,如调试网络传输时。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>neon-debug-mask</literal></term>
<listitem>
- <para>This is an integer mask that the underlying HTTP
- library, Neon, uses for choosing what type of
- debugging output to yield. The default value is
- <literal>0</literal>, which will silence all debugging
- output. For more information about how Subversion
- makes use of Neon, see <xref linkend="svn-ch-8" />.</para>
+ <para>只是一个整形的掩码,底层的HTTP库Neon用来选择产生调试的输出,缺省值是<literal>0</literal>,关闭所有的调试输出,关于Subversion使用Neon的详细信息,见<xref linkend="svn-ch-8" />。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>ssl-authority-files</literal></term>
<listitem>
- <para>This is a semicolon-delimited list of paths to files
- containing certificates of the certificate authorities
- (or CAs) that
- are accepted by the Subversion client when accessing the
- repository over HTTPS.</para>
+ <para>这是一个分号分割的路径和文件列表,这些文件包含了Subversion客户端在用HTTPS访问时可以接受的认证授权(或者CA)的证书。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>ssl-trust-default-ca</literal></term>
<listitem>
- <para>Set this variable to <literal>yes</literal> if you
- want Subversion to automatically trust the set of
- default CAs that ship with OpenSSL.</para>
+ <para>如果你希望Subversion可以自动相信OpenSSL携带的缺省的CA,可以设置为<literal>yes</literal>。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>ssl-client-cert-file</literal></term>
<listitem>
- <para>If a host (or set of hosts) requires an SSL client
- certificate, you'll normally be prompted for a path to
- your certificate. By setting this variable to that
- same path, Subversion will be able to find your client
- certificate automatically without prompting you.
- There's no standard place to store your certificate on
- disk; Subversion will grab it from any path you
- specify.</para>
+ <para>如果一个主机(或是一些主机)需要一个SSL客户端证书,你会收到一个提示说需要证书的路径。通过设置这个路径你的Subversion客户端可以自动找到你的证书而不会打扰你。没有标准的存放位置;Subversion会从任何你指定得只得到这个文件。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>ssl-client-cert-password</literal></term>
<listitem>
- <para>If your SSL client certificate file is encrypted
- by a passphrase, Subversion will prompt you for the
- passphrase whenever the certificate is used. If you
- find this annoying (and don't mind storing the
- password in the <filename>servers</filename> file),
- then you can set this variable to the certificate's
- passphrase. You won't be prompted anymore.</para>
+ <para>如果你的SSL客户端证书文件是用密码加密的,Subversion会在每次使用证书时请你输入密码,如果你发现这很讨厌(并且不介意把密码存放在<filename>servers</filename>文件),你可以设置这个参数为证书的密码,你不会再收到密码输入提示了。</para>
</listitem>
</varlistentry>
</variablelist>
</sect3>
<sect3 id="svn-ch-7-sect-1.3.2">
- <title>Config</title>
+ <title>config</title>
+
+ <para><filename>config</filename>文件保存了剩下的当前存在的Subversion运行选项,这些与网络连接无关,这些只是一些现在使用的选项,但是为了将来期望的增加也是分组为小节。</para>
- <para>The <filename>config</filename> file contains the rest
- of the currently available Subversion run-time options,
- those not related to networking. There are only a few
- options in use at this time, but they are again grouped into
- sections in expectation of future additions.</para>
-
- <para>The <literal>auth</literal> section contains settings
- related to Subversion's authentication and authorization
- against the repository. It contains:</para>
+ <para><literal>auth</literal>小节保存了Subversion相关的认证和授权的设置,它包括:</para>
<variablelist>
<varlistentry>
<term><literal>store-passwords</literal></term>
<listitem>
- <para>This instructs Subversion to cache, or not to
- cache, passwords that are supplied by the user in
- response to server authentication challenges. The
- default value is <literal>yes</literal>. Set this to
- <literal>no</literal> to disable this on-disk password
- caching. You can override this option for a single
- instance of the <command>svn</command> command using
- the <option>--no-auth-cache</option> command-line
- parameter (for those subcommands that support it).
- For more information, see <xref
- linkend="svn-ch-6-sect-2.2"/>.</para>
+ <para>这告诉Subversion是否缓存服务器认证要求时用户需要提供的密码,缺省值是<literal>yes</literal>。设置为<literal>no</literal>可以关闭在存盘的密码缓存,你可以通过<command>svn</command>的<option>--no-auth-cache</option>命令行参数(那些支持这个的字命令)来覆盖这个设置,,详细信息请见<xref
+ linkend="svn-ch-6-sect-2.2"/>。
+ </para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>store-auth-creds</literal></term>
<listitem>
- <para>This setting is the same as
- <literal>store-passwords</literal>, except that
- enables or disables disk-caching of
- <emphasis>all</emphasis> authentication information:
- usernames, passwords, server certificates, and any
- other types of cacheable credentials.</para>
+ <para>这个设置与<literal>store-passwords</literal>相似,除了是否开启和关闭<emphasis>所有</emphasis>认证信息:用户名、密码、服务器证书和其他任何类型的可以缓存的凭证。</para>
</listitem>
</varlistentry>
</variablelist>
- <para>The <literal>helpers</literal> section controls which
- external applications Subversion uses to accomplish its
- tasks. Valid options in this section are:</para>
+ <para><literal>helpers</literal>小节控制完成Subversion任务的外部程序,正确的选项包括:</para>
<variablelist>
<varlistentry>
<term><literal>editor-cmd</literal></term>
<listitem>
- <para>This specifies the program Subversion will use to
- query the user for a log message during a commit
- operation, such as when using <command>svn
- commit</command> without either the
- <option>--message</option> (<option>-m</option>) or
- <option>--file</option> (<option>-F</option>) options.
- This program is also used with the <command>svn
- propedit</command> command—a temporary file is
- populated with the current value of the property the
- user wishes to edit, and the edits take place right
- in the editor program (see <xref
- linkend="svn-ch-7-sect-2" />). This option's default
- value is empty. If the option is not set, Subversion
- will fall back to checking the environment variables
- <literal>SVN_EDITOR</literal>,
- <literal>VISUAL</literal>, and
- <literal>EDITOR</literal> (in that order) for an
- editor command.</para>
+ <para>Subversion在提交操作时用来询问用户日志信息的程序,例如使用<command>svn
+ commit</command>而没有指定<option>--message</option>(<option>-m</option>)或者<option>--file</option>(<option>-F</option>)选项。这个程序也会与<command>svn
+ propedit</command>一起使用—一个临时文件跳出来包含已经存在的用户希望编辑的属性,这个编辑只发生在编辑器程序(见<xref
+ linkend="svn-ch-7-sect-2" />),这个选项的缺省值是空,如果这个选项没有设置,Subversion会回头检查环境变量<literal>SVN_EDITOR</literal>、<literal>VISUAL</literal>和<literal>EDITOR</literal>(这个顺序)来找到一个编辑器命令。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>diff-cmd</literal></term>
<listitem>
- <para>This specifies the absolute path of a differencing
- program, used when Subversion generates
- <quote>diff</quote> output (such as when using the
- <command>svn diff</command> command). By default
- Subversion uses an internal differencing
- library—setting this option will cause it to
- perform this task using an external program.</para>
+ <para>这个命令是区别程序的绝对路径,当Subversion生成了<quote>diff</quote>输出时(例如当使用<command>svn diff</command>命令)就会使用,缺省Subversion会使用一个内置的区别库—设置这个参数会导致它会使用外部程序执行这个任务。
+ </para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>diff3-cmd</literal></term>
<listitem>
- <para>This specifies the absolute path of a three-way
- differencing program. Subversion uses this program to
- merge changes made by the user with those received
- from the repository. By default Subversion uses an
- internal differencing library—setting this
- option will cause it to perform this task using an
- external program.</para>
+ <para>这指定了一个三向的区别程序,Subversion使用这个程序来合并用户和从版本库接受的修改,缺省Subversion会使用一个内置的区别库—设置这个参数会导致它会使用外部程序执行这个任务。
+ </para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>diff3-has-program-arg</literal></term>
<listitem>
- <para>This flag should be set to <literal>true</literal>
- if the program specified by the
- <literal>diff3-cmd</literal> option accepts a
- <option>--diff-program</option> command-line
- parameter.</para>
+ <para>如果<literal>diff3-cmd</literal>选项设置的程序接受一个<option>--diff-program</option>命令行参数,这个标记必须设置为<literal>true</literal>。</para>
</listitem>
</varlistentry>
</variablelist>
- <para>The <literal>tunnels</literal> section allows you to
- define new tunnel schemes for use with
- <command>svnserve</command> and <literal>svn://</literal>
- client connections. For more details, see <xref
- linkend="svn-ch-6-sect-3.4"/>.</para>
+ <para><literal>tunnels</literal>小节允许你定义一个<command>svnserve</command>和<literal>svn://</literal>客户端连接使用的管道模式,更多细节见<xref
+ linkend="svn-ch-6-sect-3.4"/>。</para>
- <para>The <literal>miscellany</literal> section is where
- everything that doesn't belong elsewhere winds up.
+ <para><literal>miscellany</literal>小节是一些没法归到别处的选项,***
<footnote>
- <para>Anyone for potluck dinner?</para>
+ <para>任何人为了一顿家常便饭?</para>
</footnote>
- In this section, you can find:</para>
+ 在本小节,你会找到:</para>
<variablelist>
<varlistentry>
<term><literal>global-ignores</literal></term>
<listitem>
- <para>When running the <command>svn status</command>
- command, Subversion lists unversioned files and
- directories along with the versioned ones, annotating
- them with a <literal>?</literal> character (see <xref
- linkend="svn-ch-3-sect-5.3.1" />). Sometimes, it can
- be annoying to see uninteresting, unversioned
- items—for example, object files that result from
- a program's compilation—in this display. The
- <literal>global-ignores</literal> option is a list of
- whitespace-delimited globs which describe the names of
- files and directories that Subversion should not
- display unless they are versioned. The default value
- is <literal>*.o *.lo *.la #*# .*.rej *.rej .*~ *~
- .#* .DS_Store</literal>.</para>
-
- <para>As well as <command>svn status</command>, the
- <command>svn add</command> and <command>svn import</command>
- commands also ignore files that match the list.
- You can override this option for a single instance
- of any of these commands by using
- the <option>--no-ignore</option> command-line flag.
- For information on more fine-grained control of
- ignored items, see <xref linkend="svn-ch-7-sect-2.3.3"
- />.</para>
+ <para>当运行<command>svn status</command>命令时,Subversion会和版本化的文件一样列出未版本化的文件和目录,使用<literal>?</literal>字符(见see <xref
+ linkend="svn-ch-3-sect-5.3.1" />)标记,有时候察看不关心的为版本化的文件会很讨厌—举个例子,程序编译产生的对象文件—会显示。<literal>global-ignores</literal>选项是一个空格分隔的列表,用来描述Subversion在它们版本化之前不想现实的文件和目录,缺省值是<literal>*.o *.lo *.la #*# .*.rej *.rej .*~ *~
+ .#* .DS_Store</literal>。</para>
+
+ <para>就像<command>svn status</command>,<command>svn add</command>和<command>svn import</command>命令也会忽略匹配这个列表的文件,你可以用单个的<option>--no-ignore</option>命令行参数来覆盖这个选项,关于更加细致的控制忽略的项目,见<xref linkend="svn-ch-7-sect-2.3.3"
+ />。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>enable-auto-props</literal></term>
<listitem>
- <para>This instructs Subversion to automatically set
- properties on newly added or imported files. The
- default value is <literal>no</literal>, so set this to
- <literal>yes</literal> to enable Auto-props.
- The <literal>auto-props</literal> section of this file
- specifies which properties are to be set on which files.</para>
+ <para>这里指示Subversion自动对新加的或者导入的文件设置属性,缺省值是<literal>no</literal>,所以设置为<literal>yes</literal>来开启自动添加属性,这个文件的<literal>auto-props</literal>小节会说明那些属性设置到那些文件。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>log-encoding</literal></term>
<listitem>
- <para>This variable sets the default character set
- encoding for commit log messages. It's a permanent
- form of the <option>--encoding</option> option (see
- <xref linkend="svn-ch-9-sect-1.1"/>.) The Subversion
- repository stores log messages in UTF8, and assumes
- that your log message is written using your operating
- system's native locale. You should specify a
- different encoding if your commit messages are written
- in any other encoding.</para>
+ <para>这个变量设置提交日志缺省的字符集,是<option>--encoding</option>选项(见<xref linkend="svn-ch-9-sect-1.1"/>)的永久形式,Subversion版本库保存了一些UTF8的日志信息,并且假定你的日志信息是用操作系统的本地编码,如果你提交的信息使用别的编码方式,你一定要指定不同的编码。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>use-commit-times</literal></term>
<listitem>
- <para>Normally your working copy files have timestamps
- that reflect the last time they were touched by any
- process, whether that be your own editor or by some
- <command>svn</command> subcommand. This is generally
- convenient for people developing software, because
- build systems often look at timestamps as a way of
- deciding which files need to be recompiled.</para>
-
- <para>In other situations, however, it's sometimes nice
- for the working copy files to have timestamps that
- reflect the last time they were changed in the
- repository. The <command>svn export</command> command
- always places these <quote>last-commit
- timestamps</quote> on trees that it produces. By
- setting this config variable to
- <literal>yes</literal>, the <command>svn
- checkout</command>, <command>svn update</command>,
- <command>svn switch</command>, and <command>svn
- revert</command> commands will also set last-commit
- timestamps on files that they touch.</para>
+ <para>通常你的工作拷贝文件会有最后一次被进程访问的时间戳,不管是你自己的编辑器还是用<command>svn</command>子命令。这通常是对人们开发软件很方便,因为编译系统通常会通过察看时间戳来决定那些文件需要重新编译。</para>
+
+ <para>在其他情形,有时候如果工作拷贝的文件德时间戳反映了上一次在版本库中更改的时间会非常好,<command>svn export</command>命令会一直放置这些<quote>上次提交的时间戳</quote>放到它创建的目录树。通过设置config参数为<literal>yes</literal>,<command>svn
+ checkout</command>、<command>svn update</command>、
+ <command>svn switch</command>和<command>svn
+ revert</command>命令也会为他们接触的文件设置上次提交的时间戳。</para>
</listitem>
</varlistentry>
@@ -630,24 +333,7 @@
registry file, e.g., template-root -->
</variablelist>
- <para>The <literal>auto-props</literal> section controls
- the Subversion client's ability to automatically set
- properties on files when they are added or imported.
- It contains any number of key-value pairs in the
- format <literal>PATTERN = PROPNAME=PROPVALUE</literal>
- where <literal>PATTERN</literal> is a file pattern
- that matches a set of filenames and the rest of the
- line is the property and its value. Multiple matches
- on a file will result in multiple propsets for that
- file; however, there is no guarantee that auto-props
- will be applied in the order in which they are listed
- in the config file, so you can't have one rule
- <quote>override</quote> another. You can find several
- examples of auto-props usage in the
- <filename>config</filename> file. Lastly, don't
- forget to set <literal>enable-auto-props</literal> to
- <literal>yes</literal> in the <literal>miscellany</literal>
- section if you want to enable auto-props.</para>
+ <para><literal>auto-props</literal>小节控制Subversion客户端自动设置提交和导入的文件的属性的能力,它包含了任何数量的键-值对,格式是<literal>PATTERN = PROPNAME=PROPVALUE</literal>,其中<literal>PATTERN</literal>十一个文件模式,匹配一系列文件名,此行剩下的属性和值。如果一个文件匹配多次,会导致有多个属性集;然而,没有手段保障自动属性不会按照配置文件中的顺序应用,所以你可以一个规则<quote>覆盖</quote>另一个。你可以在<filename>config</filename>文件找到许多自动属性的用法实例。最后,如果你希望开启自动属性,不要忘了设置<literal>miscellany</literal>小节的<literal>enable-auto-props</literal>为<literal>yes</literal>。</para>
</sect3>
@@ -658,116 +344,41 @@
<!-- *** SECTION 2: PROPERTIES *** -->
<!-- ******************************************************************* -->
<sect1 id="svn-ch-7-sect-2">
- <title>Properties</title>
+ <title>属性</title>
- <para>We've already covered in detail how Subversion stores and
- retrieves various versions of files and directories in its
- repository. Whole chapters have been devoted to this most
- fundamental piece of functionality provided by the tool. And
- if the versioning support stopped there, Subversion would still
- be complete from a version control perspective. But it
- doesn't stop there.</para>
-
- <para>In addition to versioning your directories and files,
- Subversion provides interfaces for adding, modifying, and
- removing versioned metadata on each of your versioned
- directories and files. We refer to this metadata as
- <firstterm>properties</firstterm>, and they can be thought of as
- two-column tables that map property names to arbitrary values
- attached to each item in your working copy. Generally speaking,
- the names and values of the properties can be whatever you want
- them to be, with the constraint that the names must be
- human-readable text. And the best part about these properties
- is that they, too, are versioned, just like the textual contents
- of your files. You can modify, commit, and revert property
- changes as easily as committing textual changes. And you
- receive other people's property changes as you update your
- working copy.</para>
+ <para>我们已经覆盖了Subversion存储和检索版本库中不同版本的文件和目录的细节,整个章节来论述这个工具的基本功能,如果版本支持到此为止,Subversion还只是一个普通的版本控制观点,但是还没有结束。</para>
+
+ <para>作为目录和文件版本化的补充,Subversion提供了对每一个版本化的目录和文件添加、修改和删除版本化的元数据的接口,我们用<firstterm>properties</firstterm>来表示这些元数据,我们可以认为他们是一个两列的表,附加到你的工作拷贝每个条目上,影射属性名到任意的值。一般来说,属性的名称和值可以是你希望的任何值,限制就是名称必须是可读的文本,并且最好的一点是这些属性也是版本化的,就像你的文本内容文件,你可以像提交文本修改一样修改、提交和恢复属性修改,当你的更新时也会接收到别人的属性修改。</para>
<sidebar>
- <title>Other Properties in Subversion</title>
+ <title>Subversion的其他属性</title>
- <para>Properties show up elsewhere in Subversion, too. Just as
- files and directories may have arbitrary property names and
- values attached to them, each revision as a whole may have
- arbitrary properties attached to it. The same constraints
- apply—human-readable, text names and anything-you-want,
- binary values—except that revision properties are not
- versioned. See <xref linkend="svn-ch-5-sect-1.2" /> for more
- information on these unversioned properties.</para>
+ <para>Subversion也会在别的地方露面,就像文件和目录可能附加有任意的属性名和值,每个修订版本作为一个整体也可以附加任意的属性,也有同样的限制—可读的文本名称和任何你希望的,***二进制值—除了修订版本不是版本化的,见<xref linkend="svn-ch-5-sect-1.2" />来察看为版本化的属性信息。</para>
</sidebar>
- <para>In this section, we will examine the utility—both to
- users of Subversion, and to Subversion itself—of property
- support. You'll learn about the property-related
- <command>svn</command> subcommands, and how property
- modifications affect your normal Subversion workflow.
- Hopefully, you'll be convinced that Subversion properties can
- enhance your version control experience.</para>
+ <para>在本小节,我们将会检验这个工具—不仅是对Subversion的用户,也对Subversion本身—关于属性支持。你会学好属性相关的<command>svn</command>子命令,和属性怎样影响你的普通Subversion工作流,很期待你会确信Subversion的属性可以提高你的版本控制体验。</para>
<!-- ***************************************************************** -->
<sect2 id="svn-ch-7-sect-2.1">
- <title>Why Properties?</title>
+ <title>为什么是属性?</title>
+
+ <para>属性会是你的工作拷贝有用的补充,实际上,Subversion本身使用属性来存放特殊的信息,作为帮助特别操作的一种方法,同样,你可以使用属性来实现自己的目的,当然,你对属性作的任何事情也可以针对普通的版本化文件,但是先考虑下面Subversion使用属性的例子。</para>
+
+ <para>假定你希望设计一个网站存放许多数码图片,并且显示他们的标题和时间戳,现在你的图片集经常修改,所以你希望你的网站能够尽量的自动化,这些图片可能非常大,所以根据这个网站的特性,你希望在网站给用户提供图标图像。你可以用传统的文件做这件事,你可以有一个<filename>image123.jpg</filename>和一个<filename>image123-thumbnail.jpg</filename>对应在同一个目录,有时候你希望保持文件名相同,你可以使用不同的目录,如<filename>thumbnails/image123.jpg</filename>。你可以用一种相似的样式来保存你的标题和时间戳,再一次同原始图像文件分开。很快你的目录树会是一团糟,每个新图片的添加都会成倍的增加混乱。</para>
+
+ <para>现在考虑使用Subversion文件的属性来做相同的设置,想象我们有一个单独的图像文件<filename>image123.jpg</filename>,然后这个文件的属性集包括<literal>caption</literal>、<literal>datestamp</literal>甚至<literal>thumbnail</literal>。现在你的工作拷贝目录看起来更佳的可管理—实际上,它看起来只有图像文件,但是你的自动化脚本知道得更多,它们知道可以用<command>svn</command>(更好的选择是使用Subversion的语言绑定—见<xref
+ linkend="svn-ch-8-sect-2.3" />)来挖掘更多的站点显示需要的额外信息,而不必去阅读一个索引文件或者是玩一个路径处理的游戏。</para>
- <para>Properties can be very useful additions to your working
- copy. In fact, Subversion itself uses properties to house
- special information, and as a way to denote that certain
- special processing might be needed. Likewise, you can use
- properties for your own purposes. Of course, anything you can
- do with properties you could also do using regular versioned
- files, but consider the following example of Subversion
- property use.</para>
-
- <para>Say you wish to design a website that houses many digital
- photos, and displays them with captions and a datestamp. Now,
- your set of photos is constantly changing, so you'd like to
- have as much of this site automated as possible. These photos
- can be quite large, so as is common with sites of this nature,
- you want to provide smaller thumbnail images to your site
- visitors. You can do this with traditional files. That is,
- you can have your <filename>image123.jpg</filename> and an
- <filename>image123-thumbnail.jpg</filename> side-by-side in a
- directory. Or if you want to keep the filenames the same, you
- might have your thumbnails in a different directory, like
- <filename>thumbnails/image123.jpg</filename>. You can also
- store your captions and datestamps in a similar fashion, again
- separated from the original image file. Soon, your tree of
- files is a mess, and grows in multiples with each new photo
- added to the site.</para>
-
- <para>Now consider the same setup using Subversion's file
- properties. Imagine having a single image file,
- <filename>image123.jpg</filename>, and then properties set on
- that file named <literal>caption</literal>,
- <literal>datestamp</literal>, and even
- <literal>thumbnail</literal>. Now your working copy directory
- looks much more manageable—in fact, it looks like there
- are nothing but image files in it. But your automation
- scripts know better. They know that they can use
- <command>svn</command> (or better yet, they can use the
- Subversion language bindings—see <xref
- linkend="svn-ch-8-sect-2.3" />) to dig out the extra
- information that your site needs to display without having to
- read an index file or play path manipulation games.</para>
-
- <para>How (and if) you use Subversion properties is up to you.
- As we mentioned, Subversion has it own uses for properties,
- which we'll discuss a little later in this chapter. But
- first, let's discuss how to manipulate options using the
- <command>svn</command> program.</para>
+ <para>你怎样(而且如果)使用Subversion完全在你,像我们提到的,Subversion拥有它自己的属性集,我们会在后面的章节讨论,但首先,让我们讨论怎样使用<command>svn</command>的处理选项。</para>
</sect2>
<!-- ***************************************************************** -->
<sect2 id="svn-ch-7-sect-2.2">
- <title>Manipulating Properties</title>
+ <title>处理属性</title>
- <para>The <command>svn</command> command affords a few ways to
- add or modify file and directory properties. For properties
- with short, human-readable values, perhaps the simplest way to
- add a new property is to specify the property name and value
- on the command-line of the <command>propset</command>
- subcommand.</para>
+ <para><command>svn</command>命令提供一些方法来添加和修改文件或目录的属性,对于短的,可读的属性,最简单的添加方法是在<command>propset</command>子命令里指定正确的名称和值。
+ </para>
<screen>
$ svn propset copyright '(c) 2003 Red-Bean Software' calc/button.c
@@ -775,14 +386,7 @@
$
</screen>
- <para>But we've been touting the flexibility that Subversion
- offers for your property values. And if you are planning to
- have a multi-line textual, or even binary, property value, you
- probably do not want to supply that value on the command-line.
- So the <command>propset</command> subcommand takes a
- <option>--file</option> (<option>-F</option>) option for
- specifying the name of
- a file which contains the new property value.</para>
+ <para>但是我们已经吹捧过Subversion提供过的属性值得灵活性,如果你计划有一个多行的可读文本,甚至是二进制文件的属性值,你通常不会希望在命令行里指定,所以<command>propset</command>子命令使用<option>--file</option>(<option>-F</option>)选项来指定一个保存新的属性值的文件的名字。</para>
<screen>
$ svn propset license -F /path/to/LICENSE calc/button.c
@@ -790,22 +394,8 @@
$
</screen>
- <para>In addition to the <command>propset</command> command, the
- <command>svn</command> program supplies the
- <command>propedit</command> command. This command uses the
- configured editor program (see <xref
- linkend="svn-ch-7-sect-1.3.2" />) to add or modify properties.
- When you run the command, <command>svn</command> invokes your
- editor program on a temporary file that contains the current
- value of the property (or which is empty, if you are adding a
- new property). Then, you just modify that value in your
- editor program until it represents the new value you wish to
- store for the property, save the temporary file, and then exit
- the editor program. If Subversion detects that you've
- actually changed the existing value of the property, it will
- accept that as the new property value. If you exit your
- editor without making any changes, no property modification
- will occur.</para>
+ <para>作为<command>propset</command>命令的补充,<command>svn</command>提供了一个<command>propedit</command>命令,这个命令使用配制的编辑器程序(见<xref
+ linkend="svn-ch-7-sect-1.3.2" />)来添加和修改属性。当你运行这个命令,<command>svn</command>调用你的编辑器程序到一个临时文件,保存了当前的属性值(或者是空的,如果你添加了一个新的属性)。然后你只需要修改那些值,改为你需要的值,保存你的临时文件,然后离开编辑器程序,如果Subversion发现你已经修改了属性存在的值,就会接受新的值,如果你未作任何修改离开,没有属性修改会发生。</para>
<screen>
$ svn propedit copyright calc/button.c ### exit the editor without changes
@@ -813,11 +403,7 @@
$
</screen>
- <para>We should note that, as with other <command>svn</command>
- subcommands, those related to properties can act on multiple
- paths at once. This enables you to modify properties on whole
- sets of files with a single command. For example, we could
- have done:</para>
+ <para>我们必须注意,就像其他<command>svn</command>子命令,,这些关联的属性可以一次加到多个路径上,这让你可以通过一个命令修改一组文件的属性,举个例子,我们可以这样做:</para>
<screen>
$ svn propset copyright '(c) 2002 Red-Bean Software' calc/*
@@ -828,17 +414,8 @@
$
</screen>
- <para>All of this property adding and editing isn't really very
- useful if you can't easily get the stored property value. So
- the <command>svn</command> program supplies two subcommands
- for displaying the names and values of properties stored on
- files and directories. The <command>svn proplist</command>
- command will list the names of properties that exist on a
- path. Once you know the names of the properties on the node,
- you can request their values individually using <command>svn
- propget</command>. This command will, given a path (or set of
- paths) and a property name, print the value of the property to
- the standard output stream.</para>
+ <para>如果你不容易得到存储的属性值,所有的属性的添加和编辑不会很容易,所以<command>svn</command>提供了两个子命令来显示文件和目录存储的属性名和值,<command>svn proplist</command>命令会列出路径上存在的所有属性名称,一旦你知道了某个节点的属性名称,你可以用<command>svn
+ propget</command>要求他们的值,这个命令通过给定的路径(或者是一组路径)和属性名称,打印这个属性值到标准输出。</para>
<screen>
$ svn proplist calc/button.c
@@ -849,10 +426,7 @@
(c) 2003 Red-Bean Software
</screen>
- <para>There's even a variation of the
- <command>proplist</command> command that will list both the
- name and value of all of the properties. Simply supply the
- <option>--verbose</option> (<option>-v</option>) option.</para>
+ <para>也有一个<command>proplist</command>变种命令会列出所有属性的名称和值,只需要提供<option>--verbose</option>(<option>-v</option>)选项。</para>
<screen>
$ svn proplist --verbose calc/button.c
@@ -871,12 +445,7 @@
…
</screen>
- <para>The last property-related subcommand is
- <command>propdel</command>. Since Subversion allows you to
- store properties with empty values, you can't remove a
- property altogether using <command>propedit</command> or
- <command>propset</command>. For example, this command will
- <emphasis>not</emphasis> yield the desired effect:</para>
+ <para>最后一个属性相关的子命令是<command>propdel</command>,因为Subversion允许你来存储属性为空值,你不能所以你不能用<command>propedit</command>或者<command>propset</command>删除一个属性,举个例子,这个命令<emphasis>不会</emphasis>产生期望的效果:</para>
<screen>
$ svn propset license '' calc/button.c
@@ -888,9 +457,8 @@
$
</screen>
- <para>You need to use the <command>propdel</command> command to
- delete properties altogether. The syntax is similar to the
- other property commands:</para>
+ <para>你需要使用<command>propdel</command>来删除属性,语法与其他属性命令相似:
+ </para>
<screen>
$ svn propdel license calc/button.c
@@ -901,32 +469,15 @@
$
</screen>
- <para>Now that you are familiar with all of the
- property-related <command>svn</command> subcommands, let's see
- how property modifications affect the usual Subversion
- workflow. As we mentioned earlier, file and directory
- properties are versioned, just like your file contents. As a
- result, Subversion provides the same opportunities for
- merging—in cleanly or conflicting fashions—someone
- else's modifications into your own.</para>
+ <para>现在你已经熟悉了所有属性相关的<command>svn</command>子命令,让我们看看属性修改如何影响Subversion的工作流,我们前面提到过,文件和目录的属性是版本化的,就像你的文件内容。作为结果,Subversion提供了同样的机会来合并—用干净或者冲突的方式—其他人的修改进入到你的修改。</para>
<sidebar>
- <title>Modifying Revision Properties</title>
+ <title>修改修订版本的属性</title>
- <para>Remember those unversioned revision properties? You can
- modify those, too, with the <command>svn</command> program.
- Simply add the <option>--revprop</option> command-line
- parameter, and specify the revision whose property you wish
- to modify. Since revisions are global, you don't need to
- specify a path in this case as long as you are positioned in
- the working copy of the repository whose revision property
- you wish to modify. For example, you might want to replace
- the commit log message of an existing revision.
+ <para>记住这些未版本化的属性?你也可以修改这些,使用<command>svn</command>命令。只需要添加<option>--revprop</option>命令参数,并且说明希望修改的修订版本。因为修订版本是全局的,你不需要指定一个路径,只要你已经位于你希望修改属性的工作拷贝路径,举个例子,你希望修改一个存在版本的提交日志信息。
<footnote>
- <para>Fixing spelling errors, grammatical gotchas, and
- <quote>just-plain-wrongness</quote> in commit log
- messages is perhaps the most common use case for the
- <option>--revprop</option> option.</para>
+ <para>修正提交日志信息的拼写错误,文法错误和<quote>简单的错误</quote>是<option>--revprop</option>选项最常见用例。
+ </para>
</footnote></para>
<screen>
@@ -935,27 +486,12 @@
$
</screen>
- <para>Note that the ability to modify these unversioned
- properties must be explicitly added by the repository
- administrator (see <xref linkend="svn-ch-5-sect-2.1" />).
- Since the properties aren't versioned, you run the risk of
- losing information if you aren't careful with your edits.
- The repository administrator can setup methods to protect
- against this loss, and by default, modification of
- unversioned properties is disabled.</para>
+ <para>注意,修改这些未版本化的属性的能力一定要明确的添加给版本库管理员(见xref linkend="svn-ch-5-sect-2.1" />)。因为属性没有版本化,你如果不小心编辑,你会冒丢失信息的风险,版本库管理员可以设置方法来保护这种丢失,缺省情况下,修改未版本化的属性是禁止的。</para>
</sidebar>
- <para>And as with file contents, your property changes are local
- modifications, only made permanent when you commit them to the
- repository with <command>svn commit</command>. Your property
- changes can be easily unmade, too—the <command>svn
- revert</command> command will restore your files and
- directories to their un-edited states, contents, properties,
- and all. Also, you can receive interesting information about
- the state of your file and directory properties by using the
- <command>svn status</command> and <command>svn diff</command>
- commands.</para>
+ <para>就像文件内容,你的属性修改是本地修改,只有提交<command>svn commit</command>后才会成为持久性存储,你的属性修改也可以容易的取消—<command>svn
+ revert</command>命令会恢复你的文件和目录为未编辑状态,内容,属性和其他。另外,你可以使用<command>svn status</command>和<command>svn diff</command>接受感兴趣的文件和目录属性的状态信息。</para>
<screen>
$ svn status calc/button.c
@@ -969,23 +505,14 @@
$
</screen>
- <para>Notice how the <command>status</command> subcommand
- displays <literal>M</literal> in the second column instead of
- the first. That is because we have modified the properties on
- <filename>calc/button.c</filename>, but not modified its
- textual contents. Had we changed both, we would have seen
- <literal>M</literal> in the first column, too (see <xref
- linkend="svn-ch-3-sect-5.3.1" />).</para>
+ <para>注意<command>status</command>子命令显示的<literal>M</literal>在第二列而不是在第一列,这是因为我们修改了<filename>calc/button.c</filename>的属性,而不是它的文本内容,如果我们都修改了,我们也会看到<literal>M</literal>出现在第一列(见<xref
+ linkend="svn-ch-3-sect-5.3.1" />)。
+ </para>
<sidebar>
- <title>Property Conflicts</title>
+ <title>属性冲突</title>
- <para>As with file contents, local property modifications can
- conflict with changes committed by someone else. If you
- update your working copy directory and receive property
- changes on a versioned resource that clash with your own,
- Subversion will report that the resource is in a conflicted
- state.</para>
+ <para>与文件内容一样,本地的属性修改也会同别人的提交冲突,如果你更新你的工作拷贝目录并且接收到有资源属性修改与你的修改冲突,Subversion会报告资源处于冲突状态。</para>
<screen>
% svn update calc
@@ -995,15 +522,8 @@
$
</screen>
- <para>Subversion will also create, in the same directory as
- the conflicted resource, a file with a
- <filename>.prej</filename> extension which contains the
- details of the conflict. You should examine the contents of
- this file so you can decide how to resolve the conflict.
- Until the conflict is resolved, you will see a
- <literal>C</literal> in the second column of <command>svn
- status</command> output for that resource, and attempts to
- commit your local modifications will fail.</para>
+ <para>Subversion也会在冲突资源的同一个目录创建一个<filename>.prej</filename>扩展名的文件,保存了冲突细节。你一定要检验这个文件的内容来决定如何解决冲突,在你解决冲突之前,你会在使用<command>svn
+ status</command>时看到这个资源的输出的第二列是一个<literal>C</literal>,提交本地修改的尝试会失败。</para>
<screen>
$ svn status calc
@@ -1014,192 +534,77 @@
$
</screen>
- <para>To resolve property conflicts, simply ensure that the
- conflicting properties contain the values that they should,
- and then use the <command>svn resolved</command> command to
- alert Subversion that you have manually resolved the
- problem.</para>
+ <para>为了解决属性冲突,只需要确定冲突的属性保存了他们应该的值,然后使用<command>svn resolved</command>命令告诉Subversion你已经手工解决了问题。</para>
</sidebar>
- <para>You might also have noticed the non-standard way that
- Subversion currently displays property differences. You can
- still run <command>svn diff</command> and redirect the output
- to create a usable patch file. The <command>patch</command>
- program will ignore property patches—as a rule, it
- ignores any noise it can't understand. This does
- unfortunately mean that to fully apply a patch generated by
- <command>svn diff</command>, any property modifications will
- need to be applied by hand.</para>
-
- <para>As you can see, the presence of property modifications has
- no outstanding effect on the typical Subversion workflow.
- Your general patterns of updating your working copy, checking
- the status of your files and directories, reporting on the
- modifications you have made, and committing those
- modifications to the repository are completely immune to the
- presence or absence of properties. The <command>svn</command>
- program has some additional subcommands for actually making
- property changes, but that is the only noticeable asymmetry.</para>
+ <para>你也许已经注意到了Subversion现在显示属性区别的非标准方式。你还可以运行<command>svn diff</command>并且重定向输出来产生一个有用的补丁文件,<command>patch</command>程序会忽略属性补丁—作为规则,它会忽略任何不理解的噪音。很遗憾,这意味着完全应用<command>svn diff</command>产生的补丁时,任何属性修改必须手工应用。
+ </para>
+
+ <para>就象你看到的,属性修改的出现并没有对典型的Subversion工作流有显著的影响,你通常模式的更新工作拷贝,检查文件和目录的状态,报告你所做的修改和提交修改到版本库完全与属性的存在与否无关。<command>svn</command>程序有一些额外的子命令用来进行属性修改,但是那是唯一显而易见的不对称。
+ </para>
</sect2>
<!-- ***************************************************************** -->
<sect2 id="svn-ch-7-sect-2.3">
- <title>Special Properties</title>
+ <title>特别属性</title>
- <para>Subversion has no particular policy regarding
- properties—you can use them for any purpose. Subversion
- asks only that you not use property names that begin with the
- prefix <literal>svn:</literal>. That's the namespace that it
- sets aside for its own use. In fact, Subversion defines
- certain properties that have magical effects on the files and
- directories to which they are attached. In this section,
- we'll untangle the mystery, and describe how these special
- properties make your life just a little easier.</para>
+ <para>Subversion没有关于属性的特殊政策—你可以通过它们实现自己的目的。Subversion只是要求你不要使用<literal>svn:</literal>开头的命名空间作为属性名,这是Subversion自己使用的命名空间。实际上,Subversion定义对这些属性他们所附加的文件和目录有特殊的效果。在本小节,我们会解开这个谜团,并且描述这些属性怎样让你的生活更加容易。</para>
<sect3 id="svn-ch-7-sect-2.3.1">
<title><literal>svn:executable</literal></title>
- <para>The <literal>svn:executable</literal> property is used
- to control a versioned file's filesystem-level execute
- permission bit in a semi-automated way. This property has
- no defined values—its mere presence indicates a desire
- that the execute permission bit be kept enabled by Subversion.
- Removing this property will restore full control of the
- execute bit back to the operating system.</para>
-
- <para>On many operating systems, the ability to execute a file
- as a command is governed by the presence of an execute
- permission bit. This bit usually defaults to being
- disabled, and must be explicitly enabled by the user for
- each file that needs it. In a working copy, new files are
- being created all the time as new versions of existing files
- are received during an update. This means that you might
- enable the execute bit on a file, then update your working
- copy, and if that file was changed as part of the update,
- its execute bit might get disabled. So, Subversion provides
- the <literal>svn:executable</literal> property as a way to
- keep the execute bit enabled.</para>
-
- <para>This property has no effect on filesystems that have no
- concept of an executable permission bit, such as FAT32 and
- NTFS.
+ <para><literal>svn:executable</literal>属性用来控制一个版本化的文件自动执行文件权限设定,这个属性没有特定的值—它只是说明一个Subversion可以保留的文件权限的期望值,删除这个属性会恢复操作系统对这些权限的完全控制。</para>
+
+ <para>在多数操作系统,执行一个文件或命令的能力是由执行位管理的,这些位通常是关闭的,必须由用户显示的指定,这意味着你必须改变文件的执行位,然后更新你的工作拷贝,燃火如果你的文件成为更新的一部分,它的执行位会被关闭,所以Subversion提供了<literal>svn:executable</literal>这个属性来保持打开执行位。</para>
+
+ <para>这个属性对于没有可执行权限位的文件系统无效,如FAT32和NTFS。
<footnote>
- <para>The Windows filesystems use file extensions (such as
- <literal>.EXE</literal>, <literal>.BAT</literal>, and
- <literal>.COM</literal>) to denote executable
- files.</para>
+ <para>Windows文件系统使用文件扩展名(如<literal>.EXE</literal>、<literal>.BAT</literal>和<literal>.COM</literal>)来标示可执行文件。
+ </para>
</footnote>
- Also, although it has no defined values, Subversion will force
- its value to <literal>*</literal> when setting this property.
- Finally, this property is valid only on files, not on
- directories.</para>
+ 也就是说,尽管它没有定义的值,在设置这个属性时,Subversion会强制它的值为<literal>*</literal>,最终,这个属性只对文件有效,目录无效。
+ </para>
</sect3>
<sect3 id="svn-ch-7-sect-2.3.2">
<title><literal>svn:mime-type</literal></title>
- <para>The <literal>svn:mime-type</literal> property serves
- many purposes in Subversion. Besides being a
- general-purpose storage location for a file's Multipurpose
- Internet Mail Extensions (MIME) classification, the value of
- this property determines some behavioral characteristics
- of Subversion itself.</para>
-
- <para>For example, if a file's
- <literal>svn:mime-type</literal> property is set to a
- non-text MIME type (generally, something that doesn't begin
- with <literal>text/</literal>, though there are exceptions),
- Subversion will assume that the file contains
- binary—that is, not human-readable—data. One of
- the benefits that Subversion typically provides is
- contextual, line-based merging of changes received from the
- server during an update into your working file. But for
- files believed to contain binary data, there is no concept
- of a <quote>line</quote>. So, for those files, Subversion
- does not attempt to perform contextual merges during
- updates. Instead, any time you have locally modified a
- binary working copy file that is also being updated, your
- file is renamed with a <filename>.orig</filename> extension,
- and then Subversion stores a new working copy file that
- contains the changes received during the update, but not
- your own local modifications, at the original filename.
- This behavior is really for the protection of the user
- against failed attempts at performing contextual merges on
- files that simply cannot be contextually merged.</para>
-
- <para>Also, if the <literal>svn:mime-type</literal>
- property is set, then the Subversion Apache module will use
- its value to populate the <literal>Content-type:</literal>
- HTTP header when responding to GET requests. This gives a
- crucial clue about how to display a file when perusing
- your repository with a web browser.</para>
+ <para><literal>svn:mime-type</literal>属性为Subversion的许多目的服务,除了保存一个文件的多用途网际邮件扩展(MIME)分类以外,这个属性值也描述了一些Subversion自己使用的行为特性。
+ </para>
+
+ <para>举个例子,如果一个文件<literal>svn:mime-type</literal>属性设置为非文本的MIME类型(通常是那些不是<literal>text/</literal>开头的类型,但也有例外),Subversion会假定这个文件保存了二进制内容—也就是不可读的—数据。一个好处就是Subversion通常在更新到工作拷贝时提供了一个前后相关的以行为基础的修改合并,但是对于保存二进制数据的文件,没有<quote>行</quote>的概念,所以对这些文件,Subversion不会在更新时尝试执行合并操作,相反,任何时候你在本地修改的一个二进制文件有了更新,你的文件会被重命名为<filename>.orig</filename>为扩展名,然后Subversion保存一个新的工作拷贝文件,保存更新时得到的修改,但原来的文件名已经不是你自己的本地修改。这个行为模式是用来保护用户在对不可文本合并的文件尝试执行文本的合并时失败的情形。</para>
+
+ <para>另外,如果<literal>svn:mime-type</literal>属性被设置,Subversion的Apache模块会使用这个值来在HTTP头里输入<literal>Content-type:</literal>,这给了web浏览器如何显示一个文件提供了至关重要的线索。
+ </para>
</sect3>
<sect3 id="svn-ch-7-sect-2.3.3">
<title><literal>svn:ignore</literal></title>
- <para>The <literal>svn:ignore</literal> property contains a
- list of file patterns which certain Subversion operations
- will ignore. Perhaps the most commonly used special
- property, it works in conjunction with the
- <literal>global-ignores</literal> run-time configuration
- option (see <xref linkend="svn-ch-7-sect-1.3.2" />) to
- filter unversioned files and directories out of commands
- <command>svn status</command>, <command>svn
- add</command>, and <command>svn import</command>.</para>
-
- <para>The rationale behind the <literal>svn:ignore</literal>
- property is easily explained. Subversion does not assume
- that every file or subdirectory in a working copy directory
- is intended for version control. Resources must be
- explicitly placed under Subversion's management using the
- <command>svn add</command> or <command>svn import</command>
- commands. As a result, there are often many resources in a
- working copy that are not versioned.</para>
-
- <para>Now, the <command>svn status</command> command displays
- as part of its output every unversioned file or subdirectory
- in a working copy that is not already filtered out by the
- <literal>global-ignores</literal> option (or its built-in
- default value). This is done so that users can see if
- perhaps they've forgotten to add a resource to version
- control.</para>
-
- <para>But Subversion cannot possibly guess the names of
- every resource that should be ignored. Also, quite often
- there are things that should be ignored in
- <emphasis>every</emphasis> working copy of a particular
- repository. To force every user of that repository to add
- patterns for those resources to their run-time configuration
- areas would be not just a burden, but has the potential to
- clash with the configuration needs of other working copies
- that the user has checked out.</para>
-
- <para>The solution is to store ignore patterns that are unique
- to the resources likely to appear in a given directory with
- the directory itself. Common examples of unversioned
- resources that are basically unique to a directory, yet
- likely to appear there, include output from program
- compilations. Or—to use an example more appropriate
- to this book—the HTML, PDF, or PostScript files
- generated as the result of a conversion of some source
- DocBook XML files to a more legible output format.</para>
+ <para>这个<literal>svn:ignore</literal>属性保存了一个Subversion特定操作忽略的文件模式列表,或许这个是最常用的属性,它可以与<literal>global-ignores</literal>运行配置选项配合使用(见<xref linkend="svn-ch-7-sect-1.3.2" />)来过滤<command>svn status</command>、<command>svn
+ add</command>和<command>svn import</command>命令中操作的未版本化文件。
+ </para>
+
+ <para><literal>svn:ignore</literal>背后的基本原理很容易解释,Subversion不会假定工作拷贝中的所有文件或子目录是版本控制的一部分,资源必须被显示的使用<command>svn add</command>或者<command>svn import</command>放到Subversion的管理控制之下,作为结果,经常有许多工作拷贝的资源并没有版本化。
+ </para>
+
+ <para>现在,<command>svn status</command>命令会的显示会包括所有未纳入版本控制且没有用<literal>global-ignores</literal>(或是内置的缺省值)过滤掉的文件和子目录,这样可以帮助用户查看是否忘记了把某些自愿加入到版本控制。</para>
+
+ <para>但是Subversion不可能猜测到需要忽略的资源的名字,但是也有一些资源是<emphasis>所有</emphasis>特定版本库的工作拷贝都有忽略的,强制版本库的每个用户来添加这些模式到他们的运行配置区域不仅仅是一个负担,也会与用户取出的其他工作拷贝配置需要存在潜在的冲突。</para>
+
+ <para>解决方案是保存的忽略模式必须对出现在给定目录和这个目录本身的资源是独立的,一个常见的例子就是一个未版本化资源对一个目录来说是唯一的,会出现在那个位置,包括程序编译的输出,或者是—用一个本书的例子—DocBook的文件生成的HTML、PDF或者是PostScript文件。
+ </para>
<sidebar>
- <title>Ignore Patterns for CVS Users</title>
+ <title>CVS用户的忽略模式</title>
- <para>The Subversion <literal>svn:ignore</literal> property
- is very similar in syntax and function to the CVS
- <filename>.cvsignore</filename> file. In fact, if you are
- migrating a CVS working copy to Subversion, you can
- directly migrate the ignore patterns by using the
- <filename>.cvsignore</filename> file as input file to the
- <command>svn propset</command> command:</para>
+ <para>Subversion的<literal>svn:ignore</literal>属性与CVS的<filename>.cvsignore</filename>文件的语法和功能非常类似,实际上,如果你移植一个CVS的工作拷贝到Subversion,你可以直接使用<filename>.cvsignore</filename>作为<command>svn propset</command>输入文件参数:
+ </para>
<screen>
$ svn propset svn:ignore -F .cvsignore .
@@ -1207,28 +612,18 @@
$
</screen>
- <para>There are, however, some differences in the ways that
- CVS and Subversion handle ignore patterns. The two systems
- use the ignore patterns at some different times, and there
- are slight discrepancies in what the ignore patterns apply
- to. Also, Subversion does not recognize the use of the
- <literal>!</literal> pattern as a reset back to having no
- ignore patterns at all.</para>
+ <para>但是CVS和Subversion处理忽略模式的方式有一些不同,这两个系统在不同的时候使用忽略模式,忽略模式应用的对象也由微小的不同,但是Subversion不会识别重置回到没有忽略模式的<literal>!</literal>模式的使用。
+ </para>
</sidebar>
- <para>For this purpose, the <literal>svn:ignore</literal>
- property is the solution. Its value is a multi-line
- collection of file patterns, one pattern per line. The
- property is set on the directory in which you wish the
- patterns to be applied.
+ <para>为了这个目的,<literal>svn:ignore</literal>属性是解决方案,它的值是一个多行的文件模式集,一行一个模式,这个属性已经设置到这个你希望应用模式的目录。
<footnote>
- <para>The patterns are strictly for that
- directory—they do not carry recursively into
- subdirectories.</para>
+ <para>这个模式对那个目录是严格的—不会迭代的应用到子目录。
+ </para>
</footnote>
- For example, say you have the following output from
- <command>svn status</command>:</para>
+ 举个例子,你的<command>svn status</command>有如下的输出:
+ </para>
<screen>
$ svn status calc
@@ -1241,7 +636,8 @@
? calc/debug_log.3.gz
</screen>
- <para>In this example, you have made some property
+ <para>在这个例子里,你对<filename>button.c</filename>文件作了一些属性修改,但是你的工作拷贝也有一些未版本化的文件:你从源代码编译的最新的<filename>计算器</filename>程序是<filename>data.c</filename>,一系列调试输出日志文件,现在你知道你的编译系统会编译<filename>calculator</filename>程序。
+ In this example, you have made some property
modifications to <filename>button.c</filename>, but in your
working copy you also have some unversioned files:
the latest <filename>calculator</filename> program
@@ -1251,27 +647,17 @@
always results in the <filename>calculator</filename>
program being generated.
<footnote>
- <para>Isn't that the whole point of a build system?</para>
+ <para>这不是编译系统的基本功能吗?</para>
</footnote>
- And you know that your test suite always leaves those
- debugging log files lying around. These facts are true for
- all working copies, not just your own. And you know that
- you aren't interested in seeing those things every time you
- run <command>svn status</command>. So you use <command>svn
- propedit svn:ignore calc</command> to add some ignore
- patterns to the <filename>calc</filename> directory. For
- example, you might add this as the new value of the
- <literal>svn:ignore</literal> property:</para>
+ 就像你知道的,你的测试组件总是会留下这些调试日志,这对所有的工作拷贝都是一样的,不仅仅使你的。你也知道你不会有兴趣在<command>svn status</command>命令中显示这些信息,所以使用<command>svn
+ propedit svn:ignore calc</command>来为<filename>calc</filename>目录增加一些忽略模式,举个例子,你或许会添加如下的值作为<literal>svn:ignore</literal>属性:</para>
<programlisting>
calculator
debug_log*
</programlisting>
- <para>After you've added this property, you will now have a
- local property modification on the <filename>calc</filename>
- directory. But notice what else is different about your
- <command>svn status</command> output:</para>
+ <para>当你添加完这些属性,你会在<filename>calc</filename>目录有一个本地修改,但是注意你的<command>svn status</command>输出有什么其他的不同:</para>
<screen>
$ svn status
@@ -1280,13 +666,8 @@
? calc/data.c
</screen>
- <para>Now, all the cruft is missing from the output! Of
- course, those files are still in your working copy.
- Subversion is simply not reminding you that they are present
- and unversioned. And now with all the trivial noise removed
- from the display, you are left with more interesting
- items—such as that source code file that you probably
- forgot to add to version control.</para>
+ <para>现在,所有多余的输出不见了!当然,这些文件还在工作拷贝,Subversion仅仅是不再提醒你它们的存在和未版本化。现在所有讨厌的噪音都已经删除了,你留下了更加感兴趣的项目—如你忘记添加到版本控制的源代码文件。
+ </para>
<para>If you want to see the ignored files, you can pass the
<option>--no-ignore</option> option to Subversion:</para>
@@ -1302,139 +683,78 @@
I calc/debug_log.3.gz
</screen>
- <para>The list of patterns to ignore is also used by
- <command>svn add</command> and <command>svn
- import</command>. Both of these operations involve asking
- Subversion to begin managing some set of files and
- directories. Rather than force the user to pick and choose
- which files in a tree she wishes to start versioning,
- Subversion uses the ignore patterns to determine which files
- should not be swept into the version control system as part
- of a larger recursive addition or import operation.</para>
+ <para><command>svn add</command>和<command>svn
+ import</command>也会使用这个忽略模式列表,这两个操作都包括了询问Subversion来开始管理一组文件和目录。比强制用户挑拣目录树中那个文件要纳入版本控制的方式更好,Subversion使用忽略模式来检测那个文件不应该在大的迭代添加和导入操作中进入版本控制系统。
+ </para>
</sect3>
<sect3 id="svn-ch-7-sect-2.3.4">
<title><literal>svn:keywords</literal></title>
- <para>Subversion has the ability to substitute
- <firstterm>keywords</firstterm>—pieces of useful,
- dynamic information about a versioned file—into the
- contents of the file itself. Keywords generally describe
- information about the last time the file was known to be
- modified. Because this information changes each time the
- file changes, and more importantly, just
- <emphasis>after</emphasis> the file changes, it is a hassle
- for any process except the version control system to keep
- the data completely up-to-date. Left to human authors, the
- information would inevitably grow stale.</para>
-
- <para>For example, say you have a document in which you would
- like to display the last date on which it was modified. You
- could burden every author of that document to, just before
- committing their changes, also tweak the part of the
- document that describes when it was last changed. But
- sooner or later, someone would forget to do that. Instead
- simply ask Subversion to perform keyword substitution on the
- <literal>LastChangedDate</literal> keyword. You control
- where the keyword is inserted into your document by placing
- a <firstterm>keyword anchor</firstterm> at the desired
- location in the file. This anchor is just a string of text
- formatted as
- <literal>$</literal><replaceable>KeywordName</replaceable><literal>$</literal>.</para>
-
- <para>All keywords are case-sensitive where they appear as
- anchors in files: you must use the correct capitalization in
- order for the keyword to be expanded. You should consider the
- value of the <literal>svn:keywords</literal> property to be
- case-sensitive too—certain keyword names will be recognized
- regardless of case, but this behaviour is deprecated.</para>
-
- <para>Subversion defines the list of keywords available for
- substitution. That list contains the following five keywords,
- some of which have aliases that you can also use:</para>
+ <para>Subversion具备有添加<firstterm>关键字</firstterm>的能力—一些有用的,关于版本化的文件动态信息的片断—不必直接添加到文件本身。关键字通常会用来描述文件最后一次修改的一些信息,因为这些信息每次都有改变,更重要的一点,这是在文件修改<emphasis>之后</emphasis>,除了版本控制系统,对于任何处理完全保持最新的数据都是一场争论,作为人类作者,信息变得陈旧是不可避免的。</para>
+
+ <para>举个例子,你有一个文档希望显示最后修改的日期,你需要麻烦每个作者提交之前做这件事情,同时会改变描述这部分细细的部分,但是迟早会有人忘记做这件事,不选择简单的告诉Subversion来执行替换<literal>LastChangedDate</literal>关键字的操作,在你的文档需要放置这个关键字的地方放置一个<firstterm>keyword anchor</firstterm>,这个anchor只是一个格式为<literal>$</literal><replaceable>KeywordName</replaceable><literal>$</literal>字符串。
+ </para>
+
+ <para>所有作为anchor出现在文件里的关键字是大小写敏感的:为了关键字的扩展,你必须使用正确的按顺序大写。你必须考虑<literal>svn:keywords</literal>的属性值也是大小写敏感—特定的关键字名会忽略大小写,但是这个特性已经被废弃了。</para>
+
+ <para>Subversion定义了用来替换的关键字列表,这个列表保存了如下五个关键字,有一些也包括了可用的别名:
+ </para>
<variablelist>
<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
- looks something like <literal>$Date:
+ <para>这个关键字保存了文件最后一次在版本库修改的日期,看起来类似于<literal>$Date:
2002-07-22 21:42:37 -0700 (Mon, 22 Jul 2002)
- $</literal>. It may also be specified as
- <literal>LastChangedDate</literal>.</para>
+ $</literal>,它也可以用<literal>LastChangedDate</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>.
- 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:
- http://svn.collab.net/repos/trunk/README $</literal>.
- It may be abbreviated as
- <literal>URL</literal>.</para>
+ <para>这个关键字描述了这个文件在版本库最新的版本的完全URL,看起来类似<literal>$HeadURL:
+ http://svn.collab.net/repos/trunk/README $</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 2002-07-28 21:30:43Z sally
- $</literal>, and is interpreted to mean that the file
- <filename>calc.c</filename> was last changed in revision
- 148 on the evening of July 28, 2002 by the user
- <literal>sally</literal>.</para>
+ <para>这个关键字是其他关键字一个压缩组合,它看起来就像literal>$Id: calc.c 148 2002-07-28 21:30:43Z sally
+ $</literal>,可以解释为文件<filename>calc.c</filename>上一次修改的修订版本号是148,时间是2002年7月28日,作者是<literal>sally</literal>。
+ </para>
</listitem>
</varlistentry>
</variablelist>
- <para>Simply adding keyword anchor text to your file does
- nothing special. Subversion will never attempt to perform
- textual substitutions on your file contents unless
- explicitly asked to do so. After all, you might be writing
- a document
+ <para>只需要在你的文件增加关键字anchor不会做什么特别的事情,Subversion不会尝试对你的文件内容执行文本替换,除非明确的被告知这样做,毕竟,你可以撰写一个文档
<footnote>
- <para>… or maybe even a section of a book …</para>
+ <para>… 或者可能是一本书的一个小节 … </para>
</footnote>
- about how to use keywords, and you don't want Subversion to
- substitute your beautiful examples of un-substituted keyword
- anchors!</para>
-
- <para>To tell Subversion whether or not to substitute keywords
- on a particular file, we again turn to the property-related
- subcommands. The <literal>svn:keywords</literal> property,
- when set on a versioned file, controls which keywords will
- be substituted on that file. The value is a space-delimited
- list of the keyword names or aliases found in the previous
- table.</para>
-
- <para>For example, say you have a versioned file named
- <filename>weather.txt</filename> that looks like
- this:</para>
+ 关于如何使用关键字,你希望Subversion不会替代你漂亮的关于不需要替换的关键字anchor实例!
+ </para>
+
+ <para>为了告诉Subversion是否替代某个文件的关键字,我们要再次求助于属性相关的子命令,当<literal>svn:keywords</literal>属性设置到一个版本化的文件,这些属性控制了那些关键字将会替换到那个文件。这个值是空格分隔的前面列表的名称或是别名列表。</para>
+
+ <para>举个例子,假定你有一个版本化的文件<filename>weather.txt</filename>,内容如下:
+ </para>
<programlisting>
Here is the latest report from the front lines.
@@ -1443,10 +763,8 @@
Cumulus clouds are appearing more frequently as summer approaches.
</programlisting>
- <para>With no <literal>svn:keywords</literal> property set on
- that file, Subversion will do nothing special. Now, let's
- enable substitution of the
- <literal>LastChangedDate</literal> keyword.</para>
+ <para>当没有<literal>svn:keywords</literal>属性设置到这个文件,Subversion不会有任何特别操作,现在让我们允许<literal>LastChangedDate</literal>关键字的替换。
+ </para>
<screen>
$ svn propset svn:keywords "Date Author" weather.txt
@@ -1454,50 +772,22 @@
$
</screen>
- <para>Now you have made a local property modification on the
- <filename>weather.txt</filename> file. You will see no
- changes to the file's contents (unless you made some of your
- own prior to setting the property). Notice that the file
- contained a keyword anchor for the <literal>Rev</literal>
- keyword, yet we did not include that keyword in the property
- value we set. Subversion will happily ignore requests to
- substitute keywords that are not present in the file, and
- will not substitute keywords that are not present in the
- <literal>svn:keywords</literal> property value.</para>
+ <para>现在你已经对<filename>weather.txt</filename>的属性作了修改,你会看到文件的内容没有改变(除非你之前做了一些属性设置),注意这个文件包含了<literal>Rev</literal>的关键字anchor,但我们没有在属性值中包括这个关键字,Subversion会高兴的忽略替换这个文件中的关键字,也不会替换<literal>svn:keywords</literal>属性中没有出现的关键字。
+ </para>
<sidebar>
- <title>Keywords and Spurious Differences</title>
+ <title>关键字和虚假的差异</title>
- <para>The user-visible result of keyword substitution might
- lead you to think that every version of a file with that
- feature in use differs from the previous version in at
- least the area where the keyword anchor was placed.
- However, this is actually not the case. While checking
- for local modifications during <command>svn
- diff</command>, and before transmitting those local
- modifications during <command>svn commit</command>,
- Subversion <quote>un-substitutes</quote> any keywords that
- it previously substituted. The result is that the
- versions of the file that are stored in the repository
- contain only the real modifications that users make to the
- file.</para>
+ <para>用户可见的关键字替换会让你以为每一个具有此特性的文件的每个版本都会与前一个版本至少在关键字替换的地方不同,但是实际上并不是如此,当用<command>svn
+ diff</command>检查本地修改时,或者是在使用<command>svn commit</command>传输修改之前,Subversion不会<quote>取消替换</quote>任何上次替换的关键字,结果就是版本库保存的文件只保存用户实际做的修改。
+ </para>
</sidebar>
- <para>Immediately after you commit this property change,
- Subversion will update your working file with the new
- substitute text. Instead of seeing your keyword anchor
- <literal>$LastChangedDate$</literal>, you'll see its
- substituted result. That result also contains the name of
- the keyword, and continues to be bounded by the dollar sign
- (<literal>$</literal>) characters. And as we predicted, the
- <literal>Rev</literal> keyword was not substituted because
- we didn't ask for it to be.</para>
-
- <para>Note also that we set the <literal>svn:keywords</literal>
- property to "Date Author" yet the keyword anchor used the
- alias <literal>$LastChangedDate$</literal> and still
- expanded correctly.</para>
+ <para>在你提交了属性修改后,Subversion会立刻更新你的工作文件为新的替代文本,不会寻找你的<literal>$LastChangedDate$</literal>关键字anchor,你会看到替换的结果,这个结果也保存了关键字的名字,与美元符号(<literal>$</literal>)绑定在一起,而且我们预测的,<literal>Rev</literal>关键字不会被替换,因为我们没有要求这样做。</para>
+
+ <para>注意我们设置<literal>svn:keywords</literal>属性为"Date Author",关键字anchor使用别名<literal>$LastChangedDate$</literal>并且正确的扩张。
+ </para>
<screen>
Here is the latest report from the front lines.
@@ -1506,13 +796,8 @@
Cumulus clouds are appearing more frequently as summer approaches.
</screen>
- <para>If someone else now commits a change to
- <filename>weather.txt</filename>, your copy of that file
- will continue to display the same substituted keyword value
- as before—until you update your working copy. At that
- time the keywords in your <filename>weather.txt</filename>
- file will be re-substituted with information that
- reflects the most recent known commit to that file.</para>
+ <para>如果有其他人提交了<filename>weather.txt</filename>的修改,你的此文件的拷贝还会显示同样的替换关键字值—直到你更新你的工作拷贝,此时你的<filename>weather.txt</filename>重的关键字将会被替换来反映最新的提交信息。
+ </para>
</sect3>
@@ -2597,9 +1882,9 @@
from the native locale into UTF-8.</para>
<para>For example, suppose you create a file
- named<filename>caffè.txt</filename>, and then when committing
- the file, you write the log message as <quote>Adesso il caffè
- è più forte</quote>. Both the filename and log message
+ named<filename>caff猫.txt</filename>, and then when committing
+ the file, you write the log message as <quote>Adesso il caff猫
+ 猫 pi霉 forte</quote>. Both the filename and log message
contain non-ASCII characters, but because your locale is set
to <literal>it_IT</literal>, the Subversion client knows to
interpret them as Italian. It uses an Italian character set
@@ -2703,7 +1988,7 @@
character:</para>
<screen>
-$ svn checkout "http://host/path with space/project/españa"
+$ svn checkout "http://host/path with space/project/espa帽a"
</screen>
<para>…then Subversion will escape the unsafe characters
More information about the svnbook-dev
mailing list