# HG changeset patch # User Bryan O'Sullivan # Date 1250277139 25200 # Node ID eca3a16c0114c1c9253b61b141b5c015a17a8018 # Parent f9f71850ae1aa5a3ee160045fb21064fdfae04ea# Parent c3863298abc78debc074e85394bb5126c4392210 Merge with dongsheng diff -r f9f71850ae1a -r eca3a16c0114 Makefile --- a/Makefile Fri Aug 14 12:10:47 2009 -0700 +++ b/Makefile Fri Aug 14 12:12:19 2009 -0700 @@ -23,6 +23,11 @@ rev_id = $(shell hg parents --template '{node|short} ({date|shortdate})') images := \ + en/figs/bad-merge-1.png \ + en/figs/bad-merge-2.png \ + en/figs/bad-merge-3.png \ + en/figs/bad-merge-4.png \ + en/figs/bad-merge-5.png \ en/figs/feature-branches.png \ en/figs/filelog.png \ en/figs/metadata.png \ @@ -59,6 +64,12 @@ clean: @rm -fr build po/*.mo hello en/hello en/html en/.validated-00book.xml en/examples/.run en/examples/results \ stylesheets/system-xsl en/figs/*-tmp.svg \ + web/index-read.html.in \ + en/figs/bad-merge-1.png \ + en/figs/bad-merge-2.png \ + en/figs/bad-merge-3.png \ + en/figs/bad-merge-4.png \ + en/figs/bad-merge-5.png \ en/figs/feature-branches.png \ en/figs/filelog.png \ en/figs/feature-branches.png \ diff -r f9f71850ae1a -r eca3a16c0114 en/figs/caution.png Binary file en/figs/caution.png has changed diff -r f9f71850ae1a -r eca3a16c0114 es/99book.bib --- a/es/99book.bib Fri Aug 14 12:10:47 2009 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../en/99book.bib \ No newline at end of file diff -r f9f71850ae1a -r eca3a16c0114 es/bookhtml.cfg --- a/es/bookhtml.cfg Fri Aug 14 12:10:47 2009 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../en/bookhtml.cfg \ No newline at end of file diff -r f9f71850ae1a -r eca3a16c0114 es/fixhtml.py --- a/es/fixhtml.py Fri Aug 14 12:10:47 2009 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../en/fixhtml.py \ No newline at end of file diff -r f9f71850ae1a -r eca3a16c0114 es/hgbook.css --- a/es/hgbook.css Fri Aug 14 12:10:47 2009 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../en/hgbook.css \ No newline at end of file diff -r f9f71850ae1a -r eca3a16c0114 es/htlatex.book --- a/es/htlatex.book Fri Aug 14 12:10:47 2009 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../en/htlatex.book \ No newline at end of file diff -r f9f71850ae1a -r eca3a16c0114 po/zh.po --- a/po/zh.po Fri Aug 14 12:10:47 2009 -0700 +++ b/po/zh.po Fri Aug 14 12:12:19 2009 -0700 @@ -41,8 +41,8 @@ msgid "" msgstr "" "Project-Id-Version: hgbook 1.2\n" -"POT-Creation-Date: 2009-04-05 11:48+0800\n" -"PO-Revision-Date: 2009-04-05 12:10+0800\n" +"POT-Creation-Date: 2009-05-21 14:26+0800\n" +"PO-Revision-Date: 2009-05-21 16:42+0800\n" "Last-Translator: 宋冬生 \n" "Language-Team: Simplified Chinese \n" "MIME-Version: 1.0\n" @@ -53,32 +53,32 @@ "X-Poedit-SourceCharset: utf-8\n" #. type: Content of: -#: ../en/00book.xml:41 +#: ../en/00book.xml:42 msgid "Mercurial: The Definitive Guide" msgstr "Mercurial 权威指南" #. type: Content of: <book><subtitle> -#: ../en/00book.xml:46 +#: ../en/00book.xml:47 msgid "Compiled from $rev_id$" msgstr "编译自 $rev_id$" #. type: Content of: <book><bookinfo> -#: ../en/00book.xml:48 +#: ../en/00book.xml:49 msgid "<edition>1</edition> <isbn>9780596800673</isbn>" msgstr "<edition>1</edition> <isbn>9780596800673</isbn>" #. type: Content of: <book><bookinfo><authorgroup><author><firstname> -#: ../en/00book.xml:52 +#: ../en/00book.xml:53 msgid "Bryan" msgstr "Bryan" #. type: Content of: <book><bookinfo><authorgroup><author><surname> -#: ../en/00book.xml:53 +#: ../en/00book.xml:54 msgid "O'Sullivan" msgstr "O'Sullivan" #. type: Content of: <book><bookinfo> -#: ../en/00book.xml:57 +#: ../en/00book.xml:58 msgid "" "<editor> <firstname>Mike</firstname> <surname>Loukides</surname> </editor> " "<copyright> <year>2006</year> <year>2007</year> <year>2008</year> <year>2009</" @@ -89,6 +89,825 @@ "year> <holder>Bryan O'Sullivan</holder> </copyright>" #. type: Content of: <book><appendix><title> +#: ../en/appA-svn.xml:5 +msgid "Migrating to Mercurial" +msgstr "迁移到 Mercurial" + +#. type: Content of: <book><appendix><para> +#: ../en/appA-svn.xml:7 +msgid "" +"A common way to test the waters with a new revision control tool is to " +"experiment with switching an existing project, rather than starting a new " +"project from scratch." +msgstr "" + +#. type: Content of: <book><appendix><para> +#: ../en/appA-svn.xml:11 +msgid "" +"In this appendix, we discuss how to import a project's history into " +"Mercurial, and what to look out for if you are used to a different revision " +"control system." +msgstr "" + +#. type: Content of: <book><appendix><sect1><title> +#: ../en/appA-svn.xml:16 +msgid "Importing history from another system" +msgstr "从其它版本控制系统导入历史" + +#. type: Content of: <book><appendix><sect1><para> +#: ../en/appA-svn.xml:18 +msgid "" +"Mercurial ships with an extension named <literal>convert</literal>, which can " +"import project history from most popular revision control systems. At the " +"time this book was written, it could import history from the following " +"systems:" +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><thead><row><entry> +#: ../en/appA-svn.xml:25 ../en/appA-svn.xml:369 ../en/ch01-intro.xml:416 +#: ../en/ch01-intro.xml:627 +msgid "Subversion" +msgstr "Subversion" + +#. type: Content of: <book><appendix><sect1><itemizedlist><listitem><para> +#: ../en/appA-svn.xml:28 ../en/ch01-intro.xml:532 ../en/ch01-intro.xml:628 +msgid "CVS" +msgstr "CVS" + +#. type: Content of: <book><appendix><sect1><itemizedlist><listitem><para> +#: ../en/appA-svn.xml:31 +msgid "git" +msgstr "git" + +#. type: Content of: <book><appendix><sect1><itemizedlist><listitem><para> +#: ../en/appA-svn.xml:34 ../en/ch01-intro.xml:630 +msgid "Darcs" +msgstr "Darcs" + +#. type: Content of: <book><appendix><sect1><itemizedlist><listitem><para> +#: ../en/appA-svn.xml:37 +msgid "Bazaar" +msgstr "Bazaar" + +#. type: Content of: <book><appendix><sect1><itemizedlist><listitem><para> +#: ../en/appA-svn.xml:40 +msgid "Monotone" +msgstr "Monotone" + +#. type: Content of: <book><appendix><sect1><itemizedlist><listitem><para> +#: ../en/appA-svn.xml:43 +msgid "GNU Arch" +msgstr "GNU Arch" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><thead><row><entry> +#: ../en/appA-svn.xml:46 ../en/appA-svn.xml:370 +msgid "Mercurial" +msgstr "Mercurial" + +#. type: Content of: <book><appendix><sect1><para> +#: ../en/appA-svn.xml:50 +msgid "" +"(To see why Mercurial itself is supported as a source, see <xref linkend=" +"\"svn.filemap\"/>.)" +msgstr "" + +#. type: Content of: <book><appendix><sect1><para> +#: ../en/appA-svn.xml:53 +msgid "" +"You can enable the extension in the usual way, by editing your <filename>~/." +"hgrc</filename> file." +msgstr "" + +#. type: Content of: <book><appendix><sect1><para> +#: ../en/appA-svn.xml:59 +msgid "" +"This will make a <command>hg convert</command> command available. The " +"command is easy to use. For instance, this command will import the " +"Subversion history for the Nose unit testing framework into Mercurial." +msgstr "" + +#. type: Content of: <book><appendix><sect1><screen><prompt> +#: ../en/appA-svn.xml:64 ../en/appA-svn.xml:207 ../en/appA-svn.xml:212 +#: ../en/appA-svn.xml:213 ../en/appA-svn.xml:218 ../en/appA-svn.xml:224 +#: ../en/appA-svn.xml:229 ../en/appA-svn.xml:532 +msgid "$" +msgstr "$" + +#. type: Content of: <book><appendix><sect1><screen><userinput> +#: ../en/appA-svn.xml:64 +msgid "hg convert http://python-nose.googlecode.com/svn/trunk" +msgstr "" + +#. type: Content of: <book><appendix><sect1><para> +#: ../en/appA-svn.xml:66 +msgid "" +"The <literal>convert</literal> extension operates incrementally. In other " +"words, after you have run <command>hg convert</command> once, running it " +"again will import any new revisions committed after the first run began. " +"Incremental conversion will only work if you run <command>hg convert</" +"command> in the same Mercurial repository that you originally used, because " +"the <literal>convert</literal> extension saves some private metadata in a non-" +"revision-controlled file named <filename>.hg/shamap</filename> inside the " +"target repository." +msgstr "" + +#. type: Content of: <book><appendix><sect1><para> +#: ../en/appA-svn.xml:78 +msgid "" +"When you want to start making changes using Mercurial, it's best to clone the " +"tree in which you are doing your conversions, and leave the original tree for " +"future incremental conversions. This is the safest way to let you pull and " +"merge future commits from the source revision control system into your newly " +"active Mercurial project." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><title> +#: ../en/appA-svn.xml:86 +msgid "Converting multiple branches" +msgstr "转换多个分支" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appA-svn.xml:88 +msgid "" +"The <command>hg convert</command> command given above converts only the " +"history of the <literal>trunk</literal> branch of the Subversion repository. " +"If we instead use the URL <literal>http://python-nose.googlecode.com/svn</" +"literal>, Mercurial will automatically detect the <literal>trunk</literal>, " +"<literal>tags</literal> and <literal>branches</literal> layout that " +"Subversion projects usually use, and it will import each as a separate " +"Mercurial branch." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appA-svn.xml:98 +msgid "" +"By default, each Subversion branch imported into Mercurial is given a branch " +"name. After the conversion completes, you can get a list of the active " +"branch names in the Mercurial repository using <command>hg branches -a</" +"command>. If you would prefer to import the Subversion branches without " +"names, pass the <option>--config convert.hg.usebranchnames=false</option> " +"option to <command>hg convert</command>." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appA-svn.xml:107 +msgid "" +"Once you have converted your tree, if you want to follow the usual Mercurial " +"practice of working in a tree that contains a single branch, you can clone " +"that single branch using <command>hg clone -r mybranchname</command>." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><title> +#: ../en/appA-svn.xml:114 +msgid "Mapping user names" +msgstr "映射用户名称" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appA-svn.xml:116 +msgid "" +"Some revision control tools save only short usernames with commits, and these " +"can be difficult to interpret. The norm with Mercurial is to save a " +"committer's name and email address, which is much more useful for talking to " +"them after the fact." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appA-svn.xml:122 +msgid "" +"If you are converting a tree from a revision control system that uses short " +"names, you can map those names to longer equivalents by passing a <option>--" +"authors</option> option to <command>hg convert</command>. This option " +"accepts a file name that should contain entries of the following form." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appA-svn.xml:132 +msgid "" +"Whenever <literal>convert</literal> encounters a commit with the username " +"<literal>arist</literal> in the source repository, it will use the name " +"<literal>Aristotle <aristotle@phil.example.gr></literal> in the " +"converted Mercurial revision. If no match is found for a name, it is used " +"verbatim." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><title> +#: ../en/appA-svn.xml:141 +msgid "Tidying up the tree" +msgstr "清理目录树" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appA-svn.xml:143 +msgid "" +"Not all projects have pristine history. There may be a directory that should " +"never have been checked in, a file that is too big, or a whole hierarchy that " +"needs to be refactored." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appA-svn.xml:148 +msgid "" +"The <literal>convert</literal> extension supports the idea of a <quote>file " +"map</quote> that can reorganize the files and directories in a project as it " +"imports the project's history. This is useful not only when importing " +"history from other revision control systems, but also to prune or refactor a " +"Mercurial tree." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appA-svn.xml:155 +msgid "" +"To specify a file map, use the <option>--filemap</option> option and supply a " +"file name. A file map contains lines of the following forms." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appA-svn.xml:169 +msgid "" +"The <literal>include</literal> directive causes a file, or all files under a " +"directory, to be included in the destination repository. This also excludes " +"all other files and dirs not explicitely included. The <literal>exclude</" +"literal> directive causes files or directories to be omitted, and others not " +"explicitly mentioned to be included." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appA-svn.xml:176 +msgid "" +"To move a file or directory from one location to another, use the " +"<literal>rename</literal> directive. If you need to move a file or directory " +"from a subdirectory into the root of the repository, use <literal>.</literal> " +"as the second argument to the <literal>rename</literal> directive." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><title> +#: ../en/appA-svn.xml:184 +msgid "Improving Subversion conversion performance" +msgstr "改进 Subversion 的转换性能" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appA-svn.xml:186 +msgid "" +"You will often need several attempts before you hit the perfect combination " +"of user map, file map, and other conversion parameters. Converting a " +"Subversion repository over an access protocol like <literal>ssh</literal> or " +"<literal>http</literal> can proceed thousands of times more slowly than " +"Mercurial is capable of actually operating, due to network delays. This can " +"make tuning that perfect conversion recipe very painful." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appA-svn.xml:195 +msgid "" +"The <ulink url=\"http://svn.collab.net/repos/svn/trunk/notes/svnsync.txt" +"\"><command>svnsync</command></ulink> command can greatly speed up the " +"conversion of a Subversion repository. It is a read-only mirroring program " +"for Subversion repositories. The idea is that you create a local mirror of " +"your Subversion tree, then convert the mirror into a Mercurial repository." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appA-svn.xml:203 +msgid "" +"Suppose we want to convert the Subversion repository for the popular " +"Memcached project into a Mercurial tree. First, we create a local Subversion " +"repository." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><screen><userinput> +#: ../en/appA-svn.xml:207 +msgid "svnadmin create memcached-mirror" +msgstr "svnadmin create memcached-mirror" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appA-svn.xml:209 +msgid "Next, we set up a Subversion hook that <command>svnsync</command> needs." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><screen><userinput> +#: ../en/appA-svn.xml:212 +msgid "echo '#!/bin/sh' > memcached-mirror/hooks/pre-revprop-change" +msgstr "echo '#!/bin/sh' > memcached-mirror/hooks/pre-revprop-change" + +#. type: Content of: <book><appendix><sect1><sect2><screen><userinput> +#: ../en/appA-svn.xml:213 +msgid "chmod +x memcached-mirror/hooks/pre-revprop-change" +msgstr "chmod +x memcached-mirror/hooks/pre-revprop-change" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appA-svn.xml:215 +msgid "We then initialize <command>svnsync</command> in this repository." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><screen><userinput> +#: ../en/appA-svn.xml:218 +msgid "" +"svnsync --init file://`pwd`/memcached-mirror \\ http://code.sixapart.com/svn/" +"memcached" +msgstr "" +"svnsync --init file://`pwd`/memcached-mirror \\ http://code.sixapart.com/svn/" +"memcached" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appA-svn.xml:221 +msgid "" +"Our next step is to begin the <command>svnsync</command> mirroring process." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><screen><userinput> +#: ../en/appA-svn.xml:224 +msgid "svnsync sync file://`pwd`/memcached-mirror" +msgstr "svnsync sync file://`pwd`/memcached-mirror" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appA-svn.xml:226 +msgid "" +"Finally, we import the history of our local Subversion mirror into Mercurial." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><screen><userinput> +#: ../en/appA-svn.xml:229 +msgid "hg convert memcached-mirror" +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appA-svn.xml:231 +msgid "" +"We can use this process incrementally if the Subversion repository is still " +"in use. We run <command>svnsync</command> to pull new changes into our " +"mirror, then <command>hg convert</command> to import them into our Mercurial " +"tree." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appA-svn.xml:237 +msgid "" +"There are two advantages to doing a two-stage import with <command>svnsync</" +"command>. The first is that it uses more efficient Subversion network " +"syncing code than <command>hg convert</command>, so it transfers less data " +"over the network. The second is that the import from a local Subversion tree " +"is so fast that you can tweak your conversion setup repeatedly without having " +"to sit through a painfully slow network-based conversion process each time." +msgstr "" + +#. type: Content of: <book><appendix><sect1><title> +#: ../en/appA-svn.xml:249 +msgid "Migrating from Subversion" +msgstr "从 Subversion 迁移" + +#. type: Content of: <book><appendix><sect1><para> +#: ../en/appA-svn.xml:251 +msgid "" +"Subversion is currently the most popular open source revision control system. " +"Although there are many differences between Mercurial and Subversion, making " +"the transition from Subversion to Mercurial is not particularly difficult. " +"The two have similar command sets and generally uniform interfaces." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><title> +#: ../en/appA-svn.xml:259 +msgid "Philosophical differences" +msgstr "哲学的差别" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appA-svn.xml:261 +msgid "" +"The fundamental difference between Subversion and Mercurial is of course that " +"Subversion is centralized, while Mercurial is distributed. Since Mercurial " +"stores all of a project's history on your local drive, it only needs to " +"perform a network access when you want to explicitly communicate with another " +"repository. In contrast, Subversion stores very little information locally, " +"and the client must thus contact its server for many common operations." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appA-svn.xml:270 +msgid "" +"Subversion more or less gets away without a well-defined notion of a branch: " +"which portion of a server's namespace qualifies as a branch is a matter of " +"convention, with the software providing no enforcement. Mercurial treats a " +"repository as the unit of branch management." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><sect3><title> +#: ../en/appA-svn.xml:277 +msgid "Scope of commands" +msgstr "命令作用域" + +#. type: Content of: <book><appendix><sect1><sect2><sect3><para> +#: ../en/appA-svn.xml:279 +msgid "" +"Since Subversion doesn't know what parts of its namespace are really " +"branches, it treats most commands as requests to operate at and below " +"whatever directory you are currently visiting. For instance, if you run " +"<command>svn log</command>, you'll get the history of whatever part of the " +"tree you're looking at, not the tree as a whole." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><sect3><para> +#: ../en/appA-svn.xml:286 +msgid "" +"Mercurial's commands behave differently, by defaulting to operating over an " +"entire repository. Run <command>hg log</command> and it will tell you the " +"history of the entire tree, no matter what part of the working directory " +"you're visiting at the time. If you want the history of just a particular " +"file or directory, simply supply it by name, e.g. <command>hg log src</" +"command>." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><sect3><para> +#: ../en/appA-svn.xml:294 +msgid "" +"From my own experience, this difference in default behaviors is probably the " +"most likely to trip you up if you have to switch back and forth frequently " +"between the two tools." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><sect3><title> +#: ../en/appA-svn.xml:301 +msgid "Multi-user operation and safety" +msgstr "多用户操作与安全" + +#. type: Content of: <book><appendix><sect1><sect2><sect3><para> +#: ../en/appA-svn.xml:303 +msgid "" +"With Subversion, it is normal (though slightly frowned upon) for multiple " +"people to collaborate in a single branch. If Alice and Bob are working " +"together, and Alice commits some changes to their shared branch, Bob must " +"update his client's view of the branch before he can commit. Since at this " +"time he has no permanent record of the changes he has made, he can corrupt or " +"lose his modifications during and after his update." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><sect3><para> +#: ../en/appA-svn.xml:312 +msgid "" +"Mercurial encourages a commit-then-merge model instead. Bob commits his " +"changes locally before pulling changes from, or pushing them to, the server " +"that he shares with Alice. If Alice pushed her changes before Bob tries to " +"push his, he will not be able to push his changes until he pulls hers, merges " +"with them, and commits the result of the merge. If he makes a mistake during " +"the merge, he still has the option of reverting to the commit that recorded " +"his changes." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><sect3><para> +#: ../en/appA-svn.xml:321 +msgid "" +"It is worth emphasizing that these are the common ways of working with these " +"tools. Subversion supports a safer work-in-your-own-branch model, but it is " +"cumbersome enough in practice to not be widely used. Mercurial can support " +"the less safe mode of allowing changes to be pulled in and merged on top of " +"uncommitted edits, but this is considered highly unusual." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><sect3><title> +#: ../en/appA-svn.xml:331 +msgid "Published vs local changes" +msgstr "已发布的修改与本地修改" + +#. type: Content of: <book><appendix><sect1><sect2><sect3><para> +#: ../en/appA-svn.xml:333 +msgid "" +"A Subversion <command>svn commit</command> command immediately publishes " +"changes to a server, where they can be seen by everyone who has read access." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><sect3><para> +#: ../en/appA-svn.xml:337 +msgid "" +"With Mercurial, commits are always local, and must be published via a " +"<command>hg push</command> command afterwards." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><sect3><para> +#: ../en/appA-svn.xml:341 +msgid "" +"Each approach has its advantages and disadvantages. The Subversion model " +"means that changes are published, and hence reviewable and usable, " +"immediately. On the other hand, this means that a user must have commit " +"access to a repository in order to use the software in a normal way, and " +"commit access is not lightly given out by most open source projects." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><sect3><para> +#: ../en/appA-svn.xml:349 +msgid "" +"The Mercurial approach allows anyone who can clone a repository to commit " +"changes without the need for someone else's permission, and they can then " +"publish their changes and continue to participate however they see fit. The " +"distinction between committing and pushing does open up the possibility of " +"someone committing changes to their laptop and walking away for a few days " +"having forgotten to push them, which in rare cases might leave collaborators " +"temporarily stuck." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><title> +#: ../en/appA-svn.xml:362 +msgid "Quick reference" +msgstr "快速参考" + +#. type: Content of: <book><appendix><sect1><sect2><table><title> +#: ../en/appA-svn.xml:365 +msgid "Subversion commands and Mercurial equivalents" +msgstr "Subversion 命令与 Mercurial 对照表" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><thead><row><entry> +#: ../en/appA-svn.xml:371 +msgid "Notes" +msgstr "备注" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:376 +msgid "<command>svn add</command>" +msgstr "<command>svn add</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:377 +msgid "<command>hg add</command>" +msgstr "<command>hg add</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:381 +msgid "<command>svn blame</command>" +msgstr "<command>svn blame</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:382 +msgid "<command>hg annotate</command>" +msgstr "<command>hg annotate</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:386 +msgid "<command>svn cat</command>" +msgstr "<command>svn cat</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:387 +msgid "<command>hg cat</command>" +msgstr "<command>hg cat</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:391 +msgid "<command>svn checkout</command>" +msgstr "<command>svn checkout</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:392 ../en/appA-svn.xml:409 +msgid "<command>hg clone</command>" +msgstr "<command>hg clone</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:396 +msgid "<command>svn cleanup</command>" +msgstr "<command>svn cleanup</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:397 ../en/appA-svn.xml:472 +msgid "n/a" +msgstr "n/a" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:398 +msgid "No cleanup needed" +msgstr "不需要清理" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:401 +msgid "<command>svn commit</command>" +msgstr "<command>svn commit</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:402 +msgid "<command>hg commit</command>; <command>hg push</command>" +msgstr "<command>hg commit</command>; <command>hg push</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:404 +msgid "<command>hg push</command> publishes after commit" +msgstr "提交后使用 <command>hg push</command> 发布" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:408 ../en/appA-svn.xml:413 +msgid "<command>svn copy</command>" +msgstr "<command>svn copy</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:410 +msgid "To create a new branch" +msgstr "创建新补丁" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:414 +msgid "<command>hg copy</command>" +msgstr "<command>hg copy</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:415 +msgid "To copy files or directories" +msgstr "复制文件或目录" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:418 +msgid "<command>svn delete</command> (<command>svn remove</command>)" +msgstr "<command>svn delete</command> (<command>svn remove</command>)" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:420 +msgid "<command>hg remove</command>" +msgstr "<command>hg remove</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:424 +msgid "<command>svn diff</command>" +msgstr "<command>svn diff</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:425 +msgid "<command>hg diff</command>" +msgstr "<command>hg diff</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:429 +msgid "<command>svn export</command>" +msgstr "<command>svn export</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:430 +msgid "<command>hg archive</command>" +msgstr "<command>hg archive</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:434 +msgid "<command>svn help</command>" +msgstr "<command>svn help</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:435 +msgid "<command>hg help</command>" +msgstr "<command>hg help</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:439 +msgid "<command>svn import</command>" +msgstr "<command>svn import</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:440 +msgid "<command>hg addremove</command>; <command>hg commit</command>" +msgstr "<command>hg addremove</command>; <command>hg commit</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:445 ../en/appA-svn.xml:450 +msgid "<command>svn info</command>" +msgstr "<command>svn info</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:446 +msgid "<command>hg parents</command>" +msgstr "<command>hg parents</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:447 +msgid "Shows what revision is checked out" +msgstr "显示检出的版本信息" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:451 +msgid "<command>hg showconfig paths.parent</command>" +msgstr "<command>hg showconfig paths.parent</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:453 +msgid "Shows what URL is checked out" +msgstr "显示检出的 URL" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:456 +msgid "<command>svn list</command>" +msgstr "<command>svn list</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:457 +msgid "<command>hg manifest</command>" +msgstr "<command>hg manifest</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:461 +msgid "<command>svn log</command>" +msgstr "<command>svn log</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:462 +msgid "<command>hg log</command>" +msgstr "<command>hg log</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:466 +msgid "<command>svn merge</command>" +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:467 +msgid "<command>hg merge</command>" +msgstr "<command>hg merge</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:471 +msgid "<command>svn mkdir</command>" +msgstr "<command>svn mkdir</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:473 +msgid "Mercurial does not track directories" +msgstr "Mercurial 不跟踪目录" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:476 +msgid "<command>svn move</command> (<command>svn rename</command>)" +msgstr "<command>svn move</command> (<command>svn rename</command>)" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:478 +msgid "<command>hg rename</command>" +msgstr "<command>hg rename</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:482 +msgid "<command>svn resolved</command>" +msgstr "<command>svn resolved</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:483 +msgid "<command>hg resolve -m</command>" +msgstr "<command>hg resolve -m</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:487 +msgid "<command>svn revert</command>" +msgstr "<command>svn revert</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:488 +msgid "<command>hg revert</command>" +msgstr "<command>hg revert</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:492 +msgid "<command>svn status</command>" +msgstr "<command>svn status</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:493 +msgid "<command>hg status</command>" +msgstr "<command>hg status</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:497 +msgid "<command>svn update</command>" +msgstr "<command>svn update</command>" + +#. type: Content of: <book><appendix><sect1><sect2><table><tgroup><tbody><row><entry> +#: ../en/appA-svn.xml:498 +msgid "<command>hg pull -u</command>" +msgstr "<command>hg pull -u</command>" + +#. type: Content of: <book><appendix><sect1><title> +#: ../en/appA-svn.xml:508 +msgid "Useful tips for newcomers" +msgstr "新手需要了解的技巧" + +#. type: Content of: <book><appendix><sect1><para> +#: ../en/appA-svn.xml:510 +msgid "" +"Under some revision control systems, printing a diff for a single committed " +"revision can be painful. For instance, with Subversion, to see what changed " +"in revision 104654, you must type <command>svn diff -r104653:104654</" +"command>. Mercurial eliminates the need to type the revision ID twice in this " +"common case. For a plain diff, <command>hg export 104654</command>. For a log " +"message followed by a diff, <command>hg log -r104654 -p</command>." +msgstr "" + +#. type: Content of: <book><appendix><sect1><para> +#: ../en/appA-svn.xml:519 +msgid "" +"When you run <command>hg status</command> without any arguments, it prints " +"the status of the entire tree, with paths relative to the root of the " +"repository. This makes it tricky to copy a file name from the output of " +"<command>hg status</command> into the command line. If you supply a file or " +"directory name to <command>hg status</command>, it will print paths relative " +"to your current location instead. So to get tree-wide status from " +"<command>hg status</command>, with paths that are relative to your current " +"directory and not the root of the repository, feed the output of <command>hg " +"root</command> into <command>hg status</command>. You can easily do this as " +"follows on a Unix-like system:" +msgstr "" + +#. type: Content of: <book><appendix><sect1><screen><userinput> +#: ../en/appA-svn.xml:532 +msgid "hg status `hg root`" +msgstr "hg status `hg root`" + +#. type: Content of: <book><appendix><title> #: ../en/appB-mq-ref.xml:5 msgid "Mercurial Queues reference" msgstr "Mercurial 队列参考" @@ -167,10 +986,10 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:57 ../en/appB-mq-ref.xml:99 ../en/appB-mq-ref.xml:157 -#: ../en/appB-mq-ref.xml:197 ../en/appB-mq-ref.xml:264 -#: ../en/appB-mq-ref.xml:335 ../en/appB-mq-ref.xml:404 -#: ../en/appB-mq-ref.xml:497 +#: ../en/appB-mq-ref.xml:57 ../en/appB-mq-ref.xml:109 ../en/appB-mq-ref.xml:167 +#: ../en/appB-mq-ref.xml:207 ../en/appB-mq-ref.xml:274 +#: ../en/appB-mq-ref.xml:345 ../en/appB-mq-ref.xml:414 +#: ../en/appB-mq-ref.xml:492 msgid "Options:" msgstr "选项:" @@ -198,6 +1017,22 @@ #. type: Content of: <book><appendix><sect1><sect2><title> #: ../en/appB-mq-ref.xml:75 msgid "" +"<command role=\"hg-ext-mq\">qfold</command>&emdash;move applied patches into " +"repository history" +msgstr "" +"<command role=\"hg-ext-mq\">qfold</command>&emdash;将已应用的补丁提交到版本库" + +#. type: Content of: <book><appendix><sect1><sect2><para> +#: ../en/appB-mq-ref.xml:78 +msgid "" +"The <command>hg qfinish</command> command converts the specified applied " +"patches into permanent changes by moving them out of MQ's control so that " +"they will be treated as normal repository history." +msgstr "" + +#. type: Content of: <book><appendix><sect1><sect2><title> +#: ../en/appB-mq-ref.xml:85 +msgid "" "<command role=\"hg-ext-mq\">qfold</command>&emdash;merge (<quote>fold</" "quote>) several patches into one" msgstr "" @@ -205,7 +1040,7 @@ "quote>)成一个" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:78 +#: ../en/appB-mq-ref.xml:88 msgid "" "The <command role=\"hg-ext-mq\">qfold</command> command merges multiple " "patches into the topmost applied patch, so that the topmost applied patch " @@ -213,7 +1048,7 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:83 +#: ../en/appB-mq-ref.xml:93 msgid "" "The patches to fold must not be applied; <command role=\"hg-ext-mq\">qfold</" "command> will exit with an error if any is. The order in which patches are " @@ -223,7 +1058,7 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:91 +#: ../en/appB-mq-ref.xml:101 msgid "" "The comments from the folded patches are appended to the comments of the " "destination patch, with each block of comments separated by three asterisk " @@ -233,14 +1068,14 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:101 +#: ../en/appB-mq-ref.xml:111 msgid "" "<option role=\"hg-ext-mq-cmd-qfold-opt\">-e</option>: Edit the commit message " "and patch description for the newly folded patch." msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:106 +#: ../en/appB-mq-ref.xml:116 msgid "" "<option role=\"hg-ext-mq-cmd-qfold-opt\">-l</option>: Use the contents of the " "given file as the new commit message and patch description for the folded " @@ -248,21 +1083,21 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:111 +#: ../en/appB-mq-ref.xml:121 msgid "" "<option role=\"hg-ext-mq-cmd-qfold-opt\">-m</option>: Use the given text as " "the new commit message and patch description for the folded patch." msgstr "" #. type: Content of: <book><appendix><sect1><sect2><title> -#: ../en/appB-mq-ref.xml:119 +#: ../en/appB-mq-ref.xml:129 msgid "" "<command role=\"hg-ext-mq\">qheader</command>&emdash;display the header/" "description of a patch" msgstr "<command role=\"hg-ext-mq\">qheader</command>—显示补丁头部描述" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:123 +#: ../en/appB-mq-ref.xml:133 msgid "" "The <command role=\"hg-ext-mq\">qheader</command> command prints the header, " "or description, of a patch. By default, it prints the header of the topmost " @@ -270,14 +1105,14 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><title> -#: ../en/appB-mq-ref.xml:130 +#: ../en/appB-mq-ref.xml:140 msgid "" "<command role=\"hg-ext-mq\">qimport</command>&emdash;import a third-party " "patch into the queue" msgstr "<command role=\"hg-ext-mq\">qimport</command>—将第三方补丁导入队列" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:133 +#: ../en/appB-mq-ref.xml:143 msgid "" "The <command role=\"hg-ext-mq\">qimport</command> command adds an entry for " "an external patch to the <filename role=\"special\">series</filename> file, " @@ -287,7 +1122,7 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:141 +#: ../en/appB-mq-ref.xml:151 msgid "" "If the <filename role=\"special\" class=\"directory\">.hg/patches</filename> " "directory is a repository, <command role=\"hg-ext-mq\">qimport</command> " @@ -296,14 +1131,14 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><title> -#: ../en/appB-mq-ref.xml:149 +#: ../en/appB-mq-ref.xml:159 msgid "" "<command role=\"hg-ext-mq\">qinit</command>&emdash;prepare a repository to " "work with MQ" msgstr "<command role=\"hg-ext-mq\">qinit</command>—为使用 MQ 配置版本库" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:152 +#: ../en/appB-mq-ref.xml:162 msgid "" "The <command role=\"hg-ext-mq\">qinit</command> command prepares a repository " "to work with MQ. It creates a directory called <filename role=\"special\" " @@ -311,7 +1146,7 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:159 +#: ../en/appB-mq-ref.xml:169 msgid "" "<option role=\"hg-ext-mq-cmd-qinit-opt\">-c</option>: Create <filename role=" "\"special\" class=\"directory\">.hg/patches</filename> as a repository in its " @@ -320,7 +1155,7 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:169 +#: ../en/appB-mq-ref.xml:179 msgid "" "When the <filename role=\"special\" class=\"directory\">.hg/patches</" "filename> directory is a repository, the <command role=\"hg-ext-mq\">qimport</" @@ -329,12 +1164,12 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><title> -#: ../en/appB-mq-ref.xml:178 +#: ../en/appB-mq-ref.xml:188 msgid "<command role=\"hg-ext-mq\">qnew</command>&emdash;create a new patch" msgstr "<command role=\"hg-ext-mq\">qnew</command>—创建新补丁" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:181 +#: ../en/appB-mq-ref.xml:191 msgid "" "The <command role=\"hg-ext-mq\">qnew</command> command creates a new patch. " "It takes one mandatory argument, the name to use for the patch file. The " @@ -344,17 +1179,17 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:189 +#: ../en/appB-mq-ref.xml:199 msgid "" "If <command role=\"hg-ext-mq\">qnew</command> finds modified files in the " "working directory, it will refuse to create a new patch unless the <option " "role=\"hg-ext-mq-cmd-qnew-opt\">-f</option> option is used (see below). This " -"behaviour allows you to <command role=\"hg-ext-mq\">qrefresh</command> your " +"behavior allows you to <command role=\"hg-ext-mq\">qrefresh</command> your " "topmost applied patch before you apply a new patch on top of it." msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:199 +#: ../en/appB-mq-ref.xml:209 msgid "" "<option role=\"hg-ext-mq-cmd-qnew-opt\">-f</option>: Create a new patch if " "the contents of the working directory are modified. Any outstanding " @@ -363,7 +1198,7 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:206 +#: ../en/appB-mq-ref.xml:216 msgid "" "<option role=\"hg-ext-mq-cmd-qnew-opt\">-m</option>: Use the given text as " "the commit message. This text will be stored at the beginning of the patch " @@ -371,14 +1206,14 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><title> -#: ../en/appB-mq-ref.xml:215 +#: ../en/appB-mq-ref.xml:225 msgid "" "<command role=\"hg-ext-mq\">qnext</command>&emdash;print the name of the next " "patch" msgstr "<command role=\"hg-ext-mq\">qnext</command>—显示下个补丁的名称" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:218 +#: ../en/appB-mq-ref.xml:228 msgid "" "The <command role=\"hg-ext-mq\">qnext</command> command prints the name name " "of the next patch in the <filename role=\"special\">series</filename> file " @@ -387,13 +1222,13 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><title> -#: ../en/appB-mq-ref.xml:227 +#: ../en/appB-mq-ref.xml:237 msgid "" "<command role=\"hg-ext-mq\">qpop</command>&emdash;pop patches off the stack" msgstr "<command role=\"hg-ext-mq\">qpop</command>—删除堆栈顶部的补丁" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:230 +#: ../en/appB-mq-ref.xml:240 msgid "" "The <command role=\"hg-ext-mq\">qpop</command> command removes applied " "patches from the top of the stack of applied patches. By default, it removes " @@ -401,7 +1236,7 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:234 +#: ../en/appB-mq-ref.xml:244 msgid "" "This command removes the changesets that represent the popped patches from " "the repository, and updates the working directory to undo the effects of the " @@ -409,7 +1244,7 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:238 +#: ../en/appB-mq-ref.xml:248 msgid "" "This command takes an optional argument, which it uses as the name or index " "of the patch to pop to. If given a name, it will pop patches until the named " @@ -421,7 +1256,7 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:248 +#: ../en/appB-mq-ref.xml:258 msgid "" "The <command role=\"hg-ext-mq\">qpop</command> command does not read or write " "patches or the <filename role=\"special\">series</filename> file. It is thus " @@ -432,16 +1267,16 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:257 +#: ../en/appB-mq-ref.xml:267 msgid "" "By default, the <command role=\"hg-ext-mq\">qpop</command> command will not " "pop any patches if the working directory has been modified. You can override " -"this behaviour using the <option role=\"hg-ext-mq-cmd-qpop-opt\">-f</option> " +"this behavior using the <option role=\"hg-ext-mq-cmd-qpop-opt\">-f</option> " "option, which reverts all modifications in the working directory." msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:266 +#: ../en/appB-mq-ref.xml:276 msgid "" "<option role=\"hg-ext-mq-cmd-qpop-opt\">-a</option>: Pop all applied " "patches. This returns the repository to its state before you applied any " @@ -449,21 +1284,21 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:271 +#: ../en/appB-mq-ref.xml:281 msgid "" "<option role=\"hg-ext-mq-cmd-qpop-opt\">-f</option>: Forcibly revert any " "modifications to the working directory when popping." msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:276 +#: ../en/appB-mq-ref.xml:286 msgid "" "<option role=\"hg-ext-mq-cmd-qpop-opt\">-n</option>: Pop a patch from the " "named queue." msgstr "" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:281 +#: ../en/appB-mq-ref.xml:291 msgid "" "The <command role=\"hg-ext-mq\">qpop</command> command removes one line from " "the end of the <filename role=\"special\">status</filename> file for each " @@ -471,14 +1306,14 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><title> -#: ../en/appB-mq-ref.xml:288 +#: ../en/appB-mq-ref.xml:298 msgid "" "<command role=\"hg-ext-mq\">qprev</command>&emdash;print the name of the " "previous patch" msgstr "<command role=\"hg-ext-mq\">qprev</command>—显示上个补丁的名称" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:291 +#: ../en/appB-mq-ref.xml:301 msgid "" "The <command role=\"hg-ext-mq\">qprev</command> command prints the name of " "the patch in the <filename role=\"special\">series</filename> file that comes " @@ -487,32 +1322,32 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><title> -#: ../en/appB-mq-ref.xml:300 +#: ../en/appB-mq-ref.xml:310 msgid "" "<command role=\"hg-ext-mq\">qpush</command>&emdash;push patches onto the stack" msgstr "<command role=\"hg-ext-mq\">qpush</command>—增加补丁到堆栈" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:303 +#: ../en/appB-mq-ref.xml:313 msgid "" "The <command role=\"hg-ext-mq\">qpush</command> command adds patches onto the " "applied stack. By default, it adds only one patch." msgstr "" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:307 +#: ../en/appB-mq-ref.xml:317 msgid "" "This command creates a new changeset to represent each applied patch, and " "updates the working directory to apply the effects of the patches." msgstr "" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:311 +#: ../en/appB-mq-ref.xml:321 msgid "The default data used when creating a changeset are as follows:" msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:314 +#: ../en/appB-mq-ref.xml:324 msgid "" "The commit date and time zone are the current date and time zone. Because " "these data are used to compute the identity of a changeset, this means that " @@ -522,14 +1357,14 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:322 +#: ../en/appB-mq-ref.xml:332 msgid "" "The author is the same as the default used by the <command role=\"hg-cmd\">hg " "commit</command> command." msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:326 +#: ../en/appB-mq-ref.xml:336 msgid "" "The commit message is any text from the patch file that comes before the " "first diff header. If there is no such text, a default commit message is " @@ -537,14 +1372,14 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:331 -msgid "" -"If a patch contains a Mercurial patch header (XXX add link), the information " -"in the patch header overrides these defaults." +#: ../en/appB-mq-ref.xml:341 +msgid "" +"If a patch contains a Mercurial patch header, the information in the patch " +"header overrides these defaults." msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:337 +#: ../en/appB-mq-ref.xml:347 msgid "" "<option role=\"hg-ext-mq-cmd-qpush-opt\">-a</option>: Push all unapplied " "patches from the <filename role=\"special\">series</filename> file until " @@ -552,14 +1387,14 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:343 +#: ../en/appB-mq-ref.xml:353 msgid "" "<option role=\"hg-ext-mq-cmd-qpush-opt\">-l</option>: Add the name of the " "patch to the end of the commit message." msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:347 +#: ../en/appB-mq-ref.xml:357 msgid "" "<option role=\"hg-ext-mq-cmd-qpush-opt\">-m</option>: If a patch fails to " "apply cleanly, use the entry for the patch in another saved queue to compute " @@ -569,14 +1404,14 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:355 +#: ../en/appB-mq-ref.xml:365 msgid "" "<option role=\"hg-ext-mq-cmd-qpush-opt\">-n</option>: Use the named queue if " "merging while pushing." msgstr "" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:360 +#: ../en/appB-mq-ref.xml:370 msgid "" "The <command role=\"hg-ext-mq\">qpush</command> command reads, but does not " "modify, the <filename role=\"special\">series</filename> file. It appends " @@ -585,14 +1420,14 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><title> -#: ../en/appB-mq-ref.xml:368 +#: ../en/appB-mq-ref.xml:378 msgid "" "<command role=\"hg-ext-mq\">qrefresh</command>&emdash;update the topmost " "applied patch" msgstr "<command role=\"hg-ext-mq\">qrefresh</command>—更新最新的补丁" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:372 +#: ../en/appB-mq-ref.xml:382 msgid "" "The <command role=\"hg-ext-mq\">qrefresh</command> command updates the " "topmost applied patch. It modifies the patch, removes the old changeset that " @@ -601,28 +1436,28 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:378 +#: ../en/appB-mq-ref.xml:388 msgid "" "The <command role=\"hg-ext-mq\">qrefresh</command> command looks for the " "following modifications:" msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:381 +#: ../en/appB-mq-ref.xml:391 msgid "" "Changes to the commit message, i.e. the text before the first diff header in " "the patch file, are reflected in the new changeset that represents the patch." msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:386 +#: ../en/appB-mq-ref.xml:396 msgid "" "Modifications to tracked files in the working directory are added to the " "patch." msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:389 +#: ../en/appB-mq-ref.xml:399 msgid "" "Changes to the files tracked using <command role=\"hg-cmd\">hg add</command>, " "<command role=\"hg-cmd\">hg copy</command>, <command role=\"hg-cmd\">hg " @@ -632,7 +1467,7 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:398 +#: ../en/appB-mq-ref.xml:408 msgid "" "Even if <command role=\"hg-ext-mq\">qrefresh</command> detects no changes, it " "still recreates the changeset that represents the patch. This causes the " @@ -641,33 +1476,33 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:406 +#: ../en/appB-mq-ref.xml:416 msgid "" "<option role=\"hg-ext-mq-cmd-qrefresh-opt\">-e</option>: Modify the commit " "and patch description, using the preferred text editor." msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:411 +#: ../en/appB-mq-ref.xml:421 msgid "" "<option role=\"hg-ext-mq-cmd-qrefresh-opt\">-m</option>: Modify the commit " "message and patch description, using the given text." msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:416 +#: ../en/appB-mq-ref.xml:426 msgid "" "<option role=\"hg-ext-mq-cmd-qrefresh-opt\">-l</option>: Modify the commit " "message and patch description, using text from the given file." msgstr "" #. type: Content of: <book><appendix><sect1><sect2><title> -#: ../en/appB-mq-ref.xml:424 +#: ../en/appB-mq-ref.xml:434 msgid "<command role=\"hg-ext-mq\">qrename</command>&emdash;rename a patch" msgstr "<command role=\"hg-ext-mq\">qrename</command>—改名补丁" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:427 +#: ../en/appB-mq-ref.xml:437 msgid "" "The <command role=\"hg-ext-mq\">qrename</command> command renames a patch, " "and changes the entry for the patch in the <filename role=\"special\">series</" @@ -675,7 +1510,7 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:431 +#: ../en/appB-mq-ref.xml:441 msgid "" "With a single argument, <command role=\"hg-ext-mq\">qrename</command> renames " "the topmost applied patch. With two arguments, it renames its first argument " @@ -683,37 +1518,14 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><title> -#: ../en/appB-mq-ref.xml:438 -msgid "" -"<command role=\"hg-ext-mq\">qrestore</command>&emdash;restore saved queue " -"state" -msgstr "<command role=\"hg-ext-mq\">qrestore</command>—恢复保存的队列" - -#. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:442 -msgid "XXX No idea what this does." -msgstr "" - -#. type: Content of: <book><appendix><sect1><sect2><title> -#: ../en/appB-mq-ref.xml:446 -msgid "" -"<command role=\"hg-ext-mq\">qsave</command>&emdash;save current queue state" -msgstr "<command role=\"hg-ext-mq\">qsave</command>—保存当前的队列状态" - -#. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:449 -msgid "XXX Likewise." -msgstr "" - -#. type: Content of: <book><appendix><sect1><sect2><title> -#: ../en/appB-mq-ref.xml:453 +#: ../en/appB-mq-ref.xml:448 msgid "" "<command role=\"hg-ext-mq\">qseries</command>&emdash;print the entire patch " "series" msgstr "<command role=\"hg-ext-mq\">qseries</command>—显示补丁序列" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:456 +#: ../en/appB-mq-ref.xml:451 msgid "" "The <command role=\"hg-ext-mq\">qseries</command> command prints the entire " "patch series from the <filename role=\"special\">series</filename> file. It " @@ -722,28 +1534,28 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><title> -#: ../en/appB-mq-ref.xml:464 +#: ../en/appB-mq-ref.xml:459 msgid "" "<command role=\"hg-ext-mq\">qtop</command>&emdash;print the name of the " "current patch" msgstr "<command role=\"hg-ext-mq\">qtop</command>—显示当前补丁的名称" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:467 +#: ../en/appB-mq-ref.xml:462 msgid "" "The <command role=\"hg-ext-mq\">qtop</command> prints the name of the topmost " "currently applied patch." msgstr "" #. type: Content of: <book><appendix><sect1><sect2><title> -#: ../en/appB-mq-ref.xml:472 +#: ../en/appB-mq-ref.xml:467 msgid "" "<command role=\"hg-ext-mq\">qunapplied</command>&emdash;print patches not yet " "applied" msgstr "<command role=\"hg-ext-mq\">qunapplied</command>—显示尚未应用的补丁" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:476 +#: ../en/appB-mq-ref.xml:471 msgid "" "The <command role=\"hg-ext-mq\">qunapplied</command> command prints the names " "of patches from the <filename role=\"special\">series</filename> file that " @@ -752,14 +1564,14 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><title> -#: ../en/appB-mq-ref.xml:484 +#: ../en/appB-mq-ref.xml:479 msgid "" "<command role=\"hg-cmd\">hg strip</command>&emdash;remove a revision and " "descendants" msgstr "<command role=\"hg-cmd\">hg strip</command>—删除一个版本及其后继" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:487 +#: ../en/appB-mq-ref.xml:482 msgid "" "The <command role=\"hg-cmd\">hg strip</command> command removes a revision, " "and all of its descendants, from the repository. It undoes the effects of " @@ -768,7 +1580,7 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:493 +#: ../en/appB-mq-ref.xml:488 msgid "" "The <command role=\"hg-cmd\">hg strip</command> command saves a backup of the " "removed changesets in a bundle, so that they can be reapplied if removed in " @@ -776,37 +1588,36 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:499 +#: ../en/appB-mq-ref.xml:494 msgid "" "<option role=\"hg-opt-strip\">-b</option>: Save unrelated changesets that are " "intermixed with the stripped changesets in the backup bundle." msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> -#: ../en/appB-mq-ref.xml:503 +#: ../en/appB-mq-ref.xml:498 msgid "" "<option role=\"hg-opt-strip\">-f</option>: If a branch has multiple heads, " -"remove all heads. XXX This should be renamed, and use <literal>-f</literal> " -"to strip revs when there are pending changes." +"remove all heads." msgstr "" #. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para> +#: ../en/appB-mq-ref.xml:501 +msgid "<option role=\"hg-opt-strip\">-n</option>: Do not save a backup bundle." +msgstr "" + +#. type: Content of: <book><appendix><sect1><title> #: ../en/appB-mq-ref.xml:508 -msgid "<option role=\"hg-opt-strip\">-n</option>: Do not save a backup bundle." -msgstr "" - -#. type: Content of: <book><appendix><sect1><title> -#: ../en/appB-mq-ref.xml:515 msgid "MQ file reference" msgstr "MQ 文件参考" #. type: Content of: <book><appendix><sect1><sect2><title> -#: ../en/appB-mq-ref.xml:518 +#: ../en/appB-mq-ref.xml:511 msgid "The <filename role=\"special\">series</filename> file" msgstr "<filename role=\"special\">序列</filename>文件" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:521 +#: ../en/appB-mq-ref.xml:514 msgid "" "The <filename role=\"special\">series</filename> file contains a list of the " "names of all patches that MQ can apply. It is represented as a list of " @@ -815,7 +1626,7 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:527 +#: ../en/appB-mq-ref.xml:520 msgid "" "Lines may contain comments. A comment begins with the <quote><literal>#</" "literal></quote> character, and extends to the end of the line. Empty lines, " @@ -823,7 +1634,7 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:532 +#: ../en/appB-mq-ref.xml:525 msgid "" "You will often need to edit the <filename role=\"special\">series</filename> " "file by hand, hence the support for comments and empty lines noted above. " @@ -834,7 +1645,7 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:541 +#: ../en/appB-mq-ref.xml:534 msgid "" "Placing the <filename role=\"special\">series</filename> file under revision " "control is also supported; it is a good idea to place all of the patches that " @@ -845,12 +1656,12 @@ msgstr "" #. type: Content of: <book><appendix><sect1><sect2><title> -#: ../en/appB-mq-ref.xml:551 +#: ../en/appB-mq-ref.xml:544 msgid "The <filename role=\"special\">status</filename> file" msgstr "<filename role=\"special\">状态</filename>文件" #. type: Content of: <book><appendix><sect1><sect2><para> -#: ../en/appB-mq-ref.xml:554 +#: ../en/appB-mq-ref.xml:547 msgid "" "The <filename role=\"special\">status</filename> file contains the names and " "changeset hashes of all patches that MQ currently has applied. Unlike the " @@ -875,6 +1686,8 @@ "If you are using a Unix-like system that has a sufficiently recent version of " "Python (2.3 or newer) available, it is easy to install Mercurial from source." msgstr "" +"如果你使用类 Unix 系统,并且有足够新的 Python (2.3 更新),从源代码安装 " +"Mercurial 就很容易了。" #. type: Content of: <book><appendix><sect1><orderedlist><listitem><para> #: ../en/appC-srcinstall.xml:14 @@ -882,18 +1695,20 @@ "Download a recent source tarball from <ulink url=\"http://www.selenic.com/" "mercurial/download\">http://www.selenic.com/mercurial/download</ulink>." msgstr "" +"从 <ulink url=\"http://www.selenic.com/mercurial/download\">http://www." +"selenic.com/mercurial/download</ulink> 下载最新的源代码。" #. type: Content of: <book><appendix><sect1><orderedlist><listitem><para> #: ../en/appC-srcinstall.xml:17 msgid "Unpack the tarball:" -msgstr "" +msgstr "解压:" #. type: Content of: <book><appendix><sect1><orderedlist><listitem><para> #: ../en/appC-srcinstall.xml:20 msgid "" "Go into the source directory and run the installer script. This will build " "Mercurial and install it in your home directory." -msgstr "" +msgstr "进入源代码目录,执行安装教本。这会构建 Mercurial,安装到你的家目录。" #. type: Content of: <book><appendix><sect1><para> #: ../en/appC-srcinstall.xml:27 @@ -902,6 +1717,8 @@ "subdirectory of your home directory. Don't forget to make sure that this " "directory is present in your shell's search path." msgstr "" +"安装完成后,Mercurial 就位于家目录的 <literal>bin</literal> 子目录。不要忘记将" +"这个目录加入到你的可执行文件搜索路径中。" #. type: Content of: <book><appendix><sect1><para> #: ../en/appC-srcinstall.xml:32 @@ -915,6 +1732,11 @@ "see where the contents of the <literal>mercurial</literal> directory were " "installed to." msgstr "" +"你可能需要设置环境变量 <envar>PYTHONPATH</envar>,以便 Mercurial 可执行文件能" +"找到 Mercurial 包。例如,在我的笔记本电脑中,必须设置为 <literal>/home/bos/" +"lib/python</literal>。你需要使用的路径依赖于 Python 的构建方式,这很容易找出" +"来。如果你不确定,仔细察看上面的安装脚本输出,检查包含 <literal>mercurial</" +"literal> 目录的内容的安装位置。" #. type: Content of: <book><appendix><sect1><title> #: ../en/appC-srcinstall.xml:44 @@ -930,6 +1752,9 @@ "user</quote>. Unless you intend to hack on Mercurial, I strongly suggest " "that you use a binary package instead." msgstr "" +"在 Windows 中构建和安装 Mercurial 需要各种工具,相当多的技术背景,以及足够的耐" +"心。如果你是一个<quote>初级用户</quote>,我<emphasis>很不赞成</emphasis>这个方" +"法。我强烈建议你使用二进制安装包,除非你想深入研究 Mercurial 本身。" #. type: Content of: <book><appendix><sect1><para> #: ../en/appC-srcinstall.xml:53 @@ -940,16 +1765,21 @@ "selenic.com/mercurial/wiki/index.cgi/WindowsInstall</ulink>, and expect the " "process to involve a lot of fiddly work." msgstr "" +"If you are intent on building Mercurial from source on Windows, follow the " +"<quote>hard way</quote> directions on the Mercurial wiki at <ulink url=" +"\"http://www.selenic.com/mercurial/wiki/index.cgi/WindowsInstall\">http://www." +"selenic.com/mercurial/wiki/index.cgi/WindowsInstall</ulink>, and expect the " +"process to involve a lot of fiddly work." #. type: Content of: <book><appendix><title> #: ../en/appD-license.xml:5 msgid "Open Publication License" -msgstr "" +msgstr "开放出版协议" #. type: Content of: <book><appendix><para> #: ../en/appD-license.xml:7 msgid "Version 1.0, 8 June 1999" -msgstr "" +msgstr "版本 1.0,1999 年 6 月 8 日。" #. type: Content of: <book><appendix><sect1><title> #: ../en/appD-license.xml:10 @@ -1195,11 +2025,362 @@ #. type: Content of: <book><preface><sect1><title> #: ../en/ch00-preface.xml:8 +msgid "Technical storytelling" +msgstr "技术背景" + +#. type: Content of: <book><preface><sect1><para> +#: ../en/ch00-preface.xml:10 +msgid "" +"A few years ago, when I wanted to explain why I believed that distributed " +"revision control is important, the field was then so new that there was " +"almost no published literature to refer people to." +msgstr "" + +#. type: Content of: <book><preface><sect1><para> +#: ../en/ch00-preface.xml:15 +msgid "" +"Although at that time I spent some time working on the internals of Mercurial " +"itself, I switched to writing this book because that seemed like the most " +"effective way to help the software to reach a wide audience, along with the " +"idea that revision control ought to be distributed in nature. I publish the " +"book online under a liberal license for the same reason: to get the word out." +msgstr "" + +#. type: Content of: <book><preface><sect1><para> +#: ../en/ch00-preface.xml:23 +msgid "" +"There's a familiar rhythm to a good software book that closely resembles " +"telling a story: What is this thing? Why does it matter? How will it help me? " +"How do I use it? In this book, I try to answer those questions for " +"distributed revision control in general, and for Mercurial in particular." +msgstr "" + +#. type: Content of: <book><preface><sect1><title> +#: ../en/ch00-preface.xml:31 +msgid "Thank you for supporting Mercurial" +msgstr "谢谢你支持 Mercurial" + +#. type: Content of: <book><preface><sect1><para> +#: ../en/ch00-preface.xml:33 +msgid "" +"By purchasing a copy of this book, you are supporting the continued " +"development and freedom of Mercurial in particular, and of open source and " +"free software in general. O'Reilly Media and I are donating my royalties on " +"the sales of this book to the Software Freedom Conservancy (<ulink url=" +"\"http://www.softwarefreedom.org/\">http://www.softwarefreedom.org/</ulink>) " +"which provides clerical and legal support to Mercurial and a number of other " +"prominent and worthy open source software projects." +msgstr "" + +#. type: Content of: <book><preface><sect1><title> +#: ../en/ch00-preface.xml:45 +msgid "Acknowledgments" +msgstr "致谢" + +#. type: Content of: <book><preface><sect1><para> +#: ../en/ch00-preface.xml:47 +msgid "" +"This book would not exist were it not for the efforts of Matt Mackall, the " +"author and project lead of Mercurial. He is ably assisted by hundreds of " +"volunteer contributors across the world." +msgstr "" + +#. type: Content of: <book><preface><sect1><para> +#: ../en/ch00-preface.xml:52 +msgid "" +"My children, Cian and Ruairi, always stood ready to help me to unwind with " +"wonderful, madcap little-boy games. I'd also like to thank my ex-wife, " +"Shannon, for her support." +msgstr "" + +#. type: Content of: <book><preface><sect1><para> +#: ../en/ch00-preface.xml:56 +msgid "" +"My colleagues and friends provided help and support in innumerable ways. " +"This list of people is necessarily very incomplete: Stephen Hahn, Karyn " +"Ritter, Bonnie Corwin, James Vasile, Matt Norwood, Eben Moglen, Bradley Kuhn, " +"Robert Walsh, Jeremy Fitzhardinge, Rachel Chalmers." +msgstr "" + +#. type: Content of: <book><preface><sect1><para> +#: ../en/ch00-preface.xml:62 +msgid "" +"I developed this book in the open, posting drafts of chapters to the book web " +"site as I completed them. Readers then submitted feedback using a web " +"application that I developed. By the time I finished writing the book, more " +"than 100 people had submitted comments, an amazing number considering that " +"the comment system was live for only about two months towards the end of the " +"writing process." +msgstr "" + +#. type: Content of: <book><preface><sect1><para> +#: ../en/ch00-preface.xml:70 +msgid "" +"I would particularly like to recognize the following people, who between them " +"contributed over a third of the total number of comments. I would like to " +"thank them for their care and effort in providing so much detailed feedback." +msgstr "" + +#. type: Content of: <book><preface><sect1><para> +#: ../en/ch00-preface.xml:75 +msgid "" +"Martin Geisler, Damien Cassou, Alexey Bakhirkin, Till Plewe, Dan Himes, Paul " +"Sargent, Gokberk Hamurcu, Matthijs van der Vleuten, Michael Chermside, John " +"Mulligan, Jordi Fita, Jon Parise." +msgstr "" + +#. type: Content of: <book><preface><sect1><para> +#: ../en/ch00-preface.xml:80 +msgid "" +"I also want to acknowledge the help of the many people who caught errors and " +"provided helpful suggestions throughout the book." +msgstr "" + +#. type: Content of: <book><preface><sect1><para> +#: ../en/ch00-preface.xml:84 +msgid "" +"Jeremy W. Sherman, Brian Mearns, Vincent Furia, Iwan Luijks, Billy Edwards, " +"Andreas Sliwka, Paweł Sołyga, Eric Hanchrow, Steve Nicolai, Michał Masłowski, " +"Kevin Fitch, Johan Holmberg, Hal Wine, Volker Simonis, Thomas P Jakobsen, Ted " +"Stresen-Reuter, Stephen Rasku, Raphael Das Gupta, Ned Batchelder, Lou Keeble, " +"Li Linxiao, Kao Cardoso Félix, Joseph Wecker, Jon Prescot, Jon Maken, John " +"Yeary, Jason Harris, Geoffrey Zheng, Fredrik Jonson, Ed Davies, David " +"Zumbrunnen, David Mercer, David Cabana, Ben Karel, Alan Franzoni, Yousry " +"Abdallah, Whitney Young, Vinay Sajip, Tom Towle, Tim Ottinger, Thomas " +"Schraitle, Tero Saarni, Ted Mielczarek, Svetoslav Agafonkin, Shaun Rowland, " +"Rocco Rutte, Polo-Francois Poli, Philip Jenvey, Petr Tesałék, Peter R. " +"Annema, Paul Bonser, Olivier Scherler, Olivier Fournier, Nick Parker, Nick " +"Fabry, Nicholas Guarracino, Mike Driscoll, Mike Coleman, Mietek Bák, Michael " +"Maloney, László Nagy, Kent Johnson, Julio Nobrega, Jord Fita, Jonathan March, " +"Jonas Nockert, Jim Tittsler, Jeduan Cornejo Legorreta, Jan Larres, James " +"Murphy, Henri Wiechers, Hagen Möbius, Gábor Farkas, Fabien Engels, Evert Rol, " +"Evan Willms, Eduardo Felipe Castegnaro, Dennis Decker Jensen, Deniz Dogan, " +"David Smith, Daed Lee, Christine Slotty, Charles Merriam, Guillaume Catto, " +"Brian Dorsey, Bob Nystrom, Benoit Boissinot, Avi Rosenschein, Andrew Watts, " +"Andrew Donkin, Alexey Rodriguez, Ahmed Chaudhary." +msgstr "" + +#. type: Content of: <book><preface><sect1><title> +#: ../en/ch00-preface.xml:111 +msgid "Conventions Used in This Book" +msgstr "本书的约定" + +#. type: Content of: <book><preface><sect1><para> +#: ../en/ch00-preface.xml:113 +msgid "The following typographical conventions are used in this book:" +msgstr "本书使用如下的印刷约定:" + +#. type: Content of: <book><preface><sect1><variablelist><varlistentry><term> +#: ../en/ch00-preface.xml:118 +msgid "Italic" +msgstr "斜体" + +#. type: Content of: <book><preface><sect1><variablelist><varlistentry><listitem><para> +#: ../en/ch00-preface.xml:121 +msgid "" +"Indicates new terms, URLs, email addresses, filenames, and file extensions." +msgstr "标识新术语,URL,电子邮件地址,文件名称与扩展名。" + +#. type: Content of: <book><preface><sect1><variablelist><varlistentry><term> +#: ../en/ch00-preface.xml:127 +msgid "<literal>Constant width</literal>" +msgstr "<literal>等宽</literal>" + +#. type: Content of: <book><preface><sect1><variablelist><varlistentry><listitem><para> +#: ../en/ch00-preface.xml:130 +msgid "" +"Used for program listings, as well as within paragraphs to refer to program " +"elements such as variable or function names, databases, data types, " +"environment variables, statements, and keywords." +msgstr "" +"用于程序列表,以及段内引用的程序元素,例如变量、函数名称、数据库、数据类型、环" +"境变量、声明和关键字。" + +#. type: Content of: <book><preface><sect1><variablelist><varlistentry><term> +#: ../en/ch00-preface.xml:138 +msgid "<userinput>Constant width bold</userinput>" +msgstr "<userinput>等宽粗体</userinput>" + +#. type: Content of: <book><preface><sect1><variablelist><varlistentry><listitem><para> +#: ../en/ch00-preface.xml:141 +msgid "Shows commands or other text that should be typed literally by the user." +msgstr "标识命令或者其它用户应该逐字输入的文本。" + +#. type: Content of: <book><preface><sect1><variablelist><varlistentry><term> +#: ../en/ch00-preface.xml:147 +msgid "<replaceable>Constant width italic</replaceable>" +msgstr "<replaceable>等宽斜体</replaceable>" + +#. type: Content of: <book><preface><sect1><variablelist><varlistentry><listitem><para> +#: ../en/ch00-preface.xml:150 +msgid "" +"Shows text that should be replaced with user-supplied values or by values " +"determined by context." +msgstr "标识应该被用户提供的值或者取决于上下文的值替换的文本。" + +#. type: Content of: <book><preface><sect1><tip><para> +#: ../en/ch00-preface.xml:157 +msgid "This icon signifies a tip, suggestion, or general note." +msgstr "此图标表示提示,建议或者一般的的注释。" + +#. type: Content of: <book><preface><sect1><caution><para> +#: ../en/ch00-preface.xml:162 +msgid "This icon indicates a warning or caution." +msgstr "此图标表示警告。" + +#. type: Content of: <book><preface><sect1><title> +#: ../en/ch00-preface.xml:167 +msgid "Using Code Examples" +msgstr "使用样例代码" + +#. type: Content of: <book><preface><sect1><para> +#: ../en/ch00-preface.xml:169 +msgid "" +"This book is here to help you get your job done. In general, you may use the " +"code in this book in your programs and documentation. You do not need to " +"contact us for permission unless you’re reproducing a significant portion of " +"the code. For example, writing a program that uses several chunks of code " +"from this book does not require permission. Selling or distributing a CD-ROM " +"of examples from O’Reilly books does require permission. Answering a " +"question by citing this book and quoting example code does not require " +"permission. Incorporating a significant amount of example code from this book " +"into your product’s documentation does require permission." +msgstr "" + +#. type: Content of: <book><preface><sect1><para> +#: ../en/ch00-preface.xml:181 +msgid "" +"We appreciate, but do not require, attribution. An attribution usually " +"includes the title, author, publisher, and ISBN. For example: “<emphasis>Book " +"Title</emphasis> by Some Author. Copyright 2008 O’Reilly Media, Inc., 978-0-" +"596-xxxx-x.”" +msgstr "" + +#. type: Content of: <book><preface><sect1><para> +#: ../en/ch00-preface.xml:187 +msgid "" +"If you feel your use of code examples falls outside fair use or the " +"permission given above, feel free to contact us at <email>permissions@oreilly." +"com</email>." +msgstr "" + +#. type: Content of: <book><preface><sect1><title> +#: ../en/ch00-preface.xml:193 +msgid "Safari® Books Online" +msgstr "Safari® 在线书库" + +#. type: Content of: <book><preface><sect1><note><para> +#: ../en/ch00-preface.xml:196 +msgid "" +"When you see a Safari® Books Online icon on the cover of your favorite " +"technology book, that means the book is available online through the O’Reilly " +"Network Safari Bookshelf." +msgstr "" + +#. type: Content of: <book><preface><sect1><para> +#: ../en/ch00-preface.xml:202 +msgid "" +"Safari offers a solution that’s better than e-books. It’s a virtual library " +"that lets you easily search thousands of top tech books, cut and paste code " +"samples, download chapters, and find quick answers when you need the most " +"accurate, current information. Try it for free at <ulink role=\"orm:hideurl:" +"ital\" url=\"http://my.safaribooksonline.com/?portal=oreilly\">http://my." +"safaribooksonline.com</ulink>." +msgstr "" + +#. type: Content of: <book><preface><sect1><title> +#: ../en/ch00-preface.xml:211 +msgid "How to Contact Us" +msgstr "联系我们" + +#. type: Content of: <book><preface><sect1><para> +#: ../en/ch00-preface.xml:213 +msgid "" +"Please address comments and questions concerning this book to the publisher:" +msgstr "" + +#. type: Content of: <book><preface><sect1><simplelist><member> +#: ../en/ch00-preface.xml:217 +msgid "O’Reilly Media, Inc." +msgstr "" + +#. type: Content of: <book><preface><sect1><simplelist><member> +#: ../en/ch00-preface.xml:219 +msgid "1005 Gravenstein Highway North" +msgstr "" + +#. type: Content of: <book><preface><sect1><simplelist><member> +#: ../en/ch00-preface.xml:221 +msgid "Sebastopol, CA 95472" +msgstr "" + +#. type: Content of: <book><preface><sect1><simplelist><member> +#: ../en/ch00-preface.xml:223 +msgid "800-998-9938 (in the United States or Canada)" +msgstr "" + +#. type: Content of: <book><preface><sect1><simplelist><member> +#: ../en/ch00-preface.xml:225 +msgid "707-829-0515 (international or local)" +msgstr "" + +#. type: Content of: <book><preface><sect1><simplelist><member> +#: ../en/ch00-preface.xml:227 +msgid "707 829-0104 (fax)" +msgstr "" + +#. type: Content of: <book><preface><sect1><para> +#: ../en/ch00-preface.xml:230 +msgid "" +"We have a web page for this book, where we list errata, examples, and any " +"additional information. You can access this page at:" +msgstr "" + +#. type: Content of: <book><preface><sect1><simplelist><member> +#: ../en/ch00-preface.xml:235 +msgid "" +"<ulink url=\"http://www.oreilly.com/catalog/<catalog page>\"></ulink>" +msgstr "" + +#. type: Content of: <book><preface><sect1><remark> +#: ../en/ch00-preface.xml:239 +msgid "Don’t forget to update the <url> attribute, too." +msgstr "" + +#. type: Content of: <book><preface><sect1><para> +#: ../en/ch00-preface.xml:242 +msgid "To comment or ask technical questions about this book, send email to:" +msgstr "" + +#. type: Content of: <book><preface><sect1><simplelist><member> +#: ../en/ch00-preface.xml:246 +msgid "<email>bookquestions@oreilly.com</email>" +msgstr "<email>bookquestions@oreilly.com</email>" + +#. type: Content of: <book><preface><sect1><para> +#: ../en/ch00-preface.xml:249 +msgid "" +"For more information about our books, conferences, Resource Centers, and the " +"O’Reilly Network, see our web site at:" +msgstr "" + +#. type: Content of: <book><preface><sect1><simplelist><member> +#: ../en/ch00-preface.xml:253 +msgid "<ulink url=\"http://www.oreilly.com\"></ulink>" +msgstr "<ulink url=\"http://www.oreilly.com\"></ulink>" + +#. type: Content of: <book><chapter><title> +#: ../en/ch01-intro.xml:5 +msgid "How did we get here?" +msgstr "" + +#. type: Content of: <book><chapter><sect1><title> +#: ../en/ch01-intro.xml:8 msgid "Why revision control? Why Mercurial?" msgstr "为什么使用版本控制? 为什么使用 Mercurial?" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:10 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:10 msgid "" "Revision control is the process of managing multiple versions of a piece of " "information. In its simplest form, this is something that many people do by " @@ -1207,8 +2388,8 @@ "number, each one higher than the number of the preceding version." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:16 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:16 msgid "" "Manually managing multiple versions of even a single file is an error-prone " "task, though, so software tools to help automate this process have long been " @@ -1220,16 +2401,16 @@ "working together on projects that consist of hundreds of thousands of files." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:27 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:27 msgid "" "The arrival of distributed revision control is relatively recent, and so far " "this new field has grown due to people's willingness to explore ill-charted " "territory." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:31 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:31 msgid "" "I am writing a book about distributed revision control because I believe that " "it is an important subject that deserves a field guide. I chose to write " @@ -1238,20 +2419,20 @@ "other revision control tools buckle." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><title> -#: ../en/ch00-preface.xml:39 +#. type: Content of: <book><chapter><sect1><sect2><title> +#: ../en/ch01-intro.xml:39 msgid "Why use revision control?" msgstr "为什么使用版本控制?" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:41 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:41 msgid "" "There are a number of reasons why you or your team might want to use an " "automated revision control tool for a project." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch00-preface.xml:46 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> +#: ../en/ch01-intro.xml:46 msgid "" "It will track the history and evolution of your project, so you don't have " "to. For every change, you'll have a log of <emphasis>who</emphasis> made it; " @@ -1259,8 +2440,8 @@ "it; and <emphasis>what</emphasis> the change was." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch00-preface.xml:53 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> +#: ../en/ch01-intro.xml:53 msgid "" "When you're working with other people, revision control software makes it " "easier for you to collaborate. For example, when people more or less " @@ -1268,8 +2449,8 @@ "you to identify and resolve those conflicts." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch00-preface.xml:59 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> +#: ../en/ch01-intro.xml:59 msgid "" "It can help you to recover from mistakes. If you make a change that later " "turns out to be in error, you can revert to an earlier version of one or more " @@ -1278,23 +2459,23 @@ "introduced (see <xref linkend=\"sec:undo:bisect\"/> for details)." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch00-preface.xml:66 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> +#: ../en/ch01-intro.xml:66 msgid "" "It will help you to work simultaneously on, and manage the drift between, " "multiple versions of your project." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:71 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:71 msgid "" "Most of these reasons are equally valid&emdash;at least in theory&emdash;" "whether you're working on a project by yourself, or with a hundred other " "people." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:76 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:76 msgid "" "A key question about the practicality of revision control at these two " "different scales (<quote>lone hacker</quote> and <quote>huge team</quote>) is " @@ -1303,8 +2484,8 @@ "going to impose a high cost." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:84 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:84 msgid "" "A five-hundred-person project is likely to collapse under its own weight " "almost immediately without a revision control tool and process. In this case, " @@ -1312,16 +2493,16 @@ "<emphasis>without</emphasis> it, failure is almost guaranteed." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:91 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:91 msgid "" "On the other hand, a one-person <quote>quick hack</quote> might seem like a " "poor place to use a revision control tool, because surely the cost of using " "one must be close to the overall cost of the project. Right?" msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:96 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:96 msgid "" "Mercurial uniquely supports <emphasis>both</emphasis> of these scales of " "development. You can learn the basics in just a few minutes, and due to its " @@ -1333,81 +2514,67 @@ "projects." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:106 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:106 msgid "" "No revision control tool can rescue a poorly run project, but a good choice " "of tools can make a huge difference to the fluidity with which you can work " "on a project." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><title> -#: ../en/ch00-preface.xml:113 +#. type: Content of: <book><chapter><sect1><sect2><title> +#: ../en/ch01-intro.xml:113 msgid "The many names of revision control" msgstr "版本控制的别名" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:115 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:115 msgid "" "Revision control is a diverse field, so much so that it is referred to by " "many names and acronyms. Here are a few of the more common variations you'll " "encounter:" msgstr "" -#. type: Content of: <book><preface><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch00-preface.xml:119 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> +#: ../en/ch01-intro.xml:119 msgid "Revision control (RCS)" msgstr "版本控制(RCS)" -#. type: Content of: <book><preface><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch00-preface.xml:120 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> +#: ../en/ch01-intro.xml:120 msgid "Software configuration management (SCM), or configuration management" msgstr "软件配置管理(SCM),或配置管理" -#. type: Content of: <book><preface><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch00-preface.xml:122 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> +#: ../en/ch01-intro.xml:122 msgid "Source code management" msgstr "源代码管理" -#. type: Content of: <book><preface><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch00-preface.xml:123 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> +#: ../en/ch01-intro.xml:123 msgid "Source code control, or source control" msgstr "源代码控制,或源控制" -#. type: Content of: <book><preface><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch00-preface.xml:125 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> +#: ../en/ch01-intro.xml:125 msgid "Version control (VCS)" msgstr "版本控制(VCS)" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:127 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:127 msgid "" "Some people claim that these terms actually have different meanings, but in " "practice they overlap so much that there's no agreed or even useful way to " "tease them apart." msgstr "" -#. type: Content of: <book><preface><sect1><title> -#: ../en/ch00-preface.xml:135 -msgid "This book is a work in progress" -msgstr "本书正在编写中" - -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:137 -msgid "" -"I am releasing this book while I am still writing it, in the hope that it " -"will prove useful to others. I am writing under an open license in the hope " -"that you, my readers, will contribute feedback and perhaps content of your " -"own." -msgstr "" - -#. type: Content of: <book><preface><sect1><title> -#: ../en/ch00-preface.xml:144 +#. type: Content of: <book><chapter><sect1><title> +#: ../en/ch01-intro.xml:135 msgid "About the examples in this book" msgstr "本书的例子" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:146 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:137 msgid "" "This book takes an unusual approach to code samples. Every example is " "<quote>live</quote>&emdash;each one is actually the result of a shell script " @@ -1416,18 +2583,18 @@ "run, and their current results compared against their expected results." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:153 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:144 msgid "" "The advantage of this approach is that the examples are always accurate; they " -"describe <emphasis>exactly</emphasis> the behaviour of the version of " +"describe <emphasis>exactly</emphasis> the behavior of the version of " "Mercurial that's mentioned at the front of the book. If I update the version " "of Mercurial that I'm documenting, and the output of some command changes, " "the build fails." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:160 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:151 msgid "" "There is a small disadvantage to this approach, which is that the dates and " "times you'll see in examples tend to be <quote>squashed</quote> together in a " @@ -1437,8 +2604,8 @@ "run many commands in one second." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:168 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:159 msgid "" "As an instance of this, several consecutive commits in an example can show up " "as having occurred during the same second. You can see this occur in the " @@ -1446,29 +2613,29 @@ "bisect\"/>, for instance." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:174 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:165 msgid "" "So when you're reading examples, don't place too much weight on the dates or " "times you see in the output of commands. But <emphasis>do</emphasis> be " -"confident that the behaviour you're seeing is consistent and reproducible." -msgstr "" - -#. type: Content of: <book><preface><sect1><title> -#: ../en/ch00-preface.xml:182 +"confident that the behavior you're seeing is consistent and reproducible." +msgstr "" + +#. type: Content of: <book><chapter><sect1><title> +#: ../en/ch01-intro.xml:173 msgid "Trends in the field" msgstr "版本控制的发展趋势" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:184 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:175 msgid "" "There has been an unmistakable trend in the development and use of revision " "control tools over the past four decades, as people have become familiar with " "the capabilities of their tools and constrained by their limitations." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:189 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:180 msgid "" "The first generation began by managing single files on individual computers. " "Although these tools represented a huge advance over ad-hoc manual revision " @@ -1476,8 +2643,8 @@ "to small, tightly-knit teams." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:195 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:186 msgid "" "The second generation loosened these constraints by moving to network-" "centered architectures, and managing entire projects at a time. As projects " @@ -1490,8 +2657,8 @@ "natural way, as they could not record their changes." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:207 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:198 msgid "" "The current generation of revision control tools is peer-to-peer in nature. " "All of these systems have dropped the dependency on a single central server, " @@ -1502,13 +2669,13 @@ "when syncing changes with another repository." msgstr "" -#. type: Content of: <book><preface><sect1><title> -#: ../en/ch00-preface.xml:219 +#. type: Content of: <book><chapter><sect1><title> +#: ../en/ch01-intro.xml:210 msgid "A few of the advantages of distributed revision control" msgstr "分布版本控制的优点" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:222 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:213 msgid "" "Even though distributed revision control tools have for several years been as " "robust and usable as their previous-generation counterparts, people using " @@ -1517,8 +2684,8 @@ "ones." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:229 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:220 msgid "" "For an individual developer, distributed tools are almost always much faster " "than centralised tools. This is for a simple reason: a centralised tool " @@ -1530,8 +2697,8 @@ "interacting with your revision control software." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:240 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:231 msgid "" "Distributed tools are indifferent to the vagaries of your server " "infrastructure, again because they replicate metadata to so many locations. " @@ -1541,8 +2708,8 @@ "available on every contributor's computer." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:248 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:239 msgid "" "The reliability of your network will affect distributed tools far less than " "it will centralised tools. You can't even use a centralised tool without a " @@ -1554,13 +2721,13 @@ "may be significant." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><title> -#: ../en/ch00-preface.xml:259 +#. type: Content of: <book><chapter><sect1><sect2><title> +#: ../en/ch01-intro.xml:250 msgid "Advantages for open source projects" msgstr "开源项目的优点" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:261 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:252 msgid "" "If you take a shine to an open source project and decide that you would like " "to start hacking on it, and that project uses a distributed revision control " @@ -1575,13 +2742,13 @@ "your client's view of the repository." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><sect3><title> -#: ../en/ch00-preface.xml:277 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title> +#: ../en/ch01-intro.xml:268 msgid "The forking non-problem" msgstr "分叉不是问题" -#. type: Content of: <book><preface><sect1><sect2><sect3><para> -#: ../en/ch00-preface.xml:279 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para> +#: ../en/ch01-intro.xml:270 msgid "" "It has been suggested that distributed revision control tools pose some sort " "of risk to open source projects because they make it easy to <quote>fork</" @@ -1592,8 +2759,8 @@ "own direction." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><sect3><para> -#: ../en/ch00-preface.xml:289 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para> +#: ../en/ch01-intro.xml:280 msgid "" "Sometimes the camps in a fork decide to reconcile their differences. With a " "centralised revision control system, the <emphasis>technical</emphasis> " @@ -1603,8 +2770,8 @@ "usually loses some or all of one side's revision history." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><sect3><para> -#: ../en/ch00-preface.xml:298 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para> +#: ../en/ch01-intro.xml:289 msgid "" "What distributed tools do with respect to forking is they make forking the " "<emphasis>only</emphasis> way to develop a project. Every single change that " @@ -1614,8 +2781,8 @@ "they happen all the time." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><sect3><para> -#: ../en/ch00-preface.xml:307 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para> +#: ../en/ch01-intro.xml:298 msgid "" "If every piece of work that everybody does, all the time, is framed in terms " "of forking and merging, then what the open source world refers to as a " @@ -1624,23 +2791,23 @@ "fork:" msgstr "" -#. type: Content of: <book><preface><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch00-preface.xml:314 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> +#: ../en/ch01-intro.xml:305 msgid "" "They eliminate the social distinction that centralised tools impose: that " "between insiders (people with commit access) and outsiders (people without)." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch00-preface.xml:318 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> +#: ../en/ch01-intro.xml:309 msgid "" "They make it easier to reconcile after a social fork, because all that's " "involved from the perspective of the revision control software is just " "another merge." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><sect3><para> -#: ../en/ch00-preface.xml:323 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para> +#: ../en/ch01-intro.xml:314 msgid "" "Some people resist distributed tools because they want to retain tight " "control over their projects, and they believe that centralised tools give " @@ -1652,13 +2819,13 @@ "people feel compelled to mirror and fork your history." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><title> -#: ../en/ch00-preface.xml:338 +#. type: Content of: <book><chapter><sect1><sect2><title> +#: ../en/ch01-intro.xml:329 msgid "Advantages for commercial projects" msgstr "商业项目的优点" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:340 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:331 msgid "" "Many commercial projects are undertaken by teams that are scattered across " "the globe. Contributors who are far from a central server will see slower " @@ -1671,8 +2838,8 @@ "expensive long-haul network links." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:352 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:343 msgid "" "Centralised revision control systems tend to have relatively low " "scalability. It's not unusual for an expensive centralised system to fall " @@ -1685,8 +2852,8 @@ "of scripting." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:364 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:355 msgid "" "If you have an employee in the field, troubleshooting a problem at a " "customer's site, they'll benefit from distributed revision control. The tool " @@ -1696,40 +2863,40 @@ "to your company's network." msgstr "" -#. type: Content of: <book><preface><sect1><title> -#: ../en/ch00-preface.xml:375 +#. type: Content of: <book><chapter><sect1><title> +#: ../en/ch01-intro.xml:366 msgid "Why choose Mercurial?" msgstr "为什么选择 Mercurial?" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:377 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:368 msgid "" "Mercurial has a unique set of properties that make it a particularly good " "choice as a revision control system." msgstr "" -#. type: Content of: <book><preface><sect1><itemizedlist><listitem><para> -#: ../en/ch00-preface.xml:380 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> +#: ../en/ch01-intro.xml:371 msgid "It is easy to learn and use." msgstr "" -#. type: Content of: <book><preface><sect1><itemizedlist><listitem><para> -#: ../en/ch00-preface.xml:381 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> +#: ../en/ch01-intro.xml:372 msgid "It is lightweight." msgstr "" -#. type: Content of: <book><preface><sect1><itemizedlist><listitem><para> -#: ../en/ch00-preface.xml:382 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> +#: ../en/ch01-intro.xml:373 msgid "It scales excellently." msgstr "" -#. type: Content of: <book><preface><sect1><itemizedlist><listitem><para> -#: ../en/ch00-preface.xml:383 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> +#: ../en/ch01-intro.xml:374 msgid "It is easy to customise." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:386 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:377 msgid "" "If you are at all familiar with revision control systems, you should be able " "to get up and running with Mercurial in less than five minutes. Even if not, " @@ -1738,8 +2905,8 @@ "few general rules instead of a host of exceptions." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:393 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:384 msgid "" "On a small project, you can start working with Mercurial in moments. Creating " "new changes and branches; transferring changes around (whether locally or " @@ -1748,16 +2915,16 @@ "cognitive overhead with blazingly fast operations." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:400 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:391 msgid "" "The usefulness of Mercurial is not limited to small projects: it is used by " "projects with hundreds to thousands of contributors, each containing tens of " "thousands of files and hundreds of megabytes of source code." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:405 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:396 msgid "" "If the core functionality of Mercurial is not enough for you, it's easy to " "build on. Mercurial is well suited to scripting tasks, and its clean " @@ -1767,13 +2934,13 @@ "performance." msgstr "" -#. type: Content of: <book><preface><sect1><title> -#: ../en/ch00-preface.xml:415 +#. type: Content of: <book><chapter><sect1><title> +#: ../en/ch01-intro.xml:406 msgid "Mercurial compared with other tools" msgstr "Mercurial 与其它工具的比较" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:417 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:408 msgid "" "Before you read on, please understand that this section necessarily reflects " "my own experiences, interests, and (dare I say it) biases. I have used every " @@ -1781,28 +2948,23 @@ "years at a time." msgstr "" -#. type: Content of: <book><preface><sect1><itemizedlist><listitem><para> -#: ../en/ch00-preface.xml:425 ../en/ch00-preface.xml:636 -msgid "Subversion" -msgstr "" - -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:427 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:418 msgid "" "Subversion is a popular revision control tool, developed to replace CVS. It " "has a centralised client/server architecture." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:431 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:422 msgid "" "Subversion and Mercurial have similarly named commands for performing the " "same operations, so if you're familiar with one, it is easy to learn to use " "the other. Both tools are portable to all popular operating systems." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:436 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:427 msgid "" "Prior to version 1.5, Subversion had no useful support for merges. At the " "time of writing, its merge tracking capability is new, and known to be <ulink " @@ -1810,8 +2972,8 @@ "html#svn.branchmerge.advanced.finalword\">complicated and buggy</ulink>." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:442 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:433 msgid "" "Mercurial has a substantial performance advantage over Subversion on every " "revision control operation I have benchmarked. I have measured its advantage " @@ -1824,8 +2986,8 @@ "network bandwidth become bottlenecks for modestly large projects." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:455 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:446 msgid "" "Additionally, Subversion incurs substantial storage overhead to avoid network " "transactions for a few common operations, such as finding modified files " @@ -1836,8 +2998,8 @@ "of the project." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:465 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:456 msgid "" "Subversion is widely supported by third party tools. Mercurial currently " "lags considerably in this area. This gap is closing, however, and indeed " @@ -1845,8 +3007,8 @@ "Like Mercurial, Subversion has an excellent user manual." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:471 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:462 msgid "" "Because Subversion doesn't store revision history on the client, it is well " "suited to managing projects that deal with lots of large, opaque binary " @@ -1856,8 +3018,8 @@ "because the differences between each revision are large." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:480 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:471 msgid "" "In addition, it's often difficult or, more usually, impossible to merge " "different versions of a binary file. Subversion's ability to let a user lock " @@ -1866,8 +3028,8 @@ "widely used." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:487 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:478 msgid "" "Mercurial can import revision history from a Subversion repository. It can " "also export revision history to a Subversion repository. This makes it easy " @@ -1877,29 +3039,29 @@ "afterwards to bring in new changes." msgstr "" -#. type: Content of: <book><preface><sect1><itemizedlist><listitem><para> -#: ../en/ch00-preface.xml:499 ../en/ch00-preface.xml:638 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> +#: ../en/ch01-intro.xml:490 ../en/ch01-intro.xml:629 msgid "Git" msgstr "Git" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:501 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:492 msgid "" "Git is a distributed revision control tool that was developed for managing " "the Linux kernel source tree. Like Mercurial, its early design was somewhat " "influenced by Monotone." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:506 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:497 msgid "" "Git has a very large command set, with version 1.5.0 providing 139 individual " "commands. It has something of a reputation for being difficult to learn. " "Compared to Git, Mercurial has a strong focus on simplicity." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:511 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:502 msgid "" "In terms of performance, Git is extremely fast. In several cases, it is " "faster than Mercurial, at least on Linux, while Mercurial performs better on " @@ -1908,8 +3070,8 @@ "Mercurial." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:518 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:509 msgid "" "While a Mercurial repository needs no maintenance, a Git repository requires " "frequent manual <quote>repacks</quote> of its metadata. Without these, " @@ -1921,8 +3083,8 @@ "repository, but an unpacked repository is several orders of magnitude larger." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:529 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:520 msgid "" "The core of Git is written in C. Many Git commands are implemented as shell " "or Perl scripts, and the quality of these scripts varies widely. I have " @@ -1930,26 +3092,21 @@ "presence of errors that should have been fatal." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:535 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:526 msgid "Mercurial can import revision history from a Git repository." msgstr "" -#. type: Content of: <book><preface><sect1><itemizedlist><listitem><para> -#: ../en/ch00-preface.xml:541 ../en/ch00-preface.xml:637 -msgid "CVS" -msgstr "CVS" - -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:543 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:534 msgid "" "CVS is probably the most widely used revision control tool in the world. Due " "to its age and internal untidiness, it has been only lightly maintained for " "many years." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:547 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:538 msgid "" "It has a centralised client/server architecture. It does not group related " "file changes into atomic commits, making it easy for people to <quote>break " @@ -1962,8 +3119,8 @@ "those files were)." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:559 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:550 msgid "" "CVS has a muddled notion of tags and branches that I will not attempt to even " "describe. It does not support renaming of files or directories well, making " @@ -1973,8 +3130,8 @@ "existing or new." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:567 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:558 msgid "" "Mercurial can import CVS revision history. However, there are a few caveats " "that apply; these are true of every other revision control tool's CVS " @@ -1988,18 +3145,18 @@ "of the less interesting problems I can recall from personal experience)." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:581 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:572 msgid "Mercurial can import revision history from a CVS repository." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><title> -#: ../en/ch00-preface.xml:587 +#. type: Content of: <book><chapter><sect1><sect2><title> +#: ../en/ch01-intro.xml:578 msgid "Commercial tools" msgstr "商业工具" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:589 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:580 msgid "" "Perforce has a centralised client/server architecture, with no client-side " "caching of any data. Unlike modern revision control tools, Perforce requires " @@ -2007,8 +3164,8 @@ "to edit." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:595 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:586 msgid "" "The performance of Perforce is quite good for small teams, but it falls off " "rapidly as the number of users grows beyond a few dozen. Modestly large " @@ -2016,41 +3173,41 @@ "load their users generate." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><title> -#: ../en/ch00-preface.xml:604 +#. type: Content of: <book><chapter><sect1><sect2><title> +#: ../en/ch01-intro.xml:595 msgid "Choosing a revision control tool" msgstr "选择版本控制工具" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:606 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:597 msgid "" "With the exception of CVS, all of the tools listed above have unique " "strengths that suit them to particular styles of work. There is no single " "revision control tool that is best in all situations." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:611 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:602 msgid "" "As an example, Subversion is a good choice for working with frequently edited " "binary files, due to its centralised nature and support for file locking." msgstr "" -#. type: Content of: <book><preface><sect1><sect2><para> -#: ../en/ch00-preface.xml:615 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch01-intro.xml:606 msgid "" "I personally find Mercurial's properties of simplicity, performance, and good " "merge support to be a compelling combination that has served me well for " "several years." msgstr "" -#. type: Content of: <book><preface><sect1><title> -#: ../en/ch00-preface.xml:623 +#. type: Content of: <book><chapter><sect1><title> +#: ../en/ch01-intro.xml:614 msgid "Switching from another tool to Mercurial" msgstr "从其它工具切换到 Mercurial" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:625 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:616 msgid "" "Mercurial is bundled with an extension named <literal role=\"hg-ext" "\">convert</literal>, which can incrementally import revision history from " @@ -2060,20 +3217,15 @@ "conversion." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:633 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:624 msgid "" "The revision control tools supported by <literal role=\"hg-ext\">convert</" "literal> are as follows:" msgstr "<literal role=\"hg-ext\">convert</literal> 支持的版本控制工具有:" -#. type: Content of: <book><preface><sect1><itemizedlist><listitem><para> -#: ../en/ch00-preface.xml:639 -msgid "Darcs" -msgstr "Darcs" - -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:641 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:632 msgid "" "In addition, <literal role=\"hg-ext\">convert</literal> can export changes " "from Mercurial to Subversion. This makes it possible to try Subversion and " @@ -2081,8 +3233,8 @@ "loss of any work." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:647 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:638 msgid "" "The <command role=\"hg-ext-convert\">convert</command> command is easy to " "use. Simply point it at the path or URL of the source repository, optionally " @@ -2091,13 +3243,13 @@ "changes." msgstr "" -#. type: Content of: <book><preface><sect1><title> -#: ../en/ch00-preface.xml:656 +#. type: Content of: <book><chapter><sect1><title> +#: ../en/ch01-intro.xml:647 msgid "A short history of revision control" msgstr "版本控制简史" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:658 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:649 msgid "" "The best known of the old-time revision control tools is SCCS (Source Code " "Control System), which Marc Rochkind wrote at Bell Labs, in the early 1970s. " @@ -2109,8 +3261,8 @@ "help of an administrator." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:669 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:660 msgid "" "Walter Tichy developed a free alternative to SCCS in the early 1980s; he " "called his program RCS (Revision Control System). Like SCCS, RCS required " @@ -2118,8 +3270,8 @@ "multiple people from modifying them simultaneously." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:675 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:666 msgid "" "Later in the 1980s, Dick Grune used RCS as a building block for a set of " "shell scripts he initially called cmt, but then renamed to CVS (Concurrent " @@ -2131,8 +3283,8 @@ "to merge their edits prior to committing changes to the central repository." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:686 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:677 msgid "" "Brian Berliner took Grune's original scripts and rewrote them in C, releasing " "in 1989 the code that has since developed into the modern version of CVS. " @@ -2145,8 +3297,8 @@ "system." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:697 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:688 msgid "" "In the early 1990s, Sun Microsystems developed an early distributed revision " "control system, called TeamWare. A TeamWare workspace contains a complete " @@ -2155,8 +3307,8 @@ "SCCS.)" msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:704 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:695 msgid "" "As the 1990s progressed, awareness grew of a number of problems with CVS. It " "records simultaneous changes to multiple files individually, instead of " @@ -2167,8 +3319,8 @@ "architectural problems prohibitive." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:714 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:705 msgid "" "In 2001, Jim Blandy and Karl Fogel, two developers who had worked on CVS, " "started a project to replace it with a tool that would have a better " @@ -2179,8 +3331,8 @@ "grown in popularity." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:723 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:714 msgid "" "More or less simultaneously, Graydon Hoare began working on an ambitious " "distributed revision control system that he named Monotone. While Monotone " @@ -2190,48 +3342,26 @@ "integral notion of <quote>trust</quote> for code from different sources." msgstr "" -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:732 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch01-intro.xml:723 msgid "" "Mercurial began life in 2005. While a few aspects of its design are " "influenced by Monotone, Mercurial focuses on ease of use, high performance, " "and scalability to very large projects." msgstr "" -#. type: Content of: <book><preface><sect1><title> -#: ../en/ch00-preface.xml:740 -msgid "Colophon&emdash;this book is Free" -msgstr "后记—本书是自由的!" - -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:742 -msgid "" -"This book is licensed under the Open Publication License, and is produced " -"entirely using Free Software tools. It is typeset with DocBook XML. " -"Illustrations are drawn and rendered with <ulink url=\"http://www.inkscape." -"org/\">Inkscape</ulink>." -msgstr "" - -#. type: Content of: <book><preface><sect1><para> -#: ../en/ch00-preface.xml:747 -msgid "" -"The complete source code for this book is published as a Mercurial " -"repository, at <ulink url=\"http://hg.serpentine.com/mercurial/book\">http://" -"hg.serpentine.com/mercurial/book</ulink>." -msgstr "" - #. type: Content of: <book><chapter><title> -#: ../en/ch01-tour-basic.xml:5 +#: ../en/ch02-tour-basic.xml:5 msgid "A tour of Mercurial: the basics" msgstr "Mercurial 教程: 基础知识" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch01-tour-basic.xml:8 +#: ../en/ch02-tour-basic.xml:8 msgid "Installing Mercurial on your system" msgstr "安装 Mercurial" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:10 +#: ../en/ch02-tour-basic.xml:10 msgid "" "Prebuilt binary packages of Mercurial are available for every popular " "operating system. These make it easy to start using Mercurial on your " @@ -2241,12 +3371,12 @@ "用 Mercurial 变得很容易。" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch01-tour-basic.xml:15 +#: ../en/ch02-tour-basic.xml:15 msgid "Windows" msgstr "Windows" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:17 +#: ../en/ch02-tour-basic.xml:17 msgid "" "The best version of Mercurial for Windows is TortoiseHg, which can be found " "at <ulink url=\"http://bitbucket.org/tortoisehg/stable/wiki/Home\">http://" @@ -2254,26 +3384,32 @@ "external dependencies; it <quote>just works</quote>. It provides both " "command line and graphical user interfaces." msgstr "" +"Windows 中最好的 Mercurial 版本是TortoiseHg,它的主页地址是 <ulink url=" +"\"http://bitbucket.org/tortoisehg/stable/wiki/Home\">http://bitbucket.org/" +"tortoisehg/stable/wiki/Home</ulink>。这个软件没有外部依赖,它可以<quote>独立工" +"作</quote>,同时提供了命令行和图形用户界面。" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch01-tour-basic.xml:27 +#: ../en/ch02-tour-basic.xml:27 msgid "Mac OS X" msgstr "Mac OS X" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:29 +#: ../en/ch02-tour-basic.xml:29 msgid "" "Lee Cantey publishes an installer of Mercurial for Mac OS X at <ulink url=" "\"http://mercurial.berkwood.com\">http://mercurial.berkwood.com</ulink>." msgstr "" +"Lee Cantey 为 Mac OS X 在 <ulink url=\"http://mercurial.berkwood.com" +"\">http://mercurial.berkwood.com</ulink> 发布了 Mercurial 安装程序。" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch01-tour-basic.xml:35 +#: ../en/ch02-tour-basic.xml:35 msgid "Linux" msgstr "Linux" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:37 +#: ../en/ch02-tour-basic.xml:37 msgid "" "Because each Linux distribution has its own packaging tools, policies, and " "rate of development, it's difficult to give a comprehensive set of " @@ -2286,7 +3422,7 @@ "使用的发行版的 Mercurial 维护者的活跃程度。" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:44 +#: ../en/ch02-tour-basic.xml:44 msgid "" "To keep things simple, I will focus on installing Mercurial from the command " "line under the most popular Linux distributions. Most of these distributions " @@ -2298,27 +3434,32 @@ "Mercurial;寻找的包名称是 <literal>mercurial</literal>。" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch01-tour-basic.xml:52 +#: ../en/ch02-tour-basic.xml:52 msgid "Ubuntu and Debian:" msgstr "Ubuntu 与 Debian:" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch01-tour-basic.xml:54 -msgid "Fedora and OpenSUSE:" -msgstr "Fedora and OpenSUSE:" +#: ../en/ch02-tour-basic.xml:54 +msgid "Fedora:" +msgstr "Fedora:" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch01-tour-basic.xml:56 +#: ../en/ch02-tour-basic.xml:56 +msgid "OpenSUSE:" +msgstr "OpenSUSE:" + +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> +#: ../en/ch02-tour-basic.xml:58 msgid "Gentoo:" msgstr "Gentoo:" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch01-tour-basic.xml:62 +#: ../en/ch02-tour-basic.xml:64 msgid "Solaris" msgstr "Solaris" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:64 +#: ../en/ch02-tour-basic.xml:66 msgid "" "SunFreeWare, at <ulink url=\"http://www.sunfreeware.com\">http://www." "sunfreeware.com</ulink>, provides prebuilt packages of Mercurial." @@ -2327,26 +3468,29 @@ "ulink> 的 SunFreeWare 提供了 Mercurial 的二进制安装包。" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch01-tour-basic.xml:73 +#: ../en/ch02-tour-basic.xml:75 msgid "Getting started" msgstr "开始" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:75 +#: ../en/ch02-tour-basic.xml:77 msgid "" "To begin, we'll use the <command role=\"hg-cmd\">hg version</command> command " -"to find out whether Mercurial is actually installed properly. The actual " -"version information that it prints isn't so important; it's whether it prints " -"anything at all that we care about." -msgstr "" +"to find out whether Mercurial is installed properly. The actual version " +"information that it prints isn't so important; we simply care whether the " +"command runs and prints anything at all." +msgstr "" +"首先,我们使用 <command role=\"hg-cmd\">hg version</command> 命令检查 " +"Mercurial 是否已经正确安装。它打印出来的实际版本信息并不重要;我们只关心它是否" +"能够运行,打印出信息。" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch01-tour-basic.xml:84 +#: ../en/ch02-tour-basic.xml:86 msgid "Built-in help" msgstr "内置帮助" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:86 +#: ../en/ch02-tour-basic.xml:88 msgid "" "Mercurial provides a built-in help system. This is invaluable for those " "times when you find yourself stuck trying to remember how to run a command. " @@ -2355,9 +3499,13 @@ "what each does. If you ask for help on a specific command (as below), it " "prints more detailed information." msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:97 +"Mercurial 内置了帮助系统。当你不记得如何执行一个命令时,它会给你重要的帮助。如" +"果你完全没有头绪,那就直接运行 <command role=\"hg-cmd\">hg help</command>;它" +"会给出命令的简短列表,还描述了每个命令的作用。如果你需要具体命令的帮助(下述)," +"它会给出更详细的信息。" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch02-tour-basic.xml:99 msgid "" "For a more impressive level of detail (which you won't usually need) run " "<command role=\"hg-cmd\">hg help <option role=\"hg-opt-global\">-v</option></" @@ -2365,14 +3513,18 @@ "<option role=\"hg-opt-global\">--verbose</option>, and tells Mercurial to " "print more information than it usually would." msgstr "" +"要获得更多的详细信息(通常不需要),可以执行 <command role=\"hg-cmd\">hg help " +"<option role=\"hg-opt-global\">-v</option></command>。选项 <option role=\"hg-" +"opt-global\">-v</option> 是 <option role=\"hg-opt-global\">--verbose</option> " +"的短格式,告诉 Mercurial 要打印通常不需要的更多信息。" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch01-tour-basic.xml:108 +#: ../en/ch02-tour-basic.xml:110 msgid "Working with a repository" msgstr "使用版本库" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:110 +#: ../en/ch02-tour-basic.xml:112 msgid "" "In Mercurial, everything happens inside a <emphasis>repository</emphasis>. " "The repository for a project contains all of the files that <quote>belong to</" @@ -2380,7 +3532,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:116 +#: ../en/ch02-tour-basic.xml:118 msgid "" "There's nothing particularly magical about a repository; it is simply a " "directory tree in your filesystem that Mercurial treats as special. You can " @@ -2389,12 +3541,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch01-tour-basic.xml:123 +#: ../en/ch02-tour-basic.xml:125 msgid "Making a local copy of a repository" msgstr "创建版本库的工作副本" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:125 +#: ../en/ch02-tour-basic.xml:127 msgid "" "<emphasis>Copying</emphasis> a repository is just a little bit special. " "While you could use a normal file copying command to make a copy of a " @@ -2404,7 +3556,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:134 +#: ../en/ch02-tour-basic.xml:136 msgid "" "One advantage of using <command role=\"hg-cmd\">hg clone</command> is that, " "as we can see above, it lets us clone repositories over the network. Another " @@ -2413,21 +3565,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:140 +#: ../en/ch02-tour-basic.xml:142 msgid "" "If our clone succeeded, we should now have a local directory called <filename " "class=\"directory\">hello</filename>. This directory will contain some files." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:146 +#: ../en/ch02-tour-basic.xml:148 msgid "" "These files have the same contents and history in our repository as they do " "in the repository we cloned." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:149 +#: ../en/ch02-tour-basic.xml:151 msgid "" "Every Mercurial repository is complete, self-contained, and independent. It " "contains its own private copy of a project's files and history. As we just " @@ -2437,7 +3589,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:156 +#: ../en/ch02-tour-basic.xml:158 msgid "" "What this means for now is that we're free to experiment with our repository, " "safe in the knowledge that it's a private <quote>sandbox</quote> that won't " @@ -2445,12 +3597,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch01-tour-basic.xml:162 +#: ../en/ch02-tour-basic.xml:164 msgid "What's in a repository?" msgstr "什么是版本库?" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:164 +#: ../en/ch02-tour-basic.xml:166 msgid "" "When we take a more detailed look inside a repository, we can see that it " "contains a directory named <filename class=\"directory\">.hg</filename>. " @@ -2458,7 +3610,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:171 +#: ../en/ch02-tour-basic.xml:173 msgid "" "The contents of the <filename class=\"directory\">.hg</filename> directory " "and its subdirectories are private to Mercurial. Every other file and " @@ -2466,7 +3618,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:177 +#: ../en/ch02-tour-basic.xml:179 msgid "" "To introduce a little terminology, the <filename class=\"directory\">.hg</" "filename> directory is the <quote>real</quote> repository, and all of the " @@ -2479,12 +3631,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch01-tour-basic.xml:192 +#: ../en/ch02-tour-basic.xml:194 msgid "A tour through history" msgstr "回溯历史" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:194 +#: ../en/ch02-tour-basic.xml:196 msgid "" "One of the first things we might want to do with a new, unfamiliar repository " "is understand its history. The <command role=\"hg-cmd\">hg log</command> " @@ -2492,7 +3644,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:201 +#: ../en/ch02-tour-basic.xml:203 msgid "" "By default, this command prints a brief paragraph of output for each change " "to the project that was recorded. In Mercurial terminology, we call each of " @@ -2501,27 +3653,26 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:207 +#: ../en/ch02-tour-basic.xml:209 msgid "" "The fields in a record of output from <command role=\"hg-cmd\">hg log</" "command> are as follows." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch01-tour-basic.xml:211 +#: ../en/ch02-tour-basic.xml:213 msgid "" "<literal>changeset</literal>: This field has the format of a number, followed " "by a colon, followed by a hexadecimal (or <emphasis>hex</emphasis>) string. " "These are <emphasis>identifiers</emphasis> for the changeset. The hex string " "is a unique identifier: the same hex string will always refer to the same " -"changeset. The number is shorter and easier to type than the hex string, but " -"it isn't unique: the same number in two different clones of a repository may " -"identify different changesets. Why provide the number at all, then? For " -"local convenience." +"changeset in every copy of this repository. The number is shorter and easier " +"to type than the hex string, but it isn't unique: the same number in two " +"different clones of a repository may identify different changesets." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch01-tour-basic.xml:223 +#: ../en/ch02-tour-basic.xml:224 msgid "" "<literal>user</literal>: The identity of the person who created the " "changeset. This is a free-form field, but it most often contains a person's " @@ -2529,7 +3680,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch01-tour-basic.xml:227 +#: ../en/ch02-tour-basic.xml:228 msgid "" "<literal>date</literal>: The date and time on which the changeset was " "created, and the timezone in which it was created. (The date and time are " @@ -2538,14 +3689,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch01-tour-basic.xml:232 +#: ../en/ch02-tour-basic.xml:233 msgid "" "<literal>summary</literal>: The first line of the text message that the " "creator of the changeset entered to describe the changeset." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch01-tour-basic.xml:236 +#: ../en/ch02-tour-basic.xml:237 msgid "" "Some changesets, such as the first in the list above, have a <literal>tag</" "literal> field. A tag is another way to identify a changeset, by giving it " @@ -2554,14 +3705,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:244 +#: ../en/ch02-tour-basic.xml:245 msgid "" "The default output printed by <command role=\"hg-cmd\">hg log</command> is " "purely a summary; it is missing a lot of detail." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:248 +#: ../en/ch02-tour-basic.xml:249 msgid "" "<xref linkend=\"fig:tour-basic:history\"/> provides a graphical " "representation of the history of the <filename class=\"directory\">hello</" @@ -2571,45 +3722,47 @@ msgstr "" #. type: Content of: <book><chapter><sect1><figure><title> -#: ../en/ch01-tour-basic.xml:257 +#: ../en/ch02-tour-basic.xml:258 msgid "" "Graphical history of the <filename class=\"directory\">hello</filename> " "repository" msgstr "版本库 <filename class=\"directory\">hello</filename> 的历史图" #. type: Content of: <book><chapter><sect1><figure> -#: ../en/ch01-tour-basic.xml:259 ../en/ch02-tour-merge.xml:50 -#: ../en/ch02-tour-merge.xml:181 ../en/ch03-concepts.xml:293 +#: ../en/ch02-tour-basic.xml:260 ../en/ch03-tour-merge.xml:61 +#: ../en/ch03-tour-merge.xml:207 ../en/ch04-concepts.xml:290 msgid "<placeholder type=\"mediaobject\" id=\"0\"/>" msgstr "" #. type: Content of: <book><chapter><sect1><figure><mediaobject> -#: ../en/ch01-tour-basic.xml:260 +#: ../en/ch02-tour-basic.xml:261 msgid "" "<imageobject><imagedata fileref=\"figs/tour-history.png\"/></imageobject>" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject><textobject><phrase> -#: ../en/ch01-tour-basic.xml:261 ../en/ch02-tour-merge.xml:52 -#: ../en/ch02-tour-merge.xml:82 ../en/ch02-tour-merge.xml:129 -#: ../en/ch02-tour-merge.xml:183 ../en/ch02-tour-merge.xml:254 -#: ../en/ch03-concepts.xml:57 ../en/ch03-concepts.xml:106 -#: ../en/ch03-concepts.xml:191 ../en/ch03-concepts.xml:295 -#: ../en/ch03-concepts.xml:346 ../en/ch03-concepts.xml:361 -#: ../en/ch03-concepts.xml:402 ../en/ch03-concepts.xml:422 -#: ../en/ch03-concepts.xml:465 ../en/ch05-collab.xml:276 -#: ../en/ch08-undo.xml:365 ../en/ch08-undo.xml:412 ../en/ch08-undo.xml:477 -#: ../en/ch08-undo.xml:515 ../en/ch11-mq.xml:412 +#: ../en/ch02-tour-basic.xml:262 ../en/ch03-tour-merge.xml:63 +#: ../en/ch03-tour-merge.xml:95 ../en/ch03-tour-merge.xml:182 +#: ../en/ch03-tour-merge.xml:209 ../en/ch03-tour-merge.xml:279 +#: ../en/ch04-concepts.xml:59 ../en/ch04-concepts.xml:108 +#: ../en/ch04-concepts.xml:198 ../en/ch04-concepts.xml:292 +#: ../en/ch04-concepts.xml:347 ../en/ch04-concepts.xml:362 +#: ../en/ch04-concepts.xml:403 ../en/ch04-concepts.xml:423 +#: ../en/ch04-concepts.xml:469 ../en/ch06-collab.xml:316 +#: ../en/ch09-undo.xml:344 ../en/ch09-undo.xml:391 ../en/ch09-undo.xml:464 +#: ../en/ch09-undo.xml:502 ../en/ch09-undo.xml:658 ../en/ch09-undo.xml:682 +#: ../en/ch09-undo.xml:700 ../en/ch09-undo.xml:714 ../en/ch09-undo.xml:727 +#: ../en/ch12-mq.xml:413 msgid "XXX add text" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch01-tour-basic.xml:266 +#: ../en/ch02-tour-basic.xml:267 msgid "Changesets, revisions, and talking to other people" msgstr "修改集,版本,与其它用户交互" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:269 +#: ../en/ch02-tour-basic.xml:270 msgid "" "As English is a notoriously sloppy language, and computer science has a " "hallowed history of terminological confusion (why use one term when four will " @@ -2621,7 +3774,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:279 +#: ../en/ch02-tour-basic.xml:280 msgid "" "While it doesn't matter what <emphasis>word</emphasis> you use to refer to " "the concept of <quote>a changeset</quote>, the <emphasis>identifier</" @@ -2632,14 +3785,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch01-tour-basic.xml:288 +#: ../en/ch02-tour-basic.xml:289 msgid "" "The revision number is a handy notation that is <emphasis>only valid in that " "repository</emphasis>." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch01-tour-basic.xml:291 +#: ../en/ch02-tour-basic.xml:292 msgid "" "The hexadecimal string is the <emphasis>permanent, unchanging identifier</" "emphasis> that will always identify that exact changeset in <emphasis>every</" @@ -2647,7 +3800,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:297 +#: ../en/ch02-tour-basic.xml:298 msgid "" "This distinction is important. If you send someone an email talking about " "<quote>revision 33</quote>, there's a high likelihood that their revision 33 " @@ -2660,7 +3813,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:309 +#: ../en/ch02-tour-basic.xml:310 msgid "" "Mercurial uses revision numbers purely as a convenient shorthand. If you " "need to discuss a changeset with someone, or make a record of a changeset for " @@ -2669,12 +3822,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch01-tour-basic.xml:317 +#: ../en/ch02-tour-basic.xml:318 msgid "Viewing specific revisions" msgstr "察看指定版本" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:319 +#: ../en/ch02-tour-basic.xml:320 msgid "" "To narrow the output of <command role=\"hg-cmd\">hg log</command> down to a " "single revision, use the <option role=\"hg-opt-log\">-r</option> (or <option " @@ -2684,7 +3837,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:328 +#: ../en/ch02-tour-basic.xml:329 msgid "" "If you want to see the history of several revisions without having to list " "each one, you can use <emphasis>range notation</emphasis>; this lets you " @@ -2693,7 +3846,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:336 +#: ../en/ch02-tour-basic.xml:337 msgid "" "Mercurial also honours the order in which you specify revisions, so <command " "role=\"hg-cmd\">hg log -r 2:4</command> prints 2, 3, and 4. while <command " @@ -2701,12 +3854,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch01-tour-basic.xml:343 +#: ../en/ch02-tour-basic.xml:344 msgid "More detailed information" msgstr "更详细的信息" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:345 +#: ../en/ch02-tour-basic.xml:346 msgid "" "While the summary information printed by <command role=\"hg-cmd\">hg log</" "command> is useful if you already know what you're looking for, you may need " @@ -2718,7 +3871,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:357 +#: ../en/ch02-tour-basic.xml:358 msgid "" "If you want to see both the description and content of a change, add the " "<option role=\"hg-opt-log\">-p</option> (or <option role=\"hg-opt-log\">--" @@ -2728,19 +3881,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:367 +#: ../en/ch02-tour-basic.xml:368 msgid "" "The <option role=\"hg-opt-log\">-p</option> option is tremendously useful, so " "it's well worth remembering." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch01-tour-basic.xml:374 +#: ../en/ch02-tour-basic.xml:375 msgid "All about command options" msgstr "命令选项" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:376 +#: ../en/ch02-tour-basic.xml:377 msgid "" "Let's take a brief break from exploring Mercurial commands to discuss a " "pattern in the way that they work; you may find this useful to keep in mind " @@ -2748,7 +3901,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:380 +#: ../en/ch02-tour-basic.xml:381 msgid "" "Mercurial has a consistent and straightforward approach to dealing with the " "options that you can pass to commands. It follows the conventions for " @@ -2756,7 +3909,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch01-tour-basic.xml:387 +#: ../en/ch02-tour-basic.xml:388 msgid "" "Every option has a long name. For example, as we've already seen, the " "<command role=\"hg-cmd\">hg log</command> command accepts a <option role=\"hg-" @@ -2764,7 +3917,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch01-tour-basic.xml:393 +#: ../en/ch02-tour-basic.xml:394 msgid "" "Most options have short names, too. Instead of <option role=\"hg-opt-log\">--" "rev</option>, we can use <option role=\"hg-opt-log\">-r</option>. (The " @@ -2773,7 +3926,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch01-tour-basic.xml:400 +#: ../en/ch02-tour-basic.xml:401 msgid "" "Long options start with two dashes (e.g. <option role=\"hg-opt-log\">--rev</" "option>), while short options start with one (e.g. <option role=\"hg-opt-log" @@ -2781,7 +3934,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch01-tour-basic.xml:406 +#: ../en/ch02-tour-basic.xml:407 msgid "" "Option naming and usage is consistent across commands. For example, every " "command that lets you specify a changeset ID or revision number accepts both " @@ -2790,7 +3943,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch01-tour-basic.xml:413 +#: ../en/ch02-tour-basic.xml:414 msgid "" "If you are using short options, you can save typing by running them together. " "For example, the command <command role=\"hg-cmd\">hg log -v -p -r 2</command> " @@ -2798,15 +3951,15 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:420 -msgid "" -"In the examples throughout this book, I use short options instead of long. " -"This just reflects my own preference, so don't read anything significant into " -"it." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:424 +#: ../en/ch02-tour-basic.xml:421 +msgid "" +"In the examples throughout this book, I usually use short options instead of " +"long. This simply reflects my own preference, so don't read anything " +"significant into it." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch02-tour-basic.xml:425 msgid "" "Most commands that print output of some kind will print more output when " "passed a <option role=\"hg-opt-global\">-v</option> (or <option role=\"hg-opt-" @@ -2815,12 +3968,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><note><title> -#: ../en/ch01-tour-basic.xml:431 +#: ../en/ch02-tour-basic.xml:432 msgid "Option naming consistency" msgstr "" #. type: Content of: <book><chapter><sect1><note><para> -#: ../en/ch01-tour-basic.xml:433 +#: ../en/ch02-tour-basic.xml:434 msgid "" "Almost always, Mercurial commands use consistent option names to refer to the " "same concepts. For instance, if a command deals with changesets, you'll " @@ -2830,19 +3983,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch01-tour-basic.xml:444 +#: ../en/ch02-tour-basic.xml:445 msgid "Making and reviewing changes" msgstr "创建和复审修改" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:446 +#: ../en/ch02-tour-basic.xml:447 msgid "" "Now that we have a grasp of viewing history in Mercurial, let's take a look " "at making some changes and examining them." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:450 +#: ../en/ch02-tour-basic.xml:451 msgid "" "The first thing we'll do is isolate our experiment in a repository of its " "own. We use the <command role=\"hg-cmd\">hg clone</command> command, but we " @@ -2853,7 +4006,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para><footnote><para> -#: ../en/ch01-tour-basic.xml:457 +#: ../en/ch02-tour-basic.xml:458 msgid "" "The saving of space arises when source and destination repositories are on " "the same filesystem, in which case Mercurial will use hardlinks to do copy-on-" @@ -2863,7 +4016,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:467 +#: ../en/ch02-tour-basic.xml:468 msgid "" "As an aside, it's often good practice to keep a <quote>pristine</quote> copy " "of a remote repository around, which you can then make temporary clones of to " @@ -2875,7 +4028,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:476 +#: ../en/ch02-tour-basic.xml:477 msgid "" "In our <filename class=\"directory\">my-hello</filename> repository, we have " "a file <filename>hello.c</filename> that contains the classic <quote>hello, " @@ -2883,19 +4036,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:482 +#: ../en/ch02-tour-basic.xml:483 msgid "Let's edit this file so that it prints a second line of output." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:487 +#: ../en/ch02-tour-basic.xml:488 msgid "" "Mercurial's <command role=\"hg-cmd\">hg status</command> command will tell us " "what Mercurial knows about the files in the repository." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:493 +#: ../en/ch02-tour-basic.xml:494 msgid "" "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 " @@ -2905,7 +4058,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:500 +#: ../en/ch02-tour-basic.xml:501 msgid "" "The <quote><literal>M</literal></quote> indicates that Mercurial has noticed " "that we modified <filename>hello.c</filename>. We didn't need to " @@ -2915,7 +4068,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:508 +#: ../en/ch02-tour-basic.xml:509 msgid "" "It's somewhat helpful to know that we've modified <filename>hello.c</" "filename>, but we might prefer to know exactly <emphasis>what</emphasis> " @@ -2924,24 +4077,24 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch01-tour-basic.xml:517 ../en/ch11-mq.xml:187 +#: ../en/ch02-tour-basic.xml:518 ../en/ch12-mq.xml:187 msgid "Understanding patches" msgstr "理解补丁" #. type: Content of: <book><chapter><sect1><tip><para> -#: ../en/ch01-tour-basic.xml:519 +#: ../en/ch02-tour-basic.xml:520 msgid "" "Remember to take a look at <xref linkend=\"sec:mq:patch\"/> if you don't know " "how to read output above." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch01-tour-basic.xml:525 +#: ../en/ch02-tour-basic.xml:526 msgid "Recording changes in a new changeset" msgstr "在新修改集中记录修改" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:527 +#: ../en/ch02-tour-basic.xml:528 msgid "" "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 " @@ -2950,7 +4103,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:534 +#: ../en/ch02-tour-basic.xml:535 msgid "" "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 " @@ -2958,12 +4111,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch01-tour-basic.xml:540 +#: ../en/ch02-tour-basic.xml:541 msgid "Setting up a username" msgstr "配置用户名称" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:542 +#: ../en/ch02-tour-basic.xml:543 msgid "" "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 " @@ -2974,7 +4127,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch01-tour-basic.xml:551 +#: ../en/ch02-tour-basic.xml:552 msgid "" "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, " @@ -2982,14 +4135,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch01-tour-basic.xml:556 +#: ../en/ch02-tour-basic.xml:557 msgid "" "If you have set the <envar>HGUSER</envar> environment variable, this is " "checked next." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch01-tour-basic.xml:559 +#: ../en/ch02-tour-basic.xml:560 msgid "" "If you create a file in your home directory called <filename role=\"special" "\">.hgrc</filename>, with a <envar role=\"rc-item-ui\">username</envar> " @@ -2998,14 +4151,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch01-tour-basic.xml:567 +#: ../en/ch02-tour-basic.xml:568 msgid "" "If you have set the <envar>EMAIL</envar> environment variable, this will be " "used next." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch01-tour-basic.xml:570 +#: ../en/ch02-tour-basic.xml:571 msgid "" "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 " @@ -3014,7 +4167,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:577 +#: ../en/ch02-tour-basic.xml:578 msgid "" "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 " @@ -3022,7 +4175,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:581 +#: ../en/ch02-tour-basic.xml:582 msgid "" "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-" @@ -3033,27 +4186,47 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><title> -#: ../en/ch01-tour-basic.xml:590 +#: ../en/ch02-tour-basic.xml:591 msgid "Creating a Mercurial configuration file" msgstr "创建 Mercurial 的配置文件" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch01-tour-basic.xml:592 -msgid "" -"To set a user name, use your favourite editor to create a file called " +#: ../en/ch02-tour-basic.xml:593 +msgid "" +"To set a user name, use your favorite editor to create a file called " "<filename role=\"special\">.hgrc</filename> in your home directory. " "Mercurial will use this file to look up your personalised configuration " "settings. The initial contents of your <filename role=\"special\">.hgrc</" "filename> should look like this." msgstr "" -#. type: Content of: <book><chapter><sect1><sect2><sect3><remark> -#: ../en/ch01-tour-basic.xml:600 -msgid "Figure out what the appropriate directory is on Windows." -msgstr "" +#. type: Content of: <book><chapter><sect1><sect2><sect3><tip><title> +#: ../en/ch02-tour-basic.xml:602 +msgid "<quote>Home directory</quote> on Windows" +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><sect3><tip><para> +#: ../en/ch02-tour-basic.xml:604 +msgid "" +"When we refer to your home directory, on an English language installation of " +"Windows this will usually be a folder named after your user name in " +"<filename>C:\\Documents and Settings</filename>. You can find out the exact " +"name of your home directory by opening a command prompt window and running " +"the following command." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><sect3><tip><screen><prompt> +#: ../en/ch02-tour-basic.xml:612 +msgid "C:\\>" +msgstr "C:\\>" + +#. type: Content of: <book><chapter><sect1><sect2><sect3><tip><screen><userinput> +#: ../en/ch02-tour-basic.xml:612 +msgid "echo %UserProfile%" +msgstr "echo %UserProfile%" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch01-tour-basic.xml:607 +#: ../en/ch02-tour-basic.xml:619 msgid "" "The <quote><literal>[ui]</literal></quote> line begins a <emphasis>section</" "emphasis> of the config file, so you can read the <quote><literal>username " @@ -3065,12 +4238,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><title> -#: ../en/ch01-tour-basic.xml:620 +#: ../en/ch02-tour-basic.xml:632 msgid "Choosing a user name" msgstr "选择用户名称" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch01-tour-basic.xml:622 +#: ../en/ch02-tour-basic.xml:634 msgid "" "You can use any text you like as the value of the <literal>username</literal> " "config item, since this information is for reading by other people, but will " @@ -3079,7 +4252,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><note><para> -#: ../en/ch01-tour-basic.xml:629 +#: ../en/ch02-tour-basic.xml:641 msgid "" "Mercurial's built-in web server obfuscates email addresses, to make it more " "difficult for the email harvesting tools that spammers use. This reduces the " @@ -3088,12 +4261,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch01-tour-basic.xml:639 +#: ../en/ch02-tour-basic.xml:650 msgid "Writing a commit message" msgstr "写提交日志" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:641 +#: ../en/ch02-tour-basic.xml:652 msgid "" "When we commit a change, Mercurial drops us into a text editor, to enter a " "message that will describe the modifications we've made in this changeset. " @@ -3103,7 +4276,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:651 +#: ../en/ch02-tour-basic.xml:662 msgid "" "The editor that the <command role=\"hg-cmd\">hg commit</command> command " "drops us into will contain an empty line or two, followed by a number of " @@ -3111,7 +4284,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:665 +#: ../en/ch02-tour-basic.xml:676 msgid "" "Mercurial ignores the lines that start with <quote><literal>HG:</literal></" "quote>; it uses them only to tell us which files it's recording changes to. " @@ -3119,12 +4292,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch01-tour-basic.xml:671 +#: ../en/ch02-tour-basic.xml:682 msgid "Writing a good commit message" msgstr "写好提交日志" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:673 +#: ../en/ch02-tour-basic.xml:684 msgid "" "Since <command role=\"hg-cmd\">hg log</command> only prints the first line of " "a commit message by default, it's best to write a commit message whose first " @@ -3134,7 +4307,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:687 +#: ../en/ch02-tour-basic.xml:697 msgid "" "As far as the remainder of the contents of the commit message are concerned, " "there are no hard-and-fast rules. Mercurial itself doesn't interpret or care " @@ -3143,20 +4316,44 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:693 +#: ../en/ch02-tour-basic.xml:702 msgid "" "My personal preference is for short, but informative, commit messages that " "tell me something that I can't figure out with a quick glance at the output " "of <command role=\"hg-cmd\">hg log --patch</command>." msgstr "" +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch02-tour-basic.xml:706 +msgid "" +"If we run the <command role=\"hg-cmd\">hg commit</command> command without " +"any arguments, it records all of the changes we've made, as reported by " +"<command role=\"hg-cmd\">hg status</command> and <command role=\"hg-cmd\">hg " +"diff</command>." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><note><title> +#: ../en/ch02-tour-basic.xml:713 +msgid "A surprise for Subversion users" +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><note><para> +#: ../en/ch02-tour-basic.xml:715 +msgid "" +"Like other Mercurial commands, if we don't supply explicit names to commit to " +"the <command role=\"hg-cmd\">hg commit</command>, it will operate across a " +"repository's entire working directory. Be wary of this if you're coming from " +"the Subversion or CVS world, since you might expect it to operate only on the " +"current directory that you happen to be visiting and its subdirectories." +msgstr "" + #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch01-tour-basic.xml:700 +#: ../en/ch02-tour-basic.xml:726 msgid "Aborting a commit" msgstr "终止提交" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:702 +#: ../en/ch02-tour-basic.xml:728 msgid "" "If you decide that you don't want to commit while in the middle of editing a " "commit message, simply exit from your editor without saving the file that " @@ -3164,22 +4361,13 @@ "the working directory." msgstr "" -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:707 -msgid "" -"If we run the <command role=\"hg-cmd\">hg commit</command> command without " -"any arguments, it records all of the changes we've made, as reported by " -"<command role=\"hg-cmd\">hg status</command> and <command role=\"hg-cmd\">hg " -"diff</command>." -msgstr "" - #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch01-tour-basic.xml:714 +#: ../en/ch02-tour-basic.xml:736 msgid "Admiring our new handiwork" msgstr "欣赏我们的成果" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:716 +#: ../en/ch02-tour-basic.xml:738 msgid "" "Once we've finished the commit, we can use the <command role=\"hg-cmd\">hg " "tip</command> command to display the changeset we just created. This command " @@ -3188,14 +4376,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:725 +#: ../en/ch02-tour-basic.xml:746 msgid "" "We refer to the newest revision in the repository as the <emphasis>tip " "revision</emphasis>, or simply the <emphasis>tip</emphasis>." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:729 +#: ../en/ch02-tour-basic.xml:750 msgid "" "By the way, the <command role=\"hg-cmd\">hg tip</command> command accepts " "many of the same options as <command role=\"hg-cmd\">hg log</command>, so " @@ -3206,12 +4394,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch01-tour-basic.xml:741 +#: ../en/ch02-tour-basic.xml:762 msgid "Sharing changes" msgstr "共享修改" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch01-tour-basic.xml:743 +#: ../en/ch02-tour-basic.xml:764 msgid "" "We mentioned earlier that repositories in Mercurial are self-contained. This " "means that the changeset we just created exists only in our <filename class=" @@ -3220,12 +4408,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch01-tour-basic.xml:751 +#: ../en/ch02-tour-basic.xml:772 msgid "Pulling changes from another repository" msgstr "从其它版本库取得修改" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:752 +#: ../en/ch02-tour-basic.xml:774 msgid "" "To get started, let's clone our original <filename class=\"directory\">hello</" "filename> repository, which does not contain the change we just committed. " @@ -3234,7 +4422,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:760 +#: ../en/ch02-tour-basic.xml:782 msgid "" "We'll use the <command role=\"hg-cmd\">hg pull</command> command to bring " "changes from <filename class=\"directory\">my-hello</filename> into <filename " @@ -3247,8 +4435,34 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:773 -msgid "" +#: ../en/ch02-tour-basic.xml:795 +msgid "" +"Bringing changes into a repository is a simple matter of running the <command " +"role=\"hg-cmd\">hg pull</command> command, and optionally telling it which " +"repository to pull from." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch02-tour-basic.xml:801 +msgid "" +"As you can see from the before-and-after output of <command role=\"hg-cmd" +"\">hg tip</command>, we have successfully pulled changes into our " +"repository. However, Mercurial separates pulling changes in from updating " +"the working directory. There remains one step before we will see the changes " +"that we just pulled appear in the working directory." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><tip><title> +#: ../en/ch02-tour-basic.xml:810 +msgid "Pulling specific changes" +msgstr "提取指定的修改" + +#. type: Content of: <book><chapter><sect1><sect2><tip><para> +#: ../en/ch02-tour-basic.xml:812 +msgid "" +"It is possible that due to the delay between running <command role=\"hg-cmd" +"\">hg incoming</command> and <command role=\"hg-cmd\">hg pull</command>, you " +"may not see all changesets that will be brought from the other repository. " "Suppose you're pulling changes from a repository on the network somewhere. " "While you are looking at the <command role=\"hg-cmd\">hg incoming</command> " "output, and before you pull those changes, someone might have committed " @@ -3257,30 +4471,22 @@ "command>." msgstr "" -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:781 -msgid "" -"Bringing changes into a repository is a simple matter of running the <command " -"role=\"hg-cmd\">hg pull</command> command, and telling it which repository to " -"pull from." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:788 -msgid "" -"As you can see from the before-and-after output of <command role=\"hg-cmd" -"\">hg tip</command>, we have successfully pulled changes into our " -"repository. There remains one step before we can see these changes in the " -"working directory." +#. type: Content of: <book><chapter><sect1><sect2><tip><para> +#: ../en/ch02-tour-basic.xml:824 +msgid "" +"If you only want to pull precisely the changes that were listed by <command " +"role=\"hg-cmd\">hg incoming</command>, or you have some other reason to pull " +"a subset of changes, simply identify the change that you want to pull by its " +"changeset ID, e.g. <command>hg pull -r7e95bb</command>." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch01-tour-basic.xml:796 +#: ../en/ch02-tour-basic.xml:834 msgid "Updating the working directory" msgstr "更新工作目录" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:798 +#: ../en/ch02-tour-basic.xml:836 msgid "" "We have so far glossed over the relationship between a repository and its " "working directory. The <command role=\"hg-cmd\">hg pull</command> command " @@ -3292,7 +4498,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:810 +#: ../en/ch02-tour-basic.xml:848 msgid "" "It might seem a bit strange that <command role=\"hg-cmd\">hg pull</command> " "doesn't update the working directory automatically. There's actually a good " @@ -3306,31 +4512,31 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:821 -msgid "" -"However, since pull-then-update is such a common thing to do, Mercurial lets " -"you combine the two by passing the <option role=\"hg-opt-pull\">-u</option> " -"option to <command role=\"hg-cmd\">hg pull</command>." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:826 +#: ../en/ch02-tour-basic.xml:860 +msgid "" +"Since pull-then-update is such a common sequence of operations, Mercurial " +"lets you combine the two by passing the <option role=\"hg-opt-pull\">-u</" +"option> option to <command role=\"hg-cmd\">hg pull</command>." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch02-tour-basic.xml:865 msgid "" "If you look back at the output of <command role=\"hg-cmd\">hg pull</command> " "in <xref linkend=\"sec:tour:pull\"/> when we ran it without <option role=\"hg-" "opt-pull\">-u</option>, you can see that it printed a helpful reminder that " -"we'd have to take an explicit step to update the working directory:" -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:835 +"we'd have to take an explicit step to update the working directory." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch02-tour-basic.xml:872 msgid "" "To find out what revision the working directory is at, use the <command role=" "\"hg-cmd\">hg parents</command> command." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:841 +#: ../en/ch02-tour-basic.xml:878 msgid "" "If you look back at <xref linkend=\"fig:tour-basic:history\"/>, you'll see " "arrows connecting each changeset. The node that the arrow leads " @@ -3341,7 +4547,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:850 +#: ../en/ch02-tour-basic.xml:887 msgid "" "To update the working directory to a particular revision, give a revision " "number or changeset ID to the <command role=\"hg-cmd\">hg update</command> " @@ -3349,7 +4555,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:857 +#: ../en/ch02-tour-basic.xml:893 msgid "" "If you omit an explicit revision, <command role=\"hg-cmd\">hg update</" "command> will update to the tip revision, as shown by the second call to " @@ -3357,35 +4563,35 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch01-tour-basic.xml:865 +#: ../en/ch02-tour-basic.xml:901 msgid "Pushing changes to another repository" msgstr "发布修改到其它版本库" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:867 +#: ../en/ch02-tour-basic.xml:903 msgid "" "Mercurial lets us push changes to another repository, from the repository " -"we're currently visiting. As with the example of <command role=\"hg-cmd\">hg " +"we're currently visiting. As with the example of <command role=\"hg-cmd\">hg " "pull</command> above, we'll create a temporary repository to push our changes " "into." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:875 +#: ../en/ch02-tour-basic.xml:911 msgid "" "The <command role=\"hg-cmd\">hg outgoing</command> command tells us what " "changes would be pushed into another repository." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:881 +#: ../en/ch02-tour-basic.xml:917 msgid "" "And the <command role=\"hg-cmd\">hg push</command> command does the actual " "push." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:887 +#: ../en/ch02-tour-basic.xml:922 msgid "" "As with <command role=\"hg-cmd\">hg pull</command>, the <command role=\"hg-cmd" "\">hg push</command> command does not update the working directory in the " @@ -3399,19 +4605,53 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:899 +#: ../en/ch02-tour-basic.xml:934 msgid "" "What happens if we try to pull or push changes and the receiving repository " "already has those changes? Nothing too exciting." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch01-tour-basic.xml:906 +#: ../en/ch02-tour-basic.xml:942 +msgid "Default locations" +msgstr "默认位置" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch02-tour-basic.xml:944 +msgid "" +"When we clone a repository, Mercurial records the location of the repository " +"we cloned in the <filename>.hg/hgrc</filename> file of the new repository. " +"If we don't supply a location to <command>hg pull</command> from or " +"<command>hg push</command> to, those commands will use this location as a " +"default. The <command>hg incoming</command> and <command>hg outgoing</" +"command> commands do so too." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch02-tour-basic.xml:952 +msgid "" +"If you open a repository's <filename>.hg/hgrc</filename> file in a text " +"editor, you will see contents like the following." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch02-tour-basic.xml:959 +msgid "" +"It is possible&emdash;and often useful&emdash;to have the default location " +"for <command>hg push</command> and <command>hg outgoing</command> be " +"different from those for <command>hg pull</command> and <command>hg incoming</" +"command>. We can do this by adding a <literal>default-push</literal> entry " +"to the <literal>[paths]</literal> section of the <filename>.hg/hgrc</" +"filename> file, as follows." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><title> +#: ../en/ch02-tour-basic.xml:973 msgid "Sharing changes over a network" msgstr "通过网络共享修改" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:908 +#: ../en/ch02-tour-basic.xml:975 msgid "" "The commands we have covered in the previous few sections are not limited to " "working with local repositories. Each works in exactly the same fashion over " @@ -3419,20 +4659,70 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch01-tour-basic.xml:916 +#: ../en/ch02-tour-basic.xml:983 msgid "" "In this example, we can see what changes we could push to the remote " "repository, but the repository is understandably not set up to let anonymous " "users push to it." msgstr "" +#. type: Content of: <book><chapter><sect1><title> +#: ../en/ch02-tour-basic.xml:993 +msgid "Starting a new project" +msgstr "开始新项目" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch02-tour-basic.xml:995 +msgid "" +"It is just as easy to begin a new project as to work on one that already " +"exists. The <command>hg init</command> command creates a new, empty " +"Mercurial repository." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch02-tour-basic.xml:1001 +msgid "" +"This simply creates a repository named <filename>myproject</filename> in the " +"current directory." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch02-tour-basic.xml:1006 +msgid "" +"We can tell that <filename>myproject</filename> is a Mercurial repository, " +"because it contains a <filename>.hg</filename> directory." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch02-tour-basic.xml:1012 +msgid "" +"If we want to add some pre-existing files to the repository, we copy them " +"into place, and tell Mercurial to start tracking them using the <command>hg " +"add</command> command." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch02-tour-basic.xml:1018 +msgid "" +"Once we are satisfied that our project looks right, we commit our changes." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch02-tour-basic.xml:1023 +msgid "" +"It takes just a few moments to start using Mercurial on a new project, which " +"is part of its appeal. Revision control is now so easy to work with, we can " +"use it on the smallest of projects that we might not have considered with a " +"more complicated tool." +msgstr "" + #. type: Content of: <book><chapter><title> -#: ../en/ch02-tour-merge.xml:5 +#: ../en/ch03-tour-merge.xml:5 msgid "A tour of Mercurial: merging work" msgstr "Mercurial 教程: 合并工作" #. type: Content of: <book><chapter><para> -#: ../en/ch02-tour-merge.xml:7 +#: ../en/ch03-tour-merge.xml:7 msgid "" "We've now covered cloning a repository, making changes in a repository, and " "pulling or pushing changes from one repository into another. Our next step " @@ -3440,19 +4730,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch02-tour-merge.xml:13 +#: ../en/ch03-tour-merge.xml:13 msgid "Merging streams of work" msgstr "合并的流程" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch02-tour-merge.xml:15 +#: ../en/ch03-tour-merge.xml:15 msgid "" "Merging is a fundamental part of working with a distributed revision control " -"tool." +"tool. Here are a few cases in which the need to merge work arises." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch02-tour-merge.xml:18 +#: ../en/ch03-tour-merge.xml:20 msgid "" "Alice and Bob each have a personal copy of a repository for a project they're " "collaborating on. Alice fixes a bug in her repository; Bob adds a new " @@ -3461,31 +4751,37 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch02-tour-merge.xml:24 -msgid "" -"I frequently work on several different tasks for a single project at once, " -"each safely isolated in its own repository. Working this way means that I " -"often need to merge one piece of my own work with another." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch02-tour-merge.xml:30 -msgid "" -"Because merging is such a common thing to need to do, Mercurial makes it " -"easy. Let's walk through the process. We'll begin by cloning yet another " -"repository (see how often they spring up?) and making a change in it." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch02-tour-merge.xml:37 +#: ../en/ch03-tour-merge.xml:27 +msgid "" +"Cynthia frequently works on several different tasks for a single project at " +"once, each safely isolated in its own repository. Working this way means that " +"she often needs to merge one piece of her own work with another." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch03-tour-merge.xml:35 +msgid "" +"Because we need to merge often, Mercurial makes the process easy. Let's walk " +"through a merge. We'll begin by cloning yet another repository (see how " +"often they spring up?) and making a change in it." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch03-tour-merge.xml:42 msgid "" "We should now have two copies of <filename>hello.c</filename> with different " "contents. The histories of the two repositories have also diverged, as " -"illustrated in <xref linkend=\"fig:tour-merge:sep-repos\"/>." +"illustrated in <xref linkend=\"fig:tour-merge:sep-repos\"/>. Here is a copy " +"of our file from one repository." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch03-tour-merge.xml:51 +msgid "And here is our slightly different version from the other repository." msgstr "" #. type: Content of: <book><chapter><sect1><figure><title> -#: ../en/ch02-tour-merge.xml:46 +#: ../en/ch03-tour-merge.xml:57 msgid "" "Divergent recent histories of the <filename class=\"directory\">my-hello</" "filename> and <filename class=\"directory\">my-new-hello</filename> " @@ -3495,14 +4791,14 @@ "\"directory\">my-new-hello</filename> 最新的历史分叉" #. type: Content of: <book><chapter><sect1><figure><mediaobject> -#: ../en/ch02-tour-merge.xml:51 +#: ../en/ch03-tour-merge.xml:62 msgid "" "<imageobject><imagedata fileref=\"figs/tour-merge-sep-repos.png\"/></" "imageobject>" msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch02-tour-merge.xml:56 +#: ../en/ch03-tour-merge.xml:67 msgid "" "We already know that pulling changes from our <filename class=\"directory" "\">my-hello</filename> repository will have no effect on the working " @@ -3510,28 +4806,29 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch02-tour-merge.xml:62 +#: ../en/ch03-tour-merge.xml:73 msgid "" "However, the <command role=\"hg-cmd\">hg pull</command> command says " "something about <quote>heads</quote>." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch02-tour-merge.xml:66 +#: ../en/ch03-tour-merge.xml:77 msgid "Head changesets" msgstr "顶点修改集" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch02-tour-merge.xml:68 -msgid "" -"A head is a change that has no descendants, or children, as they're also " -"known. The tip revision is thus a head, because the newest revision in a " -"repository doesn't have any children, but a repository can contain more than " -"one head." +#: ../en/ch03-tour-merge.xml:79 +msgid "" +"Remember that Mercurial records what the parent of each change is. If a " +"change has a parent, we call it a child or descendant of the parent. A head " +"is a change that has no children. The tip revision is thus a head, because " +"the newest revision in a repository doesn't have any children. There are " +"times when a repository can contain more than one head." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><figure><title> -#: ../en/ch02-tour-merge.xml:75 +#: ../en/ch03-tour-merge.xml:88 msgid "" "Repository contents after pulling from <filename class=\"directory\">my-" "hello</filename> into <filename class=\"directory\">my-new-hello</filename>" @@ -3540,25 +4837,27 @@ "\"directory\">my-new-hello</filename> 之后版本库的内容" #. type: Content of: <book><chapter><sect1><sect2><figure> -#: ../en/ch02-tour-merge.xml:78 ../en/ch02-tour-merge.xml:125 -#: ../en/ch02-tour-merge.xml:250 ../en/ch03-concepts.xml:55 -#: ../en/ch03-concepts.xml:104 ../en/ch03-concepts.xml:189 -#: ../en/ch03-concepts.xml:344 ../en/ch03-concepts.xml:359 -#: ../en/ch03-concepts.xml:400 ../en/ch03-concepts.xml:420 -#: ../en/ch03-concepts.xml:461 ../en/ch05-collab.xml:274 -#: ../en/ch08-undo.xml:363 ../en/ch08-undo.xml:410 ../en/ch08-undo.xml:475 -#: ../en/ch08-undo.xml:513 ../en/ch11-mq.xml:410 +#: ../en/ch03-tour-merge.xml:91 ../en/ch03-tour-merge.xml:178 +#: ../en/ch03-tour-merge.xml:275 ../en/ch04-concepts.xml:57 +#: ../en/ch04-concepts.xml:106 ../en/ch04-concepts.xml:196 +#: ../en/ch04-concepts.xml:345 ../en/ch04-concepts.xml:360 +#: ../en/ch04-concepts.xml:401 ../en/ch04-concepts.xml:421 +#: ../en/ch04-concepts.xml:465 ../en/ch06-collab.xml:314 +#: ../en/ch09-undo.xml:342 ../en/ch09-undo.xml:389 ../en/ch09-undo.xml:462 +#: ../en/ch09-undo.xml:500 ../en/ch09-undo.xml:656 ../en/ch09-undo.xml:680 +#: ../en/ch09-undo.xml:698 ../en/ch09-undo.xml:712 ../en/ch09-undo.xml:725 +#: ../en/ch12-mq.xml:411 msgid " <placeholder type=\"mediaobject\" id=\"0\"/>" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject> -#: ../en/ch02-tour-merge.xml:79 +#: ../en/ch03-tour-merge.xml:92 msgid "" "<imageobject> <imagedata fileref=\"figs/tour-merge-pull.png\"/> </imageobject>" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch02-tour-merge.xml:86 +#: ../en/ch03-tour-merge.xml:99 msgid "" "In <xref linkend=\"fig:tour-merge:pull\"/>, you can see the effect of the " "pull from <filename class=\"directory\">my-hello</filename> into <filename " @@ -3574,55 +4873,51 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch02-tour-merge.xml:105 +#: ../en/ch03-tour-merge.xml:118 msgid "Performing the merge" msgstr "执行合并" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch02-tour-merge.xml:107 +#: ../en/ch03-tour-merge.xml:120 msgid "" "What happens if we try to use the normal <command role=\"hg-cmd\">hg update</" "command> command to update to the new tip?" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch02-tour-merge.xml:113 +#: ../en/ch03-tour-merge.xml:126 msgid "" "Mercurial is telling us that the <command role=\"hg-cmd\">hg update</command> " "command won't do a merge; it won't update the working directory when it " -"thinks we might be wanting to do a merge, unless we force it to do so. " -"Instead, we use the <command role=\"hg-cmd\">hg merge</command> command to " -"merge the two heads." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><figure><title> -#: ../en/ch02-tour-merge.xml:123 -msgid "Working directory and repository during merge, and following commit" -msgstr "在合并期间,以及提交之后的工作目录与版本库" - -#. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject> -#: ../en/ch02-tour-merge.xml:126 -msgid "" -"<imageobject> <imagedata fileref=\"figs/tour-merge-merge.png\"/> </" -"imageobject>" -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch02-tour-merge.xml:133 -msgid "" -"This updates the working directory so that it contains changes from " -"<emphasis>both</emphasis> heads, which is reflected in both the output of " -"<command role=\"hg-cmd\">hg parents</command> and the contents of " -"<filename>hello.c</filename>." +"thinks we might want to do a merge, unless we force it to do so. " +"(Incidentally, forcing the update with <command>hg update -C</command> would " +"revert any uncommitted changes in the working directory.)" +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch03-tour-merge.xml:134 +msgid "" +"To start a merge between the two heads, we use the <command role=\"hg-cmd" +"\">hg merge</command> command." +msgstr "" +"我们使用 <command role=\"hg-cmd\">hg merge</command> 命令来合并两个顶点。" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch03-tour-merge.xml:139 +msgid "" +"We resolve the contents of <filename>hello.c</filename> This updates the " +"working directory so that it contains changes from <emphasis>both</emphasis> " +"heads, which is reflected in both the output of <command role=\"hg-cmd\">hg " +"parents</command> and the contents of <filename>hello.c</filename>." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch02-tour-merge.xml:143 +#: ../en/ch03-tour-merge.xml:151 msgid "Committing the results of the merge" msgstr "提交合并结果" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch02-tour-merge.xml:145 +#: ../en/ch03-tour-merge.xml:153 msgid "" "Whenever we've done a merge, <command role=\"hg-cmd\">hg parents</command> " "will display two parents until we <command role=\"hg-cmd\">hg commit</" @@ -3630,7 +4925,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch02-tour-merge.xml:152 +#: ../en/ch03-tour-merge.xml:160 msgid "" "We now have a new tip revision; notice that it has <emphasis>both</emphasis> " "of our former heads as its parents. These are the same revisions that were " @@ -3638,7 +4933,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch02-tour-merge.xml:159 +#: ../en/ch03-tour-merge.xml:167 msgid "" "In <xref linkend=\"fig:tour-merge:merge\"/>, you can see a representation of " "what happens to the working directory during the merge, and how this affects " @@ -3647,35 +4942,57 @@ "changeset." msgstr "" +#. type: Content of: <book><chapter><sect1><sect2><figure><title> +#: ../en/ch03-tour-merge.xml:176 +msgid "Working directory and repository during merge, and following commit" +msgstr "在合并期间,以及提交之后的工作目录与版本库" + +#. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject> +#: ../en/ch03-tour-merge.xml:179 +msgid "" +"<imageobject> <imagedata fileref=\"figs/tour-merge-merge.png\"/> </" +"imageobject>" +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch03-tour-merge.xml:186 +msgid "" +"We sometimes talk about a merge having <emphasis>sides</emphasis>: the left " +"side is the first parent in the output of <command role=\"hg-cmd\">hg " +"parents</command>, and the right side is the second. If the working " +"directory was at e.g. revision 5 before we began a merge, that revision will " +"become the left side of the merge." +msgstr "" + #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch02-tour-merge.xml:170 +#: ../en/ch03-tour-merge.xml:196 msgid "Merging conflicting changes" msgstr "合并有冲突的改变" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch02-tour-merge.xml:172 +#: ../en/ch03-tour-merge.xml:198 msgid "" "Most merges are simple affairs, but sometimes you'll find yourself merging " -"changes where each modifies the same portions of the same files. Unless both " -"modifications are identical, this results in a <emphasis>conflict</emphasis>, " -"where you have to decide how to reconcile the different changes into " -"something coherent." +"changes where each side modifies the same portions of the same files. Unless " +"both modifications are identical, this results in a <emphasis>conflict</" +"emphasis>, where you have to decide how to reconcile the different changes " +"into something coherent." msgstr "" #. type: Content of: <book><chapter><sect1><figure><title> -#: ../en/ch02-tour-merge.xml:180 +#: ../en/ch03-tour-merge.xml:206 msgid "Conflicting changes to a document" msgstr "冲突的修改" #. type: Content of: <book><chapter><sect1><figure><mediaobject> -#: ../en/ch02-tour-merge.xml:182 +#: ../en/ch03-tour-merge.xml:208 msgid "" "<imageobject><imagedata fileref=\"figs/tour-merge-conflict.png\"/></" "imageobject>" msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch02-tour-merge.xml:187 +#: ../en/ch03-tour-merge.xml:213 msgid "" "<xref linkend=\"fig:tour-merge:conflict\"/> illustrates an instance of two " "conflicting changes to a document. We started with a single version of the " @@ -3685,33 +5002,32 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch02-tour-merge.xml:194 +#: ../en/ch03-tour-merge.xml:220 msgid "" "Mercurial doesn't have a built-in facility for handling conflicts. Instead, " -"it runs an external program called <command>hgmerge</command>. This is a " -"shell script that is bundled with Mercurial; you can change it to behave " -"however you please. What it does by default is try to find one of several " -"different merging tools that are likely to be installed on your system. It " -"first tries a few fully automatic merging tools; if these don't succeed " -"(because the resolution process requires human guidance) or aren't present, " -"the script tries a few different graphical merging tools." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch02-tour-merge.xml:205 -msgid "" -"It's also possible to get Mercurial to run another program or script instead " -"of <command>hgmerge</command>, by setting the <envar>HGMERGE</envar> " -"environment variable to the name of your preferred program." +"it runs an external program, usually one that displays some kind of graphical " +"conflict resolution interface. By default, Mercurial tries to find one of " +"several different merging tools that are likely to be installed on your " +"system. It first tries a few fully automatic merging tools; if these don't " +"succeed (because the resolution process requires human guidance) or aren't " +"present, it tries a few different graphical merging tools." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch03-tour-merge.xml:230 +msgid "" +"It's also possible to get Mercurial to run a specific program or script, by " +"setting the <envar>HGMERGE</envar> environment variable to the name of your " +"preferred program." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch02-tour-merge.xml:211 +#: ../en/ch03-tour-merge.xml:236 msgid "Using a graphical merge tool" msgstr "使用图形合并工具" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch02-tour-merge.xml:213 +#: ../en/ch03-tour-merge.xml:238 msgid "" "My preferred graphical merge tool is <command>kdiff3</command>, which I'll " "use to describe the features that are common to graphical file merging " @@ -3723,7 +5039,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch02-tour-merge.xml:223 +#: ../en/ch03-tour-merge.xml:248 msgid "" "At the left is the <emphasis>base</emphasis> version of the file, i.e. the " "most recent version from which the two versions we're trying to merge are " @@ -3731,21 +5047,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch02-tour-merge.xml:228 +#: ../en/ch03-tour-merge.xml:253 msgid "" "In the middle is <quote>our</quote> version of the file, with the contents " "that we modified." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch02-tour-merge.xml:231 +#: ../en/ch03-tour-merge.xml:256 msgid "" "On the right is <quote>their</quote> version of the file, the one that from " "the changeset that we're trying to merge with." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch02-tour-merge.xml:235 +#: ../en/ch03-tour-merge.xml:260 msgid "" "In the pane below these is the current <emphasis>result</emphasis> of the " "merge. Our task is to replace all of the red text, which indicates unresolved " @@ -3754,7 +5070,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch02-tour-merge.xml:242 +#: ../en/ch03-tour-merge.xml:267 msgid "" "All four of these panes are <emphasis>locked together</emphasis>; if we " "scroll vertically or horizontally in any of them, the others are updated to " @@ -3762,19 +5078,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><figure><title> -#: ../en/ch02-tour-merge.xml:248 +#: ../en/ch03-tour-merge.xml:273 msgid "Using <command>kdiff3</command> to merge versions of a file" msgstr "使用 <command>kdiff3</command> 合并文件的不同版本" #. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject> -#: ../en/ch02-tour-merge.xml:251 +#: ../en/ch03-tour-merge.xml:276 msgid "" "<imageobject> <imagedata width=\"100%\" fileref=\"figs/kdiff3.png\"/></" "imageobject>" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch02-tour-merge.xml:259 +#: ../en/ch03-tour-merge.xml:284 msgid "" "For each conflicting portion of the file, we can choose to resolve the " "conflict using some combination of text from the base version, ours, or " @@ -3783,7 +5099,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch02-tour-merge.xml:265 +#: ../en/ch03-tour-merge.xml:290 msgid "" "There are <emphasis>many</emphasis> file merging tools available, too many to " "cover here. They vary in which platforms they are available for, and in " @@ -3793,12 +5109,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch02-tour-merge.xml:274 +#: ../en/ch03-tour-merge.xml:299 msgid "A worked example" msgstr "合并实例" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch02-tour-merge.xml:276 +#: ../en/ch03-tour-merge.xml:301 msgid "" "In this example, we will reproduce the file modification history of <xref " "linkend=\"fig:tour-merge:conflict\"/> above. Let's begin by creating a " @@ -3806,12 +5122,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch02-tour-merge.xml:283 +#: ../en/ch03-tour-merge.xml:308 msgid "We'll clone the repository and make a change to the file." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch02-tour-merge.xml:288 +#: ../en/ch03-tour-merge.xml:313 msgid "" "And another clone, to simulate someone else making a change to the file. " "(This hints at the idea that it's not all that unusual to merge with yourself " @@ -3820,31 +5136,24 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch02-tour-merge.xml:296 +#: ../en/ch03-tour-merge.xml:321 msgid "" "Having created two different versions of the file, we'll set up an " "environment suitable for running our merge." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch02-tour-merge.xml:302 -msgid "" -"In this example, I won't use Mercurial's normal <command>hgmerge</command> " -"program to do the merge, because it would drop my nice automated example-" -"running tool into a graphical user interface. Instead, I'll set " -"<envar>HGMERGE</envar> to tell Mercurial to use the non-interactive " -"<command>merge</command> command. This is bundled with many Unix-like " -"systems. If you're following this example on your computer, don't bother " -"setting <envar>HGMERGE</envar>." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch02-tour-merge.xml:312 -msgid "<emphasis role=\"bold\">XXX FIX THIS EXAMPLE.</emphasis>" -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch02-tour-merge.xml:317 +#: ../en/ch03-tour-merge.xml:327 +msgid "" +"In this example, I'll set <envar>HGMERGE</envar> to tell Mercurial to use the " +"non-interactive <command>merge</command> command. This is bundled with many " +"Unix-like systems. (If you're following this example on your computer, don't " +"bother setting <envar>HGMERGE</envar>. You'll get dropped into a GUI file " +"merge tool instead, which is much preferable.)" +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch03-tour-merge.xml:337 msgid "" "Because <command>merge</command> can't resolve the conflicting changes, it " "leaves <emphasis>merge markers</emphasis> inside the file that has conflicts, " @@ -3853,7 +5162,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch02-tour-merge.xml:323 +#: ../en/ch03-tour-merge.xml:343 msgid "" "Mercurial can tell from the way <command>merge</command> exits that it wasn't " "able to merge successfully, so it tells us what commands we'll need to run if " @@ -3863,27 +5172,43 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch02-tour-merge.xml:330 +#: ../en/ch03-tour-merge.xml:350 msgid "" "If automatic or manual merges fail, there's nothing to prevent us from " "<quote>fixing up</quote> the affected files ourselves, and committing the " "results of our merge:" msgstr "" +#. type: Content of: <book><chapter><sect1><sect2><note><title> +#: ../en/ch03-tour-merge.xml:357 +msgid "Where is the <command>hg resolve</command> command?" +msgstr "在哪里能找到 <command role=\"hg-cmd\">hg resolve</command> 命令?" + +#. type: Content of: <book><chapter><sect1><sect2><note><para> +#: ../en/ch03-tour-merge.xml:359 +msgid "" +"The <command>hg resolve</command> command was introduced in Mercurial 1.1, " +"which was released in December 2008. If you are using an older version of " +"Mercurial (run <command>hg version</command> to see), this command will not " +"be present. If your version of Mercurial is older than 1.1, you should " +"strongly consider upgrading to a newer version before trying to tackle " +"complicated merges." +msgstr "" + #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch02-tour-merge.xml:339 +#: ../en/ch03-tour-merge.xml:371 msgid "Simplifying the pull-merge-commit sequence" msgstr "简化拉-合并-提交程序" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch02-tour-merge.xml:341 +#: ../en/ch03-tour-merge.xml:373 msgid "" "The process of merging changes as outlined above is straightforward, but " "requires running three commands in sequence." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch02-tour-merge.xml:347 +#: ../en/ch03-tour-merge.xml:379 msgid "" "In the case of the final commit, you also need to enter a commit message, " "which is almost always going to be a piece of uninteresting " @@ -3891,7 +5216,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch02-tour-merge.xml:351 +#: ../en/ch03-tour-merge.xml:383 msgid "" "It would be nice to reduce the number of steps needed, if this were " "possible. Indeed, Mercurial is distributed with an extension called <literal " @@ -3899,74 +5224,114 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch02-tour-merge.xml:356 +#: ../en/ch03-tour-merge.xml:388 msgid "" "Mercurial provides a flexible extension mechanism that lets people extend its " "functionality, while keeping the core of Mercurial small and easy to deal " "with. Some extensions add new commands that you can use from the command " "line, while others work <quote>behind the scenes,</quote> for example adding " -"capabilities to the server." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch02-tour-merge.xml:363 +"capabilities to Mercurial's built-in server mode." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch03-tour-merge.xml:395 msgid "" "The <literal role=\"hg-ext\">fetch</literal> extension adds a new command " "called, not surprisingly, <command role=\"hg-cmd\">hg fetch</command>. This " -"extension acts as a combination of <command role=\"hg-cmd\">hg pull</" -"command>, <command role=\"hg-cmd\">hg update</command> and <command role=\"hg-" -"cmd\">hg merge</command>. It begins by pulling changes from another " +"extension acts as a combination of <command role=\"hg-cmd\">hg pull -u</" +"command>, <command role=\"hg-cmd\">hg merge</command> and <command role=\"hg-" +"cmd\">hg commit</command>. It begins by pulling changes from another " "repository into the current repository. If it finds that the changes added a " -"new head to the repository, it begins a merge, then commits the result of the " -"merge with an automatically-generated commit message. If no new heads were " -"added, it updates the working directory to the new tip changeset." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch02-tour-merge.xml:376 +"new head to the repository, it updates to the new head, begins a merge, then " +"(if the merge succeeded) commits the result of the merge with an " +"automatically-generated commit message. If no new heads were added, it " +"updates the working directory to the new tip changeset." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch03-tour-merge.xml:409 msgid "" "Enabling the <literal role=\"hg-ext\">fetch</literal> extension is easy. " -"Edit your <filename role=\"special\">.hgrc</filename>, and either go to the " -"<literal role=\"rc-extensions\">extensions</literal> section or create an " -"<literal role=\"rc-extensions\">extensions</literal> section. Then add a line " -"that simply reads <quote><literal>fetch </literal></quote>." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch02-tour-merge.xml:385 -msgid "" -"(Normally, on the right-hand side of the <quote><literal>=</literal></quote> " -"would appear the location of the extension, but since the <literal role=\"hg-" +"Edit the <filename role=\"special\">.hgrc</filename> file in your home " +"directory, and either go to the <literal role=\"rc-extensions\">extensions</" +"literal> section or create an <literal role=\"rc-extensions\">extensions</" +"literal> section. Then add a line that simply reads <quote><literal>fetch=</" +"literal></quote>." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch03-tour-merge.xml:421 +msgid "" +"(Normally, the right-hand side of the <quote><literal>=</literal></quote> " +"would indicate where to find the extension, but since the <literal role=\"hg-" "ext\">fetch</literal> extension is in the standard distribution, Mercurial " "knows where to search for it.)" msgstr "" +#. type: Content of: <book><chapter><sect1><title> +#: ../en/ch03-tour-merge.xml:429 +msgid "Renaming, copying, and merging" +msgstr "改名,复制与合并" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch03-tour-merge.xml:431 +msgid "" +"During the life of a project, we will often want to change the layout of its " +"files and directories. This can be as simple as renaming a single file, or as " +"complex as restructuring the entire hierarchy of files within the project." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch03-tour-merge.xml:436 +msgid "" +"Mercurial supports these kinds of complex changes fluently, provided we tell " +"it what we're doing. If we want to rename a file, we should use the " +"<command>hg rename</command><placeholder type=\"footnote\" id=\"0\"/> command " +"to rename it, so that Mercurial can do the right thing later when we merge." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para><footnote><para> +#: ../en/ch03-tour-merge.xml:439 +msgid "" +"If you're a Unix user, you'll be glad to know that the <command>hg rename</" +"command> command can be abbreviated as <command>hg mv</command>." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch03-tour-merge.xml:445 +msgid "" +"We will cover the use of these commands in more detail in <xref linkend=" +"\"chap:daily.copy\"/>." +msgstr "" + #. type: Content of: <book><chapter><title> -#: ../en/ch03-concepts.xml:5 +#: ../en/ch04-concepts.xml:5 msgid "Behind the scenes" msgstr "Mercurial 内幕" #. type: Content of: <book><chapter><para> -#: ../en/ch03-concepts.xml:7 +#: ../en/ch04-concepts.xml:7 msgid "" "Unlike many revision control systems, the concepts upon which Mercurial is " "built are simple enough that it's easy to understand how the software really " -"works. Knowing this certainly isn't necessary, but I find it useful to have " -"a <quote>mental model</quote> of what's going on." +"works. Knowing these details certainly isn't necessary, so it is certainly " +"safe to skip this chapter. However, I think you will get more out of the " +"software with a <quote>mental model</quote> of what's going on." msgstr "" #. type: Content of: <book><chapter><para> -#: ../en/ch03-concepts.xml:13 -msgid "" -"This understanding gives me confidence that Mercurial has been carefully " -"designed to be both <emphasis>safe</emphasis> and <emphasis>efficient</" -"emphasis>. And just as importantly, if it's easy for me to retain a good " -"idea of what the software is doing when I perform a revision control task, " -"I'm less likely to be surprised by its behaviour." +#: ../en/ch04-concepts.xml:14 +msgid "" +"Being able to understand what's going on behind the scenes gives me " +"confidence that Mercurial has been carefully designed to be both " +"<emphasis>safe</emphasis> and <emphasis>efficient</emphasis>. And just as " +"importantly, if it's easy for me to retain a good idea of what the software " +"is doing when I perform a revision control task, I'm less likely to be " +"surprised by its behavior." msgstr "" #. type: Content of: <book><chapter><para> -#: ../en/ch03-concepts.xml:20 +#: ../en/ch04-concepts.xml:22 msgid "" "In this chapter, we'll initially cover the core concepts behind Mercurial's " "design, then continue to discuss some of the interesting details of its " @@ -3974,17 +5339,17 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch03-concepts.xml:25 +#: ../en/ch04-concepts.xml:27 msgid "Mercurial's historical record" msgstr "Mercurial 的历史记录" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch03-concepts.xml:28 +#: ../en/ch04-concepts.xml:30 msgid "Tracking the history of a single file" msgstr "跟踪单一文件的历史" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:30 +#: ../en/ch04-concepts.xml:32 msgid "" "When Mercurial tracks modifications to a file, it stores the history of that " "file in a metadata object called a <emphasis>filelog</emphasis>. Each entry " @@ -3996,7 +5361,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:41 +#: ../en/ch04-concepts.xml:43 msgid "" "A file that is large, or has a lot of history, has its filelog stored in " "separate data (<quote><literal>.d</literal></quote> suffix) and index " @@ -4008,23 +5373,23 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><figure><title> -#: ../en/ch03-concepts.xml:53 +#: ../en/ch04-concepts.xml:55 msgid "" "Relationships between files in working directory and filelogs in repository" msgstr "工作目录中的文件与版本库中的文件日志之间的关系" #. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject> -#: ../en/ch03-concepts.xml:56 +#: ../en/ch04-concepts.xml:58 msgid "<imageobject><imagedata fileref=\"figs/filelog.png\"/></imageobject>" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch03-concepts.xml:63 +#: ../en/ch04-concepts.xml:65 msgid "Managing tracked files" msgstr "管理跟踪的文件" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:65 +#: ../en/ch04-concepts.xml:67 msgid "" "Mercurial uses a structure called a <emphasis>manifest</emphasis> to collect " "together information about the files that it tracks. Each entry in the " @@ -4034,12 +5399,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch03-concepts.xml:75 +#: ../en/ch04-concepts.xml:77 msgid "Recording changeset information" msgstr "记录修改集信息" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:77 +#: ../en/ch04-concepts.xml:79 msgid "" "The <emphasis>changelog</emphasis> contains information about each " "changeset. Each revision records who committed a change, the changeset " @@ -4048,12 +5413,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch03-concepts.xml:85 +#: ../en/ch04-concepts.xml:87 msgid "Relationships between revisions" msgstr "版本之间的关系" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:87 +#: ../en/ch04-concepts.xml:89 msgid "" "Within a changelog, a manifest, or a filelog, each revision stores a pointer " "to its immediate parent (or to its two parents, if it's a merge revision). " @@ -4063,7 +5428,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:94 +#: ../en/ch04-concepts.xml:96 msgid "" "For every changeset in a repository, there is exactly one revision stored in " "the changelog. Each revision of the changelog contains a pointer to a single " @@ -4074,46 +5439,53 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><figure><title> -#: ../en/ch03-concepts.xml:103 +#: ../en/ch04-concepts.xml:105 msgid "Metadata relationships" msgstr "元数据之间的关系" #. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject> -#: ../en/ch03-concepts.xml:105 +#: ../en/ch04-concepts.xml:107 msgid "<imageobject><imagedata fileref=\"figs/metadata.png\"/></imageobject>" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:110 +#: ../en/ch04-concepts.xml:112 msgid "" "As the illustration shows, there is <emphasis>not</emphasis> a <quote>one to " "one</quote> relationship between revisions in the changelog, manifest, or " -"filelog. If the manifest hasn't changed between two changesets, the changelog " -"entries for those changesets will point to the same revision of the " -"manifest. If a file that Mercurial tracks hasn't changed between two " +"filelog. If a file that Mercurial tracks hasn't changed between two " "changesets, the entry for that file in the two revisions of the manifest will " -"point to the same revision of its filelog." +"point to the same revision of its filelog<placeholder type=\"footnote\" id=\"0" +"\"/>." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para><footnote><para> +#: ../en/ch04-concepts.xml:119 +msgid "" +"It is possible (though unusual) for the manifest to remain the same between " +"two changesets, in which case the changelog entries for those changesets will " +"point to the same revision of the manifest." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch03-concepts.xml:123 +#: ../en/ch04-concepts.xml:128 msgid "Safe, efficient storage" msgstr "安全,高效的存储" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch03-concepts.xml:125 +#: ../en/ch04-concepts.xml:130 msgid "" "The underpinnings of changelogs, manifests, and filelogs are provided by a " "single structure called the <emphasis>revlog</emphasis>." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch03-concepts.xml:130 +#: ../en/ch04-concepts.xml:135 msgid "Efficient storage" msgstr "高效存储" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:132 +#: ../en/ch04-concepts.xml:137 msgid "" "The revlog provides efficient storage of revisions using a <emphasis>delta</" "emphasis> mechanism. Instead of storing a complete copy of a file for each " @@ -4123,7 +5495,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:140 +#: ../en/ch04-concepts.xml:145 msgid "" "Some obsolete revision control systems can only work with deltas of text " "files. They must either store binary files as complete snapshots or encoded " @@ -4133,12 +5505,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch03-concepts.xml:149 +#: ../en/ch04-concepts.xml:154 msgid "Safe operation" msgstr "安全操作" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:151 +#: ../en/ch04-concepts.xml:156 msgid "" "Mercurial only ever <emphasis>appends</emphasis> data to the end of a revlog " "file. It never modifies a section of a file after it has written it. This is " @@ -4147,7 +5519,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:157 +#: ../en/ch04-concepts.xml:162 msgid "" "In addition, Mercurial treats every write as part of a <emphasis>transaction</" "emphasis> that can span a number of files. A transaction is " @@ -4159,7 +5531,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:167 +#: ../en/ch04-concepts.xml:172 msgid "" "The fact that Mercurial only appends to files makes it easier to provide this " "transactional guarantee. The easier it is to do stuff like this, the more " @@ -4167,17 +5539,18 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch03-concepts.xml:174 +#: ../en/ch04-concepts.xml:179 msgid "Fast retrieval" msgstr "快速检索" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:176 +#: ../en/ch04-concepts.xml:181 msgid "" "Mercurial cleverly avoids a pitfall common to all earlier revision control " "systems: the problem of <emphasis>inefficient retrieval</emphasis>. Most " "revision control systems store the contents of a revision as an incremental " -"series of modifications against a <quote>snapshot</quote>. To reconstruct a " +"series of modifications against a <quote>snapshot</quote>. (Some base the " +"snapshot on the oldest revision, others on the newest.) To reconstruct a " "specific revision, you must first read the snapshot, and then every one of " "the revisions between the snapshot and your target revision. The more " "history that a file accumulates, the more revisions you must read, hence the " @@ -4185,17 +5558,17 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><figure><title> -#: ../en/ch03-concepts.xml:188 +#: ../en/ch04-concepts.xml:195 msgid "Snapshot of a revlog, with incremental deltas" msgstr "版本日志的快照,以及增量差异" #. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject> -#: ../en/ch03-concepts.xml:190 +#: ../en/ch04-concepts.xml:197 msgid "<imageobject><imagedata fileref=\"figs/snapshot.png\"/></imageobject>" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:195 +#: ../en/ch04-concepts.xml:202 msgid "" "The innovation that Mercurial applies to this problem is simple but " "effective. Once the cumulative amount of delta information stored since the " @@ -4207,7 +5580,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:204 +#: ../en/ch04-concepts.xml:211 msgid "" "<xref linkend=\"fig:concepts:snapshot\"/> illustrates the idea. In an entry " "in a revlog's index file, Mercurial stores the range of entries from the data " @@ -4215,41 +5588,33 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><title> -#: ../en/ch03-concepts.xml:210 +#: ../en/ch04-concepts.xml:217 msgid "Aside: the influence of video compression" msgstr "旁白: 视频压缩的影响" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch03-concepts.xml:212 +#: ../en/ch04-concepts.xml:219 msgid "" "If you're familiar with video compression or have ever watched a TV feed " "through a digital cable or satellite service, you may know that most video " "compression schemes store each frame of video as a delta against its " -"predecessor frame. In addition, these schemes use <quote>lossy</quote> " -"compression techniques to increase the compression ratio, so visual errors " -"accumulate over the course of a number of inter-frame deltas." +"predecessor frame." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch03-concepts.xml:221 -msgid "" -"Because it's possible for a video stream to <quote>drop out</quote> " -"occasionally due to signal glitches, and to limit the accumulation of " -"artefacts introduced by the lossy compression process, video encoders " -"periodically insert a complete frame (called a <quote>key frame</quote>) into " -"the video stream; the next delta is generated against that frame. This means " -"that if the video signal gets interrupted, it will resume once the next key " -"frame is received. Also, the accumulation of encoding errors restarts anew " -"with each key frame." +#: ../en/ch04-concepts.xml:225 +msgid "" +"Mercurial borrows this idea to make it possible to reconstruct a revision " +"from a snapshot and a small number of deltas." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch03-concepts.xml:235 +#: ../en/ch04-concepts.xml:232 msgid "Identification and strong integrity" msgstr "鉴别和强完整性" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:237 +#: ../en/ch04-concepts.xml:234 msgid "" "Along with delta or snapshot information, a revlog entry contains a " "cryptographic hash of the data that it represents. This makes it difficult " @@ -4257,7 +5622,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:242 +#: ../en/ch04-concepts.xml:239 msgid "" "Hashes provide more than a mere check against corruption; they are used as " "the identifiers for revisions. The changeset identification hashes that you " @@ -4266,7 +5631,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:249 +#: ../en/ch04-concepts.xml:246 msgid "" "Mercurial verifies that hashes are correct when it retrieves file revisions " "and when it pulls changes from another repository. If it encounters an " @@ -4274,7 +5639,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:254 +#: ../en/ch04-concepts.xml:251 msgid "" "In addition to the effect it has on retrieval efficiency, Mercurial's use of " "periodic snapshots makes it more robust against partial data corruption. If " @@ -4285,12 +5650,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch03-concepts.xml:266 +#: ../en/ch04-concepts.xml:263 msgid "Revision history, branching, and merging" msgstr "修订历史,分支与合并" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch03-concepts.xml:268 +#: ../en/ch04-concepts.xml:265 msgid "" "Every entry in a Mercurial revlog knows the identity of its immediate " "ancestor revision, usually referred to as its <emphasis>parent</emphasis>. " @@ -4301,7 +5666,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch03-concepts.xml:276 +#: ../en/ch04-concepts.xml:273 msgid "" "In <xref linkend=\"fig:concepts:revlog\"/>, you can see an example of the " "conceptual structure of a revlog. Filelogs, manifests, and changelogs all " @@ -4310,7 +5675,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch03-concepts.xml:282 +#: ../en/ch04-concepts.xml:279 msgid "" "The first revision in a revlog (at the bottom of the image) has the null ID " "in both of its parent slots. For a <quote>normal</quote> revision, its first " @@ -4322,29 +5687,29 @@ msgstr "" #. type: Content of: <book><chapter><sect1><figure><title> -#: ../en/ch03-concepts.xml:292 +#: ../en/ch04-concepts.xml:289 msgid "The conceptual structure of a revlog" msgstr "版本日志的设计结构" #. type: Content of: <book><chapter><sect1><figure><mediaobject> -#: ../en/ch03-concepts.xml:294 +#: ../en/ch04-concepts.xml:291 msgid "<imageobject><imagedata fileref=\"figs/revlog.png\"/></imageobject>" msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch03-concepts.xml:301 +#: ../en/ch04-concepts.xml:298 msgid "The working directory" msgstr "工作目录" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch03-concepts.xml:303 +#: ../en/ch04-concepts.xml:300 msgid "" "In the working directory, Mercurial stores a snapshot of the files from the " "repository as of a particular changeset." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch03-concepts.xml:306 +#: ../en/ch04-concepts.xml:303 msgid "" "The working directory <quote>knows</quote> which changeset it contains. When " "you update the working directory to contain a particular changeset, Mercurial " @@ -4355,16 +5720,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch03-concepts.xml:315 -msgid "" -"The <emphasis>dirstate</emphasis> contains Mercurial's knowledge of the " -"working directory. This details which changeset the working directory is " -"updated to, and all of the files that Mercurial is tracking in the working " -"directory." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch03-concepts.xml:321 +#: ../en/ch04-concepts.xml:312 +msgid "" +"The <emphasis>dirstate</emphasis> is a special structure that contains " +"Mercurial's knowledge of the working directory. It is maintained as a file " +"named <filename>.hg/dirstate</filename> inside a repository. The dirstate " +"details which changeset the working directory is updated to, and all of the " +"files that Mercurial is tracking in the working directory. It also lets " +"Mercurial quickly notice changed files, by recording their checkout times and " +"sizes." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch04-concepts.xml:322 msgid "" "Just as a revision of a revlog has room for two parents, so that it can " "represent either a normal revision (with one parent) or a merge of two " @@ -4379,12 +5747,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch03-concepts.xml:335 +#: ../en/ch04-concepts.xml:336 msgid "What happens when you commit" msgstr "当你提交时发生的事情" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:337 +#: ../en/ch04-concepts.xml:338 msgid "" "The dirstate stores parent information for more than just book-keeping " "purposes. Mercurial uses the parents of the dirstate as <emphasis>the " @@ -4392,17 +5760,17 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><figure><title> -#: ../en/ch03-concepts.xml:343 +#: ../en/ch04-concepts.xml:344 msgid "The working directory can have two parents" msgstr "工作目录可以有两个父亲" #. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject> -#: ../en/ch03-concepts.xml:345 +#: ../en/ch04-concepts.xml:346 msgid "<imageobject><imagedata fileref=\"figs/wdir.png\"/></imageobject>" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:350 +#: ../en/ch04-concepts.xml:351 msgid "" "<xref linkend=\"fig:concepts:wdir\"/> shows the normal state of the working " "directory, where it has a single changeset as parent. That changeset is the " @@ -4411,18 +5779,18 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><figure><title> -#: ../en/ch03-concepts.xml:357 +#: ../en/ch04-concepts.xml:358 msgid "The working directory gains new parents after a commit" msgstr "提交之后,工作目录的父亲就改变了" #. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject> -#: ../en/ch03-concepts.xml:360 +#: ../en/ch04-concepts.xml:361 msgid "" "<imageobject><imagedata fileref=\"figs/wdir-after-commit.png\"/></imageobject>" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:365 +#: ../en/ch04-concepts.xml:366 msgid "" "It's useful to think of the working directory as <quote>the changeset I'm " "about to commit</quote>. Any files that you tell Mercurial that you've " @@ -4432,7 +5800,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:373 +#: ../en/ch04-concepts.xml:374 msgid "" "After a commit, Mercurial will update the parents of the working directory, " "so that the first parent is the ID of the new changeset, and the second is " @@ -4442,12 +5810,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch03-concepts.xml:384 +#: ../en/ch04-concepts.xml:385 msgid "Creating a new head" msgstr "创建新顶点" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:386 +#: ../en/ch04-concepts.xml:387 msgid "" "It's perfectly normal to update the working directory to a changeset other " "than the current tip. For example, you might want to know what your project " @@ -4460,18 +5828,18 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><figure><title> -#: ../en/ch03-concepts.xml:398 +#: ../en/ch04-concepts.xml:399 msgid "The working directory, updated to an older changeset" msgstr "同步到旧修改集的工作目录" #. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject> -#: ../en/ch03-concepts.xml:401 +#: ../en/ch04-concepts.xml:402 msgid "" "<imageobject><imagedata fileref=\"figs/wdir-pre-branch.png\"/></imageobject>" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:406 +#: ../en/ch04-concepts.xml:407 msgid "" "Having updated the working directory to an older changeset, what happens if " "you make some changes, and then commit? Mercurial behaves in the same way as " @@ -4483,17 +5851,17 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><figure><title> -#: ../en/ch03-concepts.xml:418 +#: ../en/ch04-concepts.xml:419 msgid "After a commit made while synced to an older changeset" msgstr "对同步到旧修改集的工作目录提交之后" #. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject> -#: ../en/ch03-concepts.xml:421 +#: ../en/ch04-concepts.xml:422 msgid "<imageobject><imagedata fileref=\"figs/wdir-branch.png\"/></imageobject>" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><note><para> -#: ../en/ch03-concepts.xml:427 +#: ../en/ch04-concepts.xml:428 msgid "" "If you're new to Mercurial, you should keep in mind a common <quote>error</" "quote>, which is to use the <command role=\"hg-cmd\">hg pull</command> " @@ -4503,27 +5871,29 @@ "working directory will stay synced at the same changeset as before the pull. " "If you make some changes and commit afterwards, you'll thus create a new " "head, because your working directory isn't synced to whatever the current tip " -"is." +"is. To combine the operation of a pull, followed by an update, run " +"<command>hg pull -u</command>." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><note><para> -#: ../en/ch03-concepts.xml:439 +#: ../en/ch04-concepts.xml:442 msgid "" "I put the word <quote>error</quote> in quotes because all that you need to do " -"to rectify this situation is <command role=\"hg-cmd\">hg merge</command>, " -"then <command role=\"hg-cmd\">hg commit</command>. In other words, this " -"almost never has negative consequences; it just surprises people. I'll " -"discuss other ways to avoid this behaviour, and why Mercurial behaves in this " -"initially surprising way, later on." +"to rectify the situation where you created a new head by accident is <command " +"role=\"hg-cmd\">hg merge</command>, then <command role=\"hg-cmd\">hg commit</" +"command>. In other words, this almost never has negative consequences; it's " +"just something of a surprise for newcomers. I'll discuss other ways to avoid " +"this behavior, and why Mercurial behaves in this initially surprising way, " +"later on." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch03-concepts.xml:451 -msgid "Merging heads" -msgstr "合并顶点" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:453 +#: ../en/ch04-concepts.xml:455 +msgid "Merging changes" +msgstr "合并修改" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch04-concepts.xml:457 msgid "" "When you run the <command role=\"hg-cmd\">hg merge</command> command, " "Mercurial leaves the first parent of the working directory unchanged, and " @@ -4532,18 +5902,18 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><figure><title> -#: ../en/ch03-concepts.xml:460 +#: ../en/ch04-concepts.xml:464 msgid "Merging two heads" msgstr "合并两个顶点" #. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject> -#: ../en/ch03-concepts.xml:462 +#: ../en/ch04-concepts.xml:466 msgid "" "<imageobject> <imagedata fileref=\"figs/wdir-merge.png\"/> </imageobject>" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:469 +#: ../en/ch04-concepts.xml:473 msgid "" "Mercurial also has to modify the working directory, to merge the files " "managed in the two changesets. Simplified a little, the merging process goes " @@ -4551,33 +5921,33 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch03-concepts.xml:474 +#: ../en/ch04-concepts.xml:478 msgid "If neither changeset has modified a file, do nothing with that file." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch03-concepts.xml:477 +#: ../en/ch04-concepts.xml:481 msgid "" "If one changeset has modified a file, and the other hasn't, create the " "modified copy of the file in the working directory." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch03-concepts.xml:481 +#: ../en/ch04-concepts.xml:485 msgid "" "If one changeset has removed a file, and the other hasn't (or has also " "deleted it), delete the file from the working directory." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch03-concepts.xml:485 +#: ../en/ch04-concepts.xml:489 msgid "" "If one changeset has removed a file, but the other has modified the file, ask " "the user what to do: keep the modified file, or remove it?" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch03-concepts.xml:489 +#: ../en/ch04-concepts.xml:493 msgid "" "If both changesets have modified a file, invoke an external merge program to " "choose the new contents for the merged file. This may require input from the " @@ -4585,14 +5955,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch03-concepts.xml:494 +#: ../en/ch04-concepts.xml:498 msgid "" "If one changeset has modified a file, and the other has renamed or copied the " "file, make sure that the changes follow the new name of the file." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:498 +#: ../en/ch04-concepts.xml:502 msgid "" "There are more details&emdash;merging has plenty of corner cases&emdash;but " "these are the most common choices that are involved in a merge. As you can " @@ -4601,7 +5971,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:505 +#: ../en/ch04-concepts.xml:509 msgid "" "When you're thinking about what happens when you commit after a merge, once " "again the working directory is <quote>the changeset I'm about to commit</" @@ -4611,23 +5981,48 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:512 +#: ../en/ch04-concepts.xml:516 msgid "" "Mercurial lets you perform multiple merges, but you must commit the results " "of each individual merge as you go. This is necessary because Mercurial only " "tracks two parents for both revisions and the working directory. While it " -"would be technically possible to merge multiple changesets at once, the " -"prospect of user confusion and making a terrible mess of a merge immediately " -"becomes overwhelming." +"would be technically feasible to merge multiple changesets at once, Mercurial " +"avoids this for simplicity. With multi-way merges, the risks of user " +"confusion, nasty conflict resolution, and making a terrible mess of a merge " +"would grow intolerable." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><title> +#: ../en/ch04-concepts.xml:529 +msgid "Merging and renames" +msgstr "合并与改名" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch04-concepts.xml:531 +msgid "" +"A surprising number of revision control systems pay little or no attention to " +"a file's <emphasis>name</emphasis> over time. For instance, it used to be " +"common that if a file got renamed on one side of a merge, the changes from " +"the other side would be silently dropped." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch04-concepts.xml:537 +msgid "" +"Mercurial records metadata when you tell it to perform a rename or copy. It " +"uses this metadata during a merge to do the right thing in the case of a " +"merge. For instance, if I rename a file, and you edit it without renaming " +"it, when we merge our work the file will be renamed and have your edits " +"applied." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch03-concepts.xml:523 +#: ../en/ch04-concepts.xml:547 msgid "Other interesting design features" msgstr "其它有趣的设计特性" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch03-concepts.xml:525 +#: ../en/ch04-concepts.xml:549 msgid "" "In the sections above, I've tried to highlight some of the most important " "aspects of Mercurial's design, to illustrate that it pays careful attention " @@ -4640,12 +6035,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch03-concepts.xml:536 +#: ../en/ch04-concepts.xml:560 msgid "Clever compression" msgstr "智能压缩" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:538 +#: ../en/ch04-concepts.xml:562 msgid "" "When appropriate, Mercurial will store both snapshots and deltas in " "compressed form. It does this by always <emphasis>trying to</emphasis> " @@ -4654,7 +6049,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:544 +#: ../en/ch04-concepts.xml:568 msgid "" "This means that Mercurial does <quote>the right thing</quote> when storing a " "file whose native form is compressed, such as a <literal>zip</literal> " @@ -4664,7 +6059,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:552 +#: ../en/ch04-concepts.xml:576 msgid "" "Deltas between revisions of a compressed file are usually larger than " "snapshots of the file, and Mercurial again does <quote>the right thing</" @@ -4674,12 +6069,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><title> -#: ../en/ch03-concepts.xml:561 +#: ../en/ch04-concepts.xml:585 msgid "Network recompression" msgstr "网络重新压缩" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch03-concepts.xml:563 +#: ../en/ch04-concepts.xml:587 msgid "" "When storing revisions on disk, Mercurial uses the <quote>deflate</quote> " "compression algorithm (the same one used by the popular <literal>zip</" @@ -4689,7 +6084,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch03-concepts.xml:571 +#: ../en/ch04-concepts.xml:595 msgid "" "If the connection is over HTTP, Mercurial recompresses the entire stream of " "data using a compression algorithm that gives a better compression ratio (the " @@ -4697,24 +6092,26 @@ "compression package). This combination of algorithm and compression of the " "entire stream (instead of a revision at a time) substantially reduces the " "number of bytes to be transferred, yielding better network performance over " -"almost all kinds of network." +"most kinds of network." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch03-concepts.xml:581 -msgid "" -"(If the connection is over <command>ssh</command>, Mercurial " +#: ../en/ch04-concepts.xml:605 +msgid "" +"If the connection is over <command>ssh</command>, Mercurial " "<emphasis>doesn't</emphasis> recompress the stream, because <command>ssh</" -"command> can already do this itself.)" +"command> can already do this itself. You can tell Mercurial to always use " +"<command>ssh</command>'s compression feature by editing the <filename>.hgrc</" +"filename> file in your home directory as follows." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch03-concepts.xml:589 +#: ../en/ch04-concepts.xml:620 msgid "Read/write ordering and atomicity" msgstr "读写顺序与原子性" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:591 +#: ../en/ch04-concepts.xml:622 msgid "" "Appending to files isn't the whole story when it comes to guaranteeing that a " "reader won't see a partial write. If you recall <xref linkend=\"fig:concepts:" @@ -4724,7 +6121,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:599 +#: ../en/ch04-concepts.xml:629 msgid "" "A writer starts a transaction by writing filelog and manifest data, and " "doesn't write any changelog data until those are finished. A reader starts " @@ -4732,7 +6129,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:604 +#: ../en/ch04-concepts.xml:634 msgid "" "Since the writer has always finished writing filelog and manifest data before " "it writes to the changelog, a reader will never read a pointer to a partially " @@ -4741,23 +6138,23 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch03-concepts.xml:612 +#: ../en/ch04-concepts.xml:642 msgid "Concurrent access" msgstr "并发访问" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:614 +#: ../en/ch04-concepts.xml:644 msgid "" "The read/write ordering and atomicity guarantees mean that Mercurial never " "needs to <emphasis>lock</emphasis> a repository when it's reading data, even " "if the repository is being written to while the read is occurring. This has a " "big effect on scalability; you can have an arbitrary number of Mercurial " -"processes safely reading data from a repository safely all at once, no matter " +"processes safely reading data from a repository all at once, no matter " "whether it's being written to or not." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:623 +#: ../en/ch04-concepts.xml:653 msgid "" "The lockless nature of reading means that if you're sharing a repository on a " "multi-user system, you don't need to grant other local users permission to " @@ -4771,7 +6168,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:636 +#: ../en/ch04-concepts.xml:666 msgid "" "Mercurial uses locks to ensure that only one process can write to a " "repository at a time (the locking mechanism is safe even over filesystems " @@ -4785,12 +6182,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><title> -#: ../en/ch03-concepts.xml:648 +#: ../en/ch04-concepts.xml:678 msgid "Safe dirstate access" msgstr "安全的目录状态访问" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch03-concepts.xml:650 +#: ../en/ch04-concepts.xml:680 msgid "" "As with revision data, Mercurial doesn't take a lock to read the dirstate " "file; it does acquire a lock to write it. To avoid the possibility of " @@ -4802,12 +6199,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch03-concepts.xml:663 +#: ../en/ch04-concepts.xml:693 msgid "Avoiding seeks" msgstr "避免查找" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:665 +#: ../en/ch04-concepts.xml:695 msgid "" "Critical to Mercurial's performance is the avoidance of seeks of the disk " "head, since any seek is far more expensive than even a comparatively large " @@ -4815,7 +6212,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:669 +#: ../en/ch04-concepts.xml:699 msgid "" "This is why, for example, the dirstate is stored in a single file. If there " "were a dirstate file per directory that Mercurial tracked, the disk would " @@ -4824,7 +6221,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:675 +#: ../en/ch04-concepts.xml:705 msgid "" "Mercurial also uses a <quote>copy on write</quote> scheme when cloning a " "repository on local storage. Instead of copying every revlog file from the " @@ -4837,24 +6234,24 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:686 +#: ../en/ch04-concepts.xml:716 msgid "" "A few revision control developers have pointed out that this idea of making a " "complete private copy of a file is not very efficient in its use of storage. " "While this is true, storage is cheap, and this method gives the highest " "performance while deferring most book-keeping to the operating system. An " "alternative scheme would most likely reduce performance and increase the " -"complexity of the software, each of which is much more important to the " +"complexity of the software, but speed and simplicity are key to the " "<quote>feel</quote> of day-to-day use." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch03-concepts.xml:698 +#: ../en/ch04-concepts.xml:728 msgid "Other contents of the dirstate" msgstr "目录状态的其它内容" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:700 +#: ../en/ch04-concepts.xml:730 msgid "" "Because Mercurial doesn't force you to tell it when you're modifying a file, " "it uses the dirstate to store some extra information so it can determine " @@ -4864,7 +6261,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:707 +#: ../en/ch04-concepts.xml:737 msgid "" "When you explicitly <command role=\"hg-cmd\">hg add</command>, <command role=" "\"hg-cmd\">hg remove</command>, <command role=\"hg-cmd\">hg rename</command> " @@ -4873,31 +6270,50 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch03-concepts.xml:714 -msgid "" -"When Mercurial is checking the states of files in the working directory, it " -"first checks a file's modification time. If that has not changed, the file " -"must not have been modified. If the file's size has changed, the file must " -"have been modified. If the modification time has changed, but the size has " -"not, only then does Mercurial need to read the actual contents of the file to " -"see if they've changed. Storing these few extra pieces of information " -"dramatically reduces the amount of data that Mercurial needs to read, which " -"yields large performance improvements compared to other revision control " -"systems." +#: ../en/ch04-concepts.xml:744 +msgid "" +"The dirstate helps Mercurial to efficiently check the status of files in a " +"repository." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> +#: ../en/ch04-concepts.xml:749 +msgid "" +"When Mercurial checks the state of a file in the working directory, it first " +"checks a file's modification time against the time in the dirstate that " +"records when Mercurial last wrote the file. If the last modified time is the " +"same as the time when Mercurial wrote the file, the file must not have been " +"modified, so Mercurial does not need to check any further." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> +#: ../en/ch04-concepts.xml:758 +msgid "" +"If the file's size has changed, the file must have been modified. If the " +"modification time has changed, but the size has not, only then does Mercurial " +"need to actually read the contents of the file to see if it has changed." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch04-concepts.xml:766 +msgid "" +"Storing the modification time and size dramatically reduces the number of " +"read operations that Mercurial needs to perform when we run commands like " +"<command>hg status</command>. This results in large performance improvements." msgstr "" #. type: Content of: <book><chapter><title> -#: ../en/ch04-daily.xml:5 +#: ../en/ch05-daily.xml:5 msgid "Mercurial in daily use" msgstr "Mercurial 的日常使用" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch04-daily.xml:8 +#: ../en/ch05-daily.xml:8 msgid "Telling Mercurial which files to track" msgstr "告诉 Mercurial 要跟踪哪些文件" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch04-daily.xml:10 +#: ../en/ch05-daily.xml:10 msgid "" "Mercurial does not work with files in your repository unless you tell it to " "manage them. The <command role=\"hg-cmd\">hg status</command> command will " @@ -4907,7 +6323,7 @@ # #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch04-daily.xml:17 +#: ../en/ch05-daily.xml:17 msgid "" "To tell Mercurial to track a file, use the <command role=\"hg-cmd\">hg add</" "command> command. Once you have added a file, the entry in the output of " @@ -4916,21 +6332,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch04-daily.xml:26 +#: ../en/ch05-daily.xml:26 msgid "" "After you run a <command role=\"hg-cmd\">hg commit</command>, the files that " "you added before the commit will no longer be listed in the output of " -"<command role=\"hg-cmd\">hg status</command>. The reason for this is that " -"<command role=\"hg-cmd\">hg status</command> only tells you about " -"<quote>interesting</quote> files&emdash;those that you have modified or told " -"Mercurial to do something with&emdash;by default. If you have a repository " -"that contains thousands of files, you will rarely want to know about files " -"that Mercurial is tracking, but that have not changed. (You can still get " -"this information; we'll return to this later.)" -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch04-daily.xml:38 +"<command role=\"hg-cmd\">hg status</command>. The reason for this is that by " +"default, <command role=\"hg-cmd\">hg status</command> only tells you about " +"<quote>interesting</quote> files&emdash;those that you have (for example) " +"modified, removed, or renamed. If you have a repository that contains " +"thousands of files, you will rarely want to know about files that Mercurial " +"is tracking, but that have not changed. (You can still get this information; " +"we'll return to this later.)" +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:38 msgid "" "Once you add a file, Mercurial doesn't do anything with it immediately. " "Instead, it will take a snapshot of the file's state the next time you " @@ -4939,52 +6355,52 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch04-daily.xml:45 +#: ../en/ch05-daily.xml:45 msgid "Explicit versus implicit file naming" msgstr "明确与隐含文件命名" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:47 -msgid "" -"A useful behaviour that Mercurial has is that if you pass the name of a " +#: ../en/ch05-daily.xml:47 +msgid "" +"A useful behavior that Mercurial has is that if you pass the name of a " "directory to a command, every Mercurial command will treat this as <quote>I " "want to operate on every file in this directory and its subdirectories</" "quote>." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:54 +#: ../en/ch05-daily.xml:54 msgid "" "Notice in this example that Mercurial printed the names of the files it " -"added, whereas it didn't do so when we added the file named <filename>a</" -"filename> in the earlier example." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:59 +"added, whereas it didn't do so when we added the file named <filename>myfile." +"txt</filename> in the earlier example." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch05-daily.xml:59 msgid "" "What's going on is that in the former case, we explicitly named the file to " -"add on the command line, so the assumption that Mercurial makes in such cases " -"is that you know what you were doing, and it doesn't print any output." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:64 +"add on the command line. The assumption that Mercurial makes in such cases " +"is that we know what we are doing, and it doesn't print any output." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch05-daily.xml:64 msgid "" "However, when we <emphasis>imply</emphasis> the names of files by giving the " "name of a directory, Mercurial takes the extra step of printing the name of " "each file that it does something with. This makes it more clear what is " "happening, and reduces the likelihood of a silent and nasty surprise. This " -"behaviour is common to most Mercurial commands." +"behavior is common to most Mercurial commands." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch04-daily.xml:73 -msgid "Aside: Mercurial tracks files, not directories" -msgstr "旁白: Mercurial 只跟踪文件,不跟踪目录" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:75 +#: ../en/ch05-daily.xml:73 +msgid "Mercurial tracks files, not directories" +msgstr "Mercurial 只跟踪文件,不跟踪目录" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch05-daily.xml:75 msgid "" "Mercurial does not track directory information. Instead, it tracks the path " "to a file. Before creating a file, it first creates any missing directory " @@ -4995,7 +6411,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:84 +#: ../en/ch05-daily.xml:84 msgid "" "Empty directories are rarely useful, and there are unintrusive workarounds " "that you can use to achieve an appropriate effect. The developers of " @@ -5004,7 +6420,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:91 +#: ../en/ch05-daily.xml:91 msgid "" "If you need an empty directory in your repository, there are a few ways to " "achieve this. One is to create a directory, then <command role=\"hg-cmd\">hg " @@ -5015,30 +6431,29 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:102 +#: ../en/ch05-daily.xml:102 msgid "" "Another way to tackle a need for an empty directory is to simply create one " "in your automated build scripts before they will need it." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch04-daily.xml:109 +#: ../en/ch05-daily.xml:109 msgid "How to stop tracking a file" msgstr "如何停止跟踪文件" -# -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch04-daily.xml:111 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:111 msgid "" "Once you decide that a file no longer belongs in your repository, use the " -"<command role=\"hg-cmd\">hg remove</command> command; this deletes the file, " -"and tells Mercurial to stop tracking it. A removed file is represented in " -"the output of <command role=\"hg-cmd\">hg status</command> with a " -"<quote><literal>R</literal></quote>." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch04-daily.xml:120 +"<command role=\"hg-cmd\">hg remove</command> command. This deletes the file, " +"and tells Mercurial to stop tracking it (which will occur at the next " +"commit). A removed file is represented in the output of <command role=\"hg-" +"cmd\">hg status</command> with a <quote><literal>R</literal></quote>." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:121 msgid "" "After you <command role=\"hg-cmd\">hg remove</command> a file, Mercurial will " "no longer track changes to that file, even if you recreate a file with the " @@ -5049,51 +6464,52 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch04-daily.xml:129 +#: ../en/ch05-daily.xml:130 msgid "Removing a file does not affect its history" msgstr "删除文件不影响历史" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:131 +#: ../en/ch05-daily.xml:132 msgid "It is important to understand that removing a file has only two effects." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch04-daily.xml:134 +#: ../en/ch05-daily.xml:135 msgid "It removes the current version of the file from the working directory." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch04-daily.xml:137 +#: ../en/ch05-daily.xml:138 msgid "" "It stops Mercurial from tracking changes to the file, from the time of the " "next commit." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:140 +#: ../en/ch05-daily.xml:141 msgid "" "Removing a file <emphasis>does not</emphasis> in any way alter the " "<emphasis>history</emphasis> of the file." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:143 -msgid "" -"If you update the working directory to a changeset in which a file that you " -"have removed was still tracked, it will reappear in the working directory, " -"with the contents it had when you committed that changeset. If you then " -"update the working directory to a later changeset, in which the file had been " -"removed, Mercurial will once again remove the file from the working directory." +#: ../en/ch05-daily.xml:144 +msgid "" +"If you update the working directory to a changeset that was committed when it " +"was still tracking a file that you later removed, the file will reappear in " +"the working directory, with the contents it had when you committed that " +"changeset. If you then update the working directory to a later changeset, in " +"which the file had been removed, Mercurial will once again remove the file " +"from the working directory." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch04-daily.xml:153 +#: ../en/ch05-daily.xml:155 msgid "Missing files" msgstr "丢失的文件" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:155 +#: ../en/ch05-daily.xml:157 msgid "" "Mercurial considers a file that you have deleted, but not used <command role=" "\"hg-cmd\">hg remove</command> to delete, to be <emphasis>missing</" @@ -5103,7 +6519,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:165 +#: ../en/ch05-daily.xml:167 msgid "" "If your repository contains a file that <command role=\"hg-cmd\">hg status</" "command> reports as missing, and you want the file to stay gone, you can run " @@ -5113,7 +6529,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:175 +#: ../en/ch05-daily.xml:177 msgid "" "On the other hand, if you deleted the missing file by accident, give <command " "role=\"hg-cmd\">hg revert</command> the name of the file to recover. It will " @@ -5121,12 +6537,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch04-daily.xml:184 +#: ../en/ch05-daily.xml:186 msgid "Aside: why tell Mercurial explicitly to remove a file?" msgstr "旁白: 为什么要明确告诉 Mercurial 删除文件?" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:187 +#: ../en/ch05-daily.xml:189 msgid "" "You might wonder why Mercurial requires you to explicitly tell it that you " "are deleting a file. Early during the development of Mercurial, it let you " @@ -5137,12 +6553,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch04-daily.xml:198 +#: ../en/ch05-daily.xml:200 msgid "Useful shorthand&emdash;adding and removing files in one step" msgstr "有用的速记—一个步骤添加和删除文件" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:201 +#: ../en/ch05-daily.xml:203 msgid "" "Mercurial offers a combination command, <command role=\"hg-cmd\">hg " "addremove</command>, that adds untracked files and marks missing files as " @@ -5150,7 +6566,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:207 +#: ../en/ch05-daily.xml:209 msgid "" "The <command role=\"hg-cmd\">hg commit</command> command also provides a " "<option role=\"hg-opt-commit\">-A</option> option that performs this same add-" @@ -5158,12 +6574,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch04-daily.xml:217 +#: ../en/ch05-daily.xml:219 msgid "Copying files" msgstr "复制文件" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch04-daily.xml:219 +#: ../en/ch05-daily.xml:221 msgid "" "Mercurial provides a <command role=\"hg-cmd\">hg copy</command> command that " "lets you make a new copy of a file. When you copy a file using this command, " @@ -5173,12 +6589,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch04-daily.xml:227 +#: ../en/ch05-daily.xml:229 msgid "The results of copying during a merge" msgstr "合并期间的复制结果" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:229 +#: ../en/ch05-daily.xml:231 msgid "" "What happens during a merge is that changes <quote>follow</quote> a copy. To " "best illustrate what this means, let's create an example. We'll start with " @@ -5186,28 +6602,28 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:236 +#: ../en/ch05-daily.xml:238 msgid "" "We need to do some work in parallel, so that we'll have something to merge. " "So let's clone our repository." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:242 +#: ../en/ch05-daily.xml:244 msgid "" "Back in our initial repository, let's use the <command role=\"hg-cmd\">hg " "copy</command> command to make a copy of the first file we created." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:248 +#: ../en/ch05-daily.xml:250 msgid "" "If we look at the output of the <command role=\"hg-cmd\">hg status</command> " "command afterwards, the copied file looks just like a normal added file." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:254 +#: ../en/ch05-daily.xml:256 msgid "" "But if we pass the <option role=\"hg-opt-status\">-C</option> option to " "<command role=\"hg-cmd\">hg status</command>, it prints another line of " @@ -5216,14 +6632,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:262 +#: ../en/ch05-daily.xml:264 msgid "" "Now, back in the repository we cloned, let's make a change in parallel. " "We'll add a line of content to the original file that we created." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:268 +#: ../en/ch05-daily.xml:270 msgid "" "Now we have a modified <filename>file</filename> in this repository. When we " "pull the changes from the first repository, and merge the two heads, " @@ -5232,19 +6648,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch04-daily.xml:278 +#: ../en/ch05-daily.xml:280 msgid "Why should changes follow copies?" msgstr "为什么复制后需要后续修改?" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:280 -msgid "" -"This behaviour, of changes to a file propagating out to copies of the file, " -"might seem esoteric, but in most cases it's highly desirable." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:284 +#: ../en/ch05-daily.xml:282 +msgid "" +"This behavior&emdash;of changes to a file propagating out to copies of the " +"file&emdash;might seem esoteric, but in most cases it's highly desirable." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch05-daily.xml:286 msgid "" "First of all, remember that this propagation <emphasis>only</emphasis> " "happens when you merge. So if you <command role=\"hg-cmd\">hg copy</command> " @@ -5253,15 +6669,15 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:290 +#: ../en/ch05-daily.xml:292 msgid "" "The second thing to know is that modifications will only propagate across a " -"copy as long as the repository that you're pulling changes from " -"<emphasis>doesn't know</emphasis> about the copy." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:295 +"copy as long as the changeset that you're merging changes from " +"<emphasis>hasn't yet seen</emphasis> the copy." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch05-daily.xml:297 msgid "" "The reason that Mercurial does this is as follows. Let's say I make an " "important bug fix in a source file, and commit my changes. Meanwhile, you've " @@ -5271,16 +6687,16 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:302 +#: ../en/ch05-daily.xml:304 msgid "" "If you pulled and merged my changes, and Mercurial <emphasis>didn't</" -"emphasis> propagate changes across copies, your source file would now contain " -"the bug, and unless you remembered to propagate the bug fix by hand, the bug " -"would <emphasis>remain</emphasis> in your copy of the file." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:308 +"emphasis> propagate changes across copies, your new source file would now " +"contain the bug, and unless you knew to propagate the bug fix by hand, the " +"bug would <emphasis>remain</emphasis> in your copy of the file." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch05-daily.xml:310 msgid "" "By automatically propagating the change that fixed the bug from the original " "file to the copy, Mercurial prevents this class of problem. To my knowledge, " @@ -5289,97 +6705,103 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:314 +#: ../en/ch05-daily.xml:316 msgid "" "Once your change history has a record that the copy and subsequent merge " "occurred, there's usually no further need to propagate changes from the " "original file to the copied file, and that's why Mercurial only propagates " -"changes across copies until this point, and no further." +"changes across copies at the first merge, and not afterwards." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch04-daily.xml:322 +#: ../en/ch05-daily.xml:324 msgid "How to make changes <emphasis>not</emphasis> follow a copy" msgstr "如何让复制后<emphasis>不</emphasis>修改?" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:325 +#: ../en/ch05-daily.xml:327 msgid "" "If, for some reason, you decide that this business of automatically " "propagating changes across copies is not for you, simply use your system's " "normal file copy command (on Unix-like systems, that's <command>cp</command>) " "to make a copy of a file, then <command role=\"hg-cmd\">hg add</command> the " "new copy by hand. Before you do so, though, please do reread <xref linkend=" -"\"sec:daily:why-copy\"/>, and make an informed decision that this behaviour " -"is not appropriate to your specific case." +"\"sec:daily:why-copy\"/>, and make an informed decision that this behavior is " +"not appropriate to your specific case." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch04-daily.xml:338 -msgid "Behaviour of the <command role=\"hg-cmd\">hg copy</command> command" +#: ../en/ch05-daily.xml:340 +msgid "Behavior of the <command role=\"hg-cmd\">hg copy</command> command" msgstr "命令 <command role=\"hg-cmd\">hg copy</command> 的特性" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:341 +#: ../en/ch05-daily.xml:343 msgid "" "When you use the <command role=\"hg-cmd\">hg copy</command> command, " "Mercurial makes a copy of each source file as it currently stands in the " "working directory. This means that if you make some modifications to a file, " "then <command role=\"hg-cmd\">hg copy</command> it without first having " "committed those changes, the new copy will also contain the modifications you " -"have made up until that point. (I find this behaviour a little " +"have made up until that point. (I find this behavior a little " "counterintuitive, which is why I mention it here.)" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:351 +#: ../en/ch05-daily.xml:353 msgid "" "The <command role=\"hg-cmd\">hg copy</command> command acts similarly to the " "Unix <command>cp</command> command (you can use the <command role=\"hg-cmd" -"\">hg cp</command> alias if you prefer). The last argument is the " -"<emphasis>destination</emphasis>, and all prior arguments are " -"<emphasis>sources</emphasis>. If you pass it a single file as the source, " -"and the destination does not exist, it creates a new file with that name." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:362 +"\">hg cp</command> alias if you prefer). We must supply two or more " +"arguments, of which the last is treated as the <emphasis>destination</" +"emphasis>, and all others are <emphasis>sources</emphasis>." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch05-daily.xml:361 +msgid "" +"If you pass <command role=\"hg-cmd\">hg copy</command> a single file as the " +"source, and the destination does not exist, it creates a new file with that " +"name." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch05-daily.xml:367 msgid "" "If the destination is a directory, Mercurial copies its sources into that " "directory." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:367 +#: ../en/ch05-daily.xml:372 msgid "" "Copying a directory is recursive, and preserves the directory structure of " "the source." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:373 +#: ../en/ch05-daily.xml:378 msgid "" "If the source and destination are both directories, the source tree is " "recreated in the destination directory." msgstr "" -# -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:378 -msgid "" -"As with the <command role=\"hg-cmd\">hg rename</command> command, if you copy " +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch05-daily.xml:383 +msgid "" +"As with the <command role=\"hg-cmd\">hg remove</command> command, if you copy " "a file manually and then want Mercurial to know that you've copied the file, " "simply use the <option role=\"hg-opt-copy\">--after</option> option to " "<command role=\"hg-cmd\">hg copy</command>." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch04-daily.xml:389 +#: ../en/ch05-daily.xml:394 msgid "Renaming files" msgstr "改名文件" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch04-daily.xml:391 +#: ../en/ch05-daily.xml:396 msgid "" "It's rather more common to need to rename a file than to make a copy of it. " "The reason I discussed the <command role=\"hg-cmd\">hg copy</command> command " @@ -5389,7 +6811,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch04-daily.xml:399 +#: ../en/ch05-daily.xml:404 msgid "" "When you use the <command role=\"hg-cmd\">hg rename</command> command, " "Mercurial makes a copy of each source file, then deletes it and marks the " @@ -5397,14 +6819,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch04-daily.xml:405 +#: ../en/ch05-daily.xml:410 msgid "" "The <command role=\"hg-cmd\">hg status</command> command shows the newly " "copied file as added, and the copied-from file as removed." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch04-daily.xml:411 +#: ../en/ch05-daily.xml:416 msgid "" "As with the results of a <command role=\"hg-cmd\">hg copy</command>, we must " "use the <option role=\"hg-opt-status\">-C</option> option to <command role=" @@ -5413,30 +6835,38 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch04-daily.xml:420 +#: ../en/ch05-daily.xml:425 msgid "" "As with <command role=\"hg-cmd\">hg remove</command> and <command role=\"hg-" "cmd\">hg copy</command>, you can tell Mercurial about a rename after the fact " "using the <option role=\"hg-opt-rename\">--after</option> option. In most " -"other respects, the behaviour of the <command role=\"hg-cmd\">hg rename</" +"other respects, the behavior of the <command role=\"hg-cmd\">hg rename</" "command> command, and the options it accepts, are similar to the <command " "role=\"hg-cmd\">hg copy</command> command." msgstr "" +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:434 +msgid "" +"If you're familiar with the Unix command line, you'll be glad to know that " +"<command role=\"hg-cmd\">hg rename</command> command can be invoked as " +"<command role=\"hg-cmd\">hg mv</command>." +msgstr "" + #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch04-daily.xml:430 +#: ../en/ch05-daily.xml:440 msgid "Renaming files and merging changes" msgstr "改名文件与合并修改" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:432 +#: ../en/ch05-daily.xml:442 msgid "" "Since Mercurial's rename is implemented as copy-and-remove, the same " "propagation of changes happens when you merge after a rename as after a copy." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:436 +#: ../en/ch05-daily.xml:446 msgid "" "If I modify a file, and you rename it to a new name, and then we merge our " "respective changes, my modifications to the file under its original name will " @@ -5446,7 +6876,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:443 +#: ../en/ch05-daily.xml:453 msgid "" "Whereas having changes follow a copy is a feature where you can perhaps nod " "and say <quote>yes, that might be useful,</quote> it should be clear that " @@ -5456,12 +6886,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch04-daily.xml:452 +#: ../en/ch05-daily.xml:462 msgid "Divergent renames and merging" msgstr "改名与合并的分歧" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:454 +#: ../en/ch05-daily.xml:464 msgid "" "The case of diverging names occurs when two developers start with a " "file&emdash;let's call it <filename>foo</filename>&emdash;in their respective " @@ -5469,45 +6899,47 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:461 +#: ../en/ch05-daily.xml:471 msgid "Anne renames the file to <filename>bar</filename>." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:465 -msgid "Meanwhile, Bob renames it to <filename>quux</filename>." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:470 +#: ../en/ch05-daily.xml:475 +msgid "" +"Meanwhile, Bob renames it to <filename>quux</filename>. (Remember that " +"<command role=\"hg-cmd\">hg mv</command> is an alias for <command role=\"hg-" +"cmd\">hg rename</command>.)" +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch05-daily.xml:482 msgid "" "I like to think of this as a conflict because each developer has expressed " "different intentions about what the file ought to be named." msgstr "" -# -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:474 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch05-daily.xml:486 msgid "" "What do you think should happen when they merge their work? Mercurial's " -"actual behaviour is that it always preserves <emphasis>both</emphasis> names " +"actual behavior is that it always preserves <emphasis>both</emphasis> names " "when it merges changesets that contain divergent renames." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:481 -msgid "" -"Notice that Mercurial does warn about the divergent renames, but it leaves it " +#: ../en/ch05-daily.xml:493 +msgid "" +"Notice that while Mercurial warns about the divergent renames, it leaves it " "up to you to do something about the divergence after the merge." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch04-daily.xml:487 +#: ../en/ch05-daily.xml:499 msgid "Convergent renames and merging" msgstr "收敛改名与合并" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:489 +#: ../en/ch05-daily.xml:501 msgid "" "Another kind of rename conflict occurs when two people choose to rename " "different <emphasis>source</emphasis> files to the same " @@ -5516,12 +6948,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch04-daily.xml:497 +#: ../en/ch05-daily.xml:509 msgid "Other name-related corner cases" msgstr "其它名称相关的角落" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch04-daily.xml:499 +#: ../en/ch05-daily.xml:511 msgid "" "Mercurial has a longstanding bug in which it fails to handle a merge where " "one side has a file with a given name, while another has a directory with the " @@ -5530,19 +6962,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch04-daily.xml:511 +#: ../en/ch05-daily.xml:524 msgid "Recovering from mistakes" msgstr "从错误恢复" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch04-daily.xml:513 +#: ../en/ch05-daily.xml:526 msgid "" "Mercurial has some useful commands that will help you to recover from some " "common mistakes." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch04-daily.xml:516 +#: ../en/ch05-daily.xml:529 msgid "" "The <command role=\"hg-cmd\">hg revert</command> command lets you undo " "changes that you have made to your working directory. For example, if you " @@ -5554,29 +6986,399 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch04-daily.xml:526 -msgid "" -"It's useful to remember that the <command role=\"hg-cmd\">hg revert</command> " -"command is useful for changes that you have not yet committed. Once you've " -"committed a change, if you decide it was a mistake, you can still do " +#: ../en/ch05-daily.xml:539 +msgid "" +"It is helpful to remember that the <command role=\"hg-cmd\">hg revert</" +"command> command is useful for changes that you have not yet committed. Once " +"you've committed a change, if you decide it was a mistake, you can still do " "something about it, though your options may be more limited." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch04-daily.xml:532 +#: ../en/ch05-daily.xml:546 msgid "" "For more information about the <command role=\"hg-cmd\">hg revert</command> " "command, and details about how to deal with changes you have already " "committed, see <xref linkend=\"chap:undo\"/>." msgstr "" +#. type: Content of: <book><chapter><sect1><title> +#: ../en/ch05-daily.xml:553 +msgid "Dealing with tricky merges" +msgstr "合并的技巧" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:555 +msgid "" +"In a complicated or large project, it's not unusual for a merge of two " +"changesets to result in some headaches. Suppose there's a big source file " +"that's been extensively edited by each side of a merge: this is almost " +"inevitably going to result in conflicts, some of which can take a few tries " +"to sort out." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:562 +msgid "" +"Let's develop a simple case of this and see how to deal with it. We'll start " +"off with a repository containing one file, and clone it twice." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:568 +msgid "In one clone, we'll modify the file in one way." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:572 +msgid "In another, we'll modify the file differently." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:576 +msgid "Next, we'll pull each set of changes into our original repo." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:581 +msgid "We expect our repository to now contain two heads." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:585 +msgid "" +"Normally, if we run <command role=\"hg-cmd\">hg merge</command> at this " +"point, it will drop us into a GUI that will let us manually resolve the " +"conflicting edits to <filename>myfile.txt</filename>. However, to simplify " +"things for presentation here, we'd like the merge to fail immediately " +"instead. Here's one way we can do so." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:594 +msgid "" +"We've told Mercurial's merge machinery to run the command <command>false</" +"command> (which, as we desire, fails immediately) if it detects a merge that " +"it can't sort out automatically." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:599 +msgid "" +"If we now fire up <command role=\"hg-cmd\">hg merge</command>, it should " +"grind to a halt and report a failure." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:605 +msgid "" +"Even if we don't notice that the merge failed, Mercurial will prevent us from " +"accidentally committing the result of a failed merge." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:611 +msgid "" +"When <command role=\"hg-cmd\">hg commit</command> fails in this case, it " +"suggests that we use the unfamiliar <command role=\"hg-cmd\">hg resolve</" +"command> command. As usual, <command role=\"hg-cmd\">hg help resolve</" +"command> will print a helpful synopsis." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><title> +#: ../en/ch05-daily.xml:618 +msgid "File resolution states" +msgstr "文件的解决状态" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch05-daily.xml:620 +msgid "" +"When a merge occurs, most files will usually remain unmodified. For each " +"file where Mercurial has to do something, it tracks the state of the file." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> +#: ../en/ch05-daily.xml:626 +msgid "" +"A <emphasis>resolved</emphasis> file has been successfully merged, either " +"automatically by Mercurial or manually with human intervention." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> +#: ../en/ch05-daily.xml:631 +msgid "" +"An <emphasis>unresolved</emphasis> file was not merged successfully, and " +"needs more attention." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch05-daily.xml:636 +msgid "" +"If Mercurial sees <emphasis>any</emphasis> file in the unresolved state after " +"a merge, it considers the merge to have failed. Fortunately, we do not need " +"to restart the entire merge from scratch." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch05-daily.xml:641 +msgid "" +"The <option role=\"hg-opt-resolve\">--list</option> or <option role=\"hg-opt-" +"resolve\">-l</option> option to <command role=\"hg-cmd\">hg resolve</command> " +"prints out the state of each merged file." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch05-daily.xml:648 +msgid "" +"In the output from <command role=\"hg-cmd\">hg resolve</command>, a resolved " +"file is marked with <literal>R</literal>, while an unresolved file is marked " +"with <literal>U</literal>. If any files are listed with <literal>U</" +"literal>, we know that an attempt to commit the results of the merge will " +"fail." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><title> +#: ../en/ch05-daily.xml:657 +msgid "Resolving a file merge" +msgstr "合并文件" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch05-daily.xml:659 +msgid "" +"We have several options to move a file from the unresolved into the resolved " +"state. By far the most common is to rerun <command role=\"hg-cmd\">hg " +"resolve</command>. If we pass the names of individual files or directories, " +"it will retry the merges of any unresolved files present in those locations. " +"We can also pass the <option role=\"hg-opt-resolve\">--all</option> or " +"<option role=\"hg-opt-resolve\">-a</option> option, which will retry the " +"merges of <emphasis>all</emphasis> unresolved files." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch05-daily.xml:669 +msgid "" +"Mercurial also lets us modify the resolution state of a file directly. We " +"can manually mark a file as resolved using the <option role=\"hg-opt-resolve" +"\">--mark</option> option, or as unresolved using the <option role=\"hg-opt-" +"resolve\">--unmark</option> option. This allows us to clean up a " +"particularly messy merge by hand, and to keep track of our progress with each " +"file as we go." +msgstr "" + +#. type: Content of: <book><chapter><sect1><title> +#: ../en/ch05-daily.xml:680 +msgid "More useful diffs" +msgstr "更有用的差异" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:682 +msgid "" +"The default output of the <command role=\"hg-cmd\">hg diff</command> command " +"is backwards compatible with the regular <command>diff</command> command, but " +"this has some drawbacks." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:687 +msgid "" +"Consider the case where we use <command role=\"hg-cmd\">hg rename</command> " +"to rename a file." +msgstr "" +"设想我们使用 <command role=\"hg-cmd\">hg rename</command> 命令来改名文件。" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:692 +msgid "" +"The output of <command role=\"hg-cmd\">hg diff</command> above obscures the " +"fact that we simply renamed a file. The <command role=\"hg-cmd\">hg diff</" +"command> command accepts an option, <option>--git</option> or <option>-g</" +"option>, to use a newer diff format that displays such information in a more " +"readable form." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:701 +msgid "" +"This option also helps with a case that can otherwise be confusing: a file " +"that appears to be modified according to <command role=\"hg-cmd\">hg status</" +"command>, but for which <command role=\"hg-cmd\">hg diff</command> prints " +"nothing. This situation can arise if we change the file's execute permissions." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:710 +msgid "" +"The normal <command>diff</command> command pays no attention to file " +"permissions, which is why <command role=\"hg-cmd\">hg diff</command> prints " +"nothing by default. If we supply it with the <option>-g</option> option, it " +"tells us what really happened." +msgstr "" + +#. type: Content of: <book><chapter><sect1><title> +#: ../en/ch05-daily.xml:720 +msgid "Which files to manage, and which to avoid" +msgstr "需要管理哪些文件,应该避免的事情" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:722 +msgid "" +"Revision control systems are generally best at managing text files that are " +"written by humans, such as source code, where the files do not change much " +"from one revision to the next. Some centralized revision control systems can " +"also deal tolerably well with binary files, such as bitmap images." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:728 +msgid "" +"For instance, a game development team will typically manage both its source " +"code and all of its binary assets (e.g. geometry data, textures, map layouts) " +"in a revision control system." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:733 +msgid "" +"Because it is usually impossible to merge two conflicting modifications to a " +"binary file, centralized systems often provide a file locking mechanism that " +"allow a user to say <quote>I am the only person who can edit this file</" +"quote>." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:739 +msgid "" +"Compared to a centralized system, a distributed revision control system " +"changes some of the factors that guide decisions over which files to manage " +"and how." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:743 +msgid "" +"For instance, a distributed revision control system cannot, by its nature, " +"offer a file locking facility. There is thus no built-in mechanism to " +"prevent two people from making conflicting changes to a binary file. If you " +"have a team where several people may be editing binary files frequently, it " +"may not be a good idea to use Mercurial&emdash;or any other distributed " +"revision control system&emdash;to manage those files." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:751 +msgid "" +"When storing modifications to a file, Mercurial usually saves only the " +"differences between the previous and current versions of the file. For most " +"text files, this is extremely efficient. However, some files (particularly " +"binary files) are laid out in such a way that even a small change to a file's " +"logical content results in many or most of the bytes inside the file " +"changing. For instance, compressed files are particularly susceptible to " +"this. If the differences between each successive version of a file are always " +"large, Mercurial will not be able to store the file's revision history very " +"efficiently. This can affect both local storage needs and the amount of time " +"it takes to clone a repository." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:764 +msgid "" +"To get an idea of how this could affect you in practice, suppose you want to " +"use Mercurial to manage an OpenOffice document. OpenOffice stores documents " +"on disk as compressed zip files. Edit even a single letter of your document " +"in OpenOffice, and almost every byte in the entire file will change when you " +"save it. Now suppose that file is 2MB in size. Because most of the file " +"changes every time you save, Mercurial will have to store all 2MB of the file " +"every time you commit, even though from your perspective, perhaps only a few " +"words are changing each time. A single frequently-edited file that is not " +"friendly to Mercurial's storage assumptions can easily have an outsized " +"effect on the size of the repository." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:777 +msgid "" +"Even worse, if both you and someone else edit the OpenOffice document you're " +"working on, there is no useful way to merge your work. In fact, there isn't " +"even a good way to tell what the differences are between your respective " +"changes." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:782 +msgid "" +"There are thus a few clear recommendations about specific kinds of files to " +"be very careful with." +msgstr "" + +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> +#: ../en/ch05-daily.xml:787 +msgid "" +"Files that are very large and incompressible, e.g. ISO CD-ROM images, will by " +"virtue of sheer size make clones over a network very slow." +msgstr "" + +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> +#: ../en/ch05-daily.xml:792 +msgid "" +"Files that change a lot from one revision to the next may be expensive to " +"store if you edit them frequently, and conflicts due to concurrent edits may " +"be difficult to resolve." +msgstr "" + +#. type: Content of: <book><chapter><sect1><title> +#: ../en/ch05-daily.xml:801 +msgid "Backups and mirroring" +msgstr "备份与镜像" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:803 +msgid "" +"Since Mercurial maintains a complete copy of history in each clone, everyone " +"who uses Mercurial to collaborate on a project can potentially act as a " +"source of backups in the event of a catastrophe. If a central repository " +"becomes unavailable, you can construct a replacement simply by cloning a copy " +"of the repository from one contributor, and pulling any changes they may not " +"have seen from others." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:811 +msgid "" +"It is simple to use Mercurial to perform off-site backups and remote " +"mirrors. Set up a periodic job (e.g. via the <command>cron</command> " +"command) on a remote server to pull changes from your master repositories " +"every hour. This will only be tricky in the unlikely case that the number of " +"master repositories you maintain changes frequently, in which case you'll " +"need to do a little scripting to refresh the list of repositories to back up." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:820 +msgid "" +"If you perform traditional backups of your master repositories to tape or " +"disk, and you want to back up a repository named <filename>myrepo</filename>, " +"use <command>hg clone -U myrepo myrepo.bak</command> to create a clone of " +"<filename>myrepo</filename> before you start your backups. The <option>-U</" +"option> option doesn't check out a working directory after the clone " +"completes, since that would be superfluous and make the backup take longer." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch05-daily.xml:829 +msgid "" +"If you then back up <filename>myrepo.bak</filename> instead of " +"<filename>myrepo</filename>, you will be guaranteed to have a consistent " +"snapshot of your repository that won't be pushed to by an insomniac developer " +"in mid-backup." +msgstr "" + #. type: Content of: <book><chapter><title> -#: ../en/ch05-collab.xml:5 +#: ../en/ch06-collab.xml:5 msgid "Collaborating with other people" msgstr "团体协作" #. type: Content of: <book><chapter><para> -#: ../en/ch05-collab.xml:7 +#: ../en/ch06-collab.xml:7 msgid "" "As a completely decentralised tool, Mercurial doesn't impose any policy on " "how people ought to work with each other. However, if you're new to " @@ -5585,32 +7387,33 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch05-collab.xml:14 +#: ../en/ch06-collab.xml:14 msgid "Mercurial's web interface" msgstr "Mercurial 的 web 接口" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch05-collab.xml:16 +#: ../en/ch06-collab.xml:16 msgid "" "Mercurial has a powerful web interface that provides several useful " "capabilities." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch05-collab.xml:19 +#: ../en/ch06-collab.xml:19 msgid "" "For interactive use, the web interface lets you browse a single repository or " "a collection of repositories. You can view the history of a repository, " "examine each change (comments and diffs), and view the contents of each " -"directory and file." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch05-collab.xml:24 -msgid "" -"Also for human consumption, the web interface provides an RSS feed of the " -"changes in a repository. This lets you <quote>subscribe</quote> to a " -"repository using your favourite feed reader, and be automatically notified of " +"directory and file. You can even get a view of history that gives a " +"graphical view of the relationships between individual changes and merges." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch06-collab.xml:26 +msgid "" +"Also for human consumption, the web interface provides Atom and RSS feeds of " +"the changes in a repository. This lets you <quote>subscribe</quote> to a " +"repository using your favorite feed reader, and be automatically notified of " "activity in that repository as soon as it happens. I find this capability " "much more convenient than the model of subscribing to a mailing list to which " "notifications are sent, as it requires no additional configuration on the " @@ -5618,7 +7421,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch05-collab.xml:34 +#: ../en/ch06-collab.xml:36 msgid "" "The web interface also lets remote users clone a repository, pull changes " "from it, and (when the server is configured to permit it) push changes back " @@ -5627,35 +7430,57 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch05-collab.xml:40 +#: ../en/ch06-collab.xml:42 msgid "" "The easiest way to get started with the web interface is to use your web " "browser to visit an existing repository, such as the master Mercurial " -"repository at <ulink url=\"http://www.selenic.com/repo/hg?style=gitweb" -"\">http://www.selenic.com/repo/hg?style=gitweb</ulink>." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch05-collab.xml:45 +"repository at <ulink url=\"http://www.selenic.com/repo/hg\">http://www." +"selenic.com/repo/hg</ulink>." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch06-collab.xml:47 msgid "" "If you're interested in providing a web interface to your own repositories, " -"Mercurial provides two ways to do this. The first is using the <command role=" -"\"hg-cmd\">hg serve</command> command, which is best suited to short-term " -"<quote>lightweight</quote> serving. See <xref linkend=\"sec:collab:serve\"/> " -"below for details of how to use this command. If you have a long-lived " -"repository that you'd like to make permanently available, Mercurial has built-" -"in support for the CGI (Common Gateway Interface) standard, which all common " -"web servers support. See <xref linkend=\"sec:collab:cgi\"/> for details of " -"CGI configuration." +"there are several good ways to do this." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch06-collab.xml:51 +msgid "" +"The easiest and fastest way to get started in an informal environment is to " +"use the <command role=\"hg-cmd\">hg serve</command> command, which is best " +"suited to short-term <quote>lightweight</quote> serving. See <xref linkend=" +"\"sec:collab:serve\"/> below for details of how to use this command." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch06-collab.xml:58 +msgid "" +"For longer-lived repositories that you'd like to have permanently available, " +"there are several public hosting services available. Some are free to open " +"source projects, while others offer paid commercial hosting. An up-to-date " +"list is available at <ulink url=\"http://www.selenic.com/mercurial/wiki/index." +"cgi/MercurialHosting\">http://www.selenic.com/mercurial/wiki/index.cgi/" +"MercurialHosting</ulink>." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch06-collab.xml:65 +msgid "" +"If you would prefer to host your own repositories, Mercurial has built-in " +"support for several popular hosting technologies, most notably CGI (Common " +"Gateway Interface), and WSGI (Web Services Gateway Interface). See <xref " +"linkend=\"sec:collab:cgi\"/> for details of CGI and WSGI configuration." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch05-collab.xml:60 +#: ../en/ch06-collab.xml:74 msgid "Collaboration models" msgstr "协作模型" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch05-collab.xml:62 +#: ../en/ch06-collab.xml:76 msgid "" "With a suitably flexible tool, making decisions about workflow is much more " "of a social engineering challenge than a technical one. Mercurial imposes few " @@ -5665,12 +7490,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch05-collab.xml:70 +#: ../en/ch06-collab.xml:84 msgid "Factors to keep in mind" msgstr "要牢记的因素" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:72 +#: ../en/ch06-collab.xml:86 msgid "" "The most important aspect of any model that you must keep in mind is how well " "it matches the needs and capabilities of the people who will be using it. " @@ -5679,7 +7504,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:78 +#: ../en/ch06-collab.xml:92 msgid "" "I once put together a workflow model that seemed to make perfect sense to me, " "but that caused a considerable amount of consternation and strife within my " @@ -5692,7 +7517,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:88 +#: ../en/ch06-collab.xml:102 msgid "" "Don't sweep foreseeable social or technical problems under the rug. Whatever " "scheme you put into effect, you should plan for mistakes and problem " @@ -5706,12 +7531,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch05-collab.xml:102 +#: ../en/ch06-collab.xml:116 msgid "Informal anarchy" msgstr "无政府状态" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:104 +#: ../en/ch06-collab.xml:118 msgid "" "I wouldn't suggest an <quote>anything goes</quote> approach as something " "sustainable, but it's a model that's easy to grasp, and it works perfectly " @@ -5719,11 +7544,11 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:109 +#: ../en/ch06-collab.xml:123 msgid "" "As one example, many projects have a loose-knit group of collaborators who " "rarely physically meet each other. Some groups like to overcome the " -"isolation of working at a distance by organising occasional <quote>sprints</" +"isolation of working at a distance by organizing occasional <quote>sprints</" "quote>. In a sprint, a number of people get together in a single location (a " "company's conference room, a hotel meeting room, that kind of place) and " "spend several days more or less locked in there, hacking intensely on a " @@ -5731,37 +7556,38 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:118 -msgid "" -"A sprint is the perfect place to use the <command role=\"hg-cmd\">hg serve</" -"command> command, since <command role=\"hg-cmd\">hg serve</command> does not " -"require any fancy server infrastructure. You can get started with <command " -"role=\"hg-cmd\">hg serve</command> in moments, by reading <xref linkend=\"sec:" -"collab:serve\"/> below. Then simply tell the person next to you that you're " -"running a server, send the URL to them in an instant message, and you " -"immediately have a quick-turnaround way to work together. They can type your " -"URL into their web browser and quickly review your changes; or they can pull " -"a bugfix from you and verify it; or they can clone a branch containing a new " -"feature and try it out." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:132 +#: ../en/ch06-collab.xml:132 +msgid "" +"A sprint or a hacking session in a coffee shop are the perfect places to use " +"the <command role=\"hg-cmd\">hg serve</command> command, since <command role=" +"\"hg-cmd\">hg serve</command> does not require any fancy server " +"infrastructure. You can get started with <command role=\"hg-cmd\">hg serve</" +"command> in moments, by reading <xref linkend=\"sec:collab:serve\"/> below. " +"Then simply tell the person next to you that you're running a server, send " +"the URL to them in an instant message, and you immediately have a quick-" +"turnaround way to work together. They can type your URL into their web " +"browser and quickly review your changes; or they can pull a bugfix from you " +"and verify it; or they can clone a branch containing a new feature and try it " +"out." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch06-collab.xml:146 msgid "" "The charm, and the problem, with doing things in an ad hoc fashion like this " "is that only people who know about your changes, and where they are, can see " "them. Such an informal approach simply doesn't scale beyond a handful " -"people, because each individual needs to know about $n$ different " -"repositories to pull from." +"people, because each individual needs to know about <emphasis>n</emphasis> " +"different repositories to pull from." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch05-collab.xml:141 +#: ../en/ch06-collab.xml:156 msgid "A single central repository" msgstr "单一中央版本库" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:143 +#: ../en/ch06-collab.xml:158 msgid "" "For smaller projects migrating from a centralised revision control tool, " "perhaps the easiest way to get started is to have changes flow through a " @@ -5770,7 +7596,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:149 +#: ../en/ch06-collab.xml:164 msgid "" "Contributors start by cloning a copy of this repository. They can pull " "changes from it whenever they need to, and some (perhaps all) developers have " @@ -5779,7 +7605,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:154 +#: ../en/ch06-collab.xml:169 msgid "" "Under this model, it can still often make sense for people to pull changes " "directly from each other, without going through the central repository. " @@ -5792,24 +7618,55 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:165 -msgid "" -"In this kind of scenario, people usually use the <command>ssh</command> " -"protocol to securely push changes to the central repository, as documented in " -"<xref linkend=\"sec:collab:ssh\"/>. It's also usual to publish a read-only " -"copy of the repository over HTTP using CGI, as in <xref linkend=\"sec:collab:" -"cgi\"/>. Publishing over HTTP satisfies the needs of people who don't have " -"push access, and those who want to use web browsers to browse the " -"repository's history." +#: ../en/ch06-collab.xml:180 +msgid "" +"If a team is hosting its own repository in this kind of scenario, people will " +"usually use the <command>ssh</command> protocol to securely push changes to " +"the central repository, as documented in <xref linkend=\"sec:collab:ssh\"/>. " +"It's also usual to publish a read-only copy of the repository over HTTP, as " +"in <xref linkend=\"sec:collab:cgi\"/>. Publishing over HTTP satisfies the " +"needs of people who don't have push access, and those who want to use web " +"browsers to browse the repository's history." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch05-collab.xml:177 +#: ../en/ch06-collab.xml:193 +msgid "A hosted central repository" +msgstr "托管的中央版本库" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch06-collab.xml:195 +msgid "" +"A wonderful thing about public hosting services like <ulink url=\"http://" +"bitbucket.org/\">Bitbucket</ulink> is that not only do they handle the fiddly " +"server configuration details, such as user accounts, authentication, and " +"secure wire protocols, they provide additional infrastructure to make this " +"model work well." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch06-collab.xml:202 +msgid "" +"For instance, a well-engineered hosting service will let people clone their " +"own copies of a repository with a single click. This lets people work in " +"separate spaces and share their changes when they're ready." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch06-collab.xml:207 +msgid "" +"In addition, a good hosting service will let people communicate with each " +"other, for instance to say <quote>there are changes ready for you to review " +"in this tree</quote>." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><title> +#: ../en/ch06-collab.xml:214 msgid "Working with multiple branches" msgstr "使用多个分支工作" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:179 +#: ../en/ch06-collab.xml:216 msgid "" "Projects of any significant size naturally tend to make progress on several " "fronts simultaneously. In the case of software, it's common for a project to " @@ -5823,30 +7680,30 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:192 +#: ../en/ch06-collab.xml:229 msgid "" "Mercurial is particularly well suited to managing a number of simultaneous, " "but not identical, branches. Each <quote>development direction</quote> can " "live in its own central repository, and you can merge changes from one to " "another as the need arises. Because repositories are independent of each " "other, unstable changes in a development branch will never affect a stable " -"branch unless someone explicitly merges those changes in." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:201 +"branch unless someone explicitly merges those changes into the stable branch." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch06-collab.xml:238 msgid "" "Here's an example of how this can work in practice. Let's say you have one " "<quote>main branch</quote> on a central server." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:207 +#: ../en/ch06-collab.xml:244 msgid "People clone it, make changes locally, test them, and push them back." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:210 +#: ../en/ch06-collab.xml:247 msgid "" "Once the main branch reaches a release milestone, you can use the <command " "role=\"hg-cmd\">hg tag</command> command to give a permanent name to the " @@ -5854,12 +7711,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:216 +#: ../en/ch06-collab.xml:253 msgid "Let's say some ongoing development occurs on the main branch." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:221 +#: ../en/ch06-collab.xml:258 msgid "" "Using the tag that was recorded at the milestone, people who clone that " "repository at any time in the future can use <command role=\"hg-cmd\">hg " @@ -5867,57 +7724,57 @@ "when that tagged revision was committed." msgstr "" -# -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:229 -msgid "" -"In addition, immediately after the main branch is tagged, someone can then " -"clone the main branch on the server to a new <quote>stable</quote> branch, " -"also on the server." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:235 -msgid "" -"Someone who needs to make a change to the stable branch can then clone " -"<emphasis>that</emphasis> repository, make their changes, commit, and push " -"their changes back there." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:241 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch06-collab.xml:266 +msgid "" +"In addition, immediately after the main branch is tagged, we can then clone " +"the main branch on the server to a new <quote>stable</quote> branch, also on " +"the server." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch06-collab.xml:272 +msgid "" +"If we need to make a change to the stable branch, we can then clone " +"<emphasis>that</emphasis> repository, make our changes, commit, and push our " +"changes back there." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch06-collab.xml:279 msgid "" "Because Mercurial repositories are independent, and Mercurial doesn't move " "changes around automatically, the stable and main branches are " -"<emphasis>isolated</emphasis> from each other. The changes that you made on " +"<emphasis>isolated</emphasis> from each other. The changes that we made on " "the main branch don't <quote>leak</quote> to the stable branch, and vice " "versa." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:248 -msgid "" -"You'll often want all of your bugfixes on the stable branch to show up on the " -"main branch, too. Rather than rewrite a bugfix on the main branch, you can " +#: ../en/ch06-collab.xml:286 +msgid "" +"We'll often want all of our bugfixes on the stable branch to show up on the " +"main branch, too. Rather than rewrite a bugfix on the main branch, we can " "simply pull and merge changes from the stable to the main branch, and " -"Mercurial will bring those bugfixes in for you." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:256 +"Mercurial will bring those bugfixes in for us." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch06-collab.xml:294 msgid "" "The main branch will still contain changes that are not on the stable branch, " "but it will also contain all of the bugfixes from the stable branch. The " -"stable branch remains unaffected by these changes." +"stable branch remains unaffected by these changes, since changes are only " +"flowing from the stable to the main branch, and not the other way." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><figure><title> -#: ../en/ch05-collab.xml:263 ../en/ch05-collab.xml:273 +#: ../en/ch06-collab.xml:303 ../en/ch06-collab.xml:313 msgid "Feature branches" msgstr "特性分支" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:265 +#: ../en/ch06-collab.xml:305 msgid "" "For larger projects, an effective way to manage change is to break up a team " "into smaller groups. Each group has a shared branch of its own, cloned from " @@ -5927,14 +7784,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject> -#: ../en/ch05-collab.xml:275 +#: ../en/ch06-collab.xml:315 msgid "" "<imageobject><imagedata width=\"100%\" fileref=\"figs/feature-branches.png\"/" "></imageobject>" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:280 +#: ../en/ch06-collab.xml:320 msgid "" "When a particular feature is deemed to be in suitable shape, someone on that " "feature team pulls and merges from the master branch into the feature branch, " @@ -5942,20 +7799,20 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch05-collab.xml:287 +#: ../en/ch06-collab.xml:327 msgid "The release train" msgstr "发布列车" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:289 -msgid "" -"Some projects are organised on a <quote>train</quote> basis: a release is " +#: ../en/ch06-collab.xml:329 +msgid "" +"Some projects are organized on a <quote>train</quote> basis: a release is " "scheduled to happen every few months, and whatever features are ready when " "the <quote>train</quote> is ready to leave are allowed in." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:294 +#: ../en/ch06-collab.xml:334 msgid "" "This model resembles working with feature branches. The difference is that " "when a feature branch misses a train, someone on the feature team pulls and " @@ -5965,12 +7822,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch05-collab.xml:303 +#: ../en/ch06-collab.xml:343 msgid "The Linux kernel model" msgstr "Linux 内核模型" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:305 +#: ../en/ch06-collab.xml:345 msgid "" "The development of the Linux kernel has a shallow hierarchical structure, " "surrounded by a cloud of apparent chaos. Because most Linux developers use " @@ -5980,7 +7837,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:313 +#: ../en/ch06-collab.xml:353 msgid "" "At the center of the community sits Linus Torvalds, the creator of Linux. He " "publishes a single source repository that is considered the " @@ -5990,7 +7847,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:320 +#: ../en/ch06-collab.xml:360 msgid "" "Linus has a number of <quote>trusted lieutenants</quote>. As a general rule, " "he pulls whatever changes they publish, in most cases without even reviewing " @@ -6004,7 +7861,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:332 +#: ../en/ch06-collab.xml:372 msgid "" "Individual lieutenants have their own approaches to reviewing, accepting, and " "publishing changes; and for deciding when to feed them to Linus. In " @@ -6017,7 +7874,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:343 +#: ../en/ch06-collab.xml:383 msgid "" "This model has two notable features. The first is that it's <quote>pull " "only</quote>. You have to ask, convince, or beg another developer to take a " @@ -6027,7 +7884,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:350 +#: ../en/ch06-collab.xml:390 msgid "" "The second is that it's based on reputation and acclaim. If you're an " "unknown, Linus will probably ignore changes from you without even " @@ -6041,7 +7898,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:361 +#: ../en/ch06-collab.xml:401 msgid "" "Reputation and acclaim don't necessarily cross subsystem or <quote>people</" "quote> boundaries. If you're a respected but specialised storage hacker, and " @@ -6050,7 +7907,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:368 +#: ../en/ch06-collab.xml:408 msgid "" "To people who come from more orderly project backgrounds, the comparatively " "chaotic Linux kernel development process often seems completely insane. It's " @@ -6060,12 +7917,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch05-collab.xml:378 +#: ../en/ch06-collab.xml:418 msgid "Pull-only versus shared-push collaboration" msgstr "只读与共享写协作" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:380 +#: ../en/ch06-collab.xml:420 msgid "" "A perpetual source of heat in the open source community is whether a " "development model in which people only ever pull changes from others is " @@ -6074,7 +7931,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:386 +#: ../en/ch06-collab.xml:426 msgid "" "Typically, the backers of the shared-push model use tools that actively " "enforce this approach. If you're using a centralised revision control tool " @@ -6085,21 +7942,20 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:394 -msgid "" -"A good distributed revision control tool, such as Mercurial, will support " -"both models. You and your collaborators can then structure how you work " -"together based on your own needs and preferences, not on what contortions " -"your tools force you into." +#: ../en/ch06-collab.xml:434 +msgid "" +"A good distributed revision control tool will support both models. You and " +"your collaborators can then structure how you work together based on your own " +"needs and preferences, not on what contortions your tools force you into." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch05-collab.xml:402 +#: ../en/ch06-collab.xml:441 msgid "Where collaboration meets branch management" msgstr "协作与分支管理" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:404 +#: ../en/ch06-collab.xml:443 msgid "" "Once you and your team set up some shared repositories and start propagating " "changes back and forth between local and shared repos, you begin to face a " @@ -6110,24 +7966,24 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch05-collab.xml:416 +#: ../en/ch06-collab.xml:455 msgid "The technical side of sharing" msgstr "共享的技术因素" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch05-collab.xml:418 -msgid "" -"The remainder of this chapter is devoted to the question of serving data to " -"your collaborators." +#: ../en/ch06-collab.xml:457 +msgid "" +"The remainder of this chapter is devoted to the question of sharing changes " +"with your collaborators." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch05-collab.xml:423 +#: ../en/ch06-collab.xml:462 msgid "Informal sharing with <command role=\"hg-cmd\">hg serve</command>" msgstr "使用 <command role=\"hg-cmd\">hg serve</command> 进行非正式共享" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch05-collab.xml:426 +#: ../en/ch06-collab.xml:465 msgid "" "Mercurial's <command role=\"hg-cmd\">hg serve</command> command is " "wonderfully suited to small, tight-knit, and fast-paced group environments. " @@ -6136,7 +7992,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch05-collab.xml:431 +#: ../en/ch06-collab.xml:470 msgid "" "Run <command role=\"hg-cmd\">hg serve</command> inside a repository, and in " "under a second it will bring up a specialised HTTP server; this will accept " @@ -6149,21 +8005,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch05-collab.xml:442 +#: ../en/ch06-collab.xml:481 msgid "" "The <command role=\"hg-cmd\">hg serve</command> command is <emphasis>not</" "emphasis> a general-purpose web server. It can do only two things:" msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:446 +#: ../en/ch06-collab.xml:485 msgid "" "Allow people to browse the history of the repository it's serving, from their " "normal web browsers." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:450 +#: ../en/ch06-collab.xml:489 msgid "" "Speak Mercurial's wire protocol, so that people can <command role=\"hg-cmd" "\">hg clone</command> or <command role=\"hg-cmd\">hg pull</command> changes " @@ -6171,7 +8027,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch05-collab.xml:455 +#: ../en/ch06-collab.xml:494 msgid "" "In particular, <command role=\"hg-cmd\">hg serve</command> won't allow remote " "users to <emphasis>modify</emphasis> your repository. It's intended for read-" @@ -6179,7 +8035,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch05-collab.xml:459 +#: ../en/ch06-collab.xml:498 msgid "" "If you're getting started with Mercurial, there's nothing to prevent you from " "using <command role=\"hg-cmd\">hg serve</command> to serve up a repository on " @@ -6190,12 +8046,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch05-collab.xml:469 +#: ../en/ch06-collab.xml:508 msgid "A few things to keep in mind" msgstr "要牢记的几件事" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:471 +#: ../en/ch06-collab.xml:510 msgid "" "Because it provides unauthenticated read access to all clients, you should " "only use <command role=\"hg-cmd\">hg serve</command> in an environment where " @@ -6204,7 +8060,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:477 +#: ../en/ch06-collab.xml:516 msgid "" "The <command role=\"hg-cmd\">hg serve</command> command knows nothing about " "any firewall software you might have installed on your system or network. It " @@ -6215,7 +8071,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:486 +#: ../en/ch06-collab.xml:525 msgid "" "By default, <command role=\"hg-cmd\">hg serve</command> listens for incoming " "connections on port 8000. If another process is already listening on the " @@ -6224,7 +8080,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:492 +#: ../en/ch06-collab.xml:531 msgid "" "Normally, when <command role=\"hg-cmd\">hg serve</command> starts, it prints " "no output, which can be a bit unnerving. If you'd like to confirm that it is " @@ -6234,12 +8090,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch05-collab.xml:502 +#: ../en/ch06-collab.xml:541 msgid "Using the Secure Shell (ssh) protocol" msgstr "使用 ssh 协议" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch05-collab.xml:504 +#: ../en/ch06-collab.xml:543 msgid "" "You can pull and push changes securely over a network connection using the " "Secure Shell (<literal>ssh</literal>) protocol. To use this successfully, " @@ -6248,40 +8104,40 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch05-collab.xml:509 -msgid "" -"If you're not familiar with ssh, it's a network protocol that lets you " -"securely communicate with another computer. To use it with Mercurial, you'll " -"be setting up one or more user accounts on a server so that remote users can " -"log in and execute commands." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch05-collab.xml:515 +#: ../en/ch06-collab.xml:548 +msgid "" +"If you're not familiar with ssh, it's the name of both a command and a " +"network protocol that let you securely communicate with another computer. To " +"use it with Mercurial, you'll be setting up one or more user accounts on a " +"server so that remote users can log in and execute commands." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch06-collab.xml:554 msgid "" "(If you <emphasis>are</emphasis> familiar with ssh, you'll probably find some " "of the material that follows to be elementary in nature.)" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch05-collab.xml:520 +#: ../en/ch06-collab.xml:559 msgid "How to read and write ssh URLs" msgstr "如何读写 ssh 路径" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:522 +#: ../en/ch06-collab.xml:561 msgid "An ssh URL tends to look like this:" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch05-collab.xml:525 +#: ../en/ch06-collab.xml:564 msgid "" "The <quote><literal>ssh://</literal></quote> part tells Mercurial to use the " "ssh protocol." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch05-collab.xml:528 +#: ../en/ch06-collab.xml:567 msgid "" "The <quote><literal>bos@</literal></quote> component indicates what username " "to log into the server as. You can leave this out if the remote username is " @@ -6289,14 +8145,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch05-collab.xml:533 +#: ../en/ch06-collab.xml:572 msgid "" "The <quote><literal>hg.serpentine.com</literal></quote> gives the hostname of " "the server to log into." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch05-collab.xml:537 +#: ../en/ch06-collab.xml:576 msgid "" "The <quote>:22</quote> identifies the port number to connect to the server " "on. The default port is 22, so you only need to specify a colon and port " @@ -6304,13 +8160,13 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch05-collab.xml:542 +#: ../en/ch06-collab.xml:581 msgid "" "The remainder of the URL is the local path to the repository on the server." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:546 +#: ../en/ch06-collab.xml:585 msgid "" "There's plenty of scope for confusion with the path component of ssh URLs, as " "there is no standard way for tools to interpret it. Some programs behave " @@ -6320,7 +8176,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:553 +#: ../en/ch06-collab.xml:592 msgid "" "Mercurial treats the path to a repository on the server as relative to the " "remote user's home directory. For example, if user <literal>foo</literal> on " @@ -6331,7 +8187,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:562 +#: ../en/ch06-collab.xml:601 msgid "" "If you want to specify a path relative to another user's home directory, you " "can use a path that starts with a tilde character followed by the user's name " @@ -6339,19 +8195,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:568 +#: ../en/ch06-collab.xml:607 msgid "" "And if you really want to specify an <emphasis>absolute</emphasis> path on " "the server, begin the path component with two slashes, as in this example." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch05-collab.xml:575 +#: ../en/ch06-collab.xml:614 msgid "Finding an ssh client for your system" msgstr "为你的系统寻找 ssh 客户端" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:577 +#: ../en/ch06-collab.xml:616 msgid "" "Almost every Unix-like system comes with OpenSSH preinstalled. If you're " "using such a system, run <literal>which ssh</literal> to find out if the " @@ -6362,60 +8218,58 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:585 -msgid "" -"On Windows, you'll first need to download a suitable ssh client. There are " -"two alternatives." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:588 -msgid "" -"Simon Tatham's excellent PuTTY package <citation>web:putty</citation> " -"provides a complete suite of ssh client commands." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:592 -msgid "" -"If you have a high tolerance for pain, you can use the Cygwin port of OpenSSH." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:595 -msgid "" -"In either case, you'll need to edit your <filename role=\"special\">hg.ini</" -"filename> file to tell Mercurial where to find the actual client command. " -"For example, if you're using PuTTY, you'll need to use the <command>plink</" -"command> command as a command-line ssh client." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><note><para> -#: ../en/ch05-collab.xml:605 -msgid "" -"The path to <command>plink</command> shouldn't contain any whitespace " -"characters, or Mercurial may not be able to run it correctly (so putting it " -"in <filename class=\"directory\">C:\\Program Files</filename> is probably not " -"a good idea)." +#: ../en/ch06-collab.xml:624 +msgid "" +"On Windows, the TortoiseHg package is bundled with a version of Simon " +"Tatham's excellent <command>plink</command> command, and you should not need " +"to do any further configuration." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch05-collab.xml:614 +#: ../en/ch06-collab.xml:631 msgid "Generating a key pair" msgstr "产生密钥对" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:616 +#: ../en/ch06-collab.xml:633 msgid "" "To avoid the need to repetitively type a password every time you need to use " -"your ssh client, I recommend generating a key pair. On a Unix-like system, " -"the <command>ssh-keygen</command> command will do the trick. On Windows, if " -"you're using PuTTY, the <command>puttygen</command> command is what you'll " -"need." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:624 +"your ssh client, I recommend generating a key pair." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><tip><title> +#: ../en/ch06-collab.xml:638 +msgid "Key pairs are not mandatory" +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><tip><para> +#: ../en/ch06-collab.xml:640 +msgid "" +"Mercurial knows nothing about ssh authentication or key pairs. You can, if " +"you like, safely ignore this section and the one that follows until you grow " +"tired of repeatedly typing ssh passwords." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> +#: ../en/ch06-collab.xml:648 +msgid "" +"On a Unix-like system, the <command>ssh-keygen</command> command will do the " +"trick." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> +#: ../en/ch06-collab.xml:651 +msgid "" +"On Windows, if you're using TortoiseHg, you may need to download a command " +"named <command>puttygen</command> from <ulink url=\"http://www.chiark." +"greenend.org.uk/~sgtatham/putty\">the PuTTY web site</ulink> to generate a " +"key pair. See <ulink url=\"http://the.earth.li/~sgtatham/putty/0.60/htmldoc/" +"Chapter8.html#pubkey-puttygen\">the <command>puttygen</command> " +"documentation</ulink> for details of how use the command." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch06-collab.xml:663 msgid "" "When you generate a key pair, it's usually <emphasis>highly</emphasis> " "advisable to protect it with a passphrase. (The only time that you might not " @@ -6424,7 +8278,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:630 +#: ../en/ch06-collab.xml:669 msgid "" "Simply generating a key pair isn't enough, however. You'll need to add the " "public key to the set of authorised keys for whatever user you're logging in " @@ -6435,7 +8289,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:639 +#: ../en/ch06-collab.xml:678 msgid "" "On a Unix-like system, your public key will have a <filename>.pub</filename> " "extension. If you're using <command>puttygen</command> on Windows, you can " @@ -6445,12 +8299,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch05-collab.xml:648 +#: ../en/ch06-collab.xml:686 msgid "Using an authentication agent" msgstr "使用认证代理" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:650 +#: ../en/ch06-collab.xml:688 msgid "" "An authentication agent is a daemon that stores passphrases in memory (so it " "will forget passphrases if you log out and log back in again). An ssh client " @@ -6462,7 +8316,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:659 +#: ../en/ch06-collab.xml:697 msgid "" "The downside of storing passphrases in an agent is that it's possible for a " "well-prepared attacker to recover the plain text of your passphrases, in some " @@ -6471,34 +8325,44 @@ "of repeated typing." msgstr "" -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:666 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> +#: ../en/ch06-collab.xml:706 msgid "" "On Unix-like systems, the agent is called <command>ssh-agent</command>, and " "it's often run automatically for you when you log in. You'll need to use the " -"<command>ssh-add</command> command to add passphrases to the agent's store. " -"On Windows, if you're using PuTTY, the <command>pageant</command> command " -"acts as the agent. It adds an icon to your system tray that will let you " -"manage stored passphrases." +"<command>ssh-add</command> command to add passphrases to the agent's store." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> +#: ../en/ch06-collab.xml:713 +msgid "" +"On Windows, if you're using TortoiseHg, the <command>pageant</command> " +"command acts as the agent. As with <command>puttygen</command>, you'll need " +"to <ulink url=\"http://www.chiark.greenend.org.uk/%7Esgtatham/putty/download." +"html\">download <command>pageant</command></ulink> from the PuTTY web site " +"and read <ulink url=\"http://the.earth.li/~sgtatham/putty/0.60/htmldoc/" +"Chapter9.html#pageant\">its documentation</ulink>. The <command>pageant</" +"command> command adds an icon to your system tray that will let you manage " +"stored passphrases." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch05-collab.xml:677 +#: ../en/ch06-collab.xml:728 msgid "Configuring the server side properly" msgstr "正确配置服务器端" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:679 -msgid "" -"Because ssh can be fiddly to set up if you're new to it, there's a variety of " -"things that can go wrong. Add Mercurial on top, and there's plenty more " -"scope for head-scratching. Most of these potential problems occur on the " -"server side, not the client side. The good news is that once you've gotten a " -"configuration working, it will usually continue to work indefinitely." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:687 +#: ../en/ch06-collab.xml:730 +msgid "" +"Because ssh can be fiddly to set up if you're new to it, a variety of things " +"can go wrong. Add Mercurial on top, and there's plenty more scope for head-" +"scratching. Most of these potential problems occur on the server side, not " +"the client side. The good news is that once you've gotten a configuration " +"working, it will usually continue to work indefinitely." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch06-collab.xml:738 msgid "" "Before you try using Mercurial to talk to an ssh server, it's best to make " "sure that you can use the normal <command>ssh</command> or <command>putty</" @@ -6511,7 +8375,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:698 +#: ../en/ch06-collab.xml:749 msgid "" "The first thing to be sure of on the server side is that you can actually log " "in from another machine at all. If you can't use <command>ssh</command> or " @@ -6520,7 +8384,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:705 +#: ../en/ch06-collab.xml:756 msgid "" "If you get a <quote>connection refused</quote> error, either there isn't an " "SSH daemon running on the server at all, or it's inaccessible due to firewall " @@ -6528,7 +8392,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:710 +#: ../en/ch06-collab.xml:761 msgid "" "If you get a <quote>no route to host</quote> error, you either have an " "incorrect address for the server or a seriously locked down firewall that " @@ -6536,7 +8400,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:715 +#: ../en/ch06-collab.xml:766 msgid "" "If you get a <quote>permission denied</quote> error, you may have mistyped " "the username on the server, or you could have mistyped your key's passphrase " @@ -6544,7 +8408,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:720 +#: ../en/ch06-collab.xml:771 msgid "" "In summary, if you're having trouble talking to the server's ssh daemon, " "first make sure that one is running at all. On many systems it will be " @@ -6556,7 +8420,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:730 +#: ../en/ch06-collab.xml:781 msgid "" "If you're using an authentication agent on the client side to store " "passphrases for your keys, you ought to be able to log into the server " @@ -6565,26 +8429,26 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:736 +#: ../en/ch06-collab.xml:787 msgid "" "You might have forgotten to use <command>ssh-add</command> or " "<command>pageant</command> to store the passphrase." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:740 +#: ../en/ch06-collab.xml:791 msgid "You might have stored the passphrase for the wrong key." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:743 +#: ../en/ch06-collab.xml:794 msgid "" "If you're being prompted for the remote user's password, there are another " "few possible problems to check." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:746 +#: ../en/ch06-collab.xml:797 msgid "" "Either the user's home directory or their <filename role=\"special\" class=" "\"directory\">.ssh</filename> directory might have excessively liberal " @@ -6595,7 +8459,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:755 +#: ../en/ch06-collab.xml:806 msgid "" "The user's <filename role=\"special\">authorized_keys</filename> file may " "have a problem. If anyone other than the user owns or can write to that file, " @@ -6603,7 +8467,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:762 +#: ../en/ch06-collab.xml:813 msgid "" "In the ideal world, you should be able to run the following command " "successfully, and it should print exactly one line of output, the current " @@ -6611,14 +8475,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:767 +#: ../en/ch06-collab.xml:818 msgid "" "If, on your server, you have login scripts that print banners or other junk " "even when running non-interactive commands like this, you should fix them " "before you continue, so that they only print output if they're run " "interactively. Otherwise these banners will at least clutter up Mercurial's " "output. Worse, they could potentially cause problems with running Mercurial " -"commands remotely. Mercurial makes tries to detect and ignore banners in non-" +"commands remotely. Mercurial tries to detect and ignore banners in non-" "interactive <command>ssh</command> sessions, but it is not foolproof. (If " "you're editing your login scripts on your server, the usual way to see if a " "login script is running in an interactive shell is to check the return code " @@ -6626,7 +8490,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:781 +#: ../en/ch06-collab.xml:832 msgid "" "Once you've verified that plain old ssh is working with your server, the next " "step is to ensure that Mercurial runs on the server. The following command " @@ -6634,7 +8498,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:788 +#: ../en/ch06-collab.xml:839 msgid "" "If you see an error message instead of normal <command role=\"hg-cmd\">hg " "version</command> output, this is usually because you haven't installed " @@ -6644,21 +8508,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:795 +#: ../en/ch06-collab.xml:846 msgid "" "Is Mercurial really installed on the server at all? I know this sounds " "trivial, but it's worth checking!" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:799 +#: ../en/ch06-collab.xml:850 msgid "" "Maybe your shell's search path (usually set via the <envar>PATH</envar> " "environment variable) is simply misconfigured." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:803 +#: ../en/ch06-collab.xml:854 msgid "" "Perhaps your <envar>PATH</envar> environment variable is only being set to " "point to the location of the <command>hg</command> executable if the login " @@ -6667,7 +8531,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:810 +#: ../en/ch06-collab.xml:861 msgid "" "The <envar>PYTHONPATH</envar> environment variable may need to contain the " "path to the Mercurial Python modules. It might not be set at all; it could " @@ -6675,7 +8539,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:817 +#: ../en/ch06-collab.xml:868 msgid "" "If you can run <command role=\"hg-cmd\">hg version</command> over an ssh " "connection, well done! You've got the server and client sorted out. You " @@ -6686,20 +8550,20 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch05-collab.xml:827 +#: ../en/ch06-collab.xml:877 msgid "Using compression with ssh" msgstr "通过 ssh 使用压缩" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:829 +#: ../en/ch06-collab.xml:879 msgid "" "Mercurial does not compress data when it uses the ssh protocol, because the " -"ssh protocol can transparently compress data. However, the default behaviour " +"ssh protocol can transparently compress data. However, the default behavior " "of ssh clients is <emphasis>not</emphasis> to request compression." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:834 +#: ../en/ch06-collab.xml:884 msgid "" "Over any network other than a fast LAN (even a wireless network), using " "compression is likely to significantly speed up Mercurial's network " @@ -6709,55 +8573,69 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:841 +#: ../en/ch06-collab.xml:891 msgid "" "Both <command>ssh</command> and <command>plink</command> accept a <option " "role=\"cmd-opt-ssh\">-C</option> option which turns on compression. You can " "easily edit your <filename role=\"special\">~/.hgrc</filename> to enable " -"compression for all of Mercurial's uses of the ssh protocol." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:849 -msgid "" -"If you use <command>ssh</command>, you can configure it to always use " -"compression when talking to your server. To do this, edit your <filename " -"role=\"special\">.ssh/config</filename> file (which may not yet exist), as " -"follows." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:857 -msgid "" -"This defines an alias, <literal>hg</literal>. When you use it on the " -"<command>ssh</command> command line or in a Mercurial <literal>ssh</literal>-" -"protocol URL, it will cause <command>ssh</command> to connect to <literal>hg." -"example.com</literal> and use compression. This gives you both a shorter " -"name to type and compression, each of which is a good thing in its own right." +"compression for all of Mercurial's uses of the ssh protocol. Here is how to " +"do so for regular <command>ssh</command> on Unix-like systems, for example." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch06-collab.xml:901 +msgid "" +"If you use <command>ssh</command> on a Unix-like system, you can configure it " +"to always use compression when talking to your server. To do this, edit your " +"<filename role=\"special\">.ssh/config</filename> file (which may not yet " +"exist), as follows." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch06-collab.xml:911 +msgid "" +"This defines a hostname alias, <literal>hg</literal>. When you use that " +"hostname on the <command>ssh</command> command line or in a Mercurial " +"<literal>ssh</literal>-protocol URL, it will cause <command>ssh</command> to " +"connect to <literal>hg.example.com</literal> and use compression. This gives " +"you both a shorter name to type and compression, each of which is a good " +"thing in its own right." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch05-collab.xml:868 +#: ../en/ch06-collab.xml:923 msgid "Serving over HTTP using CGI" msgstr "使用 CGI 通过 HTTP 提供服务" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch05-collab.xml:870 +#: ../en/ch06-collab.xml:925 +msgid "" +"The simplest way to host one or more repositories in a permanent way is to " +"use a web server and Mercurial's CGI support." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch06-collab.xml:929 msgid "" "Depending on how ambitious you are, configuring Mercurial's CGI interface can " "take anything from a few moments to several hours." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch05-collab.xml:874 +#: ../en/ch06-collab.xml:933 msgid "" "We'll begin with the simplest of examples, and work our way towards a more " "complex configuration. Even for the most basic case, you're almost certainly " "going to need to read and modify your web server's configuration." msgstr "" +#. type: Content of: <book><chapter><sect1><note><title> +#: ../en/ch06-collab.xml:939 +msgid "High pain tolerance required" +msgstr "" + #. type: Content of: <book><chapter><sect1><note><para> -#: ../en/ch05-collab.xml:880 +#: ../en/ch06-collab.xml:941 msgid "" "Configuring a web server is a complex, fiddly, and highly system-dependent " "activity. I can't possibly give you instructions that will cover anything " @@ -6766,34 +8644,43 @@ "mistakes, and to spend a lot of time reading your server's error logs." msgstr "" +#. type: Content of: <book><chapter><sect1><note><para> +#: ../en/ch06-collab.xml:949 +msgid "" +"If you don't have a strong stomach for tweaking configurations over and over, " +"or a compelling need to host your own services, you might want to try one of " +"the public hosting services that I mentioned earlier." +msgstr "" + #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch05-collab.xml:890 +#: ../en/ch06-collab.xml:956 msgid "Web server configuration checklist" msgstr "Web 服务器配置检查表" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:892 +#: ../en/ch06-collab.xml:958 msgid "" "Before you continue, do take a few moments to check a few aspects of your " "system's setup." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch05-collab.xml:896 -msgid "" -"Do you have a web server installed at all? Mac OS X ships with Apache, but " -"many other systems may not have a web server installed." +#: ../en/ch06-collab.xml:962 +msgid "" +"Do you have a web server installed at all? Mac OS X and some Linux " +"distributions ship with Apache, but many other systems may not have a web " +"server installed." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch05-collab.xml:900 +#: ../en/ch06-collab.xml:967 msgid "" "If you have a web server installed, is it actually running? On most systems, " "even if one is present, it will be disabled by default." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch05-collab.xml:904 +#: ../en/ch06-collab.xml:971 msgid "" "Is your server configured to allow you to run CGI programs in the directory " "where you plan to do so? Most servers default to explicitly disabling the " @@ -6801,7 +8688,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:910 +#: ../en/ch06-collab.xml:977 msgid "" "If you don't have a web server installed, and don't have substantial " "experience configuring Apache, you should consider using the " @@ -6814,12 +8701,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch05-collab.xml:923 +#: ../en/ch06-collab.xml:990 msgid "Basic CGI configuration" msgstr "基本 CGI 配置" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:925 +#: ../en/ch06-collab.xml:992 msgid "" "On Unix-like systems, it's common for users to have a subdirectory named " "something like <filename class=\"directory\">public_html</filename> in their " @@ -6829,7 +8716,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:933 +#: ../en/ch06-collab.xml:1000 msgid "" "To get started, find the <filename role=\"special\">hgweb.cgi</filename> " "script that should be present in your Mercurial installation. If you can't " @@ -6839,14 +8726,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:940 ../en/ch05-collab.xml:1109 +#: ../en/ch06-collab.xml:1007 ../en/ch06-collab.xml:1175 msgid "" "You'll need to copy this script into your <filename class=\"directory" "\">public_html</filename> directory, and ensure that it's executable." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:945 +#: ../en/ch06-collab.xml:1012 msgid "" "The <literal>755</literal> argument to <command>chmod</command> is a little " "more general than just making the script executable: it ensures that the " @@ -6859,26 +8746,26 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><title> -#: ../en/ch05-collab.xml:959 +#: ../en/ch06-collab.xml:1026 msgid "What could <emphasis>possibly</emphasis> go wrong?" msgstr "什么<emphasis>可能</emphasis>会出错?" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch05-collab.xml:962 +#: ../en/ch06-collab.xml:1029 msgid "" "Once you've copied the CGI script into place, go into a web browser, and try " -"to open the URL <ulink url=\"http://myhostname/ myuser/hgweb.cgi\">http://" -"myhostname/ myuser/hgweb.cgi</ulink>, <emphasis>but</emphasis> brace yourself " -"for instant failure. There's a high probability that trying to visit this " -"URL will fail, and there are many possible reasons for this. In fact, you're " -"likely to stumble over almost every one of the possible errors below, so " -"please read carefully. The following are all of the problems I ran into on a " -"system running Fedora 7, with a fresh installation of Apache, and a user " -"account that I created specially to perform this exercise." +"to open the URL <literal>http://myhostname/~myuser/hgweb.cgi</literal>, " +"<emphasis>but</emphasis> brace yourself for instant failure. There's a high " +"probability that trying to visit this URL will fail, and there are many " +"possible reasons for this. In fact, you're likely to stumble over almost " +"every one of the possible errors below, so please read carefully. The " +"following are all of the problems I ran into on a system running Fedora 7, " +"with a fresh installation of Apache, and a user account that I created " +"specially to perform this exercise." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch05-collab.xml:976 +#: ../en/ch06-collab.xml:1042 msgid "" "Your web server may have per-user directories disabled. If you're using " "Apache, search your config file for a <literal>UserDir</literal> directive. " @@ -6891,7 +8778,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch05-collab.xml:987 +#: ../en/ch06-collab.xml:1053 msgid "" "Your file access permissions may be too restrictive. The web server must be " "able to traverse your home directory and directories under your <filename " @@ -6901,7 +8788,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch05-collab.xml:997 +#: ../en/ch06-collab.xml:1063 msgid "" "The other possibility with permissions is that you might get a completely " "empty window when you try to load the script. In this case, it's likely that " @@ -6911,7 +8798,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch05-collab.xml:1004 +#: ../en/ch06-collab.xml:1070 msgid "" "Your web server may be configured to disallow execution of CGI programs in " "your per-user web directory. Here's Apache's default per-user configuration " @@ -6919,7 +8806,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch05-collab.xml:1011 +#: ../en/ch06-collab.xml:1077 msgid "" "If you find a similar-looking <literal>Directory</literal> group in your " "Apache configuration, the directive to look at inside it is <literal>Options</" @@ -6928,7 +8815,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch05-collab.xml:1018 +#: ../en/ch06-collab.xml:1084 msgid "" "If you find that Apache serves you the text of the CGI script instead of " "executing it, you may need to either uncomment (if already present) or add a " @@ -6936,7 +8823,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch05-collab.xml:1024 +#: ../en/ch06-collab.xml:1090 msgid "" "The next possibility is that you might be served with a colourful Python " "backtrace claiming that it can't import a <literal>mercurial</literal>-" @@ -6951,9 +8838,9 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch05-collab.xml:1038 -msgid "" -"Finally, you are <emphasis>certain</emphasis> to by served with another " +#: ../en/ch06-collab.xml:1104 +msgid "" +"Finally, you are <emphasis>certain</emphasis> to be served with another " "colourful Python backtrace: this one will complain that it can't find " "<filename class=\"directory\">/path/to/repository</filename>. Edit your " "<filename role=\"special\">hgweb.cgi</filename> script and replace the " @@ -6962,19 +8849,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch05-collab.xml:1048 +#: ../en/ch06-collab.xml:1114 msgid "" "At this point, when you try to reload the page, you should be presented with " "a nice HTML view of your repository's history. Whew!" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><title> -#: ../en/ch05-collab.xml:1054 +#: ../en/ch06-collab.xml:1120 msgid "Configuring lighttpd" msgstr "配置 lighttpd" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch05-collab.xml:1056 +#: ../en/ch06-collab.xml:1122 msgid "" "To be exhaustive in my experiments, I tried configuring the increasingly " "popular <literal>lighttpd</literal> web server to serve the same repository " @@ -6985,7 +8872,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch05-collab.xml:1066 +#: ../en/ch06-collab.xml:1132 msgid "" "Once I had Apache running, getting <literal>lighttpd</literal> to serve the " "repository was a snap (in other words, even if you're trying to use " @@ -6997,7 +8884,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch05-collab.xml:1078 +#: ../en/ch06-collab.xml:1144 msgid "" "With this done, <literal>lighttpd</literal> ran immediately for me. If I had " "configured <literal>lighttpd</literal> before Apache, I'd almost certainly " @@ -7008,12 +8895,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch05-collab.xml:1091 +#: ../en/ch06-collab.xml:1157 msgid "Sharing multiple repositories with one CGI script" msgstr "使用一个 CGI 脚本共享多个版本库" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:1093 +#: ../en/ch06-collab.xml:1159 msgid "" "The <filename role=\"special\">hgweb.cgi</filename> script only lets you " "publish a single repository, which is an annoying restriction. If you want " @@ -7023,7 +8910,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:1101 +#: ../en/ch06-collab.xml:1167 msgid "" "The procedure to configure <filename role=\"special\">hgwebdir.cgi</filename> " "is only a little more involved than for <filename role=\"special\">hgweb.cgi</" @@ -7034,17 +8921,17 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:1116 -msgid "" -"With basic configuration out of the way, try to visit <ulink url=\"http://" -"myhostname/ myuser/hgwebdir.cgi\">http://myhostname/ myuser/hgwebdir.cgi</" -"ulink> in your browser. It should display an empty list of repositories. If " -"you get a blank window or error message, try walking through the list of " -"potential problems in <xref linkend=\"sec:collab:wtf\"/>." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:1125 +#: ../en/ch06-collab.xml:1182 +msgid "" +"With basic configuration out of the way, try to visit <literal>http://" +"myhostname/~myuser/hgwebdir.cgi</literal> in your\tbrowser. It should " +"display an empty list of repositories. If you get a blank window or error " +"message, try walking through the list of potential problems in <xref linkend=" +"\"sec:collab:wtf\"/>." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch06-collab.xml:1190 msgid "" "The <filename role=\"special\">hgwebdir.cgi</filename> script relies on an " "external configuration file. By default, it searches for a file named " @@ -7056,7 +8943,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:1135 +#: ../en/ch06-collab.xml:1200 msgid "" "The easiest way to configure <filename role=\"special\">hgwebdir.cgi</" "filename> is with a section named <literal>collections</literal>. This will " @@ -7065,7 +8952,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:1143 +#: ../en/ch06-collab.xml:1208 msgid "" "Mercurial interprets this by looking at the directory name on the " "<emphasis>right</emphasis> hand side of the <quote><literal>=</literal></" @@ -7077,21 +8964,20 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:1152 +#: ../en/ch06-collab.xml:1217 msgid "" "Given the example above, if we have a repository whose local path is " "<filename class=\"directory\">/my/root/this/repo</filename>, the CGI script " "will strip the leading <filename class=\"directory\">/my/root</filename> from " "the name, and publish the repository with a virtual path of <filename class=" "\"directory\">this/repo</filename>. If the base URL for our CGI script is " -"<ulink url=\"http://myhostname/ myuser/hgwebdir.cgi\">http://myhostname/ " -"myuser/hgwebdir.cgi</ulink>, the complete URL for that repository will be " -"<ulink url=\"http://myhostname/ myuser/hgwebdir.cgi/this/repo\">http://" -"myhostname/ myuser/hgwebdir.cgi/this/repo</ulink>." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:1166 +"<literal>http://myhostname/~myuser/hgwebdir.cgi</literal>, the complete URL " +"for that repository will be <literal>http://myhostname/~myuser/hgwebdir.cgi/" +"this/repo</literal>." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch06-collab.xml:1229 msgid "" "If we replace <filename class=\"directory\">/my/root</filename> on the left " "hand side of this example with <filename class=\"directory\">/my</filename>, " @@ -7102,7 +8988,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:1176 +#: ../en/ch06-collab.xml:1239 msgid "" "The <filename role=\"special\">hgwebdir.cgi</filename> script will " "recursively search each directory listed in the <literal>collections</" @@ -7111,7 +8997,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:1182 +#: ../en/ch06-collab.xml:1245 msgid "" "The <literal>collections</literal> mechanism makes it easy to publish many " "repositories in a <quote>fire and forget</quote> manner. You only need to " @@ -7122,12 +9008,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><title> -#: ../en/ch05-collab.xml:1192 +#: ../en/ch06-collab.xml:1255 msgid "Explicitly specifying which repositories to publish" msgstr "明确指出要发布的版本库" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch05-collab.xml:1195 +#: ../en/ch06-collab.xml:1258 msgid "" "In addition to the <literal>collections</literal> mechanism, the <filename " "role=\"special\">hgwebdir.cgi</filename> script allows you to publish a " @@ -7136,7 +9022,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch05-collab.xml:1204 +#: ../en/ch06-collab.xml:1267 msgid "" "In this case, the virtual path (the component that will appear in a URL) is " "on the left hand side of each definition, while the path to the repository is " @@ -7146,28 +9032,33 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch05-collab.xml:1211 +#: ../en/ch06-collab.xml:1274 msgid "" "If you wish, you can use both the <literal>collections</literal> and " "<literal>paths</literal> mechanisms simultaneously in a single configuration " "file." msgstr "" +#. type: Content of: <book><chapter><sect1><sect2><sect3><note><title> +#: ../en/ch06-collab.xml:1280 +msgid "Beware duplicate virtual paths" +msgstr "" + #. type: Content of: <book><chapter><sect1><sect2><sect3><note><para> -#: ../en/ch05-collab.xml:1217 -msgid "" -"If multiple repositories have the same virtual path, <filename role=\"special" +#: ../en/ch06-collab.xml:1282 +msgid "" +"If several repositories have the same virtual path, <filename role=\"special" "\">hgwebdir.cgi</filename> will not report an error. Instead, it will behave " "unpredictably." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch05-collab.xml:1226 +#: ../en/ch06-collab.xml:1291 msgid "Downloading source archives" msgstr "下载源代码档案包" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:1228 +#: ../en/ch06-collab.xml:1293 msgid "" "Mercurial's web interface lets users download an archive of any revision. " "This archive will contain a snapshot of the working directory as of that " @@ -7175,21 +9066,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:1233 +#: ../en/ch06-collab.xml:1298 msgid "" "By default, this feature is not enabled. To enable it, you'll need to add an " "<envar role=\"rc-item-web\">allow_archive</envar> item to the <literal role=" "\"rc-web\">web</literal> section of your <filename role=\"special\">~/.hgrc</" -"filename>." +"filename>; see below for details." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch05-collab.xml:1241 +#: ../en/ch06-collab.xml:1305 msgid "Web configuration options" msgstr "Web 配置选项" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:1243 +#: ../en/ch06-collab.xml:1307 msgid "" "Mercurial's web interfaces (the <command role=\"hg-cmd\">hg serve</command> " "command, and the <filename role=\"special\">hgweb.cgi</filename> and " @@ -7199,7 +9090,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:1251 +#: ../en/ch06-collab.xml:1315 msgid "" "<envar role=\"rc-item-web\">allow_archive</envar>: Determines which (if any) " "archive download mechanisms Mercurial supports. If you enable this feature, " @@ -7209,7 +9100,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:1260 +#: ../en/ch06-collab.xml:1324 msgid "" "<literal>bz2</literal>: A <command>tar</command> archive, compressed using " "<literal>bzip2</literal> compression. This has the best compression ratio, " @@ -7217,14 +9108,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:1266 +#: ../en/ch06-collab.xml:1330 msgid "" "<literal>gz</literal>: A <command>tar</command> archive, compressed using " "<literal>gzip</literal> compression." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:1270 +#: ../en/ch06-collab.xml:1334 msgid "" "<literal>zip</literal>: A <command>zip</command> archive, compressed using " "LZW compression. This format has the worst compression ratio, but is widely " @@ -7232,7 +9123,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:1276 +#: ../en/ch06-collab.xml:1340 msgid "" "If you provide an empty list, or don't have an <envar role=\"rc-item-web" "\">allow_archive</envar> entry at all, this feature will be disabled. Here " @@ -7240,7 +9131,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:1283 +#: ../en/ch06-collab.xml:1347 msgid "" "<envar role=\"rc-item-web\">allowpull</envar>: Boolean. Determines whether " "the web interface allows remote users to <command role=\"hg-cmd\">hg pull</" @@ -7250,7 +9141,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:1292 +#: ../en/ch06-collab.xml:1356 msgid "" "<envar role=\"rc-item-web\">contact</envar>: String. A free-form (but " "preferably brief) string identifying the person or group in charge of the " @@ -7262,21 +9153,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:1303 +#: ../en/ch06-collab.xml:1367 msgid "" "<envar role=\"rc-item-web\">maxchanges</envar>: Integer. The default maximum " "number of changesets to display in a single page of output." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:1307 +#: ../en/ch06-collab.xml:1371 msgid "" "<envar role=\"rc-item-web\">maxfiles</envar>: Integer. The default maximum " "number of modified files to display in a single page of output." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:1311 +#: ../en/ch06-collab.xml:1375 msgid "" "<envar role=\"rc-item-web\">stripes</envar>: Integer. If the web interface " "displays alternating <quote>stripes</quote> to make it easier to visually " @@ -7285,18 +9176,49 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:1317 +#: ../en/ch06-collab.xml:1381 msgid "" "<envar role=\"rc-item-web\">style</envar>: Controls the template Mercurial " -"uses to display the web interface. Mercurial ships with two web templates, " -"named <literal>default</literal> and <literal>gitweb</literal> (the latter is " -"much more visually attractive). You can also specify a custom template of " -"your own; see <xref linkend=\"chap:template\"/> for details. Here, you can " -"see how to enable the <literal>gitweb</literal> style." +"uses to display the web interface. Mercurial ships with several web " +"templates." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><itemizedlist><listitem><para> +#: ../en/ch06-collab.xml:1387 +msgid "<literal>coal</literal> is monochromatic." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><itemizedlist><listitem><para> +#: ../en/ch06-collab.xml:1390 +msgid "" +"<literal>gitweb</literal> emulates the visual style of git's web interface." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><itemizedlist><listitem><para> +#: ../en/ch06-collab.xml:1394 +msgid "<literal>monoblue</literal> uses solid blues and greys." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><itemizedlist><listitem><para> +#: ../en/ch06-collab.xml:1398 +msgid "<literal>paper</literal> is the default." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><itemizedlist><listitem><para> +#: ../en/ch06-collab.xml:1401 +msgid "<literal>spartan</literal> was the default for a long time." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:1330 +#: ../en/ch06-collab.xml:1405 +msgid "" +"You can also specify a custom template of your own; see <xref linkend=\"chap:" +"template\"/> for details. Here, you can see how to enable the " +"<literal>gitweb</literal> style." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> +#: ../en/ch06-collab.xml:1413 msgid "" "<envar role=\"rc-item-web\">templates</envar>: Path. The directory in which " "to search for template files. By default, Mercurial searches in the " @@ -7304,7 +9226,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch05-collab.xml:1335 +#: ../en/ch06-collab.xml:1418 msgid "" "If you are using <filename role=\"special\">hgwebdir.cgi</filename>, you can " "place a few configuration items in a <literal role=\"rc-web\">web</literal> " @@ -7315,12 +9237,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><title> -#: ../en/ch05-collab.xml:1346 +#: ../en/ch06-collab.xml:1429 msgid "Options specific to an individual repository" msgstr "针对单个版本库的选项" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch05-collab.xml:1348 +#: ../en/ch06-collab.xml:1431 msgid "" "A few <literal role=\"rc-web\">web</literal> configuration items ought to be " "placed in a repository's local <filename role=\"special\">.hg/hgrc</" @@ -7329,7 +9251,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:1353 +#: ../en/ch06-collab.xml:1436 msgid "" "<envar role=\"rc-item-web\">description</envar>: String. A free-form (but " "preferably brief) string that describes the contents or purpose of the " @@ -7337,7 +9259,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:1358 +#: ../en/ch06-collab.xml:1441 msgid "" "<envar role=\"rc-item-web\">name</envar>: String. The name to use for the " "repository in the web interface. This overrides the default name, which is " @@ -7345,13 +9267,13 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><title> -#: ../en/ch05-collab.xml:1366 +#: ../en/ch06-collab.xml:1449 msgid "" "Options specific to the <command role=\"hg-cmd\">hg serve</command> command" msgstr "命令 <command role=\"hg-cmd\">hg serve</command> 的选项" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch05-collab.xml:1369 +#: ../en/ch06-collab.xml:1452 msgid "" "Some of the items in the <literal role=\"rc-web\">web</literal> section of a " "<filename role=\"special\">~/.hgrc</filename> file are only for use with the " @@ -7359,7 +9281,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:1375 +#: ../en/ch06-collab.xml:1458 msgid "" "<envar role=\"rc-item-web\">accesslog</envar>: Path. The name of a file into " "which to write an access log. By default, the <command role=\"hg-cmd\">hg " @@ -7369,7 +9291,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:1383 +#: ../en/ch06-collab.xml:1466 msgid "" "<envar role=\"rc-item-web\">address</envar>: String. The local address on " "which the server should listen for incoming connections. By default, the " @@ -7377,7 +9299,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:1388 +#: ../en/ch06-collab.xml:1471 msgid "" "<envar role=\"rc-item-web\">errorlog</envar>: Path. The name of a file into " "which to write an error log. By default, the <command role=\"hg-cmd\">hg " @@ -7386,21 +9308,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:1394 +#: ../en/ch06-collab.xml:1477 msgid "" "<envar role=\"rc-item-web\">ipv6</envar>: Boolean. Whether to use the IPv6 " "protocol. By default, IPv6 is not used." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch05-collab.xml:1398 +#: ../en/ch06-collab.xml:1481 msgid "" "<envar role=\"rc-item-web\">port</envar>: Integer. The TCP port number on " "which the server should listen. The default port number used is 8000." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><title> -#: ../en/ch05-collab.xml:1405 +#: ../en/ch06-collab.xml:1488 msgid "" "Choosing the right <filename role=\"special\">~/.hgrc</filename> file to add " "<literal role=\"rc-web\">web</literal> items to" @@ -7409,7 +9331,7 @@ "role=\"rc-web\">web</literal> 条目" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch05-collab.xml:1409 +#: ../en/ch06-collab.xml:1492 msgid "" "It is important to remember that a web server like Apache or " "<literal>lighttpd</literal> will run under a user ID that is different to " @@ -7418,37 +9340,86 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch05-collab.xml:1416 +#: ../en/ch06-collab.xml:1499 msgid "" "If you add <literal role=\"rc-web\">web</literal> items to your own personal " "<filename role=\"special\">~/.hgrc</filename> file, CGI scripts won't read " "that <filename role=\"special\">~/.hgrc</filename> file. Those settings will " -"thus only affect the behaviour of the <command role=\"hg-cmd\">hg serve</" +"thus only affect the behavior of the <command role=\"hg-cmd\">hg serve</" "command> command when you run it. To cause CGI scripts to see your settings, " "either create a <filename role=\"special\">~/.hgrc</filename> file in the " "home directory of the user ID that runs your web server, or add those " -"settings to a system-wide <filename role=\"special\">~/.hgrc</filename> file." +"settings to a system-wide <filename role=\"special\">hgrc</filename> file." +msgstr "" + +#. type: Content of: <book><chapter><sect1><title> +#: ../en/ch06-collab.xml:1514 +msgid "System-wide configuration" +msgstr "全局配置" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch06-collab.xml:1516 +msgid "" +"On Unix-like systems shared by multiple users (such as a server to which " +"people publish changes), it often makes sense to set up some global default " +"behaviors, such as what theme to use in web interfaces." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch06-collab.xml:1521 +msgid "" +"If a file named <filename>/etc/mercurial/hgrc</filename> exists, Mercurial " +"will read it at startup time and apply any configuration settings it finds in " +"that file. It will also look for files ending in a <literal>.rc</literal> " +"extension in a directory named <filename>/etc/mercurial/hgrc.d</filename>, " +"and apply any configuration settings it finds in each of those files." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><title> +#: ../en/ch06-collab.xml:1530 +msgid "Making Mercurial more trusting" +msgstr "让 Mercurial 更可信" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch06-collab.xml:1532 +msgid "" +"One situation in which a global <filename>hgrc</filename> can be useful is if " +"users are pulling changes owned by other users. By default, Mercurial will " +"not trust most of the configuration items in a <filename>.hg/hgrc</filename> " +"file inside a repository that is owned by a different user. If we clone or " +"pull changes from such a repository, Mercurial will print a warning stating " +"that it does not trust their <filename>.hg/hgrc</filename>." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch06-collab.xml:1541 +msgid "" +"If everyone in a particular Unix group is on the same team and " +"<emphasis>should</emphasis> trust each other's configuration settings, or we " +"want to trust particular users, we can override Mercurial's skeptical " +"defaults by creating a system-wide <filename>hgrc</filename> file such as the " +"following:" msgstr "" #. type: Content of: <book><chapter><title> -#: ../en/ch06-filenames.xml:5 +#: ../en/ch07-filenames.xml:5 msgid "File names and pattern matching" msgstr "文件名称与模式匹配" #. type: Content of: <book><chapter><para> -#: ../en/ch06-filenames.xml:7 +#: ../en/ch07-filenames.xml:7 msgid "" "Mercurial provides mechanisms that let you work with file names in a " "consistent and expressive way." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch06-filenames.xml:11 +#: ../en/ch07-filenames.xml:11 msgid "Simple file naming" msgstr "简单文件名称" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:13 +#: ../en/ch07-filenames.xml:13 msgid "" "Mercurial uses a unified piece of machinery <quote>under the hood</quote> to " "handle file names. Every command behaves uniformly with respect to file " @@ -7456,7 +9427,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:18 +#: ../en/ch07-filenames.xml:18 msgid "" "If you explicitly name real files on the command line, Mercurial works with " "exactly those files, as you would expect. &interaction.filenames.files;" @@ -7464,7 +9435,7 @@ # #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:22 +#: ../en/ch07-filenames.xml:22 msgid "" "When you provide a directory name, Mercurial will interpret this as " "<quote>operate on every file in this directory and its subdirectories</" @@ -7474,29 +9445,29 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch06-filenames.xml:33 +#: ../en/ch07-filenames.xml:33 msgid "Running commands without any file names" msgstr "不提供文件名称的执行命令" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:35 -msgid "" -"Mercurial's commands that work with file names have useful default behaviours " +#: ../en/ch07-filenames.xml:35 +msgid "" +"Mercurial's commands that work with file names have useful default behaviors " "when you invoke them without providing any file names or patterns. What kind " -"of behaviour you should expect depends on what the command does. Here are a " +"of behavior you should expect depends on what the command does. Here are a " "few rules of thumb you can use to predict what a command is likely to do if " "you don't give it any names to work with." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch06-filenames.xml:42 +#: ../en/ch07-filenames.xml:42 msgid "" "Most commands will operate on the entire working directory. This is what the " "<command role=\"hg-cmd\">hg add</command> command does, for example." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch06-filenames.xml:46 +#: ../en/ch07-filenames.xml:46 msgid "" "If the command has effects that are difficult or impossible to reverse, it " "will force you to explicitly provide at least one name or pattern (see " @@ -7504,11 +9475,10 @@ "<command role=\"hg-cmd\">hg remove</command> with no arguments, for example." msgstr "" -# -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:54 -msgid "" -"It's easy to work around these default behaviours if they don't suit you. If " +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch07-filenames.xml:54 +msgid "" +"It's easy to work around these default behaviors if they don't suit you. If " "a command normally operates on the whole working directory, you can invoke it " "on just the current directory and its subdirectories by giving it the name " "<quote><filename class=\"directory\">.</filename></quote>." @@ -7516,7 +9486,7 @@ # #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:62 +#: ../en/ch07-filenames.xml:62 msgid "" "Along the same lines, some commands normally print file names relative to the " "root of the repository, even if you're invoking them from a subdirectory. " @@ -7529,12 +9499,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch06-filenames.xml:76 +#: ../en/ch07-filenames.xml:76 msgid "Telling you what's going on" msgstr "告诉你正在做什么" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:78 +#: ../en/ch07-filenames.xml:78 msgid "" "The <command role=\"hg-cmd\">hg add</command> example in the preceding " "section illustrates something else that's helpful about Mercurial commands. " @@ -7544,17 +9514,17 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:85 +#: ../en/ch07-filenames.xml:85 msgid "" "The principle here is of <emphasis>least surprise</emphasis>. If you've " "exactly named a file on the command line, there's no point in repeating it " "back at you. If Mercurial is acting on a file <emphasis>implicitly</" -"emphasis>, because you provided no names, or a directory, or a pattern (see " -"below), it's safest to tell you what it's doing." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:92 +"emphasis>, e.g. because you provided no names, or a directory, or a pattern " +"(see below), it is safest to tell you what files it's operating on." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch07-filenames.xml:92 msgid "" "For commands that behave this way, you can silence them using the <option " "role=\"hg-opt-global\">-q</option> option. You can also get them to print " @@ -7563,12 +9533,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch06-filenames.xml:100 +#: ../en/ch07-filenames.xml:100 msgid "Using patterns to identify files" msgstr "使用模式标识文件" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:102 +#: ../en/ch07-filenames.xml:102 msgid "" "In addition to working with file and directory names, Mercurial lets you use " "<emphasis>patterns</emphasis> to identify files. Mercurial's pattern " @@ -7576,7 +9546,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:106 +#: ../en/ch07-filenames.xml:106 msgid "" "On Unix-like systems (Linux, MacOS, etc.), the job of matching file names to " "patterns normally falls to the shell. On these systems, you must explicitly " @@ -7586,21 +9556,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:113 +#: ../en/ch07-filenames.xml:113 msgid "" "To provide a pattern in place of a regular name on the command line, the " "mechanism is simple:" msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:116 +#: ../en/ch07-filenames.xml:116 msgid "" "That is, a pattern is identified by a short text string that says what kind " "of pattern this is, followed by a colon, followed by the actual pattern." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:120 +#: ../en/ch07-filenames.xml:120 msgid "" "Mercurial supports two kinds of pattern syntax. The most frequently used is " "called <literal>glob</literal>; this is the same kind of pattern matching " @@ -7609,7 +9579,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:125 +#: ../en/ch07-filenames.xml:125 msgid "" "When Mercurial does automatic pattern matching on Windows, it uses " "<literal>glob</literal> syntax. You can thus omit the <quote><literal>glob:</" @@ -7617,14 +9587,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:130 +#: ../en/ch07-filenames.xml:130 msgid "" "The <literal>re</literal> syntax is more powerful; it lets you specify " "patterns using regular expressions, also known as regexps." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:134 +#: ../en/ch07-filenames.xml:134 msgid "" "By the way, in the examples that follow, notice that I'm careful to wrap all " "of my patterns in quote characters, so that they won't get expanded by the " @@ -7632,12 +9602,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch06-filenames.xml:140 +#: ../en/ch07-filenames.xml:140 msgid "Shell-style <literal>glob</literal> patterns" msgstr "外壳风格的 <literal>glob</literal> 模式" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch06-filenames.xml:142 +#: ../en/ch07-filenames.xml:142 msgid "" "This is an overview of the kinds of patterns you can use when you're matching " "on glob patterns." @@ -7645,7 +9615,7 @@ # #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch06-filenames.xml:145 +#: ../en/ch07-filenames.xml:145 msgid "" "The <quote><literal>*</literal></quote> character matches any string, within " "a single directory." @@ -7653,7 +9623,7 @@ # #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch06-filenames.xml:150 +#: ../en/ch07-filenames.xml:150 msgid "" "The <quote><literal>**</literal></quote> pattern matches any string, and " "crosses directory boundaries. It's not a standard Unix glob token, but it's " @@ -7662,13 +9632,13 @@ # #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch06-filenames.xml:157 +#: ../en/ch07-filenames.xml:157 msgid "" "The <quote><literal>?</literal></quote> pattern matches any single character." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch06-filenames.xml:162 +#: ../en/ch07-filenames.xml:162 msgid "" "The <quote><literal>[</literal></quote> character begins a " "<emphasis>character class</emphasis>. This matches any single character " @@ -7679,7 +9649,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch06-filenames.xml:172 +#: ../en/ch07-filenames.xml:172 msgid "" "If the first character after the <quote><literal>[</literal></quote> in a " "character class is a <quote><literal>!</literal></quote>, it " @@ -7688,7 +9658,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch06-filenames.xml:178 +#: ../en/ch07-filenames.xml:178 msgid "" "A <quote><literal>{</literal></quote> begins a group of subpatterns, where " "the whole group matches if any subpattern in the group matches. The " @@ -7697,13 +9667,13 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><title> -#: ../en/ch06-filenames.xml:187 +#: ../en/ch07-filenames.xml:187 msgid "Watch out!" msgstr "千万小心!" # #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch06-filenames.xml:189 +#: ../en/ch07-filenames.xml:189 msgid "" "Don't forget that if you want to match a pattern in any directory, you should " "not be using the <quote><literal>*</literal></quote> match-any token, as this " @@ -7713,12 +9683,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch06-filenames.xml:201 +#: ../en/ch07-filenames.xml:201 msgid "Regular expression matching with <literal>re</literal> patterns" msgstr "使用 <literal>re</literal> 模式的正则表达式匹配" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch06-filenames.xml:204 +#: ../en/ch07-filenames.xml:204 msgid "" "Mercurial accepts the same regular expression syntax as the Python " "programming language (it uses Python's regexp engine internally). This is " @@ -7727,7 +9697,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch06-filenames.xml:210 +#: ../en/ch07-filenames.xml:210 msgid "" "I won't discuss Mercurial's regexp dialect in any detail here, as regexps are " "not often used. Perl-style regexps are in any case already exhaustively " @@ -7737,7 +9707,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch06-filenames.xml:217 +#: ../en/ch07-filenames.xml:217 msgid "" "A regexp is matched against an entire file name, relative to the root of the " "repository. In other words, even if you're already in subbdirectory " @@ -7747,7 +9717,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch06-filenames.xml:224 +#: ../en/ch07-filenames.xml:224 msgid "" "One thing to note, if you're familiar with Perl-style regexps, is that " "Mercurial's are <emphasis>rooted</emphasis>. That is, a regexp starts " @@ -7757,12 +9727,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch06-filenames.xml:234 +#: ../en/ch07-filenames.xml:234 msgid "Filtering files" msgstr "过滤文件" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:236 +#: ../en/ch07-filenames.xml:236 msgid "" "Not only does Mercurial give you a variety of ways to specify files; it lets " "you further winnow those files using <emphasis>filters</emphasis>. Commands " @@ -7770,7 +9740,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch06-filenames.xml:241 +#: ../en/ch07-filenames.xml:241 msgid "" "<option role=\"hg-opt-global\">-I</option>, or <option role=\"hg-opt-global" "\">--include</option>, lets you specify a pattern that file names must match " @@ -7778,7 +9748,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch06-filenames.xml:246 +#: ../en/ch07-filenames.xml:246 msgid "" "<option role=\"hg-opt-global\">-X</option>, or <option role=\"hg-opt-global" "\">--exclude</option>, gives you a way to <emphasis>avoid</emphasis> " @@ -7786,7 +9756,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:251 +#: ../en/ch07-filenames.xml:251 msgid "" "You can provide multiple <option role=\"hg-opt-global\">-I</option> and " "<option role=\"hg-opt-global\">-X</option> options on the command line, and " @@ -7795,36 +9765,77 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:258 +#: ../en/ch07-filenames.xml:258 msgid "" "You can read a <option role=\"hg-opt-global\">-I</option> filter as " "<quote>process only the files that match this filter</quote>." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:264 +#: ../en/ch07-filenames.xml:264 msgid "" "The <option role=\"hg-opt-global\">-X</option> filter is best read as " "<quote>process only the files that don't match this pattern</quote>." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch06-filenames.xml:272 -msgid "Ignoring unwanted files and directories" -msgstr "忽略不需要的文件和目录" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:274 -msgid "XXX." +#: ../en/ch07-filenames.xml:272 +msgid "Permanently ignoring unwanted files and directories" +msgstr "始终忽略不需要的文件和目录" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch07-filenames.xml:274 +msgid "" +"When you create a new repository, the chances are that over time it will grow " +"to contain files that ought to <emphasis>not</emphasis> be managed by " +"Mercurial, but which you don't want to see listed every time you run " +"<command>hg status</command>. For instance, <quote>build products</quote> " +"are files that are created as part of a build but which should not be managed " +"by a revision control system. The most common build products are output " +"files produced by software tools such as compilers. As another example, many " +"text editors litter a directory with lock files, temporary working files, and " +"backup files, which it also makes no sense to manage." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch07-filenames.xml:286 +msgid "" +"To have Mercurial permanently ignore such files, create a file named " +"<filename>.hgignore</filename> in the root of your repository. You " +"<emphasis>should</emphasis> <command>hg add</command> this file so that it " +"gets tracked with the rest of your repository contents, since your " +"collaborators will probably find it useful too." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch07-filenames.xml:293 +msgid "" +"By default, the <filename>.hgignore</filename> file should contain a list of " +"regular expressions, one per line. Empty lines are skipped. Most people " +"prefer to describe the files they want to ignore using the <quote>glob</" +"quote> syntax that we described above, so a typical <filename>.hgignore</" +"filename> file will start with this directive:" +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch07-filenames.xml:302 +msgid "" +"This tells Mercurial to interpret the lines that follow as glob patterns, not " +"regular expressions." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch07-filenames.xml:305 +msgid "Here is a typical-looking <filename>.hgignore</filename> file." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch06-filenames.xml:278 +#: ../en/ch07-filenames.xml:329 msgid "Case sensitivity" msgstr "大小写敏感性" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:280 +#: ../en/ch07-filenames.xml:331 msgid "" "If you're working in a mixed development environment that contains both Linux " "(or other Unix) systems and Macs or Windows systems, you should keep in the " @@ -7835,7 +9846,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:289 +#: ../en/ch07-filenames.xml:340 msgid "" "Operating systems and filesystems differ in the way they handle the " "<emphasis>case</emphasis> of characters in file and directory names. There " @@ -7843,7 +9854,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch06-filenames.xml:294 +#: ../en/ch07-filenames.xml:345 msgid "" "Completely case insensitive. Uppercase and lowercase versions of a letter " "are treated as identical, both when creating a file and during subsequent " @@ -7851,7 +9862,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch06-filenames.xml:299 +#: ../en/ch07-filenames.xml:350 msgid "" "Case preserving, but insensitive. When a file or directory is created, the " "case of its name is stored, and can be retrieved and displayed by the " @@ -7863,15 +9874,15 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch06-filenames.xml:310 +#: ../en/ch07-filenames.xml:361 msgid "" "Case sensitive. The case of a name is significant at all times. The names " -"<filename>foo</filename> and {FoO} identify different files. This is the way " -"Linux and Unix systems normally work." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch06-filenames.xml:316 +"<filename>foo</filename> and <filename>FoO</filename> identify different " +"files. This is the way Linux and Unix systems normally work." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch07-filenames.xml:368 msgid "" "On Unix-like systems, it is possible to have any or all of the above ways of " "handling case in action at once. For example, if you use a USB thumb drive " @@ -7880,12 +9891,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch06-filenames.xml:323 +#: ../en/ch07-filenames.xml:375 msgid "Safe, portable repository storage" msgstr "安全,可移植的版本库存储" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch06-filenames.xml:325 +#: ../en/ch07-filenames.xml:377 msgid "" "Mercurial's repository storage mechanism is <emphasis>case safe</emphasis>. " "It translates file names so that they can be safely stored on both case " @@ -7896,12 +9907,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch06-filenames.xml:336 +#: ../en/ch07-filenames.xml:388 msgid "Detecting case conflicts" msgstr "检测大小写冲突" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch06-filenames.xml:338 +#: ../en/ch07-filenames.xml:390 msgid "" "When operating in the working directory, Mercurial honours the naming policy " "of the filesystem where the working directory is located. If the filesystem " @@ -7910,7 +9921,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch06-filenames.xml:344 +#: ../en/ch07-filenames.xml:396 msgid "" "An important aspect of this approach is that it is possible to commit a " "changeset on a case sensitive (typically Linux or Unix) filesystem that will " @@ -7923,7 +9934,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch06-filenames.xml:355 +#: ../en/ch07-filenames.xml:407 msgid "" "If a Windows or Mac user pulls this change, they will not initially have a " "problem, because Mercurial's repository storage mechanism is case safe. " @@ -7935,12 +9946,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch06-filenames.xml:367 +#: ../en/ch07-filenames.xml:419 msgid "Fixing a case conflict" msgstr "修正大小写冲突" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch06-filenames.xml:369 +#: ../en/ch07-filenames.xml:421 msgid "" "If you are using Windows or a Mac in a mixed environment where some of your " "collaborators are using Linux or Unix, and Mercurial reports a case folding " @@ -7950,7 +9961,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch06-filenames.xml:376 +#: ../en/ch07-filenames.xml:428 msgid "" "Just find a nearby Linux or Unix box, clone the problem repository onto it, " "and use Mercurial's <command role=\"hg-cmd\">hg rename</command> command to " @@ -7962,7 +9973,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch06-filenames.xml:386 +#: ../en/ch07-filenames.xml:438 msgid "" "The changeset with case-conflicting names will remain in your project's " "history, and you still won't be able to <command role=\"hg-cmd\">hg update</" @@ -7970,22 +9981,13 @@ "system, but you can continue development unimpeded." msgstr "" -#. type: Content of: <book><chapter><sect1><sect2><note><para> -#: ../en/ch06-filenames.xml:393 -msgid "" -"Prior to version 0.9.3, Mercurial did not use a case safe repository storage " -"mechanism, and did not detect case folding conflicts. If you are using an " -"older version of Mercurial on Windows or MacOS, I strongly recommend that you " -"upgrade." -msgstr "" - #. type: Content of: <book><chapter><title> -#: ../en/ch07-branch.xml:5 +#: ../en/ch08-branch.xml:5 msgid "Managing releases and branchy development" msgstr "发布管理与分支开发" #. type: Content of: <book><chapter><para> -#: ../en/ch07-branch.xml:7 +#: ../en/ch08-branch.xml:7 msgid "" "Mercurial provides several mechanisms for you to manage a project that is " "making progress on multiple fronts at once. To understand these mechanisms, " @@ -7993,7 +9995,7 @@ msgstr "" #. type: Content of: <book><chapter><para> -#: ../en/ch07-branch.xml:12 +#: ../en/ch08-branch.xml:12 msgid "" "Many software projects issue periodic <quote>major</quote> releases that " "contain substantial new features. In parallel, they may issue <quote>minor</" @@ -8002,7 +10004,7 @@ msgstr "" #. type: Content of: <book><chapter><para> -#: ../en/ch07-branch.xml:18 +#: ../en/ch08-branch.xml:18 msgid "" "In this chapter, we'll start by talking about how to keep records of project " "milestones such as releases. We'll then continue on to talk about the flow " @@ -8011,12 +10013,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch07-branch.xml:25 +#: ../en/ch08-branch.xml:25 msgid "Giving a persistent name to a revision" msgstr "给版本指定一个永久的名称" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:27 +#: ../en/ch08-branch.xml:27 msgid "" "Once you decide that you'd like to call a particular revision a " "<quote>release</quote>, it's a good idea to record the identity of that " @@ -8027,7 +10029,7 @@ # #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:34 +#: ../en/ch08-branch.xml:34 msgid "" "Mercurial lets you give a permanent name to any revision using the <command " "role=\"hg-cmd\">hg tag</command> command. Not surprisingly, these names are " @@ -8035,7 +10037,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:40 +#: ../en/ch08-branch.xml:40 msgid "" "A tag is nothing more than a <quote>symbolic name</quote> for a revision. " "Tags exist purely for your convenience, so that you have a handy permanent " @@ -8046,22 +10048,22 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch07-branch.xml:49 +#: ../en/ch08-branch.xml:49 msgid "Colon (ASCII 58, <quote><literal>:</literal></quote>)" msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch07-branch.xml:52 +#: ../en/ch08-branch.xml:52 msgid "Carriage return (ASCII 13, <quote><literal>\\r</literal></quote>)" msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch07-branch.xml:55 +#: ../en/ch08-branch.xml:55 msgid "Newline (ASCII 10, <quote><literal>\\n</literal></quote>)" msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:59 +#: ../en/ch08-branch.xml:59 msgid "" "You can use the <command role=\"hg-cmd\">hg tags</command> command to display " "the tags present in your repository. In the output, each tagged revision is " @@ -8070,7 +10072,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:67 +#: ../en/ch08-branch.xml:67 msgid "" "Notice that <literal>tip</literal> is listed in the output of <command role=" "\"hg-cmd\">hg tags</command>. The <literal>tip</literal> tag is a special " @@ -8079,7 +10081,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:73 +#: ../en/ch08-branch.xml:73 msgid "" "In the output of the <command role=\"hg-cmd\">hg tags</command> command, tags " "are listed in reverse order, by revision number. This usually means that " @@ -8089,7 +10091,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:80 +#: ../en/ch08-branch.xml:80 msgid "" "When you run <command role=\"hg-cmd\">hg log</command>, if it displays a " "revision that has tags associated with it, it will print those tags." @@ -8097,7 +10099,7 @@ # #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:86 +#: ../en/ch08-branch.xml:86 msgid "" "Any time you need to provide a revision ID to a Mercurial command, the " "command will accept a tag name in its place. Internally, Mercurial will " @@ -8105,7 +10107,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:93 +#: ../en/ch08-branch.xml:93 msgid "" "There's no limit on the number of tags you can have in a repository, or on " "the number of tags that a single revision can have. As a practical matter, " @@ -8116,7 +10118,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:101 +#: ../en/ch08-branch.xml:101 msgid "" "For example, if your project has milestones as frequent as every few days, " "it's perfectly reasonable to tag each one of those. But if you have a " @@ -8127,14 +10129,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:109 +#: ../en/ch08-branch.xml:109 msgid "" "If you want to remove a tag that you no longer want, use <command role=\"hg-" "cmd\">hg tag --remove</command>." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:114 +#: ../en/ch08-branch.xml:114 msgid "" "You can also modify a tag at any time, so that it identifies a different " "revision, by simply issuing a new <command role=\"hg-cmd\">hg tag</command> " @@ -8144,7 +10146,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:123 +#: ../en/ch08-branch.xml:123 msgid "" "There will still be a permanent record of the previous identity of the tag, " "but Mercurial will no longer use it. There's thus no penalty to tagging the " @@ -8152,26 +10154,26 @@ "revision once you discover your error." msgstr "" -# -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:129 +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch08-branch.xml:129 msgid "" "Mercurial stores tags in a normal revision-controlled file in your " -"repository. If you've created any tags, you'll find them in a file named " -"<filename role=\"special\">.hgtags</filename>. When you run the <command " -"role=\"hg-cmd\">hg tag</command> command, Mercurial modifies this file, then " -"automatically commits the change to it. This means that every time you run " -"<command role=\"hg-cmd\">hg tag</command>, you'll see a corresponding " -"changeset in the output of <command role=\"hg-cmd\">hg log</command>." +"repository. If you've created any tags, you'll find them in a file in the " +"root of your repository named <filename role=\"special\">.hgtags</filename>. " +"When you run the <command role=\"hg-cmd\">hg tag</command> command, Mercurial " +"modifies this file, then automatically commits the change to it. This means " +"that every time you run <command role=\"hg-cmd\">hg tag</command>, you'll see " +"a corresponding changeset in the output of <command role=\"hg-cmd\">hg log</" +"command>." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch07-branch.xml:142 +#: ../en/ch08-branch.xml:142 msgid "Handling tag conflicts during a merge" msgstr "在合并期间处理标签冲突" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch07-branch.xml:144 +#: ../en/ch08-branch.xml:144 msgid "" "You won't often need to care about the <filename role=\"special\">.hgtags</" "filename> file, but it sometimes makes its presence known during a merge. " @@ -8181,7 +10183,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch07-branch.xml:151 +#: ../en/ch08-branch.xml:151 msgid "" "If you're resolving a conflict in the <filename role=\"special\">.hgtags</" "filename> file during a merge, there's one twist to modifying the <filename " @@ -8192,7 +10194,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch07-branch.xml:161 +#: ../en/ch08-branch.xml:161 msgid "" "An unfortunate consequence of this design is that you can't actually verify " "that your merged <filename role=\"special\">.hgtags</filename> file is " @@ -8206,12 +10208,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch07-branch.xml:176 +#: ../en/ch08-branch.xml:176 msgid "Tags and cloning" msgstr "标签与克隆" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch07-branch.xml:178 +#: ../en/ch08-branch.xml:178 msgid "" "You may have noticed that the <command role=\"hg-cmd\">hg clone</command> " "command has a <option role=\"hg-opt-clone\">-r</option> option that lets you " @@ -8221,26 +10223,26 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch07-branch.xml:186 +#: ../en/ch08-branch.xml:186 msgid "" "Recall that a tag is stored as a revision to the <filename role=\"special\">." -"hgtags</filename> file, so that when you create a tag, the changeset in which " -"it's recorded necessarily refers to an older changeset. When you run " -"<command role=\"hg-cmd\">hg clone -r foo</command> to clone a repository as " -"of tag <literal>foo</literal>, the new clone <emphasis>will not contain the " -"history that created the tag</emphasis> that you used to clone the " -"repository. The result is that you'll get exactly the right subset of the " +"hgtags</filename> file. When you create a tag, the changeset in which its " +"recorded refers to an older changeset. When you run <command role=\"hg-cmd" +"\">hg clone -r foo</command> to clone a repository as of tag <literal>foo</" +"literal>, the new clone <emphasis>will not contain any revision newer than " +"the one the tag refers to, including the revision where the tag was created</" +"emphasis>. The result is that you'll get exactly the right subset of the " "project's history in the new repository, but <emphasis>not</emphasis> the tag " "you might have expected." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch07-branch.xml:201 +#: ../en/ch08-branch.xml:201 msgid "When permanent tags are too much" msgstr "当永久标签太多的时候" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch07-branch.xml:203 +#: ../en/ch08-branch.xml:203 msgid "" "Since Mercurial's tags are revision controlled and carried around with a " "project's history, everyone you work with will see the tags you create. But " @@ -8251,7 +10253,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch07-branch.xml:213 +#: ../en/ch08-branch.xml:213 msgid "" "For cases like this, what you might want to use are <emphasis>local</" "emphasis> tags. You can create a local tag with the <option role=\"hg-opt-tag" @@ -8265,20 +10267,20 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch07-branch.xml:228 +#: ../en/ch08-branch.xml:228 msgid "The flow of changes&emdash;big picture vs. little" msgstr "修改流程—宏观与微观" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:230 -msgid "" -"To return to the outline I sketched at the beginning of a chapter, let's " +#: ../en/ch08-branch.xml:230 +msgid "" +"To return to the outline I sketched at the beginning of the chapter, let's " "think about a project that has multiple concurrent pieces of work under " "development at once." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:234 +#: ../en/ch08-branch.xml:235 msgid "" "There might be a push for a new <quote>main</quote> release; a new minor " "bugfix release to the last main release; and an unexpected <quote>hot fix</" @@ -8286,7 +10288,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:239 +#: ../en/ch08-branch.xml:240 msgid "" "The usual way people refer to these different concurrent directions of " "development is as <quote>branches</quote>. However, we've already seen " @@ -8296,14 +10298,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch07-branch.xml:246 +#: ../en/ch08-branch.xml:247 msgid "" "<quote>Big picture</quote> branches represent the sweep of a project's " "evolution; people give them names, and talk about them in conversation." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch07-branch.xml:250 +#: ../en/ch08-branch.xml:251 msgid "" "<quote>Little picture</quote> branches are artefacts of the day-to-day " "activity of developing and merging changes. They expose the narrative of how " @@ -8311,12 +10313,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch07-branch.xml:258 +#: ../en/ch08-branch.xml:259 msgid "Managing big-picture branches in repositories" msgstr "在版本库中管理分支" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:260 +#: ../en/ch08-branch.xml:261 msgid "" "The easiest way to isolate a <quote>big picture</quote> branch in Mercurial " "is in a dedicated repository. If you have an existing shared " @@ -8327,14 +10329,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:270 +#: ../en/ch08-branch.xml:271 msgid "" "You can then clone a new shared <literal>myproject-1.0.1</literal> repository " "as of that tag." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:276 +#: ../en/ch08-branch.xml:277 msgid "" "Afterwards, if someone needs to work on a bug fix that ought to go into an " "upcoming 1.0.1 minor release, they clone the <literal>myproject-1.0.1</" @@ -8342,19 +10344,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:283 +#: ../en/ch08-branch.xml:284 msgid "" "Meanwhile, development for the next major release can continue, isolated and " "unabated, in the <literal>myproject</literal> repository." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch07-branch.xml:291 +#: ../en/ch08-branch.xml:292 msgid "Don't repeat yourself: merging across branches" msgstr "不要重复劳动:在分支间合并" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:293 +#: ../en/ch08-branch.xml:294 msgid "" "In many cases, if you have a bug to fix on a maintenance branch, the chances " "are good that the bug exists on your project's main branch (and possibly " @@ -8364,26 +10366,26 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:301 +#: ../en/ch08-branch.xml:302 msgid "" "In the simplest instance, all you need to do is pull changes from your " "maintenance branch into your local clone of the target branch." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:307 +#: ../en/ch08-branch.xml:308 msgid "" "You'll then need to merge the heads of the two branches, and push back to the " "main branch." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch07-branch.xml:314 +#: ../en/ch08-branch.xml:315 msgid "Naming branches within one repository" msgstr "版本库中的命名分支" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:316 +#: ../en/ch08-branch.xml:317 msgid "" "In most instances, isolating branches in repositories is the right approach. " "Its simplicity makes it easy to understand; and so it's hard to make " @@ -8393,7 +10395,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:323 +#: ../en/ch08-branch.xml:324 msgid "" "If you're more in the <quote>power user</quote> category (<emphasis>and</" "emphasis> your collaborators are too), there is an alternative way of " @@ -8406,7 +10408,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:334 +#: ../en/ch08-branch.xml:335 msgid "" "The key to working this way is that Mercurial lets you assign a persistent " "<emphasis>name</emphasis> to a branch. There always exists a branch named " @@ -8416,7 +10418,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:341 +#: ../en/ch08-branch.xml:342 msgid "" "As an example, when you run the <command role=\"hg-cmd\">hg commit</command> " "command, and it pops up your editor so that you can enter a commit message, " @@ -8426,7 +10428,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:348 +#: ../en/ch08-branch.xml:349 msgid "" "To start working with named branches, use the <command role=\"hg-cmd\">hg " "branches</command> command. This command lists the named branches already " @@ -8434,14 +10436,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:355 +#: ../en/ch08-branch.xml:356 msgid "" "Since you haven't created any named branches yet, the only one that exists is " "<literal>default</literal>." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:358 +#: ../en/ch08-branch.xml:359 msgid "" "To find out what the <quote>current</quote> branch is, run the <command role=" "\"hg-cmd\">hg branch</command> command, giving it no arguments. This tells " @@ -8450,7 +10452,7 @@ # #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:365 +#: ../en/ch08-branch.xml:366 msgid "" "To create a new branch, run the <command role=\"hg-cmd\">hg branch</command> " "command again. This time, give it one argument: the name of the branch you " @@ -8458,7 +10460,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:371 +#: ../en/ch08-branch.xml:372 msgid "" "After you've created a branch, you might wonder what effect the <command role=" "\"hg-cmd\">hg branch</command> command has had. What do the <command role=" @@ -8467,7 +10469,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:378 +#: ../en/ch08-branch.xml:379 msgid "" "Nothing has changed in the working directory, and there's been no new history " "created. As this suggests, running the <command role=\"hg-cmd\">hg branch</" @@ -8476,7 +10478,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:385 +#: ../en/ch08-branch.xml:386 msgid "" "When you commit a change, Mercurial records the name of the branch on which " "you committed. Once you've switched from the <literal>default</literal> " @@ -8487,7 +10489,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:395 +#: ../en/ch08-branch.xml:396 msgid "" "The <command role=\"hg-cmd\">hg log</command>-like commands will print the " "branch name of every changeset that's not on the <literal>default</literal> " @@ -8496,7 +10498,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:400 +#: ../en/ch08-branch.xml:401 msgid "" "Once you've named a branch and committed a change with that name, every " "subsequent commit that descends from that change will inherit the same branch " @@ -8505,47 +10507,47 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:408 +#: ../en/ch08-branch.xml:409 msgid "" "In practice, this is something you won't do very often, as branch names tend " "to have fairly long lifetimes. (This isn't a rule, just an observation.)" msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch07-branch.xml:414 +#: ../en/ch08-branch.xml:415 msgid "Dealing with multiple named branches in a repository" msgstr "在版本库中处理多个命名分支" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:417 +#: ../en/ch08-branch.xml:418 msgid "" "If you have more than one named branch in a repository, Mercurial will " -"remember the branch that your working directory on when you start a command " -"like <command role=\"hg-cmd\">hg update</command> or <command role=\"hg-cmd" -"\">hg pull -u</command>. It will update the working directory to the tip of " -"this branch, no matter what the <quote>repo-wide</quote> tip is. To update " -"to a revision that's on a different named branch, you may need to use the " -"<option role=\"hg-opt-update\">-C</option> option to <command role=\"hg-cmd" -"\">hg update</command>." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:427 -msgid "" -"This behaviour is a little subtle, so let's see it in action. First, let's " +"remember the branch that your working directory is on when you start a " +"command like <command role=\"hg-cmd\">hg update</command> or <command role=" +"\"hg-cmd\">hg pull -u</command>. It will update the working directory to the " +"tip of this branch, no matter what the <quote>repo-wide</quote> tip is. To " +"update to a revision that's on a different named branch, you may need to use " +"the <option role=\"hg-opt-update\">-C</option> option to <command role=\"hg-" +"cmd\">hg update</command>." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch08-branch.xml:428 +msgid "" +"This behavior is a little subtle, so let's see it in action. First, let's " "remind ourselves what branch we're currently on, and what branches are in our " "repository." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:433 +#: ../en/ch08-branch.xml:434 msgid "" "We're on the <literal>bar</literal> branch, but there also exists an older " "<command role=\"hg-cmd\">hg foo</command> branch." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:437 +#: ../en/ch08-branch.xml:438 msgid "" "We can <command role=\"hg-cmd\">hg update</command> back and forth between " "the tips of the <literal>foo</literal> and <literal>bar</literal> branches " @@ -8556,7 +10558,7 @@ # #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:446 +#: ../en/ch08-branch.xml:447 msgid "" "If we go back to the <literal>foo</literal> branch and then run <command role=" "\"hg-cmd\">hg update</command>, it will keep us on <literal>foo</literal>, " @@ -8565,19 +10567,19 @@ # #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:453 +#: ../en/ch08-branch.xml:454 msgid "" "Committing a new change on the <literal>foo</literal> branch introduces a new " "head." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch07-branch.xml:460 +#: ../en/ch08-branch.xml:461 msgid "Branch names and merging" msgstr "分支名称与合并" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:462 +#: ../en/ch08-branch.xml:463 msgid "" "As you've probably noticed, merges in Mercurial are not symmetrical. Let's " "say our repository has two heads, 17 and 23. If I <command role=\"hg-cmd" @@ -8589,7 +10591,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:472 +#: ../en/ch08-branch.xml:473 msgid "" "This affects Mercurial's choice of branch name when you merge. After a " "merge, Mercurial will retain the branch name of the first parent when you " @@ -8599,7 +10601,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:479 +#: ../en/ch08-branch.xml:480 msgid "" "It's not unusual for a repository to contain multiple heads, each with the " "same branch name. Let's say I'm working on the <literal>foo</literal> " @@ -8611,7 +10613,7 @@ # #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:487 +#: ../en/ch08-branch.xml:488 msgid "" "But if I'm working on the <literal>bar</literal> branch, and I merge work " "from the <literal>foo</literal> branch, the result will remain on the " @@ -8619,7 +10621,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:493 +#: ../en/ch08-branch.xml:494 msgid "" "To give a more concrete example, if I'm working on the <literal>bleeding-" "edge</literal> branch, and I want to bring in the latest fixes from the " @@ -8629,12 +10631,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch07-branch.xml:502 +#: ../en/ch08-branch.xml:503 msgid "Branch naming is generally useful" msgstr "分支名称通常都很有用" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:504 +#: ../en/ch08-branch.xml:505 msgid "" "You shouldn't think of named branches as applicable only to situations where " "you have multiple long-lived branches cohabiting in a single repository. " @@ -8642,7 +10644,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:509 +#: ../en/ch08-branch.xml:510 msgid "" "In the simplest case, giving a name to each branch gives you a permanent " "record of which branch a changeset originated on. This gives you more " @@ -8651,7 +10653,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch07-branch.xml:514 +#: ../en/ch08-branch.xml:515 msgid "" "If you're working with shared repositories, you can set up a <literal role=" "\"hook\">pretxnchangegroup</literal> hook on each that will block incoming " @@ -8663,12 +10665,12 @@ msgstr "" #. type: Content of: <book><chapter><title> -#: ../en/ch08-undo.xml:5 +#: ../en/ch09-undo.xml:5 msgid "Finding and fixing mistakes" msgstr "查找和修改错误" #. type: Content of: <book><chapter><para> -#: ../en/ch08-undo.xml:7 +#: ../en/ch09-undo.xml:7 msgid "" "To err might be human, but to really handle the consequences well takes a top-" "notch revision control system. In this chapter, we'll discuss some of the " @@ -8678,17 +10680,17 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch08-undo.xml:15 +#: ../en/ch09-undo.xml:15 msgid "Erasing local history" msgstr "销毁本地历史" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch08-undo.xml:18 +#: ../en/ch09-undo.xml:18 msgid "The accidental commit" msgstr "意外的提交" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:20 +#: ../en/ch09-undo.xml:20 msgid "" "I have the occasional but persistent problem of typing rather more quickly " "than I can think, which sometimes results in me committing a changeset that " @@ -8699,12 +10701,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch08-undo.xml:31 +#: ../en/ch09-undo.xml:31 msgid "Rolling back a transaction" msgstr "回滚一个事务" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:33 +#: ../en/ch09-undo.xml:33 msgid "" "In <xref linkend=\"sec:concepts:txn\"/>, I mentioned that Mercurial treats " "each modification of a repository as a <emphasis>transaction</emphasis>. " @@ -8716,7 +10718,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:43 +#: ../en/ch09-undo.xml:43 msgid "" "Here's a mistake that I often find myself making: committing a change in " "which I've created a new file, but forgotten to <command role=\"hg-cmd\">hg " @@ -8724,14 +10726,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:50 +#: ../en/ch09-undo.xml:50 msgid "" "Looking at the output of <command role=\"hg-cmd\">hg status</command> after " "the commit immediately confirms the error." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:56 +#: ../en/ch09-undo.xml:56 msgid "" "The commit captured the changes to the file <filename>a</filename>, but not " "the new file <filename>b</filename>. If I were to push this changeset to a " @@ -8742,7 +10744,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:65 +#: ../en/ch09-undo.xml:65 msgid "" "However, luck is with me&emdash;I've caught my error before I pushed the " "changeset. I use the <command role=\"hg-cmd\">hg rollback</command> command, " @@ -8750,7 +10752,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:72 +#: ../en/ch09-undo.xml:72 msgid "" "Notice that the changeset is no longer present in the repository's history, " "and the working directory once again thinks that the file <filename>a</" @@ -8761,12 +10763,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch08-undo.xml:85 +#: ../en/ch09-undo.xml:85 msgid "The erroneous pull" msgstr "错误的抓取" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:87 +#: ../en/ch09-undo.xml:87 msgid "" "It's common practice with Mercurial to maintain separate development branches " "of a project in different repositories. Your development team might have one " @@ -8775,7 +10777,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:94 +#: ../en/ch09-undo.xml:94 msgid "" "Given this, you can imagine that the consequences could be messy if you had a " "local <quote>0.9</quote> repository, and accidentally pulled changes from the " @@ -8788,7 +10790,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:106 +#: ../en/ch09-undo.xml:106 msgid "" "The <command role=\"hg-cmd\">hg rollback</command> command will work nicely " "to expunge all of the changesets that you just pulled. Mercurial groups all " @@ -8798,12 +10800,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch08-undo.xml:115 +#: ../en/ch09-undo.xml:115 msgid "Rolling back is useless once you've pushed" msgstr "当完成推送后,回滚是无效的" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:117 +#: ../en/ch09-undo.xml:117 msgid "" "The value of the <command role=\"hg-cmd\">hg rollback</command> command drops " "to zero once you've pushed your changes to another repository. Rolling back " @@ -8814,57 +10816,57 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:126 +#: ../en/ch09-undo.xml:126 msgid "" "If you've pushed a change to another repository&emdash;particularly if it's a " "shared repository&emdash;it has essentially <quote>escaped into the wild,</" -"quote> and you'll have to recover from your mistake in a different way. What " -"will happen if you push a changeset somewhere, then roll it back, then pull " -"from the repository you pushed to, is that the changeset will reappear in " -"your repository." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:135 +"quote> and you'll have to recover from your mistake in a different way. If " +"you push a changeset somewhere, then roll it back, then pull from the " +"repository you pushed to, the changeset you thought you'd gotten rid of will " +"simply reappear in your repository." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch09-undo.xml:135 msgid "" "(If you absolutely know for sure that the change you want to roll back is the " "most recent change in the repository that you pushed to, <emphasis>and</" "emphasis> you know that nobody else could have pulled it from that " "repository, you can roll back the changeset there, too, but you really should " -"really not rely on this working reliably. If you do this, sooner or later a " -"change really will make it into a repository that you don't directly control " -"(or have forgotten about), and come back to bite you.)" +"not expect this to work reliably. Sooner or later a change really will make " +"it into a repository that you don't directly control (or have forgotten " +"about), and come back to bite you.)" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch08-undo.xml:147 +#: ../en/ch09-undo.xml:147 msgid "You can only roll back once" msgstr "你只能回滚一次" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:149 +#: ../en/ch09-undo.xml:149 msgid "" "Mercurial stores exactly one transaction in its transaction log; that " "transaction is the most recent one that occurred in the repository. This " "means that you can only roll back one transaction. If you expect to be able " -"to roll back one transaction, then its predecessor, this is not the behaviour " +"to roll back one transaction, then its predecessor, this is not the behavior " "you will get." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:158 +#: ../en/ch09-undo.xml:158 msgid "" "Once you've rolled back one transaction in a repository, you can't roll back " "again in that repository until you perform another commit or pull." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch08-undo.xml:165 +#: ../en/ch09-undo.xml:165 msgid "Reverting the mistaken change" msgstr "撤销错误的修改" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:167 +#: ../en/ch09-undo.xml:167 msgid "" "If you make a modification to a file, and decide that you really didn't want " "to change the file at all, and you haven't yet committed your changes, the " @@ -8876,7 +10878,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:176 +#: ../en/ch09-undo.xml:176 msgid "" "Let's illustrate how the <command role=\"hg-cmd\">hg revert</command> command " "works with yet another small example. We'll begin by modifying a file that " @@ -8884,22 +10886,40 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:183 +#: ../en/ch09-undo.xml:183 msgid "" "If we don't want that change, we can simply <command role=\"hg-cmd\">hg " "revert</command> the file." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:189 +#: ../en/ch09-undo.xml:189 msgid "" "The <command role=\"hg-cmd\">hg revert</command> command provides us with an " "extra degree of safety by saving our modified file with a <filename>.orig</" "filename> extension." msgstr "" -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:196 +#. type: Content of: <book><chapter><sect1><tip><title> +#: ../en/ch09-undo.xml:197 +msgid "Be careful with <filename>.orig</filename> files" +msgstr "小心 <filename>.orig</filename> 文件" + +#. type: Content of: <book><chapter><sect1><tip><para> +#: ../en/ch09-undo.xml:199 +msgid "" +"It's extremely unlikely that you are either using Mercurial to manage files " +"with <filename>.orig</filename> extensions or that you even care about the " +"contents of such files. Just in case, though, it's useful to remember that " +"<command role=\"hg-cmd\">hg revert</command> will unconditionally overwrite " +"an existing file with a <filename>.orig</filename> extension. For instance, " +"if you already have a file named <filename>foo.orig</filename> when you " +"revert <filename>foo</filename>, the contents of <filename>foo.orig</" +"filename> will be clobbered." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch09-undo.xml:211 msgid "" "Here is a summary of the cases that the <command role=\"hg-cmd\">hg revert</" "command> command can deal with. We will describe each of these in more " @@ -8907,26 +10927,26 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch08-undo.xml:201 +#: ../en/ch09-undo.xml:216 msgid "If you modify a file, it will restore the file to its unmodified state." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch08-undo.xml:204 +#: ../en/ch09-undo.xml:219 msgid "" "If you <command role=\"hg-cmd\">hg add</command> a file, it will undo the " "<quote>added</quote> state of the file, but leave the file itself untouched." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch08-undo.xml:208 +#: ../en/ch09-undo.xml:223 msgid "" "If you delete a file without telling Mercurial, it will restore the file to " "its unmodified contents." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch08-undo.xml:211 +#: ../en/ch09-undo.xml:226 msgid "" "If you use the <command role=\"hg-cmd\">hg remove</command> command to remove " "a file, it will undo the <quote>removed</quote> state of the file, and " @@ -8934,12 +10954,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch08-undo.xml:218 +#: ../en/ch09-undo.xml:233 msgid "File management errors" msgstr "文件管理错误" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:220 +#: ../en/ch09-undo.xml:235 msgid "" "The <command role=\"hg-cmd\">hg revert</command> command is useful for more " "than just modified files. It lets you reverse the results of all of " @@ -8949,7 +10969,7 @@ # #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:226 +#: ../en/ch09-undo.xml:241 msgid "" "If you <command role=\"hg-cmd\">hg add</command> a file, then decide that in " "fact you don't want Mercurial to track it, use <command role=\"hg-cmd\">hg " @@ -8958,7 +10978,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:234 +#: ../en/ch09-undo.xml:249 msgid "" "Similarly, if you ask Mercurial to <command role=\"hg-cmd\">hg remove</" "command> a file, you can use <command role=\"hg-cmd\">hg revert</command> to " @@ -8970,7 +10990,7 @@ # #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:245 +#: ../en/ch09-undo.xml:260 msgid "" "If you revert a <command role=\"hg-cmd\">hg copy</command>, the copied-to " "file remains in your working directory afterwards, untracked. Since a copy " @@ -8978,90 +10998,39 @@ "with the copied-from file." msgstr "" -#. type: Content of: <book><chapter><sect1><sect2><sect3><title> -#: ../en/ch08-undo.xml:254 -msgid "A slightly special case: reverting a rename" -msgstr "一个稍微特别的案例:撤销改名" - -#. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch08-undo.xml:256 -msgid "" -"If you <command role=\"hg-cmd\">hg rename</command> a file, there is one " -"small detail that you should remember. When you <command role=\"hg-cmd\">hg " -"revert</command> a rename, it's not enough to provide the name of the renamed-" -"to file, as you can see here." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch08-undo.xml:264 -msgid "" -"As you can see from the output of <command role=\"hg-cmd\">hg status</" -"command>, the renamed-to file is no longer identified as added, but the " -"renamed-<emphasis>from</emphasis> file is still removed! This is counter-" -"intuitive (at least to me), but at least it's easy to deal with." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch08-undo.xml:273 -msgid "" -"So remember, to revert a <command role=\"hg-cmd\">hg rename</command>, you " -"must provide <emphasis>both</emphasis> the source and destination names." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch08-undo.xml:278 -msgid "% TODO: the output doesn't look like it will be removed!" -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch08-undo.xml:281 -msgid "" -"(By the way, if you rename a file, then modify the renamed-to file, then " -"revert both components of the rename, when Mercurial restores the file that " -"was removed as part of the rename, it will be unmodified. If you need the " -"modifications in the renamed-to file to show up in the renamed-from file, " -"don't forget to copy them over.)" -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch08-undo.xml:288 -msgid "" -"These fiddly aspects of reverting a rename arguably constitute a small bug in " -"Mercurial." -msgstr "" - #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch08-undo.xml:295 +#: ../en/ch09-undo.xml:271 msgid "Dealing with committed changes" msgstr "处理已经提交的修改" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:297 -msgid "" -"Consider a case where you have committed a change $a$, and another change $b$ " -"on top of it; you then realise that change $a$ was incorrect. Mercurial lets " -"you <quote>back out</quote> an entire changeset automatically, and building " -"blocks that let you reverse part of a changeset by hand." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:303 +#: ../en/ch09-undo.xml:273 +msgid "" +"Consider a case where you have committed a change <emphasis>a</emphasis>, and " +"another change <emphasis>b</emphasis> on top of it; you then realise that " +"change <emphasis>a</emphasis> was incorrect. Mercurial lets you <quote>back " +"out</quote> an entire changeset automatically, and building blocks that let " +"you reverse part of a changeset by hand." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch09-undo.xml:281 msgid "" "Before you read this section, here's something to keep in mind: the <command " -"role=\"hg-cmd\">hg backout</command> command undoes changes by " -"<emphasis>adding</emphasis> history, not by modifying or erasing it. It's " -"the right tool to use if you're fixing bugs, but not if you're trying to undo " -"some change that has catastrophic consequences. To deal with those, see " -"<xref linkend=\"sec:undo:aaaiiieee\"/>." +"role=\"hg-cmd\">hg backout</command> command undoes the effect of a change by " +"<emphasis>adding</emphasis> to your repository's history, not by modifying or " +"erasing it. It's the right tool to use if you're fixing bugs, but not if " +"you're trying to undo some change that has catastrophic consequences. To " +"deal with those, see <xref linkend=\"sec:undo:aaaiiieee\"/>." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch08-undo.xml:312 +#: ../en/ch09-undo.xml:291 msgid "Backing out a changeset" msgstr "恢复一个修改集" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:314 +#: ../en/ch09-undo.xml:293 msgid "" "The <command role=\"hg-cmd\">hg backout</command> command lets you " "<quote>undo</quote> the effects of an entire changeset in an automated " @@ -9073,7 +11042,7 @@ # #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:323 +#: ../en/ch09-undo.xml:302 msgid "" "The operation of the <command role=\"hg-cmd\">hg backout</command> command is " "a little intricate, so let's illustrate it with some examples. First, we'll " @@ -9081,7 +11050,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:330 +#: ../en/ch09-undo.xml:309 msgid "" "The <command role=\"hg-cmd\">hg backout</command> command takes a single " "changeset ID as its argument; this is the changeset to back out. Normally, " @@ -9092,17 +11061,17 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch08-undo.xml:341 +#: ../en/ch09-undo.xml:320 msgid "Backing out the tip changeset" msgstr "恢复顶点修改集" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:343 +#: ../en/ch09-undo.xml:322 msgid "We're going to start by backing out the last changeset we committed." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:348 +#: ../en/ch09-undo.xml:327 msgid "" "You can see that the second line from <filename>myfile</filename> is no " "longer present. Taking a look at the output of <command role=\"hg-cmd\">hg " @@ -9115,24 +11084,24 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><figure><title> -#: ../en/ch08-undo.xml:361 ../en/ch08-undo.xml:473 +#: ../en/ch09-undo.xml:340 ../en/ch09-undo.xml:460 msgid "" "Backing out a change using the <command role=\"hg-cmd\">hg backout</command> " "command" msgstr "使用 <command role=\"hg-cmd\">hg backout</command> 恢复一个修改" #. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject> -#: ../en/ch08-undo.xml:364 +#: ../en/ch09-undo.xml:343 msgid "<imageobject><imagedata fileref=\"figs/undo-simple.png\"/></imageobject>" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch08-undo.xml:371 +#: ../en/ch09-undo.xml:350 msgid "Backing out a non-tip change" msgstr "恢复非顶点的修改" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:373 +#: ../en/ch09-undo.xml:352 msgid "" "If you want to back out a change other than the last one you committed, pass " "the <option role=\"hg-opt-backout\">--merge</option> option to the <command " @@ -9140,14 +11109,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:380 +#: ../en/ch09-undo.xml:359 msgid "" "This makes backing out any changeset a <quote>one-shot</quote> operation " "that's usually simple and fast." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:386 +#: ../en/ch09-undo.xml:365 msgid "" "If you take a look at the contents of <filename>myfile</filename> after the " "backout finishes, you'll see that the first and third changes are present, " @@ -9155,53 +11124,58 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:393 +#: ../en/ch09-undo.xml:372 msgid "" "As the graphical history in <xref linkend=\"fig:undo:backout-non-tip\"/> " -"illustrates, Mercurial actually commits <emphasis>two</emphasis> changes in " -"this kind of situation (the box-shaped nodes are the ones that Mercurial " -"commits automatically). Before Mercurial begins the backout process, it " -"first remembers what the current parent of the working directory is. It then " -"backs out the target changeset, and commits that as a changeset. Finally, it " -"merges back to the previous parent of the working directory, and commits the " -"result of the merge." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:404 -msgid "" -"% TODO: to me it looks like mercurial doesn't commit the second merge " -"automatically!" +"illustrates, Mercurial still commits one change in this kind of situation " +"(the box-shaped node is the ones that Mercurial commits automatically), but " +"the revision graph now looks different. Before Mercurial begins the backout " +"process, it first remembers what the current parent of the working directory " +"is. It then backs out the target changeset, and commits that as a " +"changeset. Finally, it merges back to the previous parent of the working " +"directory, but notice that it <emphasis>does not commit</emphasis> the result " +"of the merge. The repository now contains two heads, and the working " +"directory is in a merge state." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><figure><title> -#: ../en/ch08-undo.xml:408 +#: ../en/ch09-undo.xml:387 msgid "" "Automated backout of a non-tip change using the <command role=\"hg-cmd\">hg " "backout</command> command" msgstr "使用 <command role=\"hg-cmd\">hg backout</command> 自动恢复非顶点的修改" #. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject> -#: ../en/ch08-undo.xml:411 +#: ../en/ch09-undo.xml:390 msgid "" "<imageobject><imagedata fileref=\"figs/undo-non-tip.png\"/></imageobject>" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:416 +#: ../en/ch09-undo.xml:395 msgid "" "The result is that you end up <quote>back where you were</quote>, only with " "some extra history that undoes the effect of the changeset you wanted to back " "out." msgstr "" +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch09-undo.xml:399 +msgid "" +"You might wonder why Mercurial does not commit the result of the merge that " +"it performed. The reason lies in Mercurial behaving conservatively: a merge " +"naturally has more scope for error than simply undoing the effect of the tip " +"changeset, so your work will be safest if you first inspect (and test!) the " +"result of the merge, <emphasis>then</emphasis> commit it." +msgstr "" + #. type: Content of: <book><chapter><sect1><sect2><sect3><title> -#: ../en/ch08-undo.xml:421 +#: ../en/ch09-undo.xml:408 msgid "Always use the <option role=\"hg-opt-backout\">--merge</option> option" msgstr "始终使用选项 <option role=\"hg-opt-backout\">--merge</option>" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch08-undo.xml:424 +#: ../en/ch09-undo.xml:411 msgid "" "In fact, since the <option role=\"hg-opt-backout\">--merge</option> option " "will do the <quote>right thing</quote> whether or not the changeset you're " @@ -9211,12 +11185,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch08-undo.xml:435 +#: ../en/ch09-undo.xml:422 msgid "Gaining more control of the backout process" msgstr "在恢复处理中获得更多控制" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:437 +#: ../en/ch09-undo.xml:424 msgid "" "While I've recommended that you always use the <option role=\"hg-opt-backout" "\">--merge</option> option when backing out a change, the <command role=\"hg-" @@ -9229,14 +11203,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:450 +#: ../en/ch09-undo.xml:437 msgid "" "As with our earlier example, We'll commit a third changeset, then back out " "its parent, and see what happens." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:456 +#: ../en/ch09-undo.xml:443 msgid "" "Our new changeset is again a descendant of the changeset we backout out; it's " "thus a new head, <emphasis>not</emphasis> a descendant of the changeset that " @@ -9245,7 +11219,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:464 +#: ../en/ch09-undo.xml:451 msgid "" "Again, it's easier to see what has happened by looking at a graph of the " "revision history, in <xref linkend=\"fig:undo:backout-manual\"/>. This makes " @@ -9255,12 +11229,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject> -#: ../en/ch08-undo.xml:476 +#: ../en/ch09-undo.xml:463 msgid "<imageobject><imagedata fileref=\"figs/undo-manual.png\"/></imageobject>" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:481 +#: ../en/ch09-undo.xml:468 msgid "" "After the <command role=\"hg-cmd\">hg backout</command> command has " "completed, it leaves the new <quote>backout</quote> changeset as the parent " @@ -9268,12 +11242,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:488 +#: ../en/ch09-undo.xml:475 msgid "Now we have two isolated sets of changes." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:492 +#: ../en/ch09-undo.xml:479 msgid "" "Let's think about what we expect to see as the contents of <filename>myfile</" "filename> now. The first change should be present, because we've never " @@ -9284,73 +11258,73 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:502 +#: ../en/ch09-undo.xml:489 msgid "" "To get the third change back into the file, we just do a normal merge of our " "two heads." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:507 +#: ../en/ch09-undo.xml:494 msgid "" "Afterwards, the graphical history of our repository looks like <xref linkend=" "\"fig:undo:backout-manual-merge\"/>." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><figure><title> -#: ../en/ch08-undo.xml:512 +#: ../en/ch09-undo.xml:499 msgid "Manually merging a backout change" msgstr "手工合并恢复修改" #. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject> -#: ../en/ch08-undo.xml:514 +#: ../en/ch09-undo.xml:501 msgid "" "<imageobject><imagedata fileref=\"figs/undo-manual-merge.png\"/></imageobject>" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch08-undo.xml:521 +#: ../en/ch09-undo.xml:508 msgid "Why <command role=\"hg-cmd\">hg backout</command> works as it does" msgstr "<command role=\"hg-cmd\">hg backout</command> 的内幕" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:524 +#: ../en/ch09-undo.xml:511 msgid "" "Here's a brief description of how the <command role=\"hg-cmd\">hg backout</" "command> command works." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch08-undo.xml:527 +#: ../en/ch09-undo.xml:514 msgid "" "It ensures that the working directory is <quote>clean</quote>, i.e. that the " "output of <command role=\"hg-cmd\">hg status</command> would be empty." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch08-undo.xml:531 +#: ../en/ch09-undo.xml:518 msgid "" "It remembers the current parent of the working directory. Let's call this " -"changeset <literal>orig</literal>" +"changeset <literal>orig</literal>." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch08-undo.xml:535 +#: ../en/ch09-undo.xml:522 msgid "" "It does the equivalent of a <command role=\"hg-cmd\">hg update</command> to " "sync the working directory to the changeset you want to back out. Let's call " -"this changeset <literal>backout</literal>" +"this changeset <literal>backout</literal>." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch08-undo.xml:540 +#: ../en/ch09-undo.xml:527 msgid "" "It finds the parent of that changeset. Let's call that changeset " "<literal>parent</literal>." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch08-undo.xml:543 +#: ../en/ch09-undo.xml:530 msgid "" "For each file that the <literal>backout</literal> changeset affected, it does " "the equivalent of a <command role=\"hg-cmd\">hg revert -r parent</command> on " @@ -9359,14 +11333,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch08-undo.xml:550 +#: ../en/ch09-undo.xml:537 msgid "" "It commits the result as a new changeset. This changeset has " "<literal>backout</literal> as its parent." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch08-undo.xml:554 +#: ../en/ch09-undo.xml:541 msgid "" "If you specify <option role=\"hg-opt-backout\">--merge</option> on the " "command line, it merges with <literal>orig</literal>, and commits the result " @@ -9374,7 +11348,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:560 +#: ../en/ch09-undo.xml:547 msgid "" "An alternative way to implement the <command role=\"hg-cmd\">hg backout</" "command> command would be to <command role=\"hg-cmd\">hg export</command> the " @@ -9385,7 +11359,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:570 +#: ../en/ch09-undo.xml:557 msgid "" "The reason that <command role=\"hg-cmd\">hg backout</command> does an update, " "a commit, a merge, and another commit is to give the merge machinery the best " @@ -9394,7 +11368,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:577 +#: ../en/ch09-undo.xml:564 msgid "" "If you're backing out a changeset that's 100 revisions back in your project's " "history, the chances that the <command>patch</command> command will be able " @@ -9409,12 +11383,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch08-undo.xml:594 +#: ../en/ch09-undo.xml:581 msgid "Changes that should never have been" msgstr "不该发生的修改" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:596 +#: ../en/ch09-undo.xml:583 msgid "" "Most of the time, the <command role=\"hg-cmd\">hg backout</command> command " "is exactly what you need if you want to undo the effects of a change. It " @@ -9423,7 +11397,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:602 +#: ../en/ch09-undo.xml:589 msgid "" "On rare occasions, though, you may find that you've committed a change that " "really should not be present in the repository at all. For example, it would " @@ -9435,7 +11409,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:611 +#: ../en/ch09-undo.xml:598 msgid "" "Before I discuss the options that you have if you commit a <quote>brown paper " "bag</quote> change (the kind that's so bad that you want to pull a brown " @@ -9444,7 +11418,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:616 +#: ../en/ch09-undo.xml:603 msgid "" "Since Mercurial treats history as accumulative&emdash;every change builds on " "top of all changes that preceded it&emdash;you generally can't just make " @@ -9456,7 +11430,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:625 +#: ../en/ch09-undo.xml:612 msgid "" "After you've pushed a bad change to another repository, you <emphasis>could</" "emphasis> still use <command role=\"hg-cmd\">hg rollback</command> to make " @@ -9466,18 +11440,18 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:633 +#: ../en/ch09-undo.xml:620 msgid "" "If a situation like this arises, and you know which repositories your bad " "change has propagated into, you can <emphasis>try</emphasis> to get rid of " -"the changeefrom <emphasis>every</emphasis> one of those repositories. This " +"the change from <emphasis>every</emphasis> one of those repositories. This " "is, of course, not a satisfactory solution: if you miss even a single " "repository while you're expunging, the change is still <quote>in the wild</" "quote>, and could propagate further." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:641 +#: ../en/ch09-undo.xml:628 msgid "" "If you've committed one or more changes <emphasis>after</emphasis> the change " "that you'd like to see disappear, your options are further reduced. Mercurial " @@ -9485,21 +11459,135 @@ "changesets intact." msgstr "" -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:647 -msgid "" -"XXX This needs filling out. The <literal>hg-replay</literal> script in the " -"<literal>examples</literal> directory works, but doesn't handle merge " -"changesets. Kind of an important omission." -msgstr "" - #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch08-undo.xml:653 +#: ../en/ch09-undo.xml:635 +msgid "Backing out a merge" +msgstr "撤销一个合并" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch09-undo.xml:637 +msgid "" +"Since merges are often complicated, it is not unheard of for a merge to be " +"mangled badly, but committed erroneously. Mercurial provides an important " +"safeguard against bad merges by refusing to commit unresolved files, but " +"human ingenuity guarantees that it is still possible to mess a merge up and " +"commit it." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch09-undo.xml:644 +msgid "" +"Given a bad merge that has been committed, usually the best way to approach " +"it is to simply try to repair the damage by hand. A complete disaster that " +"cannot be easily fixed up by hand ought to be very rare, but the <command " +"role=\"hg-cmd\">hg backout</command> command may help in making the cleanup " +"easier. It offers a <option role=\"hg-opt-backout\">--parent</option> option, " +"which lets you specify which parent to revert to when backing out a merge." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><figure><title> +#: ../en/ch09-undo.xml:655 +msgid "A bad merge" +msgstr "错误的合并" + +#. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject> +#: ../en/ch09-undo.xml:657 +msgid "<imageobject><imagedata fileref=\"figs/bad-merge-1.png\"/></imageobject>" +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch09-undo.xml:662 +msgid "" +"Suppose we have a revision graph like that in <xref linkend=\"fig:undo:bad-" +"merge-1\"/>. What we'd like is to <emphasis>redo</emphasis> the merge of " +"revisions 2 and 3." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch09-undo.xml:667 +msgid "One way to do so would be as follows." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> +#: ../en/ch09-undo.xml:671 +msgid "" +"Call <command role=\"hg-cmd\">hg backout --rev=4 --parent=2</command>. This " +"tells <command role=\"hg-cmd\">hg backout</command> to back out revision 4, " +"which is the bad merge, and to when deciding which revision to prefer, to " +"choose parent 2, one of the parents of the merge. The effect can be seen in " +"<xref linkend=\"fig:undo:bad-merge-2\"/>." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><figure><title> +#: ../en/ch09-undo.xml:679 +msgid "Backing out the merge, favoring one parent" +msgstr "拆除合并,关注一个父亲" + +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><figure><mediaobject> +#: ../en/ch09-undo.xml:681 +msgid "<imageobject><imagedata fileref=\"figs/bad-merge-2.png\"/></imageobject>" +msgstr "" +"<imageobject><imagedata fileref=\"figs/bad-merge-2.png\"/></imageobject>" + +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> +#: ../en/ch09-undo.xml:688 +msgid "" +"Call <command role=\"hg-cmd\">hg backout --rev=4 --parent=3</command>. This " +"tells <command role=\"hg-cmd\">hg backout</command> to back out revision 4 " +"again, but this time to choose parent 3, the other parent of the merge. The " +"result is visible in <xref linkend=\"fig:undo:bad-merge-3\"/>, in which the " +"repository now contains three heads." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><figure><title> +#: ../en/ch09-undo.xml:696 +msgid "Backing out the merge, favoring the other parent" +msgstr "拆除合并,关注其它父亲" + +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><figure><mediaobject> +#: ../en/ch09-undo.xml:699 +msgid "<imageobject><imagedata fileref=\"figs/bad-merge-3.png\"/></imageobject>" +msgstr "" +"<imageobject><imagedata fileref=\"figs/bad-merge-3.png\"/></imageobject>" + +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> +#: ../en/ch09-undo.xml:706 +msgid "" +"Redo the bad merge by merging the two backout heads, which reduces the number " +"of heads in the repository to two, as can be seen in <xref linkend=\"fig:undo:" +"bad-merge-4\"/>." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><figure><title> +#: ../en/ch09-undo.xml:711 ../en/ch09-undo.xml:724 +msgid "Merging the backouts" +msgstr "合并拆除" + +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><figure><mediaobject> +#: ../en/ch09-undo.xml:713 +msgid "<imageobject><imagedata fileref=\"figs/bad-merge-4.png\"/></imageobject>" +msgstr "" +"<imageobject><imagedata fileref=\"figs/bad-merge-4.png\"/></imageobject>" + +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> +#: ../en/ch09-undo.xml:720 +msgid "" +"Merge with the commit that was made after the bad merge, as shown in <xref " +"linkend=\"fig:undo:bad-merge-5\"/>." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><figure><mediaobject> +#: ../en/ch09-undo.xml:726 +msgid "<imageobject><imagedata fileref=\"figs/bad-merge-5.png\"/></imageobject>" +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><title> +#: ../en/ch09-undo.xml:735 msgid "Protect yourself from <quote>escaped</quote> changes" msgstr "使用<quote>校验</quote>修改来保护你自己" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:656 +#: ../en/ch09-undo.xml:738 msgid "" "If you've committed some changes to your local repository and they've been " "pushed or pulled somewhere else, this isn't necessarily a disaster. You can " @@ -9509,7 +11597,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:663 +#: ../en/ch09-undo.xml:745 msgid "" "By configuring some hooks on that repository to validate incoming changesets " "(see chapter <xref linkend=\"chap:hook\"/>), you can automatically prevent " @@ -9521,20 +11609,83 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:673 +#: ../en/ch09-undo.xml:755 msgid "" "For instance, an incoming change hook that verifies that a changeset will " -"actually compile can prevent people from inadvertantly <quote>breaking the " +"actually compile can prevent people from inadvertently <quote>breaking the " "build</quote>." msgstr "" +#. type: Content of: <book><chapter><sect1><sect2><title> +#: ../en/ch09-undo.xml:762 +msgid "What to do about sensitive changes that escape" +msgstr "处理敏感信息泄漏的方法" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch09-undo.xml:764 +msgid "" +"Even a carefully run project can suffer an unfortunate event such as the " +"committing and uncontrolled propagation of a file that contains important " +"passwords." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch09-undo.xml:768 +msgid "" +"If something like this happens to you, and the information that gets " +"accidentally propagated is truly sensitive, your first step should be to " +"mitigate the effect of the leak without trying to control the leak itself. If " +"you are not 100% certain that you know exactly who could have seen the " +"changes, you should immediately change passwords, cancel credit cards, or " +"find some other way to make sure that the information that has leaked is no " +"longer useful. In other words, assume that the change has propagated far and " +"wide, and that there's nothing more you can do." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch09-undo.xml:779 +msgid "" +"You might hope that there would be mechanisms you could use to either figure " +"out who has seen a change or to erase the change permanently everywhere, but " +"there are good reasons why these are not possible." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch09-undo.xml:784 +msgid "" +"Mercurial does not provide an audit trail of who has pulled changes from a " +"repository, because it is usually either impossible to record such " +"information or trivial to spoof it. In a multi-user or networked " +"environment, you should thus be extremely skeptical of yourself if you think " +"that you have identified every place that a sensitive changeset has " +"propagated to. Don't forget that people can and will send bundles by email, " +"have their backup software save data offsite, carry repositories on USB " +"sticks, and find other completely innocent ways to confound your attempts to " +"track down every copy of a problematic change." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch09-undo.xml:796 +msgid "" +"Mercurial also does not provide a way to make a file or changeset completely " +"disappear from history, because there is no way to enforce its disappearance; " +"someone could easily modify their copy of Mercurial to ignore such " +"directives. In addition, even if Mercurial provided such a capability, " +"someone who simply hadn't pulled a <quote>make this file disappear</quote> " +"changeset wouldn't be affected by it, nor would web crawlers visiting at the " +"wrong time, disk backups, or other mechanisms. Indeed, no distributed " +"revision control system can make data reliably vanish. Providing the illusion " +"of such control could easily give a false sense of security, and be worse " +"than not providing it at all." +msgstr "" + #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch08-undo.xml:680 +#: ../en/ch09-undo.xml:812 msgid "Finding the source of a bug" msgstr "查找问题的根源" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:682 +#: ../en/ch09-undo.xml:814 msgid "" "While it's all very well to be able to back out a changeset that introduced a " "bug, this requires that you know which changeset to back out. Mercurial " @@ -9544,26 +11695,25 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:689 +#: ../en/ch09-undo.xml:821 msgid "" "The idea behind the <command role=\"hg-cmd\">hg bisect</command> command is " -"that a changeset has introduced some change of behaviour that you can " -"identify with a simple binary test. You don't know which piece of code " -"introduced the change, but you know how to test for the presence of the bug. " -"The <command role=\"hg-cmd\">hg bisect</command> command uses your test to " -"direct its search for the changeset that introduced the code that caused the " -"bug." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:698 +"that a changeset has introduced some change of behavior that you can identify " +"with a simple pass/fail test. You don't know which piece of code introduced " +"the change, but you know how to test for the presence of the bug. The " +"<command role=\"hg-cmd\">hg bisect</command> command uses your test to direct " +"its search for the changeset that introduced the code that caused the bug." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch09-undo.xml:830 msgid "" "Here are a few scenarios to help you understand how you might apply this " "command." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch08-undo.xml:701 +#: ../en/ch09-undo.xml:833 msgid "" "The most recent version of your software has a bug that you remember wasn't " "present a few weeks ago, but you don't know when it was introduced. Here, " @@ -9571,7 +11721,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch08-undo.xml:706 +#: ../en/ch09-undo.xml:838 msgid "" "You fixed a bug in a rush, and now it's time to close the entry in your " "team's bug database. The bug database requires a changeset ID when you close " @@ -9580,7 +11730,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch08-undo.xml:713 +#: ../en/ch09-undo.xml:845 msgid "" "Your software works correctly, but runs 15% slower than the last time you " "measured it. You want to know which changeset introduced the performance " @@ -9589,14 +11739,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch08-undo.xml:720 +#: ../en/ch09-undo.xml:852 msgid "" "The sizes of the components of your project that you ship exploded recently, " "and you suspect that something changed in the way you build your project." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:725 +#: ../en/ch09-undo.xml:857 msgid "" "From these examples, it should be clear that the <command role=\"hg-cmd\">hg " "bisect</command> command is not useful only for finding the sources of bugs. " @@ -9606,7 +11756,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:732 +#: ../en/ch09-undo.xml:864 msgid "" "We'll introduce a little bit of terminology here, just to make it clear which " "parts of the search process are your responsibility, and which are " @@ -9620,7 +11770,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:745 +#: ../en/ch09-undo.xml:877 msgid "" "One simple way to automate the searching process would be simply to probe " "every changeset. However, this scales poorly. If it took ten minutes to " @@ -9633,7 +11783,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:755 +#: ../en/ch09-undo.xml:887 msgid "" "What the <command role=\"hg-cmd\">hg bisect</command> command does is use its " "knowledge of the <quote>shape</quote> of your project's revision history to " @@ -9646,7 +11796,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch08-undo.xml:766 +#: ../en/ch09-undo.xml:898 msgid "" "The <command role=\"hg-cmd\">hg bisect</command> command is aware of the " "<quote>branchy</quote> nature of a Mercurial project's revision history, so " @@ -9656,18 +11806,18 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch08-undo.xml:774 +#: ../en/ch09-undo.xml:906 msgid "Using the <command role=\"hg-cmd\">hg bisect</command> command" msgstr "使用命令 <command role=\"hg-cmd\">hg bisect</command>" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:777 +#: ../en/ch09-undo.xml:909 msgid "" "Here's an example of <command role=\"hg-cmd\">hg bisect</command> in action." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><note><para> -#: ../en/ch08-undo.xml:781 +#: ../en/ch09-undo.xml:913 msgid "" "In versions 0.9.5 and earlier of Mercurial, <command role=\"hg-cmd\">hg " "bisect</command> was not a core command: it was distributed with Mercurial as " @@ -9676,14 +11826,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:788 +#: ../en/ch09-undo.xml:920 msgid "" "Now let's create a repository, so that we can try out the <command role=\"hg-" "cmd\">hg bisect</command> command in isolation." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:794 +#: ../en/ch09-undo.xml:926 msgid "" "We'll simulate a project that has a bug in it in a simple-minded way: create " "trivial changes in a loop, and nominate one specific change that will have " @@ -9693,7 +11843,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:804 +#: ../en/ch09-undo.xml:936 msgid "" "The next thing that we'd like to do is figure out how to use the <command " "role=\"hg-cmd\">hg bisect</command> command. We can use Mercurial's normal " @@ -9701,46 +11851,49 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:811 +#: ../en/ch09-undo.xml:943 msgid "" "The <command role=\"hg-cmd\">hg bisect</command> command works in steps. " "Each step proceeds as follows." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch08-undo.xml:814 +#: ../en/ch09-undo.xml:946 msgid "You run your binary test." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><itemizedlist><listitem><para> -#: ../en/ch08-undo.xml:816 +#: ../en/ch09-undo.xml:948 msgid "" "If the test succeeded, you tell <command role=\"hg-cmd\">hg bisect</command> " -"by running the <command role=\"hg-cmd\">hg bisect good</command> command." -msgstr "" +"by running the <command role=\"hg-cmd\">hg bisect --good</command> command." +msgstr "" +"当测试成功后,使用 <command role=\"hg-cmd\">hg bisect --good</command> 命令告" +"诉 <command role=\"hg-cmd\">hg bisect</command> 命令。" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><itemizedlist><listitem><para> -#: ../en/ch08-undo.xml:821 -msgid "" -"If it failed, run the <command role=\"hg-cmd\">hg bisect bad</command> " +#: ../en/ch09-undo.xml:953 +msgid "" +"If it failed, run the <command role=\"hg-cmd\">hg bisect --bad</command> " "command." msgstr "" +"如果失败,执行 <command role=\"hg-cmd\">hg bisect --bad</command> 命令。" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch08-undo.xml:825 +#: ../en/ch09-undo.xml:957 msgid "" "The command uses your information to decide which changeset to test next." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para> -#: ../en/ch08-undo.xml:828 +#: ../en/ch09-undo.xml:960 msgid "" "It updates the working directory to that changeset, and the process begins " "again." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:831 +#: ../en/ch09-undo.xml:963 msgid "" "The process ends when <command role=\"hg-cmd\">hg bisect</command> identifies " "a unique changeset that marks the point where your test transitioned from " @@ -9749,14 +11902,14 @@ # #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:836 +#: ../en/ch09-undo.xml:968 msgid "" "To start the search, we must run the <command role=\"hg-cmd\">hg bisect --" "reset</command> command." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:841 +#: ../en/ch09-undo.xml:973 msgid "" "In our case, the binary test we use is simple: we check to see if any file in " "the repository contains the string <quote>i have a gub</quote>. If it does, " @@ -9766,7 +11919,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:849 +#: ../en/ch09-undo.xml:981 msgid "" "Most of the time, the revision to which the working directory is synced " "(usually the tip) already exhibits the problem introduced by the buggy " @@ -9775,7 +11928,7 @@ # #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:856 +#: ../en/ch09-undo.xml:988 msgid "" "Our next task is to nominate a changeset that we know <emphasis>doesn't</" "emphasis> have the bug; the <command role=\"hg-cmd\">hg bisect</command> " @@ -9786,26 +11939,26 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:866 +#: ../en/ch09-undo.xml:998 msgid "Notice that this command printed some output." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch08-undo.xml:868 +#: ../en/ch09-undo.xml:1000 msgid "" "It told us how many changesets it must consider before it can identify the " "one that introduced the bug, and how many tests that will require." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch08-undo.xml:872 +#: ../en/ch09-undo.xml:1004 msgid "" "It updated the working directory to the next changeset to test, and told us " "which changeset it's testing." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:877 +#: ../en/ch09-undo.xml:1009 msgid "" "We now run our test in the working directory. We use the <command>grep</" "command> command to see if our <quote>bad</quote> file is present in the " @@ -9814,26 +11967,26 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:883 +#: ../en/ch09-undo.xml:1015 msgid "" "This test looks like a perfect candidate for automation, so let's turn it " "into a shell function." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:887 +#: ../en/ch09-undo.xml:1019 msgid "" "We can now run an entire test step with a single command, <literal>mytest</" "literal>." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:892 +#: ../en/ch09-undo.xml:1024 msgid "A few more invocations of our canned test step command, and we're done." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:897 +#: ../en/ch09-undo.xml:1029 msgid "" "Even though we had 40 changesets to search through, the <command role=\"hg-cmd" "\">hg bisect</command> command let us find the changeset that introduced our " @@ -9845,35 +11998,34 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch08-undo.xml:908 +#: ../en/ch09-undo.xml:1040 msgid "Cleaning up after your search" msgstr "搜索后的清理" -# -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:910 +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch09-undo.xml:1042 msgid "" "When you're finished using the <command role=\"hg-cmd\">hg bisect</command> " -"command in a repository, you can use the <command role=\"hg-cmd\">hg bisect " +"command in a repository, you can use the <command role=\"hg-cmd\">hg bisect --" "reset</command> command to drop the information it was using to drive your " "search. The command doesn't use much space, so it doesn't matter if you " "forget to run this command. However, <command role=\"hg-cmd\">hg bisect</" "command> won't let you start a new search in that repository until you do a " -"<command role=\"hg-cmd\">hg bisect reset</command>." +"<command role=\"hg-cmd\">hg bisect --reset</command>." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch08-undo.xml:925 +#: ../en/ch09-undo.xml:1057 msgid "Tips for finding bugs effectively" msgstr "有效查找问题的技巧" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch08-undo.xml:928 +#: ../en/ch09-undo.xml:1060 msgid "Give consistent input" msgstr "给出一致的输入" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:930 +#: ../en/ch09-undo.xml:1062 msgid "" "The <command role=\"hg-cmd\">hg bisect</command> command requires that you " "correctly report the result of every test you perform. If you tell it that a " @@ -9885,12 +12037,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch08-undo.xml:942 +#: ../en/ch09-undo.xml:1074 msgid "Automate as much as possible" msgstr "尽量自动" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:944 +#: ../en/ch09-undo.xml:1076 msgid "" "When I started using the <command role=\"hg-cmd\">hg bisect</command> " "command, I tried a few times to run my tests by hand, on the command line. " @@ -9900,7 +12052,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:952 +#: ../en/ch09-undo.xml:1084 msgid "" "My initial problems with driving the <command role=\"hg-cmd\">hg bisect</" "command> command by hand occurred even with simple searches on small " @@ -9911,24 +12063,24 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:961 +#: ../en/ch09-undo.xml:1093 msgid "The key to automated testing is twofold:" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch08-undo.xml:963 +#: ../en/ch09-undo.xml:1095 msgid "always test for the same symptom, and" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch08-undo.xml:965 +#: ../en/ch09-undo.xml:1097 msgid "" "always feed consistent input to the <command role=\"hg-cmd\">hg bisect</" "command> command." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:968 +#: ../en/ch09-undo.xml:1100 msgid "" "In my tutorial example above, the <command>grep</command> command tests for " "the symptom, and the <literal>if</literal> statement takes the result of this " @@ -9939,12 +12091,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch08-undo.xml:978 +#: ../en/ch09-undo.xml:1110 msgid "Check your results" msgstr "检查你的结果" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:980 +#: ../en/ch09-undo.xml:1112 msgid "" "Because the output of a <command role=\"hg-cmd\">hg bisect</command> search " "is only as good as the input you give it, don't take the changeset it reports " @@ -9953,32 +12105,32 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch08-undo.xml:986 +#: ../en/ch09-undo.xml:1118 msgid "" "The changeset that it reports as the first bad revision. Your test should " "still report this as bad." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch08-undo.xml:990 +#: ../en/ch09-undo.xml:1122 msgid "" "The parent of that changeset (either parent, if it's a merge). Your test " "should report this changeset as good." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch08-undo.xml:994 +#: ../en/ch09-undo.xml:1126 msgid "" "A child of that changeset. Your test should report this changeset as bad." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch08-undo.xml:1000 +#: ../en/ch09-undo.xml:1132 msgid "Beware interference between bugs" msgstr "谨防问题之间的冲突" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:1002 +#: ../en/ch09-undo.xml:1134 msgid "" "It's possible that your search for one bug could be disrupted by the presence " "of another. For example, let's say your software crashes at revision 100, " @@ -9988,7 +12140,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:1010 +#: ../en/ch09-undo.xml:1142 msgid "" "It is possible that this other bug completely <quote>masks</quote> yours, " "which is to say that it occurs before your bug has a chance to manifest " @@ -10000,7 +12152,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:1020 +#: ../en/ch09-undo.xml:1152 msgid "" "A different problem could arise if your test for a bug's presence is not " "specific enough. If you check for <quote>my program crashes</quote>, then " @@ -10009,7 +12161,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:1027 +#: ../en/ch09-undo.xml:1159 msgid "" "Another useful situation in which to use <command role=\"hg-cmd\">hg bisect --" "skip</command> is if you can't test a revision because your project was in a " @@ -10018,12 +12170,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch08-undo.xml:1036 +#: ../en/ch09-undo.xml:1168 msgid "Bracket your search lazily" msgstr "减少你的查找工作" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:1038 +#: ../en/ch09-undo.xml:1170 msgid "" "Choosing the first <quote>good</quote> and <quote>bad</quote> changesets that " "will mark the end points of your search is often easy, but it bears a little " @@ -10033,7 +12185,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:1046 +#: ../en/ch09-undo.xml:1178 msgid "" "If you're having trouble remembering when a suitable <quote>good</quote> " "change was, so that you can tell <command role=\"hg-cmd\">hg bisect</" @@ -10044,21 +12196,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch08-undo.xml:1055 +#: ../en/ch09-undo.xml:1187 msgid "" "Even if you end up <quote>early</quote> by thousands of changesets or months " "of history, you will only add a handful of tests to the total number that " "<command role=\"hg-cmd\">hg bisect</command> must perform, thanks to its " -"logarithmic behaviour." +"logarithmic behavior." msgstr "" #. type: Content of: <book><chapter><title> -#: ../en/ch09-hook.xml:5 +#: ../en/ch10-hook.xml:5 msgid "Handling repository events with hooks" msgstr "使用钩子处理版本库事件" #. type: Content of: <book><chapter><para> -#: ../en/ch09-hook.xml:7 +#: ../en/ch10-hook.xml:7 msgid "" "Mercurial offers a powerful mechanism to let you perform automated actions in " "response to events that occur in a repository. In some cases, you can even " @@ -10066,7 +12218,7 @@ msgstr "" #. type: Content of: <book><chapter><para> -#: ../en/ch09-hook.xml:12 +#: ../en/ch10-hook.xml:12 msgid "" "The name Mercurial uses for one of these actions is a <emphasis>hook</" "emphasis>. Hooks are called <quote>triggers</quote> in some revision control " @@ -10074,33 +12226,42 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch09-hook.xml:18 +#: ../en/ch10-hook.xml:18 msgid "An overview of hooks in Mercurial" msgstr "Mercurial 钩子概述" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch09-hook.xml:20 +#: ../en/ch10-hook.xml:20 msgid "" "Here is a brief list of the hooks that Mercurial supports. We will revisit " "each of these hooks in more detail later, in <xref linkend=\"sec:hook:ref\"/>." msgstr "" +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch10-hook.xml:24 +msgid "" +"Each of the hooks whose description begins with the word <quote>Controlling</" +"quote> has the ability to determine whether an activity can proceed. If the " +"hook succeeds, the activity may proceed; if it fails, the activity is either " +"not permitted or undone, depending on the hook." +msgstr "" + #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:25 +#: ../en/ch10-hook.xml:31 msgid "" "<literal role=\"hook\">changegroup</literal>: This is run after a group of " "changesets has been brought into the repository from elsewhere." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:29 +#: ../en/ch10-hook.xml:35 msgid "" "<literal role=\"hook\">commit</literal>: This is run after a new changeset " "has been created in the local repository." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:33 +#: ../en/ch10-hook.xml:39 msgid "" "<literal role=\"hook\">incoming</literal>: This is run once for each new " "changeset that is brought into the repository from elsewhere. Notice the " @@ -10109,42 +12270,42 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:40 +#: ../en/ch10-hook.xml:46 msgid "" "<literal role=\"hook\">outgoing</literal>: This is run after a group of " "changesets has been transmitted from this repository." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:44 +#: ../en/ch10-hook.xml:50 msgid "" "<literal role=\"hook\">prechangegroup</literal>: This is run before starting " "to bring a group of changesets into the repository." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:49 +#: ../en/ch10-hook.xml:55 msgid "" "<literal role=\"hook\">precommit</literal>: Controlling. This is run before " "starting a commit." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:53 +#: ../en/ch10-hook.xml:59 msgid "" "<literal role=\"hook\">preoutgoing</literal>: Controlling. This is run before " "starting to transmit a group of changesets from this repository." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:58 +#: ../en/ch10-hook.xml:64 msgid "" "<literal role=\"hook\">pretag</literal>: Controlling. This is run before " "creating a tag." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:62 +#: ../en/ch10-hook.xml:68 msgid "" "<literal role=\"hook\">pretxnchangegroup</literal>: Controlling. This is run " "after a group of changesets has been brought into the local repository from " @@ -10153,7 +12314,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:70 +#: ../en/ch10-hook.xml:76 msgid "" "<literal role=\"hook\">pretxncommit</literal>: Controlling. This is run after " "a new changeset has been created in the local repository, but before the " @@ -10161,46 +12322,37 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:76 +#: ../en/ch10-hook.xml:82 msgid "" "<literal role=\"hook\">preupdate</literal>: Controlling. This is run before " "starting an update or merge of the working directory." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:81 +#: ../en/ch10-hook.xml:87 msgid "" "<literal role=\"hook\">tag</literal>: This is run after a tag is created." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:85 +#: ../en/ch10-hook.xml:91 msgid "" "<literal role=\"hook\">update</literal>: This is run after an update or merge " "of the working directory has finished." msgstr "" -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch09-hook.xml:90 -msgid "" -"Each of the hooks whose description begins with the word <quote>Controlling</" -"quote> has the ability to determine whether an activity can proceed. If the " -"hook succeeds, the activity may proceed; if it fails, the activity is either " -"not permitted or undone, depending on the hook." -msgstr "" - #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch09-hook.xml:99 +#: ../en/ch10-hook.xml:99 msgid "Hooks and security" msgstr "钩子与安全性" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:102 +#: ../en/ch10-hook.xml:102 msgid "Hooks are run with your privileges" msgstr "钩子以你的特权执行" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:104 +#: ../en/ch10-hook.xml:104 msgid "" "When you run a Mercurial command in a repository, and the command causes a " "hook to run, that hook runs on <emphasis>your</emphasis> system, under " @@ -10211,7 +12363,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:115 +#: ../en/ch10-hook.xml:115 msgid "" "In some cases, you may be exposed to hooks that you did not install " "yourself. If you work with Mercurial on an unfamiliar system, Mercurial will " @@ -10220,7 +12372,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:122 +#: ../en/ch10-hook.xml:122 msgid "" "If you are working with a repository owned by another user, Mercurial can run " "hooks defined in that user's repository, but it will still run them as " @@ -10232,7 +12384,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><note><para> -#: ../en/ch09-hook.xml:134 +#: ../en/ch10-hook.xml:134 msgid "" "This only applies if you are pulling from a repository on a local or network " "filesystem. If you're pulling over http or ssh, any <literal role=\"hook" @@ -10241,10 +12393,10 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:142 -msgid "" -"XXX To see what hooks are defined in a repository, use the <command role=\"hg-" -"cmd\">hg config hooks</command> command. If you are working in one " +#: ../en/ch10-hook.xml:142 +msgid "" +"To see what hooks are defined in a repository, use the <command role=\"hg-cmd" +"\">hg showconfig hooks</command> command. If you are working in one " "repository, but talking to another that you do not own (e.g. using <command " "role=\"hg-cmd\">hg pull</command> or <command role=\"hg-cmd\">hg incoming</" "command>), remember that it is the other repository's hooks you should be " @@ -10252,12 +12404,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:153 +#: ../en/ch10-hook.xml:153 msgid "Hooks do not propagate" msgstr "钩子不会传播" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:155 +#: ../en/ch10-hook.xml:155 msgid "" "In Mercurial, hooks are not revision controlled, and do not propagate when " "you clone, or pull from, a repository. The reason for this is simple: a hook " @@ -10266,7 +12418,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:162 +#: ../en/ch10-hook.xml:162 msgid "" "It would be extremely reckless for any distributed revision control system to " "implement revision-controlled hooks, as this would offer an easily " @@ -10275,7 +12427,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:168 +#: ../en/ch10-hook.xml:168 msgid "" "Since Mercurial does not propagate hooks, if you are collaborating with other " "people on a common project, you should not assume that they are using the " @@ -10284,7 +12436,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:175 +#: ../en/ch10-hook.xml:175 msgid "" "In a corporate intranet, this is somewhat easier to control, as you can for " "example provide a <quote>standard</quote> installation of Mercurial on an NFS " @@ -10294,20 +12446,20 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:184 +#: ../en/ch10-hook.xml:184 msgid "Hooks can be overridden" msgstr "钩子可以被覆盖" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:186 +#: ../en/ch10-hook.xml:186 msgid "" "Mercurial allows you to override a hook definition by redefining the hook. " "You can disable it by setting its value to the empty string, or change its " -"behaviour as you wish." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:191 +"behavior as you wish." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch10-hook.xml:191 msgid "" "If you deploy a system- or site-wide <filename role=\"special\">~/.hgrc</" "filename> file that defines some hooks, you should thus understand that your " @@ -10315,12 +12467,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:199 +#: ../en/ch10-hook.xml:199 msgid "Ensuring that critical hooks are run" msgstr "确保关键钩子的执行" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:201 +#: ../en/ch10-hook.xml:201 msgid "" "Sometimes you may want to enforce a policy that you do not want others to be " "able to work around. For example, you may have a requirement that every " @@ -10331,7 +12483,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:210 +#: ../en/ch10-hook.xml:210 msgid "" "Instead, you can set up your policies for use of Mercurial so that people are " "expected to propagate changes through a well-known <quote>canonical</quote> " @@ -10339,7 +12491,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:216 +#: ../en/ch10-hook.xml:216 msgid "" "One way to do this is via a combination of social engineering and " "technology. Set up a restricted-access account; users can push changes over " @@ -10349,7 +12501,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:225 +#: ../en/ch10-hook.xml:225 msgid "" "When someone pushes a changeset to the server that everyone pulls from, the " "server will test the changeset before it accepts it as permanent, and reject " @@ -10359,144 +12511,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch09-hook.xml:236 -msgid "Care with <literal>pretxn</literal> hooks in a shared-access repository" -msgstr "在共享版本库中注意 <literal>pretxn</literal> 钩子" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch09-hook.xml:239 -msgid "" -"If you want to use hooks to do some automated work in a repository that a " -"number of people have shared access to, you need to be careful in how you do " -"this." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch09-hook.xml:244 -msgid "" -"Mercurial only locks a repository when it is writing to the repository, and " -"only the parts of Mercurial that write to the repository pay attention to " -"locks. Write locks are necessary to prevent multiple simultaneous writers " -"from scribbling on each other's work, corrupting the repository." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch09-hook.xml:251 -msgid "" -"Because Mercurial is careful with the order in which it reads and writes " -"data, it does not need to acquire a lock when it wants to read data from the " -"repository. The parts of Mercurial that read from the repository never pay " -"attention to locks. This lockless reading scheme greatly increases " -"performance and concurrency." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch09-hook.xml:259 -msgid "" -"With great performance comes a trade-off, though, one which has the potential " -"to cause you trouble unless you're aware of it. To describe this requires a " -"little detail about how Mercurial adds changesets to a repository and reads " -"those changes." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch09-hook.xml:266 -msgid "" -"When Mercurial <emphasis>writes</emphasis> metadata, it writes it straight " -"into the destination file. It writes file data first, then manifest data " -"(which contains pointers to the new file data), then changelog data (which " -"contains pointers to the new manifest data). Before the first write to each " -"file, it stores a record of where the end of the file was in its transaction " -"log. If the transaction must be rolled back, Mercurial simply truncates each " -"file back to the size it was before the transaction began." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch09-hook.xml:277 -msgid "" -"When Mercurial <emphasis>reads</emphasis> metadata, it reads the changelog " -"first, then everything else. Since a reader will only access parts of the " -"manifest or file metadata that it can see in the changelog, it can never see " -"partially written data." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch09-hook.xml:283 -msgid "" -"Some controlling hooks (<literal role=\"hook\">pretxncommit</literal> and " -"<literal role=\"hook\">pretxnchangegroup</literal>) run when a transaction is " -"almost complete. All of the metadata has been written, but Mercurial can " -"still roll the transaction back and cause the newly-written data to disappear." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch09-hook.xml:291 -msgid "" -"If one of these hooks runs for long, it opens a window of time during which a " -"reader can see the metadata for changesets that are not yet permanent, and " -"should not be thought of as <quote>really there</quote>. The longer the hook " -"runs, the longer that window is open." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:299 -msgid "The problem illustrated" -msgstr "问题的演示" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:301 -msgid "" -"In principle, a good use for the <literal role=\"hook\">pretxnchangegroup</" -"literal> hook would be to automatically build and test incoming changes " -"before they are accepted into a central repository. This could let you " -"guarantee that nobody can push changes to this repository that <quote>break " -"the build</quote>. But if a client can pull changes while they're being " -"tested, the usefulness of the test is zero; an unsuspecting someone can pull " -"untested changes, potentially breaking their build." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:312 -msgid "" -"The safest technological answer to this challenge is to set up such a " -"<quote>gatekeeper</quote> repository as <emphasis>unidirectional</emphasis>. " -"Let it take changes pushed in from the outside, but do not allow anyone to " -"pull changes from it (use the <literal role=\"hook\">preoutgoing</literal> " -"hook to lock it down). Configure a <literal role=\"hook\">changegroup</" -"literal> hook so that if a build or test succeeds, the hook will push the new " -"changes out to another repository that people <emphasis>can</emphasis> pull " -"from." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:324 -msgid "" -"In practice, putting a centralised bottleneck like this in place is not often " -"a good idea, and transaction visibility has nothing to do with the problem. " -"As the size of a project&emdash;and the time it takes to build and " -"test&emdash;grows, you rapidly run into a wall with this <quote>try before " -"you buy</quote> approach, where you have more changesets to test than time in " -"which to deal with them. The inevitable result is frustration on the part of " -"all involved." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:335 -msgid "" -"An approach that scales better is to get people to build and test before they " -"push, then run automated builds and tests centrally <emphasis>after</" -"emphasis> a push, to be sure all is well. The advantage of this approach is " -"that it does not impose a limit on the rate at which the repository can " -"accept changes." -msgstr "" - -#. type: Content of: <book><chapter><sect1><title> -#: ../en/ch09-hook.xml:346 +#: ../en/ch10-hook.xml:237 msgid "A short tutorial on using hooks" msgstr "使用钩子的简短指南" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch09-hook.xml:348 +#: ../en/ch10-hook.xml:239 msgid "" "It is easy to write a Mercurial hook. Let's start with a hook that runs when " "you finish a <command role=\"hg-cmd\">hg commit</command>, and simply prints " @@ -10505,12 +12525,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch09-hook.xml:355 +#: ../en/ch10-hook.xml:246 msgid "All hooks follow the pattern in this example." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch09-hook.xml:359 +#: ../en/ch10-hook.xml:250 msgid "" "You add an entry to the <literal role=\"rc-hooks\">hooks</literal> section of " "your <filename role=\"special\">~/.hgrc</filename>. On the left is the name " @@ -10521,19 +12541,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:369 +#: ../en/ch10-hook.xml:260 msgid "Performing multiple actions per event" msgstr "每个事件执行多个操作" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:371 +#: ../en/ch10-hook.xml:262 msgid "" "Quite often, you will want to define more than one hook for a particular kind " "of event, as shown below." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:376 +#: ../en/ch10-hook.xml:267 msgid "" "Mercurial lets you do this by adding an <emphasis>extension</emphasis> to the " "end of a hook's name. You extend a hook's name by giving the name of the " @@ -10544,7 +12564,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:387 +#: ../en/ch10-hook.xml:278 msgid "" "To give a well-defined order of execution when there are multiple hooks " "defined for an event, Mercurial sorts hooks by extension, and executes the " @@ -10554,7 +12574,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:396 +#: ../en/ch10-hook.xml:287 msgid "" "It is a good idea to use a somewhat descriptive extension when you define a " "new hook. This will help you to remember what the hook was for. If the hook " @@ -10564,12 +12584,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:407 +#: ../en/ch10-hook.xml:298 msgid "Controlling whether an activity can proceed" msgstr "控制处理的活动" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:409 +#: ../en/ch10-hook.xml:300 msgid "" "In our earlier examples, we used the <literal role=\"hook\">commit</literal> " "hook, which is run after a commit has completed. This is one of several " @@ -10578,7 +12598,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:416 +#: ../en/ch10-hook.xml:307 msgid "" "Mercurial defines a number of events that occur before an activity starts; or " "after it starts, but before it finishes. Hooks that trigger on these events " @@ -10587,7 +12607,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:422 +#: ../en/ch10-hook.xml:313 msgid "" "The <literal role=\"hook\">pretxncommit</literal> hook runs after a commit " "has all but completed. In other words, the metadata representing the " @@ -10598,7 +12618,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:431 +#: ../en/ch10-hook.xml:322 msgid "" "If the <literal role=\"hook\">pretxncommit</literal> hook exits with a status " "code of zero, the transaction is allowed to complete; the commit finishes; " @@ -10609,19 +12629,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:443 +#: ../en/ch10-hook.xml:334 msgid "" "The hook in the example above checks that a commit comment contains a bug " "ID. If it does, the commit can complete. If not, the commit is rolled back." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch09-hook.xml:451 +#: ../en/ch10-hook.xml:342 msgid "Writing your own hooks" msgstr "编写钩子" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch09-hook.xml:453 +#: ../en/ch10-hook.xml:344 msgid "" "When you are writing a hook, you might find it useful to run Mercurial either " "with the <option role=\"hg-opt-global\">-v</option> option, or the <envar " @@ -10630,12 +12650,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:462 +#: ../en/ch10-hook.xml:353 msgid "Choosing how your hook should run" msgstr "选择钩子的执行方式" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:464 +#: ../en/ch10-hook.xml:355 msgid "" "You can write a hook either as a normal program&emdash;typically a shell " "script&emdash;or as a Python function that is executed within the Mercurial " @@ -10643,7 +12663,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:469 +#: ../en/ch10-hook.xml:360 msgid "" "Writing a hook as an external program has the advantage that it requires no " "knowledge of Mercurial's internals. You can call normal Mercurial commands " @@ -10652,7 +12672,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:476 +#: ../en/ch10-hook.xml:367 msgid "" "An in-process Python hook has complete access to the Mercurial API, and does " "not <quote>shell out</quote> to another process, so it is inherently faster " @@ -10662,7 +12682,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:484 +#: ../en/ch10-hook.xml:375 msgid "" "If you are comfortable with Python, or require high performance, writing your " "hooks in Python may be a good choice. However, when you have a " @@ -10671,12 +12691,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:493 +#: ../en/ch10-hook.xml:384 msgid "Hook parameters" msgstr "钩子的参数" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:495 +#: ../en/ch10-hook.xml:386 msgid "" "Mercurial calls each hook with a set of well-defined parameters. In Python, " "a parameter is passed as a keyword argument to your hook function. For an " @@ -10684,7 +12704,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:501 +#: ../en/ch10-hook.xml:392 msgid "" "Whether your hook is written in Python or as a shell script, the hook-" "specific parameter names and values will be the same. A boolean parameter " @@ -10697,12 +12717,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:515 +#: ../en/ch10-hook.xml:406 msgid "Hook return values and activity control" msgstr "钩子的返回值与活动控制" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:517 +#: ../en/ch10-hook.xml:408 msgid "" "A hook that executes successfully must exit with a status of zero if " "external, or return boolean <quote>false</quote> if in-process. Failure is " @@ -10712,19 +12732,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:525 +#: ../en/ch10-hook.xml:416 msgid "" "For a hook that controls whether an activity can proceed, zero/false means " "<quote>allow</quote>, while non-zero/true/exception means <quote>deny</quote>." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:532 +#: ../en/ch10-hook.xml:423 msgid "Writing an external hook" msgstr "编写外部钩子" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:534 +#: ../en/ch10-hook.xml:425 msgid "" "When you define an external hook in your <filename role=\"special\">~/.hgrc</" "filename> and the hook is run, its value is passed to your shell, which " @@ -10733,14 +12753,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:541 +#: ../en/ch10-hook.xml:432 msgid "" "An executable hook is always run with its current directory set to a " "repository's root directory." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:545 +#: ../en/ch10-hook.xml:436 msgid "" "Each hook parameter is passed in as an environment variable; the name is " "upper-cased, and prefixed with the string <quote><literal>HG_</literal></" @@ -10748,7 +12768,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:550 +#: ../en/ch10-hook.xml:441 msgid "" "With the exception of hook parameters, Mercurial does not set or modify any " "environment variables when running a hook. This is useful to remember if you " @@ -10759,12 +12779,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:561 +#: ../en/ch10-hook.xml:452 msgid "Telling Mercurial to use an in-process hook" msgstr "让 Mercurial 使用进程内钩子" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:563 +#: ../en/ch10-hook.xml:454 msgid "" "The <filename role=\"special\">~/.hgrc</filename> syntax for defining an in-" "process hook is slightly different than for an executable hook. The value of " @@ -10774,7 +12794,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:571 +#: ../en/ch10-hook.xml:462 msgid "" "The module in which a hook lives is automatically imported when a hook is " "run. So long as you have the module name and <envar>PYTHONPATH</envar> " @@ -10782,14 +12802,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:577 +#: ../en/ch10-hook.xml:468 msgid "" "The following <filename role=\"special\">~/.hgrc</filename> example snippet " "illustrates the syntax and meaning of the notions we just described." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:583 +#: ../en/ch10-hook.xml:474 msgid "" "When Mercurial runs the <literal>commit.example</literal> hook, it imports " "<literal>mymodule.submodule</literal>, looks for the callable object named " @@ -10797,19 +12817,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:591 +#: ../en/ch10-hook.xml:482 msgid "Writing an in-process hook" msgstr "编写进程内钩子" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:593 +#: ../en/ch10-hook.xml:484 msgid "" "The simplest in-process hook does nothing, but illustrates the basic shape of " "the hook API:" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:598 +#: ../en/ch10-hook.xml:489 msgid "" "The first argument to a Python hook is always a <literal role=\"py-mod-" "mercurial.ui\">ui</literal> object. The second is a repository object; at " @@ -10821,17 +12841,17 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch09-hook.xml:613 +#: ../en/ch10-hook.xml:504 msgid "Some hook examples" msgstr "钩子样例" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:616 +#: ../en/ch10-hook.xml:507 msgid "Writing meaningful commit messages" msgstr "编写有意义的提交日志" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:618 +#: ../en/ch10-hook.xml:509 msgid "" "It's hard to imagine a useful commit message being very short. The simple " "<literal role=\"hook\">pretxncommit</literal> hook of the example below will " @@ -10840,12 +12860,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:628 +#: ../en/ch10-hook.xml:519 msgid "Checking for trailing whitespace" msgstr "检查行尾空格" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:630 +#: ../en/ch10-hook.xml:521 msgid "" "An interesting use of a commit-related hook is to help you to write cleaner " "code. A simple example of <quote>cleaner code</quote> is the dictum that a " @@ -10857,7 +12877,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:641 +#: ../en/ch10-hook.xml:532 msgid "" "You can use either the <literal role=\"hook\">precommit</literal> or <literal " "role=\"hook\">pretxncommit</literal> hook to tell whether you have a trailing " @@ -10872,7 +12892,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:657 +#: ../en/ch10-hook.xml:548 msgid "" "Should you choose the <literal role=\"hook\">pretxncommit</literal> hook, the " "check won't occur until just before the transaction for the commit " @@ -10884,7 +12904,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:670 +#: ../en/ch10-hook.xml:561 msgid "" "In this example, we introduce a simple <literal role=\"hook\">pretxncommit</" "literal> hook that checks for trailing whitespace. This hook is short, but " @@ -10896,7 +12916,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:681 +#: ../en/ch10-hook.xml:574 msgid "" "The above version is much more complex, but also more useful. It parses a " "unified diff to see if any lines add trailing whitespace, and prints the name " @@ -10909,20 +12929,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:695 -msgid "" -"As a final aside, note in the example above the use of <command>perl</" +#: ../en/ch10-hook.xml:588 +msgid "" +"As a final aside, note in the example above the use of <command>sed</" "command>'s in-place editing feature to get rid of trailing whitespace from a " -"file. This is concise and useful enough that I will reproduce it here." +"file. This is concise and useful enough that I will reproduce it here (using " +"<command>perl</command> for good measure)." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch09-hook.xml:705 +#: ../en/ch10-hook.xml:598 msgid "Bundled hooks" msgstr "内置的钩子" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch09-hook.xml:707 +#: ../en/ch10-hook.xml:600 msgid "" "Mercurial ships with several bundled hooks. You can find them in the " "<filename class=\"directory\">hgext</filename> directory of a Mercurial " @@ -10932,14 +12953,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:716 +#: ../en/ch10-hook.xml:609 msgid "" "<literal role=\"hg-ext\">acl</literal>&emdash;access control for parts of a " "repository" msgstr "<literal role=\"hg-ext\">acl</literal>—版本库的访问控制" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:719 +#: ../en/ch10-hook.xml:612 msgid "" "The <literal role=\"hg-ext\">acl</literal> extension lets you control which " "remote users are allowed to push changesets to a networked server. You can " @@ -10949,7 +12970,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:727 +#: ../en/ch10-hook.xml:620 msgid "" "This extension implements access control based on the identity of the user " "performing a push, <emphasis>not</emphasis> on who committed the changesets " @@ -10959,12 +12980,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><title> -#: ../en/ch09-hook.xml:737 +#: ../en/ch10-hook.xml:630 msgid "Configuring the <literal role=\"hook\">acl</literal> hook" msgstr "配置 <literal role=\"hook\">acl</literal> 钩子" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:740 +#: ../en/ch10-hook.xml:633 msgid "" "In order to manage incoming changesets, the <literal role=\"hg-ext\">acl</" "literal> hook must be used as a <literal role=\"hook\">pretxnchangegroup</" @@ -10974,14 +12995,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:750 +#: ../en/ch10-hook.xml:643 msgid "" "The <literal role=\"hg-ext\">acl</literal> extension is configured using " "three sections." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:754 +#: ../en/ch10-hook.xml:647 msgid "" "The <literal role=\"rc-acl\">acl</literal> section has only one entry, <envar " "role=\"rc-item-acl\">sources</envar>, which lists the sources of incoming " @@ -10990,7 +13011,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:761 +#: ../en/ch10-hook.xml:654 msgid "" "<envar role=\"rc-item-acl\">serve</envar>: Control incoming changesets that " "are arriving from a remote repository over http or ssh. This is the default " @@ -10999,28 +13020,28 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:769 +#: ../en/ch10-hook.xml:662 msgid "" "<envar role=\"rc-item-acl\">pull</envar>: Control incoming changesets that " "are arriving via a pull from a local repository." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:774 +#: ../en/ch10-hook.xml:667 msgid "" "<envar role=\"rc-item-acl\">push</envar>: Control incoming changesets that " "are arriving via a push from a local repository." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:779 +#: ../en/ch10-hook.xml:672 msgid "" "<envar role=\"rc-item-acl\">bundle</envar>: Control incoming changesets that " "are arriving from another repository via a bundle." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:785 +#: ../en/ch10-hook.xml:678 msgid "" "The <literal role=\"rc-acl.allow\">acl.allow</literal> section controls the " "users that are allowed to add changesets to the repository. If this section " @@ -11030,7 +13051,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:794 +#: ../en/ch10-hook.xml:687 msgid "" "The <literal role=\"rc-acl.deny\">acl.deny</literal> section determines which " "users are denied from adding changesets to the repository. If this section " @@ -11038,7 +13059,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:800 +#: ../en/ch10-hook.xml:693 msgid "" "The syntaxes for the <literal role=\"rc-acl.allow\">acl.allow</literal> and " "<literal role=\"rc-acl.deny\">acl.deny</literal> sections are identical. On " @@ -11047,7 +13068,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:808 +#: ../en/ch10-hook.xml:701 msgid "" "In the following example, the user <literal>docwriter</literal> can only push " "changes to the <filename class=\"directory\">docs</filename> subtree of the " @@ -11056,12 +13077,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><title> -#: ../en/ch09-hook.xml:822 ../en/ch09-hook.xml:1089 ../en/ch09-hook.xml:1279 +#: ../en/ch10-hook.xml:715 ../en/ch10-hook.xml:979 ../en/ch10-hook.xml:1169 msgid "Testing and troubleshooting" msgstr "测试与问题处理" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:824 +#: ../en/ch10-hook.xml:717 msgid "" "If you want to test the <literal role=\"hg-ext\">acl</literal> hook, run it " "with Mercurial's debugging output enabled. Since you'll probably be running " @@ -11072,7 +13093,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:835 +#: ../en/ch10-hook.xml:728 msgid "" "With this enabled, the <literal role=\"hg-ext\">acl</literal> hook will print " "enough information to let you figure out why it is allowing or forbidding " @@ -11080,13 +13101,13 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:844 +#: ../en/ch10-hook.xml:737 msgid "" "<literal role=\"hg-ext\">bugzilla</literal>&emdash;integration with Bugzilla" msgstr "<literal role=\"hg-ext\">bugzilla</literal>—与 Bugzilla 的集成" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:848 +#: ../en/ch10-hook.xml:741 msgid "" "The <literal role=\"hg-ext\">bugzilla</literal> extension adds a comment to a " "Bugzilla bug whenever it finds a reference to that bug ID in a commit " @@ -11095,14 +13116,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:855 +#: ../en/ch10-hook.xml:748 msgid "" "It adds a comment to the bug that looks like this (you can configure the " "contents of the comment&emdash;see below):" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:864 +#: ../en/ch10-hook.xml:757 msgid "" "The value of this hook is that it automates the process of updating a bug any " "time a changeset refers to it. If you configure the hook properly, it makes " @@ -11111,14 +13132,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:871 +#: ../en/ch10-hook.xml:764 msgid "" "You can use the code in this hook as a starting point for some more exotic " "Bugzilla integration recipes. Here are a few possibilities:" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:876 +#: ../en/ch10-hook.xml:769 msgid "" "Require that every changeset pushed to the server have a valid bug ID in its " "commit comment. In this case, you'd want to configure the hook as a <literal " @@ -11127,7 +13148,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:884 +#: ../en/ch10-hook.xml:777 msgid "" "Allow incoming changesets to automatically modify the <emphasis>state</" "emphasis> of a bug, as well as simply adding a comment. For example, the " @@ -11137,12 +13158,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><title> -#: ../en/ch09-hook.xml:894 +#: ../en/ch10-hook.xml:787 msgid "Configuring the <literal role=\"hook\">bugzilla</literal> hook" msgstr "配置 <literal role=\"hook\">bugzilla</literal> 钩子" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:897 +#: ../en/ch10-hook.xml:790 msgid "" "You should configure this hook in your server's <filename role=\"special\">~/." "hgrc</filename> as an <literal role=\"hook\">incoming</literal> hook, for " @@ -11150,7 +13171,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:905 +#: ../en/ch10-hook.xml:798 msgid "" "Because of the specialised nature of this hook, and because Bugzilla was not " "written with this kind of integration in mind, configuring this hook is a " @@ -11158,7 +13179,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:911 +#: ../en/ch10-hook.xml:804 msgid "" "Before you begin, you must install the MySQL bindings for Python on the host" "(s) where you'll be running the hook. If this is not available as a binary " @@ -11167,7 +13188,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:918 +#: ../en/ch10-hook.xml:811 msgid "" "Configuration information for this hook lives in the <literal role=\"rc-" "bugzilla\">bugzilla</literal> section of your <filename role=\"special\">~/." @@ -11175,16 +13196,15 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:923 +#: ../en/ch10-hook.xml:816 msgid "" "<envar role=\"rc-item-bugzilla\">version</envar>: The version of Bugzilla " "installed on the server. The database schema that Bugzilla uses changes " -"occasionally, so this hook has to know exactly which schema to use. At the " -"moment, the only version supported is <literal>2.16</literal>." +"occasionally, so this hook has to know exactly which schema to use." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:932 +#: ../en/ch10-hook.xml:822 msgid "" "<envar role=\"rc-item-bugzilla\">host</envar>: The hostname of the MySQL " "server that stores your Bugzilla data. The database must be configured to " @@ -11193,7 +13213,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:939 +#: ../en/ch10-hook.xml:829 msgid "" "<envar role=\"rc-item-bugzilla\">user</envar>: The username with which to " "connect to the MySQL server. The database must be configured to allow this " @@ -11204,7 +13224,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:950 +#: ../en/ch10-hook.xml:840 msgid "" "<envar role=\"rc-item-bugzilla\">password</envar>: The MySQL password for the " "user you configured above. This is stored as plain text, so you should make " @@ -11213,7 +13233,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:959 +#: ../en/ch10-hook.xml:849 msgid "" "<envar role=\"rc-item-bugzilla\">db</envar>: The name of the Bugzilla " "database on the MySQL server. The default value of this item is " @@ -11222,7 +13242,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:966 +#: ../en/ch10-hook.xml:856 msgid "" "<envar role=\"rc-item-bugzilla\">notify</envar>: If you want Bugzilla to send " "out a notification email to subscribers after this hook has added a comment " @@ -11233,7 +13253,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:979 +#: ../en/ch10-hook.xml:869 msgid "" "The Bugzilla <literal>processmail</literal> program expects to be given a bug " "ID (the hook replaces <quote><literal>%s</literal></quote> with the bug ID) " @@ -11244,12 +13264,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><title> -#: ../en/ch09-hook.xml:994 +#: ../en/ch10-hook.xml:884 msgid "Mapping committer names to Bugzilla user names" msgstr "提交者的名称与 Bugzilla 用户名称的映射" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:996 +#: ../en/ch10-hook.xml:886 msgid "" "By default, the <literal role=\"hg-ext\">bugzilla</literal> hook tries to use " "the email address of a changeset's committer as the Bugzilla user name with " @@ -11259,14 +13279,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1005 +#: ../en/ch10-hook.xml:895 msgid "" "Each item in the <literal role=\"rc-usermap\">usermap</literal> section " "contains an email address on the left, and a Bugzilla user name on the right." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1012 +#: ../en/ch10-hook.xml:902 msgid "" "You can either keep the <literal role=\"rc-usermap\">usermap</literal> data " "in a normal <filename role=\"special\">~/.hgrc</filename>, or tell the " @@ -11279,28 +13299,28 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1028 +#: ../en/ch10-hook.xml:918 msgid "" "While the <filename>usermap</filename> file that it refers to might look like " "this:" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><title> -#: ../en/ch09-hook.xml:1036 +#: ../en/ch10-hook.xml:926 msgid "Configuring the text that gets added to a bug" msgstr "配置增加到问题中的正文" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1038 +#: ../en/ch10-hook.xml:928 msgid "" "You can configure the text that this hook adds as a comment; you specify it " "in the form of a Mercurial template. Several <filename role=\"special\">~/." "hgrc</filename> entries (still in the <literal role=\"rc-bugzilla\">bugzilla</" -"literal> section) control this behaviour." +"literal> section) control this behavior." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1045 +#: ../en/ch10-hook.xml:935 msgid "" "<literal>strip</literal>: The number of leading path elements to strip from a " "repository's path name to construct a partial path for a URL. For example, if " @@ -11314,7 +13334,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1059 +#: ../en/ch10-hook.xml:949 msgid "" "<literal>template</literal>: The text of the template to use. In addition to " "the usual changeset-related variables, this template can use <literal>hgweb</" @@ -11324,7 +13344,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1069 +#: ../en/ch10-hook.xml:959 msgid "" "In addition, you can add a <envar role=\"rc-item-web\">baseurl</envar> item " "to the <literal role=\"rc-web\">web</literal> section of your <filename role=" @@ -11335,14 +13355,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1081 +#: ../en/ch10-hook.xml:971 msgid "" "Here is an example set of <literal role=\"hg-ext\">bugzilla</literal> hook " "config information." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1091 +#: ../en/ch10-hook.xml:981 msgid "" "The most common problems with configuring the <literal role=\"hg-ext" "\">bugzilla</literal> hook relate to running Bugzilla's " @@ -11351,7 +13371,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1097 +#: ../en/ch10-hook.xml:987 msgid "" "Recall from <xref linkend=\"sec:hook:bugzilla:config\"/> above that the user " "that runs the Mercurial process on the server is also the one that will run " @@ -11362,7 +13382,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1108 +#: ../en/ch10-hook.xml:998 msgid "" "You can cause <filename>processmail</filename> to be run with the suitable " "user's identity using the <command>sudo</command> command. Here is an " @@ -11370,7 +13390,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1115 +#: ../en/ch10-hook.xml:1005 msgid "" "This allows the <literal>hg_user</literal> user to run a " "<filename>processmail-wrapper</filename> program under the identity of " @@ -11378,7 +13398,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1120 +#: ../en/ch10-hook.xml:1010 msgid "" "This indirection through a wrapper script is necessary, because " "<filename>processmail</filename> expects to be run with its current directory " @@ -11388,14 +13408,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1129 +#: ../en/ch10-hook.xml:1019 msgid "" "It doesn't seem to matter what email address you pass to " "<filename>processmail</filename>." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1133 +#: ../en/ch10-hook.xml:1023 msgid "" "If your <literal role=\"rc-usermap\">usermap</literal> is not set up " "correctly, users will see an error message from the <literal role=\"hg-ext" @@ -11404,7 +13424,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1140 +#: ../en/ch10-hook.xml:1030 msgid "" "What this means is that the committer's address, <literal>john.q." "public@example.com</literal>, is not a valid Bugzilla user name, nor does it " @@ -11413,13 +13433,13 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:1150 +#: ../en/ch10-hook.xml:1040 msgid "" "<literal role=\"hg-ext\">notify</literal>&emdash;send email notifications" msgstr "<literal role=\"hg-ext\">notify</literal>—邮件通知" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1153 +#: ../en/ch10-hook.xml:1043 msgid "" "Although Mercurial's built-in web server provides RSS feeds of changes in " "every repository, many people prefer to receive change notifications via " @@ -11429,7 +13449,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1161 +#: ../en/ch10-hook.xml:1051 msgid "" "As with the <literal role=\"hg-ext\">bugzilla</literal> hook, the <literal " "role=\"hg-ext\">notify</literal> hook is template-driven, so you can " @@ -11437,7 +13457,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1167 +#: ../en/ch10-hook.xml:1057 msgid "" "By default, the <literal role=\"hg-ext\">notify</literal> hook includes a " "diff of every changeset that it sends out; you can limit the size of the " @@ -11446,12 +13466,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><title> -#: ../en/ch09-hook.xml:1175 +#: ../en/ch10-hook.xml:1065 msgid "Configuring the <literal role=\"hg-ext\">notify</literal> hook" msgstr "配置 <literal role=\"hg-ext\">notify</literal> 钩子" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1178 +#: ../en/ch10-hook.xml:1068 msgid "" "You can set up the <literal role=\"hg-ext\">notify</literal> hook to send one " "email message per incoming changeset, or one per incoming group of changesets " @@ -11459,7 +13479,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1190 +#: ../en/ch10-hook.xml:1080 msgid "" "Configuration information for this hook lives in the <literal role=\"rc-notify" "\">notify</literal> section of a <filename role=\"special\">~/.hgrc</" @@ -11467,7 +13487,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1195 +#: ../en/ch10-hook.xml:1085 msgid "" "<envar role=\"rc-item-notify\">test</envar>: By default, this hook does not " "send out email at all; instead, it prints the message that it " @@ -11479,7 +13499,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1207 +#: ../en/ch10-hook.xml:1097 msgid "" "<envar role=\"rc-item-notify\">config</envar>: The path to a configuration " "file that contains subscription information. This is kept separate from the " @@ -11489,7 +13509,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1216 +#: ../en/ch10-hook.xml:1106 msgid "" "<envar role=\"rc-item-notify\">strip</envar>: The number of leading path " "separator characters to strip from a repository's path, when deciding whether " @@ -11504,7 +13524,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1233 +#: ../en/ch10-hook.xml:1123 msgid "" "<envar role=\"rc-item-notify\">template</envar>: The template text to use " "when sending messages. This specifies both the contents of the message " @@ -11512,7 +13532,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1239 +#: ../en/ch10-hook.xml:1129 msgid "" "<envar role=\"rc-item-notify\">maxdiff</envar>: The maximum number of lines " "of diff data to append to the end of a message. If a diff is longer than " @@ -11521,7 +13541,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1248 +#: ../en/ch10-hook.xml:1138 msgid "" "<envar role=\"rc-item-notify\">sources</envar>: A list of sources of " "changesets to consider. This lets you limit <literal role=\"hg-ext\">notify</" @@ -11531,7 +13551,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1259 +#: ../en/ch10-hook.xml:1149 msgid "" "If you set the <envar role=\"rc-item-web\">baseurl</envar> item in the " "<literal role=\"rc-web\">web</literal> section, you can use it in a template; " @@ -11539,19 +13559,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1265 +#: ../en/ch10-hook.xml:1155 msgid "" "Here is an example set of <literal role=\"hg-ext\">notify</literal> " "configuration information." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1271 +#: ../en/ch10-hook.xml:1161 msgid "This will produce a message that looks like the following:" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1281 +#: ../en/ch10-hook.xml:1171 msgid "" "Do not forget that by default, the <literal role=\"hg-ext\">notify</literal> " "extension <emphasis>will not send any mail</emphasis> until you explicitly " @@ -11561,22 +13581,22 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch09-hook.xml:1293 +#: ../en/ch10-hook.xml:1183 msgid "Information for writers of hooks" msgstr "编写钩子的信息" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:1296 +#: ../en/ch10-hook.xml:1186 msgid "In-process hook execution" msgstr "进程内钩子的执行" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1298 +#: ../en/ch10-hook.xml:1188 msgid "An in-process hook is called with arguments of the following form:" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1302 +#: ../en/ch10-hook.xml:1192 msgid "" "The <literal>ui</literal> parameter is a <literal role=\"py-mod-mercurial.ui" "\">ui</literal> object. The <literal>repo</literal> parameter is a <literal " @@ -11586,7 +13606,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1311 +#: ../en/ch10-hook.xml:1201 msgid "" "If a parameter is named <literal>node</literal> or <literal>parentN</" "literal>, it will contain a hexadecimal changeset ID. The empty string is " @@ -11595,21 +13615,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1318 +#: ../en/ch10-hook.xml:1208 msgid "" "If a parameter is named <literal>url</literal>, it will contain the URL of a " "remote repository, if that can be determined." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1323 +#: ../en/ch10-hook.xml:1213 msgid "" "Boolean-valued parameters are represented as Python <literal>bool</literal> " "objects." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1328 +#: ../en/ch10-hook.xml:1218 msgid "" "An in-process hook is called without a change to the process's working " "directory (unlike external hooks, which are run in the root of the " @@ -11618,7 +13638,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1335 +#: ../en/ch10-hook.xml:1225 msgid "" "If a hook returns a boolean <quote>false</quote> value, it is considered to " "have succeeded. If it returns a boolean <quote>true</quote> value or raises " @@ -11627,7 +13647,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1342 +#: ../en/ch10-hook.xml:1232 msgid "" "Note that changeset IDs are passed into Python hooks as hexadecimal strings, " "not the binary hashes that Mercurial's APIs normally use. To convert a hash " @@ -11635,12 +13655,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:1350 +#: ../en/ch10-hook.xml:1240 msgid "External hook execution" msgstr "外部钩子的执行" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1352 +#: ../en/ch10-hook.xml:1242 msgid "" "An external hook is passed to the shell of the user running Mercurial. " "Features of that shell, such as variable substitution and command " @@ -11650,7 +13670,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1360 +#: ../en/ch10-hook.xml:1250 msgid "" "Hook parameters are passed to the hook as environment variables. Each " "environment variable's name is converted in upper case and prefixed with the " @@ -11661,7 +13681,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1369 +#: ../en/ch10-hook.xml:1259 msgid "" "A boolean parameter is represented as the string <quote><literal>1</literal></" "quote> for <quote>true</quote>, <quote><literal>0</literal></quote> for " @@ -11674,19 +13694,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1381 +#: ../en/ch10-hook.xml:1271 msgid "" "If a hook exits with a status of zero, it is considered to have succeeded. " "If it exits with a non-zero status, it is considered to have failed." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:1388 +#: ../en/ch10-hook.xml:1278 msgid "Finding out where changesets come from" msgstr "检查修改集来自何处" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1390 +#: ../en/ch10-hook.xml:1280 msgid "" "A hook that involves the transfer of changesets between a local repository " "and another may be able to find out information about the <quote>far side</" @@ -11696,12 +13716,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><title> -#: ../en/ch09-hook.xml:1399 +#: ../en/ch10-hook.xml:1289 msgid "Sources of changesets" msgstr "修改集的来源" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1401 +#: ../en/ch10-hook.xml:1291 msgid "" "Mercurial will tell a hook what means are, or were, used to transfer " "changesets between repositories. This is provided by Mercurial in a Python " @@ -11710,40 +13730,40 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1409 +#: ../en/ch10-hook.xml:1299 msgid "" "<literal>serve</literal>: Changesets are transferred to or from a remote " "repository over http or ssh." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1414 +#: ../en/ch10-hook.xml:1304 msgid "" "<literal>pull</literal>: Changesets are being transferred via a pull from one " "repository into another." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1419 +#: ../en/ch10-hook.xml:1309 msgid "" "<literal>push</literal>: Changesets are being transferred via a push from one " "repository into another." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1424 +#: ../en/ch10-hook.xml:1314 msgid "" "<literal>bundle</literal>: Changesets are being transferred to or from a " "bundle." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><title> -#: ../en/ch09-hook.xml:1431 +#: ../en/ch10-hook.xml:1321 msgid "Where changes are going&emdash;remote repository URLs" msgstr "修改集要到哪里—远程版本库的地址" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1434 +#: ../en/ch10-hook.xml:1324 msgid "" "When possible, Mercurial will tell a hook the location of the <quote>far " "side</quote> of an activity that transfers changeset data between " @@ -11753,7 +13773,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><para> -#: ../en/ch09-hook.xml:1442 +#: ../en/ch10-hook.xml:1332 msgid "" "This information is not always known. If a hook is invoked in a repository " "that is being served via http or ssh, Mercurial cannot tell where the remote " @@ -11762,14 +13782,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1449 +#: ../en/ch10-hook.xml:1339 msgid "" "<literal>remote:ssh:1.2.3.4</literal>&emdash;remote ssh client, at the IP " "address <literal>1.2.3.4</literal>." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1454 +#: ../en/ch10-hook.xml:1344 msgid "" "<literal>remote:http:1.2.3.4</literal>&emdash;remote http client, at the IP " "address <literal>1.2.3.4</literal>. If the client is using SSL, this will be " @@ -11777,24 +13797,24 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1461 +#: ../en/ch10-hook.xml:1351 msgid "Empty&emdash;no information could be discovered about the remote client." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch09-hook.xml:1470 +#: ../en/ch10-hook.xml:1359 msgid "Hook reference" msgstr "钩子参考" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:1473 +#: ../en/ch10-hook.xml:1362 msgid "" "<literal role=\"hook\">changegroup</literal>&emdash;after remote changesets " "added" msgstr "<literal role=\"hook\">changegroup</literal>—增加远程修改集之后" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1476 +#: ../en/ch10-hook.xml:1365 msgid "" "This hook is run after a group of pre-existing changesets has been added to " "the repository, for example via a <command role=\"hg-cmd\">hg pull</command> " @@ -11805,7 +13825,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1486 +#: ../en/ch10-hook.xml:1375 msgid "" "Some possible uses for this hook include kicking off an automated build or " "test of the added changesets, updating a bug database, or notifying " @@ -11813,15 +13833,15 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1492 ../en/ch09-hook.xml:1532 ../en/ch09-hook.xml:1576 -#: ../en/ch09-hook.xml:1618 ../en/ch09-hook.xml:1673 ../en/ch09-hook.xml:1713 -#: ../en/ch09-hook.xml:1749 ../en/ch09-hook.xml:1783 ../en/ch09-hook.xml:1846 -#: ../en/ch09-hook.xml:1904 ../en/ch09-hook.xml:1940 ../en/ch09-hook.xml:1967 +#: ../en/ch10-hook.xml:1381 ../en/ch10-hook.xml:1421 ../en/ch10-hook.xml:1465 +#: ../en/ch10-hook.xml:1507 ../en/ch10-hook.xml:1562 ../en/ch10-hook.xml:1602 +#: ../en/ch10-hook.xml:1638 ../en/ch10-hook.xml:1672 ../en/ch10-hook.xml:1736 +#: ../en/ch10-hook.xml:1794 ../en/ch10-hook.xml:1830 ../en/ch10-hook.xml:1857 msgid "Parameters to this hook:" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1495 ../en/ch09-hook.xml:1849 +#: ../en/ch10-hook.xml:1384 ../en/ch10-hook.xml:1739 msgid "" "<literal>node</literal>: A changeset ID. The changeset ID of the first " "changeset in the group that was added. All changesets between this and " @@ -11831,23 +13851,23 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1504 ../en/ch09-hook.xml:1583 ../en/ch09-hook.xml:1676 -#: ../en/ch09-hook.xml:1859 +#: ../en/ch10-hook.xml:1393 ../en/ch10-hook.xml:1472 ../en/ch10-hook.xml:1565 +#: ../en/ch10-hook.xml:1749 msgid "" "<literal>source</literal>: A string. The source of these changes. See <xref " "linkend=\"sec:hook:sources\"/> for details." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1509 ../en/ch09-hook.xml:1588 ../en/ch09-hook.xml:1639 -#: ../en/ch09-hook.xml:1681 ../en/ch09-hook.xml:1762 ../en/ch09-hook.xml:1864 +#: ../en/ch10-hook.xml:1398 ../en/ch10-hook.xml:1477 ../en/ch10-hook.xml:1528 +#: ../en/ch10-hook.xml:1570 ../en/ch10-hook.xml:1651 ../en/ch10-hook.xml:1754 msgid "" "<literal>url</literal>: A URL. The location of the remote repository, if " "known. See <xref linkend=\"sec:hook:url\"/> for more information." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1515 +#: ../en/ch10-hook.xml:1404 msgid "" "See also: <literal role=\"hook\">incoming</literal> (<xref linkend=\"sec:hook:" "incoming\"/>), <literal role=\"hook\">prechangegroup</literal> (<xref linkend=" @@ -11856,40 +13876,40 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:1526 +#: ../en/ch10-hook.xml:1415 msgid "" "<literal role=\"hook\">commit</literal>&emdash;after a new changeset is " "created" msgstr "<literal role=\"hook\">commit</literal>—创建新修改集之后" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1529 +#: ../en/ch10-hook.xml:1418 msgid "This hook is run after a new changeset has been created." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1535 ../en/ch09-hook.xml:1907 +#: ../en/ch10-hook.xml:1424 ../en/ch10-hook.xml:1797 msgid "" "<literal>node</literal>: A changeset ID. The changeset ID of the newly " "committed changeset." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1539 ../en/ch09-hook.xml:1911 +#: ../en/ch10-hook.xml:1428 ../en/ch10-hook.xml:1801 msgid "" "<literal>parent1</literal>: A changeset ID. The changeset ID of the first " "parent of the newly committed changeset." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1544 ../en/ch09-hook.xml:1916 +#: ../en/ch10-hook.xml:1433 ../en/ch10-hook.xml:1806 msgid "" "<literal>parent2</literal>: A changeset ID. The changeset ID of the second " "parent of the newly committed changeset." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1550 +#: ../en/ch10-hook.xml:1439 msgid "" "See also: <literal role=\"hook\">precommit</literal> (<xref linkend=\"sec:" "hook:precommit\"/>), <literal role=\"hook\">pretxncommit</literal> (<xref " @@ -11897,14 +13917,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:1559 +#: ../en/ch10-hook.xml:1448 msgid "" "<literal role=\"hook\">incoming</literal>&emdash;after one remote changeset " "is added" msgstr "<literal role=\"hook\">incoming</literal>—增加远程修改集之后" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1562 +#: ../en/ch10-hook.xml:1451 msgid "" "This hook is run after a pre-existing changeset has been added to the " "repository, for example via a <command role=\"hg-cmd\">hg push</command>. If " @@ -11913,7 +13933,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1569 +#: ../en/ch10-hook.xml:1458 msgid "" "You can use this hook for the same purposes as the <literal role=\"hook" "\">changegroup</literal> hook (<xref linkend=\"sec:hook:changegroup\"/>); " @@ -11922,13 +13942,13 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1579 +#: ../en/ch10-hook.xml:1468 msgid "" "<literal>node</literal>: A changeset ID. The ID of the newly added changeset." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1594 +#: ../en/ch10-hook.xml:1483 msgid "" "See also: <literal role=\"hook\">changegroup</literal> (<xref linkend=\"sec:" "hook:changegroup\"/>) <literal role=\"hook\">prechangegroup</literal> (<xref " @@ -11938,14 +13958,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:1605 +#: ../en/ch10-hook.xml:1494 msgid "" "<literal role=\"hook\">outgoing</literal>&emdash;after changesets are " "propagated" msgstr "<literal role=\"hook\">outgoing</literal>—传播修改集之后" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1608 +#: ../en/ch10-hook.xml:1497 msgid "" "This hook is run after a group of changesets has been propagated out of this " "repository, for example by a <command role=\"hg-cmd\">hg push</command> or " @@ -11953,21 +13973,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1614 +#: ../en/ch10-hook.xml:1503 msgid "" "One possible use for this hook is to notify administrators that changes have " "been pulled." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1621 +#: ../en/ch10-hook.xml:1510 msgid "" "<literal>node</literal>: A changeset ID. The changeset ID of the first " "changeset of the group that was sent." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1626 +#: ../en/ch10-hook.xml:1515 msgid "" "<literal>source</literal>: A string. The source of the of the operation (see " "<xref linkend=\"sec:hook:sources\"/>). If a remote client pulled changes " @@ -11979,28 +13999,28 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1645 +#: ../en/ch10-hook.xml:1534 msgid "" "See also: <literal role=\"hook\">preoutgoing</literal> (<xref linkend=\"sec:" "hook:preoutgoing\"/>)" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:1652 +#: ../en/ch10-hook.xml:1541 msgid "" "<literal role=\"hook\">prechangegroup</literal>&emdash;before starting to add " "remote changesets" msgstr "<literal role=\"hook\">prechangegroup</literal>—增加远程修改集之前" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1656 +#: ../en/ch10-hook.xml:1545 msgid "" "This controlling hook is run before Mercurial begins to add a group of " "changesets from another repository." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1660 +#: ../en/ch10-hook.xml:1549 msgid "" "This hook does not have any information about the changesets to be added, " "because it is run before transmission of those changesets is allowed to " @@ -12008,7 +14028,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1666 +#: ../en/ch10-hook.xml:1555 msgid "" "One use for this hook is to prevent external changes from being added to a " "repository. For example, you could use this to <quote>freeze</quote> a " @@ -12017,7 +14037,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1687 +#: ../en/ch10-hook.xml:1576 msgid "" "See also: <literal role=\"hook\">changegroup</literal> (<xref linkend=\"sec:" "hook:changegroup\"/>), <literal role=\"hook\">incoming</literal> (<xref " @@ -12026,14 +14046,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:1698 +#: ../en/ch10-hook.xml:1587 msgid "" "<literal role=\"hook\">precommit</literal>&emdash;before starting to commit a " "changeset" msgstr "<literal role=\"hook\">precommit</literal>—提交修改集之前" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1701 +#: ../en/ch10-hook.xml:1590 msgid "" "This hook is run before Mercurial begins to commit a new changeset. It is run " "before Mercurial has any of the metadata for the commit, such as the files to " @@ -12041,7 +14061,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1707 +#: ../en/ch10-hook.xml:1596 msgid "" "One use for this hook is to disable the ability to commit new changesets, " "while still allowing incoming changesets. Another is to run a build or test, " @@ -12049,28 +14069,28 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1716 +#: ../en/ch10-hook.xml:1605 msgid "" "<literal>parent1</literal>: A changeset ID. The changeset ID of the first " "parent of the working directory." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1721 +#: ../en/ch10-hook.xml:1610 msgid "" "<literal>parent2</literal>: A changeset ID. The changeset ID of the second " "parent of the working directory." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1726 +#: ../en/ch10-hook.xml:1615 msgid "" "If the commit proceeds, the parents of the working directory will become the " "parents of the new changeset." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1730 +#: ../en/ch10-hook.xml:1619 msgid "" "See also: <literal role=\"hook\">commit</literal> (<xref linkend=\"sec:hook:" "commit\"/>), <literal role=\"hook\">pretxncommit</literal> (<xref linkend=" @@ -12078,28 +14098,28 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:1738 +#: ../en/ch10-hook.xml:1627 msgid "" "<literal role=\"hook\">preoutgoing</literal>&emdash;before starting to " "propagate changesets" msgstr "<literal role=\"hook\">preoutgoing</literal>—传播修改集之前" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1741 +#: ../en/ch10-hook.xml:1630 msgid "" "This hook is invoked before Mercurial knows the identities of the changesets " "to be transmitted." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1745 +#: ../en/ch10-hook.xml:1634 msgid "" "One use for this hook is to prevent changes from being transmitted to another " "repository." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1752 +#: ../en/ch10-hook.xml:1641 msgid "" "<literal>source</literal>: A string. The source of the operation that is " "attempting to obtain changes from this repository (see <xref linkend=\"sec:" @@ -12109,27 +14129,27 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1768 +#: ../en/ch10-hook.xml:1657 msgid "" "See also: <literal role=\"hook\">outgoing</literal> (<xref linkend=\"sec:hook:" "outgoing\"/>)" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:1775 +#: ../en/ch10-hook.xml:1664 msgid "" "<literal role=\"hook\">pretag</literal>&emdash;before tagging a changeset" msgstr "<literal role=\"hook\">pretag</literal>—创建标签之前" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1778 +#: ../en/ch10-hook.xml:1667 msgid "" "This controlling hook is run before a tag is created. If the hook succeeds, " "creation of the tag proceeds. If the hook fails, the tag is not created." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1786 +#: ../en/ch10-hook.xml:1675 msgid "" "<literal>local</literal>: A boolean. Whether the tag is local to this " "repository instance (i.e. stored in <filename role=\"special\">.hg/localtags</" @@ -12138,19 +14158,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1793 +#: ../en/ch10-hook.xml:1682 msgid "" "<literal>node</literal>: A changeset ID. The ID of the changeset to be " "tagged." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1797 +#: ../en/ch10-hook.xml:1686 msgid "<literal>tag</literal>: A string. The name of the tag to be created." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1802 +#: ../en/ch10-hook.xml:1691 msgid "" "If the tag to be created is revision-controlled, the <literal role=\"hook" "\">precommit</literal> and <literal role=\"hook\">pretxncommit</literal> " @@ -12159,14 +14179,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1810 +#: ../en/ch10-hook.xml:1699 msgid "" "See also: <literal role=\"hook\">tag</literal> (<xref linkend=\"sec:hook:tag" "\"/>)" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:1815 +#: ../en/ch10-hook.xml:1705 msgid "" "<literal role=\"hook\">pretxnchangegroup</literal>&emdash;before completing " "addition of remote changesets" @@ -12174,7 +14194,7 @@ "<literal role=\"hook\">pretxnchangegroup</literal>—完成增加远程修改集之前" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1819 +#: ../en/ch10-hook.xml:1709 msgid "" "This controlling hook is run before a transaction&emdash;that manages the " "addition of a group of new changesets from outside the repository&emdash;" @@ -12184,7 +14204,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1828 +#: ../en/ch10-hook.xml:1718 msgid "" "This hook can access the metadata associated with the almost-added " "changesets, but it should not do anything permanent with this data. It must " @@ -12192,7 +14212,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1834 +#: ../en/ch10-hook.xml:1724 msgid "" "While this hook is running, if other Mercurial processes access this " "repository, they will be able to see the almost-added changesets as if they " @@ -12201,7 +14221,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1841 +#: ../en/ch10-hook.xml:1731 msgid "" "This hook can be used to automatically vet a group of changesets. If the " "hook fails, all of the changesets are <quote>rejected</quote> when the " @@ -12209,7 +14229,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1870 +#: ../en/ch10-hook.xml:1760 msgid "" "See also: <literal role=\"hook\">changegroup</literal> (<xref linkend=\"sec:" "hook:changegroup\"/>), <literal role=\"hook\">incoming</literal> (<xref " @@ -12218,14 +14238,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:1881 +#: ../en/ch10-hook.xml:1771 msgid "" "<literal role=\"hook\">pretxncommit</literal>&emdash;before completing commit " "of new changeset" msgstr "<literal role=\"hook\">pretxncommit</literal>—完成提交之前" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1884 +#: ../en/ch10-hook.xml:1774 msgid "" "This controlling hook is run before a transaction&emdash;that manages a new " "commit&emdash;completes. If the hook succeeds, the transaction completes and " @@ -12234,7 +14254,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1892 +#: ../en/ch10-hook.xml:1782 msgid "" "This hook can access the metadata associated with the almost-new changeset, " "but it should not do anything permanent with this data. It must also not " @@ -12242,7 +14262,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1898 +#: ../en/ch10-hook.xml:1788 msgid "" "While this hook is running, if other Mercurial processes access this " "repository, they will be able to see the almost-new changeset as if it is " @@ -12251,7 +14271,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1922 +#: ../en/ch10-hook.xml:1812 msgid "" "See also: <literal role=\"hook\">precommit</literal> (<xref linkend=\"sec:" "hook:precommit\"/>)" @@ -12260,14 +14280,14 @@ "precommit\"/>)" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:1929 +#: ../en/ch10-hook.xml:1819 msgid "" "<literal role=\"hook\">preupdate</literal>&emdash;before updating or merging " "working directory" msgstr "<literal role=\"hook\">preupdate</literal>—更新或合并工作目录之前" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1932 +#: ../en/ch10-hook.xml:1822 msgid "" "This controlling hook is run before an update or merge of the working " "directory begins. It is run only if Mercurial's normal pre-update checks " @@ -12276,7 +14296,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1943 +#: ../en/ch10-hook.xml:1833 msgid "" "<literal>parent1</literal>: A changeset ID. The ID of the parent that the " "working directory is to be updated to. If the working directory is being " @@ -12284,7 +14304,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1949 +#: ../en/ch10-hook.xml:1839 msgid "" "<literal>parent2</literal>: A changeset ID. Only set if the working directory " "is being merged. The ID of the revision that the working directory is being " @@ -12292,24 +14312,24 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1956 +#: ../en/ch10-hook.xml:1846 msgid "" "See also: <literal role=\"hook\">update</literal> (<xref linkend=\"sec:hook:" "update\"/>)" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:1961 +#: ../en/ch10-hook.xml:1851 msgid "<literal role=\"hook\">tag</literal>&emdash;after tagging a changeset" msgstr "<literal role=\"hook\">tag</literal>—创建标签之后" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1964 +#: ../en/ch10-hook.xml:1854 msgid "This hook is run after a tag has been created." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1970 +#: ../en/ch10-hook.xml:1860 msgid "" "<literal>local</literal>: A boolean. Whether the new tag is local to this " "repository instance (i.e. stored in <filename role=\"special\">.hg/" @@ -12318,19 +14338,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1978 +#: ../en/ch10-hook.xml:1868 msgid "" "<literal>node</literal>: A changeset ID. The ID of the changeset that was " "tagged." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:1982 +#: ../en/ch10-hook.xml:1872 msgid "<literal>tag</literal>: A string. The name of the tag that was created." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1987 +#: ../en/ch10-hook.xml:1877 msgid "" "If the created tag is revision-controlled, the <literal role=\"hook\">commit</" "literal> hook (section <xref linkend=\"sec:hook:commit\"/>) is run before " @@ -12338,7 +14358,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:1992 +#: ../en/ch10-hook.xml:1882 msgid "" "See also: <literal role=\"hook\">pretag</literal> (<xref linkend=\"sec:hook:" "pretag\"/>)" @@ -12347,14 +14367,14 @@ "\"/>)" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch09-hook.xml:1998 +#: ../en/ch10-hook.xml:1888 msgid "" "<literal role=\"hook\">update</literal>&emdash;after updating or merging " "working directory" msgstr "<literal role=\"hook\">update</literal>—更新或合并工作目录之后" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:2001 +#: ../en/ch10-hook.xml:1891 msgid "" "This hook is run after an update or merge of the working directory " "completes. Since a merge can fail (if the external <command>hgmerge</" @@ -12363,14 +14383,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:2009 +#: ../en/ch10-hook.xml:1899 msgid "" "<literal>error</literal>: A boolean. Indicates whether the update or merge " "completed successfully." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:2014 +#: ../en/ch10-hook.xml:1904 msgid "" "<literal>parent1</literal>: A changeset ID. The ID of the parent that the " "working directory was updated to. If the working directory was merged, it " @@ -12378,7 +14398,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch09-hook.xml:2020 +#: ../en/ch10-hook.xml:1910 msgid "" "<literal>parent2</literal>: A changeset ID. Only set if the working " "directory was merged. The ID of the revision that the working directory was " @@ -12386,33 +14406,33 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch09-hook.xml:2026 +#: ../en/ch10-hook.xml:1916 msgid "" "See also: <literal role=\"hook\">preupdate</literal> (<xref linkend=\"sec:" "hook:preupdate\"/>)" msgstr "" #. type: Content of: <book><chapter><title> -#: ../en/ch10-template.xml:5 -msgid "Customising the output of Mercurial" +#: ../en/ch11-template.xml:5 +msgid "Customizing the output of Mercurial" msgstr "定制 Mercurial 的输出" #. type: Content of: <book><chapter><para> -#: ../en/ch10-template.xml:7 +#: ../en/ch11-template.xml:7 msgid "" "Mercurial provides a powerful mechanism to let you control how it displays " "information. The mechanism is based on templates. You can use templates to " -"generate specific output for a single command, or to customise the entire " +"generate specific output for a single command, or to customize the entire " "appearance of the built-in web interface." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch10-template.xml:14 +#: ../en/ch11-template.xml:14 msgid "Using precanned output styles" msgstr "使用预定义的输出样式" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:16 +#: ../en/ch11-template.xml:16 msgid "" "Packaged with Mercurial are some output styles that you can use immediately. " "A style is simply a precanned template that someone wrote and installed " @@ -12420,14 +14440,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:21 +#: ../en/ch11-template.xml:21 msgid "" "Before we take a look at Mercurial's bundled styles, let's review its normal " "output." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:26 +#: ../en/ch11-template.xml:26 msgid "" "This is somewhat informative, but it takes up a lot of space&emdash;five " "lines of output per changeset. The <literal>compact</literal> style reduces " @@ -12435,7 +14455,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:33 +#: ../en/ch11-template.xml:33 msgid "" "The <literal>changelog</literal> style hints at the expressive power of " "Mercurial's templating engine. This style attempts to follow the GNU " @@ -12443,19 +14463,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:40 +#: ../en/ch11-template.xml:40 msgid "" "You will not be shocked to learn that Mercurial's default output style is " "named <literal>default</literal>." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch10-template.xml:44 +#: ../en/ch11-template.xml:44 msgid "Setting a default style" msgstr "设置默认样式" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch10-template.xml:46 +#: ../en/ch11-template.xml:46 msgid "" "You can modify the output style that Mercurial will use for every command by " "editing your <filename role=\"special\">~/.hgrc</filename> file, naming the " @@ -12463,7 +14483,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch10-template.xml:54 +#: ../en/ch11-template.xml:54 msgid "" "If you write a style of your own, you can use it by either providing the path " "to your style file, or copying your style file into a location where " @@ -12472,12 +14492,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch10-template.xml:63 +#: ../en/ch11-template.xml:63 msgid "Commands that support styles and templates" msgstr "支持样式和模版的命令" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:65 +#: ../en/ch11-template.xml:65 msgid "" "All of Mercurial's <quote><literal>log</literal>-like</quote> commands let " "you use styles and templates: <command role=\"hg-cmd\">hg incoming</command>, " @@ -12486,21 +14506,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:72 +#: ../en/ch11-template.xml:72 msgid "" "As I write this manual, these are so far the only commands that support " "styles and templates. Since these are the most important commands that need " -"customisable output, there has been little pressure from the Mercurial user " +"customizable output, there has been little pressure from the Mercurial user " "community to add style and template support to other commands." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch10-template.xml:80 +#: ../en/ch11-template.xml:80 msgid "The basics of templating" msgstr "模版基础" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:82 +#: ../en/ch11-template.xml:82 msgid "" "At its simplest, a Mercurial template is a piece of text. Some of the text " "never changes, while other parts are <emphasis>expanded</emphasis>, or " @@ -12508,20 +14528,20 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:87 +#: ../en/ch11-template.xml:87 msgid "" "Before we continue, let's look again at a simple example of Mercurial's " "normal output." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:92 +#: ../en/ch11-template.xml:92 msgid "" "Now, let's run the same command, but using a template to change its output." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:97 +#: ../en/ch11-template.xml:97 msgid "" "The example above illustrates the simplest possible template; it's just a " "piece of static text, printed once for each changeset. The <option role=\"hg-" @@ -12531,7 +14551,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:105 +#: ../en/ch11-template.xml:105 msgid "" "Notice that the template string above ends with the text <quote><literal>\\n</" "literal></quote>. This is an <emphasis>escape sequence</emphasis>, telling " @@ -12541,14 +14561,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:113 +#: ../en/ch11-template.xml:113 msgid "" "A template that prints a fixed string of text all the time isn't very useful; " "let's try something a bit more complex." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:119 +#: ../en/ch11-template.xml:119 msgid "" "As you can see, the string <quote><literal>{desc}</literal></quote> in the " "template has been replaced in the output with the description of each " @@ -12560,25 +14580,25 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch10-template.xml:131 +#: ../en/ch11-template.xml:131 msgid "Common template keywords" msgstr "模版关键字" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:133 +#: ../en/ch11-template.xml:133 msgid "" "You can start writing simple templates immediately using the keywords below." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:137 +#: ../en/ch11-template.xml:137 msgid "" "<literal role=\"template-keyword\">author</literal>: String. The unmodified " "author of the changeset." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:141 +#: ../en/ch11-template.xml:141 msgid "" "<literal role=\"template-keyword\">branches</literal>: String. The name of " "the branch on which the changeset was committed. Will be empty if the branch " @@ -12586,7 +14606,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:147 +#: ../en/ch11-template.xml:147 msgid "" "<literal role=\"template-keyword\">date</literal>: Date information. The " "date when the changeset was committed. This is <emphasis>not</emphasis> " @@ -12598,70 +14618,70 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:158 +#: ../en/ch11-template.xml:158 msgid "" "<literal role=\"template-keyword\">desc</literal>: String. The text of the " "changeset description." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:161 +#: ../en/ch11-template.xml:161 msgid "" "<literal role=\"template-keyword\">files</literal>: List of strings. All " "files modified, added, or removed by this changeset." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:166 +#: ../en/ch11-template.xml:166 msgid "" "<literal role=\"template-keyword\">file_adds</literal>: List of strings. " "Files added by this changeset." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:170 +#: ../en/ch11-template.xml:170 msgid "" "<literal role=\"template-keyword\">file_dels</literal>: List of strings. " "Files removed by this changeset." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:174 +#: ../en/ch11-template.xml:174 msgid "" "<literal role=\"template-keyword\">node</literal>: String. The changeset " "identification hash, as a 40-character hexadecimal string." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:178 +#: ../en/ch11-template.xml:178 msgid "" "<literal role=\"template-keyword\">parents</literal>: List of strings. The " "parents of the changeset." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:182 +#: ../en/ch11-template.xml:182 msgid "" "<literal role=\"template-keyword\">rev</literal>: Integer. The repository-" "local changeset revision number." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:186 +#: ../en/ch11-template.xml:186 msgid "" "<literal role=\"template-keyword\">tags</literal>: List of strings. Any tags " "associated with the changeset." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:191 +#: ../en/ch11-template.xml:192 msgid "" "A few simple experiments will show us what to expect when we use these " "keywords; you can see the results below." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:196 +#: ../en/ch11-template.xml:197 msgid "" "As we noted above, the date keyword does not produce human-readable output, " "so we must treat it specially. This involves using a <emphasis>filter</" @@ -12669,12 +14689,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch10-template.xml:205 +#: ../en/ch11-template.xml:206 msgid "Escape sequences" msgstr "转义序列" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:207 +#: ../en/ch11-template.xml:208 msgid "" "Mercurial's templating engine recognises the most commonly used escape " "sequences in strings. When it sees a backslash (<quote><literal>\\</" @@ -12683,48 +14703,48 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:214 +#: ../en/ch11-template.xml:215 msgid "" "<literal>\\</literal>: Backslash, <quote><literal>\\</literal></quote>, ASCII " "134." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:218 +#: ../en/ch11-template.xml:219 msgid "<literal>\\n</literal>: Newline, ASCII 12." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:221 +#: ../en/ch11-template.xml:222 msgid "<literal>\\r</literal>: Carriage return, ASCII 15." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:224 +#: ../en/ch11-template.xml:225 msgid "<literal>\\t</literal>: Tab, ASCII 11." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:227 +#: ../en/ch11-template.xml:228 msgid "<literal>\\v</literal>: Vertical tab, ASCII 13." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:230 -msgid "" -"<literal>{</literal>: Open curly brace, <quote><literal>{</literal></quote>, " -"ASCII 173." +#: ../en/ch11-template.xml:231 +msgid "" +"<literal>\\{</literal>: Open curly brace, <quote><literal>{</literal></" +"quote>, ASCII 173." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:234 -msgid "" -"<literal>}</literal>: Close curly brace, <quote><literal>}</literal></quote>, " -"ASCII 175." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:239 +#: ../en/ch11-template.xml:235 +msgid "" +"<literal>\\}</literal>: Close curly brace, <quote><literal>}</literal></" +"quote>, ASCII 175." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch11-template.xml:240 msgid "" "As indicated above, if you want the expansion of a template to contain a " "literal <quote><literal>\\</literal></quote>, <quote><literal>{</literal></" @@ -12732,12 +14752,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch10-template.xml:247 +#: ../en/ch11-template.xml:248 msgid "Filtering keywords to change their results" msgstr "通过过滤关键字来修改输出结果" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:249 +#: ../en/ch11-template.xml:250 msgid "" "Some of the results of template expansion are not immediately easy to use. " "Mercurial lets you specify an optional chain of <emphasis>filters</emphasis> " @@ -12747,7 +14767,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:256 +#: ../en/ch11-template.xml:257 msgid "" "Below is a list of the most commonly used filters that Mercurial supports. " "While some filters can be applied to any text, others can only be used in " @@ -12756,7 +14776,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:263 +#: ../en/ch11-template.xml:264 msgid "" "<literal role=\"template-filter\">addbreaks</literal>: Any text. Add an XHTML " "<quote><literal><br/></literal></quote> tag before the end of every " @@ -12765,7 +14785,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:270 +#: ../en/ch11-template.xml:271 msgid "" "<literal role=\"template-kw-filt-date\">age</literal>: <literal role=" "\"template-keyword\">date</literal> keyword. Render the age of the date, " @@ -12774,7 +14794,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:277 +#: ../en/ch11-template.xml:278 msgid "" "<literal role=\"template-filter\">basename</literal>: Any text, but most " "useful for the <literal role=\"template-keyword\">files</literal> keyword and " @@ -12784,7 +14804,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:286 +#: ../en/ch11-template.xml:287 msgid "" "<literal role=\"template-kw-filt-date\">date</literal>: <literal role=" "\"template-keyword\">date</literal> keyword. Render a date in a similar " @@ -12794,7 +14814,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:294 +#: ../en/ch11-template.xml:295 msgid "" "<literal role=\"template-kw-filt-author\">domain</literal>: Any text, but " "most useful for the <literal role=\"template-keyword\">author</literal> " @@ -12805,7 +14825,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:304 +#: ../en/ch11-template.xml:305 msgid "" "<literal role=\"template-kw-filt-author\">email</literal>: Any text, but most " "useful for the <literal role=\"template-keyword\">author</literal> keyword. " @@ -12815,7 +14835,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:313 +#: ../en/ch11-template.xml:314 msgid "" "<literal role=\"template-filter\">escape</literal>: Any text. Replace the " "special XML/XHTML characters <quote><literal>&</literal></quote>, " @@ -12824,7 +14844,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:321 +#: ../en/ch11-template.xml:322 msgid "" "<literal role=\"template-filter\">fill68</literal>: Any text. Wrap the text " "to fit in 68 columns. This is useful before you pass text through the " @@ -12833,21 +14853,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:329 +#: ../en/ch11-template.xml:330 msgid "" "<literal role=\"template-filter\">fill76</literal>: Any text. Wrap the text " "to fit in 76 columns." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:333 +#: ../en/ch11-template.xml:334 msgid "" "<literal role=\"template-filter\">firstline</literal>: Any text. Yield the " "first line of text, without any trailing newlines." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:338 +#: ../en/ch11-template.xml:339 msgid "" "<literal role=\"template-kw-filt-date\">hgdate</literal>: <literal role=" "\"template-keyword\">date</literal> keyword. Render the date as a pair of " @@ -12856,7 +14876,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:345 +#: ../en/ch11-template.xml:346 msgid "" "<literal role=\"template-kw-filt-date\">isodate</literal>: <literal role=" "\"template-keyword\">date</literal> keyword. Render the date as a text " @@ -12865,7 +14885,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:352 +#: ../en/ch11-template.xml:353 msgid "" "<literal role=\"template-filter\">obfuscate</literal>: Any text, but most " "useful for the <literal role=\"template-keyword\">author</literal> keyword. " @@ -12874,7 +14894,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:360 +#: ../en/ch11-template.xml:361 msgid "" "<literal role=\"template-kw-filt-author\">person</literal>: Any text, but " "most useful for the <literal role=\"template-keyword\">author</literal> " @@ -12884,7 +14904,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:369 +#: ../en/ch11-template.xml:370 msgid "" "<literal role=\"template-kw-filt-date\">rfc822date</literal>: <literal role=" "\"template-keyword\">date</literal> keyword. Render a date using the same " @@ -12893,7 +14913,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:376 +#: ../en/ch11-template.xml:377 msgid "" "<literal role=\"template-kw-filt-node\">short</literal>: Changeset hash. " "Yield the short form of a changeset hash, i.e. a 12-character hexadecimal " @@ -12901,7 +14921,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:381 +#: ../en/ch11-template.xml:382 msgid "" "<literal role=\"template-kw-filt-date\">shortdate</literal>: <literal role=" "\"template-keyword\">date</literal> keyword. Render the year, month, and day " @@ -12910,21 +14930,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:387 +#: ../en/ch11-template.xml:388 msgid "" "<literal role=\"template-filter\">strip</literal>: Any text. Strip all " "leading and trailing whitespace from the string." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:391 +#: ../en/ch11-template.xml:392 msgid "" "<literal role=\"template-filter\">tabindent</literal>: Any text. Yield the " "text, with every line except the first starting with a tab character." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:396 +#: ../en/ch11-template.xml:397 msgid "" "<literal role=\"template-filter\">urlescape</literal>: Any text. Escape all " "characters that are considered <quote>special</quote> by URL parsers. For " @@ -12932,7 +14952,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:403 +#: ../en/ch11-template.xml:404 msgid "" "<literal role=\"template-kw-filt-author\">user</literal>: Any text, but most " "useful for the <literal role=\"template-keyword\">author</literal> keyword. " @@ -12942,7 +14962,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><note><para> -#: ../en/ch10-template.xml:416 +#: ../en/ch11-template.xml:418 msgid "" "If you try to apply a filter to a piece of data that it cannot process, " "Mercurial will fail and print a Python exception. For example, trying to run " @@ -12952,12 +14972,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch10-template.xml:425 +#: ../en/ch11-template.xml:427 msgid "Combining filters" msgstr "组合过滤器" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch10-template.xml:427 +#: ../en/ch11-template.xml:429 msgid "" "It is easy to combine filters to yield output in the form you would like. " "The following chain of filters tidies up a description, then makes sure that " @@ -12967,7 +14987,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch10-template.xml:436 +#: ../en/ch11-template.xml:438 msgid "" "Note the use of <quote><literal>\\t</literal></quote> (a tab character) in " "the template to force the first line to be indented; this is necessary since " @@ -12976,7 +14996,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch10-template.xml:442 +#: ../en/ch11-template.xml:444 msgid "" "Keep in mind that the order of filters in a chain is significant. The first " "filter is applied to the result of the keyword; the second to the result of " @@ -12986,12 +15006,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch10-template.xml:453 +#: ../en/ch11-template.xml:454 msgid "From templates to styles" msgstr "从模版到样式" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:455 +#: ../en/ch11-template.xml:456 msgid "" "A command line template provides a quick and simple way to format some " "output. Templates can become verbose, though, and it's useful to be able to " @@ -13000,7 +15020,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:460 +#: ../en/ch11-template.xml:461 msgid "" "More than that, using a style file unlocks the power of Mercurial's " "templating engine in ways that are not possible using the command line " @@ -13008,49 +15028,49 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch10-template.xml:466 +#: ../en/ch11-template.xml:467 msgid "The simplest of style files" msgstr "最简单的样式文件" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch10-template.xml:468 +#: ../en/ch11-template.xml:469 msgid "Our simple style file contains just one line:" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch10-template.xml:472 +#: ../en/ch11-template.xml:473 msgid "" "This tells Mercurial, <quote>if you're printing a changeset, use the text on " "the right as the template</quote>." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch10-template.xml:478 +#: ../en/ch11-template.xml:479 msgid "Style file syntax" msgstr "样式文件语法" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch10-template.xml:480 +#: ../en/ch11-template.xml:481 msgid "The syntax rules for a style file are simple." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:483 +#: ../en/ch11-template.xml:484 msgid "The file is processed one line at a time." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:486 +#: ../en/ch11-template.xml:487 msgid "Leading and trailing white space are ignored." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:489 +#: ../en/ch11-template.xml:490 msgid "Empty lines are skipped." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:491 +#: ../en/ch11-template.xml:492 msgid "" "If a line starts with either of the characters <quote><literal>#</literal></" "quote> or <quote><literal>;</literal></quote>, the entire line is treated as " @@ -13058,7 +15078,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:496 +#: ../en/ch11-template.xml:497 msgid "" "A line starts with a keyword. This must start with an alphabetic character " "or underscore, and can subsequently contain any alphanumeric character or " @@ -13067,21 +15087,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:502 +#: ../en/ch11-template.xml:503 msgid "" "The next element must be an <quote><literal>=</literal></quote> character, " "which can be preceded or followed by an arbitrary amount of white space." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:507 +#: ../en/ch11-template.xml:508 msgid "" "If the rest of the line starts and ends with matching quote characters " "(either single or double quote), it is treated as a template body." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:511 +#: ../en/ch11-template.xml:512 msgid "" "If the rest of the line <emphasis>does not</emphasis> start with a quote " "character, it is treated as the name of a file; the contents of this file " @@ -13089,12 +15109,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch10-template.xml:520 +#: ../en/ch11-template.xml:521 msgid "Style files by example" msgstr "样式文件例子" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch10-template.xml:522 +#: ../en/ch11-template.xml:523 msgid "" "To illustrate how to write a style file, we will construct a few by example. " "Rather than provide a complete style file and walk through it, we'll mirror " @@ -13103,12 +15123,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch10-template.xml:529 +#: ../en/ch11-template.xml:530 msgid "Identifying mistakes in style files" msgstr "在样式文件中定位错误" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch10-template.xml:531 +#: ../en/ch11-template.xml:532 msgid "" "If Mercurial encounters a problem in a style file you are working on, it " "prints a terse error message that, once you figure out what it means, is " @@ -13116,7 +15136,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch10-template.xml:537 +#: ../en/ch11-template.xml:538 msgid "" "Notice that <filename>broken.style</filename> attempts to define a " "<literal>changeset</literal> keyword, but forgets to give any content for it. " @@ -13124,35 +15144,35 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch10-template.xml:544 +#: ../en/ch11-template.xml:545 msgid "This error message looks intimidating, but it is not too hard to follow." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:548 +#: ../en/ch11-template.xml:549 msgid "" "The first component is simply Mercurial's way of saying <quote>I am giving " "up</quote>." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:552 +#: ../en/ch11-template.xml:553 msgid "Next comes the name of the style file that contains the error." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:556 +#: ../en/ch11-template.xml:557 msgid "" "Following the file name is the line number where the error was encountered." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:560 +#: ../en/ch11-template.xml:561 msgid "Finally, a description of what went wrong." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:564 +#: ../en/ch11-template.xml:565 msgid "" "The description of the problem is not always clear (as in this case), but " "even when it is cryptic, it is almost always trivial to visually inspect the " @@ -13160,12 +15180,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch10-template.xml:572 +#: ../en/ch11-template.xml:574 msgid "Uniquely identifying a repository" msgstr "版本库的唯一标识" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch10-template.xml:574 +#: ../en/ch11-template.xml:576 msgid "" "If you would like to be able to identify a Mercurial repository <quote>fairly " "uniquely</quote> using a short string as an identifier, you can use the first " @@ -13173,21 +15193,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch10-template.xml:581 -msgid "" -"This is not guaranteed to be unique, but it is nevertheless useful in many " -"cases." +#: ../en/ch11-template.xml:583 +msgid "" +"This is likely to be unique, and so it is useful in many cases. There are a " +"few caveats." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:584 +#: ../en/ch11-template.xml:586 msgid "" "It will not work in a completely empty repository, because such a repository " "does not have a revision zero." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:588 +#: ../en/ch11-template.xml:590 msgid "" "Neither will it work in the (extremely rare) case where a repository is a " "merge of two or more formerly independent repositories, and you still have " @@ -13195,18 +15215,18 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch10-template.xml:593 +#: ../en/ch11-template.xml:595 msgid "Here are some uses to which you could put this identifier:" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:596 +#: ../en/ch11-template.xml:598 msgid "" "As a key into a table for a database that manages repositories on a server." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:599 +#: ../en/ch11-template.xml:601 msgid "" "As half of a {<emphasis>repository ID</emphasis>, <emphasis>revision ID</" "emphasis>} tuple. Save this information away when you run an automated build " @@ -13215,13 +15235,25 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch10-template.xml:608 +#: ../en/ch11-template.xml:611 +msgid "Listing files on multiple lines" +msgstr "每行列出一个文件" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch11-template.xml:613 +msgid "" +"Suppose we want to list the files changed by a changeset, one per line, with " +"a little indentation before each file name." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><title> +#: ../en/ch11-template.xml:621 msgid "Mimicking Subversion's output" msgstr "模仿 Subversion 的输出" # #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch10-template.xml:610 +#: ../en/ch11-template.xml:623 msgid "" "Let's try to emulate the default output format used by another revision " "control tool, Subversion." @@ -13229,7 +15261,7 @@ # #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch10-template.xml:615 +#: ../en/ch11-template.xml:628 msgid "" "Since Subversion's output style is fairly simple, it is easy to copy-and-" "paste a hunk of its output into a file, and replace the text produced above " @@ -13237,14 +15269,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch10-template.xml:622 +#: ../en/ch11-template.xml:635 msgid "" "There are a few small ways in which this template deviates from the output " "produced by Subversion." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:625 +#: ../en/ch11-template.xml:638 msgid "" "Subversion prints a <quote>readable</quote> date (the <quote><literal>Wed, 27 " "Sep 2006</literal></quote> in the example output above) in parentheses. " @@ -13253,7 +15285,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:632 +#: ../en/ch11-template.xml:645 msgid "" "We emulate Subversion's printing of <quote>separator</quote> lines full of " "<quote><literal>-</literal></quote> characters by ending the template with " @@ -13263,7 +15295,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch10-template.xml:641 +#: ../en/ch11-template.xml:654 msgid "" "Subversion's output includes a count in the header of the number of lines in " "the commit message. We cannot replicate this in Mercurial; the templating " @@ -13273,7 +15305,7 @@ # #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch10-template.xml:647 +#: ../en/ch11-template.xml:660 msgid "" "It took me no more than a minute or two of work to replace literal text from " "an example of Subversion's output with some keywords and filters to give the " @@ -13281,7 +15313,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch10-template.xml:654 +#: ../en/ch11-template.xml:667 msgid "" "We could have included the text of the template file directly in the style " "file by enclosing it in quotes and replacing the newlines with " @@ -13294,17 +15326,17 @@ msgstr "" #. type: Content of: <book><chapter><title> -#: ../en/ch11-mq.xml:5 +#: ../en/ch12-mq.xml:5 msgid "Managing change with Mercurial Queues" msgstr "使用 MQ 管理修改" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch11-mq.xml:8 +#: ../en/ch12-mq.xml:8 msgid "The patch management problem" msgstr "补丁的管理问题" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:10 +#: ../en/ch12-mq.xml:10 msgid "" "Here is a common scenario: you need to install a software package from " "source, but you find a bug that you must fix in the source before you can " @@ -13316,7 +15348,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:20 +#: ../en/ch12-mq.xml:20 msgid "" "This is a simple case of the <quote>patch management</quote> problem. You " "have an <quote>upstream</quote> source tree that you can't change; you need " @@ -13326,7 +15358,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:27 +#: ../en/ch12-mq.xml:27 msgid "" "The patch management problem arises in many situations. Probably the most " "visible is that a user of an open source software project will contribute a " @@ -13334,7 +15366,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:32 +#: ../en/ch12-mq.xml:32 msgid "" "Distributors of operating systems that include open source software often " "need to make changes to the packages they distribute so that they will build " @@ -13342,7 +15374,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:37 +#: ../en/ch12-mq.xml:37 msgid "" "When you have few changes to maintain, it is easy to manage a single patch " "using the standard <command>diff</command> and <command>patch</command> " @@ -13359,7 +15391,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:52 +#: ../en/ch12-mq.xml:52 msgid "" "Maintaining a single patch against an upstream tree is a little tedious and " "error-prone, but not difficult. However, the complexity of the problem grows " @@ -13369,7 +15401,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:59 +#: ../en/ch12-mq.xml:59 msgid "" "Fortunately, Mercurial includes a powerful extension, Mercurial Queues (or " "simply <quote>MQ</quote>), that massively simplifies the patch management " @@ -13377,21 +15409,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch11-mq.xml:65 +#: ../en/ch12-mq.xml:65 msgid "The prehistory of Mercurial Queues" msgstr "MQ 的历史" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:67 +#: ../en/ch12-mq.xml:67 msgid "" "During the late 1990s, several Linux kernel developers started to maintain " -"<quote>patch series</quote> that modified the behaviour of the Linux kernel. " +"<quote>patch series</quote> that modified the behavior of the Linux kernel. " "Some of these series were focused on stability, some on feature coverage, and " "others were more speculative." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:73 +#: ../en/ch12-mq.xml:73 msgid "" "The sizes of these patch series grew rapidly. In 2002, Andrew Morton " "published some shell scripts he had been using to automate the task of " @@ -13400,12 +15432,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch11-mq.xml:80 +#: ../en/ch12-mq.xml:80 msgid "A patchwork quilt" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:82 +#: ../en/ch12-mq.xml:82 msgid "" "In early 2003, Andreas Gruenbacher and Martin Quinson borrowed the approach " "of Andrew's scripts and published a tool called <quote>patchwork quilt</" @@ -13416,7 +15448,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:91 +#: ../en/ch12-mq.xml:91 msgid "" "Quilt manages a <emphasis>stack of patches</emphasis> on top of a directory " "tree. To begin, you tell quilt to manage a directory tree, and tell it which " @@ -13426,7 +15458,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:99 +#: ../en/ch12-mq.xml:99 msgid "" "The refresh step causes quilt to scan the directory tree; it updates the " "patch with all of the changes you have made. You can create another patch on " @@ -13436,7 +15468,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:106 +#: ../en/ch12-mq.xml:106 msgid "" "You can <emphasis>change</emphasis> which patches are applied to the tree. " "If you <quote>pop</quote> a patch, the changes made by that patch will vanish " @@ -13450,27 +15482,26 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:118 +#: ../en/ch12-mq.xml:118 msgid "" "Quilt knows nothing about revision control tools, so it works equally well on " "top of an unpacked tarball or a Subversion working copy." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch11-mq.xml:124 +#: ../en/ch12-mq.xml:124 msgid "From patchwork quilt to Mercurial Queues" msgstr "从 patchwork quilt 到 MQ" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:126 +#: ../en/ch12-mq.xml:126 msgid "" "In mid-2005, Chris Mason took the features of quilt and wrote an extension " -"that he called Mercurial Queues, which added quilt-like behaviour to " -"Mercurial." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:130 +"that he called Mercurial Queues, which added quilt-like behavior to Mercurial." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch12-mq.xml:130 msgid "" "The key difference between quilt and MQ is that quilt knows nothing about " "revision control systems, while MQ is <emphasis>integrated</emphasis> into " @@ -13479,7 +15510,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:136 +#: ../en/ch12-mq.xml:136 msgid "" "Because quilt does not care about revision control tools, it is still a " "tremendously useful piece of software to know about for situations where you " @@ -13487,19 +15518,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch11-mq.xml:144 +#: ../en/ch12-mq.xml:144 msgid "The huge advantage of MQ" msgstr "MQ 的巨大优势" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:146 +#: ../en/ch12-mq.xml:146 msgid "" "I cannot overstate the value that MQ offers through the unification of " "patches and revision control." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:149 +#: ../en/ch12-mq.xml:149 msgid "" "A major reason that patches have persisted in the free software and open " "source world&emdash;in spite of the availability of increasingly capable " @@ -13508,7 +15539,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:155 +#: ../en/ch12-mq.xml:155 msgid "" "Traditional revision control tools make a permanent, irreversible record of " "everything that you do. While this has great value, it's also somewhat " @@ -13519,7 +15550,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:163 +#: ../en/ch12-mq.xml:163 msgid "" "By contrast, MQ's marriage of distributed revision control with patches makes " "it much easier to isolate your work. Your patches live on top of normal " @@ -13530,7 +15561,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:171 +#: ../en/ch12-mq.xml:171 msgid "" "As an example, the integration of patches with revision control makes " "understanding patches and debugging their effects&emdash;and their interplay " @@ -13545,14 +15576,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:189 +#: ../en/ch12-mq.xml:189 msgid "" "Because MQ doesn't hide its patch-oriented nature, it is helpful to " "understand what patches are, and a little about the tools that work with them." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:193 +#: ../en/ch12-mq.xml:193 msgid "" "The traditional Unix <command>diff</command> command compares two files, and " "prints a list of differences between them. The <command>patch</command> " @@ -13562,7 +15593,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:202 +#: ../en/ch12-mq.xml:202 msgid "" "The type of file that <command>diff</command> generates (and <command>patch</" "command> takes as input) is called a <quote>patch</quote> or a <quote>diff</" @@ -13571,7 +15602,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:208 +#: ../en/ch12-mq.xml:208 msgid "" "A patch file can start with arbitrary text; the <command>patch</command> " "command ignores this text, but MQ uses it as the commit message when creating " @@ -13581,7 +15612,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:215 +#: ../en/ch12-mq.xml:215 msgid "" "MQ works with <emphasis>unified</emphasis> diffs (<command>patch</command> " "can accept several other diff formats, but MQ doesn't). A unified diff " @@ -13592,7 +15623,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:223 +#: ../en/ch12-mq.xml:223 msgid "" "After the file header comes a series of <emphasis>hunks</emphasis>. Each " "hunk starts with a header; this identifies the range of line numbers within " @@ -13605,7 +15636,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:235 +#: ../en/ch12-mq.xml:235 msgid "" "Each line of context begins with a space character. Within the hunk, a line " "that begins with <quote><literal>-</literal></quote> means <quote>remove this " @@ -13615,7 +15646,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:243 +#: ../en/ch12-mq.xml:243 msgid "" "We will return to some of the more subtle aspects of patches later (in <xref " "linkend=\"sec:mq:adv-patch\"/>), but you should have enough information now " @@ -13623,12 +15654,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch11-mq.xml:250 +#: ../en/ch12-mq.xml:250 msgid "Getting started with Mercurial Queues" msgstr "开始使用 MQ" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:252 +#: ../en/ch12-mq.xml:252 msgid "" "Because MQ is implemented as an extension, you must explicitly enable before " "you can use it. (You don't need to download anything; MQ ships with the " @@ -13637,7 +15668,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:262 +#: ../en/ch12-mq.xml:262 msgid "" "Once the extension is enabled, it will make a number of new commands " "available. To verify that the extension is working, you can use <command " @@ -13646,7 +15677,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:270 +#: ../en/ch12-mq.xml:270 msgid "" "You can use MQ with <emphasis>any</emphasis> Mercurial repository, and its " "commands only operate within that repository. To get started, simply prepare " @@ -13654,7 +15685,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:277 +#: ../en/ch12-mq.xml:277 msgid "" "This command creates an empty directory called <filename role=\"special\" " "class=\"directory\">.hg/patches</filename>, where MQ will keep its metadata. " @@ -13663,12 +15694,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch11-mq.xml:284 +#: ../en/ch12-mq.xml:284 msgid "Creating a new patch" msgstr "创建新补丁" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:286 +#: ../en/ch12-mq.xml:286 msgid "" "To begin work on a new patch, use the <command role=\"hg-ext-mq\">qnew</" "command> command. This command takes one argument, the name of the patch to " @@ -13676,14 +15707,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:290 +#: ../en/ch12-mq.xml:290 msgid "" "MQ will use this as the name of an actual file in the <filename role=\"special" "\" class=\"directory\">.hg/patches</filename> directory, as you can see below." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:297 +#: ../en/ch12-mq.xml:297 msgid "" "Also newly present in the <filename role=\"special\" class=\"directory\">.hg/" "patches</filename> directory are two other files, <filename role=\"special" @@ -13696,7 +15727,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><note><para> -#: ../en/ch11-mq.xml:309 +#: ../en/ch12-mq.xml:309 msgid "" "You may sometimes want to edit the <filename role=\"special\">series</" "filename> file by hand; for example, to change the sequence in which some " @@ -13706,7 +15737,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:318 +#: ../en/ch12-mq.xml:318 msgid "" "Once you have created your new patch, you can edit files in the working " "directory as you usually would. All of the normal Mercurial commands, such " @@ -13715,12 +15746,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch11-mq.xml:326 +#: ../en/ch12-mq.xml:326 msgid "Refreshing a patch" msgstr "刷新补丁" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:328 +#: ../en/ch12-mq.xml:328 msgid "" "When you reach a point where you want to save your work, use the <command " "role=\"hg-ext-mq\">qrefresh</command> command to update the patch you are " @@ -13728,14 +15759,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:334 +#: ../en/ch12-mq.xml:334 msgid "" "This command folds the changes you have made in the working directory into " "your patch, and updates its corresponding changeset to contain those changes." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:338 +#: ../en/ch12-mq.xml:338 msgid "" "You can run <command role=\"hg-ext-mq\">qrefresh</command> as often as you " "like, so it's a good way to <quote>checkpoint</quote> your work. Refresh " @@ -13745,12 +15776,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch11-mq.xml:349 +#: ../en/ch12-mq.xml:349 msgid "Stacking and tracking patches" msgstr "堆叠和跟踪补丁" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:351 +#: ../en/ch12-mq.xml:351 msgid "" "Once you have finished working on a patch, or need to work on another, you " "can use the <command role=\"hg-ext-mq\">qnew</command> command again to " @@ -13759,7 +15790,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:358 +#: ../en/ch12-mq.xml:359 msgid "" "Notice that the patch contains the changes in our prior patch as part of its " "context (you can see this more clearly in the output of <command role=\"hg-cmd" @@ -13767,7 +15798,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:363 +#: ../en/ch12-mq.xml:364 msgid "" "So far, with the exception of <command role=\"hg-ext-mq\">qnew</command> and " "<command role=\"hg-ext-mq\">qrefresh</command>, we've been careful to only " @@ -13776,7 +15807,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch11-mq.xml:373 +#: ../en/ch12-mq.xml:374 msgid "" "The <command role=\"hg-ext-mq\">qseries</command> command lists every patch " "that MQ knows about in this repository, from oldest to newest (most recently " @@ -13784,7 +15815,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch11-mq.xml:379 +#: ../en/ch12-mq.xml:380 msgid "" "The <command role=\"hg-ext-mq\">qapplied</command> command lists every patch " "that MQ has <emphasis>applied</emphasis> in this repository, again from " @@ -13792,12 +15823,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch11-mq.xml:388 +#: ../en/ch12-mq.xml:389 msgid "Manipulating the patch stack" msgstr "操作补丁堆栈" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:390 +#: ../en/ch12-mq.xml:391 msgid "" "The previous discussion implied that there must be a difference between " "<quote>known</quote> and <quote>applied</quote> patches, and there is. MQ " @@ -13805,7 +15836,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:395 +#: ../en/ch12-mq.xml:396 msgid "" "An <emphasis>applied</emphasis> patch has a corresponding changeset in the " "repository, and the effects of the patch and changeset are visible in the " @@ -13818,17 +15849,17 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><figure><title> -#: ../en/ch11-mq.xml:408 +#: ../en/ch12-mq.xml:409 msgid "Applied and unapplied patches in the MQ patch stack" msgstr "在 MQ 补丁堆栈中应用和撤销补丁" #. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject> -#: ../en/ch11-mq.xml:411 +#: ../en/ch12-mq.xml:412 msgid "<imageobject><imagedata fileref=\"figs/mq-stack.png\"/></imageobject>" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:416 +#: ../en/ch12-mq.xml:417 msgid "" "You can reapply an unapplied, or popped, patch using the <command role=\"hg-" "ext-mq\">qpush</command> command. This creates a new changeset to correspond " @@ -13838,7 +15869,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:425 +#: ../en/ch12-mq.xml:427 msgid "" "Notice that once we have popped a patch or two patches, the output of " "<command role=\"hg-ext-mq\">qseries</command> remains the same, while that of " @@ -13846,12 +15877,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch11-mq.xml:433 +#: ../en/ch12-mq.xml:435 msgid "Pushing and popping many patches" msgstr "压入或弹出多个补丁" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:435 +#: ../en/ch12-mq.xml:437 msgid "" "While <command role=\"hg-ext-mq\">qpush</command> and <command role=\"hg-ext-" "mq\">qpop</command> each operate on a single patch at a time by default, you " @@ -13864,12 +15895,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch11-mq.xml:451 +#: ../en/ch12-mq.xml:453 msgid "Safety checks, and overriding them" msgstr "安全的检查,然后覆盖它们" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:453 +#: ../en/ch12-mq.xml:455 msgid "" "Several MQ commands check the working directory before they do anything, and " "fail if they find any modifications. They do this to ensure that you won't " @@ -13881,7 +15912,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:465 +#: ../en/ch12-mq.xml:467 msgid "" "Commands that check the working directory all take an <quote>I know what I'm " "doing</quote> option, which is always named <option>-f</option>. The exact " @@ -13895,12 +15926,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch11-mq.xml:480 +#: ../en/ch12-mq.xml:482 msgid "Working on several patches at once" msgstr "同时处理多个补丁" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:482 +#: ../en/ch12-mq.xml:484 msgid "" "The <command role=\"hg-ext-mq\">qrefresh</command> command always refreshes " "the <emphasis>topmost</emphasis> applied patch. This means that you can " @@ -13909,7 +15940,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:489 +#: ../en/ch12-mq.xml:491 msgid "" "Here's an example that illustrates how you can use this ability. Let's say " "you're developing a new feature as two patches. The first is a change to the " @@ -13925,12 +15956,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch11-mq.xml:506 +#: ../en/ch12-mq.xml:508 msgid "More about patches" msgstr "关于补丁的更多信息" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:508 +#: ../en/ch12-mq.xml:510 msgid "" "MQ uses the GNU <command>patch</command> command to apply patches, so it's " "helpful to know a few more detailed aspects of how <command>patch</command> " @@ -13938,12 +15969,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch11-mq.xml:514 +#: ../en/ch12-mq.xml:516 msgid "The strip count" msgstr "修剪计数" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:516 +#: ../en/ch12-mq.xml:518 msgid "" "If you look at the file headers in a patch, you will notice that the " "pathnames usually have an extra component on the front that isn't present in " @@ -13953,7 +15984,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:523 +#: ../en/ch12-mq.xml:525 msgid "" "Alice would unpack a tarball, edit her files, then decide that she wanted to " "create a patch. So she'd rename her working directory, unpack the tarball " @@ -13967,7 +15998,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:536 +#: ../en/ch12-mq.xml:538 msgid "" "Since someone receiving a patch from the Alices of the net would be unlikely " "to have unmodified and modified directories with exactly the same names, the " @@ -13978,7 +16009,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:544 +#: ../en/ch12-mq.xml:546 msgid "" "An option of <quote><literal>-p1</literal></quote> means <quote>use a strip " "count of one</quote>. If <command>patch</command> sees a file name " @@ -13992,7 +16023,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:557 +#: ../en/ch12-mq.xml:559 msgid "" "The <quote>standard</quote> strip count for patches is one; almost all " "patches contain one leading path name component that needs to be stripped. " @@ -14002,7 +16033,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:565 +#: ../en/ch12-mq.xml:567 msgid "" "If you receive a patch from someone that you want to add to your patch queue, " "and the patch needs a strip count other than one, you cannot just <command " @@ -14019,12 +16050,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch11-mq.xml:584 +#: ../en/ch12-mq.xml:587 msgid "Strategies for applying a patch" msgstr "应用补丁的策略" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:586 +#: ../en/ch12-mq.xml:589 msgid "" "When <command>patch</command> applies a hunk, it tries a handful of " "successively less accurate strategies to try to make the hunk apply. This " @@ -14034,7 +16065,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:593 +#: ../en/ch12-mq.xml:596 msgid "" "First, <command>patch</command> tries an exact match, where the line numbers, " "the context, and the text to be modified must apply exactly. If it cannot " @@ -14045,7 +16076,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:602 +#: ../en/ch12-mq.xml:605 msgid "" "If a context-only match fails, <command>patch</command> removes the first and " "last lines of the context, and tries a <emphasis>reduced</emphasis> context-" @@ -14056,7 +16087,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:611 +#: ../en/ch12-mq.xml:614 msgid "" "When neither of these techniques works, <command>patch</command> prints a " "message saying that the hunk in question was rejected. It saves rejected " @@ -14073,33 +16104,33 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch11-mq.xml:629 +#: ../en/ch12-mq.xml:632 msgid "Some quirks of patch representation" msgstr "补丁的一些特性" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:631 +#: ../en/ch12-mq.xml:634 msgid "" "There are a few useful things to know about how <command>patch</command> " "works with files." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch11-mq.xml:634 +#: ../en/ch12-mq.xml:637 msgid "" "This should already be obvious, but <command>patch</command> cannot handle " "binary files." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch11-mq.xml:638 +#: ../en/ch12-mq.xml:641 msgid "" "Neither does it care about the executable bit; it creates new files as " "readable, but not executable." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch11-mq.xml:642 +#: ../en/ch12-mq.xml:645 msgid "" "<command>patch</command> treats the removal of a file as a diff between the " "file to be removed and the empty file. So your idea of <quote>I deleted this " @@ -14108,7 +16139,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch11-mq.xml:648 +#: ../en/ch12-mq.xml:651 msgid "" "It treats the addition of a file as a diff between the empty file and the " "file to be added. So in a patch, your idea of <quote>I added this file</" @@ -14116,7 +16147,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch11-mq.xml:654 +#: ../en/ch12-mq.xml:657 msgid "" "It treats a renamed file as the removal of the old name, and the addition of " "the new name. This means that renamed files have a big footprint in " @@ -14125,7 +16156,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch11-mq.xml:660 +#: ../en/ch12-mq.xml:663 msgid "" "<command>patch</command> cannot represent empty files, so you cannot use a " "patch to represent the notion <quote>I added this empty file to the tree</" @@ -14133,12 +16164,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch11-mq.xml:667 +#: ../en/ch12-mq.xml:671 msgid "Beware the fuzz" msgstr "当心毛刺" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:669 +#: ../en/ch12-mq.xml:673 msgid "" "While applying a hunk at an offset, or with a fuzz factor, will often be " "completely successful, these inexact techniques naturally leave open the " @@ -14150,7 +16181,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:679 +#: ../en/ch12-mq.xml:683 msgid "" "It's often a good idea to refresh a patch that has applied with an offset or " "fuzz factor; refreshing the patch generates new context information that will " @@ -14163,12 +16194,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch11-mq.xml:692 +#: ../en/ch12-mq.xml:696 msgid "Handling rejection" msgstr "处理拒绝" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:694 +#: ../en/ch12-mq.xml:698 msgid "" "If <command role=\"hg-ext-mq\">qpush</command> fails to apply a patch, it " "will print an error message and exit. If it has left <filename role=\"special" @@ -14177,7 +16208,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:700 +#: ../en/ch12-mq.xml:704 msgid "" "If your patch <emphasis>used to</emphasis> apply cleanly, and no longer does " "because you've changed the underlying code that your patches are based on, " @@ -14185,7 +16216,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:705 +#: ../en/ch12-mq.xml:709 msgid "" "Unfortunately, there aren't any great techniques for dealing with rejected " "hunks. Most often, you'll need to view the <filename role=\"special\">.rej</" @@ -14193,76 +16224,135 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:710 -msgid "" -"If you're feeling adventurous, Neil Brown, a Linux kernel hacker, wrote a " -"tool called <command>wiggle</command> <citation>web:wiggle</citation>, which " -"is more vigorous than <command>patch</command> in its attempts to make a " -"patch apply." -msgstr "" - -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:716 -msgid "" -"Another Linux kernel hacker, Chris Mason (the author of Mercurial Queues), " -"wrote a similar tool called <command>mpatch</command> <citation>web:mpatch</" -"citation>, which takes a simple approach to automating the application of " -"hunks rejected by <command>patch</command>. The <command>mpatch</command> " -"command can help with four common reasons that a hunk may be rejected:" +#: ../en/ch12-mq.xml:714 +msgid "" +"A Linux kernel hacker, Chris Mason (the author of Mercurial Queues), wrote a " +"tool called <command>mpatch</command> (<ulink url=\"http://oss.oracle.com/" +"~mason/mpatch/\">http://oss.oracle.com/~mason/mpatch/</ulink>), which takes a " +"simple approach to automating the application of hunks rejected by " +"<command>patch</command>. The <command>mpatch</command> command can help " +"with four common reasons that a hunk may be rejected:" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch11-mq.xml:725 +#: ../en/ch12-mq.xml:724 msgid "The context in the middle of a hunk has changed." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch11-mq.xml:728 +#: ../en/ch12-mq.xml:727 msgid "A hunk is missing some context at the beginning or end." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch11-mq.xml:731 +#: ../en/ch12-mq.xml:730 msgid "" "A large hunk might apply better&emdash;either entirely or in part&emdash;if " "it was broken up into smaller hunks." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch11-mq.xml:735 +#: ../en/ch12-mq.xml:734 msgid "" "A hunk removes lines with slightly different content than those currently " "present in the file." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:739 -msgid "" -"If you use <command>wiggle</command> or <command>mpatch</command>, you should " -"be doubly careful to check your results when you're done. In fact, " -"<command>mpatch</command> enforces this method of double-checking the tool's " -"output, by automatically dropping you into a merge program when it has done " -"its job, so that you can verify its work and finish off any remaining merges." +#: ../en/ch12-mq.xml:738 +msgid "" +"If you use <command>mpatch</command>, you should be doubly careful to check " +"your results when you're done. In fact, <command>mpatch</command> enforces " +"this method of double-checking the tool's output, by automatically dropping " +"you into a merge program when it has done its job, so that you can verify its " +"work and finish off any remaining merges." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch11-mq.xml:751 +#: ../en/ch12-mq.xml:749 +msgid "More on patch management" +msgstr "补丁管理进阶" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch12-mq.xml:751 +msgid "" +"As you grow familiar with MQ, you will find yourself wanting to perform other " +"kinds of patch management operations." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><title> +#: ../en/ch12-mq.xml:755 +msgid "Deleting unwanted patches" +msgstr "删除不需要的补丁" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch12-mq.xml:757 +msgid "" +"If you want to get rid of a patch, use the <command role=\"hg-ext-mq\">hg " +"qdelete</command> command to delete the patch file and remove its entry from " +"the patch series. If you try to delete a patch that is still applied, " +"<command role=\"hg-ext-mq\">hg qdelete</command> will refuse." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><title> +#: ../en/ch12-mq.xml:767 +msgid "Converting to and from permanent revisions" +msgstr "与持久版本的相互转换" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch12-mq.xml:769 +msgid "" +"Once you're done working on a patch and want to turn it into a permanent " +"changeset, use the <command role=\"hg-ext-mq\">hg qfinish</command> command. " +"Pass a revision to the command to identify the patch that you want to turn " +"into a regular changeset; this patch must already be applied." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch12-mq.xml:777 +msgid "" +"The <command role=\"hg-ext-mq\">hg qfinish</command> command accepts an " +"<option>--all</option> or <option>-a</option> option, which turns all applied " +"patches into regular changesets." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch12-mq.xml:782 +msgid "" +"It is also possible to turn an existing changeset into a patch, by passing " +"the <option>-r</option> option to <command role=\"hg-ext-mq\">hg qimport</" +"command>." +msgstr "" + +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch12-mq.xml:788 +msgid "" +"Note that it only makes sense to convert a changeset into a patch if you have " +"not propagated that changeset into any other repositories. The imported " +"changeset's ID will change every time you refresh the patch, which will make " +"Mercurial treat it as unrelated to the original changeset if you have pushed " +"it somewhere else." +msgstr "" + +#. type: Content of: <book><chapter><sect1><title> +#: ../en/ch12-mq.xml:798 msgid "Getting the best performance out of MQ" msgstr "MQ 的性能" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:753 -msgid "" -"MQ is very efficient at handling a large number of patches. I ran some " +#: ../en/ch12-mq.xml:800 +msgid "" +"MQ is very efficient at handling a large number of patches. I ran some " "performance experiments in mid-2006 for a talk that I gave at the 2006 " -"EuroPython conference <citation>web:europython</citation>. I used as my data " -"set the Linux 2.6.17-mm1 patch series, which consists of 1,738 patches. I " -"applied these on top of a Linux kernel repository containing all 27,472 " -"revisions between Linux 2.6.12-rc2 and Linux 2.6.17." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:762 +"EuroPython conference (on modern hardware, you should expect better " +"performance than you'll see below). I used as my data set the Linux 2.6.17-" +"mm1 patch series, which consists of 1,738 patches. I applied these on top of " +"a Linux kernel repository containing all 27,472 revisions between Linux " +"2.6.12-rc2 and Linux 2.6.17." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch12-mq.xml:809 msgid "" "On my old, slow laptop, I was able to <command role=\"hg-cmd\">hg qpush " "<option role=\"hg-ext-mq-cmd-qpush-opt\">hg -a</option></command> all 1,738 " @@ -14274,14 +16364,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:773 +#: ../en/ch12-mq.xml:820 msgid "" "Clearly, MQ is well suited to working in large trees, but there are a few " "tricks you can use to get the best performance of it." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:777 +#: ../en/ch12-mq.xml:824 msgid "" "First of all, try to <quote>batch</quote> operations together. Every time " "you run <command role=\"hg-ext-mq\">qpush</command> or <command role=\"hg-ext-" @@ -14293,7 +16383,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:788 +#: ../en/ch12-mq.xml:835 msgid "" "The <command role=\"hg-ext-mq\">qpush</command> and <command role=\"hg-ext-mq" "\">qpop</command> commands allow you to push and pop multiple patches at a " @@ -14305,7 +16395,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:798 +#: ../en/ch12-mq.xml:845 msgid "" "You can identify a destination patch using either the name of the patch, or " "by number. If you use numeric addressing, patches are counted from zero; " @@ -14313,12 +16403,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch11-mq.xml:805 +#: ../en/ch12-mq.xml:852 msgid "Updating your patches when the underlying code changes" msgstr "当基础代码改变时,更新补丁的方法" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:808 +#: ../en/ch12-mq.xml:855 msgid "" "It's common to have a stack of patches on top of an underlying repository " "that you don't modify directly. If you're working on changes to third-party " @@ -14329,7 +16419,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:817 +#: ../en/ch12-mq.xml:864 msgid "" "The simplest way to do this is to <command role=\"hg-cmd\">hg qpop <option " "role=\"hg-ext-mq-cmd-qpop-opt\">hg -a</option></command> your patches, then " @@ -14343,7 +16433,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:829 +#: ../en/ch12-mq.xml:876 msgid "" "This approach is easy to use and works well if you don't expect changes to " "the underlying code to affect how well your patches apply. If your patch " @@ -14353,7 +16443,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:836 +#: ../en/ch12-mq.xml:883 msgid "" "It's possible to partially automate the rebasing process. If your patches " "apply cleanly against some revision of the underlying repo, MQ can use this " @@ -14362,19 +16452,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:842 +#: ../en/ch12-mq.xml:889 msgid "The process is a little involved." msgstr "" #. type: Content of: <book><chapter><sect1><orderedlist><listitem><para> -#: ../en/ch11-mq.xml:844 +#: ../en/ch12-mq.xml:891 msgid "" "To begin, <command role=\"hg-cmd\">hg qpush -a</command> all of your patches " "on top of the revision where you know that they apply cleanly." msgstr "" #. type: Content of: <book><chapter><sect1><orderedlist><listitem><para> -#: ../en/ch11-mq.xml:848 +#: ../en/ch12-mq.xml:895 msgid "" "Save a backup copy of your patch directory using <command role=\"hg-cmd\">hg " "qsave <option role=\"hg-ext-mq-cmd-qsave-opt\">hg -e</option> <option role=" @@ -14389,7 +16479,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><orderedlist><listitem><para> -#: ../en/ch11-mq.xml:862 +#: ../en/ch12-mq.xml:909 msgid "" "Use <command role=\"hg-cmd\">hg pull</command> to bring new changes into the " "underlying repository. (Don't run <command role=\"hg-cmd\">hg pull -u</" @@ -14397,7 +16487,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><orderedlist><listitem><para> -#: ../en/ch11-mq.xml:867 +#: ../en/ch12-mq.xml:914 msgid "" "Update to the new tip revision, using <command role=\"hg-cmd\">hg update " "<option role=\"hg-opt-update\">-C</option></command> to override the patches " @@ -14405,7 +16495,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><orderedlist><listitem><para> -#: ../en/ch11-mq.xml:872 +#: ../en/ch12-mq.xml:919 msgid "" "Merge all patches using <command>hg qpush -m -a</command>. The <option role=" "\"hg-ext-mq-cmd-qpush-opt\">-m</option> option to <command role=\"hg-ext-mq" @@ -14414,7 +16504,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:880 +#: ../en/ch12-mq.xml:927 msgid "" "During the <command role=\"hg-cmd\">hg qpush <option role=\"hg-ext-mq-cmd-" "qpush-opt\">hg -m</option></command>, each patch in the <filename role=" @@ -14426,14 +16516,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:890 +#: ../en/ch12-mq.xml:937 msgid "" "When you finish resolving the effects of a patch, MQ refreshes your patch " "based on the result of the merge." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:893 +#: ../en/ch12-mq.xml:940 msgid "" "At the end of this process, your repository will have one extra head from the " "old patch queue, and a copy of the old patch queue will be in <filename role=" @@ -14445,12 +16535,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch11-mq.xml:905 +#: ../en/ch12-mq.xml:952 msgid "Identifying patches" msgstr "标识补丁" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:907 +#: ../en/ch12-mq.xml:954 msgid "" "MQ commands that work with patches let you refer to a patch either by using " "its name or by a number. By name is obvious enough; pass the name " @@ -14460,7 +16550,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:914 +#: ../en/ch12-mq.xml:961 msgid "" "As a shortcut, you can refer to a patch using both a name and a numeric " "offset; <literal>foo.patch-2</literal> means <quote>two patches before " @@ -14469,7 +16559,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:920 +#: ../en/ch12-mq.xml:967 msgid "" "Referring to a patch by index isn't much different. The first patch printed " "in the output of <command role=\"hg-ext-mq\">qseries</command> is patch zero " @@ -14478,7 +16568,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:926 +#: ../en/ch12-mq.xml:973 msgid "" "MQ also makes it easy to work with patches when you are using normal " "Mercurial commands. Every command that accepts a changeset ID will also " @@ -14490,33 +16580,33 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:936 +#: ../en/ch12-mq.xml:983 msgid "" "These additions to Mercurial's normal tagging capabilities make dealing with " "patches even more of a breeze." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch11-mq.xml:939 +#: ../en/ch12-mq.xml:986 msgid "Want to patchbomb a mailing list with your latest series of changes?" msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch11-mq.xml:942 +#: ../en/ch12-mq.xml:989 msgid "" "(Don't know what <quote>patchbombing</quote> is? See <xref linkend=\"sec:" "hgext:patchbomb\"/>.)" msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch11-mq.xml:945 +#: ../en/ch12-mq.xml:992 msgid "" "Need to see all of the patches since <literal>foo.patch</literal> that have " "touched files in a subdirectory of your tree?" msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:952 +#: ../en/ch12-mq.xml:999 msgid "" "Because MQ makes the names of patches available to the rest of Mercurial " "through its normal internal tag machinery, you don't need to type in the " @@ -14524,7 +16614,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:957 +#: ../en/ch12-mq.xml:1004 msgid "" "Another nice consequence of representing patch names as tags is that when you " "run the <command role=\"hg-cmd\">hg log</command> command, it will display a " @@ -14535,19 +16625,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch11-mq.xml:970 +#: ../en/ch12-mq.xml:1017 msgid "Useful things to know about" msgstr "其它需要了解的东西" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:972 +#: ../en/ch12-mq.xml:1019 msgid "" "There are a number of aspects of MQ usage that don't fit tidily into sections " "of their own, but that are good to know. Here they are, in one place." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch11-mq.xml:977 +#: ../en/ch12-mq.xml:1024 msgid "" "Normally, when you <command role=\"hg-ext-mq\">qpop</command> a patch and " "<command role=\"hg-ext-mq\">qpush</command> it again, the changeset that " @@ -14557,7 +16647,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch11-mq.xml:986 +#: ../en/ch12-mq.xml:1033 msgid "" "It's not a good idea to <command role=\"hg-cmd\">hg merge</command> changes " "from another branch with a patch changeset, at least if you want to maintain " @@ -14567,12 +16657,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch11-mq.xml:997 +#: ../en/ch12-mq.xml:1044 msgid "Managing patches in a repository" msgstr "在版本库管理补丁" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:999 +#: ../en/ch12-mq.xml:1046 msgid "" "Because MQ's <filename role=\"special\" class=\"directory\">.hg/patches</" "filename> directory resides outside a Mercurial repository's working " @@ -14581,7 +16671,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:1005 +#: ../en/ch12-mq.xml:1052 msgid "" "This presents the interesting possibility of managing the contents of the " "patch directory as a Mercurial repository in its own right. This can be a " @@ -14592,7 +16682,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:1014 +#: ../en/ch12-mq.xml:1061 msgid "" "You can then share different versions of the same patch stack among multiple " "underlying repositories. I use this when I am developing a Linux kernel " @@ -14604,7 +16694,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:1024 +#: ../en/ch12-mq.xml:1071 msgid "" "Managing patches in a repository makes it possible for multiple developers to " "work on the same patch series without colliding with each other, all on top " @@ -14612,12 +16702,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch11-mq.xml:1030 +#: ../en/ch12-mq.xml:1077 msgid "MQ support for patch repositories" msgstr "MQ 支持补丁版本库" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:1032 +#: ../en/ch12-mq.xml:1079 msgid "" "MQ helps you to work with the <filename role=\"special\" class=\"directory\">." "hg/patches</filename> directory as a repository; when you prepare a " @@ -14628,7 +16718,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><note><para> -#: ../en/ch11-mq.xml:1042 +#: ../en/ch12-mq.xml:1089 msgid "" "If you forget to use the <option role=\"hg-ext-mq-cmd-qinit-opt\">hg -c</" "option> option, you can simply go into the <filename role=\"special\" class=" @@ -14639,7 +16729,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><note><para> -#: ../en/ch11-mq.xml:1051 +#: ../en/ch12-mq.xml:1098 msgid "" "(<command role=\"hg-cmd\">hg qinit <option role=\"hg-ext-mq-cmd-qinit-opt" "\">hg -c</option></command> does this for you automatically); you " @@ -14648,7 +16738,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:1058 +#: ../en/ch12-mq.xml:1105 msgid "" "As a convenience, if MQ notices that the <filename class=\"directory\">.hg/" "patches</filename> directory is a repository, it will automatically <command " @@ -14656,7 +16746,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:1063 +#: ../en/ch12-mq.xml:1110 msgid "" "MQ provides a shortcut command, <command role=\"hg-ext-mq\">qcommit</" "command>, that runs <command role=\"hg-cmd\">hg commit</command> in the " @@ -14665,7 +16755,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:1069 +#: ../en/ch12-mq.xml:1116 msgid "" "Finally, as a convenience to manage the patch directory, you can define the " "alias <command>mq</command> on Unix systems. For example, on Linux systems " @@ -14674,26 +16764,26 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:1078 +#: ../en/ch12-mq.xml:1125 msgid "" "You can then issue commands of the form <command>mq pull</command> from the " "main repository." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch11-mq.xml:1083 +#: ../en/ch12-mq.xml:1130 msgid "A few things to watch out for" msgstr "需要注意的事情" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:1085 +#: ../en/ch12-mq.xml:1132 msgid "" "MQ's support for working with a repository full of patches is limited in a " "few small respects." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:1088 +#: ../en/ch12-mq.xml:1135 msgid "" "MQ cannot automatically detect changes that you make to the patch directory. " "If you <command role=\"hg-cmd\">hg pull</command>, manually edit, or <command " @@ -14707,12 +16797,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch11-mq.xml:1104 +#: ../en/ch12-mq.xml:1151 msgid "Third party tools for working with patches" msgstr "操作补丁的第三方工具" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:1106 +#: ../en/ch12-mq.xml:1153 msgid "" "Once you've been working with patches for a while, you'll find yourself " "hungry for tools that will help you to understand and manipulate the patches " @@ -14720,7 +16810,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:1110 +#: ../en/ch12-mq.xml:1157 msgid "" "The <command>diffstat</command> command <citation>web:diffstat</citation> " "generates a histogram of the modifications made to each file in a patch. It " @@ -14733,7 +16823,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:1124 +#: ../en/ch12-mq.xml:1171 msgid "" "The <literal role=\"package\">patchutils</literal> package <citation>web:" "patchutils</citation> is invaluable. It provides a set of small utilities " @@ -14748,21 +16838,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch11-mq.xml:1140 +#: ../en/ch12-mq.xml:1187 msgid "Good ways to work with patches" msgstr "操作补丁的好习惯" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:1142 +#: ../en/ch12-mq.xml:1189 msgid "" "Whether you are working on a patch series to submit to a free software or " "open source project, or a series that you intend to treat as a sequence of " "regular changesets when you're done, you can use some simple techniques to " -"keep your work well organised." -msgstr "" - -#. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:1148 +"keep your work well organized." +msgstr "" + +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch12-mq.xml:1195 msgid "" "Give your patches descriptive names. A good name for a patch might be " "<filename>rework-device-alloc.patch</filename>, because it will immediately " @@ -14776,7 +16866,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:1160 +#: ../en/ch12-mq.xml:1207 msgid "" "Be aware of what patch you're working on. Use the <command role=\"hg-ext-mq" "\">qtop</command> command and skim over the text of your patches " @@ -14789,7 +16879,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:1170 +#: ../en/ch12-mq.xml:1217 msgid "" "For this reason, it is very much worth investing a little time to learn how " "to use some of the third-party tools I described in <xref linkend=\"sec:mq:" @@ -14800,17 +16890,17 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch11-mq.xml:1181 +#: ../en/ch12-mq.xml:1228 msgid "MQ cookbook" msgstr "MQ 手册" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch11-mq.xml:1184 +#: ../en/ch12-mq.xml:1231 msgid "Manage <quote>trivial</quote> patches" msgstr "管理<quote>琐碎的</quote>补丁" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:1186 +#: ../en/ch12-mq.xml:1233 msgid "" "Because the overhead of dropping files into a new Mercurial repository is so " "low, it makes a lot of sense to manage patches this way even if you simply " @@ -14819,26 +16909,26 @@ # #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:1191 +#: ../en/ch12-mq.xml:1238 msgid "" "Begin by downloading and unpacking the source tarball, and turning it into a " "Mercurial repository." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:1196 +#: ../en/ch12-mq.xml:1243 msgid "Continue by creating a patch stack and making your changes." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:1201 +#: ../en/ch12-mq.xml:1248 msgid "" "Let's say a few weeks or months pass, and your package author releases a new " "version. First, bring their changes into the repository." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:1207 +#: ../en/ch12-mq.xml:1254 msgid "" "The pipeline starting with <command role=\"hg-cmd\">hg locate</command> above " "deletes all files in the working directory, so that <command role=\"hg-cmd" @@ -14848,17 +16938,17 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:1215 +#: ../en/ch12-mq.xml:1262 msgid "Finally, you can apply your patches on top of the new tree." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch11-mq.xml:1222 +#: ../en/ch12-mq.xml:1269 msgid "Combining entire patches" msgstr "组合全部的补丁" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:1224 +#: ../en/ch12-mq.xml:1271 msgid "" "MQ provides a command, <command role=\"hg-ext-mq\">qfold</command> that lets " "you combine entire patches. This <quote>folds</quote> the patches you name, " @@ -14868,7 +16958,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:1232 +#: ../en/ch12-mq.xml:1279 msgid "" "The order in which you fold patches matters. If your topmost applied patch " "is <literal>foo</literal>, and you <command role=\"hg-ext-mq\">qfold</" @@ -14879,19 +16969,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch11-mq.xml:1243 +#: ../en/ch12-mq.xml:1290 msgid "Merging part of one patch into another" msgstr "合并补丁的部分内容到其它补丁" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:1245 +#: ../en/ch12-mq.xml:1292 msgid "" "Merging <emphasis>part</emphasis> of one patch into another is more difficult " "than combining entire patches." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:1249 +#: ../en/ch12-mq.xml:1296 msgid "" "If you want to move changes to entire files, you can use <command>filterdiff</" "command>'s <option role=\"cmd-opt-filterdiff\">-i</option> and <option role=" @@ -14905,7 +16995,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:1262 +#: ../en/ch12-mq.xml:1309 msgid "" "If you have a patch that has multiple hunks modifying a file, and you only " "want to move a few of those hunks, the job becomes more messy, but you can " @@ -14914,32 +17004,32 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:1270 +#: ../en/ch12-mq.xml:1317 msgid "This command prints three different kinds of number:" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch11-mq.xml:1273 +#: ../en/ch12-mq.xml:1320 msgid "" "(in the first column) a <emphasis>file number</emphasis> to identify each " "file modified in the patch;" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch11-mq.xml:1277 +#: ../en/ch12-mq.xml:1324 msgid "" "(on the next line, indented) the line number within a modified file where a " "hunk starts; and" msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch11-mq.xml:1280 +#: ../en/ch12-mq.xml:1327 msgid "" "(on the same line) a <emphasis>hunk number</emphasis> to identify that hunk." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:1284 +#: ../en/ch12-mq.xml:1331 msgid "" "You'll have to use some visual inspection, and reading of the patch, to " "identify the file and hunk numbers you'll want, but you can then pass them to " @@ -14949,7 +17039,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch11-mq.xml:1292 +#: ../en/ch12-mq.xml:1339 msgid "" "Once you have this hunk, you can concatenate it onto the end of your " "destination patch and continue with the remainder of <xref linkend=\"sec:mq:" @@ -14957,19 +17047,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch11-mq.xml:1299 +#: ../en/ch12-mq.xml:1346 msgid "Differences between quilt and MQ" msgstr "MQ 与 quilt 的区别" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:1301 +#: ../en/ch12-mq.xml:1348 msgid "" "If you are already familiar with quilt, MQ provides a similar command set. " "There are a few differences in the way that it works." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch11-mq.xml:1305 +#: ../en/ch12-mq.xml:1352 msgid "" "You will already have noticed that most quilt commands have MQ counterparts " "that simply begin with a <quote><literal>q</literal></quote>. The exceptions " @@ -14981,12 +17071,12 @@ msgstr "" #. type: Content of: <book><chapter><title> -#: ../en/ch12-mq-collab.xml:5 +#: ../en/ch13-mq-collab.xml:5 msgid "Advanced uses of Mercurial Queues" msgstr "MQ 的高级用法" #. type: Content of: <book><chapter><para> -#: ../en/ch12-mq-collab.xml:7 +#: ../en/ch13-mq-collab.xml:7 msgid "" "While it's easy to pick up straightforward uses of Mercurial Queues, use of a " "little discipline and some of MQ's less frequently used capabilities makes it " @@ -14994,7 +17084,7 @@ msgstr "" #. type: Content of: <book><chapter><para> -#: ../en/ch12-mq-collab.xml:12 +#: ../en/ch13-mq-collab.xml:12 msgid "" "In this chapter, I will use as an example a technique I have used to manage " "the development of an Infiniband device driver for the Linux kernel. The " @@ -15004,7 +17094,7 @@ msgstr "" #. type: Content of: <book><chapter><para> -#: ../en/ch12-mq-collab.xml:18 +#: ../en/ch13-mq-collab.xml:18 msgid "" "While much of the material in this chapter is specific to Linux, the same " "principles apply to any code base for which you're not the primary owner, and " @@ -15012,12 +17102,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch12-mq-collab.xml:24 +#: ../en/ch13-mq-collab.xml:24 msgid "The problem of many targets" msgstr "多个目标的问题" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:26 +#: ../en/ch13-mq-collab.xml:26 msgid "" "The Linux kernel changes rapidly, and has never been internally stable; " "developers frequently make drastic changes between releases. This means that " @@ -15027,14 +17117,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:33 +#: ../en/ch13-mq-collab.xml:33 msgid "" "To maintain a driver, we have to keep a number of distinct versions of Linux " "in mind." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch12-mq-collab.xml:36 +#: ../en/ch13-mq-collab.xml:36 msgid "" "One target is the main Linux kernel development tree. Maintenance of the code " "is in this case partly shared by other developers in the kernel community, " @@ -15043,7 +17133,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch12-mq-collab.xml:42 +#: ../en/ch13-mq-collab.xml:42 msgid "" "We also maintain a number of <quote>backports</quote> to older versions of " "the Linux kernel, to support the needs of customers who are running older " @@ -15054,7 +17144,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch12-mq-collab.xml:50 +#: ../en/ch13-mq-collab.xml:50 msgid "" "Finally, we make software releases on a schedule that is necessarily not " "aligned with those used by Linux distributors and kernel developers, so that " @@ -15063,19 +17153,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch12-mq-collab.xml:58 +#: ../en/ch13-mq-collab.xml:58 msgid "Tempting approaches that don't work well" msgstr "工作不好的诱人方法" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch12-mq-collab.xml:60 +#: ../en/ch13-mq-collab.xml:60 msgid "" "There are two <quote>standard</quote> ways to maintain a piece of software " "that has to target many different environments." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch12-mq-collab.xml:64 +#: ../en/ch13-mq-collab.xml:64 msgid "" "The first is to maintain a number of branches, each intended for a single " "target. The trouble with this approach is that you must maintain iron " @@ -15087,7 +17177,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch12-mq-collab.xml:74 +#: ../en/ch13-mq-collab.xml:74 msgid "" "The second is to maintain a single source tree filled with conditional " "statements that turn chunks of code on or off depending on the intended " @@ -15099,7 +17189,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch12-mq-collab.xml:83 +#: ../en/ch13-mq-collab.xml:83 msgid "" "Neither of these approaches is well suited to a situation where you don't " "<quote>own</quote> the canonical copy of a source tree. In the case of a " @@ -15111,14 +17201,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch12-mq-collab.xml:93 +#: ../en/ch13-mq-collab.xml:93 msgid "" "These approaches have the added weakness of making it difficult to generate " "well-formed patches to submit upstream." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch12-mq-collab.xml:97 +#: ../en/ch13-mq-collab.xml:97 msgid "" "In principle, Mercurial Queues seems like a good candidate to manage a " "development scenario such as the above. While this is indeed the case, MQ " @@ -15126,12 +17216,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch12-mq-collab.xml:105 +#: ../en/ch13-mq-collab.xml:105 msgid "Conditionally applying patches with guards" msgstr "有条件的应用补丁" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:107 +#: ../en/ch13-mq-collab.xml:107 msgid "" "Perhaps the best way to maintain sanity with so many targets is to be able to " "choose specific patches to apply for a given situation. MQ provides a " @@ -15141,14 +17231,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:116 +#: ../en/ch13-mq-collab.xml:116 msgid "" "This gives us a tiny repository that contains two patches that don't have any " "dependencies on each other, because they touch different files." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:120 +#: ../en/ch13-mq-collab.xml:120 msgid "" "The idea behind conditional application is that you can <quote>tag</quote> a " "patch with a <emphasis>guard</emphasis>, which is simply a text string of " @@ -15158,7 +17248,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:127 +#: ../en/ch13-mq-collab.xml:127 msgid "" "A patch can have an arbitrary number of guards; each one is " "<emphasis>positive</emphasis> (<quote>apply this patch if this guard is " @@ -15167,12 +17257,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch12-mq-collab.xml:135 +#: ../en/ch13-mq-collab.xml:135 msgid "Controlling the guards on a patch" msgstr "控制补丁的应用条件" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:137 +#: ../en/ch13-mq-collab.xml:137 msgid "" "The <command role=\"hg-ext-mq\">qguard</command> command lets you determine " "which guards should apply to a patch, or display the guards that are already " @@ -15181,21 +17271,34 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:144 +#: ../en/ch13-mq-collab.xml:144 msgid "" "To set a positive guard on a patch, prefix the name of the guard with a " "<quote><literal>+</literal></quote>." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:149 +#: ../en/ch13-mq-collab.xml:149 msgid "" "To set a negative guard on a patch, prefix the name of the guard with a " "<quote><literal>-</literal></quote>." msgstr "" +#. type: Content of: <book><chapter><sect1><para> +#: ../en/ch13-mq-collab.xml:155 +msgid "" +"Notice that we prefixed the arguments to the <command>hg qguard</command> " +"command with a <literal>--</literal> here, so that Mercurial would not " +"interpret the text <literal>-quux</literal> as an option." +msgstr "" + +#. type: Content of: <book><chapter><sect1><note><title> +#: ../en/ch13-mq-collab.xml:161 +msgid "Setting vs. modifying" +msgstr "" + #. type: Content of: <book><chapter><sect1><note><para> -#: ../en/ch12-mq-collab.xml:156 +#: ../en/ch13-mq-collab.xml:163 msgid "" "The <command role=\"hg-ext-mq\">qguard</command> command <emphasis>sets</" "emphasis> the guards on a patch; it doesn't <emphasis>modify</emphasis> " @@ -15207,7 +17310,7 @@ # #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:165 +#: ../en/ch13-mq-collab.xml:172 msgid "" "Mercurial stores guards in the <filename role=\"special\">series</filename> " "file; the form in which they are stored is easy both to understand and to " @@ -15217,12 +17320,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch12-mq-collab.xml:177 +#: ../en/ch13-mq-collab.xml:184 msgid "Selecting the guards to use" msgstr "选择使用的条件" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:179 +#: ../en/ch13-mq-collab.xml:186 msgid "" "The <command role=\"hg-ext-mq\">qselect</command> command determines which " "guards are active at a given time. The effect of this is to determine which " @@ -15232,7 +17335,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:186 +#: ../en/ch13-mq-collab.xml:193 msgid "" "With no arguments, the <command role=\"hg-ext-mq\">qselect</command> command " "lists the guards currently in effect, one per line of output. Each argument " @@ -15240,21 +17343,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:193 +#: ../en/ch13-mq-collab.xml:200 msgid "" "In case you're interested, the currently selected guards are stored in the " "<filename role=\"special\">guards</filename> file." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:198 +#: ../en/ch13-mq-collab.xml:205 msgid "" "We can see the effect the selected guards have when we run <command role=\"hg-" "ext-mq\">qpush</command>." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:203 +#: ../en/ch13-mq-collab.xml:210 msgid "" "A guard cannot start with a <quote><literal>+</literal></quote> or " "<quote><literal>-</literal></quote> character. The name of a guard must not " @@ -15263,61 +17366,61 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:212 +#: ../en/ch13-mq-collab.xml:219 msgid "Changing the selected guards changes the patches that are applied." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:217 +#: ../en/ch13-mq-collab.xml:224 msgid "" "You can see in the example below that negative guards take precedence over " "positive guards." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch12-mq-collab.xml:224 +#: ../en/ch13-mq-collab.xml:231 msgid "MQ's rules for applying patches" msgstr "MQ 应用补丁的规则" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:226 +#: ../en/ch13-mq-collab.xml:233 msgid "" "The rules that MQ uses when deciding whether to apply a patch are as follows." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch12-mq-collab.xml:229 +#: ../en/ch13-mq-collab.xml:236 msgid "A patch that has no guards is always applied." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch12-mq-collab.xml:232 +#: ../en/ch13-mq-collab.xml:239 msgid "" "If the patch has any negative guard that matches any currently selected " "guard, the patch is skipped." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch12-mq-collab.xml:235 +#: ../en/ch13-mq-collab.xml:242 msgid "" "If the patch has any positive guard that matches any currently selected " "guard, the patch is applied." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch12-mq-collab.xml:238 +#: ../en/ch13-mq-collab.xml:245 msgid "" "If the patch has positive or negative guards, but none matches any currently " "selected guard, the patch is skipped." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch12-mq-collab.xml:245 +#: ../en/ch13-mq-collab.xml:252 msgid "Trimming the work environment" msgstr "修剪工作环境" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:247 +#: ../en/ch13-mq-collab.xml:254 msgid "" "In working on the device driver I mentioned earlier, I don't apply the " "patches to a normal Linux kernel tree. Instead, I use a repository that " @@ -15327,7 +17430,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:254 +#: ../en/ch13-mq-collab.xml:261 msgid "" "I then choose a <quote>base</quote> version on top of which the patches are " "applied. This is a snapshot of the Linux kernel tree as of a revision of my " @@ -15339,7 +17442,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:263 +#: ../en/ch13-mq-collab.xml:270 msgid "" "Normally, the base tree atop which the patches apply should be a snapshot of " "a very recent upstream tree. This best facilitates the development of " @@ -15347,12 +17450,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch12-mq-collab.xml:270 +#: ../en/ch13-mq-collab.xml:277 msgid "Dividing up the <filename role=\"special\">series</filename> file" msgstr "分类补丁<filename role=\"special\">系列</filename>" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:273 +#: ../en/ch13-mq-collab.xml:280 msgid "" "I categorise the patches in the <filename role=\"special\">series</filename> " "file into a number of logical groups. Each section of like patches begins " @@ -15361,14 +17464,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:279 +#: ../en/ch13-mq-collab.xml:286 msgid "" "The sequence of patch groups that I maintain follows. The ordering of these " "groups is important; I'll describe why after I introduce the groups." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch12-mq-collab.xml:283 +#: ../en/ch13-mq-collab.xml:290 msgid "" "The <quote>accepted</quote> group. Patches that the development team has " "submitted to the maintainer of the Infiniband subsystem, and which he has " @@ -15379,14 +17482,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch12-mq-collab.xml:291 +#: ../en/ch13-mq-collab.xml:298 msgid "" "The <quote>rework</quote> group. Patches that I have submitted, but that the " "upstream maintainer has requested modifications to before he will accept them." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch12-mq-collab.xml:296 +#: ../en/ch13-mq-collab.xml:303 msgid "" "The <quote>pending</quote> group. Patches that I have not yet submitted to " "the upstream maintainer, but which we have finished working on. These will be " @@ -15397,21 +17500,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch12-mq-collab.xml:305 +#: ../en/ch13-mq-collab.xml:312 msgid "" "The <quote>in progress</quote> group. Patches that are actively being " "developed, and should not be submitted anywhere yet." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch12-mq-collab.xml:309 +#: ../en/ch13-mq-collab.xml:316 msgid "" "The <quote>backport</quote> group. Patches that adapt the source tree to " "older versions of the kernel tree." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch12-mq-collab.xml:313 +#: ../en/ch13-mq-collab.xml:320 msgid "" "The <quote>do not ship</quote> group. Patches that for some reason should " "never be submitted upstream. For example, one such patch might change " @@ -15421,7 +17524,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:321 +#: ../en/ch13-mq-collab.xml:328 msgid "" "Now to return to the reasons for ordering groups of patches in this way. We " "would like the lowest patches in the stack to be as stable as possible, so " @@ -15431,7 +17534,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:329 +#: ../en/ch13-mq-collab.xml:336 msgid "" "We would also like the patches that we know we'll need to modify to be " "applied on top of a source tree that resembles the upstream tree as closely " @@ -15439,7 +17542,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:334 +#: ../en/ch13-mq-collab.xml:341 msgid "" "The <quote>backport</quote> and <quote>do not ship</quote> patches float at " "the end of the <filename role=\"special\">series</filename> file. The " @@ -15448,19 +17551,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch12-mq-collab.xml:343 +#: ../en/ch13-mq-collab.xml:350 msgid "Maintaining the patch series" msgstr "维护补丁系列" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:345 +#: ../en/ch13-mq-collab.xml:352 msgid "" "In my work, I use a number of guards to control which patches are to be " "applied." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch12-mq-collab.xml:349 +#: ../en/ch13-mq-collab.xml:356 msgid "" "<quote>Accepted</quote> patches are guarded with <literal>accepted</" "literal>. I enable this guard most of the time. When I'm applying the " @@ -15469,7 +17572,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch12-mq-collab.xml:356 +#: ../en/ch13-mq-collab.xml:363 msgid "" "Patches that are <quote>finished</quote>, but not yet submitted, have no " "guards. If I'm applying the patch stack to a copy of the upstream tree, I " @@ -15477,21 +17580,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch12-mq-collab.xml:362 +#: ../en/ch13-mq-collab.xml:369 msgid "" "Those patches that need reworking before being resubmitted are guarded with " "<literal>rework</literal>." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch12-mq-collab.xml:366 +#: ../en/ch13-mq-collab.xml:373 msgid "" "For those patches that are still under development, I use <literal>devel</" "literal>." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch12-mq-collab.xml:369 +#: ../en/ch13-mq-collab.xml:376 msgid "" "A backport patch may have several guards, one for each version of the kernel " "to which it applies. For example, a patch that backports a piece of code to " @@ -15499,7 +17602,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch12-mq-collab.xml:374 +#: ../en/ch13-mq-collab.xml:381 msgid "" "This variety of guards gives me considerable flexibility in determining what " "kind of source tree I want to end up with. For most situations, the " @@ -15508,12 +17611,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch12-mq-collab.xml:381 +#: ../en/ch13-mq-collab.xml:388 msgid "The art of writing backport patches" msgstr "编写向后移植补丁的艺术" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch12-mq-collab.xml:383 +#: ../en/ch13-mq-collab.xml:390 msgid "" "Using MQ, writing a backport patch is a simple process. All such a patch has " "to do is modify a piece of code that uses a kernel feature not present in the " @@ -15522,7 +17625,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch12-mq-collab.xml:389 +#: ../en/ch13-mq-collab.xml:396 msgid "" "A useful goal when writing a good backport patch is to make your code look as " "if it was written for the older version of the kernel you're targeting. The " @@ -15536,7 +17639,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch12-mq-collab.xml:402 +#: ../en/ch13-mq-collab.xml:409 msgid "" "There are two reasons to divide backport patches into a distinct group, away " "from the <quote>regular</quote> patches whose effects they modify. The first " @@ -15549,17 +17652,17 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch12-mq-collab.xml:417 +#: ../en/ch13-mq-collab.xml:424 msgid "Useful tips for developing with MQ" msgstr "使用 MQ 开发的技巧" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch12-mq-collab.xml:420 +#: ../en/ch13-mq-collab.xml:427 msgid "Organising patches in directories" msgstr "将补丁放到几个目录中" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch12-mq-collab.xml:422 +#: ../en/ch13-mq-collab.xml:429 msgid "" "If you're working on a substantial project with MQ, it's not difficult to " "accumulate a large number of patches. For example, I have one patch " @@ -15567,7 +17670,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch12-mq-collab.xml:427 +#: ../en/ch13-mq-collab.xml:434 msgid "" "If you can group these patches into separate logical categories, you can if " "you like store them in different directories; MQ has no problems with patch " @@ -15575,12 +17678,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch12-mq-collab.xml:434 +#: ../en/ch13-mq-collab.xml:441 msgid "Viewing the history of a patch" msgstr "察看补丁的历史" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch12-mq-collab.xml:436 +#: ../en/ch13-mq-collab.xml:443 msgid "" "If you're developing a set of patches over a long time, it's a good idea to " "maintain them in a repository, as discussed in <xref linkend=\"sec:mq:repo\"/" @@ -15593,7 +17696,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch12-mq-collab.xml:448 +#: ../en/ch13-mq-collab.xml:455 msgid "" "However, you can use the <literal role=\"hg-ext\">extdiff</literal> " "extension, which is bundled with Mercurial, to turn a diff of two versions of " @@ -15606,7 +17709,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch12-mq-collab.xml:459 +#: ../en/ch13-mq-collab.xml:466 msgid "" "You can enable the <literal role=\"hg-ext\">extdiff</literal> extension in " "the usual way, by adding a line to the <literal role=\"rc-extensions" @@ -15615,9 +17718,9 @@ msgstr "" # -#. &example.hg-interdiff; -#. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch12-mq-collab.xml:466 +#. &example.hg-interdiff; +#. type: Content of: <book><chapter><sect1><sect2><para> +#: ../en/ch13-mq-collab.xml:473 msgid "" "The <command>interdiff</command> command expects to be passed the names of " "two files, but the <literal role=\"hg-ext\">extdiff</literal> extension " @@ -15630,7 +17733,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch12-mq-collab.xml:478 +#: ../en/ch13-mq-collab.xml:485 msgid "" "With the <filename role=\"special\">hg-interdiff</filename> program in your " "shell's search path, you can run it as follows, from inside an MQ patch " @@ -15638,7 +17741,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch12-mq-collab.xml:482 +#: ../en/ch13-mq-collab.xml:489 msgid "" "Since you'll probably want to use this long-winded command a lot, you can get " "<literal role=\"hg-ext\">hgext</literal> to make it available as a normal " @@ -15647,7 +17750,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch12-mq-collab.xml:489 +#: ../en/ch13-mq-collab.xml:496 msgid "" "This directs <literal role=\"hg-ext\">hgext</literal> to make an " "<literal>interdiff</literal> command available, so you can now shorten the " @@ -15656,7 +17759,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><note><para> -#: ../en/ch12-mq-collab.xml:497 +#: ../en/ch13-mq-collab.xml:504 msgid "" "The <command>interdiff</command> command works well only if the underlying " "files against which versions of a patch are generated remain the same. If " @@ -15665,7 +17768,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch12-mq-collab.xml:505 +#: ../en/ch13-mq-collab.xml:512 msgid "" "The <literal role=\"hg-ext\">extdiff</literal> extension is useful for more " "than merely improving the presentation of MQ patches. To read more about it, " @@ -15673,12 +17776,12 @@ msgstr "" #. type: Content of: <book><chapter><title> -#: ../en/ch13-hgext.xml:5 +#: ../en/ch14-hgext.xml:5 msgid "Adding functionality with extensions" msgstr "使用扩展增加功能" #. type: Content of: <book><chapter><para> -#: ../en/ch13-hgext.xml:7 +#: ../en/ch14-hgext.xml:7 msgid "" "While the core of Mercurial is quite complete from a functionality " "standpoint, it's deliberately shorn of fancy features. This approach of " @@ -15687,7 +17790,7 @@ msgstr "" #. type: Content of: <book><chapter><para> -#: ../en/ch13-hgext.xml:12 +#: ../en/ch14-hgext.xml:12 msgid "" "However, Mercurial doesn't box you in with an inflexible command set: you can " "add features to it as <emphasis>extensions</emphasis> (sometimes known as " @@ -15696,7 +17799,7 @@ msgstr "" #. type: Content of: <book><chapter><itemizedlist><listitem><para> -#: ../en/ch13-hgext.xml:18 +#: ../en/ch14-hgext.xml:18 msgid "" "<xref linkend=\"sec:tour-merge:fetch\"/> covers the <literal role=\"hg-ext" "\">fetch</literal> extension; this combines pulling new changes and merging " @@ -15705,7 +17808,7 @@ msgstr "" #. type: Content of: <book><chapter><itemizedlist><listitem><para> -#: ../en/ch13-hgext.xml:24 +#: ../en/ch14-hgext.xml:24 msgid "" "In <xref linkend=\"chap:hook\"/>, we covered several extensions that are " "useful for hook-related functionality: <literal role=\"hg-ext\">acl</literal> " @@ -15715,7 +17818,7 @@ msgstr "" #. type: Content of: <book><chapter><itemizedlist><listitem><para> -#: ../en/ch13-hgext.xml:33 +#: ../en/ch14-hgext.xml:33 msgid "" "The Mercurial Queues patch management extension is so invaluable that it " "merits two chapters and an appendix all to itself. <xref linkend=\"chap:mq\"/" @@ -15724,7 +17827,7 @@ msgstr "" #. type: Content of: <book><chapter><para> -#: ../en/ch13-hgext.xml:43 +#: ../en/ch14-hgext.xml:43 msgid "" "In this chapter, we'll cover some of the other extensions that are available " "for Mercurial, and briefly touch on some of the machinery you'll need to know " @@ -15732,7 +17835,7 @@ msgstr "" #. type: Content of: <book><chapter><itemizedlist><listitem><para> -#: ../en/ch13-hgext.xml:48 +#: ../en/ch14-hgext.xml:48 msgid "" "In <xref linkend=\"sec:hgext:inotify\"/>, we'll discuss the possibility of " "<emphasis>huge</emphasis> performance improvements using the <literal role=" @@ -15740,21 +17843,21 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch13-hgext.xml:55 +#: ../en/ch14-hgext.xml:55 msgid "" "Improve performance with the <literal role=\"hg-ext\">inotify</literal> " "extension" msgstr "使用扩展 <literal role=\"hg-ext\">inotify</literal> 以提高性能" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:58 +#: ../en/ch14-hgext.xml:58 msgid "" "Are you interested in having some of the most common Mercurial operations run " "as much as a hundred times faster? Read on!" msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:62 +#: ../en/ch14-hgext.xml:62 msgid "" "Mercurial has great performance under normal circumstances. For example, " "when you run the <command role=\"hg-cmd\">hg status</command> command, " @@ -15766,7 +17869,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:72 +#: ../en/ch14-hgext.xml:72 msgid "" "Because obtaining file status is crucial to good performance, the authors of " "Mercurial have optimised this code to within an inch of its life. However, " @@ -15778,7 +17881,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:82 +#: ../en/ch14-hgext.xml:82 msgid "" "To put a number on the magnitude of this effect, I created a repository " "containing 150,000 managed files. I timed <command role=\"hg-cmd\">hg " @@ -15787,7 +17890,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:88 +#: ../en/ch14-hgext.xml:88 msgid "" "Many modern operating systems contain a file notification facility. If a " "program signs up to an appropriate service, the operating system will notify " @@ -15797,14 +17900,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:95 +#: ../en/ch14-hgext.xml:95 msgid "" "Mercurial's <literal role=\"hg-ext\">inotify</literal> extension talks to the " "kernel's <literal>inotify</literal> component to optimise <command role=\"hg-" "cmd\">hg status</command> commands. The extension has two components. A " "daemon sits in the background and receives notifications from the " "<literal>inotify</literal> subsystem. It also listens for connections from a " -"regular Mercurial command. The extension modifies Mercurial's behaviour so " +"regular Mercurial command. The extension modifies Mercurial's behavior so " "that instead of scanning the filesystem, it queries the daemon. Since the " "daemon has perfect information about the state of the repository, it can " "respond with a result instantaneously, avoiding the need to scan every " @@ -15812,7 +17915,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:108 +#: ../en/ch14-hgext.xml:108 msgid "" "Recall the ten seconds that I measured plain Mercurial as taking to run " "<command role=\"hg-cmd\">hg status</command> on a 150,000 file repository. " @@ -15822,12 +17925,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:115 +#: ../en/ch14-hgext.xml:115 msgid "Before we continue, please pay attention to some caveats." msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch13-hgext.xml:118 +#: ../en/ch14-hgext.xml:118 msgid "" "The <literal role=\"hg-ext\">inotify</literal> extension is Linux-specific. " "Because it interfaces directly to the Linux kernel's <literal>inotify</" @@ -15835,7 +17938,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch13-hgext.xml:123 +#: ../en/ch14-hgext.xml:123 msgid "" "It should work on any Linux distribution that was released after early 2005. " "Older distributions are likely to have a kernel that lacks <literal>inotify</" @@ -15844,7 +17947,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para> -#: ../en/ch13-hgext.xml:130 +#: ../en/ch14-hgext.xml:130 msgid "" "Not all filesystems are suitable for use with the <literal role=\"hg-ext" "\">inotify</literal> extension. Network filesystems such as NFS are a non-" @@ -15856,7 +17959,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:141 +#: ../en/ch14-hgext.xml:141 msgid "" "The <literal role=\"hg-ext\">inotify</literal> extension is not yet shipped " "with Mercurial as of May 2007, so it's a little more involved to set up than " @@ -15864,7 +17967,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:146 +#: ../en/ch14-hgext.xml:146 msgid "" "The extension currently comes in two parts: a set of patches to the Mercurial " "source code, and a library of Python bindings to the <literal>inotify</" @@ -15872,7 +17975,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><note><para> -#: ../en/ch13-hgext.xml:150 +#: ../en/ch14-hgext.xml:150 msgid "" "There are <emphasis>two</emphasis> Python <literal>inotify</literal> binding " "libraries. One of them is called <literal>pyinotify</literal>, and is " @@ -15882,14 +17985,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:157 +#: ../en/ch14-hgext.xml:157 msgid "" "To get going, it's best to already have a functioning copy of Mercurial " "installed." msgstr "" #. type: Content of: <book><chapter><sect1><note><para> -#: ../en/ch13-hgext.xml:160 +#: ../en/ch14-hgext.xml:160 msgid "" "If you follow the instructions below, you'll be <emphasis>replacing</" "emphasis> and overwriting any existing installation of Mercurial that you " @@ -15898,14 +18001,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><orderedlist><listitem><para> -#: ../en/ch13-hgext.xml:167 +#: ../en/ch14-hgext.xml:167 msgid "" "Clone the Python <literal>inotify</literal> binding repository. Build and " "install it." msgstr "" #. type: Content of: <book><chapter><sect1><orderedlist><listitem><para> -#: ../en/ch13-hgext.xml:174 +#: ../en/ch14-hgext.xml:174 msgid "" "Clone the <filename class=\"directory\">crew</filename> Mercurial " "repository. Clone the <literal role=\"hg-ext\">inotify</literal> patch " @@ -15914,7 +18017,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><orderedlist><listitem><para> -#: ../en/ch13-hgext.xml:184 +#: ../en/ch14-hgext.xml:184 msgid "" "Make sure that you have the Mercurial Queues extension, <literal role=\"hg-ext" "\">mq</literal>, enabled. If you've never used MQ, read <xref linkend=\"sec:" @@ -15922,7 +18025,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><orderedlist><listitem><para> -#: ../en/ch13-hgext.xml:190 +#: ../en/ch14-hgext.xml:190 msgid "" "Go into the <filename class=\"directory\">inotify</filename> repo, and apply " "all of the <literal role=\"hg-ext\">inotify</literal> patches using the " @@ -15931,19 +18034,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><orderedlist><listitem><para> -#: ../en/ch13-hgext.xml:199 +#: ../en/ch14-hgext.xml:199 msgid "" "If you get an error message from <command role=\"hg-ext-mq\">qpush</command>, " "you should not continue. Instead, ask for help." msgstr "" #. type: Content of: <book><chapter><sect1><orderedlist><listitem><para> -#: ../en/ch13-hgext.xml:203 +#: ../en/ch14-hgext.xml:203 msgid "Build and install the patched version of Mercurial." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:209 +#: ../en/ch14-hgext.xml:209 msgid "" "Once you've build a suitably patched version of Mercurial, all you need to do " "to enable the <literal role=\"hg-ext\">inotify</literal> extension is add an " @@ -15951,7 +18054,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:214 +#: ../en/ch14-hgext.xml:214 msgid "" "When the <literal role=\"hg-ext\">inotify</literal> extension is enabled, " "Mercurial will automatically and transparently start the status daemon the " @@ -15960,7 +18063,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:220 +#: ../en/ch14-hgext.xml:220 msgid "" "The status daemon is started silently, and runs in the background. If you " "look at a list of running processes after you've enabled the <literal role=" @@ -15970,7 +18073,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:228 +#: ../en/ch14-hgext.xml:228 msgid "" "The first time you run a Mercurial command in a repository when you have the " "<literal role=\"hg-ext\">inotify</literal> extension enabled, it will run " @@ -15986,7 +18089,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:242 +#: ../en/ch14-hgext.xml:242 msgid "" "If you like, you can manually start a status daemon using the <command role=" "\"hg-ext-inotify\">inserve</command> command. This gives you slightly finer " @@ -15996,25 +18099,25 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:249 +#: ../en/ch14-hgext.xml:249 msgid "" "When you're using the <literal role=\"hg-ext\">inotify</literal> extension, " "you should notice <emphasis>no difference at all</emphasis> in Mercurial's " -"behaviour, with the sole exception of status-related commands running a whole " +"behavior, with the sole exception of status-related commands running a whole " "lot faster than they used to. You should specifically expect that commands " "will not print different output; neither should they give different results. " "If either of these situations occurs, please report a bug." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch13-hgext.xml:260 +#: ../en/ch14-hgext.xml:260 msgid "" "Flexible diff support with the <literal role=\"hg-ext\">extdiff</literal> " "extension" msgstr "使用扩展 <literal role=\"hg-ext\">extdiff</literal> 以扩展差异支持" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:263 +#: ../en/ch14-hgext.xml:263 msgid "" "Mercurial's built-in <command role=\"hg-cmd\">hg diff</command> command " "outputs plaintext unified diffs." @@ -16023,7 +18126,7 @@ "不同。" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:268 +#: ../en/ch14-hgext.xml:268 msgid "" "If you would like to use an external tool to display modifications, you'll " "want to use the <literal role=\"hg-ext\">extdiff</literal> extension. This " @@ -16031,7 +18134,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:273 +#: ../en/ch14-hgext.xml:273 msgid "" "The <literal role=\"hg-ext\">extdiff</literal> extension is bundled with " "Mercurial, so it's easy to set up. In the <literal role=\"rc-extensions" @@ -16040,7 +18143,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:280 +#: ../en/ch14-hgext.xml:280 msgid "" "This introduces a command named <command role=\"hg-ext-extdiff\">extdiff</" "command>, which by default uses your system's <command>diff</command> command " @@ -16049,7 +18152,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:288 +#: ../en/ch14-hgext.xml:288 msgid "" "The result won't be exactly the same as with the built-in <command role=\"hg-" "cmd\">hg diff</command> variations, because the output of <command>diff</" @@ -16057,7 +18160,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:293 +#: ../en/ch14-hgext.xml:293 msgid "" "As the <quote><literal>making snapshot</literal></quote> lines of output " "above imply, the <command role=\"hg-ext-extdiff\">extdiff</command> command " @@ -16071,7 +18174,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:306 +#: ../en/ch14-hgext.xml:306 msgid "" "Snapshot directory names have the same base name as your repository. If your " "repository path is <filename class=\"directory\">/quux/bar/foo</filename>, " @@ -16088,7 +18191,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:322 +#: ../en/ch14-hgext.xml:322 msgid "" "The <command role=\"hg-ext-extdiff\">extdiff</command> command accepts two " "important options. The <option role=\"hg-ext-extdiff-cmd-extdiff-opt\">hg -p</" @@ -16106,7 +18209,7 @@ # #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:339 +#: ../en/ch14-hgext.xml:339 msgid "" "As an example, here's how to run the normal system <command>diff</command> " "command, getting it to generate context diffs (using the <option role=\"cmd-" @@ -16116,14 +18219,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:348 +#: ../en/ch14-hgext.xml:348 msgid "" "Launching a visual diff tool is just as easy. Here's how to launch the " "<command>kdiff3</command> viewer." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:352 +#: ../en/ch14-hgext.xml:352 msgid "" "If your diff viewing command can't deal with directories, you can easily work " "around this with a little scripting. For an example of such scripting in " @@ -16133,12 +18236,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch13-hgext.xml:360 +#: ../en/ch14-hgext.xml:360 msgid "Defining command aliases" msgstr "定义命令的别名" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch13-hgext.xml:362 +#: ../en/ch14-hgext.xml:362 msgid "" "It can be cumbersome to remember the options to both the <command role=\"hg-" "ext-extdiff\">extdiff</command> command and the diff viewer you want to use, " @@ -16148,7 +18251,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch13-hgext.xml:369 +#: ../en/ch14-hgext.xml:369 msgid "" "All you need to do is edit your <filename role=\"special\">~/.hgrc</" "filename>, and add a section named <literal role=\"rc-extdiff\">extdiff</" @@ -16160,7 +18263,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch13-hgext.xml:379 +#: ../en/ch14-hgext.xml:379 msgid "" "If you leave the right hand side of the definition empty, as above, the " "<literal role=\"hg-ext\">extdiff</literal> extension uses the name of the " @@ -16171,7 +18274,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch13-hgext.xml:389 +#: ../en/ch14-hgext.xml:389 msgid "" "You can also specify the default options that you want to invoke your diff " "viewing program with. The prefix to use is <quote><literal>opts.</literal></" @@ -16181,19 +18284,19 @@ msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch13-hgext.xml:403 +#: ../en/ch14-hgext.xml:403 msgid "" "Cherrypicking changes with the <literal role=\"hg-ext\">transplant</literal> " "extension" msgstr "使用扩展 <literal role=\"hg-ext\">transplant</literal> 以挑选修改" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:406 +#: ../en/ch14-hgext.xml:406 msgid "Need to have a long chat with Brendan about this." msgstr "" #. type: Content of: <book><chapter><sect1><title> -#: ../en/ch13-hgext.xml:410 +#: ../en/ch14-hgext.xml:410 msgid "" "Send changes via email with the <literal role=\"hg-ext\">patchbomb</literal> " "extension" @@ -16201,7 +18304,7 @@ "使用扩展 <literal role=\"hg-ext\">patchbomb</literal> 通过 email 发送修改" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:413 +#: ../en/ch14-hgext.xml:413 msgid "" "Many projects have a culture of <quote>change review</quote>, in which people " "send their modifications to a mailing list for others to read and comment on " @@ -16211,7 +18314,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:421 +#: ../en/ch14-hgext.xml:421 msgid "" "Mercurial makes it easy to send changes over email for review or application, " "via its <literal role=\"hg-ext\">patchbomb</literal> extension. The " @@ -16222,7 +18325,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:429 +#: ../en/ch14-hgext.xml:429 msgid "" "As usual, the basic configuration of the <literal role=\"hg-ext\">patchbomb</" "literal> extension takes just one or two lines in your <filename role=" @@ -16230,14 +18333,14 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:435 +#: ../en/ch14-hgext.xml:435 msgid "" "Once you've enabled the extension, you will have a new command available, " "named <command role=\"hg-ext-patchbomb\">email</command>." msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:439 +#: ../en/ch14-hgext.xml:439 msgid "" "The safest and best way to invoke the <command role=\"hg-ext-patchbomb" "\">email</command> command is to <emphasis>always</emphasis> run it first " @@ -16250,7 +18353,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:450 +#: ../en/ch14-hgext.xml:450 msgid "" "The <command role=\"hg-ext-patchbomb\">email</command> command accepts the " "same kind of revision syntax as every other Mercurial command. For example, " @@ -16259,7 +18362,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:455 +#: ../en/ch14-hgext.xml:455 msgid "" "You can also specify a <emphasis>repository</emphasis> to compare with. If " "you provide a repository but no revisions, the <command role=\"hg-ext-" @@ -16271,7 +18374,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:464 +#: ../en/ch14-hgext.xml:464 msgid "" "It's perfectly safe to run the <command role=\"hg-ext-patchbomb\">email</" "command> command without the names of the people you want to send to: if you " @@ -16282,7 +18385,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:472 +#: ../en/ch14-hgext.xml:472 msgid "" "When you are sending just one revision, the <command role=\"hg-ext-patchbomb" "\">email</command> command will by default use the first line of the " @@ -16290,7 +18393,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><para> -#: ../en/ch13-hgext.xml:477 +#: ../en/ch14-hgext.xml:477 msgid "" "If you send multiple revisions, the <command role=\"hg-ext-patchbomb\">email</" "command> command will usually send one message per changeset. It will " @@ -16299,12 +18402,12 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><title> -#: ../en/ch13-hgext.xml:484 -msgid "Changing the behaviour of patchbombs" +#: ../en/ch14-hgext.xml:484 +msgid "Changing the behavior of patchbombs" msgstr "修改 patchbomb 的行为" #. type: Content of: <book><chapter><sect1><sect2><para> -#: ../en/ch13-hgext.xml:486 +#: ../en/ch14-hgext.xml:486 msgid "" "Not every project has exactly the same conventions for sending changes in " "email; the <literal role=\"hg-ext\">patchbomb</literal> extension tries to " @@ -16312,7 +18415,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch13-hgext.xml:492 +#: ../en/ch14-hgext.xml:492 msgid "" "You can write a subject for the introductory message on the command line " "using the <option role=\"hg-ext-patchbomb-cmd-email-opt\">hg -s</option> " @@ -16320,7 +18423,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch13-hgext.xml:498 +#: ../en/ch14-hgext.xml:498 msgid "" "To change the email address from which the messages originate, use the " "<option role=\"hg-ext-patchbomb-cmd-email-opt\">hg -f</option> option. This " @@ -16328,16 +18431,16 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch13-hgext.xml:504 -msgid "" -"The default behaviour is to send unified diffs (see <xref linkend=\"sec:mq:" +#: ../en/ch14-hgext.xml:504 +msgid "" +"The default behavior is to send unified diffs (see <xref linkend=\"sec:mq:" "patch\"/> for a description of the format), one per message. You can send a " "binary bundle instead with the <option role=\"hg-ext-patchbomb-cmd-email-opt" "\">hg -b</option> option." msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch13-hgext.xml:512 +#: ../en/ch14-hgext.xml:512 msgid "" "Unified diffs are normally prefaced with a metadata header. You can omit " "this, and send unadorned diffs, with the <option role=\"hg-ext-patchbomb-cmd-" @@ -16345,7 +18448,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch13-hgext.xml:518 +#: ../en/ch14-hgext.xml:518 msgid "" "Diffs are normally sent <quote>inline</quote>, in the same body part as the " "description of a patch. This makes it easiest for the largest number of " @@ -16356,7 +18459,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch13-hgext.xml:528 +#: ../en/ch14-hgext.xml:528 msgid "" "Instead of sending mail messages, you can write them to an <literal>mbox</" "literal>-format mail folder using the <option role=\"hg-ext-patchbomb-cmd-" @@ -16365,7 +18468,7 @@ msgstr "" #. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para> -#: ../en/ch13-hgext.xml:535 +#: ../en/ch14-hgext.xml:535 msgid "" "If you would like to add a <command>diffstat</command>-format summary to each " "patch, and one to the introductory message, use the <option role=\"hg-ext-"