Commits

Mike Shi committed 7716561

添加了关于Mercurial初步设置的信息。

Comments (0)

Files changed (1)

zh/ch02-tour-basic.xml

 
     &interaction.tour.status;
 
-    <para id="x_3d">The <command role="hg-cmd">hg status</command> command
-      prints no output for some files, but a line starting with
-      <quote><literal>M</literal></quote> for
-      <filename>hello.c</filename>.  Unless you tell it to, <command
-	role="hg-cmd">hg status</command> will not print any output
-      for files that have not been modified.</para>
+    <para id="x_3d"><command role="hg-cmd">hg status</command>只会在已修改的
+      文件<filename>hello.c</filename>前显示一个<quote><literal>M</literal>
+      </quote>,除非你告诉<command role="hg-cmd">hg status</command>全都打印,
+      否则它不会显示那些未被修改的文件。</para>
+      
+    <para id="x_3e"><quote><literal>M</literal></quote>标记提示我们Mercurial
+      已经注意到我们修改过<filename>hello.c</filename>文件了。我们不需要事先
+      <emphasis>通知</emphasis>Mercurial我们将会修改哪些文件,或者在我们修改
+      后通知它我们改动了哪些文件。它会自动发现这些变化的。</para>
 
-    <para id="x_3e">The <quote><literal>M</literal></quote> indicates that
-      Mercurial has noticed that we modified
-      <filename>hello.c</filename>.  We didn't need to
-      <emphasis>inform</emphasis> Mercurial that we were going to
-      modify the file before we started, or that we had modified the
-      file after we were done; it was able to figure this out
-      itself.</para>
-
-    <para id="x_3f">It's somewhat helpful to know that we've modified
-      <filename>hello.c</filename>, but we might prefer to know
-      exactly <emphasis>what</emphasis> changes we've made to it.  To
-      do this, we use the <command role="hg-cmd">hg diff</command>
-      command.</para>
+    <para id="x_3f">了解我们修改过<filename>hello.c</filename>文件确实多少对
+      我们有所帮助,但是我们更倾向于我们到底修改了<emphasis>哪些部分</emphasis>。
+      我们可以使用<command role="hg-cmd">hg diff</command>命令来完成这个操作。</para>
 
     &interaction.tour.diff;
 
     <tip>
-      <title>Understanding patches</title>
+      <title>理解补丁</title>
 
-      <para id="x_683">Remember to take a look at <xref
-	  linkend="sec:mq:patch"/> if you don't know how to read
-	output above.</para>
+      <para id="x_683">如果你不理解上面的输出信息,记得看一眼
+        <xref linkend="sec:mq:patch"/>。</para>
     </tip>
   </sect1>
   <sect1>
-    <title>Recording changes in a new changeset</title>
+    <title>在新的变更集中记录变更</title>
 
-    <para id="x_40">We can modify files, build and test our changes, and use
-      <command role="hg-cmd">hg status</command> and <command
-	role="hg-cmd">hg diff</command> to review our changes, until
-      we're satisfied with what we've done and arrive at a natural
-      stopping point where we want to record our work in a new
-      changeset.</para>
+    <para id="x_40">我们可以修改文件,构建和测试我们的变更,并且使用
+      <command role="hg-cmd">hg status</command>和<command
+      role="hg-cmd">hg diff</command>命令来复核我们的变更,当我们对我们的变更
+      满意,并且到了一个合适的时机来把我们的工作保存到一个新的变更集中。</para>
 
-    <para id="x_41">The <command role="hg-cmd">hg commit</command> command lets
-      us create a new changeset; we'll usually refer to this as
-      <quote>making a commit</quote> or
-      <quote>committing</quote>.</para>
+    <para id="x_41"><command role="hg-cmd">hg commit</command>命令可以为我们
+      创建一个新的变更集。我们会经常使用它来<quote>做一次提交</quote>或者就说
+      <quote>提交</quote>。</para>
 
     <sect2>
-      <title>Setting up a username</title>
+      <title>设置一个用户名</title>
 
-      <para id="x_42">When you try to run <command role="hg-cmd">hg
-	  commit</command> for the first time, it is not guaranteed to
-	succeed.  Mercurial records your name and address with each
-	change that you commit, so that you and others will later be
-	able to tell who made each change.  Mercurial tries to
-	automatically figure out a sensible username to commit the
-	change with.  It will attempt each of the following methods,
-	in order:</para>
+      <para id="x_42">当你第一次试着执行<command role="hg-cmd">hg commit</command>
+        时,它可能会失败。Mercurial会在每次变更提交时,记录你的用户名和地址,这样
+        今后你和其他人才可以知道谁做了这些变更。Mercurial会试着自动查找合适的用户名
+        来提交变更。它通常会依次按照以下方法来查找。</para>
       <orderedlist>
-	<listitem><para id="x_43">If you specify a <option
-	      role="hg-opt-commit">-u</option> option to the <command
-	      role="hg-cmd">hg commit</command> command on the command
-	    line, followed by a username, this is always given the
-	    highest precedence.</para></listitem>
-	<listitem><para id="x_44">If you have set the <envar>HGUSER</envar>
-	    environment variable, this is checked
-	    next.</para></listitem>
-	<listitem><para id="x_45">If you create a file in your home
-	    directory called <filename
-	      role="special">.hgrc</filename>, with a <envar
-	      role="rc-item-ui">username</envar> entry, that will be
-	    used next.  To see what the contents of this file should
-	    look like, refer to <xref
-	      linkend="sec:tour-basic:username"/>
-	    below.</para></listitem>
-	<listitem><para id="x_46">If you have set the <envar>EMAIL</envar>
-	    environment variable, this will be used
-	    next.</para></listitem>
-	<listitem><para id="x_47">Mercurial will query your system to find out
-	    your local user name and host name, and construct a
-	    username from these components. Since this often results
-	    in a username that is not very useful, it will print a
-	    warning if it has to do
-	    this.</para></listitem>
+        <listitem><para id="x_43">如果你执行<command role="hg-cmd">hg commit</command>
+          命令时指定了参数<option role="hg-opt-commit">-u</option>,然后后面跟着
+          用户名,那么它就是最高优先度的。</para></listitem>
+      <listitem><para id="x_44">如果你设置了环境变量<envar>HGUSER</envar>,它会第二个检测。
+         </para></listitem>
+
+         <listitem><para id="x_45">如果你在主目录下创建了一个<filename role="special">
+             .hgrc</filename>,里面指定了<envar role="rc-item-ui">username</envar>,
+           那么它就是会被紧接着使用。如果你想知道这个文件的详细内容,请参见<xref
+             linkend="sec:tour-basic:username"/></para></listitem>
+       <listitem><para
+           id="x_46">如果你设置了<envar>EMAIL</envar>环境变量,这会紧接着使用。
+       </para></listitem>
+       <listitem><para id="x_47">Mercurial会从你的系统中查询,找出你的本地用户名
+           和主机名,并且从中创造出一个用户名来。因为这通常会导致一个不怎么有用的
+           用户名,所以它会显示出一个警告信息来提醒用户。</para></listitem>
       </orderedlist>
-      <para id="x_48">If all of these mechanisms fail, Mercurial will
-	  fail, printing an error message.  In this case, it will not
-	  let you commit until you set up a
-	  username.</para>
-      <para id="x_49">You should think of the <envar>HGUSER</envar> environment
-	variable and the <option role="hg-opt-commit">-u</option>
-	option to the <command role="hg-cmd">hg commit</command>
-	command as ways to <emphasis>override</emphasis> Mercurial's
-	default selection of username.  For normal use, the simplest
-	and most robust way to set a username for yourself is by
-	creating a <filename role="special">.hgrc</filename> file; see
-	below for details.</para>
+      <para id="x_48">如果以上机制都失败了,Mercurial会提交失败,并且打印出一个错误
+        信息。事到如今,除非你设置一个用户名,否则Mercurial将拒绝你提交变更。</para>
+      <para id="x_49">你可能会想用<envar>HGUSER</envar>环境变量和<option
+        role="hg-opt-commit">-u</option>参数来<emphasis>覆盖</emphasis>Mercurial的
+        默认用户名。不过通常情况下,最简单保险的做法是为你自己创建一个<filename
+        role="special">.hgrc</filename>文件来设置你的用户名。参见下文中的详细描述。</para>
+
       <sect3 id="sec:tour-basic:username">
 	<title>Creating a Mercurial configuration file</title>