[svnbook] r5350 committed - branches/1.8/zh/book/ch03-advanced-topics.xml

wuzhouhui at users.sourceforge.net wuzhouhui at users.sourceforge.net
Sat Jul 8 01:38:17 CDT 2017


Revision: 5350
          http://sourceforge.net/p/svnbook/source/5350
Author:   wuzhouhui
Date:     2017-07-08 06:38:16 +0000 (Sat, 08 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-07 01:45:07 UTC (rev 5349)
+++ branches/1.8/zh/book/ch03-advanced-topics.xml	2017-07-08 06:38:16 UTC (rev 5350)
@@ -1429,8 +1429,12 @@
 
     <!-- =============================================================== -->
     <sect2 id="svn.advanced.props.manip">
+    <!--
       <title>Manipulating Properties</title>
+    -->
+      <title>操作属性</title>
 
+    <!--
       <para>The <command>svn</command> program affords a few ways to
         add or modify file and directory properties.  For properties
         with short, human-readable values, perhaps the simplest way to
@@ -1437,6 +1441,11 @@
         add a new property is to specify the property name and value
         on the command line of the <command>svn propset</command>
         subcommand:</para>
+    -->
+      <para>命令 <command>svn</command> 提供了几种用于添加或修改文件和目录
+        属性的方法. 如果属性的值比较短, 而且是人类可读的, 那么添加新属性的
+        最简单的方法是在子命令 <command>svn propset</command> 的命令行参
+        数上指定属性名和值:</para>
 
       <informalexample>
         <screen>
@@ -1446,14 +1455,21 @@
 </screen>
       </informalexample>
        
+    <!--
       <para>But we've been touting the flexibility that Subversion
         offers for your property values.  And if you are planning to
         have a multiline textual, or even binary, property value, you
         probably do not want to supply that value on the command line.
         So the <command>svn propset</command> subcommand takes a
-        <option>--file</option> (<option>-F</option>) option for
+        <option>- -file</option> (<option>-F</option>) option for
         specifying the name of a file that contains the new property
         value.</para>
+    -->
+      <para>Subversion 对于属性值给予了很大的灵活性, 如果属性值包含多行文本,
+        甚至是二进制格式, 此时用户就不太可能把值写在命令行参数上, 为了解决
+        这个问题, <command>svn propset</command> 支持选项
+        <option>--file</option> (<option>-F</option>), 该选项指定了一个包含
+        属性值的文件的名字.</para>
 
       <informalexample>
         <screen>
@@ -1463,6 +1479,7 @@
 </screen>
       </informalexample>
 
+    <!--
       <para>There are some restrictions on the names you can use for
         properties.  A property name must start with a letter, a colon
         (<literal>:</literal>), or an underscore
@@ -1471,7 +1488,14 @@
         (<literal>.</literal>).<footnote><para>If you're familiar with
         XML, this is pretty much the ASCII subset of the syntax for
         XML <quote>Name</quote>.</para></footnote></para>
+    -->
+  <para>对属性名有一些限制条件, 属性名必须以字母, 冒号 (<literal>:</literal>)
+    或下划线 (<literal>_</literal>) 开始, 接下来的字符, 除了前面介绍的, 还可
+    以用数字, 连字符 (<literal>-</literal>), 句点 (<literal>.</literal>).
+    <footnote><para>如果读者熟悉 XML, 就会发现这很像 XML <quote>Name</quote>
+        语法的 ASCII 子集.</para></footnote></para>
 
+    <!--
       <para>In addition to the <command>propset</command> command, the
         <command>svn</command> program supplies the
         <command>propedit</command> command.  This command uses the
@@ -1488,6 +1512,17 @@
         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>. <command>propedit</command> 使用
+        预告配置的外部编辑器 (见
+        <xref linkend="svn.advanced.confarea.opts.config"/>) 来添加或修改属性.
+        执行 <command>svn propedit</command> 时, 命令在一个临时文件上打开
+        编辑器, 临时文件的内容是属性的当前值 (如果是添加新属性, 内容就是空的),
+        然后用户就可以按照自己的需要在编辑器里修改属性值, 修改完成后保存临时
+        文件, 最后退出编辑器. 退出编辑器后, 如果 Subversion 检测到属性原来的
+        值被修改了, 它就把修改后的值当作属性的新值. 如果用户没有修改便退出
+        编辑器, 属性值就保持不变:</para>
 
       <informalexample>
         <screen>
@@ -1497,11 +1532,16 @@
 </screen>
       </informalexample>
 
+    <!--
       <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 the following:</para>
+    -->
+      <para>应该注意到, 和 <command>svn</command> 的其他子命令一样, 属性操作
+        可以同时施加到多个路径, 这就允许用户用一个命令修改整个文件集合的属性,
+        例如我们可以这样做:</para>
 
       <informalexample>
         <screen>
@@ -1514,6 +1554,7 @@
 </screen>
       </informalexample>
 
+    <!--
       <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
@@ -1525,6 +1566,13 @@
         propget</command>.  This command will, given a property name
         and a path (or set of paths), 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>
 
       <informalexample>
         <screen>
@@ -1537,10 +1585,15 @@
 </screen>
       </informalexample>
 
+    <!--
       <para>There's even a variation of the
         <command>proplist</command> command that will list both the
         name and the value for all of the properties.  Simply supply the
-        <option>--verbose</option> (<option>-v</option>) option.</para>
+        <option>- -verbose</option> (<option>-v</option>) option.</para>
+    -->
+      <para>执行命令 <command>svn proplist</command> 时如果加上选项
+        <option>--verbose</option> (<option>-v</option>), 命令就会同时列出
+        所有属性的名字和值.</para>
 
       <informalexample>
         <screen>
@@ -1563,6 +1616,7 @@
 </screen>
       </informalexample>
 
+    <!--
       <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
@@ -1569,6 +1623,13 @@
         property altogether using <command>svn propedit</command> or
         <command>svn propset</command>.  For example, this command will
         <emphasis>not</emphasis> yield the desired effect:</para>
+    -->
+      <para>最后一个与属性相关的子命令是 <command>propdel</command>. 因为
+        Subversion 允许为属性设置空值, 所以用户不能想当然地认为用
+        <command>svn propedit</command> 和 <command>svn propset</command>
+        把属性值设置成空值, 就能实现完全删除属性的效果, 比如说下面的命令不会产
+        生用户想要的效果 (用户想要的效果是删除属性 <literal>license</literal>)
+        :</para>
 
       <informalexample>
         <screen>
@@ -1584,9 +1645,13 @@
 </screen>
       </informalexample>
 
+    <!--
       <para>You need to use the <command>propdel</command> subcommand
         to delete properties altogether.  The syntax is similar to the
         other property commands:</para>
+    -->
+      <para>为了完全删除属性, 需要使用子命令 <command>propdel</command>,
+        它的使用语法和其他属性命令类似:</para>
 
       <informalexample>
         <screen>




More information about the svnbook-dev mailing list