[svnbook] r5857 committed - branches/1.8/zh/book/ch07-customizing-svn.xml

wuzhouhui at users.sourceforge.net wuzhouhui at users.sourceforge.net
Sun Dec 30 22:03:54 CST 2018


Revision: 5857
          http://sourceforge.net/p/svnbook/source/5857
Author:   wuzhouhui
Date:     2018-12-31 04:03:53 +0000 (Mon, 31 Dec 2018)
Log Message:
-----------
1.8/zh: translation of chapter 7 in progress

Modified Paths:
--------------
    branches/1.8/zh/book/ch07-customizing-svn.xml

Modified: branches/1.8/zh/book/ch07-customizing-svn.xml
===================================================================
--- branches/1.8/zh/book/ch07-customizing-svn.xml	2018-12-30 03:52:17 UTC (rev 5856)
+++ branches/1.8/zh/book/ch07-customizing-svn.xml	2018-12-31 04:03:53 UTC (rev 5857)
@@ -1890,8 +1890,12 @@
   <!-- ================================================================= -->
   <!-- ================================================================= -->
   <sect1 id="svn.advanced.externaleditors">
+      <!--
     <title>Using External Editors</title>
+      -->
+    <title>使用外部编辑器</title>
 
+      <!--
     <para>The most obvious way to get data into Subversion is through
       the addition of files to version control, committing changes to
       those files, and so on.  But other pieces of
@@ -1901,21 +1905,39 @@
       property values—tend to be textual in nature and are
       provided explicitly by users.  Most of this information can be
       provided to the Subversion command-line client using the
-      <option>--message</option> (<option>-m</option>) and
-      <option>--file</option> (<option>-F</option>) options with the
+      <option>- -message</option> (<option>-m</option>) and
+      <option>- -file</option> (<option>-F</option>) options with the
       appropriate subcommands.</para>
+      -->
+    <para>为了向 Subversion 添加数据, 最明显的方式就是添加新文件, 或者向已有
+      的文件提交修改, 但是除文件内容之外的其他信息则只存在于仓库中, 其中一些
+      信息—例如日志消息, 与锁有关的注释, 以及某些属性值—是纯文本
+      的, 而且由用户显式提供. 这些信息中的大部分都可以用选项
+      <option>--message</option> (<option>-m</option>) 和
+      <option>--file</option> (<option>-F</option>) 传递给 Subversion 客户端.
+    </para>
 
+      <!--
     <para>Each of these options has its pros and cons.  For example,
-      when performing a commit, <option>--file</option>
+      when performing a commit, <option>- -file</option>
       (<option>-F</option>) works well if you've already prepared a
       text file that holds your commit log message.  If you didn't,
-      though, you can use <option>--message</option>
+      though, you can use <option>- -message</option>
       (<option>-m</option>) to provide a log message on the command
       line.  Unfortunately, it can be tricky to compose anything more
       than a simple one-line message on the command line.  Users want
       more flexibility—multiline, free-form log message editing
       on demand.</para>
-      
+      -->
+    <para>这两个选项各有利弊. 例如, 当你执行提交操作时, 如果你已经事先把日志
+      消息写到了一个文本文件里, 那么选项 <option>--file</option>
+      (<option>-F</option>) 就可以工作得很好. 如果你还没有把日志消息写到一个
+      文件里, 那你可以通过选项 <option>--message</option> (<option>-m</option>)
+      把日志消息写到命令行上, 不幸的是, 如果你想在命令行上输入多于一行的日志
+      消息就会比较困难. 用户希望更灵活的输入形式—多行文本, 不受约束的
+      日志消息编辑.</para>
+
+      <!--
     <para>Subversion supports this by allowing you to specify an
       external text editor that it will launch as necessary
       to give you a more powerful input mechanism for this textual
@@ -1923,29 +1945,54 @@
       editor you'd like use.  Subversion checks the following things,
       in the order specified, when it wants to launch such an
       editor:</para>
+      -->
+    <para>Subversion 允许用户指定一个外部文本编辑器, 必要时, Subversion 会
+      启动该编辑器, 从而允许用户更加灵活地输入文本信息 (例如日志消息和属性
+      值). 有多种方式用于指定外部编辑器, 当 Subversion 想要启动外部编辑器时,
+      将按照如下顺序查看应该启动哪个编辑器:</para>
 
     <orderedlist>
       <listitem>
-        <para><literal>--editor-cmd</literal> command-line option</para>
+      <!--
+        <para><literal>- -editor-cmd</literal> command-line option</para>
+      -->
+        <para>命令行选项 <option>--editor-cmd</option></para>
       </listitem>
       <listitem>
+      <!--
         <para><literal>SVN_EDITOR</literal> environment variable</para>
+      -->
+        <para>环境变量 <literal>SVN_EDITOR</literal></para>
       </listitem>
       <listitem>
+      <!--
         <para><literal>editor-cmd</literal> runtime configuration option</para>
+      -->
+        <para>运行时配置选项 <literal>editor-cmd</literal></para>
       </listitem>
       <listitem>
+      <!--
         <para><literal>VISUAL</literal> environment variable</para>
+      -->
+        <para>环境变量 <literal>VISUAL</literal></para>
       </listitem>
       <listitem>
+      <!--
         <para><literal>EDITOR</literal> environment variable</para>
+      -->
+        <para>环境变量 <literal>EDITOR</literal></para>
       </listitem>
       <listitem>
+      <!--
         <para>Possibly, a fallback value built into the Subversion
           libraries (not present in the official builds)</para>
+      -->
+        <para>可能是被编译到 Subversion 库中的备用编辑器 (在官方构建的版本中
+          不存在)</para>
       </listitem>
     </orderedlist>
 
+      <!--
     <para>The value of any of these options or variables is the
       beginning of a command line to be executed by the shell.
       Subversion appends to that command line a space and the pathname
@@ -1954,7 +2001,14 @@
       an invocation in which its last command-line parameter is a file
       to be edited, and it should be able to save the file in place
       and return a zero exit code to indicate success.</para>
+      -->
+    <para>上面任意一个选项或变量的值都是一个将被 shell 执行的命令行的开头,
+      Subversion 会在命令行的后面加上一个空格, 然后再加上一个临时文件的路径.
+      所以说, 为了能被 Subversion 使用, 所指定的编辑器必须支持它的最后一个命令
+      行参数是待编辑的文件, 而且在保存文件时不能更改路径, 编辑器成功退出时
+      必须以 0 作为退出值.</para>
 
+      <!--
     <para>As noted, external editors can be used to provide commit log
       messages to any of the committing subcommands (such as
       <command>svn commit</command> or <command>import</command>,
@@ -1961,8 +2015,8 @@
       <command>svn mkdir</command> or <command>delete</command> when
       provided a URL target, etc.), and Subversion will try to
       launch the editor automatically if you don't specify either of
-      the <option>--message</option> (<option>-m</option>) or
-      <option>--file</option> (<option>-F</option>) options.  The
+      the <option>- -message</option> (<option>-m</option>) or
+      <option>- -file</option> (<option>-F</option>) options.  The
       <command>svn propedit</command> command is built almost entirely
       around the use of an external editor.  And beginning in version
       1.5, Subversion will also use the configured external text
@@ -1970,6 +2024,16 @@
       interactive conflict resolution.  Oddly, there doesn't appear to
       be a way to use external editors to interactively provide lock
       comments.</para>
+      -->
+    <para>外部编辑器可以为提交类的子命令 (例如 <command>svn commit</command>,
+      <command>svn import</command>, <command>svn mkdir</command>
+      或 <command>svn delete</command>) 提供日志消息, 如果没有指定选项
+      <option>--message</option> (<option>-m</option>) 和
+      <option>--file</option> (<option>-F</option>), 那么 Subversion 就会尝试
+      启动外部编辑器, 命令 <command>svn propedit</command> 几乎就是在围绕着
+      外部编辑器. 从 Subversion 1.5 开始, Subversion 还可以在交互式地解决冲突
+      时, 按照用户的要求来启动外部编辑器. 奇怪的是, 在编写锁注释时无法使用
+      外部编辑器.</para>
 
   </sect1>
 




More information about the svnbook-dev mailing list