[svnbook] r5480 committed - branches/1.8/zh/book/ ch04-branching-and-merging.xml

wuzhouhui at users.sourceforge.net wuzhouhui at users.sourceforge.net
Sat Nov 4 07:54:34 CDT 2017


Revision: 5480
          http://sourceforge.net/p/svnbook/source/5480
Author:   wuzhouhui
Date:     2017-11-04 12:54:33 +0000 (Sat, 04 Nov 2017)
Log Message:
-----------
1.8/zh: translation of chapter 4 in progress

Modified Paths:
--------------
    branches/1.8/zh/book/ch04-branching-and-merging.xml

Modified: branches/1.8/zh/book/ch04-branching-and-merging.xml
===================================================================
--- branches/1.8/zh/book/ch04-branching-and-merging.xml	2017-11-02 12:29:13 UTC (rev 5479)
+++ branches/1.8/zh/book/ch04-branching-and-merging.xml	2017-11-04 12:54:33 UTC (rev 5480)
@@ -3658,8 +3658,12 @@
 
     <!-- =============================================================== -->
     <sect2 id="svn.branchmerge.advanced.mergeconflicts">
+      <!--
       <title>More on Merge Conflicts</title>
+      -->
+      <title>关于合并冲突的更多内容</title>
 
+      <!--
       <para>Just like the <command>svn update</command> command,
         <command>svn merge</command> applies changes to your working
         copy.  And therefore it's also capable of creating
@@ -3666,7 +3670,13 @@
         conflicts.  The conflicts produced by <command>svn
           merge</command>, however, are sometimes different, and this
         section explains those differences.</para>
+      -->
+      <para>和 <command>svn update</command> 类似, <command>svn merge</command>
+        也是向工作副本应用修改, 因此难免会产生冲突. 然而, 与 <command>svn
+          update</command> 相比, 由 <command>svn merge</command> 产生的冲突有
+        点不同, 本节就是介绍这些不同之处.</para>
 
+      <!--
       <para>To begin with, assume that your working copy has no
         local edits.  When you <command>svn update</command> to a
         particular revision, the changes sent by the server
@@ -3677,7 +3687,15 @@
         comparison is exactly equal to what you already have, the
         delta is guaranteed to correctly convert your working copy
         into the right hand tree.</para>
+      -->
+      <para>在开始前假设用户的工作副本不含有本地修改, 当用户执行 <command>svn
+          update</command>, 把工作副本更新到某个特定的版本号时, 从服务器接收
+        的修改总能 <quote>干净地</quote> 应用到工作副本上. 服务器生成差异的
+        方式是比较两棵目录树: 一个是工作副本的虚拟快照, 另一个是用户指定的版本
+        号所对应的目录树. 因为比较的左侧等价于工作副本, 所以生成的差异总能保证
+        正确地把工作副本更新到右侧.</para>
 
+      <!--
       <para>But <command>svn merge</command> has no such guarantees
         and can be much more chaotic: the advanced user can ask the
         server to compare <emphasis>any</emphasis> two trees at all,
@@ -3688,6 +3706,14 @@
         its best to apply as much of the delta as possible, but some
         parts may be impossible. A common sign that you merged the wrong
         delta is unexpected tree conflicts:</para>
+      -->
+      <para>但是 <command>svn merge</command> 没有这种保证, 而且冲突可能会更
+        混乱: 高级用户可以要求服务器比较 <emphasis>任意</emphasis> 两个目录树,
+        即使目录树和工作副本并不相关! 这就意味着有很大的可能产生人为错误.
+        用户有时候会比较两个错误的目录树, 导致生成的差异不能被干净地应用到工
+        作副本上. 命令 <command>svn merge</command> 会尽可能多地把修改应用到
+        工作副本, 但某些修改可能根本就无法应用成功. 合并错误的常见现象是出现了
+        意想不到的目标冲突:</para>
 
       <informalexample>
         <screen>
@@ -3720,6 +3746,7 @@
 </screen>
       </informalexample>
 
+      <!--
       <para>In the previous example, it might be the case that
         <filename>doc</filename> and the four <filename>*.c</filename>
         files all exist in both snapshots of the
@@ -3731,13 +3758,27 @@
         the wrong working copy target; both are classic signs of user
         error.  When this happens, it's easy to recursively revert all
         the changes created by the merge
-        (<userinput>svn revert . --recursive</userinput>), delete any
+        (<userinput>svn revert . - -recursive</userinput>), delete any
         unversioned files or directories left behind after the
         revert, and rerun <command>svn merge</command> with the
         correct arguments.</para>
+      -->
+      <para>在上面的例子里, 从现象来看, 被比较的目录 <filename>doc</filename>
+        和 4 个 <filename>*.c</filename> 文件在分支的两个快照中都存在, 生成的
+        差异想去修改工作副本中对应路径上的文件内容. 但这些路径在工作副本中都
+        不存在. 无论真实的情况是什么, 产生目录冲突最可能的原因是用户比较了两
+        个错误的目录树, 或者是差异被应用到了错误的工作副本—这两种都是
+        用户最常犯的错误. 当错误发生时, 最简单的办法就是递归地撤消由合并产生
+        的所有本地修改 (<userinput>svn revert . --recursive</userinput>),
+        删除可能残留的未被版本控制的文件和目录, 然后再用正确的参数执行
+        <command>svn merge</command>.</para>
 
+      <!--
       <para>Also keep in mind that a merge into a working copy with no
         local edits can still produce text conflicts.</para>
+      -->
+      <para>还要注意, 即使在向不含有本地修改的工作副本合并, 仍有可能产生
+        内容冲突.</para>
 
       <informalexample>
         <screen>




More information about the svnbook-dev mailing list