hgbook

changeset 670:e9ef075327c1

Merge with http://bitbucket.org/dongsheng/hgbook/
author Bryan O'Sullivan <bos@serpentine.com>
date Mon Apr 06 23:15:52 2009 -0700 (2009-04-06)
parents 2ff0a43f1152 a79fb712fe20
children eb11ec9eed8c
files en/ch02-tour-merge.xml en/ch03-concepts.xml en/examples/results/backout.init.out en/examples/results/backout.manual.backout.out en/examples/results/backout.manual.cat.out en/examples/results/backout.manual.clone.out en/examples/results/backout.manual.heads.out en/examples/results/backout.manual.log.out en/examples/results/backout.manual.merge.out en/examples/results/backout.manual.parents.out en/examples/results/backout.non-tip.backout.out en/examples/results/backout.non-tip.cat.out en/examples/results/backout.non-tip.clone.out en/examples/results/backout.simple.log.out en/examples/results/backout.simple.out en/examples/results/bisect.commits.out en/examples/results/bisect.help.out en/examples/results/bisect.init.out en/examples/results/bisect.search.bad-init.out en/examples/results/bisect.search.good-init.out en/examples/results/bisect.search.init.out en/examples/results/bisect.search.mytest.out en/examples/results/bisect.search.reset.out en/examples/results/bisect.search.rest.out en/examples/results/bisect.search.step1.out en/examples/results/bisect.search.step2.out en/examples/results/branch-named.branch.out en/examples/results/branch-named.branches.out en/examples/results/branch-named.commit.out en/examples/results/branch-named.create.out en/examples/results/branch-named.foo-commit.out en/examples/results/branch-named.merge.out en/examples/results/branch-named.parents.out en/examples/results/branch-named.rebranch.out en/examples/results/branch-named.status.out en/examples/results/branch-named.update-bar.out en/examples/results/branch-named.update-foo.out en/examples/results/branch-named.update-nothing.out en/examples/results/branch-named.update-switchy.out en/examples/results/branch-named.update.out en/examples/results/branch-repo.bugfix.out en/examples/results/branch-repo.clone.out en/examples/results/branch-repo.merge.out en/examples/results/branch-repo.new.out en/examples/results/branch-repo.pull.out en/examples/results/branch-repo.tag.out en/examples/results/branching.clone.out en/examples/results/branching.init.out en/examples/results/branching.main.out en/examples/results/branching.merge.out en/examples/results/branching.stable.out en/examples/results/branching.tag.out en/examples/results/branching.update.out en/examples/results/cmdref.diff-p.out en/examples/results/daily.copy.after.out en/examples/results/daily.copy.cat.out en/examples/results/daily.copy.clone.out en/examples/results/daily.copy.copy.out en/examples/results/daily.copy.dir-dest.out en/examples/results/daily.copy.dir-src-dest.out en/examples/results/daily.copy.dir-src.out en/examples/results/daily.copy.init.out en/examples/results/daily.copy.merge.out en/examples/results/daily.copy.other.out en/examples/results/daily.copy.simple.out en/examples/results/daily.copy.status-copy.out en/examples/results/daily.copy.status.out en/examples/results/daily.files.add-dir.out en/examples/results/daily.files.add.out en/examples/results/daily.files.addremove.out en/examples/results/daily.files.commit-addremove.out en/examples/results/daily.files.hidden.out en/examples/results/daily.files.missing.out en/examples/results/daily.files.recover-missing.out en/examples/results/daily.files.remove-after.out en/examples/results/daily.files.remove.out en/examples/results/daily.rename.rename.out en/examples/results/daily.rename.status-copy.out en/examples/results/daily.rename.status.out en/examples/results/daily.revert.add.out en/examples/results/daily.revert.copy.out en/examples/results/daily.revert.missing.out en/examples/results/daily.revert.modify.out en/examples/results/daily.revert.remove.out en/examples/results/daily.revert.rename-orig.out en/examples/results/daily.revert.rename.out en/examples/results/daily.revert.status.out en/examples/results/daily.revert.unmodify.out en/examples/results/extdiff.diff.out en/examples/results/extdiff.extdiff-ctx.out en/examples/results/extdiff.extdiff.out en/examples/results/filenames.dirs.out en/examples/results/filenames.files.out en/examples/results/filenames.filter.exclude.out en/examples/results/filenames.filter.include.out en/examples/results/filenames.glob.group.out en/examples/results/filenames.glob.question.out en/examples/results/filenames.glob.range.out en/examples/results/filenames.glob.star-starstar.out en/examples/results/filenames.glob.star.out en/examples/results/filenames.glob.starstar.out en/examples/results/filenames.wdir-relname.out en/examples/results/filenames.wdir-subdir.out en/examples/results/hook.msglen.go.out en/examples/results/hook.msglen.run.out en/examples/results/hook.simple.ext.out en/examples/results/hook.simple.init.out en/examples/results/hook.simple.pretxncommit.out en/examples/results/hook.ws.better.out en/examples/results/hook.ws.simple.out en/examples/results/issue29.go.out en/examples/results/mq.dodiff.diff.out en/examples/results/mq.guards.init.out en/examples/results/mq.guards.qguard.neg.out en/examples/results/mq.guards.qguard.out en/examples/results/mq.guards.qguard.pos.out en/examples/results/mq.guards.qselect.cat.out en/examples/results/mq.guards.qselect.error.out en/examples/results/mq.guards.qselect.foo.out en/examples/results/mq.guards.qselect.foobar.out en/examples/results/mq.guards.qselect.qpush.out en/examples/results/mq.guards.qselect.quux.out en/examples/results/mq.guards.series.out en/examples/results/mq.id.out.out en/examples/results/mq.id.output.out en/examples/results/mq.qinit-help.help.out en/examples/results/mq.tarball.download.out en/examples/results/mq.tarball.newsource.out en/examples/results/mq.tarball.qinit.out en/examples/results/mq.tarball.repush.out en/examples/results/mq.tools.lsdiff.out en/examples/results/mq.tools.tools.out en/examples/results/mq.tutorial.add.out en/examples/results/mq.tutorial.qinit.out en/examples/results/mq.tutorial.qnew.out en/examples/results/mq.tutorial.qnew2.out en/examples/results/mq.tutorial.qpop.out en/examples/results/mq.tutorial.qpush-a.out en/examples/results/mq.tutorial.qrefresh.out en/examples/results/mq.tutorial.qrefresh2.out en/examples/results/mq.tutorial.qseries.out en/examples/results/rename.divergent.clone.out en/examples/results/rename.divergent.merge.out en/examples/results/rename.divergent.rename.anne.out en/examples/results/rename.divergent.rename.bob.out en/examples/results/rollback.add.out en/examples/results/rollback.commit.out en/examples/results/rollback.rollback.out en/examples/results/rollback.status.out en/examples/results/rollback.tip.out en/examples/results/rollback.twice.out en/examples/results/tag.init.out en/examples/results/tag.log.out en/examples/results/tag.log.v1.0.out en/examples/results/tag.remove.out en/examples/results/tag.replace.out en/examples/results/tag.tag.out en/examples/results/tag.tags.out en/examples/results/tag.tip.out en/examples/results/template.simple.changelog.out en/examples/results/template.simple.combine.out en/examples/results/template.simple.compact.out en/examples/results/template.simple.datekeyword.out en/examples/results/template.simple.keywords.out en/examples/results/template.simple.manyfilters.out en/examples/results/template.simple.normal.out en/examples/results/template.simple.rev.out en/examples/results/template.simple.simplest.out en/examples/results/template.simple.simplesub.out en/examples/results/template.svnstyle.id.out en/examples/results/template.svnstyle.result.out en/examples/results/template.svnstyle.short.out en/examples/results/template.svnstyle.simplest.out en/examples/results/template.svnstyle.style.out en/examples/results/template.svnstyle.syntax.error.out en/examples/results/template.svnstyle.syntax.input.out en/examples/results/template.svnstyle.template.out en/examples/results/tour-merge-conflict.commit.out en/examples/results/tour-merge-conflict.cousin.out en/examples/results/tour-merge-conflict.merge.out en/examples/results/tour-merge-conflict.pull.out en/examples/results/tour-merge-conflict.son.out en/examples/results/tour-merge-conflict.wife.out en/examples/results/tour.clone-pull.out en/examples/results/tour.clone-push.out en/examples/results/tour.clone.out en/examples/results/tour.commit.out en/examples/results/tour.diff.out en/examples/results/tour.help.out en/examples/results/tour.incoming.out en/examples/results/tour.log-r.out en/examples/results/tour.log-v.out en/examples/results/tour.log-vp.out en/examples/results/tour.log.out en/examples/results/tour.log.range.out en/examples/results/tour.ls-a.out en/examples/results/tour.ls.out en/examples/results/tour.merge.cat.out en/examples/results/tour.merge.clone.out en/examples/results/tour.merge.commit.out en/examples/results/tour.merge.heads.out en/examples/results/tour.merge.merge.out en/examples/results/tour.merge.parents.out en/examples/results/tour.merge.pull.out en/examples/results/tour.merge.tip.out en/examples/results/tour.merge.update.out en/examples/results/tour.older.out en/examples/results/tour.outgoing.net.out en/examples/results/tour.outgoing.out en/examples/results/tour.parents.out en/examples/results/tour.pull.out en/examples/results/tour.push.net.out en/examples/results/tour.push.nothing.out en/examples/results/tour.push.out en/examples/results/tour.reclone.out en/examples/results/tour.sed.out en/examples/results/tour.status.out en/examples/results/tour.tip.out en/examples/results/tour.update.out en/examples/results/tour.version.out en/figs/kdiff3.png en/figs/note.png examples/hg-interdiff examples/hg-replay tools/latex-to-docbook xsl/all-ids.xsl xsl/base-html-stylesheet.xsl xsl/chunk-stylesheet.xsl xsl/dtd-profile.xsl
line diff
     1.1 --- a/.hgignore	Mon Apr 06 23:13:53 2009 -0700
     1.2 +++ b/.hgignore	Mon Apr 06 23:15:52 2009 -0700
     1.3 @@ -1,4 +1,4 @@
     1.4 -[^/]+/html/
     1.5 +[^/]+/htdocs/
     1.6  
     1.7  syntax: glob
     1.8  
     1.9 @@ -21,4 +21,11 @@
    1.10  web/hgbook/.database.sqlite3
    1.11  web/hgbook/secrets.py
    1.12  web/index-read.html.in
    1.13 -xsl/system-xsl
    1.14 +stylesheets/system-xsl
    1.15 +build
    1.16 +en/html
    1.17 +en/examples/results
    1.18 +tools
    1.19 +Makefile.vars
    1.20 +*.mo
    1.21 +*-tmp.*
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/Makefile	Mon Apr 06 23:15:52 2009 -0700
     2.3 @@ -0,0 +1,243 @@
     2.4 +#
     2.5 +# Makefile for the hgbook, top-level
     2.6 +#
     2.7 +include Makefile.vars
     2.8 +
     2.9 +FORMATS=html html-single pdf epub
    2.10 +
    2.11 +PO_LANGUAGES := zh
    2.12 +DBK_LANGUAGES := en
    2.13 +LANGUAGES := $(DBK_LANGUAGES) $(PO_LANGUAGES)
    2.14 +
    2.15 +UPDATEPO = PERLLIB=$(PO4A_LIB) $(PO4A_HOME)/po4a-updatepo -M UTF-8 \
    2.16 +	   -f docbook -o doctype=docbook -o includeexternal \
    2.17 +	   -o nodefault="<programlisting> <screen>" \
    2.18 +	   -o untranslated="<programlisting> <screen>"
    2.19 +TRANSLATE = PERLLIB=$(PO4A_LIB) $(PO4A_HOME)/po4a-translate -M UTF-8 \
    2.20 +	   -f docbook -o doctype=docbook -o includeexternal \
    2.21 +	   -o nodefault="<programlisting> <screen>" \
    2.22 +	   -o untranslated="<programlisting> <screen>" \
    2.23 +	   -k 0
    2.24 +
    2.25 +#rev_id = $(shell hg parents --template '{node|short} ({date|isodate})')
    2.26 +rev_id = $(shell hg parents --template '{node|short} ({date|shortdate})')
    2.27 +
    2.28 +images := \
    2.29 +	en/figs/feature-branches.png \
    2.30 +	en/figs/filelog.png \
    2.31 +	en/figs/metadata.png \
    2.32 +	en/figs/mq-stack.png \
    2.33 +	en/figs/revlog.png \
    2.34 +	en/figs/snapshot.png \
    2.35 +	en/figs/tour-history.png \
    2.36 +	en/figs/tour-merge-conflict.png \
    2.37 +	en/figs/tour-merge-merge.png \
    2.38 +	en/figs/tour-merge-pull.png \
    2.39 +	en/figs/tour-merge-sep-repos.png \
    2.40 +	en/figs/undo-manual-merge.png \
    2.41 +	en/figs/undo-manual.png \
    2.42 +	en/figs/undo-non-tip.png \
    2.43 +	en/figs/undo-simple.png \
    2.44 +	en/figs/wdir-after-commit.png \
    2.45 +	en/figs/wdir-branch.png \
    2.46 +	en/figs/wdir-merge.png \
    2.47 +	en/figs/wdir.png \
    2.48 +	en/figs/wdir-pre-branch.png
    2.49 +
    2.50 +help:
    2.51 +	@echo "  make epub         [LINGUA=en|zh|...]"
    2.52 +	@echo "  make html         [LINGUA=en|zh|...]"
    2.53 +	@echo "  make html-single  [LINGUA=en|zh|...]"
    2.54 +	@echo "  make pdf          [LINGUA=en|zh|...]"
    2.55 +	@echo "  make validate     [LINGUA=en|zh|...] # always before commit!"
    2.56 +	@echo "  make tidypo       [LINGUA=zh|...]    # always before commit!"
    2.57 +	@echo "  make updatepo     [LINGUA=zh|...]    # update po files."
    2.58 +	@echo "  make all          [LINGUA=en|zh|...]"
    2.59 +	@echo "  make stat         # print statistics about po files."
    2.60 +	@echo "  make clean        # Remove the build files."
    2.61 +
    2.62 +clean:
    2.63 +	@rm -fr build po/*.mo hello en/hello en/html en/.validated-00book.xml en/examples/.run en/examples/results \
    2.64 +          stylesheets/system-xsl en/figs/*-tmp.svg \
    2.65 +          en/figs/feature-branches.png \
    2.66 +          en/figs/filelog.png \
    2.67 +          en/figs/feature-branches.png \
    2.68 +          en/figs/filelog.png \
    2.69 +          en/figs/metadata.png \
    2.70 +          en/figs/mq-stack.png \
    2.71 +          en/figs/revlog.png \
    2.72 +          en/figs/snapshot.png \
    2.73 +          en/figs/tour-history.png \
    2.74 +          en/figs/tour-merge-conflict.png \
    2.75 +          en/figs/tour-merge-merge.png \
    2.76 +          en/figs/tour-merge-pull.png \
    2.77 +          en/figs/tour-merge-sep-repos.png \
    2.78 +          en/figs/undo-manual-merge.png \
    2.79 +          en/figs/undo-manual.png \
    2.80 +          en/figs/undo-non-tip.png \
    2.81 +          en/figs/undo-simple.png \
    2.82 +          en/figs/wdir-after-commit.png \
    2.83 +          en/figs/wdir-branch.png \
    2.84 +          en/figs/wdir-merge.png \
    2.85 +          en/figs/wdir-pre-branch.png \
    2.86 +          en/figs/wdir.png
    2.87 +
    2.88 +all:
    2.89 +ifdef LINGUA
    2.90 +	for f in $(FORMATS); do \
    2.91 +	  $(MAKE) LINGUA=$(LINGUA) $$f; \
    2.92 +	done
    2.93 +else
    2.94 +	for l in $(LANGUAGES); do \
    2.95 +	    for f in $(FORMATS); do \
    2.96 +		$(MAKE) LINGUA=$$l $$f; \
    2.97 +	    done; \
    2.98 +	done
    2.99 +endif
   2.100 +
   2.101 +stat:
   2.102 +	@( \
   2.103 +	LANG=C; export LANG; cd po; \
   2.104 +	for f in *.po; do \
   2.105 +	    printf "%s\t" $$f; \
   2.106 +	    msgfmt --statistics -c $$f; \
   2.107 +	done; \
   2.108 +	)
   2.109 +
   2.110 +tidypo:
   2.111 +ifdef LINGUA
   2.112 +	msgcat --sort-by-file --width=80 po/$(LINGUA).po > po/$(LINGUA).tmp && \
   2.113 +	    mv po/$(LINGUA).tmp po/$(LINGUA).po;
   2.114 +else
   2.115 +	for po in $(wildcard po/*.po); do \
   2.116 +	    msgcat --sort-by-file --width=80 $$po > $$po.tmp && mv $$po.tmp $$po; \
   2.117 +	done
   2.118 +endif
   2.119 +
   2.120 +ifndef LINGUA
   2.121 +updatepo:
   2.122 +	for l in $(PO_LANGUAGES); do \
   2.123 +	    $(MAKE) $@ LINGUA=$$l; \
   2.124 +	done
   2.125 +else
   2.126 +updatepo:
   2.127 +ifneq "$(findstring $(LINGUA),$(PO_LANGUAGES))" ""
   2.128 +	(cd po; \
   2.129 +	$(UPDATEPO) -m ../en/00book.xml -p $(LINGUA).po; \
   2.130 +	)
   2.131 +	$(MAKE) tidypo LINGUA=$(LINGUA)
   2.132 +endif
   2.133 +endif
   2.134 +
   2.135 +ifndef LINGUA
   2.136 +validate:
   2.137 +	for l in $(LANGUAGES); do \
   2.138 +	    $(MAKE) $@ LINGUA=$$l; \
   2.139 +	done
   2.140 +else
   2.141 +validate: build/$(LINGUA)/source/hgbook.xml
   2.142 +	xmllint --nonet --noout --postvalid --xinclude $<
   2.143 +
   2.144 +ifneq "$(findstring $(LINGUA),$(DBK_LANGUAGES))" ""
   2.145 +$(LINGUA)/examples/.run:
   2.146 +	(cd $(LINGUA)/examples; ./run-example -v -a)
   2.147 +
   2.148 +build/$(LINGUA)/source/hgbook.xml: $(wildcard $(LINGUA)/*.xml) $(images) $(LINGUA)/examples/.run
   2.149 +	mkdir -p build/$(LINGUA)/source/figs
   2.150 +	cp $(LINGUA)/figs/*.png build/$(LINGUA)/source/figs
   2.151 +	cp stylesheets/hgbook.css build/$(LINGUA)/source
   2.152 +	(cd $(LINGUA); xmllint --nonet --noent --xinclude --postvalid --output ../$@.tmp 00book.xml)
   2.153 +	cat $@.tmp | sed 's/\$$rev_id\$$/${rev_id}/' > $@
   2.154 +else
   2.155 +en/examples/.run:
   2.156 +	(cd en/examples; ./run-example -v -a)
   2.157 +
   2.158 +build/en/source/hgbook.xml:
   2.159 +	${MAKE} LINGUA=en $@
   2.160 +
   2.161 +build/$(LINGUA)/source/hgbook.xml: $(wildcard en/*.xml) po/$(LINGUA).po $(images)
   2.162 +	mkdir -p build/$(LINGUA)/source/figs
   2.163 +	cp en/figs/*.png build/$(LINGUA)/source/figs
   2.164 +	cp stylesheets/hgbook.css build/$(LINGUA)/source
   2.165 +	$(TRANSLATE) -m en/00book.xml -p po/$(LINGUA).po -l en/hgbook.xml.$(LINGUA)
   2.166 +	xmllint --nonet --noent --xinclude --postvalid --output $@.tmp en/hgbook.xml.$(LINGUA)
   2.167 +	cat $@.tmp | sed 's/\$$rev_id\$$/${rev_id}/' > $@
   2.168 +	mv en/hgbook.xml.$(LINGUA) build/$(LINGUA)/source
   2.169 +endif
   2.170 +
   2.171 +endif
   2.172 +
   2.173 +ifndef LINGUA
   2.174 +epub:
   2.175 +	for l in $(LANGUAGES); do \
   2.176 +	    $(MAKE) $@ LINGUA=$$l; \
   2.177 +	done
   2.178 +else
   2.179 +epub: build/$(LINGUA)/epub/hgbook.epub
   2.180 +
   2.181 +build/$(LINGUA)/epub/hgbook.epub: build/$(LINGUA)/source/hgbook.xml
   2.182 +	mkdir -p build/$(LINGUA)/epub
   2.183 +	(cd build/$(LINGUA)/source; $(DB2EPUB) -c hgbook.css -v hgbook.xml; mv hgbook.epub ../epub)
   2.184 +endif
   2.185 +
   2.186 +ifndef LINGUA
   2.187 +html:
   2.188 +	for l in $(LANGUAGES); do \
   2.189 +	    $(MAKE) $@ LINGUA=$$l; \
   2.190 +	done
   2.191 +else
   2.192 +html: build/$(LINGUA)/html/index.html
   2.193 +
   2.194 +build/$(LINGUA)/html/index.html: build/$(LINGUA)/source/hgbook.xml stylesheets/html.xsl stylesheets/$(LINGUA)/html.xsl
   2.195 +	mkdir -p build/$(LINGUA)/html/figs
   2.196 +	cp en/figs/*.png build/$(LINGUA)/html/figs
   2.197 +	cp stylesheets/hgbook.css build/$(LINGUA)/html
   2.198 +	xsltproc --output build/$(LINGUA)/html/ \
   2.199 +	    stylesheets/$(LINGUA)/html.xsl build/$(LINGUA)/source/hgbook.xml
   2.200 +endif
   2.201 +
   2.202 +ifndef LINGUA
   2.203 +html-single:
   2.204 +	for l in $(LANGUAGES); do \
   2.205 +	    $(MAKE) $@ LINGUA=$$l; \
   2.206 +	done
   2.207 +else
   2.208 +html-single: build/$(LINGUA)/html-single/hgbook.html
   2.209 +
   2.210 +build/$(LINGUA)/html-single/hgbook.html: build/$(LINGUA)/source/hgbook.xml stylesheets/html-single.xsl stylesheets/$(LINGUA)/html-single.xsl
   2.211 +	mkdir -p build/$(LINGUA)/html-single/figs
   2.212 +	cp en/figs/*.png build/$(LINGUA)/html-single/figs
   2.213 +	cp stylesheets/hgbook.css build/$(LINGUA)/html-single
   2.214 +	xsltproc --output build/$(LINGUA)/html-single/hgbook.html \
   2.215 +	    stylesheets/$(LINGUA)/html-single.xsl build/$(LINGUA)/source/hgbook.xml
   2.216 +endif
   2.217 +
   2.218 +ifndef LINGUA
   2.219 +pdf:
   2.220 +	for l in $(LANGUAGES); do \
   2.221 +	    $(MAKE) $@ LINGUA=$$l; \
   2.222 +	done
   2.223 +else
   2.224 +pdf: build/$(LINGUA)/pdf/hgbook.pdf
   2.225 +
   2.226 +build/$(LINGUA)/pdf/hgbook.pdf: build/$(LINGUA)/source/hgbook.xml stylesheets/fo.xsl stylesheets/$(LINGUA)/fo.xsl
   2.227 +	mkdir -p build/$(LINGUA)/pdf
   2.228 +	java -classpath $(JAVA_LIB)/saxon65.jar:$(JAVA_LIB)/saxon65-dbxsl.jar:$(JAVA_LIB)/xml-commons-resolver-1.2.jar:$(JAVA_LIB) \
   2.229 +	    com.icl.saxon.StyleSheet \
   2.230 +	    -x org.apache.xml.resolver.tools.ResolvingXMLReader \
   2.231 +	    -y org.apache.xml.resolver.tools.ResolvingXMLReader \
   2.232 +	    -r org.apache.xml.resolver.tools.CatalogResolver \
   2.233 +	    -o build/$(LINGUA)/source/hgbook.fo \
   2.234 +	    build/$(LINGUA)/source/hgbook.xml \
   2.235 +	    stylesheets/$(LINGUA)/fo.xsl \
   2.236 +	    fop1.extensions=1
   2.237 +
   2.238 +	(cd build/$(LINGUA)/source && $(FOP_HOME)/fop.sh -c $(FOP_HOME)/conf/userconfig.xml hgbook.fo ../pdf/hgbook.pdf)
   2.239 +endif
   2.240 +
   2.241 +en/figs/%.png: en/figs/%.svg en/fixsvg
   2.242 +	en/fixsvg $<
   2.243 +	inkscape -D -d 120 -e $@ $<-tmp.svg
   2.244 +
   2.245 +en/figs/%.svg: en/figs/%.dot
   2.246 +	dot -Tsvg -o $@ $<
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/Makefile.vars.tmpl	Mon Apr 06 23:15:52 2009 -0700
     3.3 @@ -0,0 +1,20 @@
     3.4 +#
     3.5 +# Please create your Makefile.vars file from this template file.
     3.6 +#
     3.7 +# Please use absolute path, DO NOT use relative path !
     3.8 +#
     3.9 +
    3.10 +# po4a (>= 0.36.1): Only for PO based Makefile !
    3.11 +# po4A_HOME=/usr/bin
    3.12 +# PO4A_LIB=/usr/share/perl5
    3.13 +PO4A_HOME=/home/dongsheng/var/svn/i18n-zh/trunk/lib/po4a
    3.14 +PO4A_LIB=$(PO4A_HOME)/lib
    3.15 +
    3.16 +# saxon65.jar, saxon65-dbxsl.jar, xml-commons-resolver-1.2.jar: Only for pdf format !
    3.17 +JAVA_LIB=/home/dongsheng/var/svn/i18n-zh/trunk/lib/share/java
    3.18 +
    3.19 +# fop (>= 0.9.6): Only for pdf format !
    3.20 +FOP_HOME=/home/dongsheng/var/svn/i18n-zh/trunk/lib/fop
    3.21 +
    3.22 +# docbook-xsl (>= 1.74.3): Only for ePub format !
    3.23 +DB2EPUB=/home/dongsheng/var/svn/i18n-zh/trunk/lib/docbook/docbook-xsl/epub/bin/dbtoepub
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/README.BUILD	Mon Apr 06 23:15:52 2009 -0700
     4.3 @@ -0,0 +1,99 @@
     4.4 +HOW-TO:  Compiling the Mercurial Book
     4.5 +======================================
     4.6 +
     4.7 +This Mercurial Book is written in DocBook 4.5.
     4.8 +
     4.9 +The goal of this document is to give simple instructions to anyone who
    4.10 +wants to compile this book into a useful format, like HTML or PDF.  It
    4.11 +should state *exactly* which tools to use, and how to invoke them, in
    4.12 +simplest terms.
    4.13 +
    4.14 +Table of Contents:
    4.15 +
    4.16 +  I. PRIMER
    4.17 + II. COMPILING THE DOCS
    4.18 +III. HACKING ON THE DOCS
    4.19 +
    4.20 +I. PRIMER
    4.21 +
    4.22 +  DocBook has a tortured, confusing history.  Before you do anything,
    4.23 +  take a look at Eric Raymond's excellent "DocBook Demystification HOWTO":
    4.24 +
    4.25 +      http://tldp.org/HOWTO/DocBook-Demystification-HOWTO/
    4.26 +
    4.27 +  It's very short and clears up many things.
    4.28 +
    4.29 +
    4.30 +II. COMPILING THE DOCS
    4.31 +
    4.32 +
    4.33 +1. Install XML DTD and XSL stylesheets for DocBook
    4.34 +
    4.35 +      % sudo apt-get install docbook-xml docbook-xsl
    4.36 +
    4.37 +2. Install libxml2-utils
    4.38 +
    4.39 +      % sudo apt-get install libxml2-utils
    4.40 +
    4.41 +3. Install graph drawing tools
    4.42 +
    4.43 +      % sudo apt-get install graphviz inkscape
    4.44 +
    4.45 +4. Install pdf support
    4.46 +
    4.47 +      % sudo apt-get install openjdk-6-jdk docbook-xsl-saxon libsaxon-java fop
    4.48 +
    4.49 +  The Makefile will actually invoke tools/fop/fop.sh, you should do
    4.50 +  some trick, let fop's CLASSPATH include saxon.jar and docbook-xsl-saxon.jar .
    4.51 +
    4.52 +5. Make
    4.53 +  Run 'make' for more details, for example:
    4.54 +
    4.55 +  * make all document(pdf, html and html-single for all languages)
    4.56 +      % make all
    4.57 +
    4.58 +  * make english document(pdf, html and html-single for all languages)
    4.59 +      % make LINGUA=en all
    4.60 +
    4.61 +  * make Chinese document(pdf, html and html-single for all languages)
    4.62 +      % make LINGUA=zh all
    4.63 +
    4.64 +  * make Chinese pdf document
    4.65 +      % make LINGUA=zh pdf
    4.66 +
    4.67 +III. HACKING ON THE DOCS
    4.68 +
    4.69 +In addition to everything in section II:
    4.70 +
    4.71 +
    4.72 +1. Get a nice editing environment for SGML/XML.
    4.73 +
    4.74 +  This isn't strictly required, but it's nice when your editor
    4.75 +  colorizes things, understands the DTD, tells you what tags you can
    4.76 +  insert, etc.
    4.77 +
    4.78 +  If you use emacs, we recommend the PSGML major-mode.  Most free
    4.79 +  operating systems package it, or its home page is here:
    4.80 +
    4.81 +      http://www.lysator.liu.se/projects/about_psgml.html
    4.82 +
    4.83 +  If you use vim, you might check out xmledit, at:
    4.84 +
    4.85 +      http://www.vim.org/scripts/script.php?script_id=301
    4.86 +
    4.87 +
    4.88 +2. Get a validating parser.
    4.89 +
    4.90 +  Actually, if you have what you need to compile the documentation,
    4.91 +  then you almost certainly have an XML validator installed already -
    4.92 +  it is called xmllint, and comes as part of libxml2.
    4.93 +
    4.94 +  The makefile is preconfigured with a suitable invocation of it,
    4.95 +  so simply run:
    4.96 +
    4.97 +      $ make validate
    4.98 +
    4.99 +3. Read about DocBook.
   4.100 +
   4.101 +  You'll want to get real intimate with a DocBook reference, such as
   4.102 +  can be found at:  http://www.docbook.org/tdg/en/html/
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/contrib/hg-interdiff	Mon Apr 06 23:15:52 2009 -0700
     5.3 @@ -0,0 +1,45 @@
     5.4 +#!/usr/bin/env python
     5.5 +#
     5.6 +# Adapter for using interdiff with mercurial's extdiff extension.
     5.7 +#
     5.8 +# Copyright 2006 Bryan O'Sullivan <bos@serpentine.com>
     5.9 +#
    5.10 +# This software may be used and distributed according to the terms of
    5.11 +# the GNU General Public License, incorporated herein by reference.
    5.12 +
    5.13 +import os, sys
    5.14 +
    5.15 +def walk(base):
    5.16 +    # yield all non-directories below the base path.
    5.17 +    for root, dirs, files in os.walk(base):
    5.18 +        for f in files:
    5.19 +            path = os.path.join(root, f)
    5.20 +            yield path[len(base)+1:], path
    5.21 +    else:
    5.22 +        if os.path.isfile(base):
    5.23 +            yield '', base
    5.24 +
    5.25 +# create list of unique file names under both directories.
    5.26 +files = dict(walk(sys.argv[1]))
    5.27 +files.update(walk(sys.argv[2]))
    5.28 +files = files.keys()
    5.29 +files.sort()
    5.30 +
    5.31 +def name(base, f):
    5.32 +    if f:
    5.33 +        path = os.path.join(base, f)
    5.34 +    else:
    5.35 +        path = base
    5.36 +    # interdiff requires two files; use /dev/null if one is missing.
    5.37 +    if os.path.exists(path):
    5.38 +        return path
    5.39 +    return '/dev/null'
    5.40 +
    5.41 +ret = 0
    5.42 +
    5.43 +for f in files:
    5.44 +    if os.system('interdiff "%s" "%s"' % (name(sys.argv[1], f),
    5.45 +                                          name(sys.argv[2], f))):
    5.46 +        ret = 1
    5.47 +
    5.48 +sys.exit(ret)
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/contrib/hg-package	Mon Apr 06 23:15:52 2009 -0700
     6.3 @@ -0,0 +1,80 @@
     6.4 +#!/bin/sh
     6.5 +
     6.6 +build_dir=`dirname "$0"`/../build
     6.7 +rev_id=`hg parents --template '{date|shortdate}' | sed 's/-//g'`
     6.8 +
     6.9 +for l in en zh; do
    6.10 +  (
    6.11 +  if [ ! -d "${build_dir}/${l}" ] ; then
    6.12 +    continue
    6.13 +  fi
    6.14 +
    6.15 +  cd ${build_dir}/${l};
    6.16 +
    6.17 +  f='html'
    6.18 +  if [ -f "${f}/index.html" ] ; then
    6.19 +     d=hgbook-${l}-${f}
    6.20 +     rm -fr ${d} && cp -r ${f} ${d} && tar czf ../${d}-${rev_id}.tar.gz ${d}
    6.21 +  fi
    6.22 +
    6.23 +  f='html-single'
    6.24 +  if [ -f "${f}/hgbook.html" ] ; then
    6.25 +     d=hgbook-${l}-${f}
    6.26 +     rm -fr ${d} && cp -r ${f} ${d} && tar czf ../${d}-${rev_id}.tar.gz ${d}
    6.27 +  fi
    6.28 +
    6.29 +  if [ -f "pdf/hgbook.pdf" ] ; then
    6.30 +     cp pdf/hgbook.pdf ../hgbook-${l}-${rev_id}.pdf
    6.31 +     gzip -f9 ../hgbook-${l}-${rev_id}.pdf
    6.32 +  fi
    6.33 +
    6.34 +  if [ -f "epub/hgbook.epub" ] ; then
    6.35 +     cp epub/hgbook.epub ../hgbook-${l}-${rev_id}.epub
    6.36 +  fi
    6.37 +  )
    6.38 +done
    6.39 +
    6.40 +upload_pass=$1
    6.41 +upload_user=$2
    6.42 +
    6.43 +# echo "upload_pass: ${upload_pass}"
    6.44 +# echo "upload_user: ${upload_user}"
    6.45 +
    6.46 +if [ "${upload_user}x" == "x" ]; then
    6.47 +  upload_user="dongsheng.song"
    6.48 +fi
    6.49 +
    6.50 +if [ "${upload_pass}x" != "x" ]; then
    6.51 +  (
    6.52 +  cd ${build_dir}
    6.53 +  curl -s -O http://support.googlecode.com/svn/trunk/scripts/googlecode_upload.py
    6.54 +  if [[ "0" != $? ]]; then
    6.55 +    exit 1
    6.56 +  fi
    6.57 +
    6.58 +  for l in en zh; do
    6.59 +    if [ -f "hgbook-${l}-${rev_id}.epub" ] ; then
    6.60 +      python googlecode_upload.py --user="${upload_user}" --password="${upload_pass}" \
    6.61 +          -p "i18n-zh" -l "Type-Docs,book,hgbook,hg,mercurial,ebook" \
    6.62 +          -s "Distributed revision control with Mercurial - ${l} - ePub" \
    6.63 +          hgbook-${l}-${rev_id}.epub
    6.64 +    fi
    6.65 +
    6.66 +    if [ -f "hgbook-${l}-${rev_id}.pdf.gz" ] ; then
    6.67 +      python googlecode_upload.py --user="${upload_user}" --password="${upload_pass}" \
    6.68 +          -p "i18n-zh" -l "Type-Docs,book,hgbook,hg,mercurial" \
    6.69 +          -s "Distributed revision control with Mercurial - ${l} - pdf" \
    6.70 +          hgbook-${l}-${rev_id}.pdf.gz
    6.71 +    fi
    6.72 +
    6.73 +    for f in html html-single; do
    6.74 +      if [ -f "hgbook-${l}-${f}-${rev_id}.tar.gz" ] ; then
    6.75 +        python googlecode_upload.py --user="${upload_user}" --password="${upload_pass}" \
    6.76 +            -p "i18n-zh" -l "Type-Docs,book,hgbook,hg,mercurial" \
    6.77 +            -s "Distributed revision control with Mercurial - ${l} - ${f}" \
    6.78 +            hgbook-${l}-${f}-${rev_id}.tar.gz
    6.79 +      fi
    6.80 +    done
    6.81 +  done
    6.82 +  )
    6.83 +fi
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/contrib/hg-replay	Mon Apr 06 23:15:52 2009 -0700
     7.3 @@ -0,0 +1,107 @@
     7.4 +#!/usr/bin/env python
     7.5 +#
     7.6 +# Adapter for using interdiff with mercurial's extdiff extension.
     7.7 +#
     7.8 +# Copyright 2006 Bryan O'Sullivan <bos@serpentine.com>
     7.9 +#
    7.10 +# This software may be used and distributed according to the terms of
    7.11 +# the GNU General Public License, incorporated herein by reference.
    7.12 +
    7.13 +import os
    7.14 +import shutil
    7.15 +import sys
    7.16 +import tempfile
    7.17 +
    7.18 +if len(sys.argv) < 4:
    7.19 +    print >> sys.stderr, ('usage: %s srcrepo destrepo cset-to-omit [...]' %
    7.20 +                          os.path.basename(sys.argv[0]))
    7.21 +    sys.exit(1)
    7.22 +
    7.23 +srcrepo, destrepo = sys.argv[1], sys.argv[2]
    7.24 +omit = sys.argv[3:]
    7.25 +    
    7.26 +changemap = {}
    7.27 +revs = []
    7.28 +
    7.29 +parent = None
    7.30 +
    7.31 +sys.stdout.write('gathering history...')
    7.32 +sys.stdout.flush()
    7.33 +
    7.34 +for line in os.popen("hg --cwd %r log -r0:tip --template '{rev}:{node} {parents}\n'" % srcrepo):
    7.35 +    changes = line.split()
    7.36 +    cset = changes[0].split(':')[1]
    7.37 +    rev = len(revs)
    7.38 +    changemap[cset] = rev
    7.39 +    if len(changes) >= 2:
    7.40 +        p1 = int(changes[1].split(':', 1)[0])
    7.41 +    if len(changes) == 3:
    7.42 +        p2 = int(changes[2].split(':', 1)[0])
    7.43 +    else:
    7.44 +        p2 = None
    7.45 +    if len(changes) == 1:
    7.46 +        p1 = parent
    7.47 +    revs.append((cset, p1, p2))
    7.48 +    parent = rev
    7.49 +
    7.50 +sys.stdout.write(' %d revs\n' % len(revs))
    7.51 +
    7.52 +def findrev(r):
    7.53 +    try:
    7.54 +        i = int(r)
    7.55 +        if str(i) == r:
    7.56 +            rev = i
    7.57 +        if rev < 0:
    7.58 +            rev += len(revs)
    7.59 +        if rev < 0 or rev > len(revs):
    7.60 +            print >> sys.stderr, 'bad changeset: %r' % r
    7.61 +            sys.exit(1)
    7.62 +        cset = revs[rev][0]
    7.63 +    except ValueError:
    7.64 +        cset = r
    7.65 +        matches = [changemap[c] for c in changemap if c.startswith(cset)]
    7.66 +        if len(matches) != 1:
    7.67 +            print >> sys.stderr, 'bad changeset: %r' % r
    7.68 +            sys.exit(1)
    7.69 +        rev = matches[0]
    7.70 +    return rev
    7.71 +
    7.72 +def run(cmd):
    7.73 +    print cmd
    7.74 +    ret = os.system(cmd)
    7.75 +    if ret:
    7.76 +        print >> sys.stderr, 'failure:', cmd
    7.77 +        sys.exit(1)
    7.78 +
    7.79 +omit = map(findrev, omit)
    7.80 +omit.sort()
    7.81 +newrevs = revs[:omit[0]]
    7.82 +tip = len(newrevs) - 1
    7.83 +run('hg clone -q -r%s %r %r' % (tip, srcrepo, destrepo))
    7.84 +    
    7.85 +os.environ['HGMERGE'] = 'true'
    7.86 +
    7.87 +patchdir = tempfile.mkdtemp(prefix='replay.')
    7.88 +try:
    7.89 +    run('hg --cwd %r export --git -o %r%s%%R %d:tip' %
    7.90 +        (srcrepo, patchdir, os.sep, omit[0]+1))
    7.91 +    for rev in xrange(omit[0], len(revs)):
    7.92 +        if rev in omit:
    7.93 +            print 'omit', rev
    7.94 +            newrevs.append((None, revs[rev][1], None))
    7.95 +            continue
    7.96 +        _, p1, p2 = revs[rev]
    7.97 +        np1 = newrevs[p1][1]
    7.98 +        if tip != np1:
    7.99 +            run('hg --cwd %r update -q -C %s' % (destrepo, np1))
   7.100 +        np2 = None
   7.101 +        if p2:
   7.102 +            np2 = newrevs[p2][1]
   7.103 +            run('hg --cwd %r merge -q %s' % (destrepo, np2))
   7.104 +            print >> sys.stderr, 'XXX - cannot handle merges properly yet'
   7.105 +        run('hg --cwd %r import -q -f %r%s%d' % (destrepo, patchdir, os.sep, rev))
   7.106 +        tip = len(newrevs) - 1
   7.107 +        newrevs.append((None, tip, np2))
   7.108 +finally:
   7.109 +    print 'cleaning up ...'
   7.110 +    #shutil.rmtree(patchdir)
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/contrib/latex-to-docbook	Mon Apr 06 23:15:52 2009 -0700
     8.3 @@ -0,0 +1,198 @@
     8.4 +#!/usr/bin/python
     8.5 +#
     8.6 +# This is the most horrible of hacks. Pretend you're not looking.</para>
     8.7 +
     8.8 +import cStringIO as StringIO
     8.9 +import re, sys
    8.10 +
    8.11 +sections = {
    8.12 +    'chapter': 'chapter',
    8.13 +    'section': 'sect1',
    8.14 +    'subsection': 'sect2',
    8.15 +    'subsubsection': 'sect3',
    8.16 +    }
    8.17 +
    8.18 +envs = {
    8.19 +    'codesample2': 'programlisting',
    8.20 +    'codesample4': 'programlisting',
    8.21 +    'enumerate': 'orderedlist',
    8.22 +    'figure': 'informalfigure',
    8.23 +    'itemize': 'itemizedlist',
    8.24 +    'note': 'note',
    8.25 +    'quote': 'blockquote',
    8.26 +    }
    8.27 +
    8.28 +def process(ifp, ofp):
    8.29 +    print >> ofp, '<!-- vim: set filetype=docbkxml shiftwidth=2 autoindent expandtab tw=77 : -->\n'
    8.30 +    stack = []
    8.31 +    para = True
    8.32 +    inlist = 0
    8.33 +    for line in ifp:
    8.34 +        if line.startswith('%%% Local Variables:'):
    8.35 +            break
    8.36 +        line = (line.rstrip()
    8.37 +                .replace('~', ' ')
    8.38 +                .replace('&', '&amp;')
    8.39 +                .replace('---', '&emdash;')
    8.40 +                .replace('\_', '_')
    8.41 +                .replace('\{', '{')
    8.42 +                .replace('\}', '}')
    8.43 +                .replace('\$', '$')
    8.44 +                .replace('\%', '%')
    8.45 +                .replace('\#', '#')
    8.46 +                .replace('<', '&lt;')
    8.47 +                .replace('>', '&gt;')
    8.48 +                .replace('``', '<quote>')
    8.49 +                .replace("''", '</quote>')
    8.50 +                .replace('\\', '\\'))
    8.51 +        line = re.sub(r'\s*\\(?:centering|small)\b\s*', '', line)
    8.52 +        line = re.sub(r'\\(?:hgrc\\|hgrc)\b',
    8.53 +                      r'<filename role="special"> /.hgrc</filename>', line)
    8.54 +        line = re.sub(r'\\item\[(?P<key>[^]]+)\]', r'\item \g<key>:', line)
    8.55 +        line = re.sub(r'\\bug{(?P<id>\d+)}',
    8.56 +                      r'<ulink role="hg-bug" url="http://www.selenic.com/mercurial/bts/issue\g<id>">issue \g<id></ulink>', line)
    8.57 +        line = re.sub(r'\\cite{([^}]+)}', r'<citation>\1</citation>', line)
    8.58 +        line = re.sub(r'\\hggopt{(?P<opt>[^}]+)}',
    8.59 +                      r'<option role="hg-opt-global">\g<opt></option>', line)
    8.60 +        line = re.sub(r'\\hgxopt{(?P<ext>[^}]+)}{(?P<cmd>[^}]+)}{(?P<opt>[^}]+)}',
    8.61 +                      r'<option role="hg-ext-\g<ext>-cmd-\g<cmd>-opt">\g<opt></option>', line)
    8.62 +        line = re.sub(r'\\hgxcmd{(?P<ext>[^}]+)}{(?P<cmd>[^}]+)}',
    8.63 +                      r'<command role="hg-ext-\g<ext>">\g<cmd></command>', line)
    8.64 +        line = re.sub(r'\\hgext{(?P<ext>[^}]+)}',
    8.65 +                      r'<literal role="hg-ext">\g<ext></literal>', line)
    8.66 +        line = re.sub(r'\\hgopt{(?P<cmd>[^}]+)}{(?P<opt>[^}]+)}',
    8.67 +                      r'<option role="hg-opt-\g<cmd>">\g<opt></option>',
    8.68 +                      line)
    8.69 +        line = re.sub(r'\\cmdopt{(?P<cmd>[^}]+)}{(?P<opt>[^}]+)}',
    8.70 +                      r'<option role="cmd-opt-\g<cmd>">\g<opt></option>',
    8.71 +                      line)
    8.72 +        line = re.sub(r'\\hgcmd{(?P<cmd>[^}]+)}',
    8.73 +                      r'<command role="hg-cmd">hg \g<cmd></command>', line)
    8.74 +        line = re.sub(r'\\caption{(?P<text>[^}]+?)}',
    8.75 +                      r'<caption><para>\g<text></para></caption>', line)
    8.76 +        line = re.sub(r'\\grafix{(?P<name>[^}]+)}',
    8.77 +                      r'<mediaobject><imageobject><imagedata fileref="\g<name>"/></imageobject><textobject><phrase>XXX add text</phrase></textobject></mediaobject>', line)
    8.78 +        line = re.sub(r'\\envar{(?P<name>[^}]+)}',
    8.79 +                      r'<envar>\g<name></envar>', line)
    8.80 +        line = re.sub(r'\\rcsection{(?P<sect>[^}]+)}',
    8.81 +                      r'<literal role="rc-\g<sect>">\g<sect></literal>', line)
    8.82 +        line = re.sub(r'\\rcitem{(?P<sect>[^}]+)}{(?P<name>[^}]+)}',
    8.83 +                      r'<envar role="rc-item-\g<sect>">\g<name></envar>', line)
    8.84 +        line = re.sub(r'\\dirname{(?P<dir>[^}]+?)}',
    8.85 +                      r'<filename class="directory">\g<dir></filename>', line)
    8.86 +        line = re.sub(r'\\filename{(?P<file>[^}]+?)}',
    8.87 +                      r'<filename>\g<file></filename>', line)
    8.88 +        line = re.sub(r'\\tildefile{(?P<file>[^}]+)}',
    8.89 +                      r'<filename role="home">~/\g<file></filename>', line)
    8.90 +        line = re.sub(r'\\sfilename{(?P<file>[^}]+)}',
    8.91 +                      r'<filename role="special">\g<file></filename>', line)
    8.92 +        line = re.sub(r'\\sdirname{(?P<dir>[^}]+)}',
    8.93 +                      r'<filename role="special" class="directory">\g<dir></filename>', line)
    8.94 +        line = re.sub(r'\\interaction{(?P<id>[^}]+)}',
    8.95 +                      r'<!-- &interaction.\g<id>; -->', line)
    8.96 +        line = re.sub(r'\\excode{(?P<id>[^}]+)}',
    8.97 +                      r'<!-- &example.\g<id>; -->', line)
    8.98 +        line = re.sub(r'\\pymod{(?P<mod>[^}]+)}',
    8.99 +                      r'<literal role="py-mod">\g<mod></literal>', line)
   8.100 +        line = re.sub(r'\\pymodclass{(?P<mod>[^}]+)}{(?P<class>[^}]+)}',
   8.101 +                      r'<literal role="py-mod-\g<mod>">\g<class></literal>', line)
   8.102 +        line = re.sub(r'\\url{(?P<url>[^}]+)}',
   8.103 +                      r'<ulink url="\g<url>">\g<url></ulink>', line)
   8.104 +        line = re.sub(r'\\href{(?P<url>[^}]+)}{(?P<text>[^}]+)}',
   8.105 +                      r'<ulink url="\g<url>">\g<text></ulink>', line)
   8.106 +        line = re.sub(r'\\command{(?P<cmd>[^}]+)}',
   8.107 +                      r'<command>\g<cmd></command>', line)
   8.108 +        line = re.sub(r'\\option{(?P<opt>[^}]+)}',
   8.109 +                      r'<option>\g<opt></option>', line)
   8.110 +        line = re.sub(r'\\ref{(?P<id>[^}]+)}', r'<xref linkend="\g<id>"/>', line)
   8.111 +        line = re.sub(r'\\emph{(?P<txt>[^}]+)}',
   8.112 +                      r'<emphasis>\g<txt></emphasis>', line)
   8.113 +        line = re.sub(r'\\texttt{(?P<txt>[^}]+)}',
   8.114 +                      r'<literal>\g<txt></literal>', line)
   8.115 +        line = re.sub(r'\\textbf{(?P<txt>[^}]+)}',
   8.116 +                      r'<emphasis role="bold">\g<txt></emphasis>', line)
   8.117 +        line = re.sub(r'\\hook{(?P<name>[^}]+)}',
   8.118 +                      r'<literal role="hook">\g<name></literal>', line)
   8.119 +        line = re.sub(r'\\tplfilter{(?P<name>[^}]+)}',
   8.120 +                      r'<literal role="template-filter">\g<name></literal>', line)
   8.121 +        line = re.sub(r'\\tplkword{(?P<name>[^}]+)}',
   8.122 +                      r'<literal role="template-keyword">\g<name></literal>', line)
   8.123 +        line = re.sub(r'\\tplkwfilt{(?P<tpl>[^}]+)}{(?P<name>[^}]+)}',
   8.124 +                      r'<literal role="template-kw-filt-\g<tpl>">\g<name></literal>', line)
   8.125 +        line = re.sub(r'\\[vV]erb(.)(?P<txt>[^\1]+?)\1',
   8.126 +                      r'<literal>\g<txt></literal>', line)
   8.127 +        line = re.sub(r'\\package{(?P<name>[^}]+)}',
   8.128 +                      r'<literal role="package">\g<name></literal>', line)
   8.129 +        line = re.sub(r'\\hgcmdargs{(?P<cmd>[^}]+)}{(?P<args>[^}]+)}',
   8.130 +                      r'<command role="hg-cmd">hg \g<cmd> \g<args></command>',
   8.131 +                      line)
   8.132 +        line = re.sub(r'\\cmdargs{(?P<cmd>[^}]+)}{(?P<args>[^}]+)}',
   8.133 +                      r'<command>\g<cmd> \g<args></command>',
   8.134 +                      line)
   8.135 +        m = re.match(r'\\(chapter|section|subsection|subsubsection){(.*)}', line)
   8.136 +        if m:
   8.137 +            kind, content = m.groups()
   8.138 +            sec = sections[kind]
   8.139 +            while stack and stack[-1] >= sec:
   8.140 +                close = stack.pop()
   8.141 +                print >> ofp, '</%s>' % close
   8.142 +            stack.append(sec)
   8.143 +            print >> ofp, '<%s>\n<title>%s</title>' % (sec, content)
   8.144 +        else:
   8.145 +            m = re.match(r'\s*\\(begin|end){(?P<sect>[^}]+)}', line)
   8.146 +            if m:
   8.147 +                if not para:
   8.148 +                    print >> ofp, '</para>'
   8.149 +                    if inlist:
   8.150 +                        ofp.write('</listitem>')
   8.151 +                    para = True
   8.152 +                state, env = m.groups()
   8.153 +                env = envs[env]
   8.154 +                if state == 'begin':
   8.155 +                    ofp.write('<')
   8.156 +                    if env in ('itemizedlist', 'orderedlist'):
   8.157 +                        inlist = 1
   8.158 +                else:
   8.159 +                    ofp.write('</')
   8.160 +                    if env in ('itemizedlist', 'orderedlist'):
   8.161 +                        inlist = 0
   8.162 +                print >> ofp, env + '>'
   8.163 +            else:
   8.164 +                if line.startswith('\\item '):
   8.165 +                    if inlist > 1:
   8.166 +                        print >> ofp, '</para>'
   8.167 +                        print >> ofp, '</listitem>'
   8.168 +                    else:
   8.169 +                        inlist = 2
   8.170 +                    para = True
   8.171 +                    line = line[6:]
   8.172 +                if line and para:
   8.173 +                    if inlist:
   8.174 +                        ofp.write('<listitem>')
   8.175 +                    ofp.write('<para>')
   8.176 +                    para = False
   8.177 +                if not line and not para:
   8.178 +                    print >> ofp, '</para>'
   8.179 +                    if inlist:
   8.180 +                        ofp.write('</listitem>')
   8.181 +                    para = True
   8.182 +                print >> ofp, line
   8.183 +    while stack:
   8.184 +        print >> ofp, '</%s>' % stack.pop()
   8.185 +    ofp.write('\n'.join(['\n<!--',
   8.186 +                         'local variables: ',
   8.187 +                         'sgml-parent-document: ("00book.xml" "book" "chapter")',
   8.188 +                         'end:',
   8.189 +                         '-->']))
   8.190 +
   8.191 +
   8.192 +if __name__ == '__main__':
   8.193 +    for name in sys.argv[1:]:
   8.194 +        if not name.endswith('.tex'):
   8.195 +            continue
   8.196 +        newname = name[:-3] + 'xml'
   8.197 +        ofp = StringIO.StringIO()
   8.198 +        process(open(name), ofp)
   8.199 +        s = ofp.getvalue()
   8.200 +        s = re.sub('\n+</para>', '</para>', s, re.M)
   8.201 +        open(newname, 'w').write(s)
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/contrib/sillybench.py	Mon Apr 06 23:15:52 2009 -0700
     9.3 @@ -0,0 +1,177 @@
     9.4 +#!/usr/bin/python
     9.5 +#
     9.6 +# Silly benchmarking program, to give a vague idea of how fast a few
     9.7 +# tools are on a handful of common operations.
     9.8 +#
     9.9 +# Use a fairly big and real source tarball to test with: Firefox
    9.10 +# 2.0.0.3 (37622 files, 5374 directories, 343MB unpacked onto
    9.11 +# 4KB-blocksize ext3).
    9.12 +
    9.13 +import csv
    9.14 +import os
    9.15 +import shutil
    9.16 +import sys
    9.17 +import tempfile
    9.18 +import time
    9.19 +import urllib2
    9.20 +
    9.21 +url = 'ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/2.0.0.3/source/firefox-2.0.0.3-source.tar.bz2'
    9.22 +
    9.23 +class CommandFailure(Exception):
    9.24 +    pass
    9.25 +
    9.26 +class rcs(object):
    9.27 +    def __init__(self):
    9.28 +        self.logfp = open(self.__class__.__name__ + '.csv', 'w')
    9.29 +        self.csv = csv.writer(self.logfp)
    9.30 +
    9.31 +    def download(self):
    9.32 +        name = url[url.rfind('/')+1:]
    9.33 +        path = os.path.join(os.environ['HOME'], name)
    9.34 +        if not os.path.isfile(path):
    9.35 +            ofp = open(path + '.part', 'wb')
    9.36 +            try:
    9.37 +                ifp = urllib2.urlopen(url)
    9.38 +                nbytes = ifp.info()['content-length']
    9.39 +                sys.stdout.write('%s: %s bytes ' % (name, nbytes))
    9.40 +                sys.stdout.flush()
    9.41 +                while True:
    9.42 +                    data = ifp.read(131072)
    9.43 +                    if not data: break
    9.44 +                    sys.stdout.write('.')
    9.45 +                    sys.stdout.flush()
    9.46 +                    ofp.write(data)
    9.47 +                del ofp
    9.48 +                os.rename(path + '.part', path)
    9.49 +            except:
    9.50 +                if os.path.exists(path + '.part'):
    9.51 +                    os.unlink(path + '.part')
    9.52 +                if os.path.exists(path):
    9.53 +                    os.unlink(path)
    9.54 +                raise
    9.55 +        return path
    9.56 +
    9.57 +    def run(self, args, mustsucceed=True):
    9.58 +        ret = os.spawnvp(os.P_WAIT, args[0], args)
    9.59 +        if ret < 0:
    9.60 +            msg = 'killed by signal %d' % (-ret)
    9.61 +        if ret > 0:
    9.62 +            msg = 'exited with status %d' % (ret)
    9.63 +        if ret:
    9.64 +            if mustsucceed:
    9.65 +                raise CommandFailure('%s: %s' % (msg, ' '.join(args)))
    9.66 +            print >> sys.stderr, 'WARNING: %s: %s' % (msg, ' '.join(args))
    9.67 +
    9.68 +    def time(self, *args, **kwargs):
    9.69 +        start = time.time()
    9.70 +        self.run(*args, **kwargs)
    9.71 +        end = time.time()
    9.72 +        return end - start
    9.73 +        
    9.74 +    def logtime(self, name, elapsed, rest=[]):
    9.75 +        self.log('time:' + name, '%.3f' % elapsed, rest)
    9.76 +
    9.77 +    def log(self, name, value, rest=[]):
    9.78 +        item = (name, value, repr(rest))
    9.79 +        print ' '.join(item)
    9.80 +        self.csv.writerow(item)
    9.81 +        self.logfp.flush()
    9.82 +
    9.83 +    def unpack(self):
    9.84 +        tarball = self.download()
    9.85 +        t = self.time(['tar', '-C', self.wdir, '-jxf', tarball])
    9.86 +        self.logtime('internal:untar', t)
    9.87 +        for name in os.listdir(os.path.join(self.wdir, 'mozilla')):
    9.88 +            os.rename(os.path.join(self.wdir, 'mozilla', name),
    9.89 +                      os.path.join(self.wdir, name))
    9.90 +
    9.91 +    def cleanup(self):
    9.92 +        pass
    9.93 +
    9.94 +    def add(self, paths):
    9.95 +        pass
    9.96 +
    9.97 +    def commit(self, msg, paths):
    9.98 +        pass
    9.99 +
   9.100 +    def status(self, path):
   9.101 +        pass
   9.102 +
   9.103 +    def remove(self, path):
   9.104 +        pass
   9.105 +
   9.106 +
   9.107 +class subversion(rcs):
   9.108 +    def __init__(self, root):
   9.109 +        rcs.__init__(self)
   9.110 +        self.repo = os.path.join(root, 'repo')
   9.111 +        self.wdir = os.path.join(root, 'wc')
   9.112 +        create = self.time(['svnadmin', 'create', '--fs-type=fsfs', self.repo])
   9.113 +        self.logtime('svn:create', create)
   9.114 +        co = self.time(['svn', 'co', 'file://' + self.repo, self.wdir])
   9.115 +        self.logtime('svn:co', co)
   9.116 +        self.logtime('init', create + co)
   9.117 +        os.chdir(self.wdir)
   9.118 +
   9.119 +    def dropmeta(self, names):
   9.120 +        return [n for n in names if os.path.basename(n) != '.svn']
   9.121 +
   9.122 +    def add(self, paths):
   9.123 +        t = self.time(['svn', 'add', '-q'] + paths)
   9.124 +        self.logtime('add %r' % paths, t)
   9.125 +
   9.126 +    def commit(self, msg, paths=[]):
   9.127 +        if paths:
   9.128 +            t = self.time(['svn', 'ci', '-q', '-m', msg] + paths)
   9.129 +        else:
   9.130 +            t = self.time(['svn', 'ci', '-q', '-m', msg])
   9.131 +        self.logtime('commit %r' % paths, t)
   9.132 +
   9.133 +
   9.134 +class mercurial(rcs):
   9.135 +    def __init__(self, root):
   9.136 +        rcs.__init__(self)
   9.137 +        self.repo = os.path.join(root, 'repo')
   9.138 +        self.wdir = self.repo
   9.139 +        init = self.time(['hg', 'init', self.repo])
   9.140 +        self.logtime('init', init)
   9.141 +        os.chdir(self.wdir)
   9.142 +
   9.143 +    def dropmeta(self, names):
   9.144 +        return [n for n in names if os.path.basename(n) != '.hg']
   9.145 +
   9.146 +    def add(self, paths):
   9.147 +        t = self.time(['hg', 'add', '-q'] + paths)
   9.148 +        self.logtime('add %r' % paths, t)
   9.149 +
   9.150 +    def commit(self, msg, paths=[]):
   9.151 +        if paths:
   9.152 +            t = self.time(['hg', 'ci', '-q', '-m', msg] + paths)
   9.153 +        else:
   9.154 +            t = self.time(['hg', 'ci', '-q', '-m', msg])
   9.155 +        self.logtime('commit %r' % paths, t)
   9.156 +
   9.157 +def benchmark(cls):
   9.158 +    oldcwd = os.getcwd()
   9.159 +    root = tempfile.mkdtemp(prefix='sillybench.')
   9.160 +    try:
   9.161 +        print 'root', root
   9.162 +        inst = cls(root)
   9.163 +        inst.unpack()
   9.164 +        names = inst.dropmeta(os.listdir('.'))
   9.165 +        dirs = [n for n in names if os.path.isdir(n)]
   9.166 +        nondirs = [n for n in names if not os.path.isdir(n)]
   9.167 +        dirs.sort(key=hash)
   9.168 +        names.sort(key=hash)
   9.169 +        for d in dirs[:len(dirs)/2]:
   9.170 +            inst.add([d])
   9.171 +            inst.commit('Add %r' % d, [d])
   9.172 +        inst.add(dirs[len(dirs)/2:] + names)
   9.173 +        inst.commit('Add remaining dirs and files')
   9.174 +    finally:
   9.175 +        print >> sys.stderr, '[cleaning up...]'
   9.176 +        shutil.rmtree(root)
   9.177 +        os.chdir(oldcwd)
   9.178 +
   9.179 +benchmark(mercurial)
   9.180 +#benchmark(subversion)
    10.1 --- a/en/00book.xml	Mon Apr 06 23:13:53 2009 -0700
    10.2 +++ b/en/00book.xml	Mon Apr 06 23:15:52 2009 -0700
    10.3 @@ -39,6 +39,11 @@
    10.4  
    10.5  <book id="hg">
    10.6    <title>Mercurial: The Definitive Guide</title>
    10.7 +  
    10.8 +  <!-- hg parents &#x2d;&#x2d;template '{node|short} ({date|shortdate})' 
    10.9 +  <subtitle>Compiled from 8a1d3f1aff17 (2009-03-10)</subtitle>
   10.10 +  -->
   10.11 +  <subtitle>Compiled from $rev_id$</subtitle>
   10.12    <bookinfo>
   10.13      <edition>1</edition>
   10.14      <isbn>9780596800673</isbn>
   10.15 @@ -91,8 +96,6 @@
   10.16    &ch12;
   10.17    <!-- BEGIN ch13 -->
   10.18    &ch13;
   10.19 -  <!-- BEGIN appA -->
   10.20 -  <!-- &appA; -->
   10.21    <!-- BEGIN appB -->
   10.22    &appB;
   10.23    <!-- BEGIN appC -->
    11.1 --- a/en/Makefile	Mon Apr 06 23:13:53 2009 -0700
    11.2 +++ b/en/Makefile	Mon Apr 06 23:15:52 2009 -0700
    11.3 @@ -112,18 +112,18 @@
    11.4  
    11.5  all: web complete.xml
    11.6  
    11.7 -../xsl/system-xsl: $(system-xsl-dir)
    11.8 +../stylesheets/system-xsl: $(system-xsl-dir)
    11.9  	ln -s $< $@
   11.10  
   11.11 -web: ../xsl/system-xsl websup html
   11.12 +web: ../stylesheets/system-xsl websup html
   11.13  
   11.14  html: $(obj-web-read)/index.html
   11.15  
   11.16  ../web/index-read.html.in: ../web/genindex.py $(xml-src-files)
   11.17  	cd ../web && ./genindex.py
   11.18  
   11.19 -$(obj-web-read)/index.html: ../xsl/system-xsl .validated-00book.xml ../web/index-read.html.in
   11.20 -	xsltproc $(xsltproc-opts) -o $(obj-web-read)/x ../xsl/chunk-stylesheet.xsl 00book.xml
   11.21 +$(obj-web-read)/index.html: ../stylesheets/system-xsl .validated-00book.xml ../web/index-read.html.in
   11.22 +	xsltproc $(xsltproc-opts) -o $(obj-web-read)/x ../stylesheets/chunk-stylesheet.xsl 00book.xml
   11.23  	python ../web/texpand.py ../web/index-read.html.in html/read/index.html
   11.24  	for i in $(obj-web-read)/*.html; do \
   11.25  	  gzip -9 -c $$i > $$i.gz; \
   11.26 @@ -131,14 +131,14 @@
   11.27  
   11.28  websup: $(extras-web) $(image-web)
   11.29  	mkdir -p $(obj-websup)/figs $(obj-web-read)/figs
   11.30 -	cp ../xsl/system-xsl/images/*.png $(obj-websup)/figs
   11.31 +	cp ../stylesheets/system-xsl/images/*.png $(obj-websup)/figs
   11.32  	cp -f ../web/icons/*.png $(obj-websup)/figs
   11.33  
   11.34  complete.xml: .validated-00book.xml
   11.35 -	$(xsltproc) $(xsltproc-opts) -o $@ ../xsl/dtd-profile.xsl 00book.xml
   11.36 -
   11.37 -all-ids.dat: ../xsl/all-ids.xsl $(xml-src-files)
   11.38 -	$(xsltproc) $(xsltproc-opts) -o $@ ../xsl/all-ids.xsl 00book.xml
   11.39 +	$(xsltproc) $(xsltproc-opts) -o $@ ../stylesheets/dtd-profile.xsl 00book.xml
   11.40 +
   11.41 +all-ids.dat: ../stylesheets/all-ids.xsl $(xml-src-files)
   11.42 +	$(xsltproc) $(xsltproc-opts) -o $@ ../stylesheets/all-ids.xsl 00book.xml
   11.43  
   11.44  web: websup
   11.45  
    12.1 --- a/en/appB-mq-ref.xml	Mon Apr 06 23:13:53 2009 -0700
    12.2 +++ b/en/appB-mq-ref.xml	Mon Apr 06 23:15:52 2009 -0700
    12.3 @@ -43,7 +43,7 @@
    12.4  	<title><command
    12.5  	  role="hg-ext-mq">qdelete</command>&emdash;delete a patch
    12.6  	from the <filename role="special">series</filename>
    12.7 -	file}</title>
    12.8 +	file</title>
    12.9  
   12.10        <para id="x_5ec">The <command role="hg-ext-mq">qdelete</command> command
   12.11  	removes the entry for a patch from the <filename
    13.1 --- a/en/ch02-tour-merge.xml	Mon Apr 06 23:13:53 2009 -0700
    13.2 +++ b/en/ch02-tour-merge.xml	Mon Apr 06 23:15:52 2009 -0700
    13.3 @@ -166,7 +166,7 @@
    13.4  
    13.5        <para>We sometimes talk about a merge having
    13.6  	<emphasis>sides</emphasis>: the left side is the first parent
    13.7 -	in the output of <command rold="hg-cmd">hg parents</command>,
    13.8 +	in the output of <command role="hg-cmd">hg parents</command>,
    13.9  	and the right side is the second.  If the working directory
   13.10  	was at e.g. revision 5 before we began a merge, that revision
   13.11  	will become the left side of the merge.</para>
   13.12 @@ -255,7 +255,7 @@
   13.13  	  file</title>
   13.14  	<mediaobject>
   13.15  	  <imageobject>
   13.16 -	    <imagedata fileref="figs/kdiff3.png"/></imageobject>
   13.17 +	    <imagedata width="100%" fileref="figs/kdiff3.png"/></imageobject>
   13.18  	  <textobject>
   13.19  	    <phrase>XXX add text</phrase>
   13.20  	  </textobject>
    14.1 --- a/en/ch05-collab.xml	Mon Apr 06 23:13:53 2009 -0700
    14.2 +++ b/en/ch05-collab.xml	Mon Apr 06 23:15:52 2009 -0700
    14.3 @@ -272,7 +272,7 @@
    14.4        <figure id="fig:collab:feature-branches">
    14.5  	<title>Feature branches</title>
    14.6  	<mediaobject>
    14.7 -	  <imageobject><imagedata fileref="figs/feature-branches.png"/></imageobject>
    14.8 +	  <imageobject><imagedata width="100%" fileref="figs/feature-branches.png"/></imageobject>
    14.9  	  <textobject><phrase>XXX add text</phrase></textobject>
   14.10  	</mediaobject>
   14.11        </figure>
    15.1 --- a/en/examples/results/backout.init.out	Mon Apr 06 23:13:53 2009 -0700
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,10 +0,0 @@
    15.4 -<!-- BEGIN backout.init -->
    15.5 -<screen><prompt>$</prompt> <userinput>hg init myrepo</userinput>
    15.6 -<prompt>$</prompt> <userinput>cd myrepo</userinput>
    15.7 -<prompt>$</prompt> <userinput>echo first change &gt;&gt; myfile</userinput>
    15.8 -<prompt>$</prompt> <userinput>hg add myfile</userinput>
    15.9 -<prompt>$</prompt> <userinput>hg commit -m 'first change'</userinput>
   15.10 -<prompt>$</prompt> <userinput>echo second change &gt;&gt; myfile</userinput>
   15.11 -<prompt>$</prompt> <userinput>hg commit -m 'second change'</userinput>
   15.12 -</screen>
   15.13 -<!-- END backout.init -->
    16.1 --- a/en/examples/results/backout.manual.backout.out	Mon Apr 06 23:13:53 2009 -0700
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,11 +0,0 @@
    16.4 -<!-- BEGIN backout.manual.backout -->
    16.5 -<screen><prompt>$</prompt> <userinput>echo third change &gt;&gt; myfile</userinput>
    16.6 -<prompt>$</prompt> <userinput>hg commit -m 'third change'</userinput>
    16.7 -<prompt>$</prompt> <userinput>hg backout -m 'back out second change' 1</userinput>
    16.8 -reverting myfile
    16.9 -created new head
   16.10 -changeset  backs out changeset 
   16.11 -the backout changeset is a new head - do not forget to merge
   16.12 -(use "backout --merge" if you want to auto-merge)
   16.13 -</screen>
   16.14 -<!-- END backout.manual.backout -->
    17.1 --- a/en/examples/results/backout.manual.cat.out	Mon Apr 06 23:13:53 2009 -0700
    17.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.3 @@ -1,7 +0,0 @@
    17.4 -<!-- BEGIN backout.manual.cat -->
    17.5 -<screen><prompt>$</prompt> <userinput>cat myfile</userinput>
    17.6 -first change
    17.7 -second change
    17.8 -third change
    17.9 -</screen>
   17.10 -<!-- END backout.manual.cat -->
    18.1 --- a/en/examples/results/backout.manual.clone.out	Mon Apr 06 23:13:53 2009 -0700
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,13 +0,0 @@
    18.4 -<!-- BEGIN backout.manual.clone -->
    18.5 -<screen><prompt>$</prompt> <userinput>cd ..</userinput>
    18.6 -<prompt>$</prompt> <userinput>hg clone -r1 myrepo newrepo</userinput>
    18.7 -requesting all changes
    18.8 -adding changesets
    18.9 -adding manifests
   18.10 -adding file changes
   18.11 -added 2 changesets with 2 changes to 1 files
   18.12 -updating working directory
   18.13 -1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   18.14 -<prompt>$</prompt> <userinput>cd newrepo</userinput>
   18.15 -</screen>
   18.16 -<!-- END backout.manual.clone -->
    19.1 --- a/en/examples/results/backout.manual.heads.out	Mon Apr 06 23:13:53 2009 -0700
    19.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.3 @@ -1,16 +0,0 @@
    19.4 -<!-- BEGIN backout.manual.heads -->
    19.5 -<screen><prompt>$</prompt> <userinput>hg heads</userinput>
    19.6 -changeset:   
    19.7 -tag:         tip
    19.8 -parent:      
    19.9 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   19.10 -
   19.11 -summary:     back out second change
   19.12 -
   19.13 -changeset:   
   19.14 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   19.15 -
   19.16 -summary:     third change
   19.17 -
   19.18 -</screen>
   19.19 -<!-- END backout.manual.heads -->
    20.1 --- a/en/examples/results/backout.manual.log.out	Mon Apr 06 23:13:53 2009 -0700
    20.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.3 @@ -1,16 +0,0 @@
    20.4 -<!-- BEGIN backout.manual.log -->
    20.5 -<screen><prompt>$</prompt> <userinput>hg log --style compact</userinput>
    20.6 -3[tip]:1      2009-03-31 19:08 +0000   bos
    20.7 -  back out second change
    20.8 -
    20.9 -2      2009-03-31 19:08 +0000   bos
   20.10 -  third change
   20.11 -
   20.12 -1      2009-03-31 19:08 +0000   bos
   20.13 -  second change
   20.14 -
   20.15 -0      2009-03-31 19:08 +0000   bos
   20.16 -  first change
   20.17 -
   20.18 -</screen>
   20.19 -<!-- END backout.manual.log -->
    21.1 --- a/en/examples/results/backout.manual.merge.out	Mon Apr 06 23:13:53 2009 -0700
    21.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.3 @@ -1,11 +0,0 @@
    21.4 -<!-- BEGIN backout.manual.merge -->
    21.5 -<screen><prompt>$</prompt> <userinput>hg merge</userinput>
    21.6 -merging myfile
    21.7 -0 files updated, 1 files merged, 0 files removed, 0 files unresolved
    21.8 -(branch merge, don't forget to commit)
    21.9 -<prompt>$</prompt> <userinput>hg commit -m 'merged backout with previous tip'</userinput>
   21.10 -<prompt>$</prompt> <userinput>cat myfile</userinput>
   21.11 -first change
   21.12 -third change
   21.13 -</screen>
   21.14 -<!-- END backout.manual.merge -->
    22.1 --- a/en/examples/results/backout.manual.parents.out	Mon Apr 06 23:13:53 2009 -0700
    22.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.3 @@ -1,9 +0,0 @@
    22.4 -<!-- BEGIN backout.manual.parents -->
    22.5 -<screen><prompt>$</prompt> <userinput>hg parents</userinput>
    22.6 -changeset:   
    22.7 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
    22.8 -
    22.9 -summary:     third change
   22.10 -
   22.11 -</screen>
   22.12 -<!-- END backout.manual.parents -->
    23.1 --- a/en/examples/results/backout.non-tip.backout.out	Mon Apr 06 23:13:53 2009 -0700
    23.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.3 @@ -1,13 +0,0 @@
    23.4 -<!-- BEGIN backout.non-tip.backout -->
    23.5 -<screen><prompt>$</prompt> <userinput>echo third change &gt;&gt; myfile</userinput>
    23.6 -<prompt>$</prompt> <userinput>hg commit -m 'third change'</userinput>
    23.7 -<prompt>$</prompt> <userinput>hg backout --merge -m 'back out second change' 1</userinput>
    23.8 -reverting myfile
    23.9 -created new head
   23.10 -changeset  backs out changeset 
   23.11 -merging with changeset 
   23.12 -merging myfile
   23.13 -0 files updated, 1 files merged, 0 files removed, 0 files unresolved
   23.14 -(branch merge, don't forget to commit)
   23.15 -</screen>
   23.16 -<!-- END backout.non-tip.backout -->
    24.1 --- a/en/examples/results/backout.non-tip.cat.out	Mon Apr 06 23:13:53 2009 -0700
    24.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.3 @@ -1,6 +0,0 @@
    24.4 -<!-- BEGIN backout.non-tip.cat -->
    24.5 -<screen><prompt>$</prompt> <userinput>cat myfile</userinput>
    24.6 -first change
    24.7 -third change
    24.8 -</screen>
    24.9 -<!-- END backout.non-tip.cat -->
    25.1 --- a/en/examples/results/backout.non-tip.clone.out	Mon Apr 06 23:13:53 2009 -0700
    25.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.3 @@ -1,13 +0,0 @@
    25.4 -<!-- BEGIN backout.non-tip.clone -->
    25.5 -<screen><prompt>$</prompt> <userinput>cd ..</userinput>
    25.6 -<prompt>$</prompt> <userinput>hg clone -r1 myrepo non-tip-repo</userinput>
    25.7 -requesting all changes
    25.8 -adding changesets
    25.9 -adding manifests
   25.10 -adding file changes
   25.11 -added 2 changesets with 2 changes to 1 files
   25.12 -updating working directory
   25.13 -1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   25.14 -<prompt>$</prompt> <userinput>cd non-tip-repo</userinput>
   25.15 -</screen>
   25.16 -<!-- END backout.non-tip.clone -->
    26.1 --- a/en/examples/results/backout.simple.log.out	Mon Apr 06 23:13:53 2009 -0700
    26.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.3 @@ -1,13 +0,0 @@
    26.4 -<!-- BEGIN backout.simple.log -->
    26.5 -<screen><prompt>$</prompt> <userinput>hg log --style compact</userinput>
    26.6 -2[tip]      2009-03-31 19:08 +0000   bos
    26.7 -  back out second change
    26.8 -
    26.9 -1      2009-03-31 19:08 +0000   bos
   26.10 -  second change
   26.11 -
   26.12 -0      2009-03-31 19:08 +0000   bos
   26.13 -  first change
   26.14 -
   26.15 -</screen>
   26.16 -<!-- END backout.simple.log -->
    27.1 --- a/en/examples/results/backout.simple.out	Mon Apr 06 23:13:53 2009 -0700
    27.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.3 @@ -1,8 +0,0 @@
    27.4 -<!-- BEGIN backout.simple -->
    27.5 -<screen><prompt>$</prompt> <userinput>hg backout -m 'back out second change' tip</userinput>
    27.6 -reverting myfile
    27.7 -changeset  backs out changeset 
    27.8 -<prompt>$</prompt> <userinput>cat myfile</userinput>
    27.9 -first change
   27.10 -</screen>
   27.11 -<!-- END backout.simple -->
    28.1 --- a/en/examples/results/bisect.commits.out	Mon Apr 06 23:13:53 2009 -0700
    28.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.3 @@ -1,13 +0,0 @@
    28.4 -
    28.5 -
    28.6 -
    28.7 -
    28.8 -
    28.9 -
   28.10 -
   28.11 -
   28.12 -
   28.13 -
   28.14 -
   28.15 -
   28.16 -
    29.1 --- a/en/examples/results/bisect.help.out	Mon Apr 06 23:13:53 2009 -0700
    29.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.3 @@ -1,36 +0,0 @@
    29.4 -
    29.5 -
    29.6 -
    29.7 -
    29.8 -
    29.9 -
   29.10 -
   29.11 -
   29.12 -
   29.13 -
   29.14 -
   29.15 -
   29.16 -
   29.17 -
   29.18 -
   29.19 -
   29.20 -
   29.21 -
   29.22 -
   29.23 -
   29.24 -
   29.25 -
   29.26 -
   29.27 -
   29.28 -
   29.29 -
   29.30 -
   29.31 -
   29.32 -
   29.33 -
   29.34 -
   29.35 -
   29.36 -
   29.37 -
   29.38 -
   29.39 -
    30.1 --- a/en/examples/results/bisect.init.out	Mon Apr 06 23:13:53 2009 -0700
    30.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.3 @@ -1,5 +0,0 @@
    30.4 -
    30.5 -
    30.6 -
    30.7 -
    30.8 -
    31.1 --- a/en/examples/results/bisect.search.bad-init.out	Mon Apr 06 23:13:53 2009 -0700
    31.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.3 @@ -1,5 +0,0 @@
    31.4 -
    31.5 -
    31.6 -
    31.7 -
    31.8 -
    32.1 --- a/en/examples/results/bisect.search.good-init.out	Mon Apr 06 23:13:53 2009 -0700
    32.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.3 @@ -1,7 +0,0 @@
    32.4 -
    32.5 -
    32.6 -
    32.7 -
    32.8 -
    32.9 -
   32.10 -
    33.1 --- a/en/examples/results/bisect.search.init.out	Mon Apr 06 23:13:53 2009 -0700
    33.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.3 @@ -1,5 +0,0 @@
    33.4 -
    33.5 -
    33.6 -
    33.7 -
    33.8 -
    34.1 --- a/en/examples/results/bisect.search.mytest.out	Mon Apr 06 23:13:53 2009 -0700
    34.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.3 @@ -1,13 +0,0 @@
    34.4 -
    34.5 -
    34.6 -
    34.7 -
    34.8 -
    34.9 -
   34.10 -
   34.11 -
   34.12 -
   34.13 -
   34.14 -
   34.15 -
   34.16 -
    35.1 --- a/en/examples/results/bisect.search.reset.out	Mon Apr 06 23:13:53 2009 -0700
    35.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.3 @@ -1,5 +0,0 @@
    35.4 -
    35.5 -
    35.6 -
    35.7 -
    35.8 -
    36.1 --- a/en/examples/results/bisect.search.rest.out	Mon Apr 06 23:13:53 2009 -0700
    36.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.3 @@ -1,22 +0,0 @@
    36.4 -
    36.5 -
    36.6 -
    36.7 -
    36.8 -
    36.9 -
   36.10 -
   36.11 -
   36.12 -
   36.13 -
   36.14 -
   36.15 -
   36.16 -
   36.17 -
   36.18 -
   36.19 -
   36.20 -
   36.21 -
   36.22 -
   36.23 -
   36.24 -
   36.25 -
    37.1 --- a/en/examples/results/bisect.search.step1.out	Mon Apr 06 23:13:53 2009 -0700
    37.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.3 @@ -1,14 +0,0 @@
    37.4 -
    37.5 -
    37.6 -
    37.7 -
    37.8 -
    37.9 -
   37.10 -
   37.11 -
   37.12 -
   37.13 -
   37.14 -
   37.15 -
   37.16 -
   37.17 -
    38.1 --- a/en/examples/results/bisect.search.step2.out	Mon Apr 06 23:13:53 2009 -0700
    38.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.3 @@ -1,8 +0,0 @@
    38.4 -
    38.5 -
    38.6 -
    38.7 -
    38.8 -
    38.9 -
   38.10 -
   38.11 -
    39.1 --- a/en/examples/results/branch-named.branch.out	Mon Apr 06 23:13:53 2009 -0700
    39.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.3 @@ -1,5 +0,0 @@
    39.4 -<!-- BEGIN branch-named.branch -->
    39.5 -<screen><prompt>$</prompt> <userinput>hg branch</userinput>
    39.6 -default
    39.7 -</screen>
    39.8 -<!-- END branch-named.branch -->
    40.1 --- a/en/examples/results/branch-named.branches.out	Mon Apr 06 23:13:53 2009 -0700
    40.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.3 @@ -1,12 +0,0 @@
    40.4 -<!-- BEGIN branch-named.branches -->
    40.5 -<screen><prompt>$</prompt> <userinput>hg tip</userinput>
    40.6 -changeset:   
    40.7 -tag:         tip
    40.8 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
    40.9 -
   40.10 -summary:     Initial commit
   40.11 -
   40.12 -<prompt>$</prompt> <userinput>hg branches</userinput>
   40.13 -default                        
   40.14 -</screen>
   40.15 -<!-- END branch-named.branches -->
    41.1 --- a/en/examples/results/branch-named.commit.out	Mon Apr 06 23:13:53 2009 -0700
    41.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.3 @@ -1,13 +0,0 @@
    41.4 -<!-- BEGIN branch-named.commit -->
    41.5 -<screen><prompt>$</prompt> <userinput>echo 'hello again' &gt;&gt; myfile</userinput>
    41.6 -<prompt>$</prompt> <userinput>hg commit -m 'Second commit'</userinput>
    41.7 -<prompt>$</prompt> <userinput>hg tip</userinput>
    41.8 -changeset:   
    41.9 -branch:      foo
   41.10 -tag:         tip
   41.11 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   41.12 -
   41.13 -summary:     Second commit
   41.14 -
   41.15 -</screen>
   41.16 -<!-- END branch-named.commit -->
    42.1 --- a/en/examples/results/branch-named.create.out	Mon Apr 06 23:13:53 2009 -0700
    42.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.3 @@ -1,7 +0,0 @@
    42.4 -<!-- BEGIN branch-named.create -->
    42.5 -<screen><prompt>$</prompt> <userinput>hg branch foo</userinput>
    42.6 -marked working directory as branch foo
    42.7 -<prompt>$</prompt> <userinput>hg branch</userinput>
    42.8 -foo
    42.9 -</screen>
   42.10 -<!-- END branch-named.create -->
    43.1 --- a/en/examples/results/branch-named.foo-commit.out	Mon Apr 06 23:13:53 2009 -0700
    43.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.3 @@ -1,22 +0,0 @@
    43.4 -<!-- BEGIN branch-named.foo-commit -->
    43.5 -<screen><prompt>$</prompt> <userinput>echo something &gt; somefile</userinput>
    43.6 -<prompt>$</prompt> <userinput>hg commit -A -m 'New file'</userinput>
    43.7 -adding somefile
    43.8 -created new head
    43.9 -<prompt>$</prompt> <userinput>hg heads</userinput>
   43.10 -changeset:   
   43.11 -branch:      foo
   43.12 -tag:         tip
   43.13 -parent:      
   43.14 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   43.15 -
   43.16 -summary:     New file
   43.17 -
   43.18 -changeset:   
   43.19 -branch:      bar
   43.20 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   43.21 -
   43.22 -summary:     Third commit
   43.23 -
   43.24 -</screen>
   43.25 -<!-- END branch-named.foo-commit -->
    44.1 --- a/en/examples/results/branch-named.merge.out	Mon Apr 06 23:13:53 2009 -0700
    44.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.3 @@ -1,19 +0,0 @@
    44.4 -<!-- BEGIN branch-named.merge -->
    44.5 -<screen><prompt>$</prompt> <userinput>hg branch</userinput>
    44.6 -bar
    44.7 -<prompt>$</prompt> <userinput>hg merge foo</userinput>
    44.8 -1 files updated, 0 files merged, 0 files removed, 0 files unresolved
    44.9 -(branch merge, don't forget to commit)
   44.10 -<prompt>$</prompt> <userinput>hg commit -m 'Merge'</userinput>
   44.11 -<prompt>$</prompt> <userinput>hg tip</userinput>
   44.12 -changeset:   
   44.13 -branch:      bar
   44.14 -tag:         tip
   44.15 -parent:      
   44.16 -parent:      
   44.17 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   44.18 -
   44.19 -summary:     Merge
   44.20 -
   44.21 -</screen>
   44.22 -<!-- END branch-named.merge -->
    45.1 --- a/en/examples/results/branch-named.parents.out	Mon Apr 06 23:13:53 2009 -0700
    45.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.3 @@ -1,15 +0,0 @@
    45.4 -<!-- BEGIN branch-named.parents -->
    45.5 -<screen><prompt>$</prompt> <userinput>hg parents</userinput>
    45.6 -changeset:   
    45.7 -branch:      bar
    45.8 -tag:         tip
    45.9 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   45.10 -
   45.11 -summary:     Third commit
   45.12 -
   45.13 -<prompt>$</prompt> <userinput>hg branches</userinput>
   45.14 -bar                            
   45.15 -foo                             (inactive)
   45.16 -default                         (inactive)
   45.17 -</screen>
   45.18 -<!-- END branch-named.parents -->
    46.1 --- a/en/examples/results/branch-named.rebranch.out	Mon Apr 06 23:13:53 2009 -0700
    46.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.3 @@ -1,18 +0,0 @@
    46.4 -<!-- BEGIN branch-named.rebranch -->
    46.5 -<screen><prompt>$</prompt> <userinput>hg branch</userinput>
    46.6 -foo
    46.7 -<prompt>$</prompt> <userinput>hg branch bar</userinput>
    46.8 -marked working directory as branch bar
    46.9 -<prompt>$</prompt> <userinput>echo new file &gt; newfile</userinput>
   46.10 -<prompt>$</prompt> <userinput>hg commit -A -m 'Third commit'</userinput>
   46.11 -adding newfile
   46.12 -<prompt>$</prompt> <userinput>hg tip</userinput>
   46.13 -changeset:   
   46.14 -branch:      bar
   46.15 -tag:         tip
   46.16 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   46.17 -
   46.18 -summary:     Third commit
   46.19 -
   46.20 -</screen>
   46.21 -<!-- END branch-named.rebranch -->
    47.1 --- a/en/examples/results/branch-named.status.out	Mon Apr 06 23:13:53 2009 -0700
    47.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.3 @@ -1,11 +0,0 @@
    47.4 -<!-- BEGIN branch-named.status -->
    47.5 -<screen><prompt>$</prompt> <userinput>hg status</userinput>
    47.6 -<prompt>$</prompt> <userinput>hg tip</userinput>
    47.7 -changeset:   
    47.8 -tag:         tip
    47.9 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   47.10 -
   47.11 -summary:     Initial commit
   47.12 -
   47.13 -</screen>
   47.14 -<!-- END branch-named.status -->
    48.1 --- a/en/examples/results/branch-named.update-bar.out	Mon Apr 06 23:13:53 2009 -0700
    48.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.3 @@ -1,5 +0,0 @@
    48.4 -<!-- BEGIN branch-named.update-bar -->
    48.5 -<screen><prompt>$</prompt> <userinput>hg update bar</userinput>
    48.6 -1 files updated, 0 files merged, 1 files removed, 0 files unresolved
    48.7 -</screen>
    48.8 -<!-- END branch-named.update-bar -->
    49.1 --- a/en/examples/results/branch-named.update-foo.out	Mon Apr 06 23:13:53 2009 -0700
    49.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.3 @@ -1,13 +0,0 @@
    49.4 -$ \textbf{hg update foo}
    49.5 -0 files updated, 0 files merged, 1 files removed, 0 files unresolved
    49.6 -$ \textbf{hg update}
    49.7 -0 files updated, 0 files merged, 0 files removed, 0 files unresolved
    49.8 -$ \textbf{hg parents}
    49.9 -changeset:   
   49.10 -branch:      foo
   49.11 -user:        Bryan O'Sullivan <bos@serpentine.com>
   49.12 -
   49.13 -summary:     Second commit
   49.14 -
   49.15 -$ \textbf{hg update bar}
   49.16 -1 files updated, 0 files merged, 0 files removed, 0 files unresolved
    50.1 --- a/en/examples/results/branch-named.update-nothing.out	Mon Apr 06 23:13:53 2009 -0700
    50.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.3 @@ -1,7 +0,0 @@
    50.4 -<!-- BEGIN branch-named.update-nothing -->
    50.5 -<screen><prompt>$</prompt> <userinput>hg update foo</userinput>
    50.6 -0 files updated, 0 files merged, 1 files removed, 0 files unresolved
    50.7 -<prompt>$</prompt> <userinput>hg update</userinput>
    50.8 -0 files updated, 0 files merged, 0 files removed, 0 files unresolved
    50.9 -</screen>
   50.10 -<!-- END branch-named.update-nothing -->
    51.1 --- a/en/examples/results/branch-named.update-switchy.out	Mon Apr 06 23:13:53 2009 -0700
    51.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.3 @@ -1,22 +0,0 @@
    51.4 -<!-- BEGIN branch-named.update-switchy -->
    51.5 -<screen><prompt>$</prompt> <userinput>hg update foo</userinput>
    51.6 -0 files updated, 0 files merged, 1 files removed, 0 files unresolved
    51.7 -<prompt>$</prompt> <userinput>hg parents</userinput>
    51.8 -changeset:   
    51.9 -branch:      foo
   51.10 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   51.11 -
   51.12 -summary:     Second commit
   51.13 -
   51.14 -<prompt>$</prompt> <userinput>hg update bar</userinput>
   51.15 -1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   51.16 -<prompt>$</prompt> <userinput>hg parents</userinput>
   51.17 -changeset:   
   51.18 -branch:      bar
   51.19 -tag:         tip
   51.20 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   51.21 -
   51.22 -summary:     Third commit
   51.23 -
   51.24 -</screen>
   51.25 -<!-- END branch-named.update-switchy -->
    52.1 --- a/en/examples/results/branch-named.update.out	Mon Apr 06 23:13:53 2009 -0700
    52.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.3 @@ -1,13 +0,0 @@
    52.4 -$ \textbf{hg update foo}
    52.5 -0 files updated, 0 files merged, 1 files removed, 0 files unresolved
    52.6 -$ \textbf{hg update}
    52.7 -0 files updated, 0 files merged, 0 files removed, 0 files unresolved
    52.8 -$ \textbf{hg parent}
    52.9 -changeset:   
   52.10 -branch:      foo
   52.11 -user:        Bryan O'Sullivan <bos@serpentine.com>
   52.12 -
   52.13 -summary:     Second commit
   52.14 -
   52.15 -$ \textbf{hg update bar}
   52.16 -1 files updated, 0 files merged, 0 files removed, 0 files unresolved
    53.1 --- a/en/examples/results/branch-repo.bugfix.out	Mon Apr 06 23:13:53 2009 -0700
    53.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.3 @@ -1,16 +0,0 @@
    53.4 -<!-- BEGIN branch-repo.bugfix -->
    53.5 -<screen><prompt>$</prompt> <userinput>hg clone myproject-1.0.1 my-1.0.1-bugfix</userinput>
    53.6 -updating working directory
    53.7 -2 files updated, 0 files merged, 0 files removed, 0 files unresolved
    53.8 -<prompt>$</prompt> <userinput>cd my-1.0.1-bugfix</userinput>
    53.9 -<prompt>$</prompt> <userinput>echo 'I fixed a bug using only echo!' &gt;&gt; myfile</userinput>
   53.10 -<prompt>$</prompt> <userinput>hg commit -m 'Important fix for 1.0.1'</userinput>
   53.11 -<prompt>$</prompt> <userinput>hg push</userinput>
   53.12 -pushing to 
   53.13 -searching for changes
   53.14 -adding changesets
   53.15 -adding manifests
   53.16 -adding file changes
   53.17 -added 1 changesets with 1 changes to 1 files
   53.18 -</screen>
   53.19 -<!-- END branch-repo.bugfix -->
    54.1 --- a/en/examples/results/branch-repo.clone.out	Mon Apr 06 23:13:53 2009 -0700
    54.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    54.3 @@ -1,7 +0,0 @@
    54.4 -<!-- BEGIN branch-repo.clone -->
    54.5 -<screen><prompt>$</prompt> <userinput>cd ..</userinput>
    54.6 -<prompt>$</prompt> <userinput>hg clone myproject myproject-1.0.1</userinput>
    54.7 -updating working directory
    54.8 -2 files updated, 0 files merged, 0 files removed, 0 files unresolved
    54.9 -</screen>
   54.10 -<!-- END branch-repo.clone -->
    55.1 --- a/en/examples/results/branch-repo.merge.out	Mon Apr 06 23:13:53 2009 -0700
    55.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    55.3 @@ -1,14 +0,0 @@
    55.4 -<!-- BEGIN branch-repo.merge -->
    55.5 -<screen><prompt>$</prompt> <userinput>hg merge</userinput>
    55.6 -1 files updated, 0 files merged, 0 files removed, 0 files unresolved
    55.7 -(branch merge, don't forget to commit)
    55.8 -<prompt>$</prompt> <userinput>hg commit -m 'Merge bugfix from 1.0.1 branch'</userinput>
    55.9 -<prompt>$</prompt> <userinput>hg push</userinput>
   55.10 -pushing to 
   55.11 -searching for changes
   55.12 -adding changesets
   55.13 -adding manifests
   55.14 -adding file changes
   55.15 -added 2 changesets with 1 changes to 1 files
   55.16 -</screen>
   55.17 -<!-- END branch-repo.merge -->
    56.1 --- a/en/examples/results/branch-repo.new.out	Mon Apr 06 23:13:53 2009 -0700
    56.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.3 @@ -1,18 +0,0 @@
    56.4 -<!-- BEGIN branch-repo.new -->
    56.5 -<screen><prompt>$</prompt> <userinput>cd ..</userinput>
    56.6 -<prompt>$</prompt> <userinput>hg clone myproject my-feature</userinput>
    56.7 -updating working directory
    56.8 -2 files updated, 0 files merged, 0 files removed, 0 files unresolved
    56.9 -<prompt>$</prompt> <userinput>cd my-feature</userinput>
   56.10 -<prompt>$</prompt> <userinput>echo 'This sure is an exciting new feature!' &gt; mynewfile</userinput>
   56.11 -<prompt>$</prompt> <userinput>hg commit -A -m 'New feature'</userinput>
   56.12 -adding mynewfile
   56.13 -<prompt>$</prompt> <userinput>hg push</userinput>
   56.14 -pushing to 
   56.15 -searching for changes
   56.16 -adding changesets
   56.17 -adding manifests
   56.18 -adding file changes
   56.19 -added 1 changesets with 1 changes to 1 files
   56.20 -</screen>
   56.21 -<!-- END branch-repo.new -->
    57.1 --- a/en/examples/results/branch-repo.pull.out	Mon Apr 06 23:13:53 2009 -0700
    57.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    57.3 @@ -1,16 +0,0 @@
    57.4 -<!-- BEGIN branch-repo.pull -->
    57.5 -<screen><prompt>$</prompt> <userinput>cd ..</userinput>
    57.6 -<prompt>$</prompt> <userinput>hg clone myproject myproject-merge</userinput>
    57.7 -updating working directory
    57.8 -3 files updated, 0 files merged, 0 files removed, 0 files unresolved
    57.9 -<prompt>$</prompt> <userinput>cd myproject-merge</userinput>
   57.10 -<prompt>$</prompt> <userinput>hg pull ../myproject-1.0.1</userinput>
   57.11 -pulling from ../myproject-1.0.1
   57.12 -searching for changes
   57.13 -adding changesets
   57.14 -adding manifests
   57.15 -adding file changes
   57.16 -added 1 changesets with 1 changes to 1 files (+1 heads)
   57.17 -(run 'hg heads' to see heads, 'hg merge' to merge)
   57.18 -</screen>
   57.19 -<!-- END branch-repo.pull -->
    58.1 --- a/en/examples/results/branch-repo.tag.out	Mon Apr 06 23:13:53 2009 -0700
    58.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    58.3 @@ -1,5 +0,0 @@
    58.4 -<!-- BEGIN branch-repo.tag -->
    58.5 -<screen><prompt>$</prompt> <userinput>cd myproject</userinput>
    58.6 -<prompt>$</prompt> <userinput>hg tag v1.0</userinput>
    58.7 -</screen>
    58.8 -<!-- END branch-repo.tag -->
    59.1 --- a/en/examples/results/branching.clone.out	Mon Apr 06 23:13:53 2009 -0700
    59.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    59.3 @@ -1,12 +0,0 @@
    59.4 -<!-- BEGIN branching.clone -->
    59.5 -<screen><prompt>$</prompt> <userinput>cd ..</userinput>
    59.6 -<prompt>$</prompt> <userinput>hg clone -rv1.0 main stable</userinput>
    59.7 -requesting all changes
    59.8 -adding changesets
    59.9 -adding manifests
   59.10 -adding file changes
   59.11 -added 1 changesets with 1 changes to 1 files
   59.12 -updating working directory
   59.13 -1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   59.14 -</screen>
   59.15 -<!-- END branching.clone -->
    60.1 --- a/en/examples/results/branching.init.out	Mon Apr 06 23:13:53 2009 -0700
    60.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    60.3 @@ -1,8 +0,0 @@
    60.4 -<!-- BEGIN branching.init -->
    60.5 -<screen><prompt>$</prompt> <userinput>hg init main</userinput>
    60.6 -<prompt>$</prompt> <userinput>cd main</userinput>
    60.7 -<prompt>$</prompt> <userinput>echo 'This is a boring feature.' &gt; myfile</userinput>
    60.8 -<prompt>$</prompt> <userinput>hg commit -A -m 'We have reached an important milestone!'</userinput>
    60.9 -adding myfile
   60.10 -</screen>
   60.11 -<!-- END branching.init -->
    61.1 --- a/en/examples/results/branching.main.out	Mon Apr 06 23:13:53 2009 -0700
    61.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    61.3 @@ -1,9 +0,0 @@
    61.4 -<!-- BEGIN branching.main -->
    61.5 -<screen><prompt>$</prompt> <userinput>cd ../main</userinput>
    61.6 -<prompt>$</prompt> <userinput>echo 'This is exciting and new!' &gt;&gt; myfile</userinput>
    61.7 -<prompt>$</prompt> <userinput>hg commit -m 'Add a new feature'</userinput>
    61.8 -<prompt>$</prompt> <userinput>cat myfile</userinput>
    61.9 -This is a boring feature.
   61.10 -This is exciting and new!
   61.11 -</screen>
   61.12 -<!-- END branching.main -->
    62.1 --- a/en/examples/results/branching.merge.out	Mon Apr 06 23:13:53 2009 -0700
    62.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    62.3 @@ -1,20 +0,0 @@
    62.4 -<!-- BEGIN branching.merge -->
    62.5 -<screen><prompt>$</prompt> <userinput>cd ../main</userinput>
    62.6 -<prompt>$</prompt> <userinput>hg pull ../stable</userinput>
    62.7 -pulling from ../stable
    62.8 -searching for changes
    62.9 -adding changesets
   62.10 -adding manifests
   62.11 -adding file changes
   62.12 -added 1 changesets with 1 changes to 1 files (+1 heads)
   62.13 -(run 'hg heads' to see heads, 'hg merge' to merge)
   62.14 -<prompt>$</prompt> <userinput>hg merge</userinput>
   62.15 -merging myfile
   62.16 -0 files updated, 1 files merged, 0 files removed, 0 files unresolved
   62.17 -(branch merge, don't forget to commit)
   62.18 -<prompt>$</prompt> <userinput>hg commit -m 'Bring in bugfix from stable branch'</userinput>
   62.19 -<prompt>$</prompt> <userinput>cat myfile</userinput>
   62.20 -This is a fix to a boring feature.
   62.21 -This is exciting and new!
   62.22 -</screen>
   62.23 -<!-- END branching.merge -->
    63.1 --- a/en/examples/results/branching.stable.out	Mon Apr 06 23:13:53 2009 -0700
    63.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    63.3 @@ -1,16 +0,0 @@
    63.4 -<!-- BEGIN branching.stable -->
    63.5 -<screen><prompt>$</prompt> <userinput>hg clone stable stable-fix</userinput>
    63.6 -updating working directory
    63.7 -1 files updated, 0 files merged, 0 files removed, 0 files unresolved
    63.8 -<prompt>$</prompt> <userinput>cd stable-fix</userinput>
    63.9 -<prompt>$</prompt> <userinput>echo 'This is a fix to a boring feature.' &gt; myfile</userinput>
   63.10 -<prompt>$</prompt> <userinput>hg commit -m 'Fix a bug'</userinput>
   63.11 -<prompt>$</prompt> <userinput>hg push</userinput>
   63.12 -pushing to 
   63.13 -searching for changes
   63.14 -adding changesets
   63.15 -adding manifests
   63.16 -adding file changes
   63.17 -added 1 changesets with 1 changes to 1 files
   63.18 -</screen>
   63.19 -<!-- END branching.stable -->
    64.1 --- a/en/examples/results/branching.tag.out	Mon Apr 06 23:13:53 2009 -0700
    64.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    64.3 @@ -1,14 +0,0 @@
    64.4 -<!-- BEGIN branching.tag -->
    64.5 -<screen><prompt>$</prompt> <userinput>hg tag v1.0</userinput>
    64.6 -<prompt>$</prompt> <userinput>hg tip</userinput>
    64.7 -changeset:   
    64.8 -tag:         tip
    64.9 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   64.10 -
   64.11 -summary:     Added tag v1.0 for changeset 
   64.12 -
   64.13 -<prompt>$</prompt> <userinput>hg tags</userinput>
   64.14 -tip                                
   64.15 -v1.0                               
   64.16 -</screen>
   64.17 -<!-- END branching.tag -->
    65.1 --- a/en/examples/results/branching.update.out	Mon Apr 06 23:13:53 2009 -0700
    65.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    65.3 @@ -1,10 +0,0 @@
    65.4 -<!-- BEGIN branching.update -->
    65.5 -<screen><prompt>$</prompt> <userinput>cd ..</userinput>
    65.6 -<prompt>$</prompt> <userinput>hg clone -U main main-old</userinput>
    65.7 -<prompt>$</prompt> <userinput>cd main-old</userinput>
    65.8 -<prompt>$</prompt> <userinput>hg update v1.0</userinput>
    65.9 -1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   65.10 -<prompt>$</prompt> <userinput>cat myfile</userinput>
   65.11 -This is a boring feature.
   65.12 -</screen>
   65.13 -<!-- END branching.update -->
    66.1 --- a/en/examples/results/cmdref.diff-p.out	Mon Apr 06 23:13:53 2009 -0700
    66.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    66.3 @@ -1,25 +0,0 @@
    66.4 -<!-- BEGIN cmdref.diff-p -->
    66.5 -<screen><prompt>$</prompt> <userinput>echo '[diff]' &gt;&gt; $HGRC</userinput>
    66.6 -<prompt>$</prompt> <userinput>echo 'showfunc = False' &gt;&gt; $HGRC</userinput>
    66.7 -<prompt>$</prompt> <userinput>hg diff</userinput>
    66.8 -diff -r  myfile.c
    66.9 -
   66.10 -
   66.11 -@@ -1,4 +1,4 @@
   66.12 - int myfunc()
   66.13 - {
   66.14 --    return 1;
   66.15 -+    return 10;
   66.16 - }
   66.17 -<prompt>$</prompt> <userinput>hg diff -p</userinput>
   66.18 -diff -r  myfile.c
   66.19 -
   66.20 -
   66.21 -@@ -1,4 +1,4 @@
   66.22 - int myfunc()
   66.23 - {
   66.24 --    return 1;
   66.25 -+    return 10;
   66.26 - }
   66.27 -</screen>
   66.28 -<!-- END cmdref.diff-p -->
    67.1 --- a/en/examples/results/daily.copy.after.out	Mon Apr 06 23:13:53 2009 -0700
    67.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    67.3 @@ -1,5 +0,0 @@
    67.4 -<!-- BEGIN daily.copy.after -->
    67.5 -<screen><prompt>$</prompt> <userinput>cp a z</userinput>
    67.6 -<prompt>$</prompt> <userinput>hg copy --after a z</userinput>
    67.7 -</screen>
    67.8 -<!-- END daily.copy.after -->
    68.1 --- a/en/examples/results/daily.copy.cat.out	Mon Apr 06 23:13:53 2009 -0700
    68.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    68.3 @@ -1,8 +0,0 @@
    68.4 -<!-- BEGIN daily.copy.cat -->
    68.5 -<screen><prompt>$</prompt> <userinput>cat file</userinput>
    68.6 -line
    68.7 -new contents
    68.8 -<prompt>$</prompt> <userinput>cat ../my-copy/new-file</userinput>
    68.9 -line
   68.10 -</screen>
   68.11 -<!-- END daily.copy.cat -->
    69.1 --- a/en/examples/results/daily.copy.clone.out	Mon Apr 06 23:13:53 2009 -0700
    69.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    69.3 @@ -1,7 +0,0 @@
    69.4 -<!-- BEGIN daily.copy.clone -->
    69.5 -<screen><prompt>$</prompt> <userinput>cd ..</userinput>
    69.6 -<prompt>$</prompt> <userinput>hg clone my-copy your-copy</userinput>
    69.7 -updating working directory
    69.8 -1 files updated, 0 files merged, 0 files removed, 0 files unresolved
    69.9 -</screen>
   69.10 -<!-- END daily.copy.clone -->
    70.1 --- a/en/examples/results/daily.copy.copy.out	Mon Apr 06 23:13:53 2009 -0700
    70.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    70.3 @@ -1,5 +0,0 @@
    70.4 -<!-- BEGIN daily.copy.copy -->
    70.5 -<screen><prompt>$</prompt> <userinput>cd my-copy</userinput>
    70.6 -<prompt>$</prompt> <userinput>hg copy file new-file</userinput>
    70.7 -</screen>
    70.8 -<!-- END daily.copy.copy -->
    71.1 --- a/en/examples/results/daily.copy.dir-dest.out	Mon Apr 06 23:13:53 2009 -0700
    71.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    71.3 @@ -1,7 +0,0 @@
    71.4 -<!-- BEGIN daily.copy.dir-dest -->
    71.5 -<screen><prompt>$</prompt> <userinput>mkdir d</userinput>
    71.6 -<prompt>$</prompt> <userinput>hg copy a b d</userinput>
    71.7 -<prompt>$</prompt> <userinput>ls d</userinput>
    71.8 -a  b
    71.9 -</screen>
   71.10 -<!-- END daily.copy.dir-dest -->
    72.1 --- a/en/examples/results/daily.copy.dir-src-dest.out	Mon Apr 06 23:13:53 2009 -0700
    72.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    72.3 @@ -1,5 +0,0 @@
    72.4 -<!-- BEGIN daily.copy.dir-src-dest -->
    72.5 -<screen><prompt>$</prompt> <userinput>hg copy c d</userinput>
    72.6 -copying c/a/c to d/c/a/c
    72.7 -</screen>
    72.8 -<!-- END daily.copy.dir-src-dest -->
    73.1 --- a/en/examples/results/daily.copy.dir-src.out	Mon Apr 06 23:13:53 2009 -0700
    73.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    73.3 @@ -1,5 +0,0 @@
    73.4 -<!-- BEGIN daily.copy.dir-src -->
    73.5 -<screen><prompt>$</prompt> <userinput>hg copy c e</userinput>
    73.6 -copying c/a/c to e/a/c
    73.7 -</screen>
    73.8 -<!-- END daily.copy.dir-src -->
    74.1 --- a/en/examples/results/daily.copy.init.out	Mon Apr 06 23:13:53 2009 -0700
    74.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    74.3 @@ -1,8 +0,0 @@
    74.4 -<!-- BEGIN daily.copy.init -->
    74.5 -<screen><prompt>$</prompt> <userinput>hg init my-copy</userinput>
    74.6 -<prompt>$</prompt> <userinput>cd my-copy</userinput>
    74.7 -<prompt>$</prompt> <userinput>echo line &gt; file</userinput>
    74.8 -<prompt>$</prompt> <userinput>hg add file</userinput>
    74.9 -<prompt>$</prompt> <userinput>hg commit -m 'Added a file'</userinput>
   74.10 -</screen>
   74.11 -<!-- END daily.copy.init -->
    75.1 --- a/en/examples/results/daily.copy.merge.out	Mon Apr 06 23:13:53 2009 -0700
    75.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    75.3 @@ -1,18 +0,0 @@
    75.4 -<!-- BEGIN daily.copy.merge -->
    75.5 -<screen><prompt>$</prompt> <userinput>hg pull ../my-copy</userinput>
    75.6 -pulling from ../my-copy
    75.7 -searching for changes
    75.8 -adding changesets
    75.9 -adding manifests
   75.10 -adding file changes
   75.11 -added 1 changesets with 1 changes to 1 files (+1 heads)
   75.12 -(run 'hg heads' to see heads, 'hg merge' to merge)
   75.13 -<prompt>$</prompt> <userinput>hg merge</userinput>
   75.14 -merging file and new-file to new-file
   75.15 -0 files updated, 1 files merged, 0 files removed, 0 files unresolved
   75.16 -(branch merge, don't forget to commit)
   75.17 -<prompt>$</prompt> <userinput>cat new-file</userinput>
   75.18 -line
   75.19 -new contents
   75.20 -</screen>
   75.21 -<!-- END daily.copy.merge -->
    76.1 --- a/en/examples/results/daily.copy.other.out	Mon Apr 06 23:13:53 2009 -0700
    76.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    76.3 @@ -1,6 +0,0 @@
    76.4 -<!-- BEGIN daily.copy.other -->
    76.5 -<screen><prompt>$</prompt> <userinput>cd ../your-copy</userinput>
    76.6 -<prompt>$</prompt> <userinput>echo 'new contents' &gt;&gt; file</userinput>
    76.7 -<prompt>$</prompt> <userinput>hg commit -m 'Changed file'</userinput>
    76.8 -</screen>
    76.9 -<!-- END daily.copy.other -->
    77.1 --- a/en/examples/results/daily.copy.simple.out	Mon Apr 06 23:13:53 2009 -0700
    77.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    77.3 @@ -1,7 +0,0 @@
    77.4 -<!-- BEGIN daily.copy.simple -->
    77.5 -<screen><prompt>$</prompt> <userinput>mkdir k</userinput>
    77.6 -<prompt>$</prompt> <userinput>hg copy a k</userinput>
    77.7 -<prompt>$</prompt> <userinput>ls k</userinput>
    77.8 -a
    77.9 -</screen>
   77.10 -<!-- END daily.copy.simple -->
    78.1 --- a/en/examples/results/daily.copy.status-copy.out	Mon Apr 06 23:13:53 2009 -0700
    78.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    78.3 @@ -1,7 +0,0 @@
    78.4 -<!-- BEGIN daily.copy.status-copy -->
    78.5 -<screen><prompt>$</prompt> <userinput>hg status -C</userinput>
    78.6 -A new-file
    78.7 -  file
    78.8 -<prompt>$</prompt> <userinput>hg commit -m 'Copied file'</userinput>
    78.9 -</screen>
   78.10 -<!-- END daily.copy.status-copy -->
    79.1 --- a/en/examples/results/daily.copy.status.out	Mon Apr 06 23:13:53 2009 -0700
    79.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    79.3 @@ -1,5 +0,0 @@
    79.4 -<!-- BEGIN daily.copy.status -->
    79.5 -<screen><prompt>$</prompt> <userinput>hg status</userinput>
    79.6 -A new-file
    79.7 -</screen>
    79.8 -<!-- END daily.copy.status -->
    80.1 --- a/en/examples/results/daily.files.add-dir.out	Mon Apr 06 23:13:53 2009 -0700
    80.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    80.3 @@ -1,13 +0,0 @@
    80.4 -<!-- BEGIN daily.files.add-dir -->
    80.5 -<screen><prompt>$</prompt> <userinput>mkdir b</userinput>
    80.6 -<prompt>$</prompt> <userinput>echo b &gt; b/b</userinput>
    80.7 -<prompt>$</prompt> <userinput>echo c &gt; b/c</userinput>
    80.8 -<prompt>$</prompt> <userinput>mkdir b/d</userinput>
    80.9 -<prompt>$</prompt> <userinput>echo d &gt; b/d/d</userinput>
   80.10 -<prompt>$</prompt> <userinput>hg add b</userinput>
   80.11 -adding b/b
   80.12 -adding b/c
   80.13 -adding b/d/d
   80.14 -<prompt>$</prompt> <userinput>hg commit -m 'Added all files in subdirectory'</userinput>
   80.15 -</screen>
   80.16 -<!-- END daily.files.add-dir -->
    81.1 --- a/en/examples/results/daily.files.add.out	Mon Apr 06 23:13:53 2009 -0700
    81.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    81.3 @@ -1,13 +0,0 @@
    81.4 -<!-- BEGIN daily.files.add -->
    81.5 -<screen><prompt>$</prompt> <userinput>hg init add-example</userinput>
    81.6 -<prompt>$</prompt> <userinput>cd add-example</userinput>
    81.7 -<prompt>$</prompt> <userinput>echo a &gt; a</userinput>
    81.8 -<prompt>$</prompt> <userinput>hg status</userinput>
    81.9 -? a
   81.10 -<prompt>$</prompt> <userinput>hg add a</userinput>
   81.11 -<prompt>$</prompt> <userinput>hg status</userinput>
   81.12 -A a
   81.13 -<prompt>$</prompt> <userinput>hg commit -m 'Added one file'</userinput>
   81.14 -<prompt>$</prompt> <userinput>hg status</userinput>
   81.15 -</screen>
   81.16 -<!-- END daily.files.add -->
    82.1 --- a/en/examples/results/daily.files.addremove.out	Mon Apr 06 23:13:53 2009 -0700
    82.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    82.3 @@ -1,10 +0,0 @@
    82.4 -<!-- BEGIN daily.files.addremove -->
    82.5 -<screen><prompt>$</prompt> <userinput>hg init addremove-example</userinput>
    82.6 -<prompt>$</prompt> <userinput>cd addremove-example</userinput>
    82.7 -<prompt>$</prompt> <userinput>echo a &gt; a</userinput>
    82.8 -<prompt>$</prompt> <userinput>echo b &gt; b</userinput>
    82.9 -<prompt>$</prompt> <userinput>hg addremove</userinput>
   82.10 -adding a
   82.11 -adding b
   82.12 -</screen>
   82.13 -<!-- END daily.files.addremove -->
    83.1 --- a/en/examples/results/daily.files.commit-addremove.out	Mon Apr 06 23:13:53 2009 -0700
    83.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    83.3 @@ -1,6 +0,0 @@
    83.4 -<!-- BEGIN daily.files.commit-addremove -->
    83.5 -<screen><prompt>$</prompt> <userinput>echo c &gt; c</userinput>
    83.6 -<prompt>$</prompt> <userinput>hg commit -A -m 'Commit with addremove'</userinput>
    83.7 -adding c
    83.8 -</screen>
    83.9 -<!-- END daily.files.commit-addremove -->
    84.1 --- a/en/examples/results/daily.files.hidden.out	Mon Apr 06 23:13:53 2009 -0700
    84.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    84.3 @@ -1,17 +0,0 @@
    84.4 -<!-- BEGIN daily.files.hidden -->
    84.5 -<screen><prompt>$</prompt> <userinput>hg init hidden-example</userinput>
    84.6 -<prompt>$</prompt> <userinput>cd hidden-example</userinput>
    84.7 -<prompt>$</prompt> <userinput>mkdir empty</userinput>
    84.8 -<prompt>$</prompt> <userinput>touch empty/.hidden</userinput>
    84.9 -<prompt>$</prompt> <userinput>hg add empty/.hidden</userinput>
   84.10 -<prompt>$</prompt> <userinput>hg commit -m 'Manage an empty-looking directory'</userinput>
   84.11 -<prompt>$</prompt> <userinput>ls empty</userinput>
   84.12 -<prompt>$</prompt> <userinput>cd ..</userinput>
   84.13 -<prompt>$</prompt> <userinput>hg clone hidden-example tmp</userinput>
   84.14 -updating working directory
   84.15 -1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   84.16 -<prompt>$</prompt> <userinput>ls tmp</userinput>
   84.17 -empty
   84.18 -<prompt>$</prompt> <userinput>ls tmp/empty</userinput>
   84.19 -</screen>
   84.20 -<!-- END daily.files.hidden -->
    85.1 --- a/en/examples/results/daily.files.missing.out	Mon Apr 06 23:13:53 2009 -0700
    85.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    85.3 @@ -1,11 +0,0 @@
    85.4 -<!-- BEGIN daily.files.missing -->
    85.5 -<screen><prompt>$</prompt> <userinput>hg init missing-example</userinput>
    85.6 -<prompt>$</prompt> <userinput>cd missing-example</userinput>
    85.7 -<prompt>$</prompt> <userinput>echo a &gt; a</userinput>
    85.8 -<prompt>$</prompt> <userinput>hg add a</userinput>
    85.9 -<prompt>$</prompt> <userinput>hg commit -m 'File about to be missing'</userinput>
   85.10 -<prompt>$</prompt> <userinput>rm a</userinput>
   85.11 -<prompt>$</prompt> <userinput>hg status</userinput>
   85.12 -! a
   85.13 -</screen>
   85.14 -<!-- END daily.files.missing -->
    86.1 --- a/en/examples/results/daily.files.recover-missing.out	Mon Apr 06 23:13:53 2009 -0700
    86.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    86.3 @@ -1,7 +0,0 @@
    86.4 -<!-- BEGIN daily.files.recover-missing -->
    86.5 -<screen><prompt>$</prompt> <userinput>hg revert a</userinput>
    86.6 -<prompt>$</prompt> <userinput>cat a</userinput>
    86.7 -a
    86.8 -<prompt>$</prompt> <userinput>hg status</userinput>
    86.9 -</screen>
   86.10 -<!-- END daily.files.recover-missing -->
    87.1 --- a/en/examples/results/daily.files.remove-after.out	Mon Apr 06 23:13:53 2009 -0700
    87.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    87.3 @@ -1,6 +0,0 @@
    87.4 -<!-- BEGIN daily.files.remove-after -->
    87.5 -<screen><prompt>$</prompt> <userinput>hg remove --after a</userinput>
    87.6 -<prompt>$</prompt> <userinput>hg status</userinput>
    87.7 -R a
    87.8 -</screen>
    87.9 -<!-- END daily.files.remove-after -->
    88.1 --- a/en/examples/results/daily.files.remove.out	Mon Apr 06 23:13:53 2009 -0700
    88.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    88.3 @@ -1,16 +0,0 @@
    88.4 -<!-- BEGIN daily.files.remove -->
    88.5 -<screen><prompt>$</prompt> <userinput>hg init remove-example</userinput>
    88.6 -<prompt>$</prompt> <userinput>cd remove-example</userinput>
    88.7 -<prompt>$</prompt> <userinput>echo a &gt; a</userinput>
    88.8 -<prompt>$</prompt> <userinput>mkdir b</userinput>
    88.9 -<prompt>$</prompt> <userinput>echo b &gt; b/b</userinput>
   88.10 -<prompt>$</prompt> <userinput>hg add a b</userinput>
   88.11 -adding b/b
   88.12 -<prompt>$</prompt> <userinput>hg commit -m 'Small example for file removal'</userinput>
   88.13 -<prompt>$</prompt> <userinput>hg remove a</userinput>
   88.14 -<prompt>$</prompt> <userinput>hg status</userinput>
   88.15 -R a
   88.16 -<prompt>$</prompt> <userinput>hg remove b</userinput>
   88.17 -removing b/b
   88.18 -</screen>
   88.19 -<!-- END daily.files.remove -->
    89.1 --- a/en/examples/results/daily.rename.rename.out	Mon Apr 06 23:13:53 2009 -0700
    89.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    89.3 @@ -1,4 +0,0 @@
    89.4 -<!-- BEGIN daily.rename.rename -->
    89.5 -<screen><prompt>$</prompt> <userinput>hg rename a b</userinput>
    89.6 -</screen>
    89.7 -<!-- END daily.rename.rename -->
    90.1 --- a/en/examples/results/daily.rename.status-copy.out	Mon Apr 06 23:13:53 2009 -0700
    90.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    90.3 @@ -1,7 +0,0 @@
    90.4 -<!-- BEGIN daily.rename.status-copy -->
    90.5 -<screen><prompt>$</prompt> <userinput>hg status -C</userinput>
    90.6 -A b
    90.7 -  a
    90.8 -R a
    90.9 -</screen>
   90.10 -<!-- END daily.rename.status-copy -->
    91.1 --- a/en/examples/results/daily.rename.status.out	Mon Apr 06 23:13:53 2009 -0700
    91.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    91.3 @@ -1,6 +0,0 @@
    91.4 -<!-- BEGIN daily.rename.status -->
    91.5 -<screen><prompt>$</prompt> <userinput>hg status</userinput>
    91.6 -A b
    91.7 -R a
    91.8 -</screen>
    91.9 -<!-- END daily.rename.status -->
    92.1 --- a/en/examples/results/daily.revert.add.out	Mon Apr 06 23:13:53 2009 -0700
    92.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    92.3 @@ -1,10 +0,0 @@
    92.4 -<!-- BEGIN daily.revert.add -->
    92.5 -<screen><prompt>$</prompt> <userinput>echo oops &gt; oops</userinput>
    92.6 -<prompt>$</prompt> <userinput>hg add oops</userinput>
    92.7 -<prompt>$</prompt> <userinput>hg status oops</userinput>
    92.8 -A oops
    92.9 -<prompt>$</prompt> <userinput>hg revert oops</userinput>
   92.10 -<prompt>$</prompt> <userinput>hg status</userinput>
   92.11 -? oops
   92.12 -</screen>
   92.13 -<!-- END daily.revert.add -->
    93.1 --- a/en/examples/results/daily.revert.copy.out	Mon Apr 06 23:13:53 2009 -0700
    93.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    93.3 @@ -1,7 +0,0 @@
    93.4 -<!-- BEGIN daily.revert.copy -->
    93.5 -<screen><prompt>$</prompt> <userinput>hg copy file new-file</userinput>
    93.6 -<prompt>$</prompt> <userinput>hg revert new-file</userinput>
    93.7 -<prompt>$</prompt> <userinput>hg status</userinput>
    93.8 -? new-file
    93.9 -</screen>
   93.10 -<!-- END daily.revert.copy -->
    94.1 --- a/en/examples/results/daily.revert.missing.out	Mon Apr 06 23:13:53 2009 -0700
    94.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    94.3 @@ -1,9 +0,0 @@
    94.4 -<!-- BEGIN daily.revert.missing -->
    94.5 -<screen><prompt>$</prompt> <userinput>rm file</userinput>
    94.6 -<prompt>$</prompt> <userinput>hg status</userinput>
    94.7 -! file
    94.8 -<prompt>$</prompt> <userinput>hg revert file</userinput>
    94.9 -<prompt>$</prompt> <userinput>ls file</userinput>
   94.10 -file
   94.11 -</screen>
   94.12 -<!-- END daily.revert.missing -->
    95.1 --- a/en/examples/results/daily.revert.modify.out	Mon Apr 06 23:13:53 2009 -0700
    95.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    95.3 @@ -1,13 +0,0 @@
    95.4 -<!-- BEGIN daily.revert.modify -->
    95.5 -<screen><prompt>$</prompt> <userinput>cat file</userinput>
    95.6 -original content
    95.7 -<prompt>$</prompt> <userinput>echo unwanted change &gt;&gt; file</userinput>
    95.8 -<prompt>$</prompt> <userinput>hg diff file</userinput>
    95.9 -diff -r  file
   95.10 -
   95.11 -
   95.12 -@@ -1,1 +1,2 @@
   95.13 - original content
   95.14 -+unwanted change
   95.15 -</screen>
   95.16 -<!-- END daily.revert.modify -->
    96.1 --- a/en/examples/results/daily.revert.remove.out	Mon Apr 06 23:13:53 2009 -0700
    96.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    96.3 @@ -1,10 +0,0 @@
    96.4 -<!-- BEGIN daily.revert.remove -->
    96.5 -<screen><prompt>$</prompt> <userinput>hg remove file</userinput>
    96.6 -<prompt>$</prompt> <userinput>hg status</userinput>
    96.7 -R file
    96.8 -<prompt>$</prompt> <userinput>hg revert file</userinput>
    96.9 -<prompt>$</prompt> <userinput>hg status</userinput>
   96.10 -<prompt>$</prompt> <userinput>ls file</userinput>
   96.11 -file
   96.12 -</screen>
   96.13 -<!-- END daily.revert.remove -->
    97.1 --- a/en/examples/results/daily.revert.rename-orig.out	Mon Apr 06 23:13:53 2009 -0700
    97.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    97.3 @@ -1,7 +0,0 @@
    97.4 -<!-- BEGIN daily.revert.rename-orig -->
    97.5 -<screen><prompt>$</prompt> <userinput>hg revert file</userinput>
    97.6 -no changes needed to file
    97.7 -<prompt>$</prompt> <userinput>hg status</userinput>
    97.8 -? new-file
    97.9 -</screen>
   97.10 -<!-- END daily.revert.rename-orig -->
    98.1 --- a/en/examples/results/daily.revert.rename.out	Mon Apr 06 23:13:53 2009 -0700
    98.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    98.3 @@ -1,7 +0,0 @@
    98.4 -<!-- BEGIN daily.revert.rename -->
    98.5 -<screen><prompt>$</prompt> <userinput>hg rename file new-file</userinput>
    98.6 -<prompt>$</prompt> <userinput>hg revert new-file</userinput>
    98.7 -<prompt>$</prompt> <userinput>hg status</userinput>
    98.8 -? new-file
    98.9 -</screen>
   98.10 -<!-- END daily.revert.rename -->
    99.1 --- a/en/examples/results/daily.revert.status.out	Mon Apr 06 23:13:53 2009 -0700
    99.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    99.3 @@ -1,8 +0,0 @@
    99.4 -<!-- BEGIN daily.revert.status -->
    99.5 -<screen><prompt>$</prompt> <userinput>hg status</userinput>
    99.6 -? file.orig
    99.7 -<prompt>$</prompt> <userinput>cat file.orig</userinput>
    99.8 -original content
    99.9 -unwanted change
   99.10 -</screen>
   99.11 -<!-- END daily.revert.status -->
   100.1 --- a/en/examples/results/daily.revert.unmodify.out	Mon Apr 06 23:13:53 2009 -0700
   100.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   100.3 @@ -1,8 +0,0 @@
   100.4 -<!-- BEGIN daily.revert.unmodify -->
   100.5 -<screen><prompt>$</prompt> <userinput>hg status</userinput>
   100.6 -M file
   100.7 -<prompt>$</prompt> <userinput>hg revert file</userinput>
   100.8 -<prompt>$</prompt> <userinput>cat file</userinput>
   100.9 -original content
  100.10 -</screen>
  100.11 -<!-- END daily.revert.unmodify -->
   101.1 --- a/en/examples/results/extdiff.diff.out	Mon Apr 06 23:13:53 2009 -0700
   101.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   101.3 @@ -1,10 +0,0 @@
   101.4 -<!-- BEGIN extdiff.diff -->
   101.5 -<screen><prompt>$</prompt> <userinput>hg diff</userinput>
   101.6 -diff -r  myfile
   101.7 -
   101.8 -
   101.9 -@@ -1,1 +1,2 @@
  101.10 - The first line.
  101.11 -+The second line.
  101.12 -</screen>
  101.13 -<!-- END extdiff.diff -->
   102.1 --- a/en/examples/results/extdiff.extdiff-ctx.out	Mon Apr 06 23:13:53 2009 -0700
   102.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   102.3 @@ -1,11 +0,0 @@
   102.4 -<!-- BEGIN extdiff.extdiff-ctx -->
   102.5 -<screen><prompt>$</prompt> <userinput>hg extdiff -o -NprcC5</userinput>
   102.6 -
   102.7 -
   102.8 -***************
   102.9 -*** 1 ****
  102.10 -
  102.11 -  The first line.
  102.12 -+ The second line.
  102.13 -</screen>
  102.14 -<!-- END extdiff.extdiff-ctx -->
   103.1 --- a/en/examples/results/extdiff.extdiff.out	Mon Apr 06 23:13:53 2009 -0700
   103.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   103.3 @@ -1,9 +0,0 @@
   103.4 -<!-- BEGIN extdiff.extdiff -->
   103.5 -<screen><prompt>$</prompt> <userinput>hg extdiff</userinput>
   103.6 -
   103.7 -
   103.8 -@@ -1 +1,2 @@
   103.9 - The first line.
  103.10 -+The second line.
  103.11 -</screen>
  103.12 -<!-- END extdiff.extdiff -->
   104.1 --- a/en/examples/results/filenames.dirs.out	Mon Apr 06 23:13:53 2009 -0700
   104.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   104.3 @@ -1,8 +0,0 @@
   104.4 -<!-- BEGIN filenames.dirs -->
   104.5 -<screen><prompt>$</prompt> <userinput>hg status src</userinput>
   104.6 -? src/main.py
   104.7 -? src/watcher/_watcher.c
   104.8 -? src/watcher/watcher.py
   104.9 -? src/xyzzy.txt
  104.10 -</screen>
  104.11 -<!-- END filenames.dirs -->
   105.1 --- a/en/examples/results/filenames.files.out	Mon Apr 06 23:13:53 2009 -0700
   105.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   105.3 @@ -1,4 +0,0 @@
   105.4 -<!-- BEGIN filenames.files -->
   105.5 -<screen><prompt>$</prompt> <userinput>hg add COPYING README examples/simple.py</userinput>
   105.6 -</screen>
   105.7 -<!-- END filenames.files -->
   106.1 --- a/en/examples/results/filenames.filter.exclude.out	Mon Apr 06 23:13:53 2009 -0700
   106.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   106.3 @@ -1,6 +0,0 @@
   106.4 -<!-- BEGIN filenames.filter.exclude -->
   106.5 -<screen><prompt>$</prompt> <userinput>hg status -X '**.py' src</userinput>
   106.6 -? src/watcher/_watcher.c
   106.7 -? src/xyzzy.txt
   106.8 -</screen>
   106.9 -<!-- END filenames.filter.exclude -->
   107.1 --- a/en/examples/results/filenames.filter.include.out	Mon Apr 06 23:13:53 2009 -0700
   107.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   107.3 @@ -1,5 +0,0 @@
   107.4 -<!-- BEGIN filenames.filter.include -->
   107.5 -<screen><prompt>$</prompt> <userinput>hg status -I '*.in'</userinput>
   107.6 -? MANIFEST.in
   107.7 -</screen>
   107.8 -<!-- END filenames.filter.include -->
   108.1 --- a/en/examples/results/filenames.glob.group.out	Mon Apr 06 23:13:53 2009 -0700
   108.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   108.3 @@ -1,6 +0,0 @@
   108.4 -<!-- BEGIN filenames.glob.group -->
   108.5 -<screen><prompt>$</prompt> <userinput>hg status 'glob:*.{in,py}'</userinput>
   108.6 -? MANIFEST.in
   108.7 -? setup.py
   108.8 -</screen>
   108.9 -<!-- END filenames.glob.group -->
   109.1 --- a/en/examples/results/filenames.glob.question.out	Mon Apr 06 23:13:53 2009 -0700
   109.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   109.3 @@ -1,5 +0,0 @@
   109.4 -<!-- BEGIN filenames.glob.question -->
   109.5 -<screen><prompt>$</prompt> <userinput>hg status 'glob:**.?'</userinput>
   109.6 -? src/watcher/_watcher.c
   109.7 -</screen>
   109.8 -<!-- END filenames.glob.question -->
   110.1 --- a/en/examples/results/filenames.glob.range.out	Mon Apr 06 23:13:53 2009 -0700
   110.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   110.3 @@ -1,6 +0,0 @@
   110.4 -<!-- BEGIN filenames.glob.range -->
   110.5 -<screen><prompt>$</prompt> <userinput>hg status 'glob:**[nr-t]'</userinput>
   110.6 -? MANIFEST.in
   110.7 -? src/xyzzy.txt
   110.8 -</screen>
   110.9 -<!-- END filenames.glob.range -->
   111.1 --- a/en/examples/results/filenames.glob.star-starstar.out	Mon Apr 06 23:13:53 2009 -0700
   111.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   111.3 @@ -1,11 +0,0 @@
   111.4 -<!-- BEGIN filenames.glob.star-starstar -->
   111.5 -<screen><prompt>$</prompt> <userinput>hg status 'glob:*.py'</userinput>
   111.6 -? setup.py
   111.7 -<prompt>$</prompt> <userinput>hg status 'glob:**.py'</userinput>
   111.8 -A examples/simple.py
   111.9 -A src/main.py
  111.10 -? examples/performant.py
  111.11 -? setup.py
  111.12 -? src/watcher/watcher.py
  111.13 -</screen>
  111.14 -<!-- END filenames.glob.star-starstar -->
   112.1 --- a/en/examples/results/filenames.glob.star.out	Mon Apr 06 23:13:53 2009 -0700
   112.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   112.3 @@ -1,5 +0,0 @@
   112.4 -<!-- BEGIN filenames.glob.star -->
   112.5 -<screen><prompt>$</prompt> <userinput>hg add 'glob:*.py'</userinput>
   112.6 -adding main.py
   112.7 -</screen>
   112.8 -<!-- END filenames.glob.star -->
   113.1 --- a/en/examples/results/filenames.glob.starstar.out	Mon Apr 06 23:13:53 2009 -0700
   113.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   113.3 @@ -1,10 +0,0 @@
   113.4 -<!-- BEGIN filenames.glob.starstar -->
   113.5 -<screen><prompt>$</prompt> <userinput>cd ..</userinput>
   113.6 -<prompt>$</prompt> <userinput>hg status 'glob:**.py'</userinput>
   113.7 -A examples/simple.py
   113.8 -A src/main.py
   113.9 -? examples/performant.py
  113.10 -? setup.py
  113.11 -? src/watcher/watcher.py
  113.12 -</screen>
  113.13 -<!-- END filenames.glob.starstar -->
   114.1 --- a/en/examples/results/filenames.wdir-relname.out	Mon Apr 06 23:13:53 2009 -0700
   114.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   114.3 @@ -1,25 +0,0 @@
   114.4 -<!-- BEGIN filenames.wdir-relname -->
   114.5 -<screen><prompt>$</prompt> <userinput>hg status</userinput>
   114.6 -A COPYING
   114.7 -A README
   114.8 -A examples/simple.py
   114.9 -? MANIFEST.in
  114.10 -? examples/performant.py
  114.11 -? setup.py
  114.12 -? src/main.py
  114.13 -? src/watcher/_watcher.c
  114.14 -? src/watcher/watcher.py
  114.15 -? src/xyzzy.txt
  114.16 -<prompt>$</prompt> <userinput>hg status `hg root`</userinput>
  114.17 -A ../COPYING
  114.18 -A ../README
  114.19 -A ../examples/simple.py
  114.20 -? ../MANIFEST.in
  114.21 -? ../examples/performant.py
  114.22 -? ../setup.py
  114.23 -? main.py
  114.24 -? watcher/_watcher.c
  114.25 -? watcher/watcher.py
  114.26 -? xyzzy.txt
  114.27 -</screen>
  114.28 -<!-- END filenames.wdir-relname -->
   115.1 --- a/en/examples/results/filenames.wdir-subdir.out	Mon Apr 06 23:13:53 2009 -0700
   115.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   115.3 @@ -1,17 +0,0 @@
   115.4 -<!-- BEGIN filenames.wdir-subdir -->
   115.5 -<screen><prompt>$</prompt> <userinput>cd src</userinput>
   115.6 -<prompt>$</prompt> <userinput>hg add -n</userinput>
   115.7 -adding ../MANIFEST.in
   115.8 -adding ../examples/performant.py
   115.9 -adding ../setup.py
  115.10 -adding main.py
  115.11 -adding watcher/_watcher.c
  115.12 -adding watcher/watcher.py
  115.13 -adding xyzzy.txt
  115.14 -<prompt>$</prompt> <userinput>hg add -n .</userinput>
  115.15 -adding main.py
  115.16 -adding watcher/_watcher.c
  115.17 -adding watcher/watcher.py
  115.18 -adding xyzzy.txt
  115.19 -</screen>
  115.20 -<!-- END filenames.wdir-subdir -->
   116.1 --- a/en/examples/results/hook.msglen.go.out	Mon Apr 06 23:13:53 2009 -0700
   116.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   116.3 @@ -1,13 +0,0 @@
   116.4 -<!-- BEGIN hook.msglen.go -->
   116.5 -<screen><prompt>$</prompt> <userinput>cat .hg/hgrc</userinput>
   116.6 -[hooks]
   116.7 -pretxncommit.msglen = test `hg tip --template {desc} | wc -c` -ge 10
   116.8 -<prompt>$</prompt> <userinput>echo a &gt; a</userinput>
   116.9 -<prompt>$</prompt> <userinput>hg add a</userinput>
  116.10 -<prompt>$</prompt> <userinput>hg commit -A -m 'too short'</userinput>
  116.11 -transaction abort!
  116.12 -rollback completed
  116.13 -abort: pretxncommit.msglen hook exited with status 1
  116.14 -<prompt>$</prompt> <userinput>hg commit -A -m 'long enough'</userinput>
  116.15 -</screen>
  116.16 -<!-- END hook.msglen.go -->
   117.1 --- a/en/examples/results/hook.msglen.run.out	Mon Apr 06 23:13:53 2009 -0700
   117.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   117.3 @@ -1,10 +0,0 @@
   117.4 -$ \textbf{cat .hg/hgrc}
   117.5 -[hooks]
   117.6 -pretxncommit.msglen = test `hg tip --template \{desc\} | wc -c` -ge 10
   117.7 -$ \textbf{echo a > a}
   117.8 -$ \textbf{hg add a}
   117.9 -$ \textbf{hg commit -A -m 'too short'}
  117.10 -abort: pretxncommit.msglen hook exited with status 1
  117.11 -transaction abort!
  117.12 -rollback completed
  117.13 -$ \textbf{hg commit -A -m 'long enough'}
   118.1 --- a/en/examples/results/hook.simple.ext.out	Mon Apr 06 23:13:53 2009 -0700
   118.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   118.3 @@ -1,8 +0,0 @@
   118.4 -<!-- BEGIN hook.simple.ext -->
   118.5 -<screen><prompt>$</prompt> <userinput>echo 'commit.when = echo -n "date of commit: "; date' &gt;&gt; .hg/hgrc</userinput>
   118.6 -<prompt>$</prompt> <userinput>echo a &gt;&gt; a</userinput>
   118.7 -<prompt>$</prompt> <userinput>hg commit -m 'i have two hooks'</userinput>
   118.8 -committed 
   118.9 -
  118.10 -</screen>
  118.11 -<!-- END hook.simple.ext -->
   119.1 --- a/en/examples/results/hook.simple.init.out	Mon Apr 06 23:13:53 2009 -0700
   119.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   119.3 @@ -1,14 +0,0 @@
   119.4 -<!-- BEGIN hook.simple.init -->
   119.5 -<screen><prompt>$</prompt> <userinput>hg init hook-test</userinput>
   119.6 -<prompt>$</prompt> <userinput>cd hook-test</userinput>
   119.7 -<prompt>$</prompt> <userinput>echo '[hooks]' &gt;&gt; .hg/hgrc</userinput>
   119.8 -<prompt>$</prompt> <userinput>echo 'commit = echo committed $HG_NODE' &gt;&gt; .hg/hgrc</userinput>
   119.9 -<prompt>$</prompt> <userinput>cat .hg/hgrc</userinput>
  119.10 -[hooks]
  119.11 -commit = echo committed $HG_NODE
  119.12 -<prompt>$</prompt> <userinput>echo a &gt; a</userinput>
  119.13 -<prompt>$</prompt> <userinput>hg add a</userinput>
  119.14 -<prompt>$</prompt> <userinput>hg commit -m 'testing commit hook'</userinput>
  119.15 -committed 
  119.16 -</screen>
  119.17 -<!-- END hook.simple.init -->
   120.1 --- a/en/examples/results/hook.simple.pretxncommit.out	Mon Apr 06 23:13:53 2009 -0700
   120.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   120.3 @@ -1,16 +0,0 @@
   120.4 -<!-- BEGIN hook.simple.pretxncommit -->
   120.5 -<screen><prompt>$</prompt> <userinput>cat check_bug_id</userinput>
   120.6 -#!/bin/sh
   120.7 -# check that a commit comment mentions a numeric bug id
   120.8 -hg log -r $1 --template {desc} | grep -q "\&lt;bug *[0-9]"
   120.9 -<prompt>$</prompt> <userinput>echo 'pretxncommit.bug_id_required = ./check_bug_id $HG_NODE' &gt;&gt; .hg/hgrc</userinput>
  120.10 -<prompt>$</prompt> <userinput>echo a &gt;&gt; a</userinput>
  120.11 -<prompt>$</prompt> <userinput>hg commit -m 'i am not mentioning a bug id'</userinput>
  120.12 -transaction abort!
  120.13 -rollback completed
  120.14 -abort: pretxncommit.bug_id_required hook exited with status 1
  120.15 -<prompt>$</prompt> <userinput>hg commit -m 'i refer you to bug 666'</userinput>
  120.16 -committed 
  120.17 -
  120.18 -</screen>
  120.19 -<!-- END hook.simple.pretxncommit -->
   121.1 --- a/en/examples/results/hook.ws.better.out	Mon Apr 06 23:13:53 2009 -0700
   121.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   121.3 @@ -1,20 +0,0 @@
   121.4 -<!-- BEGIN hook.ws.better -->
   121.5 -<screen><prompt>$</prompt> <userinput>cat .hg/hgrc</userinput>
   121.6 -[hooks]
   121.7 -pretxncommit.whitespace = .hg/check_whitespace.py
   121.8 -<prompt>$</prompt> <userinput>echo 'a ' &gt;&gt; a</userinput>
   121.9 -<prompt>$</prompt> <userinput>hg commit -A -m 'add new line with trailing whitespace'</userinput>
  121.10 -a, line 2: trailing whitespace added
  121.11 -commit message saved to .hg/commit.save
  121.12 -transaction abort!
  121.13 -rollback completed
  121.14 -abort: pretxncommit.whitespace hook exited with status 1
  121.15 -<prompt>$</prompt> <userinput>sed -i 's, *$,,' a</userinput>
  121.16 -<prompt>$</prompt> <userinput>hg commit -A -m 'trimmed trailing whitespace'</userinput>
  121.17 -a, line 2: trailing whitespace added
  121.18 -commit message saved to .hg/commit.save
  121.19 -transaction abort!
  121.20 -rollback completed
  121.21 -abort: pretxncommit.whitespace hook exited with status 1
  121.22 -</screen>
  121.23 -<!-- END hook.ws.better -->
   122.1 --- a/en/examples/results/hook.ws.simple.out	Mon Apr 06 23:13:53 2009 -0700
   122.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   122.3 @@ -1,14 +0,0 @@
   122.4 -<!-- BEGIN hook.ws.simple -->
   122.5 -<screen><prompt>$</prompt> <userinput>cat .hg/hgrc</userinput>
   122.6 -[hooks]
   122.7 -pretxncommit.whitespace = hg export tip | (! egrep -q '^\+.*[ \t]$')
   122.8 -<prompt>$</prompt> <userinput>echo 'a ' &gt; a</userinput>
   122.9 -<prompt>$</prompt> <userinput>hg commit -A -m 'test with trailing whitespace'</userinput>
  122.10 -adding a
  122.11 -transaction abort!
  122.12 -rollback completed
  122.13 -abort: pretxncommit.whitespace hook exited with status 1
  122.14 -<prompt>$</prompt> <userinput>echo 'a' &gt; a</userinput>
  122.15 -<prompt>$</prompt> <userinput>hg commit -A -m 'drop trailing whitespace and try again'</userinput>
  122.16 -</screen>
  122.17 -<!-- END hook.ws.simple -->
   123.1 --- a/en/examples/results/issue29.go.out	Mon Apr 06 23:13:53 2009 -0700
   123.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   123.3 @@ -1,20 +0,0 @@
   123.4 -<!-- BEGIN issue29.go -->
   123.5 -<screen><prompt>$</prompt> <userinput>hg init issue29</userinput>
   123.6 -<prompt>$</prompt> <userinput>cd issue29</userinput>
   123.7 -<prompt>$</prompt> <userinput>echo a &gt; a</userinput>
   123.8 -<prompt>$</prompt> <userinput>hg ci -Ama</userinput>
   123.9 -adding a
  123.10 -<prompt>$</prompt> <userinput>echo b &gt; b</userinput>
  123.11 -<prompt>$</prompt> <userinput>hg ci -Amb</userinput>
  123.12 -adding b
  123.13 -<prompt>$</prompt> <userinput>hg up 0</userinput>
  123.14 -0 files updated, 0 files merged, 1 files removed, 0 files unresolved
  123.15 -<prompt>$</prompt> <userinput>mkdir b</userinput>
  123.16 -<prompt>$</prompt> <userinput>echo b &gt; b/b</userinput>
  123.17 -<prompt>$</prompt> <userinput>hg ci -Amc</userinput>
  123.18 -adding b/b
  123.19 -created new head
  123.20 -<prompt>$</prompt> <userinput>hg merge</userinput>
  123.21 -
  123.22 -</screen>
  123.23 -<!-- END issue29.go -->
   124.1 --- a/en/examples/results/mq.dodiff.diff.out	Mon Apr 06 23:13:53 2009 -0700
   124.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   124.3 @@ -1,16 +0,0 @@
   124.4 -<!-- BEGIN mq.dodiff.diff -->
   124.5 -<screen><prompt>$</prompt> <userinput>echo 'this is my original thought' &gt; oldfile</userinput>
   124.6 -<prompt>$</prompt> <userinput>echo 'i have changed my mind' &gt; newfile</userinput>
   124.7 -<prompt>$</prompt> <userinput>diff -u oldfile newfile &gt; tiny.patch</userinput>
   124.8 -<prompt>$</prompt> <userinput>cat tiny.patch</userinput>
   124.9 -
  124.10 -
  124.11 -@@ -1 +1 @@
  124.12 --this is my original thought
  124.13 -+i have changed my mind
  124.14 -<prompt>$</prompt> <userinput>patch &lt; tiny.patch</userinput>
  124.15 -patching file oldfile
  124.16 -<prompt>$</prompt> <userinput>cat oldfile</userinput>
  124.17 -i have changed my mind
  124.18 -</screen>
  124.19 -<!-- END mq.dodiff.diff -->
   125.1 --- a/en/examples/results/mq.guards.init.out	Mon Apr 06 23:13:53 2009 -0700
   125.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   125.3 @@ -1,12 +0,0 @@
   125.4 -<!-- BEGIN mq.guards.init -->
   125.5 -<screen><prompt>$</prompt> <userinput>hg qinit</userinput>
   125.6 -<prompt>$</prompt> <userinput>hg qnew hello.patch</userinput>
   125.7 -<prompt>$</prompt> <userinput>echo hello &gt; hello</userinput>
   125.8 -<prompt>$</prompt> <userinput>hg add hello</userinput>
   125.9 -<prompt>$</prompt> <userinput>hg qrefresh</userinput>
  125.10 -<prompt>$</prompt> <userinput>hg qnew goodbye.patch</userinput>
  125.11 -<prompt>$</prompt> <userinput>echo goodbye &gt; goodbye</userinput>
  125.12 -<prompt>$</prompt> <userinput>hg add goodbye</userinput>
  125.13 -<prompt>$</prompt> <userinput>hg qrefresh</userinput>
  125.14 -</screen>
  125.15 -<!-- END mq.guards.init -->
   126.1 --- a/en/examples/results/mq.guards.qguard.neg.out	Mon Apr 06 23:13:53 2009 -0700
   126.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   126.3 @@ -1,30 +0,0 @@
   126.4 -<!-- BEGIN mq.guards.qguard.neg -->
   126.5 -<screen><prompt>$</prompt> <userinput>hg qguard hello.patch -quux</userinput>
   126.6 -hg qguard: option -u not recognized
   126.7 -hg qguard [-l] [-n] -- [PATCH] [+GUARD]... [-GUARD]...
   126.8 -
   126.9 -set or print guards for a patch
  126.10 -
  126.11 -    Guards control whether a patch can be pushed. A patch with no
  126.12 -    guards is always pushed. A patch with a positive guard ("+foo") is
  126.13 -    pushed only if the qselect command has activated it. A patch with
  126.14 -    a negative guard ("-foo") is never pushed if the qselect command
  126.15 -    has activated it.
  126.16 -
  126.17 -    With no arguments, print the currently active guards.
  126.18 -    With arguments, set guards for the named patch.
  126.19 -    NOTE: Specifying negative guards now requires '--'.
  126.20 -
  126.21 -    To set guards on another patch:
  126.22 -      hg qguard -- other.patch +2.6.17 -stable
  126.23 -
  126.24 -options:
  126.25 -
  126.26 - -l --list  list all patches and guards
  126.27 - -n --none  drop all guards
  126.28 -
  126.29 -use "hg -v help qguard" to show global options
  126.30 -<prompt>$</prompt> <userinput>hg qguard hello.patch</userinput>
  126.31 -hello.patch: unguarded
  126.32 -</screen>
  126.33 -<!-- END mq.guards.qguard.neg -->
   127.1 --- a/en/examples/results/mq.guards.qguard.out	Mon Apr 06 23:13:53 2009 -0700
   127.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   127.3 @@ -1,5 +0,0 @@
   127.4 -<!-- BEGIN mq.guards.qguard -->
   127.5 -<screen><prompt>$</prompt> <userinput>hg qguard</userinput>
   127.6 -goodbye.patch: unguarded
   127.7 -</screen>
   127.8 -<!-- END mq.guards.qguard -->
   128.1 --- a/en/examples/results/mq.guards.qguard.pos.out	Mon Apr 06 23:13:53 2009 -0700
   128.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   128.3 @@ -1,6 +0,0 @@
   128.4 -<!-- BEGIN mq.guards.qguard.pos -->
   128.5 -<screen><prompt>$</prompt> <userinput>hg qguard +foo</userinput>
   128.6 -<prompt>$</prompt> <userinput>hg qguard</userinput>
   128.7 -goodbye.patch: +foo
   128.8 -</screen>
   128.9 -<!-- END mq.guards.qguard.pos -->
   129.1 --- a/en/examples/results/mq.guards.qselect.cat.out	Mon Apr 06 23:13:53 2009 -0700
   129.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   129.3 @@ -1,5 +0,0 @@
   129.4 -<!-- BEGIN mq.guards.qselect.cat -->
   129.5 -<screen><prompt>$</prompt> <userinput>cat .hg/patches/guards</userinput>
   129.6 -foo
   129.7 -</screen>
   129.8 -<!-- END mq.guards.qselect.cat -->
   130.1 --- a/en/examples/results/mq.guards.qselect.error.out	Mon Apr 06 23:13:53 2009 -0700
   130.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   130.3 @@ -1,5 +0,0 @@
   130.4 -<!-- BEGIN mq.guards.qselect.error -->
   130.5 -<screen><prompt>$</prompt> <userinput>hg qselect +foo</userinput>
   130.6 -abort: guard '+foo' starts with invalid character: '+'
   130.7 -</screen>
   130.8 -<!-- END mq.guards.qselect.error -->
   131.1 --- a/en/examples/results/mq.guards.qselect.foo.out	Mon Apr 06 23:13:53 2009 -0700
   131.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   131.3 @@ -1,11 +0,0 @@
   131.4 -<!-- BEGIN mq.guards.qselect.foo -->
   131.5 -<screen><prompt>$</prompt> <userinput>hg qpop -a</userinput>
   131.6 -patch queue now empty
   131.7 -<prompt>$</prompt> <userinput>hg qselect</userinput>
   131.8 -no active guards
   131.9 -<prompt>$</prompt> <userinput>hg qselect foo</userinput>
  131.10 -number of unguarded, unapplied patches has changed from 1 to 2
  131.11 -<prompt>$</prompt> <userinput>hg qselect</userinput>
  131.12 -foo
  131.13 -</screen>
  131.14 -<!-- END mq.guards.qselect.foo -->
   132.1 --- a/en/examples/results/mq.guards.qselect.foobar.out	Mon Apr 06 23:13:53 2009 -0700
   132.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   132.3 @@ -1,11 +0,0 @@
   132.4 -<!-- BEGIN mq.guards.qselect.foobar -->
   132.5 -<screen><prompt>$</prompt> <userinput>hg qselect foo bar</userinput>
   132.6 -number of unguarded, unapplied patches has changed from 0 to 1
   132.7 -<prompt>$</prompt> <userinput>hg qpop -a</userinput>
   132.8 -patch queue now empty
   132.9 -<prompt>$</prompt> <userinput>hg qpush -a</userinput>
  132.10 -applying hello.patch
  132.11 -applying goodbye.patch
  132.12 -now at: goodbye.patch
  132.13 -</screen>
  132.14 -<!-- END mq.guards.qselect.foobar -->
   133.1 --- a/en/examples/results/mq.guards.qselect.qpush.out	Mon Apr 06 23:13:53 2009 -0700
   133.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   133.3 @@ -1,7 +0,0 @@
   133.4 -<!-- BEGIN mq.guards.qselect.qpush -->
   133.5 -<screen><prompt>$</prompt> <userinput>hg qpush -a</userinput>
   133.6 -applying hello.patch
   133.7 -applying goodbye.patch
   133.8 -now at: goodbye.patch
   133.9 -</screen>
  133.10 -<!-- END mq.guards.qselect.qpush -->
   134.1 --- a/en/examples/results/mq.guards.qselect.quux.out	Mon Apr 06 23:13:53 2009 -0700
   134.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   134.3 @@ -1,11 +0,0 @@
   134.4 -<!-- BEGIN mq.guards.qselect.quux -->
   134.5 -<screen><prompt>$</prompt> <userinput>hg qselect quux</userinput>
   134.6 -number of guarded, applied patches has changed from 0 to 1
   134.7 -<prompt>$</prompt> <userinput>hg qpop -a</userinput>
   134.8 -patch queue now empty
   134.9 -<prompt>$</prompt> <userinput>hg qpush -a</userinput>
  134.10 -applying hello.patch
  134.11 -skipping goodbye.patch - guarded by ['+foo']
  134.12 -now at: hello.patch
  134.13 -</screen>
  134.14 -<!-- END mq.guards.qselect.quux -->
   135.1 --- a/en/examples/results/mq.guards.series.out	Mon Apr 06 23:13:53 2009 -0700
   135.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   135.3 @@ -1,6 +0,0 @@
   135.4 -<!-- BEGIN mq.guards.series -->
   135.5 -<screen><prompt>$</prompt> <userinput>cat .hg/patches/series</userinput>
   135.6 -hello.patch
   135.7 -goodbye.patch #+foo
   135.8 -</screen>
   135.9 -<!-- END mq.guards.series -->
   136.1 --- a/en/examples/results/mq.id.out.out	Mon Apr 06 23:13:53 2009 -0700
   136.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   136.3 @@ -1,32 +0,0 @@
   136.4 -$ \textbf{hg qapplied}
   136.5 -first.patch
   136.6 -second.patch
   136.7 -$ \textbf{hg log -r qbase:qtip}
   136.8 -changeset:   
   136.9 -tag:         first.patch
  136.10 -tag:         qbase
  136.11 -user:        Bryan O'Sullivan <bos@serpentine.com>
  136.12 -
  136.13 -summary:     patch queue: first.patch
  136.14 -
  136.15 -changeset:   
  136.16 -tag:         second.patch
  136.17 -tag:         qtip
  136.18 -tag:         tip
  136.19 -user:        Bryan O'Sullivan <bos@serpentine.com>
  136.20 -
  136.21 -summary:     patch queue: second.patch
  136.22 -
  136.23 -$ \textbf{hg export second.patch}
  136.24 -# HG changeset patch
  136.25 -# User Bryan O'Sullivan <bos@serpentine.com>
  136.26 -
  136.27 -# Node ID 
  136.28 -# Parent  
  136.29 -patch queue: second.patch
  136.30 -
  136.31 -diff -r  -r  other.c
  136.32 -
  136.33 -
  136.34 -@@ -0,0 +1,1 @@
  136.35 -+double u;
   137.1 --- a/en/examples/results/mq.id.output.out	Mon Apr 06 23:13:53 2009 -0700
   137.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   137.3 @@ -1,35 +0,0 @@
   137.4 -<!-- BEGIN mq.id.output -->
   137.5 -<screen><prompt>$</prompt> <userinput>hg qapplied</userinput>
   137.6 -first.patch
   137.7 -second.patch
   137.8 -<prompt>$</prompt> <userinput>hg log -r qbase:qtip</userinput>
   137.9 -changeset:   
  137.10 -tag:         first.patch
  137.11 -tag:         qbase
  137.12 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  137.13 -
  137.14 -summary:     [mq]: first.patch
  137.15 -
  137.16 -changeset:   
  137.17 -tag:         qtip
  137.18 -tag:         second.patch
  137.19 -tag:         tip
  137.20 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  137.21 -
  137.22 -summary:     [mq]: second.patch
  137.23 -
  137.24 -<prompt>$</prompt> <userinput>hg export second.patch</userinput>
  137.25 -# HG changeset patch
  137.26 -# User Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  137.27 -
  137.28 -# Node ID 
  137.29 -# Parent  
  137.30 -[mq]: second.patch
  137.31 -
  137.32 -diff -r  -r  other.c
  137.33 -
  137.34 -
  137.35 -@@ -0,0 +1,1 @@
  137.36 -+double u;
  137.37 -</screen>
  137.38 -<!-- END mq.id.output -->
   138.1 --- a/en/examples/results/mq.qinit-help.help.out	Mon Apr 06 23:13:53 2009 -0700
   138.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   138.3 @@ -1,19 +0,0 @@
   138.4 -<!-- BEGIN mq.qinit-help.help -->
   138.5 -<screen><prompt>$</prompt> <userinput>hg help qinit</userinput>
   138.6 -hg qinit [-c]
   138.7 -
   138.8 -init a new queue repository
   138.9 -
  138.10 -    The queue repository is unversioned by default. If -c is
  138.11 -    specified, qinit will create a separate nested repository
  138.12 -    for patches (qinit -c may also be run later to convert
  138.13 -    an unversioned patch repository into a versioned one).
  138.14 -    You can use qcommit to commit changes to this queue repository.
  138.15 -
  138.16 -options:
  138.17 -
  138.18 - -c --create-repo  create queue repository
  138.19 -
  138.20 -use "hg -v help qinit" to show global options
  138.21 -</screen>
  138.22 -<!-- END mq.qinit-help.help -->
   139.1 --- a/en/examples/results/mq.tarball.download.out	Mon Apr 06 23:13:53 2009 -0700
   139.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   139.3 @@ -1,12 +0,0 @@
   139.4 -<!-- BEGIN mq.tarball.download -->
   139.5 -<screen><prompt>$</prompt> <userinput>download netplug-1.2.5.tar.bz2</userinput>
   139.6 -<prompt>$</prompt> <userinput>tar jxf netplug-1.2.5.tar.bz2</userinput>
   139.7 -<prompt>$</prompt> <userinput>cd netplug-1.2.5</userinput>
   139.8 -<prompt>$</prompt> <userinput>hg init</userinput>
   139.9 -<prompt>$</prompt> <userinput>hg commit -q --addremove --message netplug-1.2.5</userinput>
  139.10 -<prompt>$</prompt> <userinput>cd ..</userinput>
  139.11 -<prompt>$</prompt> <userinput>hg clone netplug-1.2.5 netplug</userinput>
  139.12 -updating working directory
  139.13 -18 files updated, 0 files merged, 0 files removed, 0 files unresolved
  139.14 -</screen>
  139.15 -<!-- END mq.tarball.download -->
   140.1 --- a/en/examples/results/mq.tarball.newsource.out	Mon Apr 06 23:13:53 2009 -0700
   140.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   140.3 @@ -1,16 +0,0 @@
   140.4 -<!-- BEGIN mq.tarball.newsource -->
   140.5 -<screen><prompt>$</prompt> <userinput>hg qpop -a</userinput>
   140.6 -patch queue now empty
   140.7 -<prompt>$</prompt> <userinput>cd ..</userinput>
   140.8 -<prompt>$</prompt> <userinput>download netplug-1.2.8.tar.bz2</userinput>
   140.9 -<prompt>$</prompt> <userinput>hg clone netplug-1.2.5 netplug-1.2.8</userinput>
  140.10 -updating working directory
  140.11 -18 files updated, 0 files merged, 0 files removed, 0 files unresolved
  140.12 -<prompt>$</prompt> <userinput>cd netplug-1.2.8</userinput>
  140.13 -<prompt>$</prompt> <userinput>hg locate -0 | xargs -0 rm</userinput>
  140.14 -<prompt>$</prompt> <userinput>cd ..</userinput>
  140.15 -<prompt>$</prompt> <userinput>tar jxf netplug-1.2.8.tar.bz2</userinput>
  140.16 -<prompt>$</prompt> <userinput>cd netplug-1.2.8</userinput>
  140.17 -<prompt>$</prompt> <userinput>hg commit --addremove --message netplug-1.2.8</userinput>
  140.18 -</screen>
  140.19 -<!-- END mq.tarball.newsource -->
   141.1 --- a/en/examples/results/mq.tarball.qinit.out	Mon Apr 06 23:13:53 2009 -0700
   141.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   141.3 @@ -1,31 +0,0 @@
   141.4 -<!-- BEGIN mq.tarball.qinit -->
   141.5 -<screen><prompt>$</prompt> <userinput>cd netplug</userinput>
   141.6 -<prompt>$</prompt> <userinput>hg qinit</userinput>
   141.7 -<prompt>$</prompt> <userinput>hg qnew -m 'fix build problem with gcc 4' build-fix.patch</userinput>
   141.8 -<prompt>$</prompt> <userinput>perl -pi -e 's/int addr_len/socklen_t addr_len/' netlink.c</userinput>
   141.9 -<prompt>$</prompt> <userinput>hg qrefresh</userinput>
  141.10 -<prompt>$</prompt> <userinput>hg tip -p</userinput>
  141.11 -changeset:   
  141.12 -tag:         qtip
  141.13 -tag:         build-fix.patch
  141.14 -tag:         tip
  141.15 -tag:         qbase
  141.16 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  141.17 -
  141.18 -summary:     fix build problem with gcc 4
  141.19 -
  141.20 -diff -r  -r  netlink.c
  141.21 -
  141.22 -
  141.23 -@@ -275,7 +275,7 @@
  141.24 -         exit(1);
  141.25 -     }
  141.26 - 
  141.27 --    int addr_len = sizeof(addr);
  141.28 -+    socklen_t addr_len = sizeof(addr);
  141.29 - 
  141.30 -     if (getsockname(fd, (struct sockaddr *) &amp;addr, &amp;addr_len) == -1) {
  141.31 -         do_log(LOG_ERR, "Could not get socket details: %m");
  141.32 -
  141.33 -</screen>
  141.34 -<!-- END mq.tarball.qinit -->
   142.1 --- a/en/examples/results/mq.tarball.repush.out	Mon Apr 06 23:13:53 2009 -0700
   142.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   142.3 @@ -1,16 +0,0 @@
   142.4 -<!-- BEGIN mq.tarball.repush -->
   142.5 -<screen><prompt>$</prompt> <userinput>cd ../netplug</userinput>
   142.6 -<prompt>$</prompt> <userinput>hg pull ../netplug-1.2.8</userinput>
   142.7 -pulling from ../netplug-1.2.8
   142.8 -searching for changes
   142.9 -adding changesets
  142.10 -adding manifests
  142.11 -adding file changes
  142.12 -added 1 changesets with 12 changes to 12 files
  142.13 -(run 'hg update' to get a working copy)
  142.14 -<prompt>$</prompt> <userinput>hg qpush -a</userinput>
  142.15 -(working directory not at tip)
  142.16 -applying build-fix.patch
  142.17 -now at: build-fix.patch
  142.18 -</screen>
  142.19 -<!-- END mq.tarball.repush -->
   143.1 --- a/en/examples/results/mq.tools.lsdiff.out	Mon Apr 06 23:13:53 2009 -0700
   143.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   143.3 @@ -1,24 +0,0 @@
   143.4 -<!-- BEGIN mq.tools.lsdiff -->
   143.5 -<screen><prompt>$</prompt> <userinput>lsdiff -nvv remove-redundant-null-checks.patch</userinput>
   143.6 -22	File #1  	a/drivers/char/agp/sgi-agp.c
   143.7 -	24	Hunk #1	static int __devinit agp_sgi_init(void)
   143.8 -37	File #2  	a/drivers/char/hvcs.c
   143.9 -	39	Hunk #1	static struct tty_operations hvcs_ops = 
  143.10 -	53	Hunk #2	static int hvcs_alloc_index_list(int n)
  143.11 -69	File #3  	a/drivers/message/fusion/mptfc.c
  143.12 -	71	Hunk #1	mptfc_GetFcDevPage0(MPT_ADAPTER *ioc, in
  143.13 -85	File #4  	a/drivers/message/fusion/mptsas.c
  143.14 -	87	Hunk #1	mptsas_probe_hba_phys(MPT_ADAPTER *ioc)
  143.15 -98	File #5  	a/drivers/net/fs_enet/fs_enet-mii.c
  143.16 -	100	Hunk #1	static struct fs_enet_mii_bus *create_bu
  143.17 -111	File #6  	a/drivers/net/wireless/ipw2200.c
  143.18 -	113	Hunk #1	static struct ipw_fw_error *ipw_alloc_er
  143.19 -	126	Hunk #2	static ssize_t clear_error(struct device
  143.20 -	140	Hunk #3	static void ipw_irq_tasklet(struct ipw_p
  143.21 -	150	Hunk #4	static void ipw_pci_remove(struct pci_de
  143.22 -164	File #7  	a/drivers/scsi/libata-scsi.c
  143.23 -	166	Hunk #1	int ata_cmd_ioctl(struct scsi_device *sc
  143.24 -178	File #8  	a/drivers/video/au1100fb.c
  143.25 -	180	Hunk #1	void __exit au1100fb_cleanup(void)
  143.26 -</screen>
  143.27 -<!-- END mq.tools.lsdiff -->
   144.1 --- a/en/examples/results/mq.tools.tools.out	Mon Apr 06 23:13:53 2009 -0700
   144.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   144.3 @@ -1,26 +0,0 @@
   144.4 -<!-- BEGIN mq.tools.tools -->
   144.5 -<screen><prompt>$</prompt> <userinput>diffstat -p1 remove-redundant-null-checks.patch</userinput>
   144.6 - drivers/char/agp/sgi-agp.c        |    5 ++---
   144.7 - drivers/char/hvcs.c               |   11 +++++------
   144.8 - drivers/message/fusion/mptfc.c    |    6 ++----
   144.9 - drivers/message/fusion/mptsas.c   |    3 +--
  144.10 - drivers/net/fs_enet/fs_enet-mii.c |    3 +--
  144.11 - drivers/net/wireless/ipw2200.c    |   22 ++++++----------------
  144.12 - drivers/scsi/libata-scsi.c        |    4 +---
  144.13 - drivers/video/au1100fb.c          |    3 +--
  144.14 - 8 files changed, 19 insertions(+), 38 deletions(-)
  144.15 -<prompt>$</prompt> <userinput>filterdiff -i '*/video/*' remove-redundant-null-checks.patch</userinput>
  144.16 -
  144.17 -
  144.18 -@@ -743,8 +743,7 @@ void __exit au1100fb_cleanup(void)
  144.19 - {
  144.20 - 	driver_unregister(&amp;au1100fb_driver);
  144.21 - 
  144.22 --	if (drv_info.opt_mode)
  144.23 --		kfree(drv_info.opt_mode);
  144.24 -+	kfree(drv_info.opt_mode);
  144.25 - }
  144.26 - 
  144.27 - module_init(au1100fb_init);
  144.28 -</screen>
  144.29 -<!-- END mq.tools.tools -->
   145.1 --- a/en/examples/results/mq.tutorial.add.out	Mon Apr 06 23:13:53 2009 -0700
   145.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   145.3 @@ -1,7 +0,0 @@
   145.4 -<!-- BEGIN mq.tutorial.add -->
   145.5 -<screen><prompt>$</prompt> <userinput>echo 'file 3, line 1' &gt;&gt; file3</userinput>
   145.6 -<prompt>$</prompt> <userinput>hg qnew add-file3.patch</userinput>
   145.7 -<prompt>$</prompt> <userinput>hg qnew -f add-file3.patch</userinput>
   145.8 -abort: patch "add-file3.patch" already exists
   145.9 -</screen>
  145.10 -<!-- END mq.tutorial.add -->
   146.1 --- a/en/examples/results/mq.tutorial.qinit.out	Mon Apr 06 23:13:53 2009 -0700
   146.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   146.3 @@ -1,10 +0,0 @@
   146.4 -<!-- BEGIN mq.tutorial.qinit -->
   146.5 -<screen><prompt>$</prompt> <userinput>hg init mq-sandbox</userinput>
   146.6 -<prompt>$</prompt> <userinput>cd mq-sandbox</userinput>
   146.7 -<prompt>$</prompt> <userinput>echo 'line 1' &gt; file1</userinput>
   146.8 -<prompt>$</prompt> <userinput>echo 'another line 1' &gt; file2</userinput>
   146.9 -<prompt>$</prompt> <userinput>hg add file1 file2</userinput>
  146.10 -<prompt>$</prompt> <userinput>hg commit -m'first change'</userinput>
  146.11 -<prompt>$</prompt> <userinput>hg qinit</userinput>
  146.12 -</screen>
  146.13 -<!-- END mq.tutorial.qinit -->
   147.1 --- a/en/examples/results/mq.tutorial.qnew.out	Mon Apr 06 23:13:53 2009 -0700
   147.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   147.3 @@ -1,23 +0,0 @@
   147.4 -<!-- BEGIN mq.tutorial.qnew -->
   147.5 -<screen><prompt>$</prompt> <userinput>hg tip</userinput>
   147.6 -changeset:   
   147.7 -tag:         tip
   147.8 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   147.9 -
  147.10 -summary:     first change
  147.11 -
  147.12 -<prompt>$</prompt> <userinput>hg qnew first.patch</userinput>
  147.13 -<prompt>$</prompt> <userinput>hg tip</userinput>
  147.14 -changeset:   
  147.15 -tag:         qtip
  147.16 -tag:         first.patch
  147.17 -tag:         tip
  147.18 -tag:         qbase
  147.19 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  147.20 -
  147.21 -summary:     [mq]: first.patch
  147.22 -
  147.23 -<prompt>$</prompt> <userinput>ls .hg/patches</userinput>
  147.24 -first.patch  series  status
  147.25 -</screen>
  147.26 -<!-- END mq.tutorial.qnew -->
   148.1 --- a/en/examples/results/mq.tutorial.qnew2.out	Mon Apr 06 23:13:53 2009 -0700
   148.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   148.3 @@ -1,31 +0,0 @@
   148.4 -<!-- BEGIN mq.tutorial.qnew2 -->
   148.5 -<screen><prompt>$</prompt> <userinput>hg qnew second.patch</userinput>
   148.6 -<prompt>$</prompt> <userinput>hg log --style=compact --limit=2</userinput>
   148.7 -2[qtip,second.patch,tip]      2009-03-31 19:08 +0000   bos
   148.8 -  [mq]: second.patch
   148.9 -
  148.10 -1[first.patch,qbase]      2009-03-31 19:08 +0000   bos
  148.11 -  [mq]: first.patch
  148.12 -
  148.13 -<prompt>$</prompt> <userinput>echo 'line 4' &gt;&gt; file1</userinput>
  148.14 -<prompt>$</prompt> <userinput>hg qrefresh</userinput>
  148.15 -<prompt>$</prompt> <userinput>hg tip --style=compact --patch</userinput>
  148.16 -2[qtip,second.patch,tip]      2009-03-31 19:08 +0000   bos
  148.17 -  [mq]: second.patch
  148.18 -
  148.19 -diff -r  -r  file1
  148.20 -
  148.21 -
  148.22 -@@ -1,3 +1,4 @@
  148.23 - line 1
  148.24 - line 2
  148.25 - line 3
  148.26 -+line 4
  148.27 -
  148.28 -<prompt>$</prompt> <userinput>hg annotate file1</userinput>
  148.29 -0: line 1
  148.30 -1: line 2
  148.31 -1: line 3
  148.32 -2: line 4
  148.33 -</screen>
  148.34 -<!-- END mq.tutorial.qnew2 -->
   149.1 --- a/en/examples/results/mq.tutorial.qpop.out	Mon Apr 06 23:13:53 2009 -0700
   149.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   149.3 @@ -1,17 +0,0 @@
   149.4 -<!-- BEGIN mq.tutorial.qpop -->
   149.5 -<screen><prompt>$</prompt> <userinput>hg qapplied</userinput>
   149.6 -first.patch
   149.7 -second.patch
   149.8 -<prompt>$</prompt> <userinput>hg qpop</userinput>
   149.9 -now at: first.patch
  149.10 -<prompt>$</prompt> <userinput>hg qseries</userinput>
  149.11 -first.patch
  149.12 -second.patch
  149.13 -<prompt>$</prompt> <userinput>hg qapplied</userinput>
  149.14 -first.patch
  149.15 -<prompt>$</prompt> <userinput>cat file1</userinput>
  149.16 -line 1
  149.17 -line 2
  149.18 -line 3
  149.19 -</screen>
  149.20 -<!-- END mq.tutorial.qpop -->
   150.1 --- a/en/examples/results/mq.tutorial.qpush-a.out	Mon Apr 06 23:13:53 2009 -0700
   150.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   150.3 @@ -1,11 +0,0 @@
   150.4 -<!-- BEGIN mq.tutorial.qpush-a -->
   150.5 -<screen><prompt>$</prompt> <userinput>hg qpush -a</userinput>
   150.6 -applying second.patch
   150.7 -now at: second.patch
   150.8 -<prompt>$</prompt> <userinput>cat file1</userinput>
   150.9 -line 1
  150.10 -line 2
  150.11 -line 3
  150.12 -line 4
  150.13 -</screen>
  150.14 -<!-- END mq.tutorial.qpush-a -->
   151.1 --- a/en/examples/results/mq.tutorial.qrefresh.out	Mon Apr 06 23:13:53 2009 -0700
   151.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   151.3 @@ -1,24 +0,0 @@
   151.4 -<!-- BEGIN mq.tutorial.qrefresh -->
   151.5 -<screen><prompt>$</prompt> <userinput>echo 'line 2' &gt;&gt; file1</userinput>
   151.6 -<prompt>$</prompt> <userinput>hg diff</userinput>
   151.7 -diff -r  file1
   151.8 -
   151.9 -
  151.10 -@@ -1,1 +1,2 @@
  151.11 - line 1
  151.12 -+line 2
  151.13 -<prompt>$</prompt> <userinput>hg qrefresh</userinput>
  151.14 -<prompt>$</prompt> <userinput>hg diff</userinput>
  151.15 -<prompt>$</prompt> <userinput>hg tip --style=compact --patch</userinput>
  151.16 -1[qtip,first.patch,tip,qbase]      2009-03-31 19:08 +0000   bos
  151.17 -  [mq]: first.patch
  151.18 -
  151.19 -diff -r  -r  file1
  151.20 -
  151.21 -
  151.22 -@@ -1,1 +1,2 @@
  151.23 - line 1
  151.24 -+line 2
  151.25 -
  151.26 -</screen>
  151.27 -<!-- END mq.tutorial.qrefresh -->
   152.1 --- a/en/examples/results/mq.tutorial.qrefresh2.out	Mon Apr 06 23:13:53 2009 -0700
   152.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   152.3 @@ -1,19 +0,0 @@
   152.4 -<!-- BEGIN mq.tutorial.qrefresh2 -->
   152.5 -<screen><prompt>$</prompt> <userinput>echo 'line 3' &gt;&gt; file1</userinput>
   152.6 -<prompt>$</prompt> <userinput>hg status</userinput>
   152.7 -M file1
   152.8 -<prompt>$</prompt> <userinput>hg qrefresh</userinput>
   152.9 -<prompt>$</prompt> <userinput>hg tip --style=compact --patch</userinput>
  152.10 -1[qtip,first.patch,tip,qbase]      2009-03-31 19:08 +0000   bos
  152.11 -  [mq]: first.patch
  152.12 -
  152.13 -diff -r  -r  file1
  152.14 -
  152.15 -
  152.16 -@@ -1,1 +1,3 @@
  152.17 - line 1
  152.18 -+line 2
  152.19 -+line 3
  152.20 -
  152.21 -</screen>
  152.22 -<!-- END mq.tutorial.qrefresh2 -->
   153.1 --- a/en/examples/results/mq.tutorial.qseries.out	Mon Apr 06 23:13:53 2009 -0700
   153.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   153.3 @@ -1,9 +0,0 @@
   153.4 -<!-- BEGIN mq.tutorial.qseries -->
   153.5 -<screen><prompt>$</prompt> <userinput>hg qseries</userinput>
   153.6 -first.patch
   153.7 -second.patch
   153.8 -<prompt>$</prompt> <userinput>hg qapplied</userinput>
   153.9 -first.patch
  153.10 -second.patch
  153.11 -</screen>
  153.12 -<!-- END mq.tutorial.qseries -->
   154.1 --- a/en/examples/results/rename.divergent.clone.out	Mon Apr 06 23:13:53 2009 -0700
   154.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   154.3 @@ -1,9 +0,0 @@
   154.4 -<!-- BEGIN rename.divergent.clone -->
   154.5 -<screen><prompt>$</prompt> <userinput>hg clone orig anne</userinput>
   154.6 -updating working directory
   154.7 -1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   154.8 -<prompt>$</prompt> <userinput>hg clone orig bob</userinput>
   154.9 -updating working directory
  154.10 -1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  154.11 -</screen>
  154.12 -<!-- END rename.divergent.clone -->
   155.1 --- a/en/examples/results/rename.divergent.merge.out	Mon Apr 06 23:13:53 2009 -0700
   155.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   155.3 @@ -1,29 +0,0 @@
   155.4 -<!-- BEGIN rename.divergent.merge -->
   155.5 -<screen># See http://www.selenic.com/mercurial/bts/issue455
   155.6 -<prompt>$</prompt> <userinput>cd ../orig</userinput>
   155.7 -<prompt>$</prompt> <userinput>hg pull -u ../anne</userinput>
   155.8 -pulling from ../anne
   155.9 -searching for changes
  155.10 -adding changesets
  155.11 -adding manifests
  155.12 -adding file changes
  155.13 -added 1 changesets with 1 changes to 1 files
  155.14 -1 files updated, 0 files merged, 1 files removed, 0 files unresolved
  155.15 -<prompt>$</prompt> <userinput>hg pull ../bob</userinput>
  155.16 -pulling from ../bob
  155.17 -searching for changes
  155.18 -adding changesets
  155.19 -adding manifests
  155.20 -adding file changes
  155.21 -added 1 changesets with 1 changes to 1 files (+1 heads)
  155.22 -(run 'hg heads' to see heads, 'hg merge' to merge)
  155.23 -<prompt>$</prompt> <userinput>hg merge</userinput>
  155.24 -warning: detected divergent renames of foo to:
  155.25 - bar
  155.26 - quux
  155.27 -1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  155.28 -(branch merge, don't forget to commit)
  155.29 -<prompt>$</prompt> <userinput>ls</userinput>
  155.30 -bar  quux
  155.31 -</screen>
  155.32 -<!-- END rename.divergent.merge -->
   156.1 --- a/en/examples/results/rename.divergent.rename.anne.out	Mon Apr 06 23:13:53 2009 -0700
   156.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   156.3 @@ -1,6 +0,0 @@
   156.4 -<!-- BEGIN rename.divergent.rename.anne -->
   156.5 -<screen><prompt>$</prompt> <userinput>cd anne</userinput>
   156.6 -<prompt>$</prompt> <userinput>hg mv foo bar</userinput>
   156.7 -<prompt>$</prompt> <userinput>hg ci -m 'Rename foo to bar'</userinput>
   156.8 -</screen>
   156.9 -<!-- END rename.divergent.rename.anne -->
   157.1 --- a/en/examples/results/rename.divergent.rename.bob.out	Mon Apr 06 23:13:53 2009 -0700
   157.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   157.3 @@ -1,6 +0,0 @@
   157.4 -<!-- BEGIN rename.divergent.rename.bob -->
   157.5 -<screen><prompt>$</prompt> <userinput>cd ../bob</userinput>
   157.6 -<prompt>$</prompt> <userinput>hg mv foo quux</userinput>
   157.7 -<prompt>$</prompt> <userinput>hg ci -m 'Rename foo to quux'</userinput>
   157.8 -</screen>
   157.9 -<!-- END rename.divergent.rename.bob -->
   158.1 --- a/en/examples/results/rollback.add.out	Mon Apr 06 23:13:53 2009 -0700
   158.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   158.3 @@ -1,5 +0,0 @@
   158.4 -<!-- BEGIN rollback.add -->
   158.5 -<screen><prompt>$</prompt> <userinput>hg add b</userinput>
   158.6 -<prompt>$</prompt> <userinput>hg commit -m 'Add file b, this time for real'</userinput>
   158.7 -</screen>
   158.8 -<!-- END rollback.add -->
   159.1 --- a/en/examples/results/rollback.commit.out	Mon Apr 06 23:13:53 2009 -0700
   159.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   159.3 @@ -1,7 +0,0 @@
   159.4 -<!-- BEGIN rollback.commit -->
   159.5 -<screen><prompt>$</prompt> <userinput>hg status</userinput>
   159.6 -M a
   159.7 -<prompt>$</prompt> <userinput>echo b &gt; b</userinput>
   159.8 -<prompt>$</prompt> <userinput>hg commit -m 'Add file b'</userinput>
   159.9 -</screen>
  159.10 -<!-- END rollback.commit -->
   160.1 --- a/en/examples/results/rollback.rollback.out	Mon Apr 06 23:13:53 2009 -0700
   160.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   160.3 @@ -1,15 +0,0 @@
   160.4 -<!-- BEGIN rollback.rollback -->
   160.5 -<screen><prompt>$</prompt> <userinput>hg rollback</userinput>
   160.6 -rolling back last transaction
   160.7 -<prompt>$</prompt> <userinput>hg tip</userinput>
   160.8 -changeset:   
   160.9 -tag:         tip
  160.10 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  160.11 -
  160.12 -summary:     First commit
  160.13 -
  160.14 -<prompt>$</prompt> <userinput>hg status</userinput>
  160.15 -M a
  160.16 -? b
  160.17 -</screen>
  160.18 -<!-- END rollback.rollback -->
   161.1 --- a/en/examples/results/rollback.status.out	Mon Apr 06 23:13:53 2009 -0700
   161.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   161.3 @@ -1,12 +0,0 @@
   161.4 -<!-- BEGIN rollback.status -->
   161.5 -<screen><prompt>$</prompt> <userinput>hg status</userinput>
   161.6 -? b
   161.7 -<prompt>$</prompt> <userinput>hg tip</userinput>
   161.8 -changeset:   
   161.9 -tag:         tip
  161.10 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  161.11 -
  161.12 -summary:     Add file b
  161.13 -
  161.14 -</screen>
  161.15 -<!-- END rollback.status -->
   162.1 --- a/en/examples/results/rollback.tip.out	Mon Apr 06 23:13:53 2009 -0700
   162.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   162.3 @@ -1,3 +0,0 @@
   162.4 -<!-- BEGIN rollback.tip -->
   162.5 -<screen></screen>
   162.6 -<!-- END rollback.tip -->
   163.1 --- a/en/examples/results/rollback.twice.out	Mon Apr 06 23:13:53 2009 -0700
   163.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   163.3 @@ -1,7 +0,0 @@
   163.4 -<!-- BEGIN rollback.twice -->
   163.5 -<screen><prompt>$</prompt> <userinput>hg rollback</userinput>
   163.6 -rolling back last transaction
   163.7 -<prompt>$</prompt> <userinput>hg rollback</userinput>
   163.8 -no rollback information available
   163.9 -</screen>
  163.10 -<!-- END rollback.twice -->
   164.1 --- a/en/examples/results/tag.init.out	Mon Apr 06 23:13:53 2009 -0700
   164.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   164.3 @@ -1,8 +0,0 @@
   164.4 -<!-- BEGIN tag.init -->
   164.5 -<screen><prompt>$</prompt> <userinput>hg init mytag</userinput>
   164.6 -<prompt>$</prompt> <userinput>cd mytag</userinput>
   164.7 -<prompt>$</prompt> <userinput>echo hello &gt; myfile</userinput>
   164.8 -<prompt>$</prompt> <userinput>hg commit -A -m 'Initial commit'</userinput>
   164.9 -adding myfile
  164.10 -</screen>
  164.11 -<!-- END tag.init -->
   165.1 --- a/en/examples/results/tag.log.out	Mon Apr 06 23:13:53 2009 -0700
   165.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   165.3 @@ -1,16 +0,0 @@
   165.4 -<!-- BEGIN tag.log -->
   165.5 -<screen><prompt>$</prompt> <userinput>hg log</userinput>
   165.6 -changeset:   
   165.7 -tag:         tip
   165.8 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   165.9 -
  165.10 -summary:     Added tag v1.0 for changeset 
  165.11 -
  165.12 -changeset:   
  165.13 -tag:         v1.0
  165.14 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  165.15 -
  165.16 -summary:     Initial commit
  165.17 -
  165.18 -</screen>
  165.19 -<!-- END tag.log -->
   166.1 --- a/en/examples/results/tag.log.v1.0.out	Mon Apr 06 23:13:53 2009 -0700
   166.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   166.3 @@ -1,13 +0,0 @@
   166.4 -<!-- BEGIN tag.log.v1.0 -->
   166.5 -<screen><prompt>$</prompt> <userinput>echo goodbye &gt; myfile2</userinput>
   166.6 -<prompt>$</prompt> <userinput>hg commit -A -m 'Second commit'</userinput>
   166.7 -adding myfile2
   166.8 -<prompt>$</prompt> <userinput>hg log -r v1.0</userinput>
   166.9 -changeset:   
  166.10 -tag:         v1.0
  166.11 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  166.12 -
  166.13 -summary:     Initial commit
  166.14 -
  166.15 -</screen>
  166.16 -<!-- END tag.log.v1.0 -->
   167.1 --- a/en/examples/results/tag.remove.out	Mon Apr 06 23:13:53 2009 -0700
   167.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   167.3 @@ -1,6 +0,0 @@
   167.4 -<!-- BEGIN tag.remove -->
   167.5 -<screen><prompt>$</prompt> <userinput>hg tag --remove v1.0</userinput>
   167.6 -<prompt>$</prompt> <userinput>hg tags</userinput>
   167.7 -tip                                
   167.8 -</screen>
   167.9 -<!-- END tag.remove -->
   168.1 --- a/en/examples/results/tag.replace.out	Mon Apr 06 23:13:53 2009 -0700
   168.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   168.3 @@ -1,13 +0,0 @@
   168.4 -<!-- BEGIN tag.replace -->
   168.5 -<screen><prompt>$</prompt> <userinput>hg tag -r 1 v1.1</userinput>
   168.6 -<prompt>$</prompt> <userinput>hg tags</userinput>
   168.7 -tip                                
   168.8 -v1.1                               
   168.9 -<prompt>$</prompt> <userinput>hg tag -r 2 v1.1</userinput>
  168.10 -abort: tag 'v1.1' already exists (use -f to force)
  168.11 -<prompt>$</prompt> <userinput>hg tag -f -r 2 v1.1</userinput>
  168.12 -<prompt>$</prompt> <userinput>hg tags</userinput>
  168.13 -tip                                
  168.14 -v1.1                               
  168.15 -</screen>
  168.16 -<!-- END tag.replace -->
   169.1 --- a/en/examples/results/tag.tag.out	Mon Apr 06 23:13:53 2009 -0700
   169.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   169.3 @@ -1,4 +0,0 @@
   169.4 -<!-- BEGIN tag.tag -->
   169.5 -<screen><prompt>$</prompt> <userinput>hg tag v1.0</userinput>
   169.6 -</screen>
   169.7 -<!-- END tag.tag -->
   170.1 --- a/en/examples/results/tag.tags.out	Mon Apr 06 23:13:53 2009 -0700
   170.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   170.3 @@ -1,6 +0,0 @@
   170.4 -<!-- BEGIN tag.tags -->
   170.5 -<screen><prompt>$</prompt> <userinput>hg tags</userinput>
   170.6 -tip                                
   170.7 -v1.0                               
   170.8 -</screen>
   170.9 -<!-- END tag.tags -->
   171.1 --- a/en/examples/results/tag.tip.out	Mon Apr 06 23:13:53 2009 -0700
   171.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   171.3 @@ -1,10 +0,0 @@
   171.4 -<!-- BEGIN tag.tip -->
   171.5 -<screen><prompt>$</prompt> <userinput>hg tip</userinput>
   171.6 -changeset:   
   171.7 -tag:         tip
   171.8 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   171.9 -
  171.10 -summary:     Added tag v1.1 for changeset 
  171.11 -
  171.12 -</screen>
  171.13 -<!-- END tag.tip -->
   172.1 --- a/en/examples/results/template.simple.changelog.out	Mon Apr 06 23:13:53 2009 -0700
   172.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   172.3 @@ -1,25 +0,0 @@
   172.4 -
   172.5 -
   172.6 -
   172.7 -
   172.8 -
   172.9 -
  172.10 -
  172.11 -
  172.12 -
  172.13 -
  172.14 -
  172.15 -
  172.16 -
  172.17 -
  172.18 -
  172.19 -
  172.20 -
  172.21 -
  172.22 -
  172.23 -
  172.24 -
  172.25 -
  172.26 -
  172.27 -
  172.28 -
   173.1 --- a/en/examples/results/template.simple.combine.out	Mon Apr 06 23:13:53 2009 -0700
   173.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   173.3 @@ -1,9 +0,0 @@
   173.4 -
   173.5 -
   173.6 -
   173.7 -
   173.8 -
   173.9 -
  173.10 -
  173.11 -
  173.12 -
   174.1 --- a/en/examples/results/template.simple.compact.out	Mon Apr 06 23:13:53 2009 -0700
   174.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   174.3 @@ -1,16 +0,0 @@
   174.4 -
   174.5 -
   174.6 -
   174.7 -
   174.8 -
   174.9 -
  174.10 -
  174.11 -
  174.12 -
  174.13 -
  174.14 -
  174.15 -
  174.16 -
  174.17 -
  174.18 -
  174.19 -
   175.1 --- a/en/examples/results/template.simple.datekeyword.out	Mon Apr 06 23:13:53 2009 -0700
   175.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   175.3 @@ -1,7 +0,0 @@
   175.4 -
   175.5 -
   175.6 -
   175.7 -
   175.8 -
   175.9 -
  175.10 -
   176.1 --- a/en/examples/results/template.simple.keywords.out	Mon Apr 06 23:13:53 2009 -0700
   176.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   176.3 @@ -1,24 +0,0 @@
   176.4 -
   176.5 -
   176.6 -
   176.7 -
   176.8 -
   176.9 -
  176.10 -
  176.11 -
  176.12 -
  176.13 -
  176.14 -
  176.15 -
  176.16 -
  176.17 -
  176.18 -
  176.19 -
  176.20 -
  176.21 -
  176.22 -
  176.23 -
  176.24 -
  176.25 -
  176.26 -
  176.27 -
   178.1 --- a/en/examples/results/template.simple.normal.out	Mon Apr 06 23:13:53 2009 -0700
   178.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   178.3 @@ -1,10 +0,0 @@
   178.4 -
   178.5 -
   178.6 -
   178.7 -
   178.8 -
   178.9 -
  178.10 -
  178.11 -
  178.12 -
  178.13 -
   179.1 --- a/en/examples/results/template.simple.rev.out	Mon Apr 06 23:13:53 2009 -0700
   179.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   179.3 @@ -1,6 +0,0 @@
   179.4 -
   179.5 -
   179.6 -
   179.7 -
   179.8 -
   179.9 -
   180.1 --- a/en/examples/results/template.simple.simplest.out	Mon Apr 06 23:13:53 2009 -0700
   180.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   180.3 @@ -1,5 +0,0 @@
   180.4 -
   180.5 -
   180.6 -
   180.7 -
   180.8 -
   181.1 --- a/en/examples/results/template.simple.simplesub.out	Mon Apr 06 23:13:53 2009 -0700
   181.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   181.3 @@ -1,10 +0,0 @@
   181.4 -
   181.5 -
   181.6 -
   181.7 -
   181.8 -
   181.9 -
  181.10 -
  181.11 -
  181.12 -
  181.13 -
   182.1 --- a/en/examples/results/template.svnstyle.id.out	Mon Apr 06 23:13:53 2009 -0700
   182.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   182.3 @@ -1,4 +0,0 @@
   182.4 -<!-- BEGIN template.svnstyle.id -->
   182.5 -<screen><prompt>$</prompt> <userinput>hg log -r0 --template '{node}'</userinput>
   182.6 -</screen>
   182.7 -<!-- END template.svnstyle.id -->
   183.1 --- a/en/examples/results/template.svnstyle.result.out	Mon Apr 06 23:13:53 2009 -0700
   183.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   183.3 @@ -1,14 +0,0 @@
   183.4 -<!-- BEGIN template.svnstyle.result -->
   183.5 -<screen><prompt>$</prompt> <userinput>hg log -r1 --style svn.style</userinput>
   183.6 -------------------------------------------------------------------------
   183.7 -
   183.8 -r1 | bos | 
   183.9 -
  183.10 -added line to end of &lt;&lt;hello&gt;&gt; file.
  183.11 -
  183.12 -in addition, added a file with the helpful name (at least i hope that some
  183.13 -might consider it so) of goodbye.
  183.14 -
  183.15 -------------------------------------------------------------------------
  183.16 -</screen>
  183.17 -<!-- END template.svnstyle.result -->
   184.1 --- a/en/examples/results/template.svnstyle.short.out	Mon Apr 06 23:13:53 2009 -0700
   184.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   184.3 @@ -1,13 +0,0 @@
   184.4 -<!-- BEGIN template.svnstyle.short -->
   184.5 -<screen><prompt>$</prompt> <userinput>svn log -r9653</userinput>
   184.6 -------------------------------------------------------------------------
   184.7 -r9653 | sean.hefty | 2006-09-27 14:39:55 -0700 (Wed, 27 Sep 2006) | 5 lines
   184.8 -
   184.9 -On reporting a route error, also include the status for the error,
  184.10 -rather than indicating a status of 0 when an error has occurred.
  184.11 -
  184.12 -Signed-off-by: Sean Hefty &lt;sean.hefty@intel.com&gt;
  184.13 -
  184.14 -------------------------------------------------------------------------
  184.15 -</screen>
  184.16 -<!-- END template.svnstyle.short -->
   185.1 --- a/en/examples/results/template.svnstyle.simplest.out	Mon Apr 06 23:13:53 2009 -0700
   185.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   185.3 @@ -1,7 +0,0 @@
   185.4 -<!-- BEGIN template.svnstyle.simplest -->
   185.5 -<screen><prompt>$</prompt> <userinput>cat svn.style</userinput>
   185.6 -changeset = "{node|short}\n"
   185.7 -<prompt>$</prompt> <userinput>hg log -r1 --style svn.style</userinput>
   185.8 -
   185.9 -</screen>
  185.10 -<!-- END template.svnstyle.simplest -->
   186.1 --- a/en/examples/results/template.svnstyle.style.out	Mon Apr 06 23:13:53 2009 -0700
   186.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   186.3 @@ -1,6 +0,0 @@
   186.4 -<!-- BEGIN template.svnstyle.style -->
   186.5 -<screen><prompt>$</prompt> <userinput>cat svn.style</userinput>
   186.6 -header = '------------------------------------------------------------------------\n\n'
   186.7 -changeset = svn.template
   186.8 -</screen>
   186.9 -<!-- END template.svnstyle.style -->
   187.1 --- a/en/examples/results/template.svnstyle.syntax.error.out	Mon Apr 06 23:13:53 2009 -0700
   187.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   187.3 @@ -1,5 +0,0 @@
   187.4 -<!-- BEGIN template.svnstyle.syntax.error -->
   187.5 -<screen><prompt>$</prompt> <userinput>hg log -r1 --style broken.style</userinput>
   187.6 -abort: broken.style:1: parse error
   187.7 -</screen>
   187.8 -<!-- END template.svnstyle.syntax.error -->
   188.1 --- a/en/examples/results/template.svnstyle.syntax.input.out	Mon Apr 06 23:13:53 2009 -0700
   188.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   188.3 @@ -1,5 +0,0 @@
   188.4 -<!-- BEGIN template.svnstyle.syntax.input -->
   188.5 -<screen><prompt>$</prompt> <userinput>cat broken.style</userinput>
   188.6 -changeset =
   188.7 -</screen>
   188.8 -<!-- END template.svnstyle.syntax.input -->
   189.1 --- a/en/examples/results/template.svnstyle.template.out	Mon Apr 06 23:13:53 2009 -0700
   189.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   189.3 @@ -1,9 +0,0 @@
   189.4 -<!-- BEGIN template.svnstyle.template -->
   189.5 -<screen><prompt>$</prompt> <userinput>cat svn.template</userinput>
   189.6 -r{rev} | {author|user} | {date|isodate} ({date|rfc822date})
   189.7 -
   189.8 -{desc|strip|fill76}
   189.9 -
  189.10 -------------------------------------------------------------------------
  189.11 -</screen>
  189.12 -<!-- END template.svnstyle.template -->
   190.1 --- a/en/examples/results/tour-merge-conflict.commit.out	Mon Apr 06 23:13:53 2009 -0700
   190.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   190.3 @@ -1,19 +0,0 @@
   190.4 -<!-- BEGIN tour-merge-conflict.commit -->
   190.5 -<screen><prompt>$</prompt> <userinput>cat &gt; letter.txt &lt;&lt;EOF</userinput>
   190.6 -<prompt>></prompt> <userinput>Greetings!</userinput>
   190.7 -<prompt>></prompt> <userinput>I am Bryan O'Sullivan, no relation of the former</userinput>
   190.8 -<prompt>></prompt> <userinput>Nigerian dictator Sani Abacha.</userinput>
   190.9 -<prompt>></prompt> <userinput>EOF</userinput>
  190.10 -<prompt>$</prompt> <userinput>hg resolve -m letter.txt</userinput>
  190.11 -<prompt>$</prompt> <userinput>hg commit -m 'Send me your money'</userinput>
  190.12 -<prompt>$</prompt> <userinput>hg tip</userinput>
  190.13 -changeset:   
  190.14 -tag:         tip
  190.15 -parent:      
  190.16 -parent:      
  190.17 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  190.18 -
  190.19 -summary:     Send me your money
  190.20 -
  190.21 -</screen>
  190.22 -<!-- END tour-merge-conflict.commit -->
   191.1 --- a/en/examples/results/tour-merge-conflict.cousin.out	Mon Apr 06 23:13:53 2009 -0700
   191.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   191.3 @@ -1,14 +0,0 @@
   191.4 -<!-- BEGIN tour-merge-conflict.cousin -->
   191.5 -<screen><prompt>$</prompt> <userinput>cd ..</userinput>
   191.6 -<prompt>$</prompt> <userinput>hg clone scam scam-cousin</userinput>
   191.7 -updating working directory
   191.8 -1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   191.9 -<prompt>$</prompt> <userinput>cd scam-cousin</userinput>
  191.10 -<prompt>$</prompt> <userinput>cat &gt; letter.txt &lt;&lt;EOF</userinput>
  191.11 -<prompt>></prompt> <userinput>Greetings!</userinput>
  191.12 -<prompt>></prompt> <userinput>I am Shehu Musa Abacha, cousin to the former</userinput>
  191.13 -<prompt>></prompt> <userinput>Nigerian dictator Sani Abacha.</userinput>
  191.14 -<prompt>></prompt> <userinput>EOF</userinput>
  191.15 -<prompt>$</prompt> <userinput>hg commit -m '419 scam, with cousin'</userinput>
  191.16 -</screen>
  191.17 -<!-- END tour-merge-conflict.cousin -->
   192.1 --- a/en/examples/results/tour-merge-conflict.merge.out	Mon Apr 06 23:13:53 2009 -0700
   192.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   192.3 @@ -1,20 +0,0 @@
   192.4 -<!-- BEGIN tour-merge-conflict.merge -->
   192.5 -<screen><prompt>$</prompt> <userinput>export HGMERGE=merge</userinput>
   192.6 -<prompt>$</prompt> <userinput>echo 'XXX this is broken and must be fixed'</userinput>
   192.7 -XXX this is broken and must be fixed
   192.8 -<prompt>$</prompt> <userinput>hg merge</userinput>
   192.9 -merging letter.txt
  192.10 -merge: warning: conflicts during merge
  192.11 -merging letter.txt failed!
  192.12 -0 files updated, 0 files merged, 0 files removed, 1 files unresolved
  192.13 -use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon
  192.14 -<prompt>$</prompt> <userinput>cat letter.txt</userinput>
  192.15 -Greetings!
  192.16 -&lt;&lt;&lt;&lt;&lt;&lt;&lt; /tmp/tour-merge-conflictP17yO-/scam-merge/letter.txt
  192.17 -I am Shehu Musa Abacha, cousin to the former
  192.18 -=======
  192.19 -I am Alhaji Abba Abacha, son of the former
  192.20 -&gt;&gt;&gt;&gt;&gt;&gt;&gt; /tmp/letter.txt~other.EVdwH3
  192.21 -Nigerian dictator Sani Abacha.
  192.22 -</screen>
  192.23 -<!-- END tour-merge-conflict.merge -->
   193.1 --- a/en/examples/results/tour-merge-conflict.pull.out	Mon Apr 06 23:13:53 2009 -0700
   193.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   193.3 @@ -1,17 +0,0 @@
   193.4 -<!-- BEGIN tour-merge-conflict.pull -->
   193.5 -<screen><prompt>$</prompt> <userinput>cd ..</userinput>
   193.6 -<prompt>$</prompt> <userinput>hg clone scam-cousin scam-merge</userinput>
   193.7 -updating working directory
   193.8 -1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   193.9 -<prompt>$</prompt> <userinput>cd scam-merge</userinput>
  193.10 -<prompt>$</prompt> <userinput>hg pull -u ../scam-son</userinput>
  193.11 -pulling from ../scam-son
  193.12 -searching for changes
  193.13 -adding changesets
  193.14 -adding manifests
  193.15 -adding file changes
  193.16 -added 1 changesets with 1 changes to 1 files (+1 heads)
  193.17 -not updating, since new heads added
  193.18 -(run 'hg heads' to see heads, 'hg merge' to merge)
  193.19 -</screen>
  193.20 -<!-- END tour-merge-conflict.pull -->
   194.1 --- a/en/examples/results/tour-merge-conflict.son.out	Mon Apr 06 23:13:53 2009 -0700
   194.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   194.3 @@ -1,14 +0,0 @@
   194.4 -<!-- BEGIN tour-merge-conflict.son -->
   194.5 -<screen><prompt>$</prompt> <userinput>cd ..</userinput>
   194.6 -<prompt>$</prompt> <userinput>hg clone scam scam-son</userinput>
   194.7 -updating working directory
   194.8 -1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   194.9 -<prompt>$</prompt> <userinput>cd scam-son</userinput>
  194.10 -<prompt>$</prompt> <userinput>cat &gt; letter.txt &lt;&lt;EOF</userinput>
  194.11 -<prompt>></prompt> <userinput>Greetings!</userinput>
  194.12 -<prompt>></prompt> <userinput>I am Alhaji Abba Abacha, son of the former</userinput>
  194.13 -<prompt>></prompt> <userinput>Nigerian dictator Sani Abacha.</userinput>
  194.14 -<prompt>></prompt> <userinput>EOF</userinput>
  194.15 -<prompt>$</prompt> <userinput>hg commit -m '419 scam, with son'</userinput>
  194.16 -</screen>
  194.17 -<!-- END tour-merge-conflict.son -->
   195.1 --- a/en/examples/results/tour-merge-conflict.wife.out	Mon Apr 06 23:13:53 2009 -0700
   195.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   195.3 @@ -1,10 +0,0 @@
   195.4 -<!-- BEGIN tour-merge-conflict.wife -->
   195.5 -<screen><prompt>$</prompt> <userinput>cat &gt; letter.txt &lt;&lt;EOF</userinput>
   195.6 -<prompt>></prompt> <userinput>Greetings!</userinput>
   195.7 -<prompt>></prompt> <userinput>I am Mariam Abacha, the wife of former</userinput>
   195.8 -<prompt>></prompt> <userinput>Nigerian dictator Sani Abacha.</userinput>
   195.9 -<prompt>></prompt> <userinput>EOF</userinput>
  195.10 -<prompt>$</prompt> <userinput>hg add letter.txt</userinput>
  195.11 -<prompt>$</prompt> <userinput>hg commit -m '419 scam, first draft'</userinput>
  195.12 -</screen>
  195.13 -<!-- END tour-merge-conflict.wife -->
   196.1 --- a/en/examples/results/tour.clone-pull.out	Mon Apr 06 23:13:53 2009 -0700
   196.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   196.3 @@ -1,7 +0,0 @@
   196.4 -<!-- BEGIN tour.clone-pull -->
   196.5 -<screen><prompt>$</prompt> <userinput>cd ..</userinput>
   196.6 -<prompt>$</prompt> <userinput>hg clone hello hello-pull</userinput>
   196.7 -updating working directory
   196.8 -2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   196.9 -</screen>
  196.10 -<!-- END tour.clone-pull -->
   197.1 --- a/en/examples/results/tour.clone-push.out	Mon Apr 06 23:13:53 2009 -0700
   197.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   197.3 @@ -1,7 +0,0 @@
   197.4 -<!-- BEGIN tour.clone-push -->
   197.5 -<screen><prompt>$</prompt> <userinput>cd ..</userinput>
   197.6 -<prompt>$</prompt> <userinput>hg clone hello hello-push</userinput>
   197.7 -updating working directory
   197.8 -2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   197.9 -</screen>
  197.10 -<!-- END tour.clone-push -->
   198.1 --- a/en/examples/results/tour.clone.out	Mon Apr 06 23:13:53 2009 -0700
   198.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   198.3 @@ -1,12 +0,0 @@
   198.4 -<!-- BEGIN tour.clone -->
   198.5 -<screen><prompt>$</prompt> <userinput>hg clone http://hg.serpentine.com/tutorial/hello</userinput>
   198.6 -destination directory: hello
   198.7 -requesting all changes
   198.8 -adding changesets
   198.9 -adding manifests
  198.10 -adding file changes
  198.11 -added 5 changesets with 5 changes to 2 files
  198.12 -updating working directory
  198.13 -2 files updated, 0 files merged, 0 files removed, 0 files unresolved
  198.14 -</screen>
  198.15 -<!-- END tour.clone -->
   199.1 --- a/en/examples/results/tour.commit.out	Mon Apr 06 23:13:53 2009 -0700
   199.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   199.3 @@ -1,4 +0,0 @@
   199.4 -<!-- BEGIN tour.commit -->
   199.5 -<screen><prompt>$</prompt> <userinput>hg commit</userinput>
   199.6 -</screen>
   199.7 -<!-- END tour.commit -->
   200.1 --- a/en/examples/results/tour.diff.out	Mon Apr 06 23:13:53 2009 -0700
   200.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   200.3 @@ -1,14 +0,0 @@
   200.4 -<!-- BEGIN tour.diff -->
   200.5 -<screen><prompt>$</prompt> <userinput>hg diff</userinput>
   200.6 -diff -r  hello.c
   200.7 -
   200.8 -
   200.9 -@@ -8,5 +8,6 @@
  200.10 - int main(int argc, char **argv)
  200.11 - {
  200.12 - 	printf("hello, world!\");
  200.13 -+	printf("hello again!\n");
  200.14 - 	return 0;
  200.15 - }
  200.16 -</screen>
  200.17 -<!-- END tour.diff -->
   201.1 --- a/en/examples/results/tour.help.out	Mon Apr 06 23:13:53 2009 -0700
   201.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   201.3 @@ -1,22 +0,0 @@
   201.4 -<!-- BEGIN tour.help -->
   201.5 -<screen><prompt>$</prompt> <userinput>hg help init</userinput>
   201.6 -hg init [-e CMD] [--remotecmd CMD] [DEST]
   201.7 -
   201.8 -create a new repository in the given directory
   201.9 -
  201.10 -    Initialize a new repository in the given directory. If the given
  201.11 -    directory does not exist, it is created.
  201.12 -
  201.13 -    If no directory is given, the current directory is used.
  201.14 -
  201.15 -    It is possible to specify an ssh:// URL as the destination.
  201.16 -    See 'hg help urls' for more information.
  201.17 -
  201.18 -options:
  201.19 -
  201.20 - -e --ssh        specify ssh command to use
  201.21 -    --remotecmd  specify hg command to run on the remote side
  201.22 -
  201.23 -use "hg -v help init" to show global options
  201.24 -</screen>
  201.25 -<!-- END tour.help -->
   202.1 --- a/en/examples/results/tour.incoming.out	Mon Apr 06 23:13:53 2009 -0700
   202.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   202.3 @@ -1,13 +0,0 @@
   202.4 -<!-- BEGIN tour.incoming -->
   202.5 -<screen><prompt>$</prompt> <userinput>cd hello-pull</userinput>
   202.6 -<prompt>$</prompt> <userinput>hg incoming ../my-hello</userinput>
   202.7 -comparing with ../my-hello
   202.8 -searching for changes
   202.9 -changeset:   
  202.10 -tag:         tip
  202.11 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  202.12 -
  202.13 -summary:     Added an extra line of output
  202.14 -
  202.15 -</screen>
  202.16 -<!-- END tour.incoming -->
   203.1 --- a/en/examples/results/tour.log-r.out	Mon Apr 06 23:13:53 2009 -0700
   203.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   203.3 @@ -1,27 +0,0 @@
   203.4 -<!-- BEGIN tour.log-r -->
   203.5 -<screen><prompt>$</prompt> <userinput>hg log -r 3</userinput>
   203.6 -changeset:   
   203.7 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   203.8 -
   203.9 -summary:     Get make to generate the final binary from a .o file.
  203.10 -
  203.11 -<prompt>$</prompt> <userinput>hg log -r </userinput>
  203.12 -changeset:   
  203.13 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  203.14 -
  203.15 -summary:     Get make to generate the final binary from a .o file.
  203.16 -
  203.17 -<prompt>$</prompt> <userinput>hg log -r 1 -r 4</userinput>
  203.18 -changeset:   
  203.19 -user:        mpm@selenic.com
  203.20 -
  203.21 -summary:     Create a makefile
  203.22 -
  203.23 -changeset:   
  203.24 -tag:         tip
  203.25 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  203.26 -
  203.27 -summary:     Trim comments.
  203.28 -
  203.29 -</screen>
  203.30 -<!-- END tour.log-r -->
   204.1 --- a/en/examples/results/tour.log-v.out	Mon Apr 06 23:13:53 2009 -0700
   204.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   204.3 @@ -1,12 +0,0 @@
   204.4 -<!-- BEGIN tour.log-v -->
   204.5 -<screen><prompt>$</prompt> <userinput>hg log -v -r 3</userinput>
   204.6 -changeset:   
   204.7 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   204.8 -
   204.9 -files:       Makefile
  204.10 -description:
  204.11 -Get make to generate the final binary from a .o file.
  204.12 -
  204.13 -
  204.14 -</screen>
  204.15 -<!-- END tour.log-v -->
   205.1 --- a/en/examples/results/tour.log-vp.out	Mon Apr 06 23:13:53 2009 -0700
   205.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   205.3 @@ -1,24 +0,0 @@
   205.4 -<!-- BEGIN tour.log-vp -->
   205.5 -<screen><prompt>$</prompt> <userinput>hg log -v -p -r 2</userinput>
   205.6 -changeset:   
   205.7 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   205.8 -
   205.9 -files:       hello.c
  205.10 -description:
  205.11 -Introduce a typo into hello.c.
  205.12 -
  205.13 -
  205.14 -diff -r  -r  hello.c
  205.15 -
  205.16 -
  205.17 -@@ -11,6 +11,6 @@
  205.18 - 
  205.19 - int main(int argc, char **argv)
  205.20 - {
  205.21 --	printf("hello, world!\n");
  205.22 -+	printf("hello, world!\");
  205.23 - 	return 0;
  205.24 - }
  205.25 -
  205.26 -</screen>
  205.27 -<!-- END tour.log-vp -->
   206.1 --- a/en/examples/results/tour.log.out	Mon Apr 06 23:13:53 2009 -0700
   206.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   206.3 @@ -1,30 +0,0 @@
   206.4 -<!-- BEGIN tour.log -->
   206.5 -<screen><prompt>$</prompt> <userinput>hg log</userinput>
   206.6 -changeset:   
   206.7 -tag:         tip
   206.8 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   206.9 -
  206.10 -summary:     Trim comments.
  206.11 -
  206.12 -changeset:   
  206.13 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  206.14 -
  206.15 -summary:     Get make to generate the final binary from a .o file.
  206.16 -
  206.17 -changeset:   
  206.18 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  206.19 -
  206.20 -summary:     Introduce a typo into hello.c.
  206.21 -
  206.22 -changeset:   
  206.23 -user:        mpm@selenic.com
  206.24 -
  206.25 -summary:     Create a makefile
  206.26 -
  206.27 -changeset:   
  206.28 -user:        mpm@selenic.com
  206.29 -
  206.30 -summary:     Create a standard "hello, world" program
  206.31 -
  206.32 -</screen>
  206.33 -<!-- END tour.log -->
   207.1 --- a/en/examples/results/tour.log.range.out	Mon Apr 06 23:13:53 2009 -0700
   207.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   207.3 @@ -1,20 +0,0 @@
   207.4 -<!-- BEGIN tour.log.range -->
   207.5 -<screen><prompt>$</prompt> <userinput>hg log -r 2:4</userinput>
   207.6 -changeset:   
   207.7 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   207.8 -
   207.9 -summary:     Introduce a typo into hello.c.
  207.10 -
  207.11 -changeset:   
  207.12 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  207.13 -
  207.14 -summary:     Get make to generate the final binary from a .o file.
  207.15 -
  207.16 -changeset:   
  207.17 -tag:         tip
  207.18 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  207.19 -
  207.20 -summary:     Trim comments.
  207.21 -
  207.22 -</screen>
  207.23 -<!-- END tour.log.range -->
   208.1 --- a/en/examples/results/tour.ls-a.out	Mon Apr 06 23:13:53 2009 -0700
   208.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   208.3 @@ -1,6 +0,0 @@
   208.4 -<!-- BEGIN tour.ls-a -->
   208.5 -<screen><prompt>$</prompt> <userinput>cd hello</userinput>
   208.6 -<prompt>$</prompt> <userinput>ls -a</userinput>
   208.7 -.  ..  .hg  Makefile  hello.c
   208.8 -</screen>
   208.9 -<!-- END tour.ls-a -->
   209.1 --- a/en/examples/results/tour.ls.out	Mon Apr 06 23:13:53 2009 -0700
   209.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   209.3 @@ -1,8 +0,0 @@
   209.4 -<!-- BEGIN tour.ls -->
   209.5 -<screen><prompt>$</prompt> <userinput>ls -l</userinput>
   209.6 -
   209.7 -
   209.8 -<prompt>$</prompt> <userinput>ls hello</userinput>
   209.9 -Makefile  hello.c
  209.10 -</screen>
  209.11 -<!-- END tour.ls -->
   210.1 --- a/en/examples/results/tour.merge.cat.out	Mon Apr 06 23:13:53 2009 -0700
   210.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   210.3 @@ -1,31 +0,0 @@
   210.4 -<!-- BEGIN tour.merge.cat -->
   210.5 -<screen><prompt>$</prompt> <userinput>cat hello.c</userinput>
   210.6 -/*
   210.7 - * Placed in the public domain by Bryan O'Sullivan.  This program is
   210.8 - * not covered by patents in the United States or other countries.
   210.9 - */
  210.10 -
  210.11 -#include &lt;stdio.h&gt;
  210.12 -
  210.13 -int main(int argc, char **argv)
  210.14 -{
  210.15 -	printf("once more, hello.\n");
  210.16 -	printf("hello, world!\");
  210.17 -	return 0;
  210.18 -}
  210.19 -<prompt>$</prompt> <userinput>cat ../my-hello/hello.c</userinput>
  210.20 -/*
  210.21 - * Placed in the public domain by Bryan O'Sullivan.  This program is
  210.22 - * not covered by patents in the United States or other countries.
  210.23 - */
  210.24 -
  210.25 -#include &lt;stdio.h&gt;
  210.26 -
  210.27 -int main(int argc, char **argv)
  210.28 -{
  210.29 -	printf("hello, world!\");
  210.30 -	printf("hello again!\n");
  210.31 -	return 0;
  210.32 -}
  210.33 -</screen>
  210.34 -<!-- END tour.merge.cat -->
   211.1 --- a/en/examples/results/tour.merge.clone.out	Mon Apr 06 23:13:53 2009 -0700
   211.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   211.3 @@ -1,10 +0,0 @@
   211.4 -<!-- BEGIN tour.merge.clone -->
   211.5 -<screen><prompt>$</prompt> <userinput>cd ..</userinput>
   211.6 -<prompt>$</prompt> <userinput>hg clone hello my-new-hello</userinput>
   211.7 -updating working directory
   211.8 -2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   211.9 -<prompt>$</prompt> <userinput>cd my-new-hello</userinput>
  211.10 -<prompt>$</prompt> <userinput>sed -i '/printf/i\\tprintf("once more, hello.\\n");' hello.c</userinput>
  211.11 -<prompt>$</prompt> <userinput>hg commit -m 'A new hello for a new day.'</userinput>
  211.12 -</screen>
  211.13 -<!-- END tour.merge.clone -->
   212.1 --- a/en/examples/results/tour.merge.commit.out	Mon Apr 06 23:13:53 2009 -0700
   212.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   212.3 @@ -1,4 +0,0 @@
   212.4 -<!-- BEGIN tour.merge.commit -->
   212.5 -<screen><prompt>$</prompt> <userinput>hg commit -m 'Merged changes'</userinput>
   212.6 -</screen>
   212.7 -<!-- END tour.merge.commit -->
   213.1 --- a/en/examples/results/tour.merge.heads.out	Mon Apr 06 23:13:53 2009 -0700
   213.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   213.3 @@ -1,16 +0,0 @@
   213.4 -<!-- BEGIN tour.merge.heads -->
   213.5 -<screen><prompt>$</prompt> <userinput>hg heads</userinput>
   213.6 -changeset:   
   213.7 -tag:         tip
   213.8 -parent:      
   213.9 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  213.10 -
  213.11 -summary:     Added an extra line of output
  213.12 -
  213.13 -changeset:   
  213.14 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  213.15 -
  213.16 -summary:     A new hello for a new day.
  213.17 -
  213.18 -</screen>
  213.19 -<!-- END tour.merge.heads -->
   214.1 --- a/en/examples/results/tour.merge.merge.out	Mon Apr 06 23:13:53 2009 -0700
   214.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   214.3 @@ -1,7 +0,0 @@
   214.4 -<!-- BEGIN tour.merge.merge -->
   214.5 -<screen><prompt>$</prompt> <userinput>hg merge</userinput>
   214.6 -merging hello.c
   214.7 -0 files updated, 1 files merged, 0 files removed, 0 files unresolved
   214.8 -(branch merge, don't forget to commit)
   214.9 -</screen>
  214.10 -<!-- END tour.merge.merge -->
   215.1 --- a/en/examples/results/tour.merge.parents.out	Mon Apr 06 23:13:53 2009 -0700
   215.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   215.3 @@ -1,31 +0,0 @@
   215.4 -<!-- BEGIN tour.merge.parents -->
   215.5 -<screen><prompt>$</prompt> <userinput>hg parents</userinput>
   215.6 -changeset:   
   215.7 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   215.8 -
   215.9 -summary:     A new hello for a new day.
  215.10 -
  215.11 -changeset:   
  215.12 -tag:         tip
  215.13 -parent:      
  215.14 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  215.15 -
  215.16 -summary:     Added an extra line of output
  215.17 -
  215.18 -<prompt>$</prompt> <userinput>cat hello.c</userinput>
  215.19 -/*
  215.20 - * Placed in the public domain by Bryan O'Sullivan.  This program is
  215.21 - * not covered by patents in the United States or other countries.
  215.22 - */
  215.23 -
  215.24 -#include &lt;stdio.h&gt;
  215.25 -
  215.26 -int main(int argc, char **argv)
  215.27 -{
  215.28 -	printf("once more, hello.\n");
  215.29 -	printf("hello, world!\");
  215.30 -	printf("hello again!\n");
  215.31 -	return 0;
  215.32 -}
  215.33 -</screen>
  215.34 -<!-- END tour.merge.parents -->
   216.1 --- a/en/examples/results/tour.merge.pull.out	Mon Apr 06 23:13:53 2009 -0700
   216.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   216.3 @@ -1,11 +0,0 @@
   216.4 -<!-- BEGIN tour.merge.pull -->
   216.5 -<screen><prompt>$</prompt> <userinput>hg pull ../my-hello</userinput>
   216.6 -pulling from ../my-hello
   216.7 -searching for changes
   216.8 -adding changesets
   216.9 -adding manifests
  216.10 -adding file changes
  216.11 -added 1 changesets with 1 changes to 1 files (+1 heads)
  216.12 -(run 'hg heads' to see heads, 'hg merge' to merge)
  216.13 -</screen>
  216.14 -<!-- END tour.merge.pull -->
   217.1 --- a/en/examples/results/tour.merge.tip.out	Mon Apr 06 23:13:53 2009 -0700
   217.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   217.3 @@ -1,12 +0,0 @@
   217.4 -<!-- BEGIN tour.merge.tip -->
   217.5 -<screen><prompt>$</prompt> <userinput>hg tip</userinput>
   217.6 -changeset:   
   217.7 -tag:         tip
   217.8 -parent:      
   217.9 -parent:      
  217.10 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  217.11 -
  217.12 -summary:     Merged changes
  217.13 -
  217.14 -</screen>
  217.15 -<!-- END tour.merge.tip -->
   218.1 --- a/en/examples/results/tour.merge.update.out	Mon Apr 06 23:13:53 2009 -0700
   218.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   218.3 @@ -1,5 +0,0 @@
   218.4 -<!-- BEGIN tour.merge.update -->
   218.5 -<screen><prompt>$</prompt> <userinput>hg update</userinput>
   218.6 -abort: crosses branches (use 'hg merge' or 'hg update -C')
   218.7 -</screen>
   218.8 -<!-- END tour.merge.update -->
   219.1 --- a/en/examples/results/tour.older.out	Mon Apr 06 23:13:53 2009 -0700
   219.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   219.3 @@ -1,13 +0,0 @@
   219.4 -<!-- BEGIN tour.older -->
   219.5 -<screen><prompt>$</prompt> <userinput>hg update 2</userinput>
   219.6 -2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   219.7 -<prompt>$</prompt> <userinput>hg parents</userinput>
   219.8 -changeset:   
   219.9 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  219.10 -
  219.11 -summary:     Introduce a typo into hello.c.
  219.12 -
  219.13 -<prompt>$</prompt> <userinput>hg update</userinput>
  219.14 -2 files updated, 0 files merged, 0 files removed, 0 files unresolved
  219.15 -</screen>
  219.16 -<!-- END tour.older -->
   220.1 --- a/en/examples/results/tour.outgoing.net.out	Mon Apr 06 23:13:53 2009 -0700
   220.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   220.3 @@ -1,12 +0,0 @@
   220.4 -<!-- BEGIN tour.outgoing.net -->
   220.5 -<screen><prompt>$</prompt> <userinput>hg outgoing http://hg.serpentine.com/tutorial/hello</userinput>
   220.6 -comparing with http://hg.serpentine.com/tutorial/hello
   220.7 -searching for changes
   220.8 -changeset:   
   220.9 -tag:         tip
  220.10 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  220.11 -
  220.12 -summary:     Added an extra line of output
  220.13 -
  220.14 -</screen>
  220.15 -<!-- END tour.outgoing.net -->
   221.1 --- a/en/examples/results/tour.outgoing.out	Mon Apr 06 23:13:53 2009 -0700
   221.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   221.3 @@ -1,13 +0,0 @@
   221.4 -<!-- BEGIN tour.outgoing -->
   221.5 -<screen><prompt>$</prompt> <userinput>cd my-hello</userinput>
   221.6 -<prompt>$</prompt> <userinput>hg outgoing ../hello-push</userinput>
   221.7 -comparing with ../hello-push
   221.8 -searching for changes
   221.9 -changeset:   
  221.10 -tag:         tip
  221.11 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  221.12 -
  221.13 -summary:     Added an extra line of output
  221.14 -
  221.15 -</screen>
  221.16 -<!-- END tour.outgoing -->
   222.1 --- a/en/examples/results/tour.parents.out	Mon Apr 06 23:13:53 2009 -0700
   222.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   222.3 @@ -1,10 +0,0 @@
   222.4 -<!-- BEGIN tour.parents -->
   222.5 -<screen><prompt>$</prompt> <userinput>hg parents</userinput>
   222.6 -changeset:   
   222.7 -tag:         tip
   222.8 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   222.9 -
  222.10 -summary:     Added an extra line of output
  222.11 -
  222.12 -</screen>
  222.13 -<!-- END tour.parents -->
   223.1 --- a/en/examples/results/tour.pull.out	Mon Apr 06 23:13:53 2009 -0700
   223.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   223.3 @@ -1,25 +0,0 @@
   223.4 -<!-- BEGIN tour.pull -->
   223.5 -<screen><prompt>$</prompt> <userinput>hg tip</userinput>
   223.6 -changeset:   
   223.7 -tag:         tip
   223.8 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   223.9 -
  223.10 -summary:     Trim comments.
  223.11 -
  223.12 -<prompt>$</prompt> <userinput>hg pull ../my-hello</userinput>
  223.13 -pulling from ../my-hello
  223.14 -searching for changes
  223.15 -adding changesets
  223.16 -adding manifests
  223.17 -adding file changes
  223.18 -added 1 changesets with 1 changes to 1 files
  223.19 -(run 'hg update' to get a working copy)
  223.20 -<prompt>$</prompt> <userinput>hg tip</userinput>
  223.21 -changeset:   
  223.22 -tag:         tip
  223.23 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
  223.24 -
  223.25 -summary:     Added an extra line of output
  223.26 -
  223.27 -</screen>
  223.28 -<!-- END tour.pull -->
   224.1 --- a/en/examples/results/tour.push.net.out	Mon Apr 06 23:13:53 2009 -0700
   224.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   224.3 @@ -1,7 +0,0 @@
   224.4 -<!-- BEGIN tour.push.net -->
   224.5 -<screen><prompt>$</prompt> <userinput>hg push http://hg.serpentine.com/tutorial/hello</userinput>
   224.6 -pushing to http://hg.serpentine.com/tutorial/hello
   224.7 -searching for changes
   224.8 -ssl required
   224.9 -</screen>
  224.10 -<!-- END tour.push.net -->
   225.1 --- a/en/examples/results/tour.push.nothing.out	Mon Apr 06 23:13:53 2009 -0700
   225.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   225.3 @@ -1,7 +0,0 @@
   225.4 -<!-- BEGIN tour.push.nothing -->
   225.5 -<screen><prompt>$</prompt> <userinput>hg push ../hello-push</userinput>
   225.6 -pushing to ../hello-push
   225.7 -searching for changes
   225.8 -no changes found
   225.9 -</screen>
  225.10 -<!-- END tour.push.nothing -->
   226.1 --- a/en/examples/results/tour.push.out	Mon Apr 06 23:13:53 2009 -0700
   226.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   226.3 @@ -1,10 +0,0 @@
   226.4 -<!-- BEGIN tour.push -->
   226.5 -<screen><prompt>$</prompt> <userinput>hg push ../hello-push</userinput>
   226.6 -pushing to ../hello-push
   226.7 -searching for changes
   226.8 -adding changesets
   226.9 -adding manifests
  226.10 -adding file changes
  226.11 -added 1 changesets with 1 changes to 1 files
  226.12 -</screen>
  226.13 -<!-- END tour.push -->
   227.1 --- a/en/examples/results/tour.reclone.out	Mon Apr 06 23:13:53 2009 -0700
   227.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   227.3 @@ -1,8 +0,0 @@
   227.4 -<!-- BEGIN tour.reclone -->
   227.5 -<screen><prompt>$</prompt> <userinput>cd ..</userinput>
   227.6 -<prompt>$</prompt> <userinput>hg clone hello my-hello</userinput>
   227.7 -updating working directory
   227.8 -2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   227.9 -<prompt>$</prompt> <userinput>cd my-hello</userinput>
  227.10 -</screen>
  227.11 -<!-- END tour.reclone -->
   228.1 --- a/en/examples/results/tour.sed.out	Mon Apr 06 23:13:53 2009 -0700
   228.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   228.3 @@ -1,4 +0,0 @@
   228.4 -<!-- BEGIN tour.sed -->
   228.5 -<screen><prompt>$</prompt> <userinput>sed -i '/printf/a\\tprintf("hello again!\\n");' hello.c</userinput>
   228.6 -</screen>
   228.7 -<!-- END tour.sed -->
   229.1 --- a/en/examples/results/tour.status.out	Mon Apr 06 23:13:53 2009 -0700
   229.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   229.3 @@ -1,7 +0,0 @@
   229.4 -<!-- BEGIN tour.status -->
   229.5 -<screen><prompt>$</prompt> <userinput>ls</userinput>
   229.6 -Makefile  hello.c
   229.7 -<prompt>$</prompt> <userinput>hg status</userinput>
   229.8 -M hello.c
   229.9 -</screen>
  229.10 -<!-- END tour.status -->
   230.1 --- a/en/examples/results/tour.tip.out	Mon Apr 06 23:13:53 2009 -0700
   230.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   230.3 @@ -1,24 +0,0 @@
   230.4 -<!-- BEGIN tour.tip -->
   230.5 -<screen><prompt>$</prompt> <userinput>hg tip -vp</userinput>
   230.6 -changeset:   
   230.7 -tag:         tip
   230.8 -user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
   230.9 -
  230.10 -files:       hello.c
  230.11 -description:
  230.12 -Added an extra line of output
  230.13 -
  230.14 -
  230.15 -diff -r  -r  hello.c
  230.16 -
  230.17 -
  230.18 -@@ -8,5 +8,6 @@
  230.19 - int main(int argc, char **argv)
  230.20 - {
  230.21 - 	printf("hello, world!\");
  230.22 -+	printf("hello again!\n");
  230.23 - 	return 0;
  230.24 - }
  230.25 -
  230.26 -</screen>
  230.27 -<!-- END tour.tip -->
   231.1 --- a/en/examples/results/tour.update.out	Mon Apr 06 23:13:53 2009 -0700
   231.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   231.3 @@ -1,10 +0,0 @@
   231.4 -<!-- BEGIN tour.update -->
   231.5 -<screen><prompt>$</prompt> <userinput>grep printf hello.c</userinput>
   231.6 -	printf("hello, world!\");
   231.7 -<prompt>$</prompt> <userinput>hg update tip</userinput>
   231.8 -1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   231.9 -<prompt>$</prompt> <userinput>grep printf hello.c</userinput>
  231.10 -	printf("hello, world!\");
  231.11 -	printf("hello again!\n");
  231.12 -</screen>
  231.13 -<!-- END tour.update -->
   232.1 --- a/en/examples/results/tour.version.out	Mon Apr 06 23:13:53 2009 -0700
   232.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   232.3 @@ -1,9 +0,0 @@
   232.4 -<!-- BEGIN tour.version -->
   232.5 -<screen><prompt>$</prompt> <userinput>hg version</userinput>
   232.6 -Mercurial Distributed SCM (version unknown)
   232.7 -
   232.8 -Copyright (C) 2005-2009 Matt Mackall &lt;mpm@selenic.com&gt; and others
   232.9 -This is free software; see the source for copying conditions. There is NO
  232.10 -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  232.11 -</screen>
  232.12 -<!-- END tour.version -->
   233.1 Binary file en/figs/note.png has changed
   234.1 Binary file en/figs/tip.png has changed
   235.1 Binary file en/figs/warning.png has changed
   236.1 --- a/examples/hg-interdiff	Mon Apr 06 23:13:53 2009 -0700
   236.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   236.3 @@ -1,45 +0,0 @@
   236.4 -#!/usr/bin/env python
   236.5 -#
   236.6 -# Adapter for using interdiff with mercurial's extdiff extension.
   236.7 -#
   236.8 -# Copyright 2006 Bryan O'Sullivan <bos@serpentine.com>
   236.9 -#
  236.10 -# This software may be used and distributed according to the terms of
  236.11 -# the GNU General Public License, incorporated herein by reference.
  236.12 -
  236.13 -import os, sys
  236.14 -
  236.15 -def walk(base):
  236.16 -    # yield all non-directories below the base path.
  236.17 -    for root, dirs, files in os.walk(base):
  236.18 -        for f in files:
  236.19 -            path = os.path.join(root, f)
  236.20 -            yield path[len(base)+1:], path
  236.21 -    else:
  236.22 -        if os.path.isfile(base):
  236.23 -            yield '', base
  236.24 -
  236.25 -# create list of unique file names under both directories.
  236.26 -files = dict(walk(sys.argv[1]))
  236.27 -files.update(walk(sys.argv[2]))
  236.28 -files = files.keys()
  236.29 -files.sort()
  236.30 -
  236.31 -def name(base, f):
  236.32 -    if f:
  236.33 -        path = os.path.join(base, f)
  236.34 -    else:
  236.35 -        path = base
  236.36 -    # interdiff requires two files; use /dev/null if one is missing.
  236.37 -    if os.path.exists(path):
  236.38 -        return path
  236.39 -    return '/dev/null'
  236.40 -
  236.41 -ret = 0
  236.42 -
  236.43 -for f in files:
  236.44 -    if os.system('interdiff "%s" "%s"' % (name(sys.argv[1], f),
  236.45 -                                          name(sys.argv[2], f))):
  236.46 -        ret = 1
  236.47 -
  236.48 -sys.exit(ret)
   237.1 --- a/examples/hg-replay	Mon Apr 06 23:13:53 2009 -0700
   237.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   237.3 @@ -1,107 +0,0 @@
   237.4 -#!/usr/bin/env python
   237.5 -#
   237.6 -# Adapter for using interdiff with mercurial's extdiff extension.
   237.7 -#
   237.8 -# Copyright 2006 Bryan O'Sullivan <bos@serpentine.com>
   237.9 -#
  237.10 -# This software may be used and distributed according to the terms of
  237.11 -# the GNU General Public License, incorporated herein by reference.
  237.12 -
  237.13 -import os
  237.14 -import shutil
  237.15 -import sys
  237.16 -import tempfile
  237.17 -
  237.18 -if len(sys.argv) < 4:
  237.19 -    print >> sys.stderr, ('usage: %s srcrepo destrepo cset-to-omit [...]' %
  237.20 -                          os.path.basename(sys.argv[0]))
  237.21 -    sys.exit(1)
  237.22 -
  237.23 -srcrepo, destrepo = sys.argv[1], sys.argv[2]
  237.24 -omit = sys.argv[3:]
  237.25 -    
  237.26 -changemap = {}
  237.27 -revs = []
  237.28 -
  237.29 -parent = None
  237.30 -
  237.31 -sys.stdout.write('gathering history...')
  237.32 -sys.stdout.flush()
  237.33 -
  237.34 -for line in os.popen("hg --cwd %r log -r0:tip --template '{rev}:{node} {parents}\n'" % srcrepo):
  237.35 -    changes = line.split()
  237.36 -    cset = changes[0].split(':')[1]
  237.37 -    rev = len(revs)
  237.38 -    changemap[cset] = rev
  237.39 -    if len(changes) >= 2:
  237.40 -        p1 = int(changes[1].split(':', 1)[0])
  237.41 -    if len(changes) == 3:
  237.42 -        p2 = int(changes[2].split(':', 1)[0])
  237.43 -    else:
  237.44 -        p2 = None
  237.45 -    if len(changes) == 1:
  237.46 -        p1 = parent
  237.47 -    revs.append((cset, p1, p2))
  237.48 -    parent = rev
  237.49 -
  237.50 -sys.stdout.write(' %d revs\n' % len(revs))
  237.51 -
  237.52 -def findrev(r):
  237.53 -    try:
  237.54 -        i = int(r)
  237.55 -        if str(i) == r:
  237.56 -            rev = i
  237.57 -        if rev < 0:
  237.58 -            rev += len(revs)
  237.59 -        if rev < 0 or rev > len(revs):
  237.60 -            print >> sys.stderr, 'bad changeset: %r' % r
  237.61 -            sys.exit(1)
  237.62 -        cset = revs[rev][0]
  237.63 -    except ValueError:
  237.64 -        cset = r
  237.65 -        matches = [changemap[c] for c in changemap if c.startswith(cset)]
  237.66 -        if len(matches) != 1:
  237.67 -            print >> sys.stderr, 'bad changeset: %r' % r
  237.68 -            sys.exit(1)
  237.69 -        rev = matches[0]
  237.70 -    return rev
  237.71 -
  237.72 -def run(cmd):
  237.73 -    print cmd
  237.74 -    ret = os.system(cmd)
  237.75 -    if ret:
  237.76 -        print >> sys.stderr, 'failure:', cmd
  237.77 -        sys.exit(1)
  237.78 -
  237.79 -omit = map(findrev, omit)
  237.80 -omit.sort()
  237.81 -newrevs = revs[:omit[0]]
  237.82 -tip = len(newrevs) - 1
  237.83 -run('hg clone -q -r%s %r %r' % (tip, srcrepo, destrepo))
  237.84 -    
  237.85 -os.environ['HGMERGE'] = 'true'
  237.86 -
  237.87 -patchdir = tempfile.mkdtemp(prefix='replay.')
  237.88 -try:
  237.89 -    run('hg --cwd %r export --git -o %r%s%%R %d:tip' %
  237.90 -        (srcrepo, patchdir, os.sep, omit[0]+1))
  237.91 -    for rev in xrange(omit[0], len(revs)):
  237.92 -        if rev in omit:
  237.93 -            print 'omit', rev
  237.94 -            newrevs.append((None, revs[rev][1], None))
  237.95 -            continue
  237.96 -        _, p1, p2 = revs[rev]
  237.97 -        np1 = newrevs[p1][1]
  237.98 -        if tip != np1:
  237.99 -            run('hg --cwd %r update -q -C %s' % (destrepo, np1))
 237.100 -        np2 = None
 237.101 -        if p2:
 237.102 -            np2 = newrevs[p2][1]
 237.103 -            run('hg --cwd %r merge -q %s' % (destrepo, np2))
 237.104 -            print >> sys.stderr, 'XXX - cannot handle merges properly yet'
 237.105 -        run('hg --cwd %r import -q -f %r%s%d' % (destrepo, patchdir, os.sep, rev))
 237.106 -        tip = len(newrevs) - 1
 237.107 -        newrevs.append((None, tip, np2))
 237.108 -finally:
 237.109 -    print 'cleaning up ...'
 237.110 -    #shutil.rmtree(patchdir)
   238.1 Binary file htdocs/hgicon.png has changed
   239.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   239.2 +++ b/htdocs/index.en.html	Mon Apr 06 23:15:52 2009 -0700
   239.3 @@ -0,0 +1,51 @@
   239.4 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   239.5 +"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
   239.6 +<html lang="en">
   239.7 +  <head>
   239.8 +    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   239.9 +    <link rel="icon" href="/hgicon.png" type="image/png">
  239.10 +    <meta name="robots" content="index,follow">
  239.11 +    <title>Distributed revision control with Mercurial</title>
  239.12 +  </head>
  239.13 +
  239.14 +  <body>
  239.15 +    <h1>Distributed revision control with Mercurial</h1>
  239.16 +
  239.17 +    <p>Welcome to the home of the book &ldquo;Distributed revision
  239.18 +      control with Mercurial&rdquo;, by <a
  239.19 +      href="http://www.serpentine.com/blog/">Bryan O'Sullivan</a>.
  239.20 +      This is a <a href="hgbookap4.html">freely licensed</a> book
  239.21 +      about the <a
  239.22 +      href="http://www.selenic.com/mercurial">Mercurial</a> revision
  239.23 +      control system.</p>
  239.24 +
  239.25 +    <ul>
  239.26 +      <li>The <a href="hgbook.html">HTML version</a> is split into one
  239.27 +	web page per chapter.</li>
  239.28 +      <li>The <a href="hgbook.pdf">PDF version</a> is a single 1.3
  239.29 +	megabyte file.</li>
  239.30 +      <li>The <a href="http://hg.serpentine.com/mercurial/book">source
  239.31 +	  code</a> is available to the adventurous.</li>
  239.32 +    </ul>
  239.33 +
  239.34 +    <h2>How you can help Mercurial, and help free software</h2>
  239.35 +
  239.36 +    <p>Mercurial is a member of the <a
  239.37 +	href="http://conservancy.softwarefreedom.org/">Software
  239.38 +	Freedom Conservancy</a>, a wonderful non-profit
  239.39 +      organisation that offers its member projects legal and
  239.40 +      administrative advice.  The SFC can accept <a
  239.41 +      href="http://conservancy.softwarefreedom.org/?donate">accept
  239.42 +      donations</a> (tax-free under IRS 501(c)(3), within the United
  239.43 +      States) on behalf of its member projects.  If you would like to
  239.44 +      support Mercurial directly, please consider making a donation to
  239.45 +      the SFC on its behalf.</p>
  239.46 +
  239.47 +    <p>If you would like to help free software developers to provide
  239.48 +      their important public services without being impeded by legal
  239.49 +      issues, please consider donating to the SFC's sister
  239.50 +      organisation, the <a
  239.51 +	href="http://www.softwarefreedom.org/">Software Freedom Law
  239.52 +	Center</a>.</p>
  239.53 +  </body>
  239.54 +</html>
   240.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   240.2 +++ b/htdocs/index.es.html	Mon Apr 06 23:15:52 2009 -0700
   240.3 @@ -0,0 +1,53 @@
   240.4 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   240.5 +"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
   240.6 +<html lang="es">
   240.7 +  <head>
   240.8 +    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   240.9 +    <link rel="icon" href="/hgicon.png" type="image/png">
  240.10 +    <meta name="robots" content="index,follow">
  240.11 +    <title>Control Distribuido de Revisiones con Mercurial</title>
  240.12 +  </head>
  240.13 +
  240.14 +  <body>
  240.15 +    <h1>Control Distribuido de Revisiones con Mercurial</h1>
  240.16 +
  240.17 +    <p>Bienvenido al sito del libro &ldquo;Control Distribuido de Revisiones con Mercurial&rdquo;, en español, 
  240.18 +      por <a href="http://www.serpentine.com/blog/">Bryan O'Sullivan</a>.
  240.19 +      Este libro está cobijado por una <a href="hgbookap4.html">licencia abierta</a>
  240.20 +      y trata del sistema de control de revisiones
  240.21 +      <a href="http://www.selenic.com/mercurial">Mercurial</a>.
  240.22 +
  240.23 +    <p>Los traductores son <a href="http://devnull.li/~jerojasro/blog/">Javier Rojas</a> e
  240.24 +    <a href="http://igor.tamarapatino.org/">Igor Támara</a>. En este sitio usted puede encontrar:
  240.25 +    <ul>
  240.26 +      <li>La <a href="onepage.html">versi&oacute;n HTML</a> una sola página.</li>
  240.27 +      <li>La <a href="hgbook.pdf">versi&oacute;n PDF</a> (1.9 megabytes.)</li>
  240.28 +      <li>El <a href="http://mercurial.intuxication.org/hg/mercurial_book_es/">c&oacute;digo
  240.29 +	fuente</a> de la traducci&oacute;n, si desea revisarla o colaborar con el proyecto. En 
  240.30 +      <a href="http://hg.serpentine.com/mercurial/book">este sitio</a> puede
  240.31 +      encontrar la versi&oacute;n original en ingl&eacute;s.</li>
  240.32 +    </ul>
  240.33 +    Para más detalles acerca del proceso de traducción, por favor vea <a
  240.34 +        href="http://mercurial.intuxication.org/hg/mercurial_book_es/file/tip/es/Leame.1st">este
  240.35 +        fichero</a>.
  240.36 +
  240.37 +    <h2>¿Cómo puede usted ayudar a Mercurial, y el software libre?</h2>
  240.38 +
  240.39 +    <p>Mercurial es miembro del <a
  240.40 +	href="http://conservancy.softwarefreedom.org/">Conservatorio
  240.41 +	de Software Libre</a>, una maravillosa organización sin ánimo
  240.42 +      de lucro que ofrece a sus proyectos miembros consejo legal y
  240.43 +      administrativo.  La SFC acepta <a href="http://conservancy.softwarefreedom.org/?donate">donaciones</a>
  240.44 +      (deducibles de impuestos bajo IRS 501(c)(3), dentro de los Estados Unidos) 
  240.45 +      en representación de sus proyectos miembros.  Si desea dar un apoyo
  240.46 +      directo a Mercurial, por favor considere hacer una donación a SFC 
  240.47 +      en su representación.</p>
  240.48 +
  240.49 +    <p>Si desea apoyar a los desarrolladores de software libre en su
  240.50 +      importante servicio público sin estar impedido por cuestiones
  240.51 +      legales, por favor considere donar a la organización hermana de
  240.52 +      SFC, el <a
  240.53 +	href="http://www.softwarefreedom.org/">Centro de Leyes de Software
  240.54 +	Libre</a>.</p>
  240.55 +  </body>
  240.56 +</html>
   241.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   241.2 +++ b/htdocs/index.html.var	Mon Apr 06 23:15:52 2009 -0700
   241.3 @@ -0,0 +1,7 @@
   241.4 +URI: index.en.html
   241.5 +Content-Language: en
   241.6 +Content-Type: text/html; charset=UTF-8
   241.7 +
   241.8 +URI: index.es.html
   241.9 +Content-Language: es
  241.10 +Content-Type: text/html; charset=UTF-8
   242.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   242.2 +++ b/po/zh.po	Mon Apr 06 23:15:52 2009 -0700
   242.3 @@ -0,0 +1,16376 @@
   242.4 +#
   242.5 +# Simplified Chinese translation for hgbook
   242.6 +# This file is distributed under the same license as the hgbook.
   242.7 +#
   242.8 +# Authors:
   242.9 +# Dongsheng Song <dongsheng.song@gmail.com>, 2009
  242.10 +#
  242.11 +# Check translation:
  242.12 +#    msgfmt --statistics -c -o zh.mo zh.po
  242.13 +#
  242.14 +# Please format your translation before commit:
  242.15 +#    msgcat --sort-by-file --width=80 -o zh_new.po zh.po
  242.16 +#    mv -f zh_new.po zh.po
  242.17 +#
  242.18 +# Dictionary:
  242.19 +# blame             追溯
  242.20 +# branch            分支
  242.21 +# changes           修改
  242.22 +# changeset         修改集
  242.23 +# checkout          检出
  242.24 +# remove            移除(从版本库删除)
  242.25 +# delete            删除(只从文件系统删除)
  242.26 +# filelog           文件日志
  242.27 +# patchset          补丁集
  242.28 +# pushing to        推到
  242.29 +# pulling from      拉自,抓取
  242.30 +# rename            改名
  242.31 +# repository        版本库
  242.32 +# revert            恢复
  242.33 +# revision          版本
  242.34 +# revlog            版本日志
  242.35 +# tag               标签
  242.36 +# tip               顶点
  242.37 +# undo              撤销
  242.38 +# unversioned       未版本控制
  242.39 +# updated           更新到,同步到(适用于旧版本)
  242.40 +# versioned         受版本控制
  242.41 +# working copy      工作副本
  242.42 +# ...
  242.43 +#
  242.44 +msgid ""
  242.45 +msgstr ""
  242.46 +"Project-Id-Version: hgbook 1.2\n"
  242.47 +"POT-Creation-Date: 2009-04-05 11:48+0800\n"
  242.48 +"PO-Revision-Date: 2009-04-05 12:10+0800\n"
  242.49 +"Last-Translator: 宋冬生 <songdonogsheng@live.cn>\n"
  242.50 +"Language-Team: Simplified Chinese <i18n-zh@googlegroups.com >\n"
  242.51 +"MIME-Version: 1.0\n"
  242.52 +"Content-Type: text/plain; charset=UTF-8\n"
  242.53 +"Content-Transfer-Encoding: 8bit\n"
  242.54 +"X-Poedit-Language: Chinese\n"
  242.55 +"X-Poedit-Country: CHINA\n"
  242.56 +"X-Poedit-SourceCharset: utf-8\n"
  242.57 +
  242.58 +#. type: Content of: <book><title>
  242.59 +#: ../en/00book.xml:41
  242.60 +msgid "Mercurial: The Definitive Guide"
  242.61 +msgstr "Mercurial 权威指南"
  242.62 +
  242.63 +#. type: Content of: <book><subtitle>
  242.64 +#: ../en/00book.xml:46
  242.65 +msgid "Compiled from $rev_id$"
  242.66 +msgstr "编译自 $rev_id$"
  242.67 +
  242.68 +#. type: Content of: <book><bookinfo>
  242.69 +#: ../en/00book.xml:48
  242.70 +msgid "<edition>1</edition> <isbn>9780596800673</isbn>"
  242.71 +msgstr "<edition>1</edition> <isbn>9780596800673</isbn>"
  242.72 +
  242.73 +#. type: Content of: <book><bookinfo><authorgroup><author><firstname>
  242.74 +#: ../en/00book.xml:52
  242.75 +msgid "Bryan"
  242.76 +msgstr "Bryan"
  242.77 +
  242.78 +#. type: Content of: <book><bookinfo><authorgroup><author><surname>
  242.79 +#: ../en/00book.xml:53
  242.80 +msgid "O'Sullivan"
  242.81 +msgstr "O'Sullivan"
  242.82 +
  242.83 +#. type: Content of: <book><bookinfo>
  242.84 +#: ../en/00book.xml:57
  242.85 +msgid ""
  242.86 +"<editor> <firstname>Mike</firstname> <surname>Loukides</surname> </editor> "
  242.87 +"<copyright> <year>2006</year> <year>2007</year> <year>2008</year> <year>2009</"
  242.88 +"year> <holder>Bryan O'Sullivan</holder> </copyright>"
  242.89 +msgstr ""
  242.90 +"<editor> <firstname>Mike</firstname> <surname>Loukides</surname> </editor> "
  242.91 +"<copyright> <year>2006</year> <year>2007</year> <year>2008</year> <year>2009</"
  242.92 +"year> <holder>Bryan O'Sullivan</holder> </copyright>"
  242.93 +
  242.94 +#. type: Content of: <book><appendix><title>
  242.95 +#: ../en/appB-mq-ref.xml:5
  242.96 +msgid "Mercurial Queues reference"
  242.97 +msgstr "Mercurial 队列参考"
  242.98 +
  242.99 +#. type: Content of: <book><appendix><sect1><title>
 242.100 +#: ../en/appB-mq-ref.xml:8
 242.101 +msgid "MQ command reference"
 242.102 +msgstr "MQ 命令参考"
 242.103 +
 242.104 +#. type: Content of: <book><appendix><sect1><para>
 242.105 +#: ../en/appB-mq-ref.xml:10
 242.106 +msgid ""
 242.107 +"For an overview of the commands provided by MQ, use the command <command role="
 242.108 +"\"hg-cmd\">hg help mq</command>."
 242.109 +msgstr ""
 242.110 +
 242.111 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.112 +#: ../en/appB-mq-ref.xml:14
 242.113 +msgid ""
 242.114 +"<command role=\"hg-ext-mq\">qapplied</command>&emdash;print applied patches"
 242.115 +msgstr "<command role=\"hg-ext-mq\">qapplied</command>—显示已应用的补丁"
 242.116 +
 242.117 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.118 +#: ../en/appB-mq-ref.xml:17
 242.119 +msgid ""
 242.120 +"The <command role=\"hg-ext-mq\">qapplied</command> command prints the current "
 242.121 +"stack of applied patches.  Patches are printed in oldest-to-newest order, so "
 242.122 +"the last patch in the list is the <quote>top</quote> patch."
 242.123 +msgstr ""
 242.124 +
 242.125 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.126 +#: ../en/appB-mq-ref.xml:24
 242.127 +msgid ""
 242.128 +"<command role=\"hg-ext-mq\">qcommit</command>&emdash;commit changes in the "
 242.129 +"queue repository"
 242.130 +msgstr "<command role=\"hg-ext-mq\">qcommit</command>—提交队列中的修改"
 242.131 +
 242.132 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.133 +#: ../en/appB-mq-ref.xml:27
 242.134 +msgid ""
 242.135 +"The <command role=\"hg-ext-mq\">qcommit</command> command commits any "
 242.136 +"outstanding changes in the <filename role=\"special\" class=\"directory\">.hg/"
 242.137 +"patches</filename> repository.  This command only works if the <filename role="
 242.138 +"\"special\" class=\"directory\">.hg/patches</filename> directory is a "
 242.139 +"repository, i.e. you created the directory using <command role=\"hg-cmd\">hg "
 242.140 +"qinit <option role=\"hg-ext-mq-cmd-qinit-opt\">-c</option></command> or ran "
 242.141 +"<command role=\"hg-cmd\">hg init</command> in the directory after running "
 242.142 +"<command role=\"hg-ext-mq\">qinit</command>."
 242.143 +msgstr ""
 242.144 +
 242.145 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.146 +#: ../en/appB-mq-ref.xml:39
 242.147 +msgid ""
 242.148 +"This command is shorthand for <command role=\"hg-cmd\">hg commit --cwd .hg/"
 242.149 +"patches</command>."
 242.150 +msgstr ""
 242.151 +
 242.152 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.153 +#: ../en/appB-mq-ref.xml:43
 242.154 +msgid ""
 242.155 +"<command role=\"hg-ext-mq\">qdelete</command>&emdash;delete a patch from the "
 242.156 +"<filename role=\"special\">series</filename> file"
 242.157 +msgstr ""
 242.158 +"<command role=\"hg-ext-mq\">qdelete</command>—从文件 <filename role=\"special"
 242.159 +"\">series</filename> 中删除补丁"
 242.160 +
 242.161 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.162 +#: ../en/appB-mq-ref.xml:48
 242.163 +msgid ""
 242.164 +"The <command role=\"hg-ext-mq\">qdelete</command> command removes the entry "
 242.165 +"for a patch from the <filename role=\"special\">series</filename> file in the "
 242.166 +"<filename role=\"special\" class=\"directory\">.hg/patches</filename> "
 242.167 +"directory.  It does not pop the patch if the patch is already applied.  By "
 242.168 +"default, it does not delete the patch file; use the <option role=\"hg-ext-mq-"
 242.169 +"cmd-qdel-opt\">-f</option> option to do that."
 242.170 +msgstr ""
 242.171 +
 242.172 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.173 +#: ../en/appB-mq-ref.xml:57 ../en/appB-mq-ref.xml:99 ../en/appB-mq-ref.xml:157
 242.174 +#: ../en/appB-mq-ref.xml:197 ../en/appB-mq-ref.xml:264
 242.175 +#: ../en/appB-mq-ref.xml:335 ../en/appB-mq-ref.xml:404
 242.176 +#: ../en/appB-mq-ref.xml:497
 242.177 +msgid "Options:"
 242.178 +msgstr "选项:"
 242.179 +
 242.180 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.181 +#: ../en/appB-mq-ref.xml:59
 242.182 +msgid ""
 242.183 +"<option role=\"hg-ext-mq-cmd-qdel-opt\">-f</option>: Delete the patch file."
 242.184 +msgstr ""
 242.185 +
 242.186 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.187 +#: ../en/appB-mq-ref.xml:66
 242.188 +msgid ""
 242.189 +"<command role=\"hg-ext-mq\">qdiff</command>&emdash;print a diff of the "
 242.190 +"topmost applied patch"
 242.191 +msgstr "<command role=\"hg-ext-mq\">qdiff</command>—显示最新应用补丁的差异"
 242.192 +
 242.193 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.194 +#: ../en/appB-mq-ref.xml:69
 242.195 +msgid ""
 242.196 +"The <command role=\"hg-ext-mq\">qdiff</command> command prints a diff of the "
 242.197 +"topmost applied patch. It is equivalent to <command role=\"hg-cmd\">hg diff -"
 242.198 +"r-2:-1</command>."
 242.199 +msgstr ""
 242.200 +
 242.201 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.202 +#: ../en/appB-mq-ref.xml:75
 242.203 +msgid ""
 242.204 +"<command role=\"hg-ext-mq\">qfold</command>&emdash;merge (<quote>fold</"
 242.205 +"quote>) several patches into one"
 242.206 +msgstr ""
 242.207 +"<command role=\"hg-ext-mq\">qfold</command>—将多个补丁合并(<quote>折叠</"
 242.208 +"quote>)成一个"
 242.209 +
 242.210 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.211 +#: ../en/appB-mq-ref.xml:78
 242.212 +msgid ""
 242.213 +"The <command role=\"hg-ext-mq\">qfold</command> command merges multiple "
 242.214 +"patches into the topmost applied patch, so that the topmost applied patch "
 242.215 +"makes the union of all of the changes in the patches in question."
 242.216 +msgstr ""
 242.217 +
 242.218 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.219 +#: ../en/appB-mq-ref.xml:83
 242.220 +msgid ""
 242.221 +"The patches to fold must not be applied; <command role=\"hg-ext-mq\">qfold</"
 242.222 +"command> will exit with an error if any is.  The order in which patches are "
 242.223 +"folded is significant; <command role=\"hg-cmd\">hg qfold a b</command> means "
 242.224 +"<quote>apply the current topmost patch, followed by <literal>a</literal>, "
 242.225 +"followed by <literal>b</literal></quote>."
 242.226 +msgstr ""
 242.227 +
 242.228 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.229 +#: ../en/appB-mq-ref.xml:91
 242.230 +msgid ""
 242.231 +"The comments from the folded patches are appended to the comments of the "
 242.232 +"destination patch, with each block of comments separated by three asterisk "
 242.233 +"(<quote><literal>*</literal></quote>) characters.  Use the <option role=\"hg-"
 242.234 +"ext-mq-cmd-qfold-opt\">-e</option> option to edit the commit message for the "
 242.235 +"combined patch/changeset after the folding has completed."
 242.236 +msgstr ""
 242.237 +
 242.238 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.239 +#: ../en/appB-mq-ref.xml:101
 242.240 +msgid ""
 242.241 +"<option role=\"hg-ext-mq-cmd-qfold-opt\">-e</option>: Edit the commit message "
 242.242 +"and patch description for the newly folded patch."
 242.243 +msgstr ""
 242.244 +
 242.245 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.246 +#: ../en/appB-mq-ref.xml:106
 242.247 +msgid ""
 242.248 +"<option role=\"hg-ext-mq-cmd-qfold-opt\">-l</option>: Use the contents of the "
 242.249 +"given file as the new commit message and patch description for the folded "
 242.250 +"patch."
 242.251 +msgstr ""
 242.252 +
 242.253 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.254 +#: ../en/appB-mq-ref.xml:111
 242.255 +msgid ""
 242.256 +"<option role=\"hg-ext-mq-cmd-qfold-opt\">-m</option>: Use the given text as "
 242.257 +"the new commit message and patch description for the folded patch."
 242.258 +msgstr ""
 242.259 +
 242.260 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.261 +#: ../en/appB-mq-ref.xml:119
 242.262 +msgid ""
 242.263 +"<command role=\"hg-ext-mq\">qheader</command>&emdash;display the header/"
 242.264 +"description of a patch"
 242.265 +msgstr "<command role=\"hg-ext-mq\">qheader</command>—显示补丁头部描述"
 242.266 +
 242.267 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.268 +#: ../en/appB-mq-ref.xml:123
 242.269 +msgid ""
 242.270 +"The <command role=\"hg-ext-mq\">qheader</command> command prints the header, "
 242.271 +"or description, of a patch.  By default, it prints the header of the topmost "
 242.272 +"applied patch. Given an argument, it prints the header of the named patch."
 242.273 +msgstr ""
 242.274 +
 242.275 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.276 +#: ../en/appB-mq-ref.xml:130
 242.277 +msgid ""
 242.278 +"<command role=\"hg-ext-mq\">qimport</command>&emdash;import a third-party "
 242.279 +"patch into the queue"
 242.280 +msgstr "<command role=\"hg-ext-mq\">qimport</command>—将第三方补丁导入队列"
 242.281 +
 242.282 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.283 +#: ../en/appB-mq-ref.xml:133
 242.284 +msgid ""
 242.285 +"The <command role=\"hg-ext-mq\">qimport</command> command adds an entry for "
 242.286 +"an external patch to the <filename role=\"special\">series</filename> file, "
 242.287 +"and copies the patch into the <filename role=\"special\" class=\"directory\">."
 242.288 +"hg/patches</filename> directory.  It adds the entry immediately after the "
 242.289 +"topmost applied patch, but does not push the patch."
 242.290 +msgstr ""
 242.291 +
 242.292 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.293 +#: ../en/appB-mq-ref.xml:141
 242.294 +msgid ""
 242.295 +"If the <filename role=\"special\" class=\"directory\">.hg/patches</filename> "
 242.296 +"directory is a repository, <command role=\"hg-ext-mq\">qimport</command> "
 242.297 +"automatically does an <command role=\"hg-cmd\">hg add</command> of the "
 242.298 +"imported patch."
 242.299 +msgstr ""
 242.300 +
 242.301 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.302 +#: ../en/appB-mq-ref.xml:149
 242.303 +msgid ""
 242.304 +"<command role=\"hg-ext-mq\">qinit</command>&emdash;prepare a repository to "
 242.305 +"work with MQ"
 242.306 +msgstr "<command role=\"hg-ext-mq\">qinit</command>—为使用 MQ 配置版本库"
 242.307 +
 242.308 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.309 +#: ../en/appB-mq-ref.xml:152
 242.310 +msgid ""
 242.311 +"The <command role=\"hg-ext-mq\">qinit</command> command prepares a repository "
 242.312 +"to work with MQ.  It creates a directory called <filename role=\"special\" "
 242.313 +"class=\"directory\">.hg/patches</filename>."
 242.314 +msgstr ""
 242.315 +
 242.316 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.317 +#: ../en/appB-mq-ref.xml:159
 242.318 +msgid ""
 242.319 +"<option role=\"hg-ext-mq-cmd-qinit-opt\">-c</option>: Create <filename role="
 242.320 +"\"special\" class=\"directory\">.hg/patches</filename> as a repository in its "
 242.321 +"own right.  Also creates a <filename role=\"special\">.hgignore</filename> "
 242.322 +"file that will ignore the <filename role=\"special\">status</filename> file."
 242.323 +msgstr ""
 242.324 +
 242.325 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.326 +#: ../en/appB-mq-ref.xml:169
 242.327 +msgid ""
 242.328 +"When the <filename role=\"special\" class=\"directory\">.hg/patches</"
 242.329 +"filename> directory is a repository, the <command role=\"hg-ext-mq\">qimport</"
 242.330 +"command> and <command role=\"hg-ext-mq\">qnew</command> commands "
 242.331 +"automatically <command role=\"hg-cmd\">hg add</command> new patches."
 242.332 +msgstr ""
 242.333 +
 242.334 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.335 +#: ../en/appB-mq-ref.xml:178
 242.336 +msgid "<command role=\"hg-ext-mq\">qnew</command>&emdash;create a new patch"
 242.337 +msgstr "<command role=\"hg-ext-mq\">qnew</command>—创建新补丁"
 242.338 +
 242.339 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.340 +#: ../en/appB-mq-ref.xml:181
 242.341 +msgid ""
 242.342 +"The <command role=\"hg-ext-mq\">qnew</command> command creates a new patch.  "
 242.343 +"It takes one mandatory argument, the name to use for the patch file.  The "
 242.344 +"newly created patch is created empty by default.  It is added to the "
 242.345 +"<filename role=\"special\">series</filename> file after the current topmost "
 242.346 +"applied patch, and is immediately pushed on top of that patch."
 242.347 +msgstr ""
 242.348 +
 242.349 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.350 +#: ../en/appB-mq-ref.xml:189
 242.351 +msgid ""
 242.352 +"If <command role=\"hg-ext-mq\">qnew</command> finds modified files in the "
 242.353 +"working directory, it will refuse to create a new patch unless the <option "
 242.354 +"role=\"hg-ext-mq-cmd-qnew-opt\">-f</option> option is used (see below).  This "
 242.355 +"behaviour allows you to <command role=\"hg-ext-mq\">qrefresh</command> your "
 242.356 +"topmost applied patch before you apply a new patch on top of it."
 242.357 +msgstr ""
 242.358 +
 242.359 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.360 +#: ../en/appB-mq-ref.xml:199
 242.361 +msgid ""
 242.362 +"<option role=\"hg-ext-mq-cmd-qnew-opt\">-f</option>: Create a new patch if "
 242.363 +"the contents of the working directory are modified.  Any outstanding "
 242.364 +"modifications are added to the newly created patch, so after this command "
 242.365 +"completes, the working directory will no longer be modified."
 242.366 +msgstr ""
 242.367 +
 242.368 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.369 +#: ../en/appB-mq-ref.xml:206
 242.370 +msgid ""
 242.371 +"<option role=\"hg-ext-mq-cmd-qnew-opt\">-m</option>: Use the given text as "
 242.372 +"the commit message. This text will be stored at the beginning of the patch "
 242.373 +"file, before the patch data."
 242.374 +msgstr ""
 242.375 +
 242.376 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.377 +#: ../en/appB-mq-ref.xml:215
 242.378 +msgid ""
 242.379 +"<command role=\"hg-ext-mq\">qnext</command>&emdash;print the name of the next "
 242.380 +"patch"
 242.381 +msgstr "<command role=\"hg-ext-mq\">qnext</command>—显示下个补丁的名称"
 242.382 +
 242.383 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.384 +#: ../en/appB-mq-ref.xml:218
 242.385 +msgid ""
 242.386 +"The <command role=\"hg-ext-mq\">qnext</command> command prints the name name "
 242.387 +"of the next patch in the <filename role=\"special\">series</filename> file "
 242.388 +"after the topmost applied patch.  This patch will become the topmost applied "
 242.389 +"patch if you run <command role=\"hg-ext-mq\">qpush</command>."
 242.390 +msgstr ""
 242.391 +
 242.392 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.393 +#: ../en/appB-mq-ref.xml:227
 242.394 +msgid ""
 242.395 +"<command role=\"hg-ext-mq\">qpop</command>&emdash;pop patches off the stack"
 242.396 +msgstr "<command role=\"hg-ext-mq\">qpop</command>—删除堆栈顶部的补丁"
 242.397 +
 242.398 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.399 +#: ../en/appB-mq-ref.xml:230
 242.400 +msgid ""
 242.401 +"The <command role=\"hg-ext-mq\">qpop</command> command removes applied "
 242.402 +"patches from the top of the stack of applied patches.  By default, it removes "
 242.403 +"only one patch."
 242.404 +msgstr ""
 242.405 +
 242.406 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.407 +#: ../en/appB-mq-ref.xml:234
 242.408 +msgid ""
 242.409 +"This command removes the changesets that represent the popped patches from "
 242.410 +"the repository, and updates the working directory to undo the effects of the "
 242.411 +"patches."
 242.412 +msgstr ""
 242.413 +
 242.414 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.415 +#: ../en/appB-mq-ref.xml:238
 242.416 +msgid ""
 242.417 +"This command takes an optional argument, which it uses as the name or index "
 242.418 +"of the patch to pop to.  If given a name, it will pop patches until the named "
 242.419 +"patch is the topmost applied patch.  If given a number, <command role=\"hg-"
 242.420 +"ext-mq\">qpop</command> treats the number as an index into the entries in the "
 242.421 +"series file, counting from zero (empty lines and lines containing only "
 242.422 +"comments do not count).  It pops patches until the patch identified by the "
 242.423 +"given index is the topmost applied patch."
 242.424 +msgstr ""
 242.425 +
 242.426 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.427 +#: ../en/appB-mq-ref.xml:248
 242.428 +msgid ""
 242.429 +"The <command role=\"hg-ext-mq\">qpop</command> command does not read or write "
 242.430 +"patches or the <filename role=\"special\">series</filename> file.  It is thus "
 242.431 +"safe to <command role=\"hg-ext-mq\">qpop</command> a patch that you have "
 242.432 +"removed from the <filename role=\"special\">series</filename> file, or a "
 242.433 +"patch that you have renamed or deleted entirely.  In the latter two cases, "
 242.434 +"use the name of the patch as it was when you applied it."
 242.435 +msgstr ""
 242.436 +
 242.437 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.438 +#: ../en/appB-mq-ref.xml:257
 242.439 +msgid ""
 242.440 +"By default, the <command role=\"hg-ext-mq\">qpop</command> command will not "
 242.441 +"pop any patches if the working directory has been modified.  You can override "
 242.442 +"this behaviour using the <option role=\"hg-ext-mq-cmd-qpop-opt\">-f</option> "
 242.443 +"option, which reverts all modifications in the working directory."
 242.444 +msgstr ""
 242.445 +
 242.446 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.447 +#: ../en/appB-mq-ref.xml:266
 242.448 +msgid ""
 242.449 +"<option role=\"hg-ext-mq-cmd-qpop-opt\">-a</option>: Pop all applied "
 242.450 +"patches.  This returns the repository to its state before you applied any "
 242.451 +"patches."
 242.452 +msgstr ""
 242.453 +
 242.454 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.455 +#: ../en/appB-mq-ref.xml:271
 242.456 +msgid ""
 242.457 +"<option role=\"hg-ext-mq-cmd-qpop-opt\">-f</option>: Forcibly revert any "
 242.458 +"modifications to the working directory when popping."
 242.459 +msgstr ""
 242.460 +
 242.461 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.462 +#: ../en/appB-mq-ref.xml:276
 242.463 +msgid ""
 242.464 +"<option role=\"hg-ext-mq-cmd-qpop-opt\">-n</option>: Pop a patch from the "
 242.465 +"named queue."
 242.466 +msgstr ""
 242.467 +
 242.468 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.469 +#: ../en/appB-mq-ref.xml:281
 242.470 +msgid ""
 242.471 +"The <command role=\"hg-ext-mq\">qpop</command> command removes one line from "
 242.472 +"the end of the <filename role=\"special\">status</filename> file for each "
 242.473 +"patch that it pops."
 242.474 +msgstr ""
 242.475 +
 242.476 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.477 +#: ../en/appB-mq-ref.xml:288
 242.478 +msgid ""
 242.479 +"<command role=\"hg-ext-mq\">qprev</command>&emdash;print the name of the "
 242.480 +"previous patch"
 242.481 +msgstr "<command role=\"hg-ext-mq\">qprev</command>—显示上个补丁的名称"
 242.482 +
 242.483 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.484 +#: ../en/appB-mq-ref.xml:291
 242.485 +msgid ""
 242.486 +"The <command role=\"hg-ext-mq\">qprev</command> command prints the name of "
 242.487 +"the patch in the <filename role=\"special\">series</filename> file that comes "
 242.488 +"before the topmost applied patch. This will become the topmost applied patch "
 242.489 +"if you run <command role=\"hg-ext-mq\">qpop</command>."
 242.490 +msgstr ""
 242.491 +
 242.492 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.493 +#: ../en/appB-mq-ref.xml:300
 242.494 +msgid ""
 242.495 +"<command role=\"hg-ext-mq\">qpush</command>&emdash;push patches onto the stack"
 242.496 +msgstr "<command role=\"hg-ext-mq\">qpush</command>—增加补丁到堆栈"
 242.497 +
 242.498 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.499 +#: ../en/appB-mq-ref.xml:303
 242.500 +msgid ""
 242.501 +"The <command role=\"hg-ext-mq\">qpush</command> command adds patches onto the "
 242.502 +"applied stack.  By default, it adds only one patch."
 242.503 +msgstr ""
 242.504 +
 242.505 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.506 +#: ../en/appB-mq-ref.xml:307
 242.507 +msgid ""
 242.508 +"This command creates a new changeset to represent each applied patch, and "
 242.509 +"updates the working directory to apply the effects of the patches."
 242.510 +msgstr ""
 242.511 +
 242.512 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.513 +#: ../en/appB-mq-ref.xml:311
 242.514 +msgid "The default data used when creating a changeset are as follows:"
 242.515 +msgstr ""
 242.516 +
 242.517 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.518 +#: ../en/appB-mq-ref.xml:314
 242.519 +msgid ""
 242.520 +"The commit date and time zone are the current date and time zone.  Because "
 242.521 +"these data are used to compute the identity of a changeset, this means that "
 242.522 +"if you <command role=\"hg-ext-mq\">qpop</command> a patch and <command role="
 242.523 +"\"hg-ext-mq\">qpush</command> it again, the changeset that you push will have "
 242.524 +"a different identity than the changeset you popped."
 242.525 +msgstr ""
 242.526 +
 242.527 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.528 +#: ../en/appB-mq-ref.xml:322
 242.529 +msgid ""
 242.530 +"The author is the same as the default used by the <command role=\"hg-cmd\">hg "
 242.531 +"commit</command> command."
 242.532 +msgstr ""
 242.533 +
 242.534 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.535 +#: ../en/appB-mq-ref.xml:326
 242.536 +msgid ""
 242.537 +"The commit message is any text from the patch file that comes before the "
 242.538 +"first diff header.  If there is no such text, a default commit message is "
 242.539 +"used that identifies the name of the patch."
 242.540 +msgstr ""
 242.541 +
 242.542 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.543 +#: ../en/appB-mq-ref.xml:331
 242.544 +msgid ""
 242.545 +"If a patch contains a Mercurial patch header (XXX add link), the information "
 242.546 +"in the patch header overrides these defaults."
 242.547 +msgstr ""
 242.548 +
 242.549 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.550 +#: ../en/appB-mq-ref.xml:337
 242.551 +msgid ""
 242.552 +"<option role=\"hg-ext-mq-cmd-qpush-opt\">-a</option>: Push all unapplied "
 242.553 +"patches from the <filename role=\"special\">series</filename> file until "
 242.554 +"there are none left to push."
 242.555 +msgstr ""
 242.556 +
 242.557 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.558 +#: ../en/appB-mq-ref.xml:343
 242.559 +msgid ""
 242.560 +"<option role=\"hg-ext-mq-cmd-qpush-opt\">-l</option>: Add the name of the "
 242.561 +"patch to the end of the commit message."
 242.562 +msgstr ""
 242.563 +
 242.564 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.565 +#: ../en/appB-mq-ref.xml:347
 242.566 +msgid ""
 242.567 +"<option role=\"hg-ext-mq-cmd-qpush-opt\">-m</option>: If a patch fails to "
 242.568 +"apply cleanly, use the entry for the patch in another saved queue to compute "
 242.569 +"the parameters for a three-way merge, and perform a three-way merge using the "
 242.570 +"normal Mercurial merge machinery.  Use the resolution of the merge as the new "
 242.571 +"patch content."
 242.572 +msgstr ""
 242.573 +
 242.574 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.575 +#: ../en/appB-mq-ref.xml:355
 242.576 +msgid ""
 242.577 +"<option role=\"hg-ext-mq-cmd-qpush-opt\">-n</option>: Use the named queue if "
 242.578 +"merging while pushing."
 242.579 +msgstr ""
 242.580 +
 242.581 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.582 +#: ../en/appB-mq-ref.xml:360
 242.583 +msgid ""
 242.584 +"The <command role=\"hg-ext-mq\">qpush</command> command reads, but does not "
 242.585 +"modify, the <filename role=\"special\">series</filename> file.  It appends "
 242.586 +"one line to the <command role=\"hg-cmd\">hg status</command> file for each "
 242.587 +"patch that it pushes."
 242.588 +msgstr ""
 242.589 +
 242.590 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.591 +#: ../en/appB-mq-ref.xml:368
 242.592 +msgid ""
 242.593 +"<command role=\"hg-ext-mq\">qrefresh</command>&emdash;update the topmost "
 242.594 +"applied patch"
 242.595 +msgstr "<command role=\"hg-ext-mq\">qrefresh</command>—更新最新的补丁"
 242.596 +
 242.597 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.598 +#: ../en/appB-mq-ref.xml:372
 242.599 +msgid ""
 242.600 +"The <command role=\"hg-ext-mq\">qrefresh</command> command updates the "
 242.601 +"topmost applied patch.  It modifies the patch, removes the old changeset that "
 242.602 +"represented the patch, and creates a new changeset to represent the modified "
 242.603 +"patch."
 242.604 +msgstr ""
 242.605 +
 242.606 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.607 +#: ../en/appB-mq-ref.xml:378
 242.608 +msgid ""
 242.609 +"The <command role=\"hg-ext-mq\">qrefresh</command> command looks for the "
 242.610 +"following modifications:"
 242.611 +msgstr ""
 242.612 +
 242.613 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.614 +#: ../en/appB-mq-ref.xml:381
 242.615 +msgid ""
 242.616 +"Changes to the commit message, i.e. the text before the first diff header in "
 242.617 +"the patch file, are reflected in the new changeset that represents the patch."
 242.618 +msgstr ""
 242.619 +
 242.620 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.621 +#: ../en/appB-mq-ref.xml:386
 242.622 +msgid ""
 242.623 +"Modifications to tracked files in the working directory are added to the "
 242.624 +"patch."
 242.625 +msgstr ""
 242.626 +
 242.627 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.628 +#: ../en/appB-mq-ref.xml:389
 242.629 +msgid ""
 242.630 +"Changes to the files tracked using <command role=\"hg-cmd\">hg add</command>, "
 242.631 +"<command role=\"hg-cmd\">hg copy</command>, <command role=\"hg-cmd\">hg "
 242.632 +"remove</command>, or <command role=\"hg-cmd\">hg rename</command>.  Added "
 242.633 +"files and copy and rename destinations are added to the patch, while removed "
 242.634 +"files and rename sources are removed."
 242.635 +msgstr ""
 242.636 +
 242.637 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.638 +#: ../en/appB-mq-ref.xml:398
 242.639 +msgid ""
 242.640 +"Even if <command role=\"hg-ext-mq\">qrefresh</command> detects no changes, it "
 242.641 +"still recreates the changeset that represents the patch.  This causes the "
 242.642 +"identity of the changeset to differ from the previous changeset that "
 242.643 +"identified the patch."
 242.644 +msgstr ""
 242.645 +
 242.646 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.647 +#: ../en/appB-mq-ref.xml:406
 242.648 +msgid ""
 242.649 +"<option role=\"hg-ext-mq-cmd-qrefresh-opt\">-e</option>: Modify the commit "
 242.650 +"and patch description, using the preferred text editor."
 242.651 +msgstr ""
 242.652 +
 242.653 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.654 +#: ../en/appB-mq-ref.xml:411
 242.655 +msgid ""
 242.656 +"<option role=\"hg-ext-mq-cmd-qrefresh-opt\">-m</option>: Modify the commit "
 242.657 +"message and patch description, using the given text."
 242.658 +msgstr ""
 242.659 +
 242.660 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.661 +#: ../en/appB-mq-ref.xml:416
 242.662 +msgid ""
 242.663 +"<option role=\"hg-ext-mq-cmd-qrefresh-opt\">-l</option>: Modify the commit "
 242.664 +"message and patch description, using text from the given file."
 242.665 +msgstr ""
 242.666 +
 242.667 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.668 +#: ../en/appB-mq-ref.xml:424
 242.669 +msgid "<command role=\"hg-ext-mq\">qrename</command>&emdash;rename a patch"
 242.670 +msgstr "<command role=\"hg-ext-mq\">qrename</command>—改名补丁"
 242.671 +
 242.672 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.673 +#: ../en/appB-mq-ref.xml:427
 242.674 +msgid ""
 242.675 +"The <command role=\"hg-ext-mq\">qrename</command> command renames a patch, "
 242.676 +"and changes the entry for the patch in the <filename role=\"special\">series</"
 242.677 +"filename> file."
 242.678 +msgstr ""
 242.679 +
 242.680 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.681 +#: ../en/appB-mq-ref.xml:431
 242.682 +msgid ""
 242.683 +"With a single argument, <command role=\"hg-ext-mq\">qrename</command> renames "
 242.684 +"the topmost applied patch.  With two arguments, it renames its first argument "
 242.685 +"to its second."
 242.686 +msgstr ""
 242.687 +
 242.688 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.689 +#: ../en/appB-mq-ref.xml:438
 242.690 +msgid ""
 242.691 +"<command role=\"hg-ext-mq\">qrestore</command>&emdash;restore saved queue "
 242.692 +"state"
 242.693 +msgstr "<command role=\"hg-ext-mq\">qrestore</command>—恢复保存的队列"
 242.694 +
 242.695 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.696 +#: ../en/appB-mq-ref.xml:442
 242.697 +msgid "XXX No idea what this does."
 242.698 +msgstr ""
 242.699 +
 242.700 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.701 +#: ../en/appB-mq-ref.xml:446
 242.702 +msgid ""
 242.703 +"<command role=\"hg-ext-mq\">qsave</command>&emdash;save current queue state"
 242.704 +msgstr "<command role=\"hg-ext-mq\">qsave</command>—保存当前的队列状态"
 242.705 +
 242.706 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.707 +#: ../en/appB-mq-ref.xml:449
 242.708 +msgid "XXX Likewise."
 242.709 +msgstr ""
 242.710 +
 242.711 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.712 +#: ../en/appB-mq-ref.xml:453
 242.713 +msgid ""
 242.714 +"<command role=\"hg-ext-mq\">qseries</command>&emdash;print the entire patch "
 242.715 +"series"
 242.716 +msgstr "<command role=\"hg-ext-mq\">qseries</command>—显示补丁序列"
 242.717 +
 242.718 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.719 +#: ../en/appB-mq-ref.xml:456
 242.720 +msgid ""
 242.721 +"The <command role=\"hg-ext-mq\">qseries</command> command prints the entire "
 242.722 +"patch series from the <filename role=\"special\">series</filename> file.  It "
 242.723 +"prints only patch names, not empty lines or comments.  It prints in order "
 242.724 +"from first to be applied to last."
 242.725 +msgstr ""
 242.726 +
 242.727 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.728 +#: ../en/appB-mq-ref.xml:464
 242.729 +msgid ""
 242.730 +"<command role=\"hg-ext-mq\">qtop</command>&emdash;print the name of the "
 242.731 +"current patch"
 242.732 +msgstr "<command role=\"hg-ext-mq\">qtop</command>—显示当前补丁的名称"
 242.733 +
 242.734 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.735 +#: ../en/appB-mq-ref.xml:467
 242.736 +msgid ""
 242.737 +"The <command role=\"hg-ext-mq\">qtop</command> prints the name of the topmost "
 242.738 +"currently applied patch."
 242.739 +msgstr ""
 242.740 +
 242.741 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.742 +#: ../en/appB-mq-ref.xml:472
 242.743 +msgid ""
 242.744 +"<command role=\"hg-ext-mq\">qunapplied</command>&emdash;print patches not yet "
 242.745 +"applied"
 242.746 +msgstr "<command role=\"hg-ext-mq\">qunapplied</command>—显示尚未应用的补丁"
 242.747 +
 242.748 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.749 +#: ../en/appB-mq-ref.xml:476
 242.750 +msgid ""
 242.751 +"The <command role=\"hg-ext-mq\">qunapplied</command> command prints the names "
 242.752 +"of patches from the <filename role=\"special\">series</filename> file that "
 242.753 +"are not yet applied.  It prints them in order from the next patch that will "
 242.754 +"be pushed to the last."
 242.755 +msgstr ""
 242.756 +
 242.757 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.758 +#: ../en/appB-mq-ref.xml:484
 242.759 +msgid ""
 242.760 +"<command role=\"hg-cmd\">hg strip</command>&emdash;remove a revision and "
 242.761 +"descendants"
 242.762 +msgstr "<command role=\"hg-cmd\">hg strip</command>—删除一个版本及其后继"
 242.763 +
 242.764 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.765 +#: ../en/appB-mq-ref.xml:487
 242.766 +msgid ""
 242.767 +"The <command role=\"hg-cmd\">hg strip</command> command removes a revision, "
 242.768 +"and all of its descendants, from the repository.  It undoes the effects of "
 242.769 +"the removed revisions from the repository, and updates the working directory "
 242.770 +"to the first parent of the removed revision."
 242.771 +msgstr ""
 242.772 +
 242.773 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.774 +#: ../en/appB-mq-ref.xml:493
 242.775 +msgid ""
 242.776 +"The <command role=\"hg-cmd\">hg strip</command> command saves a backup of the "
 242.777 +"removed changesets in a bundle, so that they can be reapplied if removed in "
 242.778 +"error."
 242.779 +msgstr ""
 242.780 +
 242.781 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.782 +#: ../en/appB-mq-ref.xml:499
 242.783 +msgid ""
 242.784 +"<option role=\"hg-opt-strip\">-b</option>: Save unrelated changesets that are "
 242.785 +"intermixed with the stripped changesets in the backup bundle."
 242.786 +msgstr ""
 242.787 +
 242.788 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.789 +#: ../en/appB-mq-ref.xml:503
 242.790 +msgid ""
 242.791 +"<option role=\"hg-opt-strip\">-f</option>: If a branch has multiple heads, "
 242.792 +"remove all heads. XXX This should be renamed, and use <literal>-f</literal> "
 242.793 +"to strip revs when there are pending changes."
 242.794 +msgstr ""
 242.795 +
 242.796 +#. type: Content of: <book><appendix><sect1><sect2><itemizedlist><listitem><para>
 242.797 +#: ../en/appB-mq-ref.xml:508
 242.798 +msgid "<option role=\"hg-opt-strip\">-n</option>: Do not save a backup bundle."
 242.799 +msgstr ""
 242.800 +
 242.801 +#. type: Content of: <book><appendix><sect1><title>
 242.802 +#: ../en/appB-mq-ref.xml:515
 242.803 +msgid "MQ file reference"
 242.804 +msgstr "MQ 文件参考"
 242.805 +
 242.806 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.807 +#: ../en/appB-mq-ref.xml:518
 242.808 +msgid "The <filename role=\"special\">series</filename> file"
 242.809 +msgstr "<filename role=\"special\">序列</filename>文件"
 242.810 +
 242.811 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.812 +#: ../en/appB-mq-ref.xml:521
 242.813 +msgid ""
 242.814 +"The <filename role=\"special\">series</filename> file contains a list of the "
 242.815 +"names of all patches that MQ can apply.  It is represented as a list of "
 242.816 +"names, with one name saved per line.  Leading and trailing white space in "
 242.817 +"each line are ignored."
 242.818 +msgstr ""
 242.819 +
 242.820 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.821 +#: ../en/appB-mq-ref.xml:527
 242.822 +msgid ""
 242.823 +"Lines may contain comments.  A comment begins with the <quote><literal>#</"
 242.824 +"literal></quote> character, and extends to the end of the line.  Empty lines, "
 242.825 +"and lines that contain only comments, are ignored."
 242.826 +msgstr ""
 242.827 +
 242.828 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.829 +#: ../en/appB-mq-ref.xml:532
 242.830 +msgid ""
 242.831 +"You will often need to edit the <filename role=\"special\">series</filename> "
 242.832 +"file by hand, hence the support for comments and empty lines noted above.  "
 242.833 +"For example, you can comment out a patch temporarily, and <command role=\"hg-"
 242.834 +"ext-mq\">qpush</command> will skip over that patch when applying patches.  "
 242.835 +"You can also change the order in which patches are applied by reordering "
 242.836 +"their entries in the <filename role=\"special\">series</filename> file."
 242.837 +msgstr ""
 242.838 +
 242.839 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.840 +#: ../en/appB-mq-ref.xml:541
 242.841 +msgid ""
 242.842 +"Placing the <filename role=\"special\">series</filename> file under revision "
 242.843 +"control is also supported; it is a good idea to place all of the patches that "
 242.844 +"it refers to under revision control, as well.  If you create a patch "
 242.845 +"directory using the <option role=\"hg-ext-mq-cmd-qinit-opt\">-c</option> "
 242.846 +"option to <command role=\"hg-ext-mq\">qinit</command>, this will be done for "
 242.847 +"you automatically."
 242.848 +msgstr ""
 242.849 +
 242.850 +#. type: Content of: <book><appendix><sect1><sect2><title>
 242.851 +#: ../en/appB-mq-ref.xml:551
 242.852 +msgid "The <filename role=\"special\">status</filename> file"
 242.853 +msgstr "<filename role=\"special\">状态</filename>文件"
 242.854 +
 242.855 +#. type: Content of: <book><appendix><sect1><sect2><para>
 242.856 +#: ../en/appB-mq-ref.xml:554
 242.857 +msgid ""
 242.858 +"The <filename role=\"special\">status</filename> file contains the names and "
 242.859 +"changeset hashes of all patches that MQ currently has applied.  Unlike the "
 242.860 +"<filename role=\"special\">series</filename> file, this file is not intended "
 242.861 +"for editing.  You should not place this file under revision control, or "
 242.862 +"modify it in any way.  It is used by MQ strictly for internal book-keeping."
 242.863 +msgstr ""
 242.864 +
 242.865 +#. type: Content of: <book><appendix><title>
 242.866 +#: ../en/appC-srcinstall.xml:5
 242.867 +msgid "Installing Mercurial from source"
 242.868 +msgstr "从源代码安装 Mercurial"
 242.869 +
 242.870 +#. type: Content of: <book><appendix><sect1><title>
 242.871 +#: ../en/appC-srcinstall.xml:8
 242.872 +msgid "On a Unix-like system"
 242.873 +msgstr "类 Unix 系统"
 242.874 +
 242.875 +#. type: Content of: <book><appendix><sect1><para>
 242.876 +#: ../en/appC-srcinstall.xml:10
 242.877 +msgid ""
 242.878 +"If you are using a Unix-like system that has a sufficiently recent version of "
 242.879 +"Python (2.3 or newer) available, it is easy to install Mercurial from source."
 242.880 +msgstr ""
 242.881 +
 242.882 +#. type: Content of: <book><appendix><sect1><orderedlist><listitem><para>
 242.883 +#: ../en/appC-srcinstall.xml:14
 242.884 +msgid ""
 242.885 +"Download a recent source tarball from <ulink url=\"http://www.selenic.com/"
 242.886 +"mercurial/download\">http://www.selenic.com/mercurial/download</ulink>."
 242.887 +msgstr ""
 242.888 +
 242.889 +#. type: Content of: <book><appendix><sect1><orderedlist><listitem><para>
 242.890 +#: ../en/appC-srcinstall.xml:17
 242.891 +msgid "Unpack the tarball:"
 242.892 +msgstr ""
 242.893 +
 242.894 +#. type: Content of: <book><appendix><sect1><orderedlist><listitem><para>
 242.895 +#: ../en/appC-srcinstall.xml:20
 242.896 +msgid ""
 242.897 +"Go into the source directory and run the installer script.  This will build "
 242.898 +"Mercurial and install it in your home directory."
 242.899 +msgstr ""
 242.900 +
 242.901 +#. type: Content of: <book><appendix><sect1><para>
 242.902 +#: ../en/appC-srcinstall.xml:27
 242.903 +msgid ""
 242.904 +"Once the install finishes, Mercurial will be in the <literal>bin</literal> "
 242.905 +"subdirectory of your home directory.  Don't forget to make sure that this "
 242.906 +"directory is present in your shell's search path."
 242.907 +msgstr ""
 242.908 +
 242.909 +#. type: Content of: <book><appendix><sect1><para>
 242.910 +#: ../en/appC-srcinstall.xml:32
 242.911 +msgid ""
 242.912 +"You will probably need to set the <envar>PYTHONPATH</envar> environment "
 242.913 +"variable so that the Mercurial executable can find the rest of the Mercurial "
 242.914 +"packages.  For example, on my laptop, I have set it to <literal>/home/bos/lib/"
 242.915 +"python</literal>.  The exact path that you will need to use depends on how "
 242.916 +"Python was built for your system, but should be easy to figure out.  If "
 242.917 +"you're uncertain, look through the output of the installer script above, and "
 242.918 +"see where the contents of the <literal>mercurial</literal> directory were "
 242.919 +"installed to."
 242.920 +msgstr ""
 242.921 +
 242.922 +#. type: Content of: <book><appendix><sect1><title>
 242.923 +#: ../en/appC-srcinstall.xml:44
 242.924 +msgid "On Windows"
 242.925 +msgstr "Windows 系统"
 242.926 +
 242.927 +#. type: Content of: <book><appendix><sect1><para>
 242.928 +#: ../en/appC-srcinstall.xml:46
 242.929 +msgid ""
 242.930 +"Building and installing Mercurial on Windows requires a variety of tools, a "
 242.931 +"fair amount of technical knowledge, and considerable patience.  I very much "
 242.932 +"<emphasis>do not recommend</emphasis> this route if you are a <quote>casual "
 242.933 +"user</quote>.  Unless you intend to hack on Mercurial, I strongly suggest "
 242.934 +"that you use a binary package instead."
 242.935 +msgstr ""
 242.936 +
 242.937 +#. type: Content of: <book><appendix><sect1><para>
 242.938 +#: ../en/appC-srcinstall.xml:53
 242.939 +msgid ""
 242.940 +"If you are intent on building Mercurial from source on Windows, follow the "
 242.941 +"<quote>hard way</quote> directions on the Mercurial wiki at <ulink url="
 242.942 +"\"http://www.selenic.com/mercurial/wiki/index.cgi/WindowsInstall\">http://www."
 242.943 +"selenic.com/mercurial/wiki/index.cgi/WindowsInstall</ulink>, and expect the "
 242.944 +"process to involve a lot of fiddly work."
 242.945 +msgstr ""
 242.946 +
 242.947 +#. type: Content of: <book><appendix><title>
 242.948 +#: ../en/appD-license.xml:5
 242.949 +msgid "Open Publication License"
 242.950 +msgstr ""
 242.951 +
 242.952 +#. type: Content of: <book><appendix><para>
 242.953 +#: ../en/appD-license.xml:7
 242.954 +msgid "Version 1.0, 8 June 1999"
 242.955 +msgstr ""
 242.956 +
 242.957 +#. type: Content of: <book><appendix><sect1><title>
 242.958 +#: ../en/appD-license.xml:10
 242.959 +msgid "Requirements on both unmodified and modified versions"
 242.960 +msgstr ""
 242.961 +
 242.962 +#. type: Content of: <book><appendix><sect1><para>
 242.963 +#: ../en/appD-license.xml:13
 242.964 +msgid ""
 242.965 +"The Open Publication works may be reproduced and distributed in whole or in "
 242.966 +"part, in any medium physical or electronic, provided that the terms of this "
 242.967 +"license are adhered to, and that this license or an incorporation of it by "
 242.968 +"reference (with any options elected by the author(s) and/or publisher) is "
 242.969 +"displayed in the reproduction."
 242.970 +msgstr ""
 242.971 +
 242.972 +#. type: Content of: <book><appendix><sect1><para>
 242.973 +#: ../en/appD-license.xml:20
 242.974 +msgid "Proper form for an incorporation by reference is as follows:"
 242.975 +msgstr ""
 242.976 +
 242.977 +#. type: Content of: <book><appendix><sect1><blockquote><para>
 242.978 +#: ../en/appD-license.xml:24
 242.979 +msgid ""
 242.980 +"Copyright (c) <emphasis>year</emphasis> by <emphasis>author's name or "
 242.981 +"designee</emphasis>. This material may be distributed only subject to the "
 242.982 +"terms and conditions set forth in the Open Publication License, v<emphasis>x."
 242.983 +"y</emphasis> or later (the latest version is presently available at <ulink "
 242.984 +"url=\"http://www.opencontent.org/openpub/\">http://www.opencontent.org/"
 242.985 +"openpub/</ulink>)."
 242.986 +msgstr ""
 242.987 +
 242.988 +#. type: Content of: <book><appendix><sect1><para>
 242.989 +#: ../en/appD-license.xml:33
 242.990 +msgid ""
 242.991 +"The reference must be immediately followed with any options elected by the "
 242.992 +"author(s) and/or publisher of the document (see <xref linkend=\"sec:opl:"
 242.993 +"options\"/>)."
 242.994 +msgstr ""
 242.995 +
 242.996 +#. type: Content of: <book><appendix><sect1><para>
 242.997 +#: ../en/appD-license.xml:37
 242.998 +msgid ""
 242.999 +"Commercial redistribution of Open Publication-licensed material is permitted."
242.1000 +msgstr ""
242.1001 +
242.1002 +#. type: Content of: <book><appendix><sect1><para>
242.1003 +#: ../en/appD-license.xml:40
242.1004 +msgid ""
242.1005 +"Any publication in standard (paper) book form shall require the citation of "
242.1006 +"the original publisher and author. The publisher and author's names shall "
242.1007 +"appear on all outer surfaces of the book. On all outer surfaces of the book "
242.1008 +"the original publisher's name shall be as large as the title of the work and "
242.1009 +"cited as possessive with respect to the title."
242.1010 +msgstr ""
242.1011 +
242.1012 +#. type: Content of: <book><appendix><sect1><title>
242.1013 +#: ../en/appD-license.xml:49
242.1014 +msgid "Copyright"
242.1015 +msgstr ""
242.1016 +
242.1017 +#. type: Content of: <book><appendix><sect1><para>
242.1018 +#: ../en/appD-license.xml:51
242.1019 +msgid ""
242.1020 +"The copyright to each Open Publication is owned by its author(s) or designee."
242.1021 +msgstr ""
242.1022 +
242.1023 +#. type: Content of: <book><appendix><sect1><title>
242.1024 +#: ../en/appD-license.xml:56
242.1025 +msgid "Scope of license"
242.1026 +msgstr ""
242.1027 +
242.1028 +#. type: Content of: <book><appendix><sect1><para>
242.1029 +#: ../en/appD-license.xml:58
242.1030 +msgid ""
242.1031 +"The following license terms apply to all Open Publication works, unless "
242.1032 +"otherwise explicitly stated in the document."
242.1033 +msgstr ""
242.1034 +
242.1035 +#. type: Content of: <book><appendix><sect1><para>
242.1036 +#: ../en/appD-license.xml:62
242.1037 +msgid ""
242.1038 +"Mere aggregation of Open Publication works or a portion of an Open "
242.1039 +"Publication work with other works or programs on the same media shall not "
242.1040 +"cause this license to apply to those other works. The aggregate work shall "
242.1041 +"contain a notice specifying the inclusion of the Open Publication material "
242.1042 +"and appropriate copyright notice."
242.1043 +msgstr ""
242.1044 +
242.1045 +#. type: Content of: <book><appendix><sect1><para>
242.1046 +#: ../en/appD-license.xml:69
242.1047 +msgid ""
242.1048 +"<emphasis role=\"bold\">Severability</emphasis>. If any part of this license "
242.1049 +"is found to be unenforceable in any jurisdiction, the remaining portions of "
242.1050 +"the license remain in force."
242.1051 +msgstr ""
242.1052 +
242.1053 +#. type: Content of: <book><appendix><sect1><para>
242.1054 +#: ../en/appD-license.xml:74
242.1055 +msgid ""
242.1056 +"<emphasis role=\"bold\">No warranty</emphasis>. Open Publication works are "
242.1057 +"licensed and provided <quote>as is</quote> without warranty of any kind, "
242.1058 +"express or implied, including, but not limited to, the implied warranties of "
242.1059 +"merchantability and fitness for a particular purpose or a warranty of non-"
242.1060 +"infringement."
242.1061 +msgstr ""
242.1062 +
242.1063 +#. type: Content of: <book><appendix><sect1><title>
242.1064 +#: ../en/appD-license.xml:83
242.1065 +msgid "Requirements on modified works"
242.1066 +msgstr ""
242.1067 +
242.1068 +#. type: Content of: <book><appendix><sect1><para>
242.1069 +#: ../en/appD-license.xml:85
242.1070 +msgid ""
242.1071 +"All modified versions of documents covered by this license, including "
242.1072 +"translations, anthologies, compilations and partial documents, must meet the "
242.1073 +"following requirements:"
242.1074 +msgstr ""
242.1075 +
242.1076 +#. type: Content of: <book><appendix><sect1><orderedlist><listitem><para>
242.1077 +#: ../en/appD-license.xml:90
242.1078 +msgid "The modified version must be labeled as such."
242.1079 +msgstr ""
242.1080 +
242.1081 +#. type: Content of: <book><appendix><sect1><orderedlist><listitem><para>
242.1082 +#: ../en/appD-license.xml:93
242.1083 +msgid ""
242.1084 +"The person making the modifications must be identified and the modifications "
242.1085 +"dated."
242.1086 +msgstr ""
242.1087 +
242.1088 +#. type: Content of: <book><appendix><sect1><orderedlist><listitem><para>
242.1089 +#: ../en/appD-license.xml:96
242.1090 +msgid ""
242.1091 +"Acknowledgement of the original author and publisher if applicable must be "
242.1092 +"retained according to normal academic citation practices."
242.1093 +msgstr ""
242.1094 +
242.1095 +#. type: Content of: <book><appendix><sect1><orderedlist><listitem><para>
242.1096 +#: ../en/appD-license.xml:100
242.1097 +msgid "The location of the original unmodified document must be identified."
242.1098 +msgstr ""
242.1099 +
242.1100 +#. type: Content of: <book><appendix><sect1><orderedlist><listitem><para>
242.1101 +#: ../en/appD-license.xml:103
242.1102 +msgid ""
242.1103 +"The original author's (or authors') name(s) may not be used to assert or "
242.1104 +"imply endorsement of the resulting document without the original author's (or "
242.1105 +"authors')  permission."
242.1106 +msgstr ""
242.1107 +
242.1108 +#. type: Content of: <book><appendix><sect1><title>
242.1109 +#: ../en/appD-license.xml:111
242.1110 +msgid "Good-practice recommendations"
242.1111 +msgstr ""
242.1112 +
242.1113 +#. type: Content of: <book><appendix><sect1><para>
242.1114 +#: ../en/appD-license.xml:113
242.1115 +msgid ""
242.1116 +"In addition to the requirements of this license, it is requested from and "
242.1117 +"strongly recommended of redistributors that:"
242.1118 +msgstr ""
242.1119 +
242.1120 +#. type: Content of: <book><appendix><sect1><orderedlist><listitem><para>
242.1121 +#: ../en/appD-license.xml:118
242.1122 +msgid ""
242.1123 +"If you are distributing Open Publication works on hardcopy or CD-ROM, you "
242.1124 +"provide email notification to the authors of your intent to redistribute at "
242.1125 +"least thirty days before your manuscript or media freeze, to give the authors "
242.1126 +"time to provide updated documents. This notification should describe "
242.1127 +"modifications, if any, made to the document."
242.1128 +msgstr ""
242.1129 +
242.1130 +#. type: Content of: <book><appendix><sect1><orderedlist><listitem><para>
242.1131 +#: ../en/appD-license.xml:125
242.1132 +msgid ""
242.1133 +"All substantive modifications (including deletions) be either clearly marked "
242.1134 +"up in the document or else described in an attachment to the document."
242.1135 +msgstr ""
242.1136 +
242.1137 +#. type: Content of: <book><appendix><sect1><orderedlist><listitem><para>
242.1138 +#: ../en/appD-license.xml:129
242.1139 +msgid ""
242.1140 +"Finally, while it is not mandatory under this license, it is considered good "
242.1141 +"form to offer a free copy of any hardcopy and CD-ROM expression of an Open "
242.1142 +"Publication-licensed work to its author(s)."
242.1143 +msgstr ""
242.1144 +
242.1145 +#. type: Content of: <book><appendix><sect1><title>
242.1146 +#: ../en/appD-license.xml:137
242.1147 +msgid "License options"
242.1148 +msgstr ""
242.1149 +
242.1150 +#. type: Content of: <book><appendix><sect1><para>
242.1151 +#: ../en/appD-license.xml:139
242.1152 +msgid ""
242.1153 +"The author(s) and/or publisher of an Open Publication-licensed document may "
242.1154 +"elect certain options by appending language to the reference to or copy of "
242.1155 +"the license.  These options are considered part of the license instance and "
242.1156 +"must be included with the license (or its incorporation by reference) in "
242.1157 +"derived works."
242.1158 +msgstr ""
242.1159 +
242.1160 +#. type: Content of: <book><appendix><sect1><orderedlist><listitem><para>
242.1161 +#: ../en/appD-license.xml:147
242.1162 +msgid ""
242.1163 +"To prohibit distribution of substantively modified versions without the "
242.1164 +"explicit permission of the author(s). <quote>Substantive modification</quote> "
242.1165 +"is defined as a change to the semantic content of the document, and excludes "
242.1166 +"mere changes in format or typographical corrections."
242.1167 +msgstr ""
242.1168 +
242.1169 +#. type: Content of: <book><appendix><sect1><orderedlist><listitem><para>
242.1170 +#: ../en/appD-license.xml:154
242.1171 +msgid ""
242.1172 +"To accomplish this, add the phrase <quote>Distribution of substantively "
242.1173 +"modified versions of this document is prohibited without the explicit "
242.1174 +"permission of the copyright holder.</quote> to the license reference or copy."
242.1175 +msgstr ""
242.1176 +
242.1177 +#. type: Content of: <book><appendix><sect1><orderedlist><listitem><para>
242.1178 +#: ../en/appD-license.xml:160
242.1179 +msgid ""
242.1180 +"To prohibit any publication of this work or derivative works in whole or in "
242.1181 +"part in standard (paper)  book form for commercial purposes is prohibited "
242.1182 +"unless prior permission is obtained from the copyright holder."
242.1183 +msgstr ""
242.1184 +
242.1185 +#. type: Content of: <book><appendix><sect1><orderedlist><listitem><para>
242.1186 +#: ../en/appD-license.xml:165
242.1187 +msgid ""
242.1188 +"To accomplish this, add the phrase <quote>Distribution of the work or "
242.1189 +"derivative of the work in any standard (paper) book form is prohibited unless "
242.1190 +"prior permission is obtained from the copyright holder.</quote> to the "
242.1191 +"license reference or copy."
242.1192 +msgstr ""
242.1193 +
242.1194 +#. type: Content of: <book><preface><title>
242.1195 +#: ../en/ch00-preface.xml:5
242.1196 +msgid "Preface"
242.1197 +msgstr "序言"
242.1198 +
242.1199 +#. type: Content of: <book><preface><sect1><title>
242.1200 +#: ../en/ch00-preface.xml:8
242.1201 +msgid "Why revision control? Why Mercurial?"
242.1202 +msgstr "为什么使用版本控制? 为什么使用 Mercurial?"
242.1203 +
242.1204 +#. type: Content of: <book><preface><sect1><para>
242.1205 +#: ../en/ch00-preface.xml:10
242.1206 +msgid ""
242.1207 +"Revision control is the process of managing multiple versions of a piece of "
242.1208 +"information.  In its simplest form, this is something that many people do by "
242.1209 +"hand: every time you modify a file, save it under a new name that contains a "
242.1210 +"number, each one higher than the number of the preceding version."
242.1211 +msgstr ""
242.1212 +
242.1213 +#. type: Content of: <book><preface><sect1><para>
242.1214 +#: ../en/ch00-preface.xml:16
242.1215 +msgid ""
242.1216 +"Manually managing multiple versions of even a single file is an error-prone "
242.1217 +"task, though, so software tools to help automate this process have long been "
242.1218 +"available.  The earliest automated revision control tools were intended to "
242.1219 +"help a single user to manage revisions of a single file.  Over the past few "
242.1220 +"decades, the scope of revision control tools has expanded greatly; they now "
242.1221 +"manage multiple files, and help multiple people to work together.  The best "
242.1222 +"modern revision control tools have no problem coping with thousands of people "
242.1223 +"working together on projects that consist of hundreds of thousands of files."
242.1224 +msgstr ""
242.1225 +
242.1226 +#. type: Content of: <book><preface><sect1><para>
242.1227 +#: ../en/ch00-preface.xml:27
242.1228 +msgid ""
242.1229 +"The arrival of distributed revision control is relatively recent, and so far "
242.1230 +"this new field has grown due to people's willingness to explore ill-charted "
242.1231 +"territory."
242.1232 +msgstr ""
242.1233 +
242.1234 +#. type: Content of: <book><preface><sect1><para>
242.1235 +#: ../en/ch00-preface.xml:31
242.1236 +msgid ""
242.1237 +"I am writing a book about distributed revision control because I believe that "
242.1238 +"it is an important subject that deserves a field guide. I chose to write "
242.1239 +"about Mercurial because it is the easiest tool to learn the terrain with, and "
242.1240 +"yet it scales to the demands of real, challenging environments where many "
242.1241 +"other revision control tools buckle."
242.1242 +msgstr ""
242.1243 +
242.1244 +#. type: Content of: <book><preface><sect1><sect2><title>
242.1245 +#: ../en/ch00-preface.xml:39
242.1246 +msgid "Why use revision control?"
242.1247 +msgstr "为什么使用版本控制?"
242.1248 +
242.1249 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1250 +#: ../en/ch00-preface.xml:41
242.1251 +msgid ""
242.1252 +"There are a number of reasons why you or your team might want to use an "
242.1253 +"automated revision control tool for a project."
242.1254 +msgstr ""
242.1255 +
242.1256 +#. type: Content of: <book><preface><sect1><sect2><itemizedlist><listitem><para>
242.1257 +#: ../en/ch00-preface.xml:46
242.1258 +msgid ""
242.1259 +"It will track the history and evolution of your project, so you don't have "
242.1260 +"to.  For every change, you'll have a log of <emphasis>who</emphasis> made it; "
242.1261 +"<emphasis>why</emphasis> they made it; <emphasis>when</emphasis> they made "
242.1262 +"it; and <emphasis>what</emphasis> the change was."
242.1263 +msgstr ""
242.1264 +
242.1265 +#. type: Content of: <book><preface><sect1><sect2><itemizedlist><listitem><para>
242.1266 +#: ../en/ch00-preface.xml:53
242.1267 +msgid ""
242.1268 +"When you're working with other people, revision control software makes it "
242.1269 +"easier for you to collaborate.  For example, when people more or less "
242.1270 +"simultaneously make potentially incompatible changes, the software will help "
242.1271 +"you to identify and resolve those conflicts."
242.1272 +msgstr ""
242.1273 +
242.1274 +#. type: Content of: <book><preface><sect1><sect2><itemizedlist><listitem><para>
242.1275 +#: ../en/ch00-preface.xml:59
242.1276 +msgid ""
242.1277 +"It can help you to recover from mistakes.  If you make a change that later "
242.1278 +"turns out to be in error, you can revert to an earlier version of one or more "
242.1279 +"files.  In fact, a <emphasis>really</emphasis> good revision control tool "
242.1280 +"will even help you to efficiently figure out exactly when a problem was "
242.1281 +"introduced (see <xref linkend=\"sec:undo:bisect\"/> for details)."
242.1282 +msgstr ""
242.1283 +
242.1284 +#. type: Content of: <book><preface><sect1><sect2><itemizedlist><listitem><para>
242.1285 +#: ../en/ch00-preface.xml:66
242.1286 +msgid ""
242.1287 +"It will help you to work simultaneously on, and manage the drift between, "
242.1288 +"multiple versions of your project."
242.1289 +msgstr ""
242.1290 +
242.1291 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1292 +#: ../en/ch00-preface.xml:71
242.1293 +msgid ""
242.1294 +"Most of these reasons are equally valid&emdash;at least in theory&emdash;"
242.1295 +"whether you're working on a project by yourself, or with a hundred other "
242.1296 +"people."
242.1297 +msgstr ""
242.1298 +
242.1299 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1300 +#: ../en/ch00-preface.xml:76
242.1301 +msgid ""
242.1302 +"A key question about the practicality of revision control at these two "
242.1303 +"different scales (<quote>lone hacker</quote> and <quote>huge team</quote>) is "
242.1304 +"how its <emphasis>benefits</emphasis> compare to its <emphasis>costs</"
242.1305 +"emphasis>.  A revision control tool that's difficult to understand or use is "
242.1306 +"going to impose a high cost."
242.1307 +msgstr ""
242.1308 +
242.1309 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1310 +#: ../en/ch00-preface.xml:84
242.1311 +msgid ""
242.1312 +"A five-hundred-person project is likely to collapse under its own weight "
242.1313 +"almost immediately without a revision control tool and process. In this case, "
242.1314 +"the cost of using revision control might hardly seem worth considering, since "
242.1315 +"<emphasis>without</emphasis> it, failure is almost guaranteed."
242.1316 +msgstr ""
242.1317 +
242.1318 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1319 +#: ../en/ch00-preface.xml:91
242.1320 +msgid ""
242.1321 +"On the other hand, a one-person <quote>quick hack</quote> might seem like a "
242.1322 +"poor place to use a revision control tool, because surely the cost of using "
242.1323 +"one must be close to the overall cost of the project.  Right?"
242.1324 +msgstr ""
242.1325 +
242.1326 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1327 +#: ../en/ch00-preface.xml:96
242.1328 +msgid ""
242.1329 +"Mercurial uniquely supports <emphasis>both</emphasis> of these scales of "
242.1330 +"development.  You can learn the basics in just a few minutes, and due to its "
242.1331 +"low overhead, you can apply revision control to the smallest of projects with "
242.1332 +"ease.  Its simplicity means you won't have a lot of abstruse concepts or "
242.1333 +"command sequences competing for mental space with whatever you're "
242.1334 +"<emphasis>really</emphasis> trying to do.  At the same time, Mercurial's high "
242.1335 +"performance and peer-to-peer nature let you scale painlessly to handle large "
242.1336 +"projects."
242.1337 +msgstr ""
242.1338 +
242.1339 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1340 +#: ../en/ch00-preface.xml:106
242.1341 +msgid ""
242.1342 +"No revision control tool can rescue a poorly run project, but a good choice "
242.1343 +"of tools can make a huge difference to the fluidity with which you can work "
242.1344 +"on a project."
242.1345 +msgstr ""
242.1346 +
242.1347 +#. type: Content of: <book><preface><sect1><sect2><title>
242.1348 +#: ../en/ch00-preface.xml:113
242.1349 +msgid "The many names of revision control"
242.1350 +msgstr "版本控制的别名"
242.1351 +
242.1352 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1353 +#: ../en/ch00-preface.xml:115
242.1354 +msgid ""
242.1355 +"Revision control is a diverse field, so much so that it is referred to by "
242.1356 +"many names and acronyms.  Here are a few of the more common variations you'll "
242.1357 +"encounter:"
242.1358 +msgstr ""
242.1359 +
242.1360 +#. type: Content of: <book><preface><sect1><sect2><itemizedlist><listitem><para>
242.1361 +#: ../en/ch00-preface.xml:119
242.1362 +msgid "Revision control (RCS)"
242.1363 +msgstr "版本控制(RCS)"
242.1364 +
242.1365 +#. type: Content of: <book><preface><sect1><sect2><itemizedlist><listitem><para>
242.1366 +#: ../en/ch00-preface.xml:120
242.1367 +msgid "Software configuration management (SCM), or configuration management"
242.1368 +msgstr "软件配置管理(SCM),或配置管理"
242.1369 +
242.1370 +#. type: Content of: <book><preface><sect1><sect2><itemizedlist><listitem><para>
242.1371 +#: ../en/ch00-preface.xml:122
242.1372 +msgid "Source code management"
242.1373 +msgstr "源代码管理"
242.1374 +
242.1375 +#. type: Content of: <book><preface><sect1><sect2><itemizedlist><listitem><para>
242.1376 +#: ../en/ch00-preface.xml:123
242.1377 +msgid "Source code control, or source control"
242.1378 +msgstr "源代码控制,或源控制"
242.1379 +
242.1380 +#. type: Content of: <book><preface><sect1><sect2><itemizedlist><listitem><para>
242.1381 +#: ../en/ch00-preface.xml:125
242.1382 +msgid "Version control (VCS)"
242.1383 +msgstr "版本控制(VCS)"
242.1384 +
242.1385 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1386 +#: ../en/ch00-preface.xml:127
242.1387 +msgid ""
242.1388 +"Some people claim that these terms actually have different meanings, but in "
242.1389 +"practice they overlap so much that there's no agreed or even useful way to "
242.1390 +"tease them apart."
242.1391 +msgstr ""
242.1392 +
242.1393 +#. type: Content of: <book><preface><sect1><title>
242.1394 +#: ../en/ch00-preface.xml:135
242.1395 +msgid "This book is a work in progress"
242.1396 +msgstr "本书正在编写中"
242.1397 +
242.1398 +#. type: Content of: <book><preface><sect1><para>
242.1399 +#: ../en/ch00-preface.xml:137
242.1400 +msgid ""
242.1401 +"I am releasing this book while I am still writing it, in the hope that it "
242.1402 +"will prove useful to others.  I am writing under an open license in the hope "
242.1403 +"that you, my readers, will contribute feedback and perhaps content of your "
242.1404 +"own."
242.1405 +msgstr ""
242.1406 +
242.1407 +#. type: Content of: <book><preface><sect1><title>
242.1408 +#: ../en/ch00-preface.xml:144
242.1409 +msgid "About the examples in this book"
242.1410 +msgstr "本书的例子"
242.1411 +
242.1412 +#. type: Content of: <book><preface><sect1><para>
242.1413 +#: ../en/ch00-preface.xml:146
242.1414 +msgid ""
242.1415 +"This book takes an unusual approach to code samples.  Every example is "
242.1416 +"<quote>live</quote>&emdash;each one is actually the result of a shell script "
242.1417 +"that executes the Mercurial commands you see.  Every time an image of the "
242.1418 +"book is built from its sources, all the example scripts are automatically "
242.1419 +"run, and their current results compared against their expected results."
242.1420 +msgstr ""
242.1421 +
242.1422 +#. type: Content of: <book><preface><sect1><para>
242.1423 +#: ../en/ch00-preface.xml:153
242.1424 +msgid ""
242.1425 +"The advantage of this approach is that the examples are always accurate; they "
242.1426 +"describe <emphasis>exactly</emphasis> the behaviour of the version of "
242.1427 +"Mercurial that's mentioned at the front of the book.  If I update the version "
242.1428 +"of Mercurial that I'm documenting, and the output of some command changes, "
242.1429 +"the build fails."
242.1430 +msgstr ""
242.1431 +
242.1432 +#. type: Content of: <book><preface><sect1><para>
242.1433 +#: ../en/ch00-preface.xml:160
242.1434 +msgid ""
242.1435 +"There is a small disadvantage to this approach, which is that the dates and "
242.1436 +"times you'll see in examples tend to be <quote>squashed</quote> together in a "
242.1437 +"way that they wouldn't be if the same commands were being typed by a human.  "
242.1438 +"Where a human can issue no more than one command every few seconds, with any "
242.1439 +"resulting timestamps correspondingly spread out, my automated example scripts "
242.1440 +"run many commands in one second."
242.1441 +msgstr ""
242.1442 +
242.1443 +#. type: Content of: <book><preface><sect1><para>
242.1444 +#: ../en/ch00-preface.xml:168
242.1445 +msgid ""
242.1446 +"As an instance of this, several consecutive commits in an example can show up "
242.1447 +"as having occurred during the same second.  You can see this occur in the "
242.1448 +"<literal role=\"hg-ext\">bisect</literal> example in <xref linkend=\"sec:undo:"
242.1449 +"bisect\"/>, for instance."
242.1450 +msgstr ""
242.1451 +
242.1452 +#. type: Content of: <book><preface><sect1><para>
242.1453 +#: ../en/ch00-preface.xml:174
242.1454 +msgid ""
242.1455 +"So when you're reading examples, don't place too much weight on the dates or "
242.1456 +"times you see in the output of commands.  But <emphasis>do</emphasis> be "
242.1457 +"confident that the behaviour you're seeing is consistent and reproducible."
242.1458 +msgstr ""
242.1459 +
242.1460 +#. type: Content of: <book><preface><sect1><title>
242.1461 +#: ../en/ch00-preface.xml:182
242.1462 +msgid "Trends in the field"
242.1463 +msgstr "版本控制的发展趋势"
242.1464 +
242.1465 +#. type: Content of: <book><preface><sect1><para>
242.1466 +#: ../en/ch00-preface.xml:184
242.1467 +msgid ""
242.1468 +"There has been an unmistakable trend in the development and use of revision "
242.1469 +"control tools over the past four decades, as people have become familiar with "
242.1470 +"the capabilities of their tools and constrained by their limitations."
242.1471 +msgstr ""
242.1472 +
242.1473 +#. type: Content of: <book><preface><sect1><para>
242.1474 +#: ../en/ch00-preface.xml:189
242.1475 +msgid ""
242.1476 +"The first generation began by managing single files on individual computers.  "
242.1477 +"Although these tools represented a huge advance over ad-hoc manual revision "
242.1478 +"control, their locking model and reliance on a single computer limited them "
242.1479 +"to small, tightly-knit teams."
242.1480 +msgstr ""
242.1481 +
242.1482 +#. type: Content of: <book><preface><sect1><para>
242.1483 +#: ../en/ch00-preface.xml:195
242.1484 +msgid ""
242.1485 +"The second generation loosened these constraints by moving to network-"
242.1486 +"centered architectures, and managing entire projects at a time.  As projects "
242.1487 +"grew larger, they ran into new problems.  With clients needing to talk to "
242.1488 +"servers very frequently, server scaling became an issue for large projects.  "
242.1489 +"An unreliable network connection could prevent remote users from being able "
242.1490 +"to talk to the server at all.  As open source projects started making read-"
242.1491 +"only access available anonymously to anyone, people without commit privileges "
242.1492 +"found that they could not use the tools to interact with a project in a "
242.1493 +"natural way, as they could not record their changes."
242.1494 +msgstr ""
242.1495 +
242.1496 +#. type: Content of: <book><preface><sect1><para>
242.1497 +#: ../en/ch00-preface.xml:207
242.1498 +msgid ""
242.1499 +"The current generation of revision control tools is peer-to-peer in nature.  "
242.1500 +"All of these systems have dropped the dependency on a single central server, "
242.1501 +"and allow people to distribute their revision control data to where it's "
242.1502 +"actually needed.  Collaboration over the Internet has moved from constrained "
242.1503 +"by technology to a matter of choice and consensus.  Modern tools can operate "
242.1504 +"offline indefinitely and autonomously, with a network connection only needed "
242.1505 +"when syncing changes with another repository."
242.1506 +msgstr ""
242.1507 +
242.1508 +#. type: Content of: <book><preface><sect1><title>
242.1509 +#: ../en/ch00-preface.xml:219
242.1510 +msgid "A few of the advantages of distributed revision control"
242.1511 +msgstr "分布版本控制的优点"
242.1512 +
242.1513 +#. type: Content of: <book><preface><sect1><para>
242.1514 +#: ../en/ch00-preface.xml:222
242.1515 +msgid ""
242.1516 +"Even though distributed revision control tools have for several years been as "
242.1517 +"robust and usable as their previous-generation counterparts, people using "
242.1518 +"older tools have not yet necessarily woken up to their advantages.  There are "
242.1519 +"a number of ways in which distributed tools shine relative to centralised "
242.1520 +"ones."
242.1521 +msgstr ""
242.1522 +
242.1523 +#. type: Content of: <book><preface><sect1><para>
242.1524 +#: ../en/ch00-preface.xml:229
242.1525 +msgid ""
242.1526 +"For an individual developer, distributed tools are almost always much faster "
242.1527 +"than centralised tools.  This is for a simple reason: a centralised tool "
242.1528 +"needs to talk over the network for many common operations, because most "
242.1529 +"metadata is stored in a single copy on the central server.  A distributed "
242.1530 +"tool stores all of its metadata locally.  All else being equal, talking over "
242.1531 +"the network adds overhead to a centralised tool.  Don't underestimate the "
242.1532 +"value of a snappy, responsive tool: you're going to spend a lot of time "
242.1533 +"interacting with your revision control software."
242.1534 +msgstr ""
242.1535 +
242.1536 +#. type: Content of: <book><preface><sect1><para>
242.1537 +#: ../en/ch00-preface.xml:240
242.1538 +msgid ""
242.1539 +"Distributed tools are indifferent to the vagaries of your server "
242.1540 +"infrastructure, again because they replicate metadata to so many locations.  "
242.1541 +"If you use a centralised system and your server catches fire, you'd better "
242.1542 +"hope that your backup media are reliable, and that your last backup was "
242.1543 +"recent and actually worked.  With a distributed tool, you have many backups "
242.1544 +"available on every contributor's computer."
242.1545 +msgstr ""
242.1546 +
242.1547 +#. type: Content of: <book><preface><sect1><para>
242.1548 +#: ../en/ch00-preface.xml:248
242.1549 +msgid ""
242.1550 +"The reliability of your network will affect distributed tools far less than "
242.1551 +"it will centralised tools.  You can't even use a centralised tool without a "
242.1552 +"network connection, except for a few highly constrained commands.  With a "
242.1553 +"distributed tool, if your network connection goes down while you're working, "
242.1554 +"you may not even notice.  The only thing you won't be able to do is talk to "
242.1555 +"repositories on other computers, something that is relatively rare compared "
242.1556 +"with local operations.  If you have a far-flung team of collaborators, this "
242.1557 +"may be significant."
242.1558 +msgstr ""
242.1559 +
242.1560 +#. type: Content of: <book><preface><sect1><sect2><title>
242.1561 +#: ../en/ch00-preface.xml:259
242.1562 +msgid "Advantages for open source projects"
242.1563 +msgstr "开源项目的优点"
242.1564 +
242.1565 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1566 +#: ../en/ch00-preface.xml:261
242.1567 +msgid ""
242.1568 +"If you take a shine to an open source project and decide that you would like "
242.1569 +"to start hacking on it, and that project uses a distributed revision control "
242.1570 +"tool, you are at once a peer with the people who consider themselves the "
242.1571 +"<quote>core</quote> of that project.  If they publish their repositories, you "
242.1572 +"can immediately copy their project history, start making changes, and record "
242.1573 +"your work, using the same tools in the same ways as insiders.  By contrast, "
242.1574 +"with a centralised tool, you must use the software in a <quote>read only</"
242.1575 +"quote> mode unless someone grants you permission to commit changes to their "
242.1576 +"central server.  Until then, you won't be able to record changes, and your "
242.1577 +"local modifications will be at risk of corruption any time you try to update "
242.1578 +"your client's view of the repository."
242.1579 +msgstr ""
242.1580 +
242.1581 +#. type: Content of: <book><preface><sect1><sect2><sect3><title>
242.1582 +#: ../en/ch00-preface.xml:277
242.1583 +msgid "The forking non-problem"
242.1584 +msgstr "分叉不是问题"
242.1585 +
242.1586 +#. type: Content of: <book><preface><sect1><sect2><sect3><para>
242.1587 +#: ../en/ch00-preface.xml:279
242.1588 +msgid ""
242.1589 +"It has been suggested that distributed revision control tools pose some sort "
242.1590 +"of risk to open source projects because they make it easy to <quote>fork</"
242.1591 +"quote> the development of a project.  A fork happens when there are "
242.1592 +"differences in opinion or attitude between groups of developers that cause "
242.1593 +"them to decide that they can't work together any longer.  Each side takes a "
242.1594 +"more or less complete copy of the project's source code, and goes off in its "
242.1595 +"own direction."
242.1596 +msgstr ""
242.1597 +
242.1598 +#. type: Content of: <book><preface><sect1><sect2><sect3><para>
242.1599 +#: ../en/ch00-preface.xml:289
242.1600 +msgid ""
242.1601 +"Sometimes the camps in a fork decide to reconcile their differences. With a "
242.1602 +"centralised revision control system, the <emphasis>technical</emphasis> "
242.1603 +"process of reconciliation is painful, and has to be performed largely by "
242.1604 +"hand.  You have to decide whose revision history is going to <quote>win</"
242.1605 +"quote>, and graft the other team's changes into the tree somehow. This "
242.1606 +"usually loses some or all of one side's revision history."
242.1607 +msgstr ""
242.1608 +
242.1609 +#. type: Content of: <book><preface><sect1><sect2><sect3><para>
242.1610 +#: ../en/ch00-preface.xml:298
242.1611 +msgid ""
242.1612 +"What distributed tools do with respect to forking is they make forking the "
242.1613 +"<emphasis>only</emphasis> way to develop a project.  Every single change that "
242.1614 +"you make is potentially a fork point.  The great strength of this approach is "
242.1615 +"that a distributed revision control tool has to be really good at "
242.1616 +"<emphasis>merging</emphasis> forks, because forks are absolutely fundamental: "
242.1617 +"they happen all the time."
242.1618 +msgstr ""
242.1619 +
242.1620 +#. type: Content of: <book><preface><sect1><sect2><sect3><para>
242.1621 +#: ../en/ch00-preface.xml:307
242.1622 +msgid ""
242.1623 +"If every piece of work that everybody does, all the time, is framed in terms "
242.1624 +"of forking and merging, then what the open source world refers to as a "
242.1625 +"<quote>fork</quote> becomes <emphasis>purely</emphasis> a social issue.  If "
242.1626 +"anything, distributed tools <emphasis>lower</emphasis> the likelihood of a "
242.1627 +"fork:"
242.1628 +msgstr ""
242.1629 +
242.1630 +#. type: Content of: <book><preface><sect1><sect2><sect3><itemizedlist><listitem><para>
242.1631 +#: ../en/ch00-preface.xml:314
242.1632 +msgid ""
242.1633 +"They eliminate the social distinction that centralised tools impose: that "
242.1634 +"between insiders (people with commit access) and outsiders (people without)."
242.1635 +msgstr ""
242.1636 +
242.1637 +#. type: Content of: <book><preface><sect1><sect2><sect3><itemizedlist><listitem><para>
242.1638 +#: ../en/ch00-preface.xml:318
242.1639 +msgid ""
242.1640 +"They make it easier to reconcile after a social fork, because all that's "
242.1641 +"involved from the perspective of the revision control software is just "
242.1642 +"another merge."
242.1643 +msgstr ""
242.1644 +
242.1645 +#. type: Content of: <book><preface><sect1><sect2><sect3><para>
242.1646 +#: ../en/ch00-preface.xml:323
242.1647 +msgid ""
242.1648 +"Some people resist distributed tools because they want to retain tight "
242.1649 +"control over their projects, and they believe that centralised tools give "
242.1650 +"them this control.  However, if you're of this belief, and you publish your "
242.1651 +"CVS or Subversion repositories publicly, there are plenty of tools available "
242.1652 +"that can pull out your entire project's history (albeit slowly) and recreate "
242.1653 +"it somewhere that you don't control.  So while your control in this case is "
242.1654 +"illusory, you are forgoing the ability to fluidly collaborate with whatever "
242.1655 +"people feel compelled to mirror and fork your history."
242.1656 +msgstr ""
242.1657 +
242.1658 +#. type: Content of: <book><preface><sect1><sect2><title>
242.1659 +#: ../en/ch00-preface.xml:338
242.1660 +msgid "Advantages for commercial projects"
242.1661 +msgstr "商业项目的优点"
242.1662 +
242.1663 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1664 +#: ../en/ch00-preface.xml:340
242.1665 +msgid ""
242.1666 +"Many commercial projects are undertaken by teams that are scattered across "
242.1667 +"the globe.  Contributors who are far from a central server will see slower "
242.1668 +"command execution and perhaps less reliability.  Commercial revision control "
242.1669 +"systems attempt to ameliorate these problems with remote-site replication add-"
242.1670 +"ons that are typically expensive to buy and cantankerous to administer.  A "
242.1671 +"distributed system doesn't suffer from these problems in the first place.  "
242.1672 +"Better yet, you can easily set up multiple authoritative servers, say one per "
242.1673 +"site, so that there's no redundant communication between repositories over "
242.1674 +"expensive long-haul network links."
242.1675 +msgstr ""
242.1676 +
242.1677 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1678 +#: ../en/ch00-preface.xml:352
242.1679 +msgid ""
242.1680 +"Centralised revision control systems tend to have relatively low "
242.1681 +"scalability.  It's not unusual for an expensive centralised system to fall "
242.1682 +"over under the combined load of just a few dozen concurrent users.  Once "
242.1683 +"again, the typical response tends to be an expensive and clunky replication "
242.1684 +"facility.  Since the load on a central server&emdash;if you have one at "
242.1685 +"all&emdash;is many times lower with a distributed tool (because all of the "
242.1686 +"data is replicated everywhere), a single cheap server can handle the needs of "
242.1687 +"a much larger team, and replication to balance load becomes a simple matter "
242.1688 +"of scripting."
242.1689 +msgstr ""
242.1690 +
242.1691 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1692 +#: ../en/ch00-preface.xml:364
242.1693 +msgid ""
242.1694 +"If you have an employee in the field, troubleshooting a problem at a "
242.1695 +"customer's site, they'll benefit from distributed revision control. The tool "
242.1696 +"will let them generate custom builds, try different fixes in isolation from "
242.1697 +"each other, and search efficiently through history for the sources of bugs "
242.1698 +"and regressions in the customer's environment, all without needing to connect "
242.1699 +"to your company's network."
242.1700 +msgstr ""
242.1701 +
242.1702 +#. type: Content of: <book><preface><sect1><title>
242.1703 +#: ../en/ch00-preface.xml:375
242.1704 +msgid "Why choose Mercurial?"
242.1705 +msgstr "为什么选择 Mercurial?"
242.1706 +
242.1707 +#. type: Content of: <book><preface><sect1><para>
242.1708 +#: ../en/ch00-preface.xml:377
242.1709 +msgid ""
242.1710 +"Mercurial has a unique set of properties that make it a particularly good "
242.1711 +"choice as a revision control system."
242.1712 +msgstr ""
242.1713 +
242.1714 +#. type: Content of: <book><preface><sect1><itemizedlist><listitem><para>
242.1715 +#: ../en/ch00-preface.xml:380
242.1716 +msgid "It is easy to learn and use."
242.1717 +msgstr ""
242.1718 +
242.1719 +#. type: Content of: <book><preface><sect1><itemizedlist><listitem><para>
242.1720 +#: ../en/ch00-preface.xml:381
242.1721 +msgid "It is lightweight."
242.1722 +msgstr ""
242.1723 +
242.1724 +#. type: Content of: <book><preface><sect1><itemizedlist><listitem><para>
242.1725 +#: ../en/ch00-preface.xml:382
242.1726 +msgid "It scales excellently."
242.1727 +msgstr ""
242.1728 +
242.1729 +#. type: Content of: <book><preface><sect1><itemizedlist><listitem><para>
242.1730 +#: ../en/ch00-preface.xml:383
242.1731 +msgid "It is easy to customise."
242.1732 +msgstr ""
242.1733 +
242.1734 +#. type: Content of: <book><preface><sect1><para>
242.1735 +#: ../en/ch00-preface.xml:386
242.1736 +msgid ""
242.1737 +"If you are at all familiar with revision control systems, you should be able "
242.1738 +"to get up and running with Mercurial in less than five minutes.  Even if not, "
242.1739 +"it will take no more than a few minutes longer.  Mercurial's command and "
242.1740 +"feature sets are generally uniform and consistent, so you can keep track of a "
242.1741 +"few general rules instead of a host of exceptions."
242.1742 +msgstr ""
242.1743 +
242.1744 +#. type: Content of: <book><preface><sect1><para>
242.1745 +#: ../en/ch00-preface.xml:393
242.1746 +msgid ""
242.1747 +"On a small project, you can start working with Mercurial in moments. Creating "
242.1748 +"new changes and branches; transferring changes around (whether locally or "
242.1749 +"over a network); and history and status operations are all fast.  Mercurial "
242.1750 +"attempts to stay nimble and largely out of your way by combining low "
242.1751 +"cognitive overhead with blazingly fast operations."
242.1752 +msgstr ""
242.1753 +
242.1754 +#. type: Content of: <book><preface><sect1><para>
242.1755 +#: ../en/ch00-preface.xml:400
242.1756 +msgid ""
242.1757 +"The usefulness of Mercurial is not limited to small projects: it is used by "
242.1758 +"projects with hundreds to thousands of contributors, each containing tens of "
242.1759 +"thousands of files and hundreds of megabytes of source code."
242.1760 +msgstr ""
242.1761 +
242.1762 +#. type: Content of: <book><preface><sect1><para>
242.1763 +#: ../en/ch00-preface.xml:405
242.1764 +msgid ""
242.1765 +"If the core functionality of Mercurial is not enough for you, it's easy to "
242.1766 +"build on.  Mercurial is well suited to scripting tasks, and its clean "
242.1767 +"internals and implementation in Python make it easy to add features in the "
242.1768 +"form of extensions.  There are a number of popular and useful extensions "
242.1769 +"already available, ranging from helping to identify bugs to improving "
242.1770 +"performance."
242.1771 +msgstr ""
242.1772 +
242.1773 +#. type: Content of: <book><preface><sect1><title>
242.1774 +#: ../en/ch00-preface.xml:415
242.1775 +msgid "Mercurial compared with other tools"
242.1776 +msgstr "Mercurial 与其它工具的比较"
242.1777 +
242.1778 +#. type: Content of: <book><preface><sect1><para>
242.1779 +#: ../en/ch00-preface.xml:417
242.1780 +msgid ""
242.1781 +"Before you read on, please understand that this section necessarily reflects "
242.1782 +"my own experiences, interests, and (dare I say it) biases.  I have used every "
242.1783 +"one of the revision control tools listed below, in most cases for several "
242.1784 +"years at a time."
242.1785 +msgstr ""
242.1786 +
242.1787 +#. type: Content of: <book><preface><sect1><itemizedlist><listitem><para>
242.1788 +#: ../en/ch00-preface.xml:425 ../en/ch00-preface.xml:636
242.1789 +msgid "Subversion"
242.1790 +msgstr ""
242.1791 +
242.1792 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1793 +#: ../en/ch00-preface.xml:427
242.1794 +msgid ""
242.1795 +"Subversion is a popular revision control tool, developed to replace CVS.  It "
242.1796 +"has a centralised client/server architecture."
242.1797 +msgstr ""
242.1798 +
242.1799 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1800 +#: ../en/ch00-preface.xml:431
242.1801 +msgid ""
242.1802 +"Subversion and Mercurial have similarly named commands for performing the "
242.1803 +"same operations, so if you're familiar with one, it is easy to learn to use "
242.1804 +"the other.  Both tools are portable to all popular operating systems."
242.1805 +msgstr ""
242.1806 +
242.1807 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1808 +#: ../en/ch00-preface.xml:436
242.1809 +msgid ""
242.1810 +"Prior to version 1.5, Subversion had no useful support for merges. At the "
242.1811 +"time of writing, its merge tracking capability is new, and known to be <ulink "
242.1812 +"url=\"http://svnbook.red-bean.com/nightly/en/svn.branchmerge.advanced."
242.1813 +"html#svn.branchmerge.advanced.finalword\">complicated and buggy</ulink>."
242.1814 +msgstr ""
242.1815 +
242.1816 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1817 +#: ../en/ch00-preface.xml:442
242.1818 +msgid ""
242.1819 +"Mercurial has a substantial performance advantage over Subversion on every "
242.1820 +"revision control operation I have benchmarked.  I have measured its advantage "
242.1821 +"as ranging from a factor of two to a factor of six when compared with "
242.1822 +"Subversion 1.4.3's <emphasis>ra_local</emphasis> file store, which is the "
242.1823 +"fastest access method available.  In more realistic deployments involving a "
242.1824 +"network-based store, Subversion will be at a substantially larger "
242.1825 +"disadvantage.  Because many Subversion commands must talk to the server and "
242.1826 +"Subversion does not have useful replication facilities, server capacity and "
242.1827 +"network bandwidth become bottlenecks for modestly large projects."
242.1828 +msgstr ""
242.1829 +
242.1830 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1831 +#: ../en/ch00-preface.xml:455
242.1832 +msgid ""
242.1833 +"Additionally, Subversion incurs substantial storage overhead to avoid network "
242.1834 +"transactions for a few common operations, such as finding modified files "
242.1835 +"(<literal>status</literal>) and displaying modifications against the current "
242.1836 +"revision (<literal>diff</literal>).  As a result, a Subversion working copy "
242.1837 +"is often the same size as, or larger than, a Mercurial repository and working "
242.1838 +"directory, even though the Mercurial repository contains a complete history "
242.1839 +"of the project."
242.1840 +msgstr ""
242.1841 +
242.1842 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1843 +#: ../en/ch00-preface.xml:465
242.1844 +msgid ""
242.1845 +"Subversion is widely supported by third party tools.  Mercurial currently "
242.1846 +"lags considerably in this area.  This gap is closing, however, and indeed "
242.1847 +"some of Mercurial's GUI tools now outshine their Subversion equivalents.  "
242.1848 +"Like Mercurial, Subversion has an excellent user manual."
242.1849 +msgstr ""
242.1850 +
242.1851 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1852 +#: ../en/ch00-preface.xml:471
242.1853 +msgid ""
242.1854 +"Because Subversion doesn't store revision history on the client, it is well "
242.1855 +"suited to managing projects that deal with lots of large, opaque binary "
242.1856 +"files.  If you check in fifty revisions to an incompressible 10MB file, "
242.1857 +"Subversion's client-side space usage stays constant The space used by any "
242.1858 +"distributed SCM will grow rapidly in proportion to the number of revisions, "
242.1859 +"because the differences between each revision are large."
242.1860 +msgstr ""
242.1861 +
242.1862 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1863 +#: ../en/ch00-preface.xml:480
242.1864 +msgid ""
242.1865 +"In addition, it's often difficult or, more usually, impossible to merge "
242.1866 +"different versions of a binary file.  Subversion's ability to let a user lock "
242.1867 +"a file, so that they temporarily have the exclusive right to commit changes "
242.1868 +"to it, can be a significant advantage to a project where binary files are "
242.1869 +"widely used."
242.1870 +msgstr ""
242.1871 +
242.1872 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1873 +#: ../en/ch00-preface.xml:487
242.1874 +msgid ""
242.1875 +"Mercurial can import revision history from a Subversion repository. It can "
242.1876 +"also export revision history to a Subversion repository.  This makes it easy "
242.1877 +"to <quote>test the waters</quote> and use Mercurial and Subversion in "
242.1878 +"parallel before deciding to switch.  History conversion is incremental, so "
242.1879 +"you can perform an initial conversion, then small additional conversions "
242.1880 +"afterwards to bring in new changes."
242.1881 +msgstr ""
242.1882 +
242.1883 +#. type: Content of: <book><preface><sect1><itemizedlist><listitem><para>
242.1884 +#: ../en/ch00-preface.xml:499 ../en/ch00-preface.xml:638
242.1885 +msgid "Git"
242.1886 +msgstr "Git"
242.1887 +
242.1888 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1889 +#: ../en/ch00-preface.xml:501
242.1890 +msgid ""
242.1891 +"Git is a distributed revision control tool that was developed for managing "
242.1892 +"the Linux kernel source tree.  Like Mercurial, its early design was somewhat "
242.1893 +"influenced by Monotone."
242.1894 +msgstr ""
242.1895 +
242.1896 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1897 +#: ../en/ch00-preface.xml:506
242.1898 +msgid ""
242.1899 +"Git has a very large command set, with version 1.5.0 providing 139 individual "
242.1900 +"commands.  It has something of a reputation for being difficult to learn.  "
242.1901 +"Compared to Git, Mercurial has a strong focus on simplicity."
242.1902 +msgstr ""
242.1903 +
242.1904 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1905 +#: ../en/ch00-preface.xml:511
242.1906 +msgid ""
242.1907 +"In terms of performance, Git is extremely fast.  In several cases, it is "
242.1908 +"faster than Mercurial, at least on Linux, while Mercurial performs better on "
242.1909 +"other operations.  However, on Windows, the performance and general level of "
242.1910 +"support that Git provides is, at the time of writing, far behind that of "
242.1911 +"Mercurial."
242.1912 +msgstr ""
242.1913 +
242.1914 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1915 +#: ../en/ch00-preface.xml:518
242.1916 +msgid ""
242.1917 +"While a Mercurial repository needs no maintenance, a Git repository requires "
242.1918 +"frequent manual <quote>repacks</quote> of its metadata.  Without these, "
242.1919 +"performance degrades, while space usage grows rapidly.  A server that "
242.1920 +"contains many Git repositories that are not rigorously and frequently "
242.1921 +"repacked will become heavily disk-bound during backups, and there have been "
242.1922 +"instances of daily backups taking far longer than 24 hours as a result.  A "
242.1923 +"freshly packed Git repository is slightly smaller than a Mercurial "
242.1924 +"repository, but an unpacked repository is several orders of magnitude larger."
242.1925 +msgstr ""
242.1926 +
242.1927 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1928 +#: ../en/ch00-preface.xml:529
242.1929 +msgid ""
242.1930 +"The core of Git is written in C.  Many Git commands are implemented as shell "
242.1931 +"or Perl scripts, and the quality of these scripts varies widely. I have "
242.1932 +"encountered several instances where scripts charged along blindly in the "
242.1933 +"presence of errors that should have been fatal."
242.1934 +msgstr ""
242.1935 +
242.1936 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1937 +#: ../en/ch00-preface.xml:535
242.1938 +msgid "Mercurial can import revision history from a Git repository."
242.1939 +msgstr ""
242.1940 +
242.1941 +#. type: Content of: <book><preface><sect1><itemizedlist><listitem><para>
242.1942 +#: ../en/ch00-preface.xml:541 ../en/ch00-preface.xml:637
242.1943 +msgid "CVS"
242.1944 +msgstr "CVS"
242.1945 +
242.1946 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1947 +#: ../en/ch00-preface.xml:543
242.1948 +msgid ""
242.1949 +"CVS is probably the most widely used revision control tool in the world.  Due "
242.1950 +"to its age and internal untidiness, it has been only lightly maintained for "
242.1951 +"many years."
242.1952 +msgstr ""
242.1953 +
242.1954 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1955 +#: ../en/ch00-preface.xml:547
242.1956 +msgid ""
242.1957 +"It has a centralised client/server architecture.  It does not group related "
242.1958 +"file changes into atomic commits, making it easy for people to <quote>break "
242.1959 +"the build</quote>: one person can successfully commit part of a change and "
242.1960 +"then be blocked by the need for a merge, causing other people to see only a "
242.1961 +"portion of the work they intended to do.  This also affects how you work with "
242.1962 +"project history.  If you want to see all of the modifications someone made as "
242.1963 +"part of a task, you will need to manually inspect the descriptions and "
242.1964 +"timestamps of the changes made to each file involved (if you even know what "
242.1965 +"those files were)."
242.1966 +msgstr ""
242.1967 +
242.1968 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1969 +#: ../en/ch00-preface.xml:559
242.1970 +msgid ""
242.1971 +"CVS has a muddled notion of tags and branches that I will not attempt to even "
242.1972 +"describe.  It does not support renaming of files or directories well, making "
242.1973 +"it easy to corrupt a repository.  It has almost no internal consistency "
242.1974 +"checking capabilities, so it is usually not even possible to tell whether or "
242.1975 +"how a repository is corrupt.  I would not recommend CVS for any project, "
242.1976 +"existing or new."
242.1977 +msgstr ""
242.1978 +
242.1979 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1980 +#: ../en/ch00-preface.xml:567
242.1981 +msgid ""
242.1982 +"Mercurial can import CVS revision history.  However, there are a few caveats "
242.1983 +"that apply; these are true of every other revision control tool's CVS "
242.1984 +"importer, too.  Due to CVS's lack of atomic changes and unversioned "
242.1985 +"filesystem hierarchy, it is not possible to reconstruct CVS history "
242.1986 +"completely accurately; some guesswork is involved, and renames will usually "
242.1987 +"not show up.  Because a lot of advanced CVS administration has to be done by "
242.1988 +"hand and is hence error-prone, it's common for CVS importers to run into "
242.1989 +"multiple problems with corrupted repositories (completely bogus revision "
242.1990 +"timestamps and files that have remained locked for over a decade are just two "
242.1991 +"of the less interesting problems I can recall from personal experience)."
242.1992 +msgstr ""
242.1993 +
242.1994 +#. type: Content of: <book><preface><sect1><sect2><para>
242.1995 +#: ../en/ch00-preface.xml:581
242.1996 +msgid "Mercurial can import revision history from a CVS repository."
242.1997 +msgstr ""
242.1998 +
242.1999 +#. type: Content of: <book><preface><sect1><sect2><title>
242.2000 +#: ../en/ch00-preface.xml:587
242.2001 +msgid "Commercial tools"
242.2002 +msgstr "商业工具"
242.2003 +
242.2004 +#. type: Content of: <book><preface><sect1><sect2><para>
242.2005 +#: ../en/ch00-preface.xml:589
242.2006 +msgid ""
242.2007 +"Perforce has a centralised client/server architecture, with no client-side "
242.2008 +"caching of any data.  Unlike modern revision control tools, Perforce requires "
242.2009 +"that a user run a command to inform the server about every file they intend "
242.2010 +"to edit."
242.2011 +msgstr ""
242.2012 +
242.2013 +#. type: Content of: <book><preface><sect1><sect2><para>
242.2014 +#: ../en/ch00-preface.xml:595
242.2015 +msgid ""
242.2016 +"The performance of Perforce is quite good for small teams, but it falls off "
242.2017 +"rapidly as the number of users grows beyond a few dozen. Modestly large "
242.2018 +"Perforce installations require the deployment of proxies to cope with the "
242.2019 +"load their users generate."
242.2020 +msgstr ""
242.2021 +
242.2022 +#. type: Content of: <book><preface><sect1><sect2><title>
242.2023 +#: ../en/ch00-preface.xml:604
242.2024 +msgid "Choosing a revision control tool"
242.2025 +msgstr "选择版本控制工具"
242.2026 +
242.2027 +#. type: Content of: <book><preface><sect1><sect2><para>
242.2028 +#: ../en/ch00-preface.xml:606
242.2029 +msgid ""
242.2030 +"With the exception of CVS, all of the tools listed above have unique "
242.2031 +"strengths that suit them to particular styles of work.  There is no single "
242.2032 +"revision control tool that is best in all situations."
242.2033 +msgstr ""
242.2034 +
242.2035 +#. type: Content of: <book><preface><sect1><sect2><para>
242.2036 +#: ../en/ch00-preface.xml:611
242.2037 +msgid ""
242.2038 +"As an example, Subversion is a good choice for working with frequently edited "
242.2039 +"binary files, due to its centralised nature and support for file locking."
242.2040 +msgstr ""
242.2041 +
242.2042 +#. type: Content of: <book><preface><sect1><sect2><para>
242.2043 +#: ../en/ch00-preface.xml:615
242.2044 +msgid ""
242.2045 +"I personally find Mercurial's properties of simplicity, performance, and good "
242.2046 +"merge support to be a compelling combination that has served me well for "
242.2047 +"several years."
242.2048 +msgstr ""
242.2049 +
242.2050 +#. type: Content of: <book><preface><sect1><title>
242.2051 +#: ../en/ch00-preface.xml:623
242.2052 +msgid "Switching from another tool to Mercurial"
242.2053 +msgstr "从其它工具切换到 Mercurial"
242.2054 +
242.2055 +#. type: Content of: <book><preface><sect1><para>
242.2056 +#: ../en/ch00-preface.xml:625
242.2057 +msgid ""
242.2058 +"Mercurial is bundled with an extension named <literal role=\"hg-ext"
242.2059 +"\">convert</literal>, which can incrementally import revision history from "
242.2060 +"several other revision control tools.  By <quote>incremental</quote>, I mean "
242.2061 +"that you can convert all of a project's history to date in one go, then rerun "
242.2062 +"the conversion later to obtain new changes that happened after the initial "
242.2063 +"conversion."
242.2064 +msgstr ""
242.2065 +
242.2066 +#. type: Content of: <book><preface><sect1><para>
242.2067 +#: ../en/ch00-preface.xml:633
242.2068 +msgid ""
242.2069 +"The revision control tools supported by <literal role=\"hg-ext\">convert</"
242.2070 +"literal> are as follows:"
242.2071 +msgstr "<literal role=\"hg-ext\">convert</literal> 支持的版本控制工具有:"
242.2072 +
242.2073 +#. type: Content of: <book><preface><sect1><itemizedlist><listitem><para>
242.2074 +#: ../en/ch00-preface.xml:639
242.2075 +msgid "Darcs"
242.2076 +msgstr "Darcs"
242.2077 +
242.2078 +#. type: Content of: <book><preface><sect1><para>
242.2079 +#: ../en/ch00-preface.xml:641
242.2080 +msgid ""
242.2081 +"In addition, <literal role=\"hg-ext\">convert</literal> can export changes "
242.2082 +"from Mercurial to Subversion.  This makes it possible to try Subversion and "
242.2083 +"Mercurial in parallel before committing to a switchover, without risking the "
242.2084 +"loss of any work."
242.2085 +msgstr ""
242.2086 +
242.2087 +#. type: Content of: <book><preface><sect1><para>
242.2088 +#: ../en/ch00-preface.xml:647
242.2089 +msgid ""
242.2090 +"The <command role=\"hg-ext-convert\">convert</command> command is easy to "
242.2091 +"use.  Simply point it at the path or URL of the source repository, optionally "
242.2092 +"give it the name of the destination repository, and it will start working.  "
242.2093 +"After the initial conversion, just run the same command again to import new "
242.2094 +"changes."
242.2095 +msgstr ""
242.2096 +
242.2097 +#. type: Content of: <book><preface><sect1><title>
242.2098 +#: ../en/ch00-preface.xml:656
242.2099 +msgid "A short history of revision control"
242.2100 +msgstr "版本控制简史"
242.2101 +
242.2102 +#. type: Content of: <book><preface><sect1><para>
242.2103 +#: ../en/ch00-preface.xml:658
242.2104 +msgid ""
242.2105 +"The best known of the old-time revision control tools is SCCS (Source Code "
242.2106 +"Control System), which Marc Rochkind wrote at Bell Labs, in the early 1970s.  "
242.2107 +"SCCS operated on individual files, and required every person working on a "
242.2108 +"project to have access to a shared workspace on a single system.  Only one "
242.2109 +"person could modify a file at any time; arbitration for access to files was "
242.2110 +"via locks.  It was common for people to lock files, and later forget to "
242.2111 +"unlock them, preventing anyone else from modifying those files without the "
242.2112 +"help of an administrator."
242.2113 +msgstr ""
242.2114 +
242.2115 +#. type: Content of: <book><preface><sect1><para>
242.2116 +#: ../en/ch00-preface.xml:669
242.2117 +msgid ""
242.2118 +"Walter Tichy developed a free alternative to SCCS in the early 1980s; he "
242.2119 +"called his program RCS (Revision Control System).  Like SCCS, RCS required "
242.2120 +"developers to work in a single shared workspace, and to lock files to prevent "
242.2121 +"multiple people from modifying them simultaneously."
242.2122 +msgstr ""
242.2123 +
242.2124 +#. type: Content of: <book><preface><sect1><para>
242.2125 +#: ../en/ch00-preface.xml:675
242.2126 +msgid ""
242.2127 +"Later in the 1980s, Dick Grune used RCS as a building block for a set of "
242.2128 +"shell scripts he initially called cmt, but then renamed to CVS (Concurrent "
242.2129 +"Versions System).  The big innovation of CVS was that it let developers work "
242.2130 +"simultaneously and somewhat independently in their own personal workspaces.  "
242.2131 +"The personal workspaces prevented developers from stepping on each other's "
242.2132 +"toes all the time, as was common with SCCS and RCS. Each developer had a copy "
242.2133 +"of every project file, and could modify their copies independently.  They had "
242.2134 +"to merge their edits prior to committing changes to the central repository."
242.2135 +msgstr ""
242.2136 +
242.2137 +#. type: Content of: <book><preface><sect1><para>
242.2138 +#: ../en/ch00-preface.xml:686
242.2139 +msgid ""
242.2140 +"Brian Berliner took Grune's original scripts and rewrote them in C, releasing "
242.2141 +"in 1989 the code that has since developed into the modern version of CVS.  "
242.2142 +"CVS subsequently acquired the ability to operate over a network connection, "
242.2143 +"giving it a client/server architecture.  CVS's architecture is centralised; "
242.2144 +"only the server has a copy of the history of the project. Client workspaces "
242.2145 +"just contain copies of recent versions of the project's files, and a little "
242.2146 +"metadata to tell them where the server is.  CVS has been enormously "
242.2147 +"successful; it is probably the world's most widely used revision control "
242.2148 +"system."
242.2149 +msgstr ""
242.2150 +
242.2151 +#. type: Content of: <book><preface><sect1><para>
242.2152 +#: ../en/ch00-preface.xml:697
242.2153 +msgid ""
242.2154 +"In the early 1990s, Sun Microsystems developed an early distributed revision "
242.2155 +"control system, called TeamWare.  A TeamWare workspace contains a complete "
242.2156 +"copy of the project's history.  TeamWare has no notion of a central "
242.2157 +"repository.  (CVS relied upon RCS for its history storage; TeamWare used "
242.2158 +"SCCS.)"
242.2159 +msgstr ""
242.2160 +
242.2161 +#. type: Content of: <book><preface><sect1><para>
242.2162 +#: ../en/ch00-preface.xml:704
242.2163 +msgid ""
242.2164 +"As the 1990s progressed, awareness grew of a number of problems with CVS.  It "
242.2165 +"records simultaneous changes to multiple files individually, instead of "
242.2166 +"grouping them together as a single logically atomic operation.  It does not "
242.2167 +"manage its file hierarchy well; it is easy to make a mess of a repository by "
242.2168 +"renaming files and directories.  Worse, its source code is difficult to read "
242.2169 +"and maintain, which made the <quote>pain level</quote> of fixing these "
242.2170 +"architectural problems prohibitive."
242.2171 +msgstr ""
242.2172 +
242.2173 +#. type: Content of: <book><preface><sect1><para>
242.2174 +#: ../en/ch00-preface.xml:714
242.2175 +msgid ""
242.2176 +"In 2001, Jim Blandy and Karl Fogel, two developers who had worked on CVS, "
242.2177 +"started a project to replace it with a tool that would have a better "
242.2178 +"architecture and cleaner code.  The result, Subversion, does not stray from "
242.2179 +"CVS's centralised client/server model, but it adds multi-file atomic commits, "
242.2180 +"better namespace management, and a number of other features that make it a "
242.2181 +"generally better tool than CVS. Since its initial release, it has rapidly "
242.2182 +"grown in popularity."
242.2183 +msgstr ""
242.2184 +
242.2185 +#. type: Content of: <book><preface><sect1><para>
242.2186 +#: ../en/ch00-preface.xml:723
242.2187 +msgid ""
242.2188 +"More or less simultaneously, Graydon Hoare began working on an ambitious "
242.2189 +"distributed revision control system that he named Monotone. While Monotone "
242.2190 +"addresses many of CVS's design flaws and has a peer-to-peer architecture, it "
242.2191 +"goes beyond earlier (and subsequent) revision control tools in a number of "
242.2192 +"innovative ways.  It uses cryptographic hashes as identifiers, and has an "
242.2193 +"integral notion of <quote>trust</quote> for code from different sources."
242.2194 +msgstr ""
242.2195 +
242.2196 +#. type: Content of: <book><preface><sect1><para>
242.2197 +#: ../en/ch00-preface.xml:732
242.2198 +msgid ""
242.2199 +"Mercurial began life in 2005.  While a few aspects of its design are "
242.2200 +"influenced by Monotone, Mercurial focuses on ease of use, high performance, "
242.2201 +"and scalability to very large projects."
242.2202 +msgstr ""
242.2203 +
242.2204 +#. type: Content of: <book><preface><sect1><title>
242.2205 +#: ../en/ch00-preface.xml:740
242.2206 +msgid "Colophon&emdash;this book is Free"
242.2207 +msgstr "后记—本书是自由的!"
242.2208 +
242.2209 +#. type: Content of: <book><preface><sect1><para>
242.2210 +#: ../en/ch00-preface.xml:742
242.2211 +msgid ""
242.2212 +"This book is licensed under the Open Publication License, and is produced "
242.2213 +"entirely using Free Software tools.  It is typeset with DocBook XML.  "
242.2214 +"Illustrations are drawn and rendered with <ulink url=\"http://www.inkscape."
242.2215 +"org/\">Inkscape</ulink>."
242.2216 +msgstr ""
242.2217 +
242.2218 +#. type: Content of: <book><preface><sect1><para>
242.2219 +#: ../en/ch00-preface.xml:747
242.2220 +msgid ""
242.2221 +"The complete source code for this book is published as a Mercurial "
242.2222 +"repository, at <ulink url=\"http://hg.serpentine.com/mercurial/book\">http://"
242.2223 +"hg.serpentine.com/mercurial/book</ulink>."
242.2224 +msgstr ""
242.2225 +
242.2226 +#. type: Content of: <book><chapter><title>
242.2227 +#: ../en/ch01-tour-basic.xml:5
242.2228 +msgid "A tour of Mercurial: the basics"
242.2229 +msgstr "Mercurial 教程: 基础知识"
242.2230 +
242.2231 +#. type: Content of: <book><chapter><sect1><title>
242.2232 +#: ../en/ch01-tour-basic.xml:8
242.2233 +msgid "Installing Mercurial on your system"
242.2234 +msgstr "安装 Mercurial"
242.2235 +
242.2236 +#. type: Content of: <book><chapter><sect1><para>
242.2237 +#: ../en/ch01-tour-basic.xml:10
242.2238 +msgid ""
242.2239 +"Prebuilt binary packages of Mercurial are available for every popular "
242.2240 +"operating system.  These make it easy to start using Mercurial on your "
242.2241 +"computer immediately."
242.2242 +msgstr ""
242.2243 +"对于每种流行的操作系统,都有已经构建的二进制软件包。这让在你的计算机上开始使"
242.2244 +"用 Mercurial 变得很容易。"
242.2245 +
242.2246 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.2247 +#: ../en/ch01-tour-basic.xml:15
242.2248 +msgid "Windows"
242.2249 +msgstr "Windows"
242.2250 +
242.2251 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2252 +#: ../en/ch01-tour-basic.xml:17
242.2253 +msgid ""
242.2254 +"The best version of Mercurial for Windows is TortoiseHg, which can be found "
242.2255 +"at <ulink url=\"http://bitbucket.org/tortoisehg/stable/wiki/Home\">http://"
242.2256 +"bitbucket.org/tortoisehg/stable/wiki/Home</ulink>.  This package has no "
242.2257 +"external dependencies; it <quote>just works</quote>.  It provides both "
242.2258 +"command line and graphical user interfaces."
242.2259 +msgstr ""
242.2260 +
242.2261 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.2262 +#: ../en/ch01-tour-basic.xml:27
242.2263 +msgid "Mac OS X"
242.2264 +msgstr "Mac OS X"
242.2265 +
242.2266 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2267 +#: ../en/ch01-tour-basic.xml:29
242.2268 +msgid ""
242.2269 +"Lee Cantey publishes an installer of Mercurial for Mac OS X at <ulink url="
242.2270 +"\"http://mercurial.berkwood.com\">http://mercurial.berkwood.com</ulink>."
242.2271 +msgstr ""
242.2272 +
242.2273 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.2274 +#: ../en/ch01-tour-basic.xml:35
242.2275 +msgid "Linux"
242.2276 +msgstr "Linux"
242.2277 +
242.2278 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2279 +#: ../en/ch01-tour-basic.xml:37
242.2280 +msgid ""
242.2281 +"Because each Linux distribution has its own packaging tools, policies, and "
242.2282 +"rate of development, it's difficult to give a comprehensive set of "
242.2283 +"instructions on how to install Mercurial binaries.  The version of Mercurial "
242.2284 +"that you will end up with can vary depending on how active the person is who "
242.2285 +"maintains the package for your distribution."
242.2286 +msgstr ""
242.2287 +"由于每种 Linux 发行版都有自己的包管理工具,开发策略和进度,从而很难给出安装 "
242.2288 +"Mercurial 二进制包的全面说明。你安装的 Mercurial 版本,在很大程度上依赖于你所"
242.2289 +"使用的发行版的 Mercurial 维护者的活跃程度。"
242.2290 +
242.2291 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2292 +#: ../en/ch01-tour-basic.xml:44
242.2293 +msgid ""
242.2294 +"To keep things simple, I will focus on installing Mercurial from the command "
242.2295 +"line under the most popular Linux distributions.  Most of these distributions "
242.2296 +"provide graphical package managers that will let you install Mercurial with a "
242.2297 +"single click; the package name to look for is <literal>mercurial</literal>."
242.2298 +msgstr ""
242.2299 +"为了让事情简单,我会致力于说明在最流行的 Linux 发行版中,从命令行安装 "
242.2300 +"Mercurial 的方法。这些发行版都提供了图形界面的包管理器,让你通过点击鼠标安装 "
242.2301 +"Mercurial;寻找的包名称是 <literal>mercurial</literal>。"
242.2302 +
242.2303 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.2304 +#: ../en/ch01-tour-basic.xml:52
242.2305 +msgid "Ubuntu and Debian:"
242.2306 +msgstr "Ubuntu 与 Debian:"
242.2307 +
242.2308 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.2309 +#: ../en/ch01-tour-basic.xml:54
242.2310 +msgid "Fedora and OpenSUSE:"
242.2311 +msgstr "Fedora and OpenSUSE:"
242.2312 +
242.2313 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.2314 +#: ../en/ch01-tour-basic.xml:56
242.2315 +msgid "Gentoo:"
242.2316 +msgstr "Gentoo:"
242.2317 +
242.2318 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.2319 +#: ../en/ch01-tour-basic.xml:62
242.2320 +msgid "Solaris"
242.2321 +msgstr "Solaris"
242.2322 +
242.2323 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2324 +#: ../en/ch01-tour-basic.xml:64
242.2325 +msgid ""
242.2326 +"SunFreeWare, at <ulink url=\"http://www.sunfreeware.com\">http://www."
242.2327 +"sunfreeware.com</ulink>, provides prebuilt packages of Mercurial."
242.2328 +msgstr ""
242.2329 +"位于 <ulink url=\"http://www.sunfreeware.com\">http://www.sunfreeware.com</"
242.2330 +"ulink> 的 SunFreeWare 提供了 Mercurial 的二进制安装包。"
242.2331 +
242.2332 +#. type: Content of: <book><chapter><sect1><title>
242.2333 +#: ../en/ch01-tour-basic.xml:73
242.2334 +msgid "Getting started"
242.2335 +msgstr "开始"
242.2336 +
242.2337 +#. type: Content of: <book><chapter><sect1><para>
242.2338 +#: ../en/ch01-tour-basic.xml:75
242.2339 +msgid ""
242.2340 +"To begin, we'll use the <command role=\"hg-cmd\">hg version</command> command "
242.2341 +"to find out whether Mercurial is actually installed properly.  The actual "
242.2342 +"version information that it prints isn't so important; it's whether it prints "
242.2343 +"anything at all that we care about."
242.2344 +msgstr ""
242.2345 +
242.2346 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.2347 +#: ../en/ch01-tour-basic.xml:84
242.2348 +msgid "Built-in help"
242.2349 +msgstr "内置帮助"
242.2350 +
242.2351 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2352 +#: ../en/ch01-tour-basic.xml:86
242.2353 +msgid ""
242.2354 +"Mercurial provides a built-in help system.  This is invaluable for those "
242.2355 +"times when you find yourself stuck trying to remember how to run a command.  "
242.2356 +"If you are completely stuck, simply run <command role=\"hg-cmd\">hg help</"
242.2357 +"command>; it will print a brief list of commands, along with a description of "
242.2358 +"what each does.  If you ask for help on a specific command (as below), it "
242.2359 +"prints more detailed information."
242.2360 +msgstr ""
242.2361 +
242.2362 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2363 +#: ../en/ch01-tour-basic.xml:97
242.2364 +msgid ""
242.2365 +"For a more impressive level of detail (which you won't usually need) run "
242.2366 +"<command role=\"hg-cmd\">hg help <option role=\"hg-opt-global\">-v</option></"
242.2367 +"command>.  The <option role=\"hg-opt-global\">-v</option> option is short for "
242.2368 +"<option role=\"hg-opt-global\">--verbose</option>, and tells Mercurial to "
242.2369 +"print more information than it usually would."
242.2370 +msgstr ""
242.2371 +
242.2372 +#. type: Content of: <book><chapter><sect1><title>
242.2373 +#: ../en/ch01-tour-basic.xml:108
242.2374 +msgid "Working with a repository"
242.2375 +msgstr "使用版本库"
242.2376 +
242.2377 +#. type: Content of: <book><chapter><sect1><para>
242.2378 +#: ../en/ch01-tour-basic.xml:110
242.2379 +msgid ""
242.2380 +"In Mercurial, everything happens inside a <emphasis>repository</emphasis>.  "
242.2381 +"The repository for a project contains all of the files that <quote>belong to</"
242.2382 +"quote> that project, along with a historical record of the project's files."
242.2383 +msgstr ""
242.2384 +
242.2385 +#. type: Content of: <book><chapter><sect1><para>
242.2386 +#: ../en/ch01-tour-basic.xml:116
242.2387 +msgid ""
242.2388 +"There's nothing particularly magical about a repository; it is simply a "
242.2389 +"directory tree in your filesystem that Mercurial treats as special. You can "
242.2390 +"rename or delete a repository any time you like, using either the command "
242.2391 +"line or your file browser."
242.2392 +msgstr ""
242.2393 +
242.2394 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.2395 +#: ../en/ch01-tour-basic.xml:123
242.2396 +msgid "Making a local copy of a repository"
242.2397 +msgstr "创建版本库的工作副本"
242.2398 +
242.2399 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2400 +#: ../en/ch01-tour-basic.xml:125
242.2401 +msgid ""
242.2402 +"<emphasis>Copying</emphasis> a repository is just a little bit special.  "
242.2403 +"While you could use a normal file copying command to make a copy of a "
242.2404 +"repository, it's best to use a built-in command that Mercurial provides.  "
242.2405 +"This command is called <command role=\"hg-cmd\">hg clone</command>, because "
242.2406 +"it makes an identical copy of an existing repository."
242.2407 +msgstr ""
242.2408 +
242.2409 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2410 +#: ../en/ch01-tour-basic.xml:134
242.2411 +msgid ""
242.2412 +"One advantage of using <command role=\"hg-cmd\">hg clone</command> is that, "
242.2413 +"as we can see above, it lets us clone repositories over the network.  Another "
242.2414 +"is that it remembers where we cloned from, which we'll find useful soon when "
242.2415 +"we want to fetch new changes from another repository."
242.2416 +msgstr ""
242.2417 +
242.2418 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2419 +#: ../en/ch01-tour-basic.xml:140
242.2420 +msgid ""
242.2421 +"If our clone succeeded, we should now have a local directory called <filename "
242.2422 +"class=\"directory\">hello</filename>.  This directory will contain some files."
242.2423 +msgstr ""
242.2424 +
242.2425 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2426 +#: ../en/ch01-tour-basic.xml:146
242.2427 +msgid ""
242.2428 +"These files have the same contents and history in our repository as they do "
242.2429 +"in the repository we cloned."
242.2430 +msgstr ""
242.2431 +
242.2432 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2433 +#: ../en/ch01-tour-basic.xml:149
242.2434 +msgid ""
242.2435 +"Every Mercurial repository is complete, self-contained, and independent.  It "
242.2436 +"contains its own private copy of a project's files and history.  As we just "
242.2437 +"mentioned, a cloned repository remembers the location of the repository it "
242.2438 +"was cloned from, but Mercurial will not communicate with that repository, or "
242.2439 +"any other, unless you tell it to."
242.2440 +msgstr ""
242.2441 +
242.2442 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2443 +#: ../en/ch01-tour-basic.xml:156
242.2444 +msgid ""
242.2445 +"What this means for now is that we're free to experiment with our repository, "
242.2446 +"safe in the knowledge that it's a private <quote>sandbox</quote> that won't "
242.2447 +"affect anyone else."
242.2448 +msgstr ""
242.2449 +
242.2450 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.2451 +#: ../en/ch01-tour-basic.xml:162
242.2452 +msgid "What's in a repository?"
242.2453 +msgstr "什么是版本库?"
242.2454 +
242.2455 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2456 +#: ../en/ch01-tour-basic.xml:164
242.2457 +msgid ""
242.2458 +"When we take a more detailed look inside a repository, we can see that it "
242.2459 +"contains a directory named <filename class=\"directory\">.hg</filename>.  "
242.2460 +"This is where Mercurial keeps all of its metadata for the repository."
242.2461 +msgstr ""
242.2462 +
242.2463 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2464 +#: ../en/ch01-tour-basic.xml:171
242.2465 +msgid ""
242.2466 +"The contents of the <filename class=\"directory\">.hg</filename> directory "
242.2467 +"and its subdirectories are private to Mercurial.  Every other file and "
242.2468 +"directory in the repository is yours to do with as you please."
242.2469 +msgstr ""
242.2470 +
242.2471 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2472 +#: ../en/ch01-tour-basic.xml:177
242.2473 +msgid ""
242.2474 +"To introduce a little terminology, the <filename class=\"directory\">.hg</"
242.2475 +"filename> directory is the <quote>real</quote> repository, and all of the "
242.2476 +"files and directories that coexist with it are said to live in the "
242.2477 +"<emphasis>working directory</emphasis>.  An easy way to remember the "
242.2478 +"distinction is that the <emphasis>repository</emphasis> contains the "
242.2479 +"<emphasis>history</emphasis> of your project, while the <emphasis>working "
242.2480 +"directory</emphasis> contains a <emphasis>snapshot</emphasis> of your project "
242.2481 +"at a particular point in history."
242.2482 +msgstr ""
242.2483 +
242.2484 +#. type: Content of: <book><chapter><sect1><title>
242.2485 +#: ../en/ch01-tour-basic.xml:192
242.2486 +msgid "A tour through history"
242.2487 +msgstr "回溯历史"
242.2488 +
242.2489 +#. type: Content of: <book><chapter><sect1><para>
242.2490 +#: ../en/ch01-tour-basic.xml:194
242.2491 +msgid ""
242.2492 +"One of the first things we might want to do with a new, unfamiliar repository "
242.2493 +"is understand its history.  The <command role=\"hg-cmd\">hg log</command> "
242.2494 +"command gives us a view of the history of changes in the repository."
242.2495 +msgstr ""
242.2496 +
242.2497 +#. type: Content of: <book><chapter><sect1><para>
242.2498 +#: ../en/ch01-tour-basic.xml:201
242.2499 +msgid ""
242.2500 +"By default, this command prints a brief paragraph of output for each change "
242.2501 +"to the project that was recorded.  In Mercurial terminology, we call each of "
242.2502 +"these recorded events a <emphasis>changeset</emphasis>, because it can "
242.2503 +"contain a record of changes to several files."
242.2504 +msgstr ""
242.2505 +
242.2506 +#. type: Content of: <book><chapter><sect1><para>
242.2507 +#: ../en/ch01-tour-basic.xml:207
242.2508 +msgid ""
242.2509 +"The fields in a record of output from <command role=\"hg-cmd\">hg log</"
242.2510 +"command> are as follows."
242.2511 +msgstr ""
242.2512 +
242.2513 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.2514 +#: ../en/ch01-tour-basic.xml:211
242.2515 +msgid ""
242.2516 +"<literal>changeset</literal>: This field has the format of a number, followed "
242.2517 +"by a colon, followed by a hexadecimal (or <emphasis>hex</emphasis>)  string.  "
242.2518 +"These are <emphasis>identifiers</emphasis> for the changeset.  The hex string "
242.2519 +"is a unique identifier: the same hex string will always refer to the same "
242.2520 +"changeset. The number is shorter and easier to type than the hex string, but "
242.2521 +"it isn't unique: the same number in two different clones of a repository may "
242.2522 +"identify different changesets.  Why provide the number at all, then? For "
242.2523 +"local convenience."
242.2524 +msgstr ""
242.2525 +
242.2526 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.2527 +#: ../en/ch01-tour-basic.xml:223
242.2528 +msgid ""
242.2529 +"<literal>user</literal>: The identity of the person who created the "
242.2530 +"changeset.  This is a free-form field, but it most often contains a person's "
242.2531 +"name and email address."
242.2532 +msgstr ""
242.2533 +
242.2534 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.2535 +#: ../en/ch01-tour-basic.xml:227
242.2536 +msgid ""
242.2537 +"<literal>date</literal>: The date and time on which the changeset was "
242.2538 +"created, and the timezone in which it was created.  (The date and time are "
242.2539 +"local to that timezone; they display what time and date it was for the person "
242.2540 +"who created the changeset.)"
242.2541 +msgstr ""
242.2542 +
242.2543 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.2544 +#: ../en/ch01-tour-basic.xml:232
242.2545 +msgid ""
242.2546 +"<literal>summary</literal>: The first line of the text message that the "
242.2547 +"creator of the changeset entered to describe the changeset."
242.2548 +msgstr ""
242.2549 +
242.2550 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.2551 +#: ../en/ch01-tour-basic.xml:236
242.2552 +msgid ""
242.2553 +"Some changesets, such as the first in the list above, have a <literal>tag</"
242.2554 +"literal> field.  A tag is another way to identify a changeset, by giving it "
242.2555 +"an easy-to-remember name. (The tag named <literal>tip</literal> is special: "
242.2556 +"it always refers to the newest change in a repository.)"
242.2557 +msgstr ""
242.2558 +
242.2559 +#. type: Content of: <book><chapter><sect1><para>
242.2560 +#: ../en/ch01-tour-basic.xml:244
242.2561 +msgid ""
242.2562 +"The default output printed by <command role=\"hg-cmd\">hg log</command> is "
242.2563 +"purely a summary; it is missing a lot of detail."
242.2564 +msgstr ""
242.2565 +
242.2566 +#. type: Content of: <book><chapter><sect1><para>
242.2567 +#: ../en/ch01-tour-basic.xml:248
242.2568 +msgid ""
242.2569 +"<xref linkend=\"fig:tour-basic:history\"/> provides a graphical "
242.2570 +"representation of the history of the <filename class=\"directory\">hello</"
242.2571 +"filename> repository, to make it a little easier to see which direction "
242.2572 +"history is <quote>flowing</quote> in.  We'll be returning to this figure "
242.2573 +"several times in this chapter and the chapter that follows."
242.2574 +msgstr ""
242.2575 +
242.2576 +#. type: Content of: <book><chapter><sect1><figure><title>
242.2577 +#: ../en/ch01-tour-basic.xml:257
242.2578 +msgid ""
242.2579 +"Graphical history of the <filename class=\"directory\">hello</filename> "
242.2580 +"repository"
242.2581 +msgstr "版本库 <filename class=\"directory\">hello</filename> 的历史图"
242.2582 +
242.2583 +#. type: Content of: <book><chapter><sect1><figure>
242.2584 +#: ../en/ch01-tour-basic.xml:259 ../en/ch02-tour-merge.xml:50
242.2585 +#: ../en/ch02-tour-merge.xml:181 ../en/ch03-concepts.xml:293
242.2586 +msgid "<placeholder type=\"mediaobject\" id=\"0\"/>"
242.2587 +msgstr ""
242.2588 +
242.2589 +#. type: Content of: <book><chapter><sect1><figure><mediaobject>
242.2590 +#: ../en/ch01-tour-basic.xml:260
242.2591 +msgid ""
242.2592 +"<imageobject><imagedata fileref=\"figs/tour-history.png\"/></imageobject>"
242.2593 +msgstr ""
242.2594 +
242.2595 +#. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject><textobject><phrase>
242.2596 +#: ../en/ch01-tour-basic.xml:261 ../en/ch02-tour-merge.xml:52
242.2597 +#: ../en/ch02-tour-merge.xml:82 ../en/ch02-tour-merge.xml:129
242.2598 +#: ../en/ch02-tour-merge.xml:183 ../en/ch02-tour-merge.xml:254
242.2599 +#: ../en/ch03-concepts.xml:57 ../en/ch03-concepts.xml:106
242.2600 +#: ../en/ch03-concepts.xml:191 ../en/ch03-concepts.xml:295
242.2601 +#: ../en/ch03-concepts.xml:346 ../en/ch03-concepts.xml:361
242.2602 +#: ../en/ch03-concepts.xml:402 ../en/ch03-concepts.xml:422
242.2603 +#: ../en/ch03-concepts.xml:465 ../en/ch05-collab.xml:276
242.2604 +#: ../en/ch08-undo.xml:365 ../en/ch08-undo.xml:412 ../en/ch08-undo.xml:477
242.2605 +#: ../en/ch08-undo.xml:515 ../en/ch11-mq.xml:412
242.2606 +msgid "XXX add text"
242.2607 +msgstr ""
242.2608 +
242.2609 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.2610 +#: ../en/ch01-tour-basic.xml:266
242.2611 +msgid "Changesets, revisions, and talking to other people"
242.2612 +msgstr "修改集,版本,与其它用户交互"
242.2613 +
242.2614 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2615 +#: ../en/ch01-tour-basic.xml:269
242.2616 +msgid ""
242.2617 +"As English is a notoriously sloppy language, and computer science has a "
242.2618 +"hallowed history of terminological confusion (why use one term when four will "
242.2619 +"do?), revision control has a variety of words and phrases that mean the same "
242.2620 +"thing.  If you are talking about Mercurial history with other people, you "
242.2621 +"will find that the word <quote>changeset</quote> is often compressed to "
242.2622 +"<quote>change</quote> or (when written)  <quote>cset</quote>, and sometimes a "
242.2623 +"changeset is referred to as a <quote>revision</quote> or a <quote>rev</quote>."
242.2624 +msgstr ""
242.2625 +
242.2626 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2627 +#: ../en/ch01-tour-basic.xml:279
242.2628 +msgid ""
242.2629 +"While it doesn't matter what <emphasis>word</emphasis> you use to refer to "
242.2630 +"the concept of <quote>a changeset</quote>, the <emphasis>identifier</"
242.2631 +"emphasis> that you use to refer to <quote>a <emphasis>specific</emphasis> "
242.2632 +"changeset</quote> is of great importance. Recall that the <literal>changeset</"
242.2633 +"literal> field in the output from <command role=\"hg-cmd\">hg log</command> "
242.2634 +"identifies a changeset using both a number and a hexadecimal string."
242.2635 +msgstr ""
242.2636 +
242.2637 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.2638 +#: ../en/ch01-tour-basic.xml:288
242.2639 +msgid ""
242.2640 +"The revision number is a handy notation that is <emphasis>only valid in that "
242.2641 +"repository</emphasis>."
242.2642 +msgstr ""
242.2643 +
242.2644 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.2645 +#: ../en/ch01-tour-basic.xml:291
242.2646 +msgid ""
242.2647 +"The hexadecimal string is the <emphasis>permanent, unchanging identifier</"
242.2648 +"emphasis> that will always identify that exact changeset in <emphasis>every</"
242.2649 +"emphasis> copy of the repository."
242.2650 +msgstr ""
242.2651 +
242.2652 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2653 +#: ../en/ch01-tour-basic.xml:297
242.2654 +msgid ""
242.2655 +"This distinction is important.  If you send someone an email talking about "
242.2656 +"<quote>revision 33</quote>, there's a high likelihood that their revision 33 "
242.2657 +"will <emphasis>not be the same</emphasis> as yours.  The reason for this is "
242.2658 +"that a revision number depends on the order in which changes arrived in a "
242.2659 +"repository, and there is no guarantee that the same changes will happen in "
242.2660 +"the same order in different repositories. Three changes <literal>a,b,c</"
242.2661 +"literal> can easily appear in one repository as <literal>0,1,2</literal>, "
242.2662 +"while in another as <literal>0,2,1</literal>."
242.2663 +msgstr ""
242.2664 +
242.2665 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2666 +#: ../en/ch01-tour-basic.xml:309
242.2667 +msgid ""
242.2668 +"Mercurial uses revision numbers purely as a convenient shorthand.  If you "
242.2669 +"need to discuss a changeset with someone, or make a record of a changeset for "
242.2670 +"some other reason (for example, in a bug report), use the hexadecimal "
242.2671 +"identifier."
242.2672 +msgstr ""
242.2673 +
242.2674 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.2675 +#: ../en/ch01-tour-basic.xml:317
242.2676 +msgid "Viewing specific revisions"
242.2677 +msgstr "察看指定版本"
242.2678 +
242.2679 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2680 +#: ../en/ch01-tour-basic.xml:319
242.2681 +msgid ""
242.2682 +"To narrow the output of <command role=\"hg-cmd\">hg log</command> down to a "
242.2683 +"single revision, use the <option role=\"hg-opt-log\">-r</option> (or <option "
242.2684 +"role=\"hg-opt-log\">--rev</option>) option.  You can use either a revision "
242.2685 +"number or a hexadecimal identifier, and you can provide as many revisions as "
242.2686 +"you want."
242.2687 +msgstr ""
242.2688 +
242.2689 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2690 +#: ../en/ch01-tour-basic.xml:328
242.2691 +msgid ""
242.2692 +"If you want to see the history of several revisions without having to list "
242.2693 +"each one, you can use <emphasis>range notation</emphasis>; this lets you "
242.2694 +"express the idea <quote>I want all revisions between <literal>abc</literal> "
242.2695 +"and <literal>def</literal>, inclusive</quote>."
242.2696 +msgstr ""
242.2697 +
242.2698 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2699 +#: ../en/ch01-tour-basic.xml:336
242.2700 +msgid ""
242.2701 +"Mercurial also honours the order in which you specify revisions, so <command "
242.2702 +"role=\"hg-cmd\">hg log -r 2:4</command> prints 2, 3, and 4. while <command "
242.2703 +"role=\"hg-cmd\">hg log -r 4:2</command> prints 4, 3, and 2."
242.2704 +msgstr ""
242.2705 +
242.2706 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.2707 +#: ../en/ch01-tour-basic.xml:343
242.2708 +msgid "More detailed information"
242.2709 +msgstr "更详细的信息"
242.2710 +
242.2711 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2712 +#: ../en/ch01-tour-basic.xml:345
242.2713 +msgid ""
242.2714 +"While the summary information printed by <command role=\"hg-cmd\">hg log</"
242.2715 +"command> is useful if you already know what you're looking for, you may need "
242.2716 +"to see a complete description of the change, or a list of the files changed, "
242.2717 +"if you're trying to decide whether a changeset is the one you're looking for. "
242.2718 +"The <command role=\"hg-cmd\">hg log</command> command's <option role=\"hg-opt-"
242.2719 +"global\">-v</option> (or <option role=\"hg-opt-global\">--verbose</option>) "
242.2720 +"option gives you this extra detail."
242.2721 +msgstr ""
242.2722 +
242.2723 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2724 +#: ../en/ch01-tour-basic.xml:357
242.2725 +msgid ""
242.2726 +"If you want to see both the description and content of a change, add the "
242.2727 +"<option role=\"hg-opt-log\">-p</option> (or <option role=\"hg-opt-log\">--"
242.2728 +"patch</option>) option.  This displays the content of a change as a "
242.2729 +"<emphasis>unified diff</emphasis> (if you've never seen a unified diff "
242.2730 +"before, see <xref linkend=\"sec:mq:patch\"/> for an overview)."
242.2731 +msgstr ""
242.2732 +
242.2733 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2734 +#: ../en/ch01-tour-basic.xml:367
242.2735 +msgid ""
242.2736 +"The <option role=\"hg-opt-log\">-p</option> option is tremendously useful, so "
242.2737 +"it's well worth remembering."
242.2738 +msgstr ""
242.2739 +
242.2740 +#. type: Content of: <book><chapter><sect1><title>
242.2741 +#: ../en/ch01-tour-basic.xml:374
242.2742 +msgid "All about command options"
242.2743 +msgstr "命令选项"
242.2744 +
242.2745 +#. type: Content of: <book><chapter><sect1><para>
242.2746 +#: ../en/ch01-tour-basic.xml:376
242.2747 +msgid ""
242.2748 +"Let's take a brief break from exploring Mercurial commands to discuss a "
242.2749 +"pattern in the way that they work; you may find this useful to keep in mind "
242.2750 +"as we continue our tour."
242.2751 +msgstr ""
242.2752 +
242.2753 +#. type: Content of: <book><chapter><sect1><para>
242.2754 +#: ../en/ch01-tour-basic.xml:380
242.2755 +msgid ""
242.2756 +"Mercurial has a consistent and straightforward approach to dealing with the "
242.2757 +"options that you can pass to commands.  It follows the conventions for "
242.2758 +"options that are common to modern Linux and Unix systems."
242.2759 +msgstr ""
242.2760 +
242.2761 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.2762 +#: ../en/ch01-tour-basic.xml:387
242.2763 +msgid ""
242.2764 +"Every option has a long name.  For example, as we've already seen, the "
242.2765 +"<command role=\"hg-cmd\">hg log</command> command accepts a <option role=\"hg-"
242.2766 +"opt-log\">--rev</option> option."
242.2767 +msgstr ""
242.2768 +
242.2769 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.2770 +#: ../en/ch01-tour-basic.xml:393
242.2771 +msgid ""
242.2772 +"Most options have short names, too.  Instead of <option role=\"hg-opt-log\">--"
242.2773 +"rev</option>, we can use <option role=\"hg-opt-log\">-r</option>.  (The "
242.2774 +"reason that some options don't have short names is that the options in "
242.2775 +"question are rarely used.)"
242.2776 +msgstr ""
242.2777 +
242.2778 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.2779 +#: ../en/ch01-tour-basic.xml:400
242.2780 +msgid ""
242.2781 +"Long options start with two dashes (e.g.  <option role=\"hg-opt-log\">--rev</"
242.2782 +"option>), while short options start with one (e.g. <option role=\"hg-opt-log"
242.2783 +"\">-r</option>)."
242.2784 +msgstr ""
242.2785 +
242.2786 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.2787 +#: ../en/ch01-tour-basic.xml:406
242.2788 +msgid ""
242.2789 +"Option naming and usage is consistent across commands.  For example, every "
242.2790 +"command that lets you specify a changeset ID or revision number accepts both "
242.2791 +"<option role=\"hg-opt-log\">-r</option> and <option role=\"hg-opt-log\">--"
242.2792 +"rev</option> arguments."
242.2793 +msgstr ""
242.2794 +
242.2795 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.2796 +#: ../en/ch01-tour-basic.xml:413
242.2797 +msgid ""
242.2798 +"If you are using short options, you can save typing by running them together. "
242.2799 +"For example, the command <command role=\"hg-cmd\">hg log -v -p -r 2</command> "
242.2800 +"can be written as <command role=\"hg-cmd\">hg log -vpr2</command>."
242.2801 +msgstr ""
242.2802 +
242.2803 +#. type: Content of: <book><chapter><sect1><para>
242.2804 +#: ../en/ch01-tour-basic.xml:420
242.2805 +msgid ""
242.2806 +"In the examples throughout this book, I use short options instead of long.  "
242.2807 +"This just reflects my own preference, so don't read anything significant into "
242.2808 +"it."
242.2809 +msgstr ""
242.2810 +
242.2811 +#. type: Content of: <book><chapter><sect1><para>
242.2812 +#: ../en/ch01-tour-basic.xml:424
242.2813 +msgid ""
242.2814 +"Most commands that print output of some kind will print more output when "
242.2815 +"passed a <option role=\"hg-opt-global\">-v</option> (or <option role=\"hg-opt-"
242.2816 +"global\">--verbose</option>) option, and less when passed <option role=\"hg-"
242.2817 +"opt-global\">-q</option> (or <option role=\"hg-opt-global\">--quiet</option>)."
242.2818 +msgstr ""
242.2819 +
242.2820 +#. type: Content of: <book><chapter><sect1><note><title>
242.2821 +#: ../en/ch01-tour-basic.xml:431
242.2822 +msgid "Option naming consistency"
242.2823 +msgstr ""
242.2824 +
242.2825 +#. type: Content of: <book><chapter><sect1><note><para>
242.2826 +#: ../en/ch01-tour-basic.xml:433
242.2827 +msgid ""
242.2828 +"Almost always, Mercurial commands use consistent option names to refer to the "
242.2829 +"same concepts.  For instance, if a command deals with changesets, you'll "
242.2830 +"always identify them with <option role=\"hg-opt-log\">--rev</option> or "
242.2831 +"<option role=\"hg-opt-log\">-r</option>.  This consistent use of option names "
242.2832 +"makes it easier to remember what options a particular command takes."
242.2833 +msgstr ""
242.2834 +
242.2835 +#. type: Content of: <book><chapter><sect1><title>
242.2836 +#: ../en/ch01-tour-basic.xml:444
242.2837 +msgid "Making and reviewing changes"
242.2838 +msgstr "创建和复审修改"
242.2839 +
242.2840 +#. type: Content of: <book><chapter><sect1><para>
242.2841 +#: ../en/ch01-tour-basic.xml:446
242.2842 +msgid ""
242.2843 +"Now that we have a grasp of viewing history in Mercurial, let's take a look "
242.2844 +"at making some changes and examining them."
242.2845 +msgstr ""
242.2846 +
242.2847 +#. type: Content of: <book><chapter><sect1><para>
242.2848 +#: ../en/ch01-tour-basic.xml:450
242.2849 +msgid ""
242.2850 +"The first thing we'll do is isolate our experiment in a repository of its "
242.2851 +"own.  We use the <command role=\"hg-cmd\">hg clone</command> command, but we "
242.2852 +"don't need to clone a copy of the remote repository.  Since we already have a "
242.2853 +"copy of it locally, we can just clone that instead.  This is much faster than "
242.2854 +"cloning over the network, and cloning a local repository uses less disk space "
242.2855 +"in most cases, too<placeholder type=\"footnote\" id=\"0\"/>."
242.2856 +msgstr ""
242.2857 +
242.2858 +#. type: Content of: <book><chapter><sect1><para><footnote><para>
242.2859 +#: ../en/ch01-tour-basic.xml:457
242.2860 +msgid ""
242.2861 +"The saving of space arises when source and destination repositories are on "
242.2862 +"the same filesystem, in which case Mercurial will use hardlinks to do copy-on-"
242.2863 +"write sharing of its internal metadata.  If that explanation meant nothing to "
242.2864 +"you, don't worry: everything happens transparently and automatically, and you "
242.2865 +"don't need to understand it."
242.2866 +msgstr ""
242.2867 +
242.2868 +#. type: Content of: <book><chapter><sect1><para>
242.2869 +#: ../en/ch01-tour-basic.xml:467
242.2870 +msgid ""
242.2871 +"As an aside, it's often good practice to keep a <quote>pristine</quote> copy "
242.2872 +"of a remote repository around, which you can then make temporary clones of to "
242.2873 +"create sandboxes for each task you want to work on.  This lets you work on "
242.2874 +"multiple tasks in parallel, each isolated from the others until it's complete "
242.2875 +"and you're ready to integrate it back.  Because local clones are so cheap, "
242.2876 +"there's almost no overhead to cloning and destroying repositories whenever "
242.2877 +"you want."
242.2878 +msgstr ""
242.2879 +
242.2880 +#. type: Content of: <book><chapter><sect1><para>
242.2881 +#: ../en/ch01-tour-basic.xml:476
242.2882 +msgid ""
242.2883 +"In our <filename class=\"directory\">my-hello</filename> repository, we have "
242.2884 +"a file <filename>hello.c</filename> that contains the classic <quote>hello, "
242.2885 +"world</quote> program."
242.2886 +msgstr ""
242.2887 +
242.2888 +#. type: Content of: <book><chapter><sect1><para>
242.2889 +#: ../en/ch01-tour-basic.xml:482
242.2890 +msgid "Let's edit this file so that it prints a second line of output."
242.2891 +msgstr ""
242.2892 +
242.2893 +#. type: Content of: <book><chapter><sect1><para>
242.2894 +#: ../en/ch01-tour-basic.xml:487
242.2895 +msgid ""
242.2896 +"Mercurial's <command role=\"hg-cmd\">hg status</command> command will tell us "
242.2897 +"what Mercurial knows about the files in the repository."
242.2898 +msgstr ""
242.2899 +
242.2900 +#. type: Content of: <book><chapter><sect1><para>
242.2901 +#: ../en/ch01-tour-basic.xml:493
242.2902 +msgid ""
242.2903 +"The <command role=\"hg-cmd\">hg status</command> command prints no output for "
242.2904 +"some files, but a line starting with <quote><literal>M</literal></quote> for "
242.2905 +"<filename>hello.c</filename>.  Unless you tell it to, <command role=\"hg-cmd"
242.2906 +"\">hg status</command> will not print any output for files that have not been "
242.2907 +"modified."
242.2908 +msgstr ""
242.2909 +
242.2910 +#. type: Content of: <book><chapter><sect1><para>
242.2911 +#: ../en/ch01-tour-basic.xml:500
242.2912 +msgid ""
242.2913 +"The <quote><literal>M</literal></quote> indicates that Mercurial has noticed "
242.2914 +"that we modified <filename>hello.c</filename>.  We didn't need to "
242.2915 +"<emphasis>inform</emphasis> Mercurial that we were going to modify the file "
242.2916 +"before we started, or that we had modified the file after we were done; it "
242.2917 +"was able to figure this out itself."
242.2918 +msgstr ""
242.2919 +
242.2920 +#. type: Content of: <book><chapter><sect1><para>
242.2921 +#: ../en/ch01-tour-basic.xml:508
242.2922 +msgid ""
242.2923 +"It's somewhat helpful to know that we've modified <filename>hello.c</"
242.2924 +"filename>, but we might prefer to know exactly <emphasis>what</emphasis> "
242.2925 +"changes we've made to it.  To do this, we use the <command role=\"hg-cmd\">hg "
242.2926 +"diff</command> command."
242.2927 +msgstr ""
242.2928 +
242.2929 +#. type: Content of: <book><chapter><sect1><title>
242.2930 +#: ../en/ch01-tour-basic.xml:517 ../en/ch11-mq.xml:187
242.2931 +msgid "Understanding patches"
242.2932 +msgstr "理解补丁"
242.2933 +
242.2934 +#. type: Content of: <book><chapter><sect1><tip><para>
242.2935 +#: ../en/ch01-tour-basic.xml:519
242.2936 +msgid ""
242.2937 +"Remember to take a look at <xref linkend=\"sec:mq:patch\"/> if you don't know "
242.2938 +"how to read output above."
242.2939 +msgstr ""
242.2940 +
242.2941 +#. type: Content of: <book><chapter><sect1><title>
242.2942 +#: ../en/ch01-tour-basic.xml:525
242.2943 +msgid "Recording changes in a new changeset"
242.2944 +msgstr "在新修改集中记录修改"
242.2945 +
242.2946 +#. type: Content of: <book><chapter><sect1><para>
242.2947 +#: ../en/ch01-tour-basic.xml:527
242.2948 +msgid ""
242.2949 +"We can modify files, build and test our changes, and use <command role=\"hg-"
242.2950 +"cmd\">hg status</command> and <command role=\"hg-cmd\">hg diff</command> to "
242.2951 +"review our changes, until we're satisfied with what we've done and arrive at "
242.2952 +"a natural stopping point where we want to record our work in a new changeset."
242.2953 +msgstr ""
242.2954 +
242.2955 +#. type: Content of: <book><chapter><sect1><para>
242.2956 +#: ../en/ch01-tour-basic.xml:534
242.2957 +msgid ""
242.2958 +"The <command role=\"hg-cmd\">hg commit</command> command lets us create a new "
242.2959 +"changeset; we'll usually refer to this as <quote>making a commit</quote> or "
242.2960 +"<quote>committing</quote>."
242.2961 +msgstr ""
242.2962 +
242.2963 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.2964 +#: ../en/ch01-tour-basic.xml:540
242.2965 +msgid "Setting up a username"
242.2966 +msgstr "配置用户名称"
242.2967 +
242.2968 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.2969 +#: ../en/ch01-tour-basic.xml:542
242.2970 +msgid ""
242.2971 +"When you try to run <command role=\"hg-cmd\">hg commit</command> for the "
242.2972 +"first time, it is not guaranteed to succeed.  Mercurial records your name and "
242.2973 +"address with each change that you commit, so that you and others will later "
242.2974 +"be able to tell who made each change.  Mercurial tries to automatically "
242.2975 +"figure out a sensible username to commit the change with.  It will attempt "
242.2976 +"each of the following methods, in order:"
242.2977 +msgstr ""
242.2978 +
242.2979 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.2980 +#: ../en/ch01-tour-basic.xml:551
242.2981 +msgid ""
242.2982 +"If you specify a <option role=\"hg-opt-commit\">-u</option> option to the "
242.2983 +"<command role=\"hg-cmd\">hg commit</command> command on the command line, "
242.2984 +"followed by a username, this is always given the highest precedence."
242.2985 +msgstr ""
242.2986 +
242.2987 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.2988 +#: ../en/ch01-tour-basic.xml:556
242.2989 +msgid ""
242.2990 +"If you have set the <envar>HGUSER</envar> environment variable, this is "
242.2991 +"checked next."
242.2992 +msgstr ""
242.2993 +
242.2994 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.2995 +#: ../en/ch01-tour-basic.xml:559
242.2996 +msgid ""
242.2997 +"If you create a file in your home directory called <filename role=\"special"
242.2998 +"\">.hgrc</filename>, with a <envar role=\"rc-item-ui\">username</envar> "
242.2999 +"entry, that will be used next.  To see what the contents of this file should "
242.3000 +"look like, refer to <xref linkend=\"sec:tour-basic:username\"/> below."
242.3001 +msgstr ""
242.3002 +
242.3003 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.3004 +#: ../en/ch01-tour-basic.xml:567
242.3005 +msgid ""
242.3006 +"If you have set the <envar>EMAIL</envar> environment variable, this will be "
242.3007 +"used next."
242.3008 +msgstr ""
242.3009 +
242.3010 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.3011 +#: ../en/ch01-tour-basic.xml:570
242.3012 +msgid ""
242.3013 +"Mercurial will query your system to find out your local user name and host "
242.3014 +"name, and construct a username from these components. Since this often "
242.3015 +"results in a username that is not very useful, it will print a warning if it "
242.3016 +"has to do this."
242.3017 +msgstr ""
242.3018 +
242.3019 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3020 +#: ../en/ch01-tour-basic.xml:577
242.3021 +msgid ""
242.3022 +"If all of these mechanisms fail, Mercurial will fail, printing an error "
242.3023 +"message.  In this case, it will not let you commit until you set up a "
242.3024 +"username."
242.3025 +msgstr ""
242.3026 +
242.3027 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3028 +#: ../en/ch01-tour-basic.xml:581
242.3029 +msgid ""
242.3030 +"You should think of the <envar>HGUSER</envar> environment variable and the "
242.3031 +"<option role=\"hg-opt-commit\">-u</option> option to the <command role=\"hg-"
242.3032 +"cmd\">hg commit</command> command as ways to <emphasis>override</emphasis> "
242.3033 +"Mercurial's default selection of username.  For normal use, the simplest and "
242.3034 +"most robust way to set a username for yourself is by creating a <filename "
242.3035 +"role=\"special\">.hgrc</filename> file; see below for details."
242.3036 +msgstr ""
242.3037 +
242.3038 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title>
242.3039 +#: ../en/ch01-tour-basic.xml:590
242.3040 +msgid "Creating a Mercurial configuration file"
242.3041 +msgstr "创建 Mercurial 的配置文件"
242.3042 +
242.3043 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.3044 +#: ../en/ch01-tour-basic.xml:592
242.3045 +msgid ""
242.3046 +"To set a user name, use your favourite editor to create a file called "
242.3047 +"<filename role=\"special\">.hgrc</filename> in your home directory.  "
242.3048 +"Mercurial will use this file to look up your personalised configuration "
242.3049 +"settings.  The initial contents of your <filename role=\"special\">.hgrc</"
242.3050 +"filename> should look like this."
242.3051 +msgstr ""
242.3052 +
242.3053 +#. type: Content of: <book><chapter><sect1><sect2><sect3><remark>
242.3054 +#: ../en/ch01-tour-basic.xml:600
242.3055 +msgid "Figure out what the appropriate directory is on Windows."
242.3056 +msgstr ""
242.3057 +
242.3058 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.3059 +#: ../en/ch01-tour-basic.xml:607
242.3060 +msgid ""
242.3061 +"The <quote><literal>[ui]</literal></quote> line begins a <emphasis>section</"
242.3062 +"emphasis> of the config file, so you can read the <quote><literal>username "
242.3063 +"= ...</literal></quote> line as meaning <quote>set the value of the "
242.3064 +"<literal>username</literal> item in the <literal>ui</literal> section</"
242.3065 +"quote>. A section continues until a new section begins, or the end of the "
242.3066 +"file.  Mercurial ignores empty lines and treats any text from "
242.3067 +"<quote><literal>#</literal></quote> to the end of a line as a comment."
242.3068 +msgstr ""
242.3069 +
242.3070 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title>
242.3071 +#: ../en/ch01-tour-basic.xml:620
242.3072 +msgid "Choosing a user name"
242.3073 +msgstr "选择用户名称"
242.3074 +
242.3075 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.3076 +#: ../en/ch01-tour-basic.xml:622
242.3077 +msgid ""
242.3078 +"You can use any text you like as the value of the <literal>username</literal> "
242.3079 +"config item, since this information is for reading by other people, but will "
242.3080 +"not be interpreted by Mercurial.  The convention that most people follow is "
242.3081 +"to use their name and email address, as in the example above."
242.3082 +msgstr ""
242.3083 +
242.3084 +#. type: Content of: <book><chapter><sect1><sect2><sect3><note><para>
242.3085 +#: ../en/ch01-tour-basic.xml:629
242.3086 +msgid ""
242.3087 +"Mercurial's built-in web server obfuscates email addresses, to make it more "
242.3088 +"difficult for the email harvesting tools that spammers use. This reduces the "
242.3089 +"likelihood that you'll start receiving more junk email if you publish a "
242.3090 +"Mercurial repository on the web."
242.3091 +msgstr ""
242.3092 +
242.3093 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.3094 +#: ../en/ch01-tour-basic.xml:639
242.3095 +msgid "Writing a commit message"
242.3096 +msgstr "写提交日志"
242.3097 +
242.3098 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3099 +#: ../en/ch01-tour-basic.xml:641
242.3100 +msgid ""
242.3101 +"When we commit a change, Mercurial drops us into a text editor, to enter a "
242.3102 +"message that will describe the modifications we've made in this changeset.  "
242.3103 +"This is called the <emphasis>commit message</emphasis>.  It will be a record "
242.3104 +"for readers of what we did and why, and it will be printed by <command role="
242.3105 +"\"hg-cmd\">hg log</command> after we've finished committing."
242.3106 +msgstr ""
242.3107 +
242.3108 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3109 +#: ../en/ch01-tour-basic.xml:651
242.3110 +msgid ""
242.3111 +"The editor that the <command role=\"hg-cmd\">hg commit</command> command "
242.3112 +"drops us into will contain an empty line or two, followed by a number of "
242.3113 +"lines starting with <quote><literal>HG:</literal></quote>."
242.3114 +msgstr ""
242.3115 +
242.3116 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3117 +#: ../en/ch01-tour-basic.xml:665
242.3118 +msgid ""
242.3119 +"Mercurial ignores the lines that start with <quote><literal>HG:</literal></"
242.3120 +"quote>; it uses them only to tell us which files it's recording changes to.  "
242.3121 +"Modifying or deleting these lines has no effect."
242.3122 +msgstr ""
242.3123 +
242.3124 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.3125 +#: ../en/ch01-tour-basic.xml:671
242.3126 +msgid "Writing a good commit message"
242.3127 +msgstr "写好提交日志"
242.3128 +
242.3129 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3130 +#: ../en/ch01-tour-basic.xml:673
242.3131 +msgid ""
242.3132 +"Since <command role=\"hg-cmd\">hg log</command> only prints the first line of "
242.3133 +"a commit message by default, it's best to write a commit message whose first "
242.3134 +"line stands alone.  Here's a real example of a commit message that "
242.3135 +"<emphasis>doesn't</emphasis> follow this guideline, and hence has a summary "
242.3136 +"that is not readable."
242.3137 +msgstr ""
242.3138 +
242.3139 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3140 +#: ../en/ch01-tour-basic.xml:687
242.3141 +msgid ""
242.3142 +"As far as the remainder of the contents of the commit message are concerned, "
242.3143 +"there are no hard-and-fast rules.  Mercurial itself doesn't interpret or care "
242.3144 +"about the contents of the commit message, though your project may have "
242.3145 +"policies that dictate a certain kind of formatting."
242.3146 +msgstr ""
242.3147 +
242.3148 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3149 +#: ../en/ch01-tour-basic.xml:693
242.3150 +msgid ""
242.3151 +"My personal preference is for short, but informative, commit messages that "
242.3152 +"tell me something that I can't figure out with a quick glance at the output "
242.3153 +"of <command role=\"hg-cmd\">hg log --patch</command>."
242.3154 +msgstr ""
242.3155 +
242.3156 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.3157 +#: ../en/ch01-tour-basic.xml:700
242.3158 +msgid "Aborting a commit"
242.3159 +msgstr "终止提交"
242.3160 +
242.3161 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3162 +#: ../en/ch01-tour-basic.xml:702
242.3163 +msgid ""
242.3164 +"If you decide that you don't want to commit while in the middle of editing a "
242.3165 +"commit message, simply exit from your editor without saving the file that "
242.3166 +"it's editing.  This will cause nothing to happen to either the repository or "
242.3167 +"the working directory."
242.3168 +msgstr ""
242.3169 +
242.3170 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3171 +#: ../en/ch01-tour-basic.xml:707
242.3172 +msgid ""
242.3173 +"If we run the <command role=\"hg-cmd\">hg commit</command> command without "
242.3174 +"any arguments, it records all of the changes we've made, as reported by "
242.3175 +"<command role=\"hg-cmd\">hg status</command> and <command role=\"hg-cmd\">hg "
242.3176 +"diff</command>."
242.3177 +msgstr ""
242.3178 +
242.3179 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.3180 +#: ../en/ch01-tour-basic.xml:714
242.3181 +msgid "Admiring our new handiwork"
242.3182 +msgstr "欣赏我们的成果"
242.3183 +
242.3184 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3185 +#: ../en/ch01-tour-basic.xml:716
242.3186 +msgid ""
242.3187 +"Once we've finished the commit, we can use the <command role=\"hg-cmd\">hg "
242.3188 +"tip</command> command to display the changeset we just created.  This command "
242.3189 +"produces output that is identical to <command role=\"hg-cmd\">hg log</"
242.3190 +"command>, but it only displays the newest revision in the repository."
242.3191 +msgstr ""
242.3192 +
242.3193 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3194 +#: ../en/ch01-tour-basic.xml:725
242.3195 +msgid ""
242.3196 +"We refer to the newest revision in the repository as the <emphasis>tip "
242.3197 +"revision</emphasis>, or simply the <emphasis>tip</emphasis>."
242.3198 +msgstr ""
242.3199 +
242.3200 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3201 +#: ../en/ch01-tour-basic.xml:729
242.3202 +msgid ""
242.3203 +"By the way, the <command role=\"hg-cmd\">hg tip</command> command accepts "
242.3204 +"many of the same options as <command role=\"hg-cmd\">hg log</command>, so "
242.3205 +"<option role=\"hg-opt-global\">-v</option> above indicates <quote>be verbose</"
242.3206 +"quote>, <option role=\"hg-opt-tip\">-p</option> specifies <quote>print a "
242.3207 +"patch</quote>.  The use of <option role=\"hg-opt-tip\">-p</option> to print "
242.3208 +"patches is another example of the consistent naming we mentioned earlier."
242.3209 +msgstr ""
242.3210 +
242.3211 +#. type: Content of: <book><chapter><sect1><title>
242.3212 +#: ../en/ch01-tour-basic.xml:741
242.3213 +msgid "Sharing changes"
242.3214 +msgstr "共享修改"
242.3215 +
242.3216 +#. type: Content of: <book><chapter><sect1><para>
242.3217 +#: ../en/ch01-tour-basic.xml:743
242.3218 +msgid ""
242.3219 +"We mentioned earlier that repositories in Mercurial are self-contained.  This "
242.3220 +"means that the changeset we just created exists only in our <filename class="
242.3221 +"\"directory\">my-hello</filename> repository.  Let's look at a few ways that "
242.3222 +"we can propagate this change into other repositories."
242.3223 +msgstr ""
242.3224 +
242.3225 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.3226 +#: ../en/ch01-tour-basic.xml:751
242.3227 +msgid "Pulling changes from another repository"
242.3228 +msgstr "从其它版本库取得修改"
242.3229 +
242.3230 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3231 +#: ../en/ch01-tour-basic.xml:752
242.3232 +msgid ""
242.3233 +"To get started, let's clone our original <filename class=\"directory\">hello</"
242.3234 +"filename> repository, which does not contain the change we just committed.  "
242.3235 +"We'll call our temporary repository <filename class=\"directory\">hello-pull</"
242.3236 +"filename>."
242.3237 +msgstr ""
242.3238 +
242.3239 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3240 +#: ../en/ch01-tour-basic.xml:760
242.3241 +msgid ""
242.3242 +"We'll use the <command role=\"hg-cmd\">hg pull</command> command to bring "
242.3243 +"changes from <filename class=\"directory\">my-hello</filename> into <filename "
242.3244 +"class=\"directory\">hello-pull</filename>.  However, blindly pulling unknown "
242.3245 +"changes into a repository is a somewhat scary prospect.  Mercurial provides "
242.3246 +"the <command role=\"hg-cmd\">hg incoming</command> command to tell us what "
242.3247 +"changes the <command role=\"hg-cmd\">hg pull</command> command "
242.3248 +"<emphasis>would</emphasis> pull into the repository, without actually pulling "
242.3249 +"the changes in."
242.3250 +msgstr ""
242.3251 +
242.3252 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3253 +#: ../en/ch01-tour-basic.xml:773
242.3254 +msgid ""
242.3255 +"Suppose you're pulling changes from a repository on the network somewhere. "
242.3256 +"While you are looking at the <command role=\"hg-cmd\">hg incoming</command> "
242.3257 +"output, and before you pull those changes, someone might have committed "
242.3258 +"something in the remote repository. This means that it's possible to pull "
242.3259 +"more changes than you saw when using <command role=\"hg-cmd\">hg incoming</"
242.3260 +"command>."
242.3261 +msgstr ""
242.3262 +
242.3263 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3264 +#: ../en/ch01-tour-basic.xml:781
242.3265 +msgid ""
242.3266 +"Bringing changes into a repository is a simple matter of running the <command "
242.3267 +"role=\"hg-cmd\">hg pull</command> command, and telling it which repository to "
242.3268 +"pull from."
242.3269 +msgstr ""
242.3270 +
242.3271 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3272 +#: ../en/ch01-tour-basic.xml:788
242.3273 +msgid ""
242.3274 +"As you can see from the before-and-after output of <command role=\"hg-cmd"
242.3275 +"\">hg tip</command>, we have successfully pulled changes into our "
242.3276 +"repository.  There remains one step before we can see these changes in the "
242.3277 +"working directory."
242.3278 +msgstr ""
242.3279 +
242.3280 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.3281 +#: ../en/ch01-tour-basic.xml:796
242.3282 +msgid "Updating the working directory"
242.3283 +msgstr "更新工作目录"
242.3284 +
242.3285 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3286 +#: ../en/ch01-tour-basic.xml:798
242.3287 +msgid ""
242.3288 +"We have so far glossed over the relationship between a repository and its "
242.3289 +"working directory.  The <command role=\"hg-cmd\">hg pull</command> command "
242.3290 +"that we ran in <xref linkend=\"sec:tour:pull\"/> brought changes into the "
242.3291 +"repository, but if we check, there's no sign of those changes in the working "
242.3292 +"directory.  This is because <command role=\"hg-cmd\">hg pull</command> does "
242.3293 +"not (by default) touch the working directory.  Instead, we use the <command "
242.3294 +"role=\"hg-cmd\">hg update</command> command to do this."
242.3295 +msgstr ""
242.3296 +
242.3297 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3298 +#: ../en/ch01-tour-basic.xml:810
242.3299 +msgid ""
242.3300 +"It might seem a bit strange that <command role=\"hg-cmd\">hg pull</command> "
242.3301 +"doesn't update the working directory automatically.  There's actually a good "
242.3302 +"reason for this: you can use <command role=\"hg-cmd\">hg update</command> to "
242.3303 +"update the working directory to the state it was in at <emphasis>any "
242.3304 +"revision</emphasis> in the history of the repository.  If you had the working "
242.3305 +"directory updated to an old revision&emdash;to hunt down the origin of a bug, "
242.3306 +"say&emdash;and ran a <command role=\"hg-cmd\">hg pull</command> which "
242.3307 +"automatically updated the working directory to a new revision, you might not "
242.3308 +"be terribly happy."
242.3309 +msgstr ""
242.3310 +
242.3311 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3312 +#: ../en/ch01-tour-basic.xml:821
242.3313 +msgid ""
242.3314 +"However, since pull-then-update is such a common thing to do, Mercurial lets "
242.3315 +"you combine the two by passing the <option role=\"hg-opt-pull\">-u</option> "
242.3316 +"option to <command role=\"hg-cmd\">hg pull</command>."
242.3317 +msgstr ""
242.3318 +
242.3319 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3320 +#: ../en/ch01-tour-basic.xml:826
242.3321 +msgid ""
242.3322 +"If you look back at the output of <command role=\"hg-cmd\">hg pull</command> "
242.3323 +"in <xref linkend=\"sec:tour:pull\"/> when we ran it without <option role=\"hg-"
242.3324 +"opt-pull\">-u</option>, you can see that it printed a helpful reminder that "
242.3325 +"we'd have to take an explicit step to update the working directory:"
242.3326 +msgstr ""
242.3327 +
242.3328 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3329 +#: ../en/ch01-tour-basic.xml:835
242.3330 +msgid ""
242.3331 +"To find out what revision the working directory is at, use the <command role="
242.3332 +"\"hg-cmd\">hg parents</command> command."
242.3333 +msgstr ""
242.3334 +
242.3335 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3336 +#: ../en/ch01-tour-basic.xml:841
242.3337 +msgid ""
242.3338 +"If you look back at <xref linkend=\"fig:tour-basic:history\"/>, you'll see "
242.3339 +"arrows connecting each changeset.  The node that the arrow leads "
242.3340 +"<emphasis>from</emphasis> in each case is a parent, and the node that the "
242.3341 +"arrow leads <emphasis>to</emphasis> is its child.  The working directory has "
242.3342 +"a parent in just the same way; this is the changeset that the working "
242.3343 +"directory currently contains."
242.3344 +msgstr ""
242.3345 +
242.3346 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3347 +#: ../en/ch01-tour-basic.xml:850
242.3348 +msgid ""
242.3349 +"To update the working directory to a particular revision, give a revision "
242.3350 +"number or changeset ID to the <command role=\"hg-cmd\">hg update</command> "
242.3351 +"command."
242.3352 +msgstr ""
242.3353 +
242.3354 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3355 +#: ../en/ch01-tour-basic.xml:857
242.3356 +msgid ""
242.3357 +"If you omit an explicit revision, <command role=\"hg-cmd\">hg update</"
242.3358 +"command> will update to the tip revision, as shown by the second call to "
242.3359 +"<command role=\"hg-cmd\">hg update</command> in the example above."
242.3360 +msgstr ""
242.3361 +
242.3362 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.3363 +#: ../en/ch01-tour-basic.xml:865
242.3364 +msgid "Pushing changes to another repository"
242.3365 +msgstr "发布修改到其它版本库"
242.3366 +
242.3367 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3368 +#: ../en/ch01-tour-basic.xml:867
242.3369 +msgid ""
242.3370 +"Mercurial lets us push changes to another repository, from the repository "
242.3371 +"we're currently visiting.  As with the example of <command role=\"hg-cmd\">hg "
242.3372 +"pull</command> above, we'll create a temporary repository to push our changes "
242.3373 +"into."
242.3374 +msgstr ""
242.3375 +
242.3376 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3377 +#: ../en/ch01-tour-basic.xml:875
242.3378 +msgid ""
242.3379 +"The <command role=\"hg-cmd\">hg outgoing</command> command tells us what "
242.3380 +"changes would be pushed into another repository."
242.3381 +msgstr ""
242.3382 +
242.3383 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3384 +#: ../en/ch01-tour-basic.xml:881
242.3385 +msgid ""
242.3386 +"And the <command role=\"hg-cmd\">hg push</command> command does the actual "
242.3387 +"push."
242.3388 +msgstr ""
242.3389 +
242.3390 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3391 +#: ../en/ch01-tour-basic.xml:887
242.3392 +msgid ""
242.3393 +"As with <command role=\"hg-cmd\">hg pull</command>, the <command role=\"hg-cmd"
242.3394 +"\">hg push</command> command does not update the working directory in the "
242.3395 +"repository that it's pushing changes into. Unlike <command role=\"hg-cmd\">hg "
242.3396 +"pull</command>, <command role=\"hg-cmd\">hg push</command> does not provide a "
242.3397 +"<literal>-u</literal> option that updates the other repository's working "
242.3398 +"directory.  This asymmetry is deliberate: the repository we're pushing to "
242.3399 +"might be on a remote server and shared between several people.  If we were to "
242.3400 +"update its working directory while someone was working in it, their work "
242.3401 +"would be disrupted."
242.3402 +msgstr ""
242.3403 +
242.3404 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3405 +#: ../en/ch01-tour-basic.xml:899
242.3406 +msgid ""
242.3407 +"What happens if we try to pull or push changes and the receiving repository "
242.3408 +"already has those changes? Nothing too exciting."
242.3409 +msgstr ""
242.3410 +
242.3411 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.3412 +#: ../en/ch01-tour-basic.xml:906
242.3413 +msgid "Sharing changes over a network"
242.3414 +msgstr "通过网络共享修改"
242.3415 +
242.3416 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3417 +#: ../en/ch01-tour-basic.xml:908
242.3418 +msgid ""
242.3419 +"The commands we have covered in the previous few sections are not limited to "
242.3420 +"working with local repositories.  Each works in exactly the same fashion over "
242.3421 +"a network connection; simply pass in a URL instead of a local path."
242.3422 +msgstr ""
242.3423 +
242.3424 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3425 +#: ../en/ch01-tour-basic.xml:916
242.3426 +msgid ""
242.3427 +"In this example, we can see what changes we could push to the remote "
242.3428 +"repository, but the repository is understandably not set up to let anonymous "
242.3429 +"users push to it."
242.3430 +msgstr ""
242.3431 +
242.3432 +#. type: Content of: <book><chapter><title>
242.3433 +#: ../en/ch02-tour-merge.xml:5
242.3434 +msgid "A tour of Mercurial: merging work"
242.3435 +msgstr "Mercurial 教程: 合并工作"
242.3436 +
242.3437 +#. type: Content of: <book><chapter><para>
242.3438 +#: ../en/ch02-tour-merge.xml:7
242.3439 +msgid ""
242.3440 +"We've now covered cloning a repository, making changes in a repository, and "
242.3441 +"pulling or pushing changes from one repository into another.  Our next step "
242.3442 +"is <emphasis>merging</emphasis> changes from separate repositories."
242.3443 +msgstr ""
242.3444 +
242.3445 +#. type: Content of: <book><chapter><sect1><title>
242.3446 +#: ../en/ch02-tour-merge.xml:13
242.3447 +msgid "Merging streams of work"
242.3448 +msgstr "合并的流程"
242.3449 +
242.3450 +#. type: Content of: <book><chapter><sect1><para>
242.3451 +#: ../en/ch02-tour-merge.xml:15
242.3452 +msgid ""
242.3453 +"Merging is a fundamental part of working with a distributed revision control "
242.3454 +"tool."
242.3455 +msgstr ""
242.3456 +
242.3457 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.3458 +#: ../en/ch02-tour-merge.xml:18
242.3459 +msgid ""
242.3460 +"Alice and Bob each have a personal copy of a repository for a project they're "
242.3461 +"collaborating on.  Alice fixes a bug in her repository; Bob adds a new "
242.3462 +"feature in his.  They want the shared repository to contain both the bug fix "
242.3463 +"and the new feature."
242.3464 +msgstr ""
242.3465 +
242.3466 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.3467 +#: ../en/ch02-tour-merge.xml:24
242.3468 +msgid ""
242.3469 +"I frequently work on several different tasks for a single project at once, "
242.3470 +"each safely isolated in its own repository. Working this way means that I "
242.3471 +"often need to merge one piece of my own work with another."
242.3472 +msgstr ""
242.3473 +
242.3474 +#. type: Content of: <book><chapter><sect1><para>
242.3475 +#: ../en/ch02-tour-merge.xml:30
242.3476 +msgid ""
242.3477 +"Because merging is such a common thing to need to do, Mercurial makes it "
242.3478 +"easy.  Let's walk through the process.  We'll begin by cloning yet another "
242.3479 +"repository (see how often they spring up?) and making a change in it."
242.3480 +msgstr ""
242.3481 +
242.3482 +#. type: Content of: <book><chapter><sect1><para>
242.3483 +#: ../en/ch02-tour-merge.xml:37
242.3484 +msgid ""
242.3485 +"We should now have two copies of <filename>hello.c</filename> with different "
242.3486 +"contents.  The histories of the two repositories have also diverged, as "
242.3487 +"illustrated in <xref linkend=\"fig:tour-merge:sep-repos\"/>."
242.3488 +msgstr ""
242.3489 +
242.3490 +#. type: Content of: <book><chapter><sect1><figure><title>
242.3491 +#: ../en/ch02-tour-merge.xml:46
242.3492 +msgid ""
242.3493 +"Divergent recent histories of the <filename class=\"directory\">my-hello</"
242.3494 +"filename> and <filename class=\"directory\">my-new-hello</filename> "
242.3495 +"repositories"
242.3496 +msgstr ""
242.3497 +"<filename class=\"directory\">my-hello</filename> 与 <filename class="
242.3498 +"\"directory\">my-new-hello</filename> 最新的历史分叉"
242.3499 +
242.3500 +#. type: Content of: <book><chapter><sect1><figure><mediaobject>
242.3501 +#: ../en/ch02-tour-merge.xml:51
242.3502 +msgid ""
242.3503 +"<imageobject><imagedata fileref=\"figs/tour-merge-sep-repos.png\"/></"
242.3504 +"imageobject>"
242.3505 +msgstr ""
242.3506 +
242.3507 +#. type: Content of: <book><chapter><sect1><para>
242.3508 +#: ../en/ch02-tour-merge.xml:56
242.3509 +msgid ""
242.3510 +"We already know that pulling changes from our <filename class=\"directory"
242.3511 +"\">my-hello</filename> repository will have no effect on the working "
242.3512 +"directory."
242.3513 +msgstr ""
242.3514 +
242.3515 +#. type: Content of: <book><chapter><sect1><para>
242.3516 +#: ../en/ch02-tour-merge.xml:62
242.3517 +msgid ""
242.3518 +"However, the <command role=\"hg-cmd\">hg pull</command> command says "
242.3519 +"something about <quote>heads</quote>."
242.3520 +msgstr ""
242.3521 +
242.3522 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.3523 +#: ../en/ch02-tour-merge.xml:66
242.3524 +msgid "Head changesets"
242.3525 +msgstr "顶点修改集"
242.3526 +
242.3527 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3528 +#: ../en/ch02-tour-merge.xml:68
242.3529 +msgid ""
242.3530 +"A head is a change that has no descendants, or children, as they're also "
242.3531 +"known.  The tip revision is thus a head, because the newest revision in a "
242.3532 +"repository doesn't have any children, but a repository can contain more than "
242.3533 +"one head."
242.3534 +msgstr ""
242.3535 +
242.3536 +#. type: Content of: <book><chapter><sect1><sect2><figure><title>
242.3537 +#: ../en/ch02-tour-merge.xml:75
242.3538 +msgid ""
242.3539 +"Repository contents after pulling from <filename class=\"directory\">my-"
242.3540 +"hello</filename> into <filename class=\"directory\">my-new-hello</filename>"
242.3541 +msgstr ""
242.3542 +"从 <filename class=\"directory\">my-hello</filename> 拉到 <filename class="
242.3543 +"\"directory\">my-new-hello</filename> 之后版本库的内容"
242.3544 +
242.3545 +#. type: Content of: <book><chapter><sect1><sect2><figure>
242.3546 +#: ../en/ch02-tour-merge.xml:78 ../en/ch02-tour-merge.xml:125
242.3547 +#: ../en/ch02-tour-merge.xml:250 ../en/ch03-concepts.xml:55
242.3548 +#: ../en/ch03-concepts.xml:104 ../en/ch03-concepts.xml:189
242.3549 +#: ../en/ch03-concepts.xml:344 ../en/ch03-concepts.xml:359
242.3550 +#: ../en/ch03-concepts.xml:400 ../en/ch03-concepts.xml:420
242.3551 +#: ../en/ch03-concepts.xml:461 ../en/ch05-collab.xml:274
242.3552 +#: ../en/ch08-undo.xml:363 ../en/ch08-undo.xml:410 ../en/ch08-undo.xml:475
242.3553 +#: ../en/ch08-undo.xml:513 ../en/ch11-mq.xml:410
242.3554 +msgid "  <placeholder type=\"mediaobject\" id=\"0\"/>"
242.3555 +msgstr ""
242.3556 +
242.3557 +#. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject>
242.3558 +#: ../en/ch02-tour-merge.xml:79
242.3559 +msgid ""
242.3560 +"<imageobject> <imagedata fileref=\"figs/tour-merge-pull.png\"/> </imageobject>"
242.3561 +msgstr ""
242.3562 +
242.3563 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3564 +#: ../en/ch02-tour-merge.xml:86
242.3565 +msgid ""
242.3566 +"In <xref linkend=\"fig:tour-merge:pull\"/>, you can see the effect of the "
242.3567 +"pull from <filename class=\"directory\">my-hello</filename> into <filename "
242.3568 +"class=\"directory\">my-new-hello</filename>.  The history that was already "
242.3569 +"present in <filename class=\"directory\">my-new-hello</filename> is "
242.3570 +"untouched, but a new revision has been added.  By referring to <xref linkend="
242.3571 +"\"fig:tour-merge:sep-repos\"/>, we can see that the <emphasis>changeset ID</"
242.3572 +"emphasis> remains the same in the new repository, but the <emphasis>revision "
242.3573 +"number</emphasis> has changed.  (This, incidentally, is a fine example of why "
242.3574 +"it's not safe to use revision numbers when discussing changesets.)  We can "
242.3575 +"view the heads in a repository using the <command role=\"hg-cmd\">hg heads</"
242.3576 +"command> command."
242.3577 +msgstr ""
242.3578 +
242.3579 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.3580 +#: ../en/ch02-tour-merge.xml:105
242.3581 +msgid "Performing the merge"
242.3582 +msgstr "执行合并"
242.3583 +
242.3584 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3585 +#: ../en/ch02-tour-merge.xml:107
242.3586 +msgid ""
242.3587 +"What happens if we try to use the normal <command role=\"hg-cmd\">hg update</"
242.3588 +"command> command to update to the new tip?"
242.3589 +msgstr ""
242.3590 +
242.3591 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3592 +#: ../en/ch02-tour-merge.xml:113
242.3593 +msgid ""
242.3594 +"Mercurial is telling us that the <command role=\"hg-cmd\">hg update</command> "
242.3595 +"command won't do a merge; it won't update the working directory when it "
242.3596 +"thinks we might be wanting to do a merge, unless we force it to do so.  "
242.3597 +"Instead, we use the <command role=\"hg-cmd\">hg merge</command> command to "
242.3598 +"merge the two heads."
242.3599 +msgstr ""
242.3600 +
242.3601 +#. type: Content of: <book><chapter><sect1><sect2><figure><title>
242.3602 +#: ../en/ch02-tour-merge.xml:123
242.3603 +msgid "Working directory and repository during merge, and following commit"
242.3604 +msgstr "在合并期间,以及提交之后的工作目录与版本库"
242.3605 +
242.3606 +#. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject>
242.3607 +#: ../en/ch02-tour-merge.xml:126
242.3608 +msgid ""
242.3609 +"<imageobject> <imagedata fileref=\"figs/tour-merge-merge.png\"/> </"
242.3610 +"imageobject>"
242.3611 +msgstr ""
242.3612 +
242.3613 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3614 +#: ../en/ch02-tour-merge.xml:133
242.3615 +msgid ""
242.3616 +"This updates the working directory so that it contains changes from "
242.3617 +"<emphasis>both</emphasis> heads, which is reflected in both the output of "
242.3618 +"<command role=\"hg-cmd\">hg parents</command> and the contents of "
242.3619 +"<filename>hello.c</filename>."
242.3620 +msgstr ""
242.3621 +
242.3622 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.3623 +#: ../en/ch02-tour-merge.xml:143
242.3624 +msgid "Committing the results of the merge"
242.3625 +msgstr "提交合并结果"
242.3626 +
242.3627 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3628 +#: ../en/ch02-tour-merge.xml:145
242.3629 +msgid ""
242.3630 +"Whenever we've done a merge, <command role=\"hg-cmd\">hg parents</command> "
242.3631 +"will display two parents until we <command role=\"hg-cmd\">hg commit</"
242.3632 +"command> the results of the merge."
242.3633 +msgstr ""
242.3634 +
242.3635 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3636 +#: ../en/ch02-tour-merge.xml:152
242.3637 +msgid ""
242.3638 +"We now have a new tip revision; notice that it has <emphasis>both</emphasis> "
242.3639 +"of our former heads as its parents.  These are the same revisions that were "
242.3640 +"previously displayed by <command role=\"hg-cmd\">hg parents</command>."
242.3641 +msgstr ""
242.3642 +
242.3643 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3644 +#: ../en/ch02-tour-merge.xml:159
242.3645 +msgid ""
242.3646 +"In <xref linkend=\"fig:tour-merge:merge\"/>, you can see a representation of "
242.3647 +"what happens to the working directory during the merge, and how this affects "
242.3648 +"the repository when the commit happens.  During the merge, the working "
242.3649 +"directory has two parent changesets, and these become the parents of the new "
242.3650 +"changeset."
242.3651 +msgstr ""
242.3652 +
242.3653 +#. type: Content of: <book><chapter><sect1><title>
242.3654 +#: ../en/ch02-tour-merge.xml:170
242.3655 +msgid "Merging conflicting changes"
242.3656 +msgstr "合并有冲突的改变"
242.3657 +
242.3658 +#. type: Content of: <book><chapter><sect1><para>
242.3659 +#: ../en/ch02-tour-merge.xml:172
242.3660 +msgid ""
242.3661 +"Most merges are simple affairs, but sometimes you'll find yourself merging "
242.3662 +"changes where each modifies the same portions of the same files.  Unless both "
242.3663 +"modifications are identical, this results in a <emphasis>conflict</emphasis>, "
242.3664 +"where you have to decide how to reconcile the different changes into "
242.3665 +"something coherent."
242.3666 +msgstr ""
242.3667 +
242.3668 +#. type: Content of: <book><chapter><sect1><figure><title>
242.3669 +#: ../en/ch02-tour-merge.xml:180
242.3670 +msgid "Conflicting changes to a document"
242.3671 +msgstr "冲突的修改"
242.3672 +
242.3673 +#. type: Content of: <book><chapter><sect1><figure><mediaobject>
242.3674 +#: ../en/ch02-tour-merge.xml:182
242.3675 +msgid ""
242.3676 +"<imageobject><imagedata fileref=\"figs/tour-merge-conflict.png\"/></"
242.3677 +"imageobject>"
242.3678 +msgstr ""
242.3679 +
242.3680 +#. type: Content of: <book><chapter><sect1><para>
242.3681 +#: ../en/ch02-tour-merge.xml:187
242.3682 +msgid ""
242.3683 +"<xref linkend=\"fig:tour-merge:conflict\"/> illustrates an instance of two "
242.3684 +"conflicting changes to a document.  We started with a single version of the "
242.3685 +"file; then we made some changes; while someone else made different changes to "
242.3686 +"the same text.  Our task in resolving the conflicting changes is to decide "
242.3687 +"what the file should look like."
242.3688 +msgstr ""
242.3689 +
242.3690 +#. type: Content of: <book><chapter><sect1><para>
242.3691 +#: ../en/ch02-tour-merge.xml:194
242.3692 +msgid ""
242.3693 +"Mercurial doesn't have a built-in facility for handling conflicts. Instead, "
242.3694 +"it runs an external program called <command>hgmerge</command>.  This is a "
242.3695 +"shell script that is bundled with Mercurial; you can change it to behave "
242.3696 +"however you please.  What it does by default is try to find one of several "
242.3697 +"different merging tools that are likely to be installed on your system.  It "
242.3698 +"first tries a few fully automatic merging tools; if these don't succeed "
242.3699 +"(because the resolution process requires human guidance) or aren't present, "
242.3700 +"the script tries a few different graphical merging tools."
242.3701 +msgstr ""
242.3702 +
242.3703 +#. type: Content of: <book><chapter><sect1><para>
242.3704 +#: ../en/ch02-tour-merge.xml:205
242.3705 +msgid ""
242.3706 +"It's also possible to get Mercurial to run another program or script instead "
242.3707 +"of <command>hgmerge</command>, by setting the <envar>HGMERGE</envar> "
242.3708 +"environment variable to the name of your preferred program."
242.3709 +msgstr ""
242.3710 +
242.3711 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.3712 +#: ../en/ch02-tour-merge.xml:211
242.3713 +msgid "Using a graphical merge tool"
242.3714 +msgstr "使用图形合并工具"
242.3715 +
242.3716 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3717 +#: ../en/ch02-tour-merge.xml:213
242.3718 +msgid ""
242.3719 +"My preferred graphical merge tool is <command>kdiff3</command>, which I'll "
242.3720 +"use to describe the features that are common to graphical file merging "
242.3721 +"tools.  You can see a screenshot of <command>kdiff3</command> in action in "
242.3722 +"<xref linkend=\"fig:tour-merge:kdiff3\"/>.  The kind of merge it is "
242.3723 +"performing is called a <emphasis>three-way merge</emphasis>, because there "
242.3724 +"are three different versions of the file of interest to us.  The tool thus "
242.3725 +"splits the upper portion of the window into three panes:"
242.3726 +msgstr ""
242.3727 +
242.3728 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.3729 +#: ../en/ch02-tour-merge.xml:223
242.3730 +msgid ""
242.3731 +"At the left is the <emphasis>base</emphasis> version of the file, i.e. the "
242.3732 +"most recent version from which the two versions we're trying to merge are "
242.3733 +"descended."
242.3734 +msgstr ""
242.3735 +
242.3736 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.3737 +#: ../en/ch02-tour-merge.xml:228
242.3738 +msgid ""
242.3739 +"In the middle is <quote>our</quote> version of the file, with the contents "
242.3740 +"that we modified."
242.3741 +msgstr ""
242.3742 +
242.3743 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.3744 +#: ../en/ch02-tour-merge.xml:231
242.3745 +msgid ""
242.3746 +"On the right is <quote>their</quote> version of the file, the one that from "
242.3747 +"the changeset that we're trying to merge with."
242.3748 +msgstr ""
242.3749 +
242.3750 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3751 +#: ../en/ch02-tour-merge.xml:235
242.3752 +msgid ""
242.3753 +"In the pane below these is the current <emphasis>result</emphasis> of the "
242.3754 +"merge. Our task is to replace all of the red text, which indicates unresolved "
242.3755 +"conflicts, with some sensible merger of the <quote>ours</quote> and "
242.3756 +"<quote>theirs</quote> versions of the file."
242.3757 +msgstr ""
242.3758 +
242.3759 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3760 +#: ../en/ch02-tour-merge.xml:242
242.3761 +msgid ""
242.3762 +"All four of these panes are <emphasis>locked together</emphasis>; if we "
242.3763 +"scroll vertically or horizontally in any of them, the others are updated to "
242.3764 +"display the corresponding sections of their respective files."
242.3765 +msgstr ""
242.3766 +
242.3767 +#. type: Content of: <book><chapter><sect1><sect2><figure><title>
242.3768 +#: ../en/ch02-tour-merge.xml:248
242.3769 +msgid "Using <command>kdiff3</command> to merge versions of a file"
242.3770 +msgstr "使用 <command>kdiff3</command> 合并文件的不同版本"
242.3771 +
242.3772 +#. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject>
242.3773 +#: ../en/ch02-tour-merge.xml:251
242.3774 +msgid ""
242.3775 +"<imageobject> <imagedata width=\"100%\" fileref=\"figs/kdiff3.png\"/></"
242.3776 +"imageobject>"
242.3777 +msgstr ""
242.3778 +
242.3779 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3780 +#: ../en/ch02-tour-merge.xml:259
242.3781 +msgid ""
242.3782 +"For each conflicting portion of the file, we can choose to resolve the "
242.3783 +"conflict using some combination of text from the base version, ours, or "
242.3784 +"theirs.  We can also manually edit the merged file at any time, in case we "
242.3785 +"need to make further modifications."
242.3786 +msgstr ""
242.3787 +
242.3788 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3789 +#: ../en/ch02-tour-merge.xml:265
242.3790 +msgid ""
242.3791 +"There are <emphasis>many</emphasis> file merging tools available, too many to "
242.3792 +"cover here.  They vary in which platforms they are available for, and in "
242.3793 +"their particular strengths and weaknesses.  Most are tuned for merging files "
242.3794 +"containing plain text, while a few are aimed at specialised file formats "
242.3795 +"(generally XML)."
242.3796 +msgstr ""
242.3797 +
242.3798 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.3799 +#: ../en/ch02-tour-merge.xml:274
242.3800 +msgid "A worked example"
242.3801 +msgstr "合并实例"
242.3802 +
242.3803 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3804 +#: ../en/ch02-tour-merge.xml:276
242.3805 +msgid ""
242.3806 +"In this example, we will reproduce the file modification history of <xref "
242.3807 +"linkend=\"fig:tour-merge:conflict\"/> above.  Let's begin by creating a "
242.3808 +"repository with a base version of our document."
242.3809 +msgstr ""
242.3810 +
242.3811 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3812 +#: ../en/ch02-tour-merge.xml:283
242.3813 +msgid "We'll clone the repository and make a change to the file."
242.3814 +msgstr ""
242.3815 +
242.3816 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3817 +#: ../en/ch02-tour-merge.xml:288
242.3818 +msgid ""
242.3819 +"And another clone, to simulate someone else making a change to the file. "
242.3820 +"(This hints at the idea that it's not all that unusual to merge with yourself "
242.3821 +"when you isolate tasks in separate repositories, and indeed to find and "
242.3822 +"resolve conflicts while doing so.)"
242.3823 +msgstr ""
242.3824 +
242.3825 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3826 +#: ../en/ch02-tour-merge.xml:296
242.3827 +msgid ""
242.3828 +"Having created two different versions of the file, we'll set up an "
242.3829 +"environment suitable for running our merge."
242.3830 +msgstr ""
242.3831 +
242.3832 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3833 +#: ../en/ch02-tour-merge.xml:302
242.3834 +msgid ""
242.3835 +"In this example, I won't use Mercurial's normal <command>hgmerge</command> "
242.3836 +"program to do the merge, because it would drop my nice automated example-"
242.3837 +"running tool into a graphical user interface.  Instead, I'll set "
242.3838 +"<envar>HGMERGE</envar> to tell Mercurial to use the non-interactive "
242.3839 +"<command>merge</command> command.  This is bundled with many Unix-like "
242.3840 +"systems. If you're following this example on your computer, don't bother "
242.3841 +"setting <envar>HGMERGE</envar>."
242.3842 +msgstr ""
242.3843 +
242.3844 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3845 +#: ../en/ch02-tour-merge.xml:312
242.3846 +msgid "<emphasis role=\"bold\">XXX FIX THIS EXAMPLE.</emphasis>"
242.3847 +msgstr ""
242.3848 +
242.3849 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3850 +#: ../en/ch02-tour-merge.xml:317
242.3851 +msgid ""
242.3852 +"Because <command>merge</command> can't resolve the conflicting changes, it "
242.3853 +"leaves <emphasis>merge markers</emphasis> inside the file that has conflicts, "
242.3854 +"indicating which lines have conflicts, and whether they came from our version "
242.3855 +"of the file or theirs."
242.3856 +msgstr ""
242.3857 +
242.3858 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3859 +#: ../en/ch02-tour-merge.xml:323
242.3860 +msgid ""
242.3861 +"Mercurial can tell from the way <command>merge</command> exits that it wasn't "
242.3862 +"able to merge successfully, so it tells us what commands we'll need to run if "
242.3863 +"we want to redo the merging operation.  This could be useful if, for example, "
242.3864 +"we were running a graphical merge tool and quit because we were confused or "
242.3865 +"realised we had made a mistake."
242.3866 +msgstr ""
242.3867 +
242.3868 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3869 +#: ../en/ch02-tour-merge.xml:330
242.3870 +msgid ""
242.3871 +"If automatic or manual merges fail, there's nothing to prevent us from "
242.3872 +"<quote>fixing up</quote> the affected files ourselves, and committing the "
242.3873 +"results of our merge:"
242.3874 +msgstr ""
242.3875 +
242.3876 +#. type: Content of: <book><chapter><sect1><title>
242.3877 +#: ../en/ch02-tour-merge.xml:339
242.3878 +msgid "Simplifying the pull-merge-commit sequence"
242.3879 +msgstr "简化拉-合并-提交程序"
242.3880 +
242.3881 +#. type: Content of: <book><chapter><sect1><para>
242.3882 +#: ../en/ch02-tour-merge.xml:341
242.3883 +msgid ""
242.3884 +"The process of merging changes as outlined above is straightforward, but "
242.3885 +"requires running three commands in sequence."
242.3886 +msgstr ""
242.3887 +
242.3888 +#. type: Content of: <book><chapter><sect1><para>
242.3889 +#: ../en/ch02-tour-merge.xml:347
242.3890 +msgid ""
242.3891 +"In the case of the final commit, you also need to enter a commit message, "
242.3892 +"which is almost always going to be a piece of uninteresting "
242.3893 +"<quote>boilerplate</quote> text."
242.3894 +msgstr ""
242.3895 +
242.3896 +#. type: Content of: <book><chapter><sect1><para>
242.3897 +#: ../en/ch02-tour-merge.xml:351
242.3898 +msgid ""
242.3899 +"It would be nice to reduce the number of steps needed, if this were "
242.3900 +"possible.  Indeed, Mercurial is distributed with an extension called <literal "
242.3901 +"role=\"hg-ext\">fetch</literal> that does just this."
242.3902 +msgstr ""
242.3903 +
242.3904 +#. type: Content of: <book><chapter><sect1><para>
242.3905 +#: ../en/ch02-tour-merge.xml:356
242.3906 +msgid ""
242.3907 +"Mercurial provides a flexible extension mechanism that lets people extend its "
242.3908 +"functionality, while keeping the core of Mercurial small and easy to deal "
242.3909 +"with.  Some extensions add new commands that you can use from the command "
242.3910 +"line, while others work <quote>behind the scenes,</quote> for example adding "
242.3911 +"capabilities to the server."
242.3912 +msgstr ""
242.3913 +
242.3914 +#. type: Content of: <book><chapter><sect1><para>
242.3915 +#: ../en/ch02-tour-merge.xml:363
242.3916 +msgid ""
242.3917 +"The <literal role=\"hg-ext\">fetch</literal> extension adds a new command "
242.3918 +"called, not surprisingly, <command role=\"hg-cmd\">hg fetch</command>.  This "
242.3919 +"extension acts as a combination of <command role=\"hg-cmd\">hg pull</"
242.3920 +"command>, <command role=\"hg-cmd\">hg update</command> and <command role=\"hg-"
242.3921 +"cmd\">hg merge</command>.  It begins by pulling changes from another "
242.3922 +"repository into the current repository.  If it finds that the changes added a "
242.3923 +"new head to the repository, it begins a merge, then commits the result of the "
242.3924 +"merge with an automatically-generated commit message.  If no new heads were "
242.3925 +"added, it updates the working directory to the new tip changeset."
242.3926 +msgstr ""
242.3927 +
242.3928 +#. type: Content of: <book><chapter><sect1><para>
242.3929 +#: ../en/ch02-tour-merge.xml:376
242.3930 +msgid ""
242.3931 +"Enabling the <literal role=\"hg-ext\">fetch</literal> extension is easy.  "
242.3932 +"Edit your <filename role=\"special\">.hgrc</filename>, and either go to the "
242.3933 +"<literal role=\"rc-extensions\">extensions</literal> section or create an "
242.3934 +"<literal role=\"rc-extensions\">extensions</literal> section. Then add a line "
242.3935 +"that simply reads <quote><literal>fetch </literal></quote>."
242.3936 +msgstr ""
242.3937 +
242.3938 +#. type: Content of: <book><chapter><sect1><para>
242.3939 +#: ../en/ch02-tour-merge.xml:385
242.3940 +msgid ""
242.3941 +"(Normally, on the right-hand side of the <quote><literal>=</literal></quote> "
242.3942 +"would appear the location of the extension, but since the <literal role=\"hg-"
242.3943 +"ext\">fetch</literal> extension is in the standard distribution, Mercurial "
242.3944 +"knows where to search for it.)"
242.3945 +msgstr ""
242.3946 +
242.3947 +#. type: Content of: <book><chapter><title>
242.3948 +#: ../en/ch03-concepts.xml:5
242.3949 +msgid "Behind the scenes"
242.3950 +msgstr "Mercurial 内幕"
242.3951 +
242.3952 +#. type: Content of: <book><chapter><para>
242.3953 +#: ../en/ch03-concepts.xml:7
242.3954 +msgid ""
242.3955 +"Unlike many revision control systems, the concepts upon which Mercurial is "
242.3956 +"built are simple enough that it's easy to understand how the software really "
242.3957 +"works.  Knowing this certainly isn't necessary, but I find it useful to have "
242.3958 +"a <quote>mental model</quote> of what's going on."
242.3959 +msgstr ""
242.3960 +
242.3961 +#. type: Content of: <book><chapter><para>
242.3962 +#: ../en/ch03-concepts.xml:13
242.3963 +msgid ""
242.3964 +"This understanding gives me confidence that Mercurial has been carefully "
242.3965 +"designed to be both <emphasis>safe</emphasis> and <emphasis>efficient</"
242.3966 +"emphasis>.  And just as importantly, if it's easy for me to retain a good "
242.3967 +"idea of what the software is doing when I perform a revision control task, "
242.3968 +"I'm less likely to be surprised by its behaviour."
242.3969 +msgstr ""
242.3970 +
242.3971 +#. type: Content of: <book><chapter><para>
242.3972 +#: ../en/ch03-concepts.xml:20
242.3973 +msgid ""
242.3974 +"In this chapter, we'll initially cover the core concepts behind Mercurial's "
242.3975 +"design, then continue to discuss some of the interesting details of its "
242.3976 +"implementation."
242.3977 +msgstr ""
242.3978 +
242.3979 +#. type: Content of: <book><chapter><sect1><title>
242.3980 +#: ../en/ch03-concepts.xml:25
242.3981 +msgid "Mercurial's historical record"
242.3982 +msgstr "Mercurial 的历史记录"
242.3983 +
242.3984 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.3985 +#: ../en/ch03-concepts.xml:28
242.3986 +msgid "Tracking the history of a single file"
242.3987 +msgstr "跟踪单一文件的历史"
242.3988 +
242.3989 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.3990 +#: ../en/ch03-concepts.xml:30
242.3991 +msgid ""
242.3992 +"When Mercurial tracks modifications to a file, it stores the history of that "
242.3993 +"file in a metadata object called a <emphasis>filelog</emphasis>.  Each entry "
242.3994 +"in the filelog contains enough information to reconstruct one revision of the "
242.3995 +"file that is being tracked.  Filelogs are stored as files in the <filename "
242.3996 +"role=\"special\" class=\"directory\">.hg/store/data</filename> directory.  A "
242.3997 +"filelog contains two kinds of information: revision data, and an index to "
242.3998 +"help Mercurial to find a revision efficiently."
242.3999 +msgstr ""
242.4000 +
242.4001 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4002 +#: ../en/ch03-concepts.xml:41
242.4003 +msgid ""
242.4004 +"A file that is large, or has a lot of history, has its filelog stored in "
242.4005 +"separate data (<quote><literal>.d</literal></quote> suffix) and index "
242.4006 +"(<quote><literal>.i</literal></quote> suffix) files.  For small files without "
242.4007 +"much history, the revision data and index are combined in a single "
242.4008 +"<quote><literal>.i</literal></quote> file.  The correspondence between a file "
242.4009 +"in the working directory and the filelog that tracks its history in the "
242.4010 +"repository is illustrated in <xref linkend=\"fig:concepts:filelog\"/>."
242.4011 +msgstr ""
242.4012 +
242.4013 +#. type: Content of: <book><chapter><sect1><sect2><figure><title>
242.4014 +#: ../en/ch03-concepts.xml:53
242.4015 +msgid ""
242.4016 +"Relationships between files in working directory and filelogs in repository"
242.4017 +msgstr "工作目录中的文件与版本库中的文件日志之间的关系"
242.4018 +
242.4019 +#. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject>
242.4020 +#: ../en/ch03-concepts.xml:56
242.4021 +msgid "<imageobject><imagedata fileref=\"figs/filelog.png\"/></imageobject>"
242.4022 +msgstr ""
242.4023 +
242.4024 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.4025 +#: ../en/ch03-concepts.xml:63
242.4026 +msgid "Managing tracked files"
242.4027 +msgstr "管理跟踪的文件"
242.4028 +
242.4029 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4030 +#: ../en/ch03-concepts.xml:65
242.4031 +msgid ""
242.4032 +"Mercurial uses a structure called a <emphasis>manifest</emphasis> to collect "
242.4033 +"together information about the files that it tracks.  Each entry in the "
242.4034 +"manifest contains information about the files present in a single changeset.  "
242.4035 +"An entry records which files are present in the changeset, the revision of "
242.4036 +"each file, and a few other pieces of file metadata."
242.4037 +msgstr ""
242.4038 +
242.4039 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.4040 +#: ../en/ch03-concepts.xml:75
242.4041 +msgid "Recording changeset information"
242.4042 +msgstr "记录修改集信息"
242.4043 +
242.4044 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4045 +#: ../en/ch03-concepts.xml:77
242.4046 +msgid ""
242.4047 +"The <emphasis>changelog</emphasis> contains information about each "
242.4048 +"changeset.  Each revision records who committed a change, the changeset "
242.4049 +"comment, other pieces of changeset-related information, and the revision of "
242.4050 +"the manifest to use."
242.4051 +msgstr ""
242.4052 +
242.4053 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.4054 +#: ../en/ch03-concepts.xml:85
242.4055 +msgid "Relationships between revisions"
242.4056 +msgstr "版本之间的关系"
242.4057 +
242.4058 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4059 +#: ../en/ch03-concepts.xml:87
242.4060 +msgid ""
242.4061 +"Within a changelog, a manifest, or a filelog, each revision stores a pointer "
242.4062 +"to its immediate parent (or to its two parents, if it's a merge revision).  "
242.4063 +"As I mentioned above, there are also relationships between revisions "
242.4064 +"<emphasis>across</emphasis> these structures, and they are hierarchical in "
242.4065 +"nature."
242.4066 +msgstr ""
242.4067 +
242.4068 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4069 +#: ../en/ch03-concepts.xml:94
242.4070 +msgid ""
242.4071 +"For every changeset in a repository, there is exactly one revision stored in "
242.4072 +"the changelog.  Each revision of the changelog contains a pointer to a single "
242.4073 +"revision of the manifest.  A revision of the manifest stores a pointer to a "
242.4074 +"single revision of each filelog tracked when that changeset was created.  "
242.4075 +"These relationships are illustrated in <xref linkend=\"fig:concepts:metadata"
242.4076 +"\"/>."
242.4077 +msgstr ""
242.4078 +
242.4079 +#. type: Content of: <book><chapter><sect1><sect2><figure><title>
242.4080 +#: ../en/ch03-concepts.xml:103
242.4081 +msgid "Metadata relationships"
242.4082 +msgstr "元数据之间的关系"
242.4083 +
242.4084 +#. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject>
242.4085 +#: ../en/ch03-concepts.xml:105
242.4086 +msgid "<imageobject><imagedata fileref=\"figs/metadata.png\"/></imageobject>"
242.4087 +msgstr ""
242.4088 +
242.4089 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4090 +#: ../en/ch03-concepts.xml:110
242.4091 +msgid ""
242.4092 +"As the illustration shows, there is <emphasis>not</emphasis> a <quote>one to "
242.4093 +"one</quote> relationship between revisions in the changelog, manifest, or "
242.4094 +"filelog. If the manifest hasn't changed between two changesets, the changelog "
242.4095 +"entries for those changesets will point to the same revision of the "
242.4096 +"manifest.  If a file that Mercurial tracks hasn't changed between two "
242.4097 +"changesets, the entry for that file in the two revisions of the manifest will "
242.4098 +"point to the same revision of its filelog."
242.4099 +msgstr ""
242.4100 +
242.4101 +#. type: Content of: <book><chapter><sect1><title>
242.4102 +#: ../en/ch03-concepts.xml:123
242.4103 +msgid "Safe, efficient storage"
242.4104 +msgstr "安全,高效的存储"
242.4105 +
242.4106 +#. type: Content of: <book><chapter><sect1><para>
242.4107 +#: ../en/ch03-concepts.xml:125
242.4108 +msgid ""
242.4109 +"The underpinnings of changelogs, manifests, and filelogs are provided by a "
242.4110 +"single structure called the <emphasis>revlog</emphasis>."
242.4111 +msgstr ""
242.4112 +
242.4113 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.4114 +#: ../en/ch03-concepts.xml:130
242.4115 +msgid "Efficient storage"
242.4116 +msgstr "高效存储"
242.4117 +
242.4118 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4119 +#: ../en/ch03-concepts.xml:132
242.4120 +msgid ""
242.4121 +"The revlog provides efficient storage of revisions using a <emphasis>delta</"
242.4122 +"emphasis> mechanism.  Instead of storing a complete copy of a file for each "
242.4123 +"revision, it stores the changes needed to transform an older revision into "
242.4124 +"the new revision.  For many kinds of file data, these deltas are typically a "
242.4125 +"fraction of a percent of the size of a full copy of a file."
242.4126 +msgstr ""
242.4127 +
242.4128 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4129 +#: ../en/ch03-concepts.xml:140
242.4130 +msgid ""
242.4131 +"Some obsolete revision control systems can only work with deltas of text "
242.4132 +"files.  They must either store binary files as complete snapshots or encoded "
242.4133 +"into a text representation, both of which are wasteful approaches.  Mercurial "
242.4134 +"can efficiently handle deltas of files with arbitrary binary contents; it "
242.4135 +"doesn't need to treat text as special."
242.4136 +msgstr ""
242.4137 +
242.4138 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.4139 +#: ../en/ch03-concepts.xml:149
242.4140 +msgid "Safe operation"
242.4141 +msgstr "安全操作"
242.4142 +
242.4143 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4144 +#: ../en/ch03-concepts.xml:151
242.4145 +msgid ""
242.4146 +"Mercurial only ever <emphasis>appends</emphasis> data to the end of a revlog "
242.4147 +"file. It never modifies a section of a file after it has written it.  This is "
242.4148 +"both more robust and efficient than schemes that need to modify or rewrite "
242.4149 +"data."
242.4150 +msgstr ""
242.4151 +
242.4152 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4153 +#: ../en/ch03-concepts.xml:157
242.4154 +msgid ""
242.4155 +"In addition, Mercurial treats every write as part of a <emphasis>transaction</"
242.4156 +"emphasis> that can span a number of files.  A transaction is "
242.4157 +"<emphasis>atomic</emphasis>: either the entire transaction succeeds and its "
242.4158 +"effects are all visible to readers in one go, or the whole thing is undone.  "
242.4159 +"This guarantee of atomicity means that if you're running two copies of "
242.4160 +"Mercurial, where one is reading data and one is writing it, the reader will "
242.4161 +"never see a partially written result that might confuse it."
242.4162 +msgstr ""
242.4163 +
242.4164 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4165 +#: ../en/ch03-concepts.xml:167
242.4166 +msgid ""
242.4167 +"The fact that Mercurial only appends to files makes it easier to provide this "
242.4168 +"transactional guarantee.  The easier it is to do stuff like this, the more "
242.4169 +"confident you should be that it's done correctly."
242.4170 +msgstr ""
242.4171 +
242.4172 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.4173 +#: ../en/ch03-concepts.xml:174
242.4174 +msgid "Fast retrieval"
242.4175 +msgstr "快速检索"
242.4176 +
242.4177 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4178 +#: ../en/ch03-concepts.xml:176
242.4179 +msgid ""
242.4180 +"Mercurial cleverly avoids a pitfall common to all earlier revision control "
242.4181 +"systems: the problem of <emphasis>inefficient retrieval</emphasis>. Most "
242.4182 +"revision control systems store the contents of a revision as an incremental "
242.4183 +"series of modifications against a <quote>snapshot</quote>.  To reconstruct a "
242.4184 +"specific revision, you must first read the snapshot, and then every one of "
242.4185 +"the revisions between the snapshot and your target revision.  The more "
242.4186 +"history that a file accumulates, the more revisions you must read, hence the "
242.4187 +"longer it takes to reconstruct a particular revision."
242.4188 +msgstr ""
242.4189 +
242.4190 +#. type: Content of: <book><chapter><sect1><sect2><figure><title>
242.4191 +#: ../en/ch03-concepts.xml:188
242.4192 +msgid "Snapshot of a revlog, with incremental deltas"
242.4193 +msgstr "版本日志的快照,以及增量差异"
242.4194 +
242.4195 +#. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject>
242.4196 +#: ../en/ch03-concepts.xml:190
242.4197 +msgid "<imageobject><imagedata fileref=\"figs/snapshot.png\"/></imageobject>"
242.4198 +msgstr ""
242.4199 +
242.4200 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4201 +#: ../en/ch03-concepts.xml:195
242.4202 +msgid ""
242.4203 +"The innovation that Mercurial applies to this problem is simple but "
242.4204 +"effective.  Once the cumulative amount of delta information stored since the "
242.4205 +"last snapshot exceeds a fixed threshold, it stores a new snapshot "
242.4206 +"(compressed, of course), instead of another delta.  This makes it possible to "
242.4207 +"reconstruct <emphasis>any</emphasis> revision of a file quickly.  This "
242.4208 +"approach works so well that it has since been copied by several other "
242.4209 +"revision control systems."
242.4210 +msgstr ""
242.4211 +
242.4212 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4213 +#: ../en/ch03-concepts.xml:204
242.4214 +msgid ""
242.4215 +"<xref linkend=\"fig:concepts:snapshot\"/> illustrates the idea.  In an entry "
242.4216 +"in a revlog's index file, Mercurial stores the range of entries from the data "
242.4217 +"file that it must read to reconstruct a particular revision."
242.4218 +msgstr ""
242.4219 +
242.4220 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title>
242.4221 +#: ../en/ch03-concepts.xml:210
242.4222 +msgid "Aside: the influence of video compression"
242.4223 +msgstr "旁白: 视频压缩的影响"
242.4224 +
242.4225 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.4226 +#: ../en/ch03-concepts.xml:212
242.4227 +msgid ""
242.4228 +"If you're familiar with video compression or have ever watched a TV feed "
242.4229 +"through a digital cable or satellite service, you may know that most video "
242.4230 +"compression schemes store each frame of video as a delta against its "
242.4231 +"predecessor frame.  In addition, these schemes use <quote>lossy</quote> "
242.4232 +"compression techniques to increase the compression ratio, so visual errors "
242.4233 +"accumulate over the course of a number of inter-frame deltas."
242.4234 +msgstr ""
242.4235 +
242.4236 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.4237 +#: ../en/ch03-concepts.xml:221
242.4238 +msgid ""
242.4239 +"Because it's possible for a video stream to <quote>drop out</quote> "
242.4240 +"occasionally due to signal glitches, and to limit the accumulation of "
242.4241 +"artefacts introduced by the lossy compression process, video encoders "
242.4242 +"periodically insert a complete frame (called a <quote>key frame</quote>) into "
242.4243 +"the video stream; the next delta is generated against that frame.  This means "
242.4244 +"that if the video signal gets interrupted, it will resume once the next key "
242.4245 +"frame is received.  Also, the accumulation of encoding errors restarts anew "
242.4246 +"with each key frame."
242.4247 +msgstr ""
242.4248 +
242.4249 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.4250 +#: ../en/ch03-concepts.xml:235
242.4251 +msgid "Identification and strong integrity"
242.4252 +msgstr "鉴别和强完整性"
242.4253 +
242.4254 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4255 +#: ../en/ch03-concepts.xml:237
242.4256 +msgid ""
242.4257 +"Along with delta or snapshot information, a revlog entry contains a "
242.4258 +"cryptographic hash of the data that it represents.  This makes it difficult "
242.4259 +"to forge the contents of a revision, and easy to detect accidental corruption."
242.4260 +msgstr ""
242.4261 +
242.4262 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4263 +#: ../en/ch03-concepts.xml:242
242.4264 +msgid ""
242.4265 +"Hashes provide more than a mere check against corruption; they are used as "
242.4266 +"the identifiers for revisions.  The changeset identification hashes that you "
242.4267 +"see as an end user are from revisions of the changelog.  Although filelogs "
242.4268 +"and the manifest also use hashes, Mercurial only uses these behind the scenes."
242.4269 +msgstr ""
242.4270 +
242.4271 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4272 +#: ../en/ch03-concepts.xml:249
242.4273 +msgid ""
242.4274 +"Mercurial verifies that hashes are correct when it retrieves file revisions "
242.4275 +"and when it pulls changes from another repository.  If it encounters an "
242.4276 +"integrity problem, it will complain and stop whatever it's doing."
242.4277 +msgstr ""
242.4278 +
242.4279 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4280 +#: ../en/ch03-concepts.xml:254
242.4281 +msgid ""
242.4282 +"In addition to the effect it has on retrieval efficiency, Mercurial's use of "
242.4283 +"periodic snapshots makes it more robust against partial data corruption.  If "
242.4284 +"a revlog becomes partly corrupted due to a hardware error or system bug, it's "
242.4285 +"often possible to reconstruct some or most revisions from the uncorrupted "
242.4286 +"sections of the revlog, both before and after the corrupted section.  This "
242.4287 +"would not be possible with a delta-only storage model."
242.4288 +msgstr ""
242.4289 +
242.4290 +#. type: Content of: <book><chapter><sect1><title>
242.4291 +#: ../en/ch03-concepts.xml:266
242.4292 +msgid "Revision history, branching, and merging"
242.4293 +msgstr "修订历史,分支与合并"
242.4294 +
242.4295 +#. type: Content of: <book><chapter><sect1><para>
242.4296 +#: ../en/ch03-concepts.xml:268
242.4297 +msgid ""
242.4298 +"Every entry in a Mercurial revlog knows the identity of its immediate "
242.4299 +"ancestor revision, usually referred to as its <emphasis>parent</emphasis>.  "
242.4300 +"In fact, a revision contains room for not one parent, but two.  Mercurial "
242.4301 +"uses a special hash, called the <quote>null ID</quote>, to represent the idea "
242.4302 +"<quote>there is no parent here</quote>.  This hash is simply a string of "
242.4303 +"zeroes."
242.4304 +msgstr ""
242.4305 +
242.4306 +#. type: Content of: <book><chapter><sect1><para>
242.4307 +#: ../en/ch03-concepts.xml:276
242.4308 +msgid ""
242.4309 +"In <xref linkend=\"fig:concepts:revlog\"/>, you can see an example of the "
242.4310 +"conceptual structure of a revlog.  Filelogs, manifests, and changelogs all "
242.4311 +"have this same structure; they differ only in the kind of data stored in each "
242.4312 +"delta or snapshot."
242.4313 +msgstr ""
242.4314 +
242.4315 +#. type: Content of: <book><chapter><sect1><para>
242.4316 +#: ../en/ch03-concepts.xml:282
242.4317 +msgid ""
242.4318 +"The first revision in a revlog (at the bottom of the image)  has the null ID "
242.4319 +"in both of its parent slots.  For a <quote>normal</quote> revision, its first "
242.4320 +"parent slot contains the ID of its parent revision, and its second contains "
242.4321 +"the null ID, indicating that the revision has only one real parent.  Any two "
242.4322 +"revisions that have the same parent ID are branches.  A revision that "
242.4323 +"represents a merge between branches has two normal revision IDs in its parent "
242.4324 +"slots."
242.4325 +msgstr ""
242.4326 +
242.4327 +#. type: Content of: <book><chapter><sect1><figure><title>
242.4328 +#: ../en/ch03-concepts.xml:292
242.4329 +msgid "The conceptual structure of a revlog"
242.4330 +msgstr "版本日志的设计结构"
242.4331 +
242.4332 +#. type: Content of: <book><chapter><sect1><figure><mediaobject>
242.4333 +#: ../en/ch03-concepts.xml:294
242.4334 +msgid "<imageobject><imagedata fileref=\"figs/revlog.png\"/></imageobject>"
242.4335 +msgstr ""
242.4336 +
242.4337 +#. type: Content of: <book><chapter><sect1><title>
242.4338 +#: ../en/ch03-concepts.xml:301
242.4339 +msgid "The working directory"
242.4340 +msgstr "工作目录"
242.4341 +
242.4342 +#. type: Content of: <book><chapter><sect1><para>
242.4343 +#: ../en/ch03-concepts.xml:303
242.4344 +msgid ""
242.4345 +"In the working directory, Mercurial stores a snapshot of the files from the "
242.4346 +"repository as of a particular changeset."
242.4347 +msgstr ""
242.4348 +
242.4349 +#. type: Content of: <book><chapter><sect1><para>
242.4350 +#: ../en/ch03-concepts.xml:306
242.4351 +msgid ""
242.4352 +"The working directory <quote>knows</quote> which changeset it contains.  When "
242.4353 +"you update the working directory to contain a particular changeset, Mercurial "
242.4354 +"looks up the appropriate revision of the manifest to find out which files it "
242.4355 +"was tracking at the time that changeset was committed, and which revision of "
242.4356 +"each file was then current.  It then recreates a copy of each of those files, "
242.4357 +"with the same contents it had when the changeset was committed."
242.4358 +msgstr ""
242.4359 +
242.4360 +#. type: Content of: <book><chapter><sect1><para>
242.4361 +#: ../en/ch03-concepts.xml:315
242.4362 +msgid ""
242.4363 +"The <emphasis>dirstate</emphasis> contains Mercurial's knowledge of the "
242.4364 +"working directory.  This details which changeset the working directory is "
242.4365 +"updated to, and all of the files that Mercurial is tracking in the working "
242.4366 +"directory."
242.4367 +msgstr ""
242.4368 +
242.4369 +#. type: Content of: <book><chapter><sect1><para>
242.4370 +#: ../en/ch03-concepts.xml:321
242.4371 +msgid ""
242.4372 +"Just as a revision of a revlog has room for two parents, so that it can "
242.4373 +"represent either a normal revision (with one parent)  or a merge of two "
242.4374 +"earlier revisions, the dirstate has slots for two parents.  When you use the "
242.4375 +"<command role=\"hg-cmd\">hg update</command> command, the changeset that you "
242.4376 +"update to is stored in the <quote>first parent</quote> slot, and the null ID "
242.4377 +"in the second. When you <command role=\"hg-cmd\">hg merge</command> with "
242.4378 +"another changeset, the first parent remains unchanged, and the second parent "
242.4379 +"is filled in with the changeset you're merging with.  The <command role=\"hg-"
242.4380 +"cmd\">hg parents</command> command tells you what the parents of the dirstate "
242.4381 +"are."
242.4382 +msgstr ""
242.4383 +
242.4384 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.4385 +#: ../en/ch03-concepts.xml:335
242.4386 +msgid "What happens when you commit"
242.4387 +msgstr "当你提交时发生的事情"
242.4388 +
242.4389 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4390 +#: ../en/ch03-concepts.xml:337
242.4391 +msgid ""
242.4392 +"The dirstate stores parent information for more than just book-keeping "
242.4393 +"purposes.  Mercurial uses the parents of the dirstate as <emphasis>the "
242.4394 +"parents of a new changeset</emphasis> when you perform a commit."
242.4395 +msgstr ""
242.4396 +
242.4397 +#. type: Content of: <book><chapter><sect1><sect2><figure><title>
242.4398 +#: ../en/ch03-concepts.xml:343
242.4399 +msgid "The working directory can have two parents"
242.4400 +msgstr "工作目录可以有两个父亲"
242.4401 +
242.4402 +#. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject>
242.4403 +#: ../en/ch03-concepts.xml:345
242.4404 +msgid "<imageobject><imagedata fileref=\"figs/wdir.png\"/></imageobject>"
242.4405 +msgstr ""
242.4406 +
242.4407 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4408 +#: ../en/ch03-concepts.xml:350
242.4409 +msgid ""
242.4410 +"<xref linkend=\"fig:concepts:wdir\"/> shows the normal state of the working "
242.4411 +"directory, where it has a single changeset as parent.  That changeset is the "
242.4412 +"<emphasis>tip</emphasis>, the newest changeset in the repository that has no "
242.4413 +"children."
242.4414 +msgstr ""
242.4415 +
242.4416 +#. type: Content of: <book><chapter><sect1><sect2><figure><title>
242.4417 +#: ../en/ch03-concepts.xml:357
242.4418 +msgid "The working directory gains new parents after a commit"
242.4419 +msgstr "提交之后,工作目录的父亲就改变了"
242.4420 +
242.4421 +#. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject>
242.4422 +#: ../en/ch03-concepts.xml:360
242.4423 +msgid ""
242.4424 +"<imageobject><imagedata fileref=\"figs/wdir-after-commit.png\"/></imageobject>"
242.4425 +msgstr ""
242.4426 +
242.4427 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4428 +#: ../en/ch03-concepts.xml:365
242.4429 +msgid ""
242.4430 +"It's useful to think of the working directory as <quote>the changeset I'm "
242.4431 +"about to commit</quote>.  Any files that you tell Mercurial that you've "
242.4432 +"added, removed, renamed, or copied will be reflected in that changeset, as "
242.4433 +"will modifications to any files that Mercurial is already tracking; the new "
242.4434 +"changeset will have the parents of the working directory as its parents."
242.4435 +msgstr ""
242.4436 +
242.4437 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4438 +#: ../en/ch03-concepts.xml:373
242.4439 +msgid ""
242.4440 +"After a commit, Mercurial will update the parents of the working directory, "
242.4441 +"so that the first parent is the ID of the new changeset, and the second is "
242.4442 +"the null ID.  This is shown in <xref linkend=\"fig:concepts:wdir-after-commit"
242.4443 +"\"/>. Mercurial doesn't touch any of the files in the working directory when "
242.4444 +"you commit; it just modifies the dirstate to note its new parents."
242.4445 +msgstr ""
242.4446 +
242.4447 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.4448 +#: ../en/ch03-concepts.xml:384
242.4449 +msgid "Creating a new head"
242.4450 +msgstr "创建新顶点"
242.4451 +
242.4452 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4453 +#: ../en/ch03-concepts.xml:386
242.4454 +msgid ""
242.4455 +"It's perfectly normal to update the working directory to a changeset other "
242.4456 +"than the current tip.  For example, you might want to know what your project "
242.4457 +"looked like last Tuesday, or you could be looking through changesets to see "
242.4458 +"which one introduced a bug.  In cases like this, the natural thing to do is "
242.4459 +"update the working directory to the changeset you're interested in, and then "
242.4460 +"examine the files in the working directory directly to see their contents as "
242.4461 +"they were when you committed that changeset.  The effect of this is shown in "
242.4462 +"<xref linkend=\"fig:concepts:wdir-pre-branch\"/>."
242.4463 +msgstr ""
242.4464 +
242.4465 +#. type: Content of: <book><chapter><sect1><sect2><figure><title>
242.4466 +#: ../en/ch03-concepts.xml:398
242.4467 +msgid "The working directory, updated to an older changeset"
242.4468 +msgstr "同步到旧修改集的工作目录"
242.4469 +
242.4470 +#. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject>
242.4471 +#: ../en/ch03-concepts.xml:401
242.4472 +msgid ""
242.4473 +"<imageobject><imagedata fileref=\"figs/wdir-pre-branch.png\"/></imageobject>"
242.4474 +msgstr ""
242.4475 +
242.4476 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4477 +#: ../en/ch03-concepts.xml:406
242.4478 +msgid ""
242.4479 +"Having updated the working directory to an older changeset, what happens if "
242.4480 +"you make some changes, and then commit? Mercurial behaves in the same way as "
242.4481 +"I outlined above.  The parents of the working directory become the parents of "
242.4482 +"the new changeset.  This new changeset has no children, so it becomes the new "
242.4483 +"tip.  And the repository now contains two changesets that have no children; "
242.4484 +"we call these <emphasis>heads</emphasis>.  You can see the structure that "
242.4485 +"this creates in <xref linkend=\"fig:concepts:wdir-branch\"/>."
242.4486 +msgstr ""
242.4487 +
242.4488 +#. type: Content of: <book><chapter><sect1><sect2><figure><title>
242.4489 +#: ../en/ch03-concepts.xml:418
242.4490 +msgid "After a commit made while synced to an older changeset"
242.4491 +msgstr "对同步到旧修改集的工作目录提交之后"
242.4492 +
242.4493 +#. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject>
242.4494 +#: ../en/ch03-concepts.xml:421
242.4495 +msgid "<imageobject><imagedata fileref=\"figs/wdir-branch.png\"/></imageobject>"
242.4496 +msgstr ""
242.4497 +
242.4498 +#. type: Content of: <book><chapter><sect1><sect2><note><para>
242.4499 +#: ../en/ch03-concepts.xml:427
242.4500 +msgid ""
242.4501 +"If you're new to Mercurial, you should keep in mind a common <quote>error</"
242.4502 +"quote>, which is to use the <command role=\"hg-cmd\">hg pull</command> "
242.4503 +"command without any options.  By default, the <command role=\"hg-cmd\">hg "
242.4504 +"pull</command> command <emphasis>does not</emphasis> update the working "
242.4505 +"directory, so you'll bring new changesets into your repository, but the "
242.4506 +"working directory will stay synced at the same changeset as before the pull.  "
242.4507 +"If you make some changes and commit afterwards, you'll thus create a new "
242.4508 +"head, because your working directory isn't synced to whatever the current tip "
242.4509 +"is."
242.4510 +msgstr ""
242.4511 +
242.4512 +#. type: Content of: <book><chapter><sect1><sect2><note><para>
242.4513 +#: ../en/ch03-concepts.xml:439
242.4514 +msgid ""
242.4515 +"I put the word <quote>error</quote> in quotes because all that you need to do "
242.4516 +"to rectify this situation is <command role=\"hg-cmd\">hg merge</command>, "
242.4517 +"then <command role=\"hg-cmd\">hg commit</command>.  In other words, this "
242.4518 +"almost never has negative consequences; it just surprises people.  I'll "
242.4519 +"discuss other ways to avoid this behaviour, and why Mercurial behaves in this "
242.4520 +"initially surprising way, later on."
242.4521 +msgstr ""
242.4522 +
242.4523 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.4524 +#: ../en/ch03-concepts.xml:451
242.4525 +msgid "Merging heads"
242.4526 +msgstr "合并顶点"
242.4527 +
242.4528 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4529 +#: ../en/ch03-concepts.xml:453
242.4530 +msgid ""
242.4531 +"When you run the <command role=\"hg-cmd\">hg merge</command> command, "
242.4532 +"Mercurial leaves the first parent of the working directory unchanged, and "
242.4533 +"sets the second parent to the changeset you're merging with, as shown in "
242.4534 +"<xref linkend=\"fig:concepts:wdir-merge\"/>."
242.4535 +msgstr ""
242.4536 +
242.4537 +#. type: Content of: <book><chapter><sect1><sect2><figure><title>
242.4538 +#: ../en/ch03-concepts.xml:460
242.4539 +msgid "Merging two heads"
242.4540 +msgstr "合并两个顶点"
242.4541 +
242.4542 +#. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject>
242.4543 +#: ../en/ch03-concepts.xml:462
242.4544 +msgid ""
242.4545 +"<imageobject> <imagedata fileref=\"figs/wdir-merge.png\"/> </imageobject>"
242.4546 +msgstr ""
242.4547 +
242.4548 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4549 +#: ../en/ch03-concepts.xml:469
242.4550 +msgid ""
242.4551 +"Mercurial also has to modify the working directory, to merge the files "
242.4552 +"managed in the two changesets.  Simplified a little, the merging process goes "
242.4553 +"like this, for every file in the manifests of both changesets."
242.4554 +msgstr ""
242.4555 +
242.4556 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.4557 +#: ../en/ch03-concepts.xml:474
242.4558 +msgid "If neither changeset has modified a file, do nothing with that file."
242.4559 +msgstr ""
242.4560 +
242.4561 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.4562 +#: ../en/ch03-concepts.xml:477
242.4563 +msgid ""
242.4564 +"If one changeset has modified a file, and the other hasn't, create the "
242.4565 +"modified copy of the file in the working directory."
242.4566 +msgstr ""
242.4567 +
242.4568 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.4569 +#: ../en/ch03-concepts.xml:481
242.4570 +msgid ""
242.4571 +"If one changeset has removed a file, and the other hasn't (or has also "
242.4572 +"deleted it), delete the file from the working directory."
242.4573 +msgstr ""
242.4574 +
242.4575 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.4576 +#: ../en/ch03-concepts.xml:485
242.4577 +msgid ""
242.4578 +"If one changeset has removed a file, but the other has modified the file, ask "
242.4579 +"the user what to do: keep the modified file, or remove it?"
242.4580 +msgstr ""
242.4581 +
242.4582 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.4583 +#: ../en/ch03-concepts.xml:489
242.4584 +msgid ""
242.4585 +"If both changesets have modified a file, invoke an external merge program to "
242.4586 +"choose the new contents for the merged file.  This may require input from the "
242.4587 +"user."
242.4588 +msgstr ""
242.4589 +
242.4590 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.4591 +#: ../en/ch03-concepts.xml:494
242.4592 +msgid ""
242.4593 +"If one changeset has modified a file, and the other has renamed or copied the "
242.4594 +"file, make sure that the changes follow the new name of the file."
242.4595 +msgstr ""
242.4596 +
242.4597 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4598 +#: ../en/ch03-concepts.xml:498
242.4599 +msgid ""
242.4600 +"There are more details&emdash;merging has plenty of corner cases&emdash;but "
242.4601 +"these are the most common choices that are involved in a merge.  As you can "
242.4602 +"see, most cases are completely automatic, and indeed most merges finish "
242.4603 +"automatically, without requiring your input to resolve any conflicts."
242.4604 +msgstr ""
242.4605 +
242.4606 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4607 +#: ../en/ch03-concepts.xml:505
242.4608 +msgid ""
242.4609 +"When you're thinking about what happens when you commit after a merge, once "
242.4610 +"again the working directory is <quote>the changeset I'm about to commit</"
242.4611 +"quote>.  After the <command role=\"hg-cmd\">hg merge</command> command "
242.4612 +"completes, the working directory has two parents; these will become the "
242.4613 +"parents of the new changeset."
242.4614 +msgstr ""
242.4615 +
242.4616 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4617 +#: ../en/ch03-concepts.xml:512
242.4618 +msgid ""
242.4619 +"Mercurial lets you perform multiple merges, but you must commit the results "
242.4620 +"of each individual merge as you go.  This is necessary because Mercurial only "
242.4621 +"tracks two parents for both revisions and the working directory.  While it "
242.4622 +"would be technically possible to merge multiple changesets at once, the "
242.4623 +"prospect of user confusion and making a terrible mess of a merge immediately "
242.4624 +"becomes overwhelming."
242.4625 +msgstr ""
242.4626 +
242.4627 +#. type: Content of: <book><chapter><sect1><title>
242.4628 +#: ../en/ch03-concepts.xml:523
242.4629 +msgid "Other interesting design features"
242.4630 +msgstr "其它有趣的设计特性"
242.4631 +
242.4632 +#. type: Content of: <book><chapter><sect1><para>
242.4633 +#: ../en/ch03-concepts.xml:525
242.4634 +msgid ""
242.4635 +"In the sections above, I've tried to highlight some of the most important "
242.4636 +"aspects of Mercurial's design, to illustrate that it pays careful attention "
242.4637 +"to reliability and performance.  However, the attention to detail doesn't "
242.4638 +"stop there.  There are a number of other aspects of Mercurial's construction "
242.4639 +"that I personally find interesting.  I'll detail a few of them here, separate "
242.4640 +"from the <quote>big ticket</quote> items above, so that if you're interested, "
242.4641 +"you can gain a better idea of the amount of thinking that goes into a well-"
242.4642 +"designed system."
242.4643 +msgstr ""
242.4644 +
242.4645 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.4646 +#: ../en/ch03-concepts.xml:536
242.4647 +msgid "Clever compression"
242.4648 +msgstr "智能压缩"
242.4649 +
242.4650 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4651 +#: ../en/ch03-concepts.xml:538
242.4652 +msgid ""
242.4653 +"When appropriate, Mercurial will store both snapshots and deltas in "
242.4654 +"compressed form.  It does this by always <emphasis>trying to</emphasis> "
242.4655 +"compress a snapshot or delta, but only storing the compressed version if it's "
242.4656 +"smaller than the uncompressed version."
242.4657 +msgstr ""
242.4658 +
242.4659 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4660 +#: ../en/ch03-concepts.xml:544
242.4661 +msgid ""
242.4662 +"This means that Mercurial does <quote>the right thing</quote> when storing a "
242.4663 +"file whose native form is compressed, such as a <literal>zip</literal> "
242.4664 +"archive or a JPEG image.  When these types of files are compressed a second "
242.4665 +"time, the resulting file is usually bigger than the once-compressed form, and "
242.4666 +"so Mercurial will store the plain <literal>zip</literal> or JPEG."
242.4667 +msgstr ""
242.4668 +
242.4669 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4670 +#: ../en/ch03-concepts.xml:552
242.4671 +msgid ""
242.4672 +"Deltas between revisions of a compressed file are usually larger than "
242.4673 +"snapshots of the file, and Mercurial again does <quote>the right thing</"
242.4674 +"quote> in these cases.  It finds that such a delta exceeds the threshold at "
242.4675 +"which it should store a complete snapshot of the file, so it stores the "
242.4676 +"snapshot, again saving space compared to a naive delta-only approach."
242.4677 +msgstr ""
242.4678 +
242.4679 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title>
242.4680 +#: ../en/ch03-concepts.xml:561
242.4681 +msgid "Network recompression"
242.4682 +msgstr "网络重新压缩"
242.4683 +
242.4684 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.4685 +#: ../en/ch03-concepts.xml:563
242.4686 +msgid ""
242.4687 +"When storing revisions on disk, Mercurial uses the <quote>deflate</quote> "
242.4688 +"compression algorithm (the same one used by the popular <literal>zip</"
242.4689 +"literal> archive format), which balances good speed with a respectable "
242.4690 +"compression ratio.  However, when transmitting revision data over a network "
242.4691 +"connection, Mercurial uncompresses the compressed revision data."
242.4692 +msgstr ""
242.4693 +
242.4694 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.4695 +#: ../en/ch03-concepts.xml:571
242.4696 +msgid ""
242.4697 +"If the connection is over HTTP, Mercurial recompresses the entire stream of "
242.4698 +"data using a compression algorithm that gives a better compression ratio (the "
242.4699 +"Burrows-Wheeler algorithm from the widely used <literal>bzip2</literal> "
242.4700 +"compression package).  This combination of algorithm and compression of the "
242.4701 +"entire stream (instead of a revision at a time) substantially reduces the "
242.4702 +"number of bytes to be transferred, yielding better network performance over "
242.4703 +"almost all kinds of network."
242.4704 +msgstr ""
242.4705 +
242.4706 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.4707 +#: ../en/ch03-concepts.xml:581
242.4708 +msgid ""
242.4709 +"(If the connection is over <command>ssh</command>, Mercurial "
242.4710 +"<emphasis>doesn't</emphasis> recompress the stream, because <command>ssh</"
242.4711 +"command> can already do this itself.)"
242.4712 +msgstr ""
242.4713 +
242.4714 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.4715 +#: ../en/ch03-concepts.xml:589
242.4716 +msgid "Read/write ordering and atomicity"
242.4717 +msgstr "读写顺序与原子性"
242.4718 +
242.4719 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4720 +#: ../en/ch03-concepts.xml:591
242.4721 +msgid ""
242.4722 +"Appending to files isn't the whole story when it comes to guaranteeing that a "
242.4723 +"reader won't see a partial write.  If you recall <xref linkend=\"fig:concepts:"
242.4724 +"metadata\"/>, revisions in the changelog point to revisions in the manifest, "
242.4725 +"and revisions in the manifest point to revisions in filelogs.  This hierarchy "
242.4726 +"is deliberate."
242.4727 +msgstr ""
242.4728 +
242.4729 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4730 +#: ../en/ch03-concepts.xml:599
242.4731 +msgid ""
242.4732 +"A writer starts a transaction by writing filelog and manifest data, and "
242.4733 +"doesn't write any changelog data until those are finished.  A reader starts "
242.4734 +"by reading changelog data, then manifest data, followed by filelog data."
242.4735 +msgstr ""
242.4736 +
242.4737 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4738 +#: ../en/ch03-concepts.xml:604
242.4739 +msgid ""
242.4740 +"Since the writer has always finished writing filelog and manifest data before "
242.4741 +"it writes to the changelog, a reader will never read a pointer to a partially "
242.4742 +"written manifest revision from the changelog, and it will never read a "
242.4743 +"pointer to a partially written filelog revision from the manifest."
242.4744 +msgstr ""
242.4745 +
242.4746 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.4747 +#: ../en/ch03-concepts.xml:612
242.4748 +msgid "Concurrent access"
242.4749 +msgstr "并发访问"
242.4750 +
242.4751 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4752 +#: ../en/ch03-concepts.xml:614
242.4753 +msgid ""
242.4754 +"The read/write ordering and atomicity guarantees mean that Mercurial never "
242.4755 +"needs to <emphasis>lock</emphasis> a repository when it's reading data, even "
242.4756 +"if the repository is being written to while the read is occurring. This has a "
242.4757 +"big effect on scalability; you can have an arbitrary number of Mercurial "
242.4758 +"processes safely reading data from a repository safely all at once, no matter "
242.4759 +"whether it's being written to or not."
242.4760 +msgstr ""
242.4761 +
242.4762 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4763 +#: ../en/ch03-concepts.xml:623
242.4764 +msgid ""
242.4765 +"The lockless nature of reading means that if you're sharing a repository on a "
242.4766 +"multi-user system, you don't need to grant other local users permission to "
242.4767 +"<emphasis>write</emphasis> to your repository in order for them to be able to "
242.4768 +"clone it or pull changes from it; they only need <emphasis>read</emphasis> "
242.4769 +"permission.  (This is <emphasis>not</emphasis> a common feature among "
242.4770 +"revision control systems, so don't take it for granted! Most require readers "
242.4771 +"to be able to lock a repository to access it safely, and this requires write "
242.4772 +"permission on at least one directory, which of course makes for all kinds of "
242.4773 +"nasty and annoying security and administrative problems.)"
242.4774 +msgstr ""
242.4775 +
242.4776 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4777 +#: ../en/ch03-concepts.xml:636
242.4778 +msgid ""
242.4779 +"Mercurial uses locks to ensure that only one process can write to a "
242.4780 +"repository at a time (the locking mechanism is safe even over filesystems "
242.4781 +"that are notoriously hostile to locking, such as NFS).  If a repository is "
242.4782 +"locked, a writer will wait for a while to retry if the repository becomes "
242.4783 +"unlocked, but if the repository remains locked for too long, the process "
242.4784 +"attempting to write will time out after a while. This means that your daily "
242.4785 +"automated scripts won't get stuck forever and pile up if a system crashes "
242.4786 +"unnoticed, for example.  (Yes, the timeout is configurable, from zero to "
242.4787 +"infinity.)"
242.4788 +msgstr ""
242.4789 +
242.4790 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title>
242.4791 +#: ../en/ch03-concepts.xml:648
242.4792 +msgid "Safe dirstate access"
242.4793 +msgstr "安全的目录状态访问"
242.4794 +
242.4795 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.4796 +#: ../en/ch03-concepts.xml:650
242.4797 +msgid ""
242.4798 +"As with revision data, Mercurial doesn't take a lock to read the dirstate "
242.4799 +"file; it does acquire a lock to write it.  To avoid the possibility of "
242.4800 +"reading a partially written copy of the dirstate file, Mercurial writes to a "
242.4801 +"file with a unique name in the same directory as the dirstate file, then "
242.4802 +"renames the temporary file atomically to <filename>dirstate</filename>.  The "
242.4803 +"file named <filename>dirstate</filename> is thus guaranteed to be complete, "
242.4804 +"not partially written."
242.4805 +msgstr ""
242.4806 +
242.4807 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.4808 +#: ../en/ch03-concepts.xml:663
242.4809 +msgid "Avoiding seeks"
242.4810 +msgstr "避免查找"
242.4811 +
242.4812 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4813 +#: ../en/ch03-concepts.xml:665
242.4814 +msgid ""
242.4815 +"Critical to Mercurial's performance is the avoidance of seeks of the disk "
242.4816 +"head, since any seek is far more expensive than even a comparatively large "
242.4817 +"read operation."
242.4818 +msgstr ""
242.4819 +
242.4820 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4821 +#: ../en/ch03-concepts.xml:669
242.4822 +msgid ""
242.4823 +"This is why, for example, the dirstate is stored in a single file.  If there "
242.4824 +"were a dirstate file per directory that Mercurial tracked, the disk would "
242.4825 +"seek once per directory.  Instead, Mercurial reads the entire single dirstate "
242.4826 +"file in one step."
242.4827 +msgstr ""
242.4828 +
242.4829 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4830 +#: ../en/ch03-concepts.xml:675
242.4831 +msgid ""
242.4832 +"Mercurial also uses a <quote>copy on write</quote> scheme when cloning a "
242.4833 +"repository on local storage.  Instead of copying every revlog file from the "
242.4834 +"old repository into the new repository, it makes a <quote>hard link</quote>, "
242.4835 +"which is a shorthand way to say <quote>these two names point to the same "
242.4836 +"file</quote>.  When Mercurial is about to write to one of a revlog's files, "
242.4837 +"it checks to see if the number of names pointing at the file is greater than "
242.4838 +"one.  If it is, more than one repository is using the file, so Mercurial "
242.4839 +"makes a new copy of the file that is private to this repository."
242.4840 +msgstr ""
242.4841 +
242.4842 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4843 +#: ../en/ch03-concepts.xml:686
242.4844 +msgid ""
242.4845 +"A few revision control developers have pointed out that this idea of making a "
242.4846 +"complete private copy of a file is not very efficient in its use of storage.  "
242.4847 +"While this is true, storage is cheap, and this method gives the highest "
242.4848 +"performance while deferring most book-keeping to the operating system.  An "
242.4849 +"alternative scheme would most likely reduce performance and increase the "
242.4850 +"complexity of the software, each of which is much more important to the "
242.4851 +"<quote>feel</quote> of day-to-day use."
242.4852 +msgstr ""
242.4853 +
242.4854 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.4855 +#: ../en/ch03-concepts.xml:698
242.4856 +msgid "Other contents of the dirstate"
242.4857 +msgstr "目录状态的其它内容"
242.4858 +
242.4859 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4860 +#: ../en/ch03-concepts.xml:700
242.4861 +msgid ""
242.4862 +"Because Mercurial doesn't force you to tell it when you're modifying a file, "
242.4863 +"it uses the dirstate to store some extra information so it can determine "
242.4864 +"efficiently whether you have modified a file.  For each file in the working "
242.4865 +"directory, it stores the time that it last modified the file itself, and the "
242.4866 +"size of the file at that time."
242.4867 +msgstr ""
242.4868 +
242.4869 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4870 +#: ../en/ch03-concepts.xml:707
242.4871 +msgid ""
242.4872 +"When you explicitly <command role=\"hg-cmd\">hg add</command>, <command role="
242.4873 +"\"hg-cmd\">hg remove</command>, <command role=\"hg-cmd\">hg rename</command> "
242.4874 +"or <command role=\"hg-cmd\">hg copy</command> files, Mercurial updates the "
242.4875 +"dirstate so that it knows what to do with those files when you commit."
242.4876 +msgstr ""
242.4877 +
242.4878 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4879 +#: ../en/ch03-concepts.xml:714
242.4880 +msgid ""
242.4881 +"When Mercurial is checking the states of files in the working directory, it "
242.4882 +"first checks a file's modification time.  If that has not changed, the file "
242.4883 +"must not have been modified.  If the file's size has changed, the file must "
242.4884 +"have been modified.  If the modification time has changed, but the size has "
242.4885 +"not, only then does Mercurial need to read the actual contents of the file to "
242.4886 +"see if they've changed. Storing these few extra pieces of information "
242.4887 +"dramatically reduces the amount of data that Mercurial needs to read, which "
242.4888 +"yields large performance improvements compared to other revision control "
242.4889 +"systems."
242.4890 +msgstr ""
242.4891 +
242.4892 +#. type: Content of: <book><chapter><title>
242.4893 +#: ../en/ch04-daily.xml:5
242.4894 +msgid "Mercurial in daily use"
242.4895 +msgstr "Mercurial 的日常使用"
242.4896 +
242.4897 +#. type: Content of: <book><chapter><sect1><title>
242.4898 +#: ../en/ch04-daily.xml:8
242.4899 +msgid "Telling Mercurial which files to track"
242.4900 +msgstr "告诉 Mercurial 要跟踪哪些文件"
242.4901 +
242.4902 +#. type: Content of: <book><chapter><sect1><para>
242.4903 +#: ../en/ch04-daily.xml:10
242.4904 +msgid ""
242.4905 +"Mercurial does not work with files in your repository unless you tell it to "
242.4906 +"manage them.  The <command role=\"hg-cmd\">hg status</command> command will "
242.4907 +"tell you which files Mercurial doesn't know about; it uses a <quote><literal>?"
242.4908 +"</literal></quote> to display such files."
242.4909 +msgstr ""
242.4910 +
242.4911 +#
242.4912 +#. type: Content of: <book><chapter><sect1><para>
242.4913 +#: ../en/ch04-daily.xml:17
242.4914 +msgid ""
242.4915 +"To tell Mercurial to track a file, use the <command role=\"hg-cmd\">hg add</"
242.4916 +"command> command.  Once you have added a file, the entry in the output of "
242.4917 +"<command role=\"hg-cmd\">hg status</command> for that file changes from "
242.4918 +"<quote><literal>?</literal></quote> to <quote><literal>A</literal></quote>."
242.4919 +msgstr ""
242.4920 +
242.4921 +#. type: Content of: <book><chapter><sect1><para>
242.4922 +#: ../en/ch04-daily.xml:26
242.4923 +msgid ""
242.4924 +"After you run a <command role=\"hg-cmd\">hg commit</command>, the files that "
242.4925 +"you added before the commit will no longer be listed in the output of "
242.4926 +"<command role=\"hg-cmd\">hg status</command>.  The reason for this is that "
242.4927 +"<command role=\"hg-cmd\">hg status</command> only tells you about "
242.4928 +"<quote>interesting</quote> files&emdash;those that you have modified or told "
242.4929 +"Mercurial to do something with&emdash;by default.  If you have a repository "
242.4930 +"that contains thousands of files, you will rarely want to know about files "
242.4931 +"that Mercurial is tracking, but that have not changed.  (You can still get "
242.4932 +"this information; we'll return to this later.)"
242.4933 +msgstr ""
242.4934 +
242.4935 +#. type: Content of: <book><chapter><sect1><para>
242.4936 +#: ../en/ch04-daily.xml:38
242.4937 +msgid ""
242.4938 +"Once you add a file, Mercurial doesn't do anything with it immediately.  "
242.4939 +"Instead, it will take a snapshot of the file's state the next time you "
242.4940 +"perform a commit.  It will then continue to track the changes you make to the "
242.4941 +"file every time you commit, until you remove the file."
242.4942 +msgstr ""
242.4943 +
242.4944 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.4945 +#: ../en/ch04-daily.xml:45
242.4946 +msgid "Explicit versus implicit file naming"
242.4947 +msgstr "明确与隐含文件命名"
242.4948 +
242.4949 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4950 +#: ../en/ch04-daily.xml:47
242.4951 +msgid ""
242.4952 +"A useful behaviour that Mercurial has is that if you pass the name of a "
242.4953 +"directory to a command, every Mercurial command will treat this as <quote>I "
242.4954 +"want to operate on every file in this directory and its subdirectories</"
242.4955 +"quote>."
242.4956 +msgstr ""
242.4957 +
242.4958 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4959 +#: ../en/ch04-daily.xml:54
242.4960 +msgid ""
242.4961 +"Notice in this example that Mercurial printed the names of the files it "
242.4962 +"added, whereas it didn't do so when we added the file named <filename>a</"
242.4963 +"filename> in the earlier example."
242.4964 +msgstr ""
242.4965 +
242.4966 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4967 +#: ../en/ch04-daily.xml:59
242.4968 +msgid ""
242.4969 +"What's going on is that in the former case, we explicitly named the file to "
242.4970 +"add on the command line, so the assumption that Mercurial makes in such cases "
242.4971 +"is that you know what you were doing, and it doesn't print any output."
242.4972 +msgstr ""
242.4973 +
242.4974 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4975 +#: ../en/ch04-daily.xml:64
242.4976 +msgid ""
242.4977 +"However, when we <emphasis>imply</emphasis> the names of files by giving the "
242.4978 +"name of a directory, Mercurial takes the extra step of printing the name of "
242.4979 +"each file that it does something with.  This makes it more clear what is "
242.4980 +"happening, and reduces the likelihood of a silent and nasty surprise.  This "
242.4981 +"behaviour is common to most Mercurial commands."
242.4982 +msgstr ""
242.4983 +
242.4984 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.4985 +#: ../en/ch04-daily.xml:73
242.4986 +msgid "Aside: Mercurial tracks files, not directories"
242.4987 +msgstr "旁白: Mercurial 只跟踪文件,不跟踪目录"
242.4988 +
242.4989 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.4990 +#: ../en/ch04-daily.xml:75
242.4991 +msgid ""
242.4992 +"Mercurial does not track directory information.  Instead, it tracks the path "
242.4993 +"to a file.  Before creating a file, it first creates any missing directory "
242.4994 +"components of the path.  After it deletes a file, it then deletes any empty "
242.4995 +"directories that were in the deleted file's path.  This sounds like a trivial "
242.4996 +"distinction, but it has one minor practical consequence: it is not possible "
242.4997 +"to represent a completely empty directory in Mercurial."
242.4998 +msgstr ""
242.4999 +
242.5000 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5001 +#: ../en/ch04-daily.xml:84
242.5002 +msgid ""
242.5003 +"Empty directories are rarely useful, and there are unintrusive workarounds "
242.5004 +"that you can use to achieve an appropriate effect.  The developers of "
242.5005 +"Mercurial thus felt that the complexity that would be required to manage "
242.5006 +"empty directories was not worth the limited benefit this feature would bring."
242.5007 +msgstr ""
242.5008 +
242.5009 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5010 +#: ../en/ch04-daily.xml:91
242.5011 +msgid ""
242.5012 +"If you need an empty directory in your repository, there are a few ways to "
242.5013 +"achieve this. One is to create a directory, then <command role=\"hg-cmd\">hg "
242.5014 +"add</command> a <quote>hidden</quote> file to that directory.  On Unix-like "
242.5015 +"systems, any file name that begins with a period (<quote><literal>.</"
242.5016 +"literal></quote>) is treated as hidden by most commands and GUI tools.  This "
242.5017 +"approach is illustrated below."
242.5018 +msgstr ""
242.5019 +
242.5020 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5021 +#: ../en/ch04-daily.xml:102
242.5022 +msgid ""
242.5023 +"Another way to tackle a need for an empty directory is to simply create one "
242.5024 +"in your automated build scripts before they will need it."
242.5025 +msgstr ""
242.5026 +
242.5027 +#. type: Content of: <book><chapter><sect1><title>
242.5028 +#: ../en/ch04-daily.xml:109
242.5029 +msgid "How to stop tracking a file"
242.5030 +msgstr "如何停止跟踪文件"
242.5031 +
242.5032 +#
242.5033 +#. type: Content of: <book><chapter><sect1><para>
242.5034 +#: ../en/ch04-daily.xml:111
242.5035 +msgid ""
242.5036 +"Once you decide that a file no longer belongs in your repository, use the "
242.5037 +"<command role=\"hg-cmd\">hg remove</command> command; this deletes the file, "
242.5038 +"and tells Mercurial to stop tracking it.  A removed file is represented in "
242.5039 +"the output of <command role=\"hg-cmd\">hg status</command> with a "
242.5040 +"<quote><literal>R</literal></quote>."
242.5041 +msgstr ""
242.5042 +
242.5043 +#. type: Content of: <book><chapter><sect1><para>
242.5044 +#: ../en/ch04-daily.xml:120
242.5045 +msgid ""
242.5046 +"After you <command role=\"hg-cmd\">hg remove</command> a file, Mercurial will "
242.5047 +"no longer track changes to that file, even if you recreate a file with the "
242.5048 +"same name in your working directory.  If you do recreate a file with the same "
242.5049 +"name and want Mercurial to track the new file, simply <command role=\"hg-cmd"
242.5050 +"\">hg add</command> it. Mercurial will know that the newly added file is not "
242.5051 +"related to the old file of the same name."
242.5052 +msgstr ""
242.5053 +
242.5054 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.5055 +#: ../en/ch04-daily.xml:129
242.5056 +msgid "Removing a file does not affect its history"
242.5057 +msgstr "删除文件不影响历史"
242.5058 +
242.5059 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5060 +#: ../en/ch04-daily.xml:131
242.5061 +msgid "It is important to understand that removing a file has only two effects."
242.5062 +msgstr ""
242.5063 +
242.5064 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.5065 +#: ../en/ch04-daily.xml:134
242.5066 +msgid "It removes the current version of the file from the working directory."
242.5067 +msgstr ""
242.5068 +
242.5069 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.5070 +#: ../en/ch04-daily.xml:137
242.5071 +msgid ""
242.5072 +"It stops Mercurial from tracking changes to the file, from the time of the "
242.5073 +"next commit."
242.5074 +msgstr ""
242.5075 +
242.5076 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5077 +#: ../en/ch04-daily.xml:140
242.5078 +msgid ""
242.5079 +"Removing a file <emphasis>does not</emphasis> in any way alter the "
242.5080 +"<emphasis>history</emphasis> of the file."
242.5081 +msgstr ""
242.5082 +
242.5083 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5084 +#: ../en/ch04-daily.xml:143
242.5085 +msgid ""
242.5086 +"If you update the working directory to a changeset in which a file that you "
242.5087 +"have removed was still tracked, it will reappear in the working directory, "
242.5088 +"with the contents it had when you committed that changeset.  If you then "
242.5089 +"update the working directory to a later changeset, in which the file had been "
242.5090 +"removed, Mercurial will once again remove the file from the working directory."
242.5091 +msgstr ""
242.5092 +
242.5093 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.5094 +#: ../en/ch04-daily.xml:153
242.5095 +msgid "Missing files"
242.5096 +msgstr "丢失的文件"
242.5097 +
242.5098 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5099 +#: ../en/ch04-daily.xml:155
242.5100 +msgid ""
242.5101 +"Mercurial considers a file that you have deleted, but not used <command role="
242.5102 +"\"hg-cmd\">hg remove</command> to delete, to be <emphasis>missing</"
242.5103 +"emphasis>.  A missing file is represented with <quote><literal>!</literal></"
242.5104 +"quote> in the output of <command role=\"hg-cmd\">hg status</command>.  "
242.5105 +"Mercurial commands will not generally do anything with missing files."
242.5106 +msgstr ""
242.5107 +
242.5108 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5109 +#: ../en/ch04-daily.xml:165
242.5110 +msgid ""
242.5111 +"If your repository contains a file that <command role=\"hg-cmd\">hg status</"
242.5112 +"command> reports as missing, and you want the file to stay gone, you can run "
242.5113 +"<command role=\"hg-cmd\">hg remove <option role=\"hg-opt-remove\">--after</"
242.5114 +"option></command> at any time later on, to tell Mercurial that you really did "
242.5115 +"mean to remove the file."
242.5116 +msgstr ""
242.5117 +
242.5118 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5119 +#: ../en/ch04-daily.xml:175
242.5120 +msgid ""
242.5121 +"On the other hand, if you deleted the missing file by accident, give <command "
242.5122 +"role=\"hg-cmd\">hg revert</command> the name of the file to recover.  It will "
242.5123 +"reappear, in unmodified form."
242.5124 +msgstr ""
242.5125 +
242.5126 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.5127 +#: ../en/ch04-daily.xml:184
242.5128 +msgid "Aside: why tell Mercurial explicitly to remove a file?"
242.5129 +msgstr "旁白: 为什么要明确告诉 Mercurial 删除文件?"
242.5130 +
242.5131 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5132 +#: ../en/ch04-daily.xml:187
242.5133 +msgid ""
242.5134 +"You might wonder why Mercurial requires you to explicitly tell it that you "
242.5135 +"are deleting a file.  Early during the development of Mercurial, it let you "
242.5136 +"delete a file however you pleased; Mercurial would notice the absence of the "
242.5137 +"file automatically when you next ran a <command role=\"hg-cmd\">hg commit</"
242.5138 +"command>, and stop tracking the file.  In practice, this made it too easy to "
242.5139 +"accidentally remove a file without noticing."
242.5140 +msgstr ""
242.5141 +
242.5142 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.5143 +#: ../en/ch04-daily.xml:198
242.5144 +msgid "Useful shorthand&emdash;adding and removing files in one step"
242.5145 +msgstr "有用的速记—一个步骤添加和删除文件"
242.5146 +
242.5147 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5148 +#: ../en/ch04-daily.xml:201
242.5149 +msgid ""
242.5150 +"Mercurial offers a combination command, <command role=\"hg-cmd\">hg "
242.5151 +"addremove</command>, that adds untracked files and marks missing files as "
242.5152 +"removed."
242.5153 +msgstr ""
242.5154 +
242.5155 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5156 +#: ../en/ch04-daily.xml:207
242.5157 +msgid ""
242.5158 +"The <command role=\"hg-cmd\">hg commit</command> command also provides a "
242.5159 +"<option role=\"hg-opt-commit\">-A</option> option that performs this same add-"
242.5160 +"and-remove, immediately followed by a commit."
242.5161 +msgstr ""
242.5162 +
242.5163 +#. type: Content of: <book><chapter><sect1><title>
242.5164 +#: ../en/ch04-daily.xml:217
242.5165 +msgid "Copying files"
242.5166 +msgstr "复制文件"
242.5167 +
242.5168 +#. type: Content of: <book><chapter><sect1><para>
242.5169 +#: ../en/ch04-daily.xml:219
242.5170 +msgid ""
242.5171 +"Mercurial provides a <command role=\"hg-cmd\">hg copy</command> command that "
242.5172 +"lets you make a new copy of a file.  When you copy a file using this command, "
242.5173 +"Mercurial makes a record of the fact that the new file is a copy of the "
242.5174 +"original file.  It treats these copied files specially when you merge your "
242.5175 +"work with someone else's."
242.5176 +msgstr ""
242.5177 +
242.5178 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.5179 +#: ../en/ch04-daily.xml:227
242.5180 +msgid "The results of copying during a merge"
242.5181 +msgstr "合并期间的复制结果"
242.5182 +
242.5183 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5184 +#: ../en/ch04-daily.xml:229
242.5185 +msgid ""
242.5186 +"What happens during a merge is that changes <quote>follow</quote> a copy.  To "
242.5187 +"best illustrate what this means, let's create an example.  We'll start with "
242.5188 +"the usual tiny repository that contains a single file."
242.5189 +msgstr ""
242.5190 +
242.5191 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5192 +#: ../en/ch04-daily.xml:236
242.5193 +msgid ""
242.5194 +"We need to do some work in parallel, so that we'll have something to merge.  "
242.5195 +"So let's clone our repository."
242.5196 +msgstr ""
242.5197 +
242.5198 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5199 +#: ../en/ch04-daily.xml:242
242.5200 +msgid ""
242.5201 +"Back in our initial repository, let's use the <command role=\"hg-cmd\">hg "
242.5202 +"copy</command> command to make a copy of the first file we created."
242.5203 +msgstr ""
242.5204 +
242.5205 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5206 +#: ../en/ch04-daily.xml:248
242.5207 +msgid ""
242.5208 +"If we look at the output of the <command role=\"hg-cmd\">hg status</command> "
242.5209 +"command afterwards, the copied file looks just like a normal added file."
242.5210 +msgstr ""
242.5211 +
242.5212 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5213 +#: ../en/ch04-daily.xml:254
242.5214 +msgid ""
242.5215 +"But if we pass the <option role=\"hg-opt-status\">-C</option> option to "
242.5216 +"<command role=\"hg-cmd\">hg status</command>, it prints another line of "
242.5217 +"output: this is the file that our newly-added file was copied <emphasis>from</"
242.5218 +"emphasis>."
242.5219 +msgstr ""
242.5220 +
242.5221 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5222 +#: ../en/ch04-daily.xml:262
242.5223 +msgid ""
242.5224 +"Now, back in the repository we cloned, let's make a change in parallel.  "
242.5225 +"We'll add a line of content to the original file that we created."
242.5226 +msgstr ""
242.5227 +
242.5228 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5229 +#: ../en/ch04-daily.xml:268
242.5230 +msgid ""
242.5231 +"Now we have a modified <filename>file</filename> in this repository.  When we "
242.5232 +"pull the changes from the first repository, and merge the two heads, "
242.5233 +"Mercurial will propagate the changes that we made locally to <filename>file</"
242.5234 +"filename> into its copy, <filename>new-file</filename>."
242.5235 +msgstr ""
242.5236 +
242.5237 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.5238 +#: ../en/ch04-daily.xml:278
242.5239 +msgid "Why should changes follow copies?"
242.5240 +msgstr "为什么复制后需要后续修改?"
242.5241 +
242.5242 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5243 +#: ../en/ch04-daily.xml:280
242.5244 +msgid ""
242.5245 +"This behaviour, of changes to a file propagating out to copies of the file, "
242.5246 +"might seem esoteric, but in most cases it's highly desirable."
242.5247 +msgstr ""
242.5248 +
242.5249 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5250 +#: ../en/ch04-daily.xml:284
242.5251 +msgid ""
242.5252 +"First of all, remember that this propagation <emphasis>only</emphasis> "
242.5253 +"happens when you merge.  So if you <command role=\"hg-cmd\">hg copy</command> "
242.5254 +"a file, and subsequently modify the original file during the normal course of "
242.5255 +"your work, nothing will happen."
242.5256 +msgstr ""
242.5257 +
242.5258 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5259 +#: ../en/ch04-daily.xml:290
242.5260 +msgid ""
242.5261 +"The second thing to know is that modifications will only propagate across a "
242.5262 +"copy as long as the repository that you're pulling changes from "
242.5263 +"<emphasis>doesn't know</emphasis> about the copy."
242.5264 +msgstr ""
242.5265 +
242.5266 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5267 +#: ../en/ch04-daily.xml:295
242.5268 +msgid ""
242.5269 +"The reason that Mercurial does this is as follows.  Let's say I make an "
242.5270 +"important bug fix in a source file, and commit my changes. Meanwhile, you've "
242.5271 +"decided to <command role=\"hg-cmd\">hg copy</command> the file in your "
242.5272 +"repository, without knowing about the bug or having seen the fix, and you "
242.5273 +"have started hacking on your copy of the file."
242.5274 +msgstr ""
242.5275 +
242.5276 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5277 +#: ../en/ch04-daily.xml:302
242.5278 +msgid ""
242.5279 +"If you pulled and merged my changes, and Mercurial <emphasis>didn't</"
242.5280 +"emphasis> propagate changes across copies, your source file would now contain "
242.5281 +"the bug, and unless you remembered to propagate the bug fix by hand, the bug "
242.5282 +"would <emphasis>remain</emphasis> in your copy of the file."
242.5283 +msgstr ""
242.5284 +
242.5285 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5286 +#: ../en/ch04-daily.xml:308
242.5287 +msgid ""
242.5288 +"By automatically propagating the change that fixed the bug from the original "
242.5289 +"file to the copy, Mercurial prevents this class of problem. To my knowledge, "
242.5290 +"Mercurial is the <emphasis>only</emphasis> revision control system that "
242.5291 +"propagates changes across copies like this."
242.5292 +msgstr ""
242.5293 +
242.5294 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5295 +#: ../en/ch04-daily.xml:314
242.5296 +msgid ""
242.5297 +"Once your change history has a record that the copy and subsequent merge "
242.5298 +"occurred, there's usually no further need to propagate changes from the "
242.5299 +"original file to the copied file, and that's why Mercurial only propagates "
242.5300 +"changes across copies until this point, and no further."
242.5301 +msgstr ""
242.5302 +
242.5303 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.5304 +#: ../en/ch04-daily.xml:322
242.5305 +msgid "How to make changes <emphasis>not</emphasis> follow a copy"
242.5306 +msgstr "如何让复制后<emphasis>不</emphasis>修改?"
242.5307 +
242.5308 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5309 +#: ../en/ch04-daily.xml:325
242.5310 +msgid ""
242.5311 +"If, for some reason, you decide that this business of automatically "
242.5312 +"propagating changes across copies is not for you, simply use your system's "
242.5313 +"normal file copy command (on Unix-like systems, that's <command>cp</command>) "
242.5314 +"to make a copy of a file, then <command role=\"hg-cmd\">hg add</command> the "
242.5315 +"new copy by hand.  Before you do so, though, please do reread <xref linkend="
242.5316 +"\"sec:daily:why-copy\"/>, and make an informed decision that this behaviour "
242.5317 +"is not appropriate to your specific case."
242.5318 +msgstr ""
242.5319 +
242.5320 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.5321 +#: ../en/ch04-daily.xml:338
242.5322 +msgid "Behaviour of the <command role=\"hg-cmd\">hg copy</command> command"
242.5323 +msgstr "命令 <command role=\"hg-cmd\">hg copy</command> 的特性"
242.5324 +
242.5325 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5326 +#: ../en/ch04-daily.xml:341
242.5327 +msgid ""
242.5328 +"When you use the <command role=\"hg-cmd\">hg copy</command> command, "
242.5329 +"Mercurial makes a copy of each source file as it currently stands in the "
242.5330 +"working directory.  This means that if you make some modifications to a file, "
242.5331 +"then <command role=\"hg-cmd\">hg copy</command> it without first having "
242.5332 +"committed those changes, the new copy will also contain the modifications you "
242.5333 +"have made up until that point.  (I find this behaviour a little "
242.5334 +"counterintuitive, which is why I mention it here.)"
242.5335 +msgstr ""
242.5336 +
242.5337 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5338 +#: ../en/ch04-daily.xml:351
242.5339 +msgid ""
242.5340 +"The <command role=\"hg-cmd\">hg copy</command> command acts similarly to the "
242.5341 +"Unix <command>cp</command> command (you can use the <command role=\"hg-cmd"
242.5342 +"\">hg cp</command> alias if you prefer).  The last argument is the "
242.5343 +"<emphasis>destination</emphasis>, and all prior arguments are "
242.5344 +"<emphasis>sources</emphasis>.  If you pass it a single file as the source, "
242.5345 +"and the destination does not exist, it creates a new file with that name."
242.5346 +msgstr ""
242.5347 +
242.5348 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5349 +#: ../en/ch04-daily.xml:362
242.5350 +msgid ""
242.5351 +"If the destination is a directory, Mercurial copies its sources into that "
242.5352 +"directory."
242.5353 +msgstr ""
242.5354 +
242.5355 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5356 +#: ../en/ch04-daily.xml:367
242.5357 +msgid ""
242.5358 +"Copying a directory is recursive, and preserves the directory structure of "
242.5359 +"the source."
242.5360 +msgstr ""
242.5361 +
242.5362 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5363 +#: ../en/ch04-daily.xml:373
242.5364 +msgid ""
242.5365 +"If the source and destination are both directories, the source tree is "
242.5366 +"recreated in the destination directory."
242.5367 +msgstr ""
242.5368 +
242.5369 +#
242.5370 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5371 +#: ../en/ch04-daily.xml:378
242.5372 +msgid ""
242.5373 +"As with the <command role=\"hg-cmd\">hg rename</command> command, if you copy "
242.5374 +"a file manually and then want Mercurial to know that you've copied the file, "
242.5375 +"simply use the <option role=\"hg-opt-copy\">--after</option> option to "
242.5376 +"<command role=\"hg-cmd\">hg copy</command>."
242.5377 +msgstr ""
242.5378 +
242.5379 +#. type: Content of: <book><chapter><sect1><title>
242.5380 +#: ../en/ch04-daily.xml:389
242.5381 +msgid "Renaming files"
242.5382 +msgstr "改名文件"
242.5383 +
242.5384 +#. type: Content of: <book><chapter><sect1><para>
242.5385 +#: ../en/ch04-daily.xml:391
242.5386 +msgid ""
242.5387 +"It's rather more common to need to rename a file than to make a copy of it.  "
242.5388 +"The reason I discussed the <command role=\"hg-cmd\">hg copy</command> command "
242.5389 +"before talking about renaming files is that Mercurial treats a rename in "
242.5390 +"essentially the same way as a copy.  Therefore, knowing what Mercurial does "
242.5391 +"when you copy a file tells you what to expect when you rename a file."
242.5392 +msgstr ""
242.5393 +
242.5394 +#. type: Content of: <book><chapter><sect1><para>
242.5395 +#: ../en/ch04-daily.xml:399
242.5396 +msgid ""
242.5397 +"When you use the <command role=\"hg-cmd\">hg rename</command> command, "
242.5398 +"Mercurial makes a copy of each source file, then deletes it and marks the "
242.5399 +"file as removed."
242.5400 +msgstr ""
242.5401 +
242.5402 +#. type: Content of: <book><chapter><sect1><para>
242.5403 +#: ../en/ch04-daily.xml:405
242.5404 +msgid ""
242.5405 +"The <command role=\"hg-cmd\">hg status</command> command shows the newly "
242.5406 +"copied file as added, and the copied-from file as removed."
242.5407 +msgstr ""
242.5408 +
242.5409 +#. type: Content of: <book><chapter><sect1><para>
242.5410 +#: ../en/ch04-daily.xml:411
242.5411 +msgid ""
242.5412 +"As with the results of a <command role=\"hg-cmd\">hg copy</command>, we must "
242.5413 +"use the <option role=\"hg-opt-status\">-C</option> option to <command role="
242.5414 +"\"hg-cmd\">hg status</command> to see that the added file is really being "
242.5415 +"tracked by Mercurial as a copy of the original, now removed, file."
242.5416 +msgstr ""
242.5417 +
242.5418 +#. type: Content of: <book><chapter><sect1><para>
242.5419 +#: ../en/ch04-daily.xml:420
242.5420 +msgid ""
242.5421 +"As with <command role=\"hg-cmd\">hg remove</command> and <command role=\"hg-"
242.5422 +"cmd\">hg copy</command>, you can tell Mercurial about a rename after the fact "
242.5423 +"using the <option role=\"hg-opt-rename\">--after</option> option.  In most "
242.5424 +"other respects, the behaviour of the <command role=\"hg-cmd\">hg rename</"
242.5425 +"command> command, and the options it accepts, are similar to the <command "
242.5426 +"role=\"hg-cmd\">hg copy</command> command."
242.5427 +msgstr ""
242.5428 +
242.5429 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.5430 +#: ../en/ch04-daily.xml:430
242.5431 +msgid "Renaming files and merging changes"
242.5432 +msgstr "改名文件与合并修改"
242.5433 +
242.5434 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5435 +#: ../en/ch04-daily.xml:432
242.5436 +msgid ""
242.5437 +"Since Mercurial's rename is implemented as copy-and-remove, the same "
242.5438 +"propagation of changes happens when you merge after a rename as after a copy."
242.5439 +msgstr ""
242.5440 +
242.5441 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5442 +#: ../en/ch04-daily.xml:436
242.5443 +msgid ""
242.5444 +"If I modify a file, and you rename it to a new name, and then we merge our "
242.5445 +"respective changes, my modifications to the file under its original name will "
242.5446 +"be propagated into the file under its new name. (This is something you might "
242.5447 +"expect to <quote>simply work,</quote> but not all revision control systems "
242.5448 +"actually do this.)"
242.5449 +msgstr ""
242.5450 +
242.5451 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5452 +#: ../en/ch04-daily.xml:443
242.5453 +msgid ""
242.5454 +"Whereas having changes follow a copy is a feature where you can perhaps nod "
242.5455 +"and say <quote>yes, that might be useful,</quote> it should be clear that "
242.5456 +"having them follow a rename is definitely important.  Without this facility, "
242.5457 +"it would simply be too easy for changes to become orphaned when files are "
242.5458 +"renamed."
242.5459 +msgstr ""
242.5460 +
242.5461 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.5462 +#: ../en/ch04-daily.xml:452
242.5463 +msgid "Divergent renames and merging"
242.5464 +msgstr "改名与合并的分歧"
242.5465 +
242.5466 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5467 +#: ../en/ch04-daily.xml:454
242.5468 +msgid ""
242.5469 +"The case of diverging names occurs when two developers start with a "
242.5470 +"file&emdash;let's call it <filename>foo</filename>&emdash;in their respective "
242.5471 +"repositories."
242.5472 +msgstr ""
242.5473 +
242.5474 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5475 +#: ../en/ch04-daily.xml:461
242.5476 +msgid "Anne renames the file to <filename>bar</filename>."
242.5477 +msgstr ""
242.5478 +
242.5479 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5480 +#: ../en/ch04-daily.xml:465
242.5481 +msgid "Meanwhile, Bob renames it to <filename>quux</filename>."
242.5482 +msgstr ""
242.5483 +
242.5484 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5485 +#: ../en/ch04-daily.xml:470
242.5486 +msgid ""
242.5487 +"I like to think of this as a conflict because each developer has expressed "
242.5488 +"different intentions about what the file ought to be named."
242.5489 +msgstr ""
242.5490 +
242.5491 +#
242.5492 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5493 +#: ../en/ch04-daily.xml:474
242.5494 +msgid ""
242.5495 +"What do you think should happen when they merge their work? Mercurial's "
242.5496 +"actual behaviour is that it always preserves <emphasis>both</emphasis> names "
242.5497 +"when it merges changesets that contain divergent renames."
242.5498 +msgstr ""
242.5499 +
242.5500 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5501 +#: ../en/ch04-daily.xml:481
242.5502 +msgid ""
242.5503 +"Notice that Mercurial does warn about the divergent renames, but it leaves it "
242.5504 +"up to you to do something about the divergence after the merge."
242.5505 +msgstr ""
242.5506 +
242.5507 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.5508 +#: ../en/ch04-daily.xml:487
242.5509 +msgid "Convergent renames and merging"
242.5510 +msgstr "收敛改名与合并"
242.5511 +
242.5512 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5513 +#: ../en/ch04-daily.xml:489
242.5514 +msgid ""
242.5515 +"Another kind of rename conflict occurs when two people choose to rename "
242.5516 +"different <emphasis>source</emphasis> files to the same "
242.5517 +"<emphasis>destination</emphasis>. In this case, Mercurial runs its normal "
242.5518 +"merge machinery, and lets you guide it to a suitable resolution."
242.5519 +msgstr ""
242.5520 +
242.5521 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.5522 +#: ../en/ch04-daily.xml:497
242.5523 +msgid "Other name-related corner cases"
242.5524 +msgstr "其它名称相关的角落"
242.5525 +
242.5526 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5527 +#: ../en/ch04-daily.xml:499
242.5528 +msgid ""
242.5529 +"Mercurial has a longstanding bug in which it fails to handle a merge where "
242.5530 +"one side has a file with a given name, while another has a directory with the "
242.5531 +"same name.  This is documented as <ulink role=\"hg-bug\" url=\"http://www."
242.5532 +"selenic.com/mercurial/bts/issue29\">issue 29</ulink>."
242.5533 +msgstr ""
242.5534 +
242.5535 +#. type: Content of: <book><chapter><sect1><title>
242.5536 +#: ../en/ch04-daily.xml:511
242.5537 +msgid "Recovering from mistakes"
242.5538 +msgstr "从错误恢复"
242.5539 +
242.5540 +#. type: Content of: <book><chapter><sect1><para>
242.5541 +#: ../en/ch04-daily.xml:513
242.5542 +msgid ""
242.5543 +"Mercurial has some useful commands that will help you to recover from some "
242.5544 +"common mistakes."
242.5545 +msgstr ""
242.5546 +
242.5547 +#. type: Content of: <book><chapter><sect1><para>
242.5548 +#: ../en/ch04-daily.xml:516
242.5549 +msgid ""
242.5550 +"The <command role=\"hg-cmd\">hg revert</command> command lets you undo "
242.5551 +"changes that you have made to your working directory.  For example, if you "
242.5552 +"<command role=\"hg-cmd\">hg add</command> a file by accident, just run "
242.5553 +"<command role=\"hg-cmd\">hg revert</command> with the name of the file you "
242.5554 +"added, and while the file won't be touched in any way, it won't be tracked "
242.5555 +"for adding by Mercurial any longer, either.  You can also use <command role="
242.5556 +"\"hg-cmd\">hg revert</command> to get rid of erroneous changes to a file."
242.5557 +msgstr ""
242.5558 +
242.5559 +#. type: Content of: <book><chapter><sect1><para>
242.5560 +#: ../en/ch04-daily.xml:526
242.5561 +msgid ""
242.5562 +"It's useful to remember that the <command role=\"hg-cmd\">hg revert</command> "
242.5563 +"command is useful for changes that you have not yet committed.  Once you've "
242.5564 +"committed a change, if you decide it was a mistake, you can still do "
242.5565 +"something about it, though your options may be more limited."
242.5566 +msgstr ""
242.5567 +
242.5568 +#. type: Content of: <book><chapter><sect1><para>
242.5569 +#: ../en/ch04-daily.xml:532
242.5570 +msgid ""
242.5571 +"For more information about the <command role=\"hg-cmd\">hg revert</command> "
242.5572 +"command, and details about how to deal with changes you have already "
242.5573 +"committed, see <xref linkend=\"chap:undo\"/>."
242.5574 +msgstr ""
242.5575 +
242.5576 +#. type: Content of: <book><chapter><title>
242.5577 +#: ../en/ch05-collab.xml:5
242.5578 +msgid "Collaborating with other people"
242.5579 +msgstr "团体协作"
242.5580 +
242.5581 +#. type: Content of: <book><chapter><para>
242.5582 +#: ../en/ch05-collab.xml:7
242.5583 +msgid ""
242.5584 +"As a completely decentralised tool, Mercurial doesn't impose any policy on "
242.5585 +"how people ought to work with each other.  However, if you're new to "
242.5586 +"distributed revision control, it helps to have some tools and examples in "
242.5587 +"mind when you're thinking about possible workflow models."
242.5588 +msgstr ""
242.5589 +
242.5590 +#. type: Content of: <book><chapter><sect1><title>
242.5591 +#: ../en/ch05-collab.xml:14
242.5592 +msgid "Mercurial's web interface"
242.5593 +msgstr "Mercurial 的 web 接口"
242.5594 +
242.5595 +#. type: Content of: <book><chapter><sect1><para>
242.5596 +#: ../en/ch05-collab.xml:16
242.5597 +msgid ""
242.5598 +"Mercurial has a powerful web interface that provides several useful "
242.5599 +"capabilities."
242.5600 +msgstr ""
242.5601 +
242.5602 +#. type: Content of: <book><chapter><sect1><para>
242.5603 +#: ../en/ch05-collab.xml:19
242.5604 +msgid ""
242.5605 +"For interactive use, the web interface lets you browse a single repository or "
242.5606 +"a collection of repositories.  You can view the history of a repository, "
242.5607 +"examine each change (comments and diffs), and view the contents of each "
242.5608 +"directory and file."
242.5609 +msgstr ""
242.5610 +
242.5611 +#. type: Content of: <book><chapter><sect1><para>
242.5612 +#: ../en/ch05-collab.xml:24
242.5613 +msgid ""
242.5614 +"Also for human consumption, the web interface provides an RSS feed of the "
242.5615 +"changes in a repository.  This lets you <quote>subscribe</quote> to a "
242.5616 +"repository using your favourite feed reader, and be automatically notified of "
242.5617 +"activity in that repository as soon as it happens.  I find this capability "
242.5618 +"much more convenient than the model of subscribing to a mailing list to which "
242.5619 +"notifications are sent, as it requires no additional configuration on the "
242.5620 +"part of whoever is serving the repository."
242.5621 +msgstr ""
242.5622 +
242.5623 +#. type: Content of: <book><chapter><sect1><para>
242.5624 +#: ../en/ch05-collab.xml:34
242.5625 +msgid ""
242.5626 +"The web interface also lets remote users clone a repository, pull changes "
242.5627 +"from it, and (when the server is configured to permit it) push changes back "
242.5628 +"to it.  Mercurial's HTTP tunneling protocol aggressively compresses data, so "
242.5629 +"that it works efficiently even over low-bandwidth network connections."
242.5630 +msgstr ""
242.5631 +
242.5632 +#. type: Content of: <book><chapter><sect1><para>
242.5633 +#: ../en/ch05-collab.xml:40
242.5634 +msgid ""
242.5635 +"The easiest way to get started with the web interface is to use your web "
242.5636 +"browser to visit an existing repository, such as the master Mercurial "
242.5637 +"repository at <ulink url=\"http://www.selenic.com/repo/hg?style=gitweb"
242.5638 +"\">http://www.selenic.com/repo/hg?style=gitweb</ulink>."
242.5639 +msgstr ""
242.5640 +
242.5641 +#. type: Content of: <book><chapter><sect1><para>
242.5642 +#: ../en/ch05-collab.xml:45
242.5643 +msgid ""
242.5644 +"If you're interested in providing a web interface to your own repositories, "
242.5645 +"Mercurial provides two ways to do this.  The first is using the <command role="
242.5646 +"\"hg-cmd\">hg serve</command> command, which is best suited to short-term "
242.5647 +"<quote>lightweight</quote> serving.  See <xref linkend=\"sec:collab:serve\"/> "
242.5648 +"below for details of how to use this command.  If you have a long-lived "
242.5649 +"repository that you'd like to make permanently available, Mercurial has built-"
242.5650 +"in support for the CGI (Common Gateway Interface) standard, which all common "
242.5651 +"web servers support.  See <xref linkend=\"sec:collab:cgi\"/> for details of "
242.5652 +"CGI configuration."
242.5653 +msgstr ""
242.5654 +
242.5655 +#. type: Content of: <book><chapter><sect1><title>
242.5656 +#: ../en/ch05-collab.xml:60
242.5657 +msgid "Collaboration models"
242.5658 +msgstr "协作模型"
242.5659 +
242.5660 +#. type: Content of: <book><chapter><sect1><para>
242.5661 +#: ../en/ch05-collab.xml:62
242.5662 +msgid ""
242.5663 +"With a suitably flexible tool, making decisions about workflow is much more "
242.5664 +"of a social engineering challenge than a technical one. Mercurial imposes few "
242.5665 +"limitations on how you can structure the flow of work in a project, so it's "
242.5666 +"up to you and your group to set up and live with a model that matches your "
242.5667 +"own particular needs."
242.5668 +msgstr ""
242.5669 +
242.5670 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.5671 +#: ../en/ch05-collab.xml:70
242.5672 +msgid "Factors to keep in mind"
242.5673 +msgstr "要牢记的因素"
242.5674 +
242.5675 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5676 +#: ../en/ch05-collab.xml:72
242.5677 +msgid ""
242.5678 +"The most important aspect of any model that you must keep in mind is how well "
242.5679 +"it matches the needs and capabilities of the people who will be using it.  "
242.5680 +"This might seem self-evident; even so, you still can't afford to forget it "
242.5681 +"for a moment."
242.5682 +msgstr ""
242.5683 +
242.5684 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5685 +#: ../en/ch05-collab.xml:78
242.5686 +msgid ""
242.5687 +"I once put together a workflow model that seemed to make perfect sense to me, "
242.5688 +"but that caused a considerable amount of consternation and strife within my "
242.5689 +"development team.  In spite of my attempts to explain why we needed a complex "
242.5690 +"set of branches, and how changes ought to flow between them, a few team "
242.5691 +"members revolted.  Even though they were smart people, they didn't want to "
242.5692 +"pay attention to the constraints we were operating under, or face the "
242.5693 +"consequences of those constraints in the details of the model that I was "
242.5694 +"advocating."
242.5695 +msgstr ""
242.5696 +
242.5697 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5698 +#: ../en/ch05-collab.xml:88
242.5699 +msgid ""
242.5700 +"Don't sweep foreseeable social or technical problems under the rug. Whatever "
242.5701 +"scheme you put into effect, you should plan for mistakes and problem "
242.5702 +"scenarios.  Consider adding automated machinery to prevent, or quickly "
242.5703 +"recover from, trouble that you can anticipate.  As an example, if you intend "
242.5704 +"to have a branch with not-for-release changes in it, you'd do well to think "
242.5705 +"early about the possibility that someone might accidentally merge those "
242.5706 +"changes into a release branch.  You could avoid this particular problem by "
242.5707 +"writing a hook that prevents changes from being merged from an inappropriate "
242.5708 +"branch."
242.5709 +msgstr ""
242.5710 +
242.5711 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.5712 +#: ../en/ch05-collab.xml:102
242.5713 +msgid "Informal anarchy"
242.5714 +msgstr "无政府状态"
242.5715 +
242.5716 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5717 +#: ../en/ch05-collab.xml:104
242.5718 +msgid ""
242.5719 +"I wouldn't suggest an <quote>anything goes</quote> approach as something "
242.5720 +"sustainable, but it's a model that's easy to grasp, and it works perfectly "
242.5721 +"well in a few unusual situations."
242.5722 +msgstr ""
242.5723 +
242.5724 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5725 +#: ../en/ch05-collab.xml:109
242.5726 +msgid ""
242.5727 +"As one example, many projects have a loose-knit group of collaborators who "
242.5728 +"rarely physically meet each other.  Some groups like to overcome the "
242.5729 +"isolation of working at a distance by organising occasional <quote>sprints</"
242.5730 +"quote>.  In a sprint, a number of people get together in a single location (a "
242.5731 +"company's conference room, a hotel meeting room, that kind of place) and "
242.5732 +"spend several days more or less locked in there, hacking intensely on a "
242.5733 +"handful of projects."
242.5734 +msgstr ""
242.5735 +
242.5736 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5737 +#: ../en/ch05-collab.xml:118
242.5738 +msgid ""
242.5739 +"A sprint is the perfect place to use the <command role=\"hg-cmd\">hg serve</"
242.5740 +"command> command, since <command role=\"hg-cmd\">hg serve</command> does not "
242.5741 +"require any fancy server infrastructure.  You can get started with <command "
242.5742 +"role=\"hg-cmd\">hg serve</command> in moments, by reading <xref linkend=\"sec:"
242.5743 +"collab:serve\"/> below.  Then simply tell the person next to you that you're "
242.5744 +"running a server, send the URL to them in an instant message, and you "
242.5745 +"immediately have a quick-turnaround way to work together.  They can type your "
242.5746 +"URL into their web browser and quickly review your changes; or they can pull "
242.5747 +"a bugfix from you and verify it; or they can clone a branch containing a new "
242.5748 +"feature and try it out."
242.5749 +msgstr ""
242.5750 +
242.5751 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5752 +#: ../en/ch05-collab.xml:132
242.5753 +msgid ""
242.5754 +"The charm, and the problem, with doing things in an ad hoc fashion like this "
242.5755 +"is that only people who know about your changes, and where they are, can see "
242.5756 +"them.  Such an informal approach simply doesn't scale beyond a handful "
242.5757 +"people, because each individual needs to know about $n$ different "
242.5758 +"repositories to pull from."
242.5759 +msgstr ""
242.5760 +
242.5761 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.5762 +#: ../en/ch05-collab.xml:141
242.5763 +msgid "A single central repository"
242.5764 +msgstr "单一中央版本库"
242.5765 +
242.5766 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5767 +#: ../en/ch05-collab.xml:143
242.5768 +msgid ""
242.5769 +"For smaller projects migrating from a centralised revision control tool, "
242.5770 +"perhaps the easiest way to get started is to have changes flow through a "
242.5771 +"single shared central repository.  This is also the most common "
242.5772 +"<quote>building block</quote> for more ambitious workflow schemes."
242.5773 +msgstr ""
242.5774 +
242.5775 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5776 +#: ../en/ch05-collab.xml:149
242.5777 +msgid ""
242.5778 +"Contributors start by cloning a copy of this repository.  They can pull "
242.5779 +"changes from it whenever they need to, and some (perhaps all) developers have "
242.5780 +"permission to push a change back when they're ready for other people to see "
242.5781 +"it."
242.5782 +msgstr ""
242.5783 +
242.5784 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5785 +#: ../en/ch05-collab.xml:154
242.5786 +msgid ""
242.5787 +"Under this model, it can still often make sense for people to pull changes "
242.5788 +"directly from each other, without going through the central repository.  "
242.5789 +"Consider a case in which I have a tentative bug fix, but I am worried that if "
242.5790 +"I were to publish it to the central repository, it might subsequently break "
242.5791 +"everyone else's trees as they pull it.  To reduce the potential for damage, I "
242.5792 +"can ask you to clone my repository into a temporary repository of your own "
242.5793 +"and test it.  This lets us put off publishing the potentially unsafe change "
242.5794 +"until it has had a little testing."
242.5795 +msgstr ""
242.5796 +
242.5797 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5798 +#: ../en/ch05-collab.xml:165
242.5799 +msgid ""
242.5800 +"In this kind of scenario, people usually use the <command>ssh</command> "
242.5801 +"protocol to securely push changes to the central repository, as documented in "
242.5802 +"<xref linkend=\"sec:collab:ssh\"/>.  It's also usual to publish a read-only "
242.5803 +"copy of the repository over HTTP using CGI, as in <xref linkend=\"sec:collab:"
242.5804 +"cgi\"/>. Publishing over HTTP satisfies the needs of people who don't have "
242.5805 +"push access, and those who want to use web browsers to browse the "
242.5806 +"repository's history."
242.5807 +msgstr ""
242.5808 +
242.5809 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.5810 +#: ../en/ch05-collab.xml:177
242.5811 +msgid "Working with multiple branches"
242.5812 +msgstr "使用多个分支工作"
242.5813 +
242.5814 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5815 +#: ../en/ch05-collab.xml:179
242.5816 +msgid ""
242.5817 +"Projects of any significant size naturally tend to make progress on several "
242.5818 +"fronts simultaneously.  In the case of software, it's common for a project to "
242.5819 +"go through periodic official releases.  A release might then go into "
242.5820 +"<quote>maintenance mode</quote> for a while after its first publication; "
242.5821 +"maintenance releases tend to contain only bug fixes, not new features.  In "
242.5822 +"parallel with these maintenance releases, one or more future releases may be "
242.5823 +"under development.  People normally use the word <quote>branch</quote> to "
242.5824 +"refer to one of these many slightly different directions in which development "
242.5825 +"is proceeding."
242.5826 +msgstr ""
242.5827 +
242.5828 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5829 +#: ../en/ch05-collab.xml:192
242.5830 +msgid ""
242.5831 +"Mercurial is particularly well suited to managing a number of simultaneous, "
242.5832 +"but not identical, branches.  Each <quote>development direction</quote> can "
242.5833 +"live in its own central repository, and you can merge changes from one to "
242.5834 +"another as the need arises.  Because repositories are independent of each "
242.5835 +"other, unstable changes in a development branch will never affect a stable "
242.5836 +"branch unless someone explicitly merges those changes in."
242.5837 +msgstr ""
242.5838 +
242.5839 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5840 +#: ../en/ch05-collab.xml:201
242.5841 +msgid ""
242.5842 +"Here's an example of how this can work in practice.  Let's say you have one "
242.5843 +"<quote>main branch</quote> on a central server."
242.5844 +msgstr ""
242.5845 +
242.5846 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5847 +#: ../en/ch05-collab.xml:207
242.5848 +msgid "People clone it, make changes locally, test them, and push them back."
242.5849 +msgstr ""
242.5850 +
242.5851 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5852 +#: ../en/ch05-collab.xml:210
242.5853 +msgid ""
242.5854 +"Once the main branch reaches a release milestone, you can use the <command "
242.5855 +"role=\"hg-cmd\">hg tag</command> command to give a permanent name to the "
242.5856 +"milestone revision."
242.5857 +msgstr ""
242.5858 +
242.5859 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5860 +#: ../en/ch05-collab.xml:216
242.5861 +msgid "Let's say some ongoing development occurs on the main branch."
242.5862 +msgstr ""
242.5863 +
242.5864 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5865 +#: ../en/ch05-collab.xml:221
242.5866 +msgid ""
242.5867 +"Using the tag that was recorded at the milestone, people who clone that "
242.5868 +"repository at any time in the future can use <command role=\"hg-cmd\">hg "
242.5869 +"update</command> to get a copy of the working directory exactly as it was "
242.5870 +"when that tagged revision was committed."
242.5871 +msgstr ""
242.5872 +
242.5873 +#
242.5874 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5875 +#: ../en/ch05-collab.xml:229
242.5876 +msgid ""
242.5877 +"In addition, immediately after the main branch is tagged, someone can then "
242.5878 +"clone the main branch on the server to a new <quote>stable</quote> branch, "
242.5879 +"also on the server."
242.5880 +msgstr ""
242.5881 +
242.5882 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5883 +#: ../en/ch05-collab.xml:235
242.5884 +msgid ""
242.5885 +"Someone who needs to make a change to the stable branch can then clone "
242.5886 +"<emphasis>that</emphasis> repository, make their changes, commit, and push "
242.5887 +"their changes back there."
242.5888 +msgstr ""
242.5889 +
242.5890 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5891 +#: ../en/ch05-collab.xml:241
242.5892 +msgid ""
242.5893 +"Because Mercurial repositories are independent, and Mercurial doesn't move "
242.5894 +"changes around automatically, the stable and main branches are "
242.5895 +"<emphasis>isolated</emphasis> from each other.  The changes that you made on "
242.5896 +"the main branch don't <quote>leak</quote> to the stable branch, and vice "
242.5897 +"versa."
242.5898 +msgstr ""
242.5899 +
242.5900 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5901 +#: ../en/ch05-collab.xml:248
242.5902 +msgid ""
242.5903 +"You'll often want all of your bugfixes on the stable branch to show up on the "
242.5904 +"main branch, too.  Rather than rewrite a bugfix on the main branch, you can "
242.5905 +"simply pull and merge changes from the stable to the main branch, and "
242.5906 +"Mercurial will bring those bugfixes in for you."
242.5907 +msgstr ""
242.5908 +
242.5909 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5910 +#: ../en/ch05-collab.xml:256
242.5911 +msgid ""
242.5912 +"The main branch will still contain changes that are not on the stable branch, "
242.5913 +"but it will also contain all of the bugfixes from the stable branch.  The "
242.5914 +"stable branch remains unaffected by these changes."
242.5915 +msgstr ""
242.5916 +
242.5917 +#. type: Content of: <book><chapter><sect1><sect2><figure><title>
242.5918 +#: ../en/ch05-collab.xml:263 ../en/ch05-collab.xml:273
242.5919 +msgid "Feature branches"
242.5920 +msgstr "特性分支"
242.5921 +
242.5922 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5923 +#: ../en/ch05-collab.xml:265
242.5924 +msgid ""
242.5925 +"For larger projects, an effective way to manage change is to break up a team "
242.5926 +"into smaller groups.  Each group has a shared branch of its own, cloned from "
242.5927 +"a single <quote>master</quote> branch used by the entire project.  People "
242.5928 +"working on an individual branch are typically quite isolated from "
242.5929 +"developments on other branches."
242.5930 +msgstr ""
242.5931 +
242.5932 +#. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject>
242.5933 +#: ../en/ch05-collab.xml:275
242.5934 +msgid ""
242.5935 +"<imageobject><imagedata width=\"100%\" fileref=\"figs/feature-branches.png\"/"
242.5936 +"></imageobject>"
242.5937 +msgstr ""
242.5938 +
242.5939 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5940 +#: ../en/ch05-collab.xml:280
242.5941 +msgid ""
242.5942 +"When a particular feature is deemed to be in suitable shape, someone on that "
242.5943 +"feature team pulls and merges from the master branch into the feature branch, "
242.5944 +"then pushes back up to the master branch."
242.5945 +msgstr ""
242.5946 +
242.5947 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.5948 +#: ../en/ch05-collab.xml:287
242.5949 +msgid "The release train"
242.5950 +msgstr "发布列车"
242.5951 +
242.5952 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5953 +#: ../en/ch05-collab.xml:289
242.5954 +msgid ""
242.5955 +"Some projects are organised on a <quote>train</quote> basis: a release is "
242.5956 +"scheduled to happen every few months, and whatever features are ready when "
242.5957 +"the <quote>train</quote> is ready to leave are allowed in."
242.5958 +msgstr ""
242.5959 +
242.5960 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5961 +#: ../en/ch05-collab.xml:294
242.5962 +msgid ""
242.5963 +"This model resembles working with feature branches.  The difference is that "
242.5964 +"when a feature branch misses a train, someone on the feature team pulls and "
242.5965 +"merges the changes that went out on that train release into the feature "
242.5966 +"branch, and the team continues its work on top of that release so that their "
242.5967 +"feature can make the next release."
242.5968 +msgstr ""
242.5969 +
242.5970 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.5971 +#: ../en/ch05-collab.xml:303
242.5972 +msgid "The Linux kernel model"
242.5973 +msgstr "Linux 内核模型"
242.5974 +
242.5975 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5976 +#: ../en/ch05-collab.xml:305
242.5977 +msgid ""
242.5978 +"The development of the Linux kernel has a shallow hierarchical structure, "
242.5979 +"surrounded by a cloud of apparent chaos.  Because most Linux developers use "
242.5980 +"<command>git</command>, a distributed revision control tool with capabilities "
242.5981 +"similar to Mercurial, it's useful to describe the way work flows in that "
242.5982 +"environment; if you like the ideas, the approach translates well across tools."
242.5983 +msgstr ""
242.5984 +
242.5985 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5986 +#: ../en/ch05-collab.xml:313
242.5987 +msgid ""
242.5988 +"At the center of the community sits Linus Torvalds, the creator of Linux.  He "
242.5989 +"publishes a single source repository that is considered the "
242.5990 +"<quote>authoritative</quote> current tree by the entire developer community. "
242.5991 +"Anyone can clone Linus's tree, but he is very choosy about whose trees he "
242.5992 +"pulls from."
242.5993 +msgstr ""
242.5994 +
242.5995 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.5996 +#: ../en/ch05-collab.xml:320
242.5997 +msgid ""
242.5998 +"Linus has a number of <quote>trusted lieutenants</quote>.  As a general rule, "
242.5999 +"he pulls whatever changes they publish, in most cases without even reviewing "
242.6000 +"those changes.  Some of those lieutenants are generally agreed to be "
242.6001 +"<quote>maintainers</quote>, responsible for specific subsystems within the "
242.6002 +"kernel.  If a random kernel hacker wants to make a change to a subsystem that "
242.6003 +"they want to end up in Linus's tree, they must find out who the subsystem's "
242.6004 +"maintainer is, and ask that maintainer to take their change.  If the "
242.6005 +"maintainer reviews their changes and agrees to take them, they'll pass them "
242.6006 +"along to Linus in due course."
242.6007 +msgstr ""
242.6008 +
242.6009 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6010 +#: ../en/ch05-collab.xml:332
242.6011 +msgid ""
242.6012 +"Individual lieutenants have their own approaches to reviewing, accepting, and "
242.6013 +"publishing changes; and for deciding when to feed them to Linus.  In "
242.6014 +"addition, there are several well known branches that people use for different "
242.6015 +"purposes.  For example, a few people maintain <quote>stable</quote> "
242.6016 +"repositories of older versions of the kernel, to which they apply critical "
242.6017 +"fixes as needed.  Some maintainers publish multiple trees: one for "
242.6018 +"experimental changes; one for changes that they are about to feed upstream; "
242.6019 +"and so on.  Others just publish a single tree."
242.6020 +msgstr ""
242.6021 +
242.6022 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6023 +#: ../en/ch05-collab.xml:343
242.6024 +msgid ""
242.6025 +"This model has two notable features.  The first is that it's <quote>pull "
242.6026 +"only</quote>.  You have to ask, convince, or beg another developer to take a "
242.6027 +"change from you, because there are almost no trees to which more than one "
242.6028 +"person can push, and there's no way to push changes into a tree that someone "
242.6029 +"else controls."
242.6030 +msgstr ""
242.6031 +
242.6032 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6033 +#: ../en/ch05-collab.xml:350
242.6034 +msgid ""
242.6035 +"The second is that it's based on reputation and acclaim.  If you're an "
242.6036 +"unknown, Linus will probably ignore changes from you without even "
242.6037 +"responding.  But a subsystem maintainer will probably review them, and will "
242.6038 +"likely take them if they pass their criteria for suitability. The more "
242.6039 +"<quote>good</quote> changes you contribute to a maintainer, the more likely "
242.6040 +"they are to trust your judgment and accept your changes.  If you're well-"
242.6041 +"known and maintain a long-lived branch for something Linus hasn't yet "
242.6042 +"accepted, people with similar interests may pull your changes regularly to "
242.6043 +"keep up with your work."
242.6044 +msgstr ""
242.6045 +
242.6046 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6047 +#: ../en/ch05-collab.xml:361
242.6048 +msgid ""
242.6049 +"Reputation and acclaim don't necessarily cross subsystem or <quote>people</"
242.6050 +"quote> boundaries.  If you're a respected but specialised storage hacker, and "
242.6051 +"you try to fix a networking bug, that change will receive a level of scrutiny "
242.6052 +"from a network maintainer comparable to a change from a complete stranger."
242.6053 +msgstr ""
242.6054 +
242.6055 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6056 +#: ../en/ch05-collab.xml:368
242.6057 +msgid ""
242.6058 +"To people who come from more orderly project backgrounds, the comparatively "
242.6059 +"chaotic Linux kernel development process often seems completely insane.  It's "
242.6060 +"subject to the whims of individuals; people make sweeping changes whenever "
242.6061 +"they deem it appropriate; and the pace of development is astounding.  And yet "
242.6062 +"Linux is a highly successful, well-regarded piece of software."
242.6063 +msgstr ""
242.6064 +
242.6065 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.6066 +#: ../en/ch05-collab.xml:378
242.6067 +msgid "Pull-only versus shared-push collaboration"
242.6068 +msgstr "只读与共享写协作"
242.6069 +
242.6070 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6071 +#: ../en/ch05-collab.xml:380
242.6072 +msgid ""
242.6073 +"A perpetual source of heat in the open source community is whether a "
242.6074 +"development model in which people only ever pull changes from others is "
242.6075 +"<quote>better than</quote> one in which multiple people can push changes to a "
242.6076 +"shared repository."
242.6077 +msgstr ""
242.6078 +
242.6079 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6080 +#: ../en/ch05-collab.xml:386
242.6081 +msgid ""
242.6082 +"Typically, the backers of the shared-push model use tools that actively "
242.6083 +"enforce this approach.  If you're using a centralised revision control tool "
242.6084 +"such as Subversion, there's no way to make a choice over which model you'll "
242.6085 +"use: the tool gives you shared-push, and if you want to do anything else, "
242.6086 +"you'll have to roll your own approach on top (such as applying a patch by "
242.6087 +"hand)."
242.6088 +msgstr ""
242.6089 +
242.6090 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6091 +#: ../en/ch05-collab.xml:394
242.6092 +msgid ""
242.6093 +"A good distributed revision control tool, such as Mercurial, will support "
242.6094 +"both models.  You and your collaborators can then structure how you work "
242.6095 +"together based on your own needs and preferences, not on what contortions "
242.6096 +"your tools force you into."
242.6097 +msgstr ""
242.6098 +
242.6099 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.6100 +#: ../en/ch05-collab.xml:402
242.6101 +msgid "Where collaboration meets branch management"
242.6102 +msgstr "协作与分支管理"
242.6103 +
242.6104 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6105 +#: ../en/ch05-collab.xml:404
242.6106 +msgid ""
242.6107 +"Once you and your team set up some shared repositories and start propagating "
242.6108 +"changes back and forth between local and shared repos, you begin to face a "
242.6109 +"related, but slightly different challenge: that of managing the multiple "
242.6110 +"directions in which your team may be moving at once.  Even though this "
242.6111 +"subject is intimately related to how your team collaborates, it's dense "
242.6112 +"enough to merit treatment of its own, in <xref linkend=\"chap:branch\"/>."
242.6113 +msgstr ""
242.6114 +
242.6115 +#. type: Content of: <book><chapter><sect1><title>
242.6116 +#: ../en/ch05-collab.xml:416
242.6117 +msgid "The technical side of sharing"
242.6118 +msgstr "共享的技术因素"
242.6119 +
242.6120 +#. type: Content of: <book><chapter><sect1><para>
242.6121 +#: ../en/ch05-collab.xml:418
242.6122 +msgid ""
242.6123 +"The remainder of this chapter is devoted to the question of serving data to "
242.6124 +"your collaborators."
242.6125 +msgstr ""
242.6126 +
242.6127 +#. type: Content of: <book><chapter><sect1><title>
242.6128 +#: ../en/ch05-collab.xml:423
242.6129 +msgid "Informal sharing with <command role=\"hg-cmd\">hg serve</command>"
242.6130 +msgstr "使用 <command role=\"hg-cmd\">hg serve</command> 进行非正式共享"
242.6131 +
242.6132 +#. type: Content of: <book><chapter><sect1><para>
242.6133 +#: ../en/ch05-collab.xml:426
242.6134 +msgid ""
242.6135 +"Mercurial's <command role=\"hg-cmd\">hg serve</command> command is "
242.6136 +"wonderfully suited to small, tight-knit, and fast-paced group environments.  "
242.6137 +"It also provides a great way to get a feel for using Mercurial commands over "
242.6138 +"a network."
242.6139 +msgstr ""
242.6140 +
242.6141 +#. type: Content of: <book><chapter><sect1><para>
242.6142 +#: ../en/ch05-collab.xml:431
242.6143 +msgid ""
242.6144 +"Run <command role=\"hg-cmd\">hg serve</command> inside a repository, and in "
242.6145 +"under a second it will bring up a specialised HTTP server; this will accept "
242.6146 +"connections from any client, and serve up data for that repository until you "
242.6147 +"terminate it.  Anyone who knows the URL of the server you just started, and "
242.6148 +"can talk to your computer over the network, can then use a web browser or "
242.6149 +"Mercurial to read data from that repository.  A URL for a <command role=\"hg-"
242.6150 +"cmd\">hg serve</command> instance running on a laptop is likely to look "
242.6151 +"something like <literal>http://my-laptop.local:8000/</literal>."
242.6152 +msgstr ""
242.6153 +
242.6154 +#. type: Content of: <book><chapter><sect1><para>
242.6155 +#: ../en/ch05-collab.xml:442
242.6156 +msgid ""
242.6157 +"The <command role=\"hg-cmd\">hg serve</command> command is <emphasis>not</"
242.6158 +"emphasis> a general-purpose web server. It can do only two things:"
242.6159 +msgstr ""
242.6160 +
242.6161 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.6162 +#: ../en/ch05-collab.xml:446
242.6163 +msgid ""
242.6164 +"Allow people to browse the history of the repository it's serving, from their "
242.6165 +"normal web browsers."
242.6166 +msgstr ""
242.6167 +
242.6168 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.6169 +#: ../en/ch05-collab.xml:450
242.6170 +msgid ""
242.6171 +"Speak Mercurial's wire protocol, so that people can <command role=\"hg-cmd"
242.6172 +"\">hg clone</command> or <command role=\"hg-cmd\">hg pull</command> changes "
242.6173 +"from that repository."
242.6174 +msgstr ""
242.6175 +
242.6176 +#. type: Content of: <book><chapter><sect1><para>
242.6177 +#: ../en/ch05-collab.xml:455
242.6178 +msgid ""
242.6179 +"In particular, <command role=\"hg-cmd\">hg serve</command> won't allow remote "
242.6180 +"users to <emphasis>modify</emphasis> your repository.  It's intended for read-"
242.6181 +"only use."
242.6182 +msgstr ""
242.6183 +
242.6184 +#. type: Content of: <book><chapter><sect1><para>
242.6185 +#: ../en/ch05-collab.xml:459
242.6186 +msgid ""
242.6187 +"If you're getting started with Mercurial, there's nothing to prevent you from "
242.6188 +"using <command role=\"hg-cmd\">hg serve</command> to serve up a repository on "
242.6189 +"your own computer, then use commands like <command role=\"hg-cmd\">hg clone</"
242.6190 +"command>, <command role=\"hg-cmd\">hg incoming</command>, and so on to talk "
242.6191 +"to that server as if the repository was hosted remotely. This can help you to "
242.6192 +"quickly get acquainted with using commands on network-hosted repositories."
242.6193 +msgstr ""
242.6194 +
242.6195 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.6196 +#: ../en/ch05-collab.xml:469
242.6197 +msgid "A few things to keep in mind"
242.6198 +msgstr "要牢记的几件事"
242.6199 +
242.6200 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6201 +#: ../en/ch05-collab.xml:471
242.6202 +msgid ""
242.6203 +"Because it provides unauthenticated read access to all clients, you should "
242.6204 +"only use <command role=\"hg-cmd\">hg serve</command> in an environment where "
242.6205 +"you either don't care, or have complete control over, who can access your "
242.6206 +"network and pull data from your repository."
242.6207 +msgstr ""
242.6208 +
242.6209 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6210 +#: ../en/ch05-collab.xml:477
242.6211 +msgid ""
242.6212 +"The <command role=\"hg-cmd\">hg serve</command> command knows nothing about "
242.6213 +"any firewall software you might have installed on your system or network.  It "
242.6214 +"cannot detect or control your firewall software.  If other people are unable "
242.6215 +"to talk to a running <command role=\"hg-cmd\">hg serve</command> instance, "
242.6216 +"the second thing you should do (<emphasis>after</emphasis> you make sure that "
242.6217 +"they're using the correct URL) is check your firewall configuration."
242.6218 +msgstr ""
242.6219 +
242.6220 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6221 +#: ../en/ch05-collab.xml:486
242.6222 +msgid ""
242.6223 +"By default, <command role=\"hg-cmd\">hg serve</command> listens for incoming "
242.6224 +"connections on port 8000.  If another process is already listening on the "
242.6225 +"port you want to use, you can specify a different port to listen on using the "
242.6226 +"<option role=\"hg-opt-serve\">-p</option> option."
242.6227 +msgstr ""
242.6228 +
242.6229 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6230 +#: ../en/ch05-collab.xml:492
242.6231 +msgid ""
242.6232 +"Normally, when <command role=\"hg-cmd\">hg serve</command> starts, it prints "
242.6233 +"no output, which can be a bit unnerving.  If you'd like to confirm that it is "
242.6234 +"indeed running correctly, and find out what URL you should send to your "
242.6235 +"collaborators, start it with the <option role=\"hg-opt-global\">-v</option> "
242.6236 +"option."
242.6237 +msgstr ""
242.6238 +
242.6239 +#. type: Content of: <book><chapter><sect1><title>
242.6240 +#: ../en/ch05-collab.xml:502
242.6241 +msgid "Using the Secure Shell (ssh) protocol"
242.6242 +msgstr "使用 ssh 协议"
242.6243 +
242.6244 +#. type: Content of: <book><chapter><sect1><para>
242.6245 +#: ../en/ch05-collab.xml:504
242.6246 +msgid ""
242.6247 +"You can pull and push changes securely over a network connection using the "
242.6248 +"Secure Shell (<literal>ssh</literal>)  protocol.  To use this successfully, "
242.6249 +"you may have to do a little bit of configuration on the client or server "
242.6250 +"sides."
242.6251 +msgstr ""
242.6252 +
242.6253 +#. type: Content of: <book><chapter><sect1><para>
242.6254 +#: ../en/ch05-collab.xml:509
242.6255 +msgid ""
242.6256 +"If you're not familiar with ssh, it's a network protocol that lets you "
242.6257 +"securely communicate with another computer.  To use it with Mercurial, you'll "
242.6258 +"be setting up one or more user accounts on a server so that remote users can "
242.6259 +"log in and execute commands."
242.6260 +msgstr ""
242.6261 +
242.6262 +#. type: Content of: <book><chapter><sect1><para>
242.6263 +#: ../en/ch05-collab.xml:515
242.6264 +msgid ""
242.6265 +"(If you <emphasis>are</emphasis> familiar with ssh, you'll probably find some "
242.6266 +"of the material that follows to be elementary in nature.)"
242.6267 +msgstr ""
242.6268 +
242.6269 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.6270 +#: ../en/ch05-collab.xml:520
242.6271 +msgid "How to read and write ssh URLs"
242.6272 +msgstr "如何读写 ssh 路径"
242.6273 +
242.6274 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6275 +#: ../en/ch05-collab.xml:522
242.6276 +msgid "An ssh URL tends to look like this:"
242.6277 +msgstr ""
242.6278 +
242.6279 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.6280 +#: ../en/ch05-collab.xml:525
242.6281 +msgid ""
242.6282 +"The <quote><literal>ssh://</literal></quote> part tells Mercurial to use the "
242.6283 +"ssh protocol."
242.6284 +msgstr ""
242.6285 +
242.6286 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.6287 +#: ../en/ch05-collab.xml:528
242.6288 +msgid ""
242.6289 +"The <quote><literal>bos@</literal></quote> component indicates what username "
242.6290 +"to log into the server as.  You can leave this out if the remote username is "
242.6291 +"the same as your local username."
242.6292 +msgstr ""
242.6293 +
242.6294 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.6295 +#: ../en/ch05-collab.xml:533
242.6296 +msgid ""
242.6297 +"The <quote><literal>hg.serpentine.com</literal></quote> gives the hostname of "
242.6298 +"the server to log into."
242.6299 +msgstr ""
242.6300 +
242.6301 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.6302 +#: ../en/ch05-collab.xml:537
242.6303 +msgid ""
242.6304 +"The <quote>:22</quote> identifies the port number to connect to the server "
242.6305 +"on.  The default port is 22, so you only need to specify a colon and port "
242.6306 +"number if you're <emphasis>not</emphasis> using port 22."
242.6307 +msgstr ""
242.6308 +
242.6309 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.6310 +#: ../en/ch05-collab.xml:542
242.6311 +msgid ""
242.6312 +"The remainder of the URL is the local path to the repository on the server."
242.6313 +msgstr ""
242.6314 +
242.6315 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6316 +#: ../en/ch05-collab.xml:546
242.6317 +msgid ""
242.6318 +"There's plenty of scope for confusion with the path component of ssh URLs, as "
242.6319 +"there is no standard way for tools to interpret it.  Some programs behave "
242.6320 +"differently than others when dealing with these paths. This isn't an ideal "
242.6321 +"situation, but it's unlikely to change.  Please read the following paragraphs "
242.6322 +"carefully."
242.6323 +msgstr ""
242.6324 +
242.6325 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6326 +#: ../en/ch05-collab.xml:553
242.6327 +msgid ""
242.6328 +"Mercurial treats the path to a repository on the server as relative to the "
242.6329 +"remote user's home directory.  For example, if user <literal>foo</literal> on "
242.6330 +"the server has a home directory of <filename class=\"directory\">/home/foo</"
242.6331 +"filename>, then an ssh URL that contains a path component of <filename class="
242.6332 +"\"directory\">bar</filename> <emphasis>really</emphasis> refers to the "
242.6333 +"directory <filename class=\"directory\">/home/foo/bar</filename>."
242.6334 +msgstr ""
242.6335 +
242.6336 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6337 +#: ../en/ch05-collab.xml:562
242.6338 +msgid ""
242.6339 +"If you want to specify a path relative to another user's home directory, you "
242.6340 +"can use a path that starts with a tilde character followed by the user's name "
242.6341 +"(let's call them <literal>otheruser</literal>), like this."
242.6342 +msgstr ""
242.6343 +
242.6344 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6345 +#: ../en/ch05-collab.xml:568
242.6346 +msgid ""
242.6347 +"And if you really want to specify an <emphasis>absolute</emphasis> path on "
242.6348 +"the server, begin the path component with two slashes, as in this example."
242.6349 +msgstr ""
242.6350 +
242.6351 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.6352 +#: ../en/ch05-collab.xml:575
242.6353 +msgid "Finding an ssh client for your system"
242.6354 +msgstr "为你的系统寻找 ssh 客户端"
242.6355 +
242.6356 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6357 +#: ../en/ch05-collab.xml:577
242.6358 +msgid ""
242.6359 +"Almost every Unix-like system comes with OpenSSH preinstalled.  If you're "
242.6360 +"using such a system, run <literal>which ssh</literal> to find out if the "
242.6361 +"<command>ssh</command> command is installed (it's usually in <filename class="
242.6362 +"\"directory\">/usr/bin</filename>).  In the unlikely event that it isn't "
242.6363 +"present, take a look at your system documentation to figure out how to "
242.6364 +"install it."
242.6365 +msgstr ""
242.6366 +
242.6367 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6368 +#: ../en/ch05-collab.xml:585
242.6369 +msgid ""
242.6370 +"On Windows, you'll first need to download a suitable ssh client.  There are "
242.6371 +"two alternatives."
242.6372 +msgstr ""
242.6373 +
242.6374 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.6375 +#: ../en/ch05-collab.xml:588
242.6376 +msgid ""
242.6377 +"Simon Tatham's excellent PuTTY package <citation>web:putty</citation> "
242.6378 +"provides a complete suite of ssh client commands."
242.6379 +msgstr ""
242.6380 +
242.6381 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.6382 +#: ../en/ch05-collab.xml:592
242.6383 +msgid ""
242.6384 +"If you have a high tolerance for pain, you can use the Cygwin port of OpenSSH."
242.6385 +msgstr ""
242.6386 +
242.6387 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6388 +#: ../en/ch05-collab.xml:595
242.6389 +msgid ""
242.6390 +"In either case, you'll need to edit your <filename role=\"special\">hg.ini</"
242.6391 +"filename> file to tell Mercurial where to find the actual client command.  "
242.6392 +"For example, if you're using PuTTY, you'll need to use the <command>plink</"
242.6393 +"command> command as a command-line ssh client."
242.6394 +msgstr ""
242.6395 +
242.6396 +#. type: Content of: <book><chapter><sect1><sect2><note><para>
242.6397 +#: ../en/ch05-collab.xml:605
242.6398 +msgid ""
242.6399 +"The path to <command>plink</command> shouldn't contain any whitespace "
242.6400 +"characters, or Mercurial may not be able to run it correctly (so putting it "
242.6401 +"in <filename class=\"directory\">C:\\Program Files</filename> is probably not "
242.6402 +"a good idea)."
242.6403 +msgstr ""
242.6404 +
242.6405 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.6406 +#: ../en/ch05-collab.xml:614
242.6407 +msgid "Generating a key pair"
242.6408 +msgstr "产生密钥对"
242.6409 +
242.6410 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6411 +#: ../en/ch05-collab.xml:616
242.6412 +msgid ""
242.6413 +"To avoid the need to repetitively type a password every time you need to use "
242.6414 +"your ssh client, I recommend generating a key pair.  On a Unix-like system, "
242.6415 +"the <command>ssh-keygen</command> command will do the trick. On Windows, if "
242.6416 +"you're using PuTTY, the <command>puttygen</command> command is what you'll "
242.6417 +"need."
242.6418 +msgstr ""
242.6419 +
242.6420 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6421 +#: ../en/ch05-collab.xml:624
242.6422 +msgid ""
242.6423 +"When you generate a key pair, it's usually <emphasis>highly</emphasis> "
242.6424 +"advisable to protect it with a passphrase.  (The only time that you might not "
242.6425 +"want to do this is when you're using the ssh protocol for automated tasks on "
242.6426 +"a secure network.)"
242.6427 +msgstr ""
242.6428 +
242.6429 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6430 +#: ../en/ch05-collab.xml:630
242.6431 +msgid ""
242.6432 +"Simply generating a key pair isn't enough, however.  You'll need to add the "
242.6433 +"public key to the set of authorised keys for whatever user you're logging in "
242.6434 +"remotely as.  For servers using OpenSSH (the vast majority), this will mean "
242.6435 +"adding the public key to a list in a file called <filename role=\"special"
242.6436 +"\">authorized_keys</filename> in their <filename role=\"special\" class="
242.6437 +"\"directory\">.ssh</filename> directory."
242.6438 +msgstr ""
242.6439 +
242.6440 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6441 +#: ../en/ch05-collab.xml:639
242.6442 +msgid ""
242.6443 +"On a Unix-like system, your public key will have a <filename>.pub</filename> "
242.6444 +"extension.  If you're using <command>puttygen</command> on Windows, you can "
242.6445 +"save the public key to a file of your choosing, or paste it from the window "
242.6446 +"it's displayed in straight into the <filename role=\"special"
242.6447 +"\">authorized_keys</filename> file."
242.6448 +msgstr ""
242.6449 +
242.6450 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.6451 +#: ../en/ch05-collab.xml:648
242.6452 +msgid "Using an authentication agent"
242.6453 +msgstr "使用认证代理"
242.6454 +
242.6455 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6456 +#: ../en/ch05-collab.xml:650
242.6457 +msgid ""
242.6458 +"An authentication agent is a daemon that stores passphrases in memory (so it "
242.6459 +"will forget passphrases if you log out and log back in again). An ssh client "
242.6460 +"will notice if it's running, and query it for a passphrase.  If there's no "
242.6461 +"authentication agent running, or the agent doesn't store the necessary "
242.6462 +"passphrase, you'll have to type your passphrase every time Mercurial tries to "
242.6463 +"communicate with a server on your behalf (e.g. whenever you pull or push "
242.6464 +"changes)."
242.6465 +msgstr ""
242.6466 +
242.6467 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6468 +#: ../en/ch05-collab.xml:659
242.6469 +msgid ""
242.6470 +"The downside of storing passphrases in an agent is that it's possible for a "
242.6471 +"well-prepared attacker to recover the plain text of your passphrases, in some "
242.6472 +"cases even if your system has been power-cycled. You should make your own "
242.6473 +"judgment as to whether this is an acceptable risk.  It certainly saves a lot "
242.6474 +"of repeated typing."
242.6475 +msgstr ""
242.6476 +
242.6477 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6478 +#: ../en/ch05-collab.xml:666
242.6479 +msgid ""
242.6480 +"On Unix-like systems, the agent is called <command>ssh-agent</command>, and "
242.6481 +"it's often run automatically for you when you log in.  You'll need to use the "
242.6482 +"<command>ssh-add</command> command to add passphrases to the agent's store.  "
242.6483 +"On Windows, if you're using PuTTY, the <command>pageant</command> command "
242.6484 +"acts as the agent.  It adds an icon to your system tray that will let you "
242.6485 +"manage stored passphrases."
242.6486 +msgstr ""
242.6487 +
242.6488 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.6489 +#: ../en/ch05-collab.xml:677
242.6490 +msgid "Configuring the server side properly"
242.6491 +msgstr "正确配置服务器端"
242.6492 +
242.6493 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6494 +#: ../en/ch05-collab.xml:679
242.6495 +msgid ""
242.6496 +"Because ssh can be fiddly to set up if you're new to it, there's a variety of "
242.6497 +"things that can go wrong.  Add Mercurial on top, and there's plenty more "
242.6498 +"scope for head-scratching.  Most of these potential problems occur on the "
242.6499 +"server side, not the client side.  The good news is that once you've gotten a "
242.6500 +"configuration working, it will usually continue to work indefinitely."
242.6501 +msgstr ""
242.6502 +
242.6503 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6504 +#: ../en/ch05-collab.xml:687
242.6505 +msgid ""
242.6506 +"Before you try using Mercurial to talk to an ssh server, it's best to make "
242.6507 +"sure that you can use the normal <command>ssh</command> or <command>putty</"
242.6508 +"command> command to talk to the server first.  If you run into problems with "
242.6509 +"using these commands directly, Mercurial surely won't work.  Worse, it will "
242.6510 +"obscure the underlying problem.  Any time you want to debug ssh-related "
242.6511 +"Mercurial problems, you should drop back to making sure that plain ssh client "
242.6512 +"commands work first, <emphasis>before</emphasis> you worry about whether "
242.6513 +"there's a problem with Mercurial."
242.6514 +msgstr ""
242.6515 +
242.6516 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6517 +#: ../en/ch05-collab.xml:698
242.6518 +msgid ""
242.6519 +"The first thing to be sure of on the server side is that you can actually log "
242.6520 +"in from another machine at all.  If you can't use <command>ssh</command> or "
242.6521 +"<command>putty</command> to log in, the error message you get may give you a "
242.6522 +"few hints as to what's wrong.  The most common problems are as follows."
242.6523 +msgstr ""
242.6524 +
242.6525 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.6526 +#: ../en/ch05-collab.xml:705
242.6527 +msgid ""
242.6528 +"If you get a <quote>connection refused</quote> error, either there isn't an "
242.6529 +"SSH daemon running on the server at all, or it's inaccessible due to firewall "
242.6530 +"configuration."
242.6531 +msgstr ""
242.6532 +
242.6533 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.6534 +#: ../en/ch05-collab.xml:710
242.6535 +msgid ""
242.6536 +"If you get a <quote>no route to host</quote> error, you either have an "
242.6537 +"incorrect address for the server or a seriously locked down firewall that "
242.6538 +"won't admit its existence at all."
242.6539 +msgstr ""
242.6540 +
242.6541 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.6542 +#: ../en/ch05-collab.xml:715
242.6543 +msgid ""
242.6544 +"If you get a <quote>permission denied</quote> error, you may have mistyped "
242.6545 +"the username on the server, or you could have mistyped your key's passphrase "
242.6546 +"or the remote user's password."
242.6547 +msgstr ""
242.6548 +
242.6549 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6550 +#: ../en/ch05-collab.xml:720
242.6551 +msgid ""
242.6552 +"In summary, if you're having trouble talking to the server's ssh daemon, "
242.6553 +"first make sure that one is running at all.  On many systems it will be "
242.6554 +"installed, but disabled, by default.  Once you're done with this step, you "
242.6555 +"should then check that the server's firewall is configured to allow incoming "
242.6556 +"connections on the port the ssh daemon is listening on (usually 22).  Don't "
242.6557 +"worry about more exotic possibilities for misconfiguration until you've "
242.6558 +"checked these two first."
242.6559 +msgstr ""
242.6560 +
242.6561 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6562 +#: ../en/ch05-collab.xml:730
242.6563 +msgid ""
242.6564 +"If you're using an authentication agent on the client side to store "
242.6565 +"passphrases for your keys, you ought to be able to log into the server "
242.6566 +"without being prompted for a passphrase or a password.  If you're prompted "
242.6567 +"for a passphrase, there are a few possible culprits."
242.6568 +msgstr ""
242.6569 +
242.6570 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.6571 +#: ../en/ch05-collab.xml:736
242.6572 +msgid ""
242.6573 +"You might have forgotten to use <command>ssh-add</command> or "
242.6574 +"<command>pageant</command> to store the passphrase."
242.6575 +msgstr ""
242.6576 +
242.6577 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.6578 +#: ../en/ch05-collab.xml:740
242.6579 +msgid "You might have stored the passphrase for the wrong key."
242.6580 +msgstr ""
242.6581 +
242.6582 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6583 +#: ../en/ch05-collab.xml:743
242.6584 +msgid ""
242.6585 +"If you're being prompted for the remote user's password, there are another "
242.6586 +"few possible problems to check."
242.6587 +msgstr ""
242.6588 +
242.6589 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.6590 +#: ../en/ch05-collab.xml:746
242.6591 +msgid ""
242.6592 +"Either the user's home directory or their <filename role=\"special\" class="
242.6593 +"\"directory\">.ssh</filename> directory might have excessively liberal "
242.6594 +"permissions.  As a result, the ssh daemon will not trust or read their "
242.6595 +"<filename role=\"special\">authorized_keys</filename> file.  For example, a "
242.6596 +"group-writable home or <filename role=\"special\" class=\"directory\">.ssh</"
242.6597 +"filename> directory will often cause this symptom."
242.6598 +msgstr ""
242.6599 +
242.6600 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.6601 +#: ../en/ch05-collab.xml:755
242.6602 +msgid ""
242.6603 +"The user's <filename role=\"special\">authorized_keys</filename> file may "
242.6604 +"have a problem. If anyone other than the user owns or can write to that file, "
242.6605 +"the ssh daemon will not trust or read it."
242.6606 +msgstr ""
242.6607 +
242.6608 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6609 +#: ../en/ch05-collab.xml:762
242.6610 +msgid ""
242.6611 +"In the ideal world, you should be able to run the following command "
242.6612 +"successfully, and it should print exactly one line of output, the current "
242.6613 +"date and time."
242.6614 +msgstr ""
242.6615 +
242.6616 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6617 +#: ../en/ch05-collab.xml:767
242.6618 +msgid ""
242.6619 +"If, on your server, you have login scripts that print banners or other junk "
242.6620 +"even when running non-interactive commands like this, you should fix them "
242.6621 +"before you continue, so that they only print output if they're run "
242.6622 +"interactively.  Otherwise these banners will at least clutter up Mercurial's "
242.6623 +"output.  Worse, they could potentially cause problems with running Mercurial "
242.6624 +"commands remotely.  Mercurial makes tries to detect and ignore banners in non-"
242.6625 +"interactive <command>ssh</command> sessions, but it is not foolproof.  (If "
242.6626 +"you're editing your login scripts on your server, the usual way to see if a "
242.6627 +"login script is running in an interactive shell is to check the return code "
242.6628 +"from the command <literal>tty -s</literal>.)"
242.6629 +msgstr ""
242.6630 +
242.6631 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6632 +#: ../en/ch05-collab.xml:781
242.6633 +msgid ""
242.6634 +"Once you've verified that plain old ssh is working with your server, the next "
242.6635 +"step is to ensure that Mercurial runs on the server.  The following command "
242.6636 +"should run successfully:"
242.6637 +msgstr ""
242.6638 +
242.6639 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6640 +#: ../en/ch05-collab.xml:788
242.6641 +msgid ""
242.6642 +"If you see an error message instead of normal <command role=\"hg-cmd\">hg "
242.6643 +"version</command> output, this is usually because you haven't installed "
242.6644 +"Mercurial to <filename class=\"directory\">/usr/bin</filename>.  Don't worry "
242.6645 +"if this is the case; you don't need to do that.  But you should check for a "
242.6646 +"few possible problems."
242.6647 +msgstr ""
242.6648 +
242.6649 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.6650 +#: ../en/ch05-collab.xml:795
242.6651 +msgid ""
242.6652 +"Is Mercurial really installed on the server at all? I know this sounds "
242.6653 +"trivial, but it's worth checking!"
242.6654 +msgstr ""
242.6655 +
242.6656 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.6657 +#: ../en/ch05-collab.xml:799
242.6658 +msgid ""
242.6659 +"Maybe your shell's search path (usually set via the <envar>PATH</envar> "
242.6660 +"environment variable) is simply misconfigured."
242.6661 +msgstr ""
242.6662 +
242.6663 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.6664 +#: ../en/ch05-collab.xml:803
242.6665 +msgid ""
242.6666 +"Perhaps your <envar>PATH</envar> environment variable is only being set to "
242.6667 +"point to the location of the <command>hg</command> executable if the login "
242.6668 +"session is interactive.  This can happen if you're setting the path in the "
242.6669 +"wrong shell login script.  See your shell's documentation for details."
242.6670 +msgstr ""
242.6671 +
242.6672 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.6673 +#: ../en/ch05-collab.xml:810
242.6674 +msgid ""
242.6675 +"The <envar>PYTHONPATH</envar> environment variable may need to contain the "
242.6676 +"path to the Mercurial Python modules.  It might not be set at all; it could "
242.6677 +"be incorrect; or it may be set only if the login is interactive."
242.6678 +msgstr ""
242.6679 +
242.6680 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6681 +#: ../en/ch05-collab.xml:817
242.6682 +msgid ""
242.6683 +"If you can run <command role=\"hg-cmd\">hg version</command> over an ssh "
242.6684 +"connection, well done! You've got the server and client sorted out.  You "
242.6685 +"should now be able to use Mercurial to access repositories hosted by that "
242.6686 +"username on that server.  If you run into problems with Mercurial and ssh at "
242.6687 +"this point, try using the <option role=\"hg-opt-global\">--debug</option> "
242.6688 +"option to get a clearer picture of what's going on."
242.6689 +msgstr ""
242.6690 +
242.6691 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.6692 +#: ../en/ch05-collab.xml:827
242.6693 +msgid "Using compression with ssh"
242.6694 +msgstr "通过 ssh 使用压缩"
242.6695 +
242.6696 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6697 +#: ../en/ch05-collab.xml:829
242.6698 +msgid ""
242.6699 +"Mercurial does not compress data when it uses the ssh protocol, because the "
242.6700 +"ssh protocol can transparently compress data.  However, the default behaviour "
242.6701 +"of ssh clients is <emphasis>not</emphasis> to request compression."
242.6702 +msgstr ""
242.6703 +
242.6704 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6705 +#: ../en/ch05-collab.xml:834
242.6706 +msgid ""
242.6707 +"Over any network other than a fast LAN (even a wireless network), using "
242.6708 +"compression is likely to significantly speed up Mercurial's network "
242.6709 +"operations.  For example, over a WAN, someone measured compression as "
242.6710 +"reducing the amount of time required to clone a particularly large repository "
242.6711 +"from 51 minutes to 17 minutes."
242.6712 +msgstr ""
242.6713 +
242.6714 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6715 +#: ../en/ch05-collab.xml:841
242.6716 +msgid ""
242.6717 +"Both <command>ssh</command> and <command>plink</command> accept a <option "
242.6718 +"role=\"cmd-opt-ssh\">-C</option> option which turns on compression.  You can "
242.6719 +"easily edit your <filename role=\"special\">~/.hgrc</filename> to enable "
242.6720 +"compression for all of Mercurial's uses of the ssh protocol."
242.6721 +msgstr ""
242.6722 +
242.6723 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6724 +#: ../en/ch05-collab.xml:849
242.6725 +msgid ""
242.6726 +"If you use <command>ssh</command>, you can configure it to always use "
242.6727 +"compression when talking to your server.  To do this, edit your <filename "
242.6728 +"role=\"special\">.ssh/config</filename> file (which may not yet exist), as "
242.6729 +"follows."
242.6730 +msgstr ""
242.6731 +
242.6732 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6733 +#: ../en/ch05-collab.xml:857
242.6734 +msgid ""
242.6735 +"This defines an alias, <literal>hg</literal>.  When you use it on the "
242.6736 +"<command>ssh</command> command line or in a Mercurial <literal>ssh</literal>-"
242.6737 +"protocol URL, it will cause <command>ssh</command> to connect to <literal>hg."
242.6738 +"example.com</literal> and use compression.  This gives you both a shorter "
242.6739 +"name to type and compression, each of which is a good thing in its own right."
242.6740 +msgstr ""
242.6741 +
242.6742 +#. type: Content of: <book><chapter><sect1><title>
242.6743 +#: ../en/ch05-collab.xml:868
242.6744 +msgid "Serving over HTTP using CGI"
242.6745 +msgstr "使用 CGI 通过 HTTP 提供服务"
242.6746 +
242.6747 +#. type: Content of: <book><chapter><sect1><para>
242.6748 +#: ../en/ch05-collab.xml:870
242.6749 +msgid ""
242.6750 +"Depending on how ambitious you are, configuring Mercurial's CGI interface can "
242.6751 +"take anything from a few moments to several hours."
242.6752 +msgstr ""
242.6753 +
242.6754 +#. type: Content of: <book><chapter><sect1><para>
242.6755 +#: ../en/ch05-collab.xml:874
242.6756 +msgid ""
242.6757 +"We'll begin with the simplest of examples, and work our way towards a more "
242.6758 +"complex configuration.  Even for the most basic case, you're almost certainly "
242.6759 +"going to need to read and modify your web server's configuration."
242.6760 +msgstr ""
242.6761 +
242.6762 +#. type: Content of: <book><chapter><sect1><note><para>
242.6763 +#: ../en/ch05-collab.xml:880
242.6764 +msgid ""
242.6765 +"Configuring a web server is a complex, fiddly, and highly system-dependent "
242.6766 +"activity.  I can't possibly give you instructions that will cover anything "
242.6767 +"like all of the cases you will encounter. Please use your discretion and "
242.6768 +"judgment in following the sections below.  Be prepared to make plenty of "
242.6769 +"mistakes, and to spend a lot of time reading your server's error logs."
242.6770 +msgstr ""
242.6771 +
242.6772 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.6773 +#: ../en/ch05-collab.xml:890
242.6774 +msgid "Web server configuration checklist"
242.6775 +msgstr "Web 服务器配置检查表"
242.6776 +
242.6777 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6778 +#: ../en/ch05-collab.xml:892
242.6779 +msgid ""
242.6780 +"Before you continue, do take a few moments to check a few aspects of your "
242.6781 +"system's setup."
242.6782 +msgstr ""
242.6783 +
242.6784 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.6785 +#: ../en/ch05-collab.xml:896
242.6786 +msgid ""
242.6787 +"Do you have a web server installed at all? Mac OS X ships with Apache, but "
242.6788 +"many other systems may not have a web server installed."
242.6789 +msgstr ""
242.6790 +
242.6791 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.6792 +#: ../en/ch05-collab.xml:900
242.6793 +msgid ""
242.6794 +"If you have a web server installed, is it actually running? On most systems, "
242.6795 +"even if one is present, it will be disabled by default."
242.6796 +msgstr ""
242.6797 +
242.6798 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.6799 +#: ../en/ch05-collab.xml:904
242.6800 +msgid ""
242.6801 +"Is your server configured to allow you to run CGI programs in the directory "
242.6802 +"where you plan to do so? Most servers default to explicitly disabling the "
242.6803 +"ability to run CGI programs."
242.6804 +msgstr ""
242.6805 +
242.6806 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6807 +#: ../en/ch05-collab.xml:910
242.6808 +msgid ""
242.6809 +"If you don't have a web server installed, and don't have substantial "
242.6810 +"experience configuring Apache, you should consider using the "
242.6811 +"<literal>lighttpd</literal> web server instead of Apache.  Apache has a well-"
242.6812 +"deserved reputation for baroque and confusing configuration. While "
242.6813 +"<literal>lighttpd</literal> is less capable in some ways than Apache, most of "
242.6814 +"these capabilities are not relevant to serving Mercurial repositories.  And "
242.6815 +"<literal>lighttpd</literal> is undeniably <emphasis>much</emphasis> easier to "
242.6816 +"get started with than Apache."
242.6817 +msgstr ""
242.6818 +
242.6819 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.6820 +#: ../en/ch05-collab.xml:923
242.6821 +msgid "Basic CGI configuration"
242.6822 +msgstr "基本 CGI 配置"
242.6823 +
242.6824 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6825 +#: ../en/ch05-collab.xml:925
242.6826 +msgid ""
242.6827 +"On Unix-like systems, it's common for users to have a subdirectory named "
242.6828 +"something like <filename class=\"directory\">public_html</filename> in their "
242.6829 +"home directory, from which they can serve up web pages.  A file named "
242.6830 +"<filename>foo</filename> in this directory will be accessible at a URL of the "
242.6831 +"form <literal>http://www.example.com/username/foo</literal>."
242.6832 +msgstr ""
242.6833 +
242.6834 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6835 +#: ../en/ch05-collab.xml:933
242.6836 +msgid ""
242.6837 +"To get started, find the <filename role=\"special\">hgweb.cgi</filename> "
242.6838 +"script that should be present in your Mercurial installation.  If you can't "
242.6839 +"quickly find a local copy on your system, simply download one from the master "
242.6840 +"Mercurial repository at <ulink url=\"http://www.selenic.com/repo/hg/raw-file/"
242.6841 +"tip/hgweb.cgi\">http://www.selenic.com/repo/hg/raw-file/tip/hgweb.cgi</ulink>."
242.6842 +msgstr ""
242.6843 +
242.6844 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6845 +#: ../en/ch05-collab.xml:940 ../en/ch05-collab.xml:1109
242.6846 +msgid ""
242.6847 +"You'll need to copy this script into your <filename class=\"directory"
242.6848 +"\">public_html</filename> directory, and ensure that it's executable."
242.6849 +msgstr ""
242.6850 +
242.6851 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.6852 +#: ../en/ch05-collab.xml:945
242.6853 +msgid ""
242.6854 +"The <literal>755</literal> argument to <command>chmod</command> is a little "
242.6855 +"more general than just making the script executable: it ensures that the "
242.6856 +"script is executable by anyone, and that <quote>group</quote> and "
242.6857 +"<quote>other</quote> write permissions are <emphasis>not</emphasis> set.  If "
242.6858 +"you were to leave those write permissions enabled, Apache's <literal>suexec</"
242.6859 +"literal> subsystem would likely refuse to execute the script.  In fact, "
242.6860 +"<literal>suexec</literal> also insists that the <emphasis>directory</"
242.6861 +"emphasis> in which the script resides must not be writable by others."
242.6862 +msgstr ""
242.6863 +
242.6864 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title>
242.6865 +#: ../en/ch05-collab.xml:959
242.6866 +msgid "What could <emphasis>possibly</emphasis> go wrong?"
242.6867 +msgstr "什么<emphasis>可能</emphasis>会出错?"
242.6868 +
242.6869 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.6870 +#: ../en/ch05-collab.xml:962
242.6871 +msgid ""
242.6872 +"Once you've copied the CGI script into place, go into a web browser, and try "
242.6873 +"to open the URL <ulink url=\"http://myhostname/ myuser/hgweb.cgi\">http://"
242.6874 +"myhostname/ myuser/hgweb.cgi</ulink>, <emphasis>but</emphasis> brace yourself "
242.6875 +"for instant failure.  There's a high probability that trying to visit this "
242.6876 +"URL will fail, and there are many possible reasons for this.  In fact, you're "
242.6877 +"likely to stumble over almost every one of the possible errors below, so "
242.6878 +"please read carefully.  The following are all of the problems I ran into on a "
242.6879 +"system running Fedora 7, with a fresh installation of Apache, and a user "
242.6880 +"account that I created specially to perform this exercise."
242.6881 +msgstr ""
242.6882 +
242.6883 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.6884 +#: ../en/ch05-collab.xml:976
242.6885 +msgid ""
242.6886 +"Your web server may have per-user directories disabled.  If you're using "
242.6887 +"Apache, search your config file for a <literal>UserDir</literal> directive.  "
242.6888 +"If there's none present, per-user directories will be disabled.  If one "
242.6889 +"exists, but its value is <literal>disabled</literal>, then per-user "
242.6890 +"directories will be disabled.  Otherwise, the string after <literal>UserDir</"
242.6891 +"literal> gives the name of the subdirectory that Apache will look in under "
242.6892 +"your home directory, for example <filename class=\"directory\">public_html</"
242.6893 +"filename>."
242.6894 +msgstr ""
242.6895 +
242.6896 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.6897 +#: ../en/ch05-collab.xml:987
242.6898 +msgid ""
242.6899 +"Your file access permissions may be too restrictive.  The web server must be "
242.6900 +"able to traverse your home directory and directories under your <filename "
242.6901 +"class=\"directory\">public_html</filename> directory, and read files under "
242.6902 +"the latter too.  Here's a quick recipe to help you to make your permissions "
242.6903 +"more appropriate."
242.6904 +msgstr ""
242.6905 +
242.6906 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.6907 +#: ../en/ch05-collab.xml:997
242.6908 +msgid ""
242.6909 +"The other possibility with permissions is that you might get a completely "
242.6910 +"empty window when you try to load the script.  In this case, it's likely that "
242.6911 +"your access permissions are <emphasis>too permissive</emphasis>.  Apache's "
242.6912 +"<literal>suexec</literal> subsystem won't execute a script that's group- or "
242.6913 +"world-writable, for example."
242.6914 +msgstr ""
242.6915 +
242.6916 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.6917 +#: ../en/ch05-collab.xml:1004
242.6918 +msgid ""
242.6919 +"Your web server may be configured to disallow execution of CGI programs in "
242.6920 +"your per-user web directory.  Here's Apache's default per-user configuration "
242.6921 +"from my Fedora system."
242.6922 +msgstr ""
242.6923 +
242.6924 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.6925 +#: ../en/ch05-collab.xml:1011
242.6926 +msgid ""
242.6927 +"If you find a similar-looking <literal>Directory</literal> group in your "
242.6928 +"Apache configuration, the directive to look at inside it is <literal>Options</"
242.6929 +"literal>. Add <literal>ExecCGI</literal> to the end of this list if it's "
242.6930 +"missing, and restart the web server."
242.6931 +msgstr ""
242.6932 +
242.6933 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.6934 +#: ../en/ch05-collab.xml:1018
242.6935 +msgid ""
242.6936 +"If you find that Apache serves you the text of the CGI script instead of "
242.6937 +"executing it, you may need to either uncomment (if already present) or add a "
242.6938 +"directive like this."
242.6939 +msgstr ""
242.6940 +
242.6941 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.6942 +#: ../en/ch05-collab.xml:1024
242.6943 +msgid ""
242.6944 +"The next possibility is that you might be served with a colourful Python "
242.6945 +"backtrace claiming that it can't import a <literal>mercurial</literal>-"
242.6946 +"related module.  This is actually progress! The server is now capable of "
242.6947 +"executing your CGI script.  This error is only likely to occur if you're "
242.6948 +"running a private installation of Mercurial, instead of a system-wide "
242.6949 +"version.  Remember that the web server runs the CGI program without any of "
242.6950 +"the environment variables that you take for granted in an interactive "
242.6951 +"session.  If this error happens to you, edit your copy of <filename role="
242.6952 +"\"special\">hgweb.cgi</filename> and follow the directions inside it to "
242.6953 +"correctly set your <envar>PYTHONPATH</envar> environment variable."
242.6954 +msgstr ""
242.6955 +
242.6956 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.6957 +#: ../en/ch05-collab.xml:1038
242.6958 +msgid ""
242.6959 +"Finally, you are <emphasis>certain</emphasis> to by served with another "
242.6960 +"colourful Python backtrace: this one will complain that it can't find "
242.6961 +"<filename class=\"directory\">/path/to/repository</filename>.  Edit your "
242.6962 +"<filename role=\"special\">hgweb.cgi</filename> script and replace the "
242.6963 +"<filename class=\"directory\">/path/to/repository</filename> string with the "
242.6964 +"complete path to the repository you want to serve up."
242.6965 +msgstr ""
242.6966 +
242.6967 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.6968 +#: ../en/ch05-collab.xml:1048
242.6969 +msgid ""
242.6970 +"At this point, when you try to reload the page, you should be presented with "
242.6971 +"a nice HTML view of your repository's history.  Whew!"
242.6972 +msgstr ""
242.6973 +
242.6974 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title>
242.6975 +#: ../en/ch05-collab.xml:1054
242.6976 +msgid "Configuring lighttpd"
242.6977 +msgstr "配置 lighttpd"
242.6978 +
242.6979 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.6980 +#: ../en/ch05-collab.xml:1056
242.6981 +msgid ""
242.6982 +"To be exhaustive in my experiments, I tried configuring the increasingly "
242.6983 +"popular <literal>lighttpd</literal> web server to serve the same repository "
242.6984 +"as I described with Apache above.  I had already overcome all of the problems "
242.6985 +"I outlined with Apache, many of which are not server-specific.  As a result, "
242.6986 +"I was fairly sure that my file and directory permissions were good, and that "
242.6987 +"my <filename role=\"special\">hgweb.cgi</filename> script was properly edited."
242.6988 +msgstr ""
242.6989 +
242.6990 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.6991 +#: ../en/ch05-collab.xml:1066
242.6992 +msgid ""
242.6993 +"Once I had Apache running, getting <literal>lighttpd</literal> to serve the "
242.6994 +"repository was a snap (in other words, even if you're trying to use "
242.6995 +"<literal>lighttpd</literal>, you should read the Apache section).  I first "
242.6996 +"had to edit the <literal>mod_access</literal> section of its config file to "
242.6997 +"enable <literal>mod_cgi</literal> and <literal>mod_userdir</literal>, both of "
242.6998 +"which were disabled by default on my system.  I then added a few lines to the "
242.6999 +"end of the config file, to configure these modules."
242.7000 +msgstr ""
242.7001 +
242.7002 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.7003 +#: ../en/ch05-collab.xml:1078
242.7004 +msgid ""
242.7005 +"With this done, <literal>lighttpd</literal> ran immediately for me.  If I had "
242.7006 +"configured <literal>lighttpd</literal> before Apache, I'd almost certainly "
242.7007 +"have run into many of the same system-level configuration problems as I did "
242.7008 +"with Apache.  However, I found <literal>lighttpd</literal> to be noticeably "
242.7009 +"easier to configure than Apache, even though I've used Apache for over a "
242.7010 +"decade, and this was my first exposure to <literal>lighttpd</literal>."
242.7011 +msgstr ""
242.7012 +
242.7013 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.7014 +#: ../en/ch05-collab.xml:1091
242.7015 +msgid "Sharing multiple repositories with one CGI script"
242.7016 +msgstr "使用一个 CGI 脚本共享多个版本库"
242.7017 +
242.7018 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7019 +#: ../en/ch05-collab.xml:1093
242.7020 +msgid ""
242.7021 +"The <filename role=\"special\">hgweb.cgi</filename> script only lets you "
242.7022 +"publish a single repository, which is an annoying restriction.  If you want "
242.7023 +"to publish more than one without wracking yourself with multiple copies of "
242.7024 +"the same script, each with different names, a better choice is to use the "
242.7025 +"<filename role=\"special\">hgwebdir.cgi</filename> script."
242.7026 +msgstr ""
242.7027 +
242.7028 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7029 +#: ../en/ch05-collab.xml:1101
242.7030 +msgid ""
242.7031 +"The procedure to configure <filename role=\"special\">hgwebdir.cgi</filename> "
242.7032 +"is only a little more involved than for <filename role=\"special\">hgweb.cgi</"
242.7033 +"filename>.  First, you must obtain a copy of the script.  If you don't have "
242.7034 +"one handy, you can download a copy from the master Mercurial repository at "
242.7035 +"<ulink url=\"http://www.selenic.com/repo/hg/raw-file/tip/hgwebdir.cgi"
242.7036 +"\">http://www.selenic.com/repo/hg/raw-file/tip/hgwebdir.cgi</ulink>."
242.7037 +msgstr ""
242.7038 +
242.7039 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7040 +#: ../en/ch05-collab.xml:1116
242.7041 +msgid ""
242.7042 +"With basic configuration out of the way, try to visit <ulink url=\"http://"
242.7043 +"myhostname/ myuser/hgwebdir.cgi\">http://myhostname/ myuser/hgwebdir.cgi</"
242.7044 +"ulink> in your browser.  It should display an empty list of repositories.  If "
242.7045 +"you get a blank window or error message, try walking through the list of "
242.7046 +"potential problems in <xref linkend=\"sec:collab:wtf\"/>."
242.7047 +msgstr ""
242.7048 +
242.7049 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7050 +#: ../en/ch05-collab.xml:1125
242.7051 +msgid ""
242.7052 +"The <filename role=\"special\">hgwebdir.cgi</filename> script relies on an "
242.7053 +"external configuration file.  By default, it searches for a file named "
242.7054 +"<filename role=\"special\">hgweb.config</filename> in the same directory as "
242.7055 +"itself.  You'll need to create this file, and make it world-readable.  The "
242.7056 +"format of the file is similar to a Windows <quote>ini</quote> file, as "
242.7057 +"understood by Python's <literal>ConfigParser</literal> <citation>web:"
242.7058 +"configparser</citation> module."
242.7059 +msgstr ""
242.7060 +
242.7061 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7062 +#: ../en/ch05-collab.xml:1135
242.7063 +msgid ""
242.7064 +"The easiest way to configure <filename role=\"special\">hgwebdir.cgi</"
242.7065 +"filename> is with a section named <literal>collections</literal>.  This will "
242.7066 +"automatically publish <emphasis>every</emphasis> repository under the "
242.7067 +"directories you name.  The section should look like this:"
242.7068 +msgstr ""
242.7069 +
242.7070 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7071 +#: ../en/ch05-collab.xml:1143
242.7072 +msgid ""
242.7073 +"Mercurial interprets this by looking at the directory name on the "
242.7074 +"<emphasis>right</emphasis> hand side of the <quote><literal>=</literal></"
242.7075 +"quote> sign; finding repositories in that directory hierarchy; and using the "
242.7076 +"text on the <emphasis>left</emphasis> to strip off matching text from the "
242.7077 +"names it will actually list in the web interface.  The remaining component of "
242.7078 +"a path after this stripping has occurred is called a <quote>virtual path</"
242.7079 +"quote>."
242.7080 +msgstr ""
242.7081 +
242.7082 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7083 +#: ../en/ch05-collab.xml:1152
242.7084 +msgid ""
242.7085 +"Given the example above, if we have a repository whose local path is "
242.7086 +"<filename class=\"directory\">/my/root/this/repo</filename>, the CGI script "
242.7087 +"will strip the leading <filename class=\"directory\">/my/root</filename> from "
242.7088 +"the name, and publish the repository with a virtual path of <filename class="
242.7089 +"\"directory\">this/repo</filename>.  If the base URL for our CGI script is "
242.7090 +"<ulink url=\"http://myhostname/ myuser/hgwebdir.cgi\">http://myhostname/ "
242.7091 +"myuser/hgwebdir.cgi</ulink>, the complete URL for that repository will be "
242.7092 +"<ulink url=\"http://myhostname/ myuser/hgwebdir.cgi/this/repo\">http://"
242.7093 +"myhostname/ myuser/hgwebdir.cgi/this/repo</ulink>."
242.7094 +msgstr ""
242.7095 +
242.7096 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7097 +#: ../en/ch05-collab.xml:1166
242.7098 +msgid ""
242.7099 +"If we replace <filename class=\"directory\">/my/root</filename> on the left "
242.7100 +"hand side of this example with <filename class=\"directory\">/my</filename>, "
242.7101 +"then <filename role=\"special\">hgwebdir.cgi</filename> will only strip off "
242.7102 +"<filename class=\"directory\">/my</filename> from the repository name, and "
242.7103 +"will give us a virtual path of <filename class=\"directory\">root/this/repo</"
242.7104 +"filename> instead of <filename class=\"directory\">this/repo</filename>."
242.7105 +msgstr ""
242.7106 +
242.7107 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7108 +#: ../en/ch05-collab.xml:1176
242.7109 +msgid ""
242.7110 +"The <filename role=\"special\">hgwebdir.cgi</filename> script will "
242.7111 +"recursively search each directory listed in the <literal>collections</"
242.7112 +"literal> section of its configuration file, but it will <literal>not</"
242.7113 +"literal> recurse into the repositories it finds."
242.7114 +msgstr ""
242.7115 +
242.7116 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7117 +#: ../en/ch05-collab.xml:1182
242.7118 +msgid ""
242.7119 +"The <literal>collections</literal> mechanism makes it easy to publish many "
242.7120 +"repositories in a <quote>fire and forget</quote> manner.  You only need to "
242.7121 +"set up the CGI script and configuration file one time.  Afterwards, you can "
242.7122 +"publish or unpublish a repository at any time by simply moving it into, or "
242.7123 +"out of, the directory hierarchy in which you've configured <filename role="
242.7124 +"\"special\">hgwebdir.cgi</filename> to look."
242.7125 +msgstr ""
242.7126 +
242.7127 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title>
242.7128 +#: ../en/ch05-collab.xml:1192
242.7129 +msgid "Explicitly specifying which repositories to publish"
242.7130 +msgstr "明确指出要发布的版本库"
242.7131 +
242.7132 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.7133 +#: ../en/ch05-collab.xml:1195
242.7134 +msgid ""
242.7135 +"In addition to the <literal>collections</literal> mechanism, the <filename "
242.7136 +"role=\"special\">hgwebdir.cgi</filename> script allows you to publish a "
242.7137 +"specific list of repositories.  To do so, create a <literal>paths</literal> "
242.7138 +"section, with contents of the following form."
242.7139 +msgstr ""
242.7140 +
242.7141 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.7142 +#: ../en/ch05-collab.xml:1204
242.7143 +msgid ""
242.7144 +"In this case, the virtual path (the component that will appear in a URL) is "
242.7145 +"on the left hand side of each definition, while the path to the repository is "
242.7146 +"on the right.  Notice that there does not need to be any relationship between "
242.7147 +"the virtual path you choose and the location of a repository in your "
242.7148 +"filesystem."
242.7149 +msgstr ""
242.7150 +
242.7151 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.7152 +#: ../en/ch05-collab.xml:1211
242.7153 +msgid ""
242.7154 +"If you wish, you can use both the <literal>collections</literal> and "
242.7155 +"<literal>paths</literal> mechanisms simultaneously in a single configuration "
242.7156 +"file."
242.7157 +msgstr ""
242.7158 +
242.7159 +#. type: Content of: <book><chapter><sect1><sect2><sect3><note><para>
242.7160 +#: ../en/ch05-collab.xml:1217
242.7161 +msgid ""
242.7162 +"If multiple repositories have the same virtual path, <filename role=\"special"
242.7163 +"\">hgwebdir.cgi</filename> will not report an error.  Instead, it will behave "
242.7164 +"unpredictably."
242.7165 +msgstr ""
242.7166 +
242.7167 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.7168 +#: ../en/ch05-collab.xml:1226
242.7169 +msgid "Downloading source archives"
242.7170 +msgstr "下载源代码档案包"
242.7171 +
242.7172 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7173 +#: ../en/ch05-collab.xml:1228
242.7174 +msgid ""
242.7175 +"Mercurial's web interface lets users download an archive of any revision.  "
242.7176 +"This archive will contain a snapshot of the working directory as of that "
242.7177 +"revision, but it will not contain a copy of the repository data."
242.7178 +msgstr ""
242.7179 +
242.7180 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7181 +#: ../en/ch05-collab.xml:1233
242.7182 +msgid ""
242.7183 +"By default, this feature is not enabled.  To enable it, you'll need to add an "
242.7184 +"<envar role=\"rc-item-web\">allow_archive</envar> item to the <literal role="
242.7185 +"\"rc-web\">web</literal> section of your <filename role=\"special\">~/.hgrc</"
242.7186 +"filename>."
242.7187 +msgstr ""
242.7188 +
242.7189 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.7190 +#: ../en/ch05-collab.xml:1241
242.7191 +msgid "Web configuration options"
242.7192 +msgstr "Web 配置选项"
242.7193 +
242.7194 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7195 +#: ../en/ch05-collab.xml:1243
242.7196 +msgid ""
242.7197 +"Mercurial's web interfaces (the <command role=\"hg-cmd\">hg serve</command> "
242.7198 +"command, and the <filename role=\"special\">hgweb.cgi</filename> and "
242.7199 +"<filename role=\"special\">hgwebdir.cgi</filename> scripts) have a number of "
242.7200 +"configuration options that you can set.  These belong in a section named "
242.7201 +"<literal role=\"rc-web\">web</literal>."
242.7202 +msgstr ""
242.7203 +
242.7204 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.7205 +#: ../en/ch05-collab.xml:1251
242.7206 +msgid ""
242.7207 +"<envar role=\"rc-item-web\">allow_archive</envar>: Determines which (if any) "
242.7208 +"archive download mechanisms Mercurial supports.  If you enable this feature, "
242.7209 +"users of the web interface will be able to download an archive of whatever "
242.7210 +"revision of a repository they are viewing. To enable the archive feature, "
242.7211 +"this item must take the form of a sequence of words drawn from the list below."
242.7212 +msgstr ""
242.7213 +
242.7214 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><itemizedlist><listitem><para>
242.7215 +#: ../en/ch05-collab.xml:1260
242.7216 +msgid ""
242.7217 +"<literal>bz2</literal>: A <command>tar</command> archive, compressed using "
242.7218 +"<literal>bzip2</literal> compression.  This has the best compression ratio, "
242.7219 +"but uses the most CPU time on the server."
242.7220 +msgstr ""
242.7221 +
242.7222 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><itemizedlist><listitem><para>
242.7223 +#: ../en/ch05-collab.xml:1266
242.7224 +msgid ""
242.7225 +"<literal>gz</literal>: A <command>tar</command> archive, compressed using "
242.7226 +"<literal>gzip</literal> compression."
242.7227 +msgstr ""
242.7228 +
242.7229 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><itemizedlist><listitem><para>
242.7230 +#: ../en/ch05-collab.xml:1270
242.7231 +msgid ""
242.7232 +"<literal>zip</literal>: A <command>zip</command> archive, compressed using "
242.7233 +"LZW compression.  This format has the worst compression ratio, but is widely "
242.7234 +"used in the Windows world."
242.7235 +msgstr ""
242.7236 +
242.7237 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.7238 +#: ../en/ch05-collab.xml:1276
242.7239 +msgid ""
242.7240 +"If you provide an empty list, or don't have an <envar role=\"rc-item-web"
242.7241 +"\">allow_archive</envar> entry at all, this feature will be disabled.  Here "
242.7242 +"is an example of how to enable all three supported formats."
242.7243 +msgstr ""
242.7244 +
242.7245 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.7246 +#: ../en/ch05-collab.xml:1283
242.7247 +msgid ""
242.7248 +"<envar role=\"rc-item-web\">allowpull</envar>: Boolean.  Determines whether "
242.7249 +"the web interface allows remote users to <command role=\"hg-cmd\">hg pull</"
242.7250 +"command> and <command role=\"hg-cmd\">hg clone</command> this repository over "
242.7251 +"HTTP.  If set to <literal>no</literal> or <literal>false</literal>, only the "
242.7252 +"<quote>human-oriented</quote> portion of the web interface is available."
242.7253 +msgstr ""
242.7254 +
242.7255 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.7256 +#: ../en/ch05-collab.xml:1292
242.7257 +msgid ""
242.7258 +"<envar role=\"rc-item-web\">contact</envar>: String.  A free-form (but "
242.7259 +"preferably brief) string identifying the person or group in charge of the "
242.7260 +"repository.  This often contains the name and email address of a person or "
242.7261 +"mailing list.  It often makes sense to place this entry in a repository's own "
242.7262 +"<filename role=\"special\">.hg/hgrc</filename> file, but it can make sense to "
242.7263 +"use in a global <filename role=\"special\">~/.hgrc</filename> if every "
242.7264 +"repository has a single maintainer."
242.7265 +msgstr ""
242.7266 +
242.7267 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.7268 +#: ../en/ch05-collab.xml:1303
242.7269 +msgid ""
242.7270 +"<envar role=\"rc-item-web\">maxchanges</envar>: Integer.  The default maximum "
242.7271 +"number of changesets to display in a single page of output."
242.7272 +msgstr ""
242.7273 +
242.7274 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.7275 +#: ../en/ch05-collab.xml:1307
242.7276 +msgid ""
242.7277 +"<envar role=\"rc-item-web\">maxfiles</envar>: Integer.  The default maximum "
242.7278 +"number of modified files to display in a single page of output."
242.7279 +msgstr ""
242.7280 +
242.7281 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.7282 +#: ../en/ch05-collab.xml:1311
242.7283 +msgid ""
242.7284 +"<envar role=\"rc-item-web\">stripes</envar>: Integer.  If the web interface "
242.7285 +"displays alternating <quote>stripes</quote> to make it easier to visually "
242.7286 +"align rows when you are looking at a table, this number controls the number "
242.7287 +"of rows in each stripe."
242.7288 +msgstr ""
242.7289 +
242.7290 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.7291 +#: ../en/ch05-collab.xml:1317
242.7292 +msgid ""
242.7293 +"<envar role=\"rc-item-web\">style</envar>: Controls the template Mercurial "
242.7294 +"uses to display the web interface.  Mercurial ships with two web templates, "
242.7295 +"named <literal>default</literal> and <literal>gitweb</literal> (the latter is "
242.7296 +"much more visually attractive).  You can also specify a custom template of "
242.7297 +"your own; see <xref linkend=\"chap:template\"/> for details. Here, you can "
242.7298 +"see how to enable the <literal>gitweb</literal> style."
242.7299 +msgstr ""
242.7300 +
242.7301 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.7302 +#: ../en/ch05-collab.xml:1330
242.7303 +msgid ""
242.7304 +"<envar role=\"rc-item-web\">templates</envar>: Path.  The directory in which "
242.7305 +"to search for template files.  By default, Mercurial searches in the "
242.7306 +"directory in which it was installed."
242.7307 +msgstr ""
242.7308 +
242.7309 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7310 +#: ../en/ch05-collab.xml:1335
242.7311 +msgid ""
242.7312 +"If you are using <filename role=\"special\">hgwebdir.cgi</filename>, you can "
242.7313 +"place a few configuration items in a <literal role=\"rc-web\">web</literal> "
242.7314 +"section of the <filename role=\"special\">hgweb.config</filename> file "
242.7315 +"instead of a <filename role=\"special\">~/.hgrc</filename> file, for "
242.7316 +"convenience.  These items are <envar role=\"rc-item-web\">motd</envar> and "
242.7317 +"<envar role=\"rc-item-web\">style</envar>."
242.7318 +msgstr ""
242.7319 +
242.7320 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title>
242.7321 +#: ../en/ch05-collab.xml:1346
242.7322 +msgid "Options specific to an individual repository"
242.7323 +msgstr "针对单个版本库的选项"
242.7324 +
242.7325 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.7326 +#: ../en/ch05-collab.xml:1348
242.7327 +msgid ""
242.7328 +"A few <literal role=\"rc-web\">web</literal> configuration items ought to be "
242.7329 +"placed in a repository's local <filename role=\"special\">.hg/hgrc</"
242.7330 +"filename>, rather than a user's or global <filename role=\"special\">~/.hgrc</"
242.7331 +"filename>."
242.7332 +msgstr ""
242.7333 +
242.7334 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.7335 +#: ../en/ch05-collab.xml:1353
242.7336 +msgid ""
242.7337 +"<envar role=\"rc-item-web\">description</envar>: String.  A free-form (but "
242.7338 +"preferably brief) string that describes the contents or purpose of the "
242.7339 +"repository."
242.7340 +msgstr ""
242.7341 +
242.7342 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.7343 +#: ../en/ch05-collab.xml:1358
242.7344 +msgid ""
242.7345 +"<envar role=\"rc-item-web\">name</envar>: String.  The name to use for the "
242.7346 +"repository in the web interface.  This overrides the default name, which is "
242.7347 +"the last component of the repository's path."
242.7348 +msgstr ""
242.7349 +
242.7350 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title>
242.7351 +#: ../en/ch05-collab.xml:1366
242.7352 +msgid ""
242.7353 +"Options specific to the <command role=\"hg-cmd\">hg serve</command> command"
242.7354 +msgstr "命令 <command role=\"hg-cmd\">hg serve</command> 的选项"
242.7355 +
242.7356 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.7357 +#: ../en/ch05-collab.xml:1369
242.7358 +msgid ""
242.7359 +"Some of the items in the <literal role=\"rc-web\">web</literal> section of a "
242.7360 +"<filename role=\"special\">~/.hgrc</filename> file are only for use with the "
242.7361 +"<command role=\"hg-cmd\">hg serve</command> command."
242.7362 +msgstr ""
242.7363 +
242.7364 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.7365 +#: ../en/ch05-collab.xml:1375
242.7366 +msgid ""
242.7367 +"<envar role=\"rc-item-web\">accesslog</envar>: Path.  The name of a file into "
242.7368 +"which to write an access log.  By default, the <command role=\"hg-cmd\">hg "
242.7369 +"serve</command> command writes this information to standard output, not to a "
242.7370 +"file.  Log entries are written in the standard <quote>combined</quote> file "
242.7371 +"format used by almost all web servers."
242.7372 +msgstr ""
242.7373 +
242.7374 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.7375 +#: ../en/ch05-collab.xml:1383
242.7376 +msgid ""
242.7377 +"<envar role=\"rc-item-web\">address</envar>: String.  The local address on "
242.7378 +"which the server should listen for incoming connections.  By default, the "
242.7379 +"server listens on all addresses."
242.7380 +msgstr ""
242.7381 +
242.7382 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.7383 +#: ../en/ch05-collab.xml:1388
242.7384 +msgid ""
242.7385 +"<envar role=\"rc-item-web\">errorlog</envar>: Path.  The name of a file into "
242.7386 +"which to write an error log.  By default, the <command role=\"hg-cmd\">hg "
242.7387 +"serve</command> command writes this information to standard error, not to a "
242.7388 +"file."
242.7389 +msgstr ""
242.7390 +
242.7391 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.7392 +#: ../en/ch05-collab.xml:1394
242.7393 +msgid ""
242.7394 +"<envar role=\"rc-item-web\">ipv6</envar>: Boolean.  Whether to use the IPv6 "
242.7395 +"protocol. By default, IPv6 is not used."
242.7396 +msgstr ""
242.7397 +
242.7398 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.7399 +#: ../en/ch05-collab.xml:1398
242.7400 +msgid ""
242.7401 +"<envar role=\"rc-item-web\">port</envar>: Integer.  The TCP port number on "
242.7402 +"which the server should listen.  The default port number used is 8000."
242.7403 +msgstr ""
242.7404 +
242.7405 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title>
242.7406 +#: ../en/ch05-collab.xml:1405
242.7407 +msgid ""
242.7408 +"Choosing the right <filename role=\"special\">~/.hgrc</filename> file to add "
242.7409 +"<literal role=\"rc-web\">web</literal> items to"
242.7410 +msgstr ""
242.7411 +"选择正确的 <filename role=\"special\"> ~/.hgrc</filename> 文件增加到 <literal "
242.7412 +"role=\"rc-web\">web</literal> 条目"
242.7413 +
242.7414 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.7415 +#: ../en/ch05-collab.xml:1409
242.7416 +msgid ""
242.7417 +"It is important to remember that a web server like Apache or "
242.7418 +"<literal>lighttpd</literal> will run under a user ID that is different to "
242.7419 +"yours. CGI scripts run by your server, such as <filename role=\"special"
242.7420 +"\">hgweb.cgi</filename>, will usually also run under that user ID."
242.7421 +msgstr ""
242.7422 +
242.7423 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.7424 +#: ../en/ch05-collab.xml:1416
242.7425 +msgid ""
242.7426 +"If you add <literal role=\"rc-web\">web</literal> items to your own personal "
242.7427 +"<filename role=\"special\">~/.hgrc</filename> file, CGI scripts won't read "
242.7428 +"that <filename role=\"special\">~/.hgrc</filename> file.  Those settings will "
242.7429 +"thus only affect the behaviour of the <command role=\"hg-cmd\">hg serve</"
242.7430 +"command> command when you run it.  To cause CGI scripts to see your settings, "
242.7431 +"either create a <filename role=\"special\">~/.hgrc</filename> file in the "
242.7432 +"home directory of the user ID that runs your web server, or add those "
242.7433 +"settings to a system-wide <filename role=\"special\">~/.hgrc</filename> file."
242.7434 +msgstr ""
242.7435 +
242.7436 +#. type: Content of: <book><chapter><title>
242.7437 +#: ../en/ch06-filenames.xml:5
242.7438 +msgid "File names and pattern matching"
242.7439 +msgstr "文件名称与模式匹配"
242.7440 +
242.7441 +#. type: Content of: <book><chapter><para>
242.7442 +#: ../en/ch06-filenames.xml:7
242.7443 +msgid ""
242.7444 +"Mercurial provides mechanisms that let you work with file names in a "
242.7445 +"consistent and expressive way."
242.7446 +msgstr ""
242.7447 +
242.7448 +#. type: Content of: <book><chapter><sect1><title>
242.7449 +#: ../en/ch06-filenames.xml:11
242.7450 +msgid "Simple file naming"
242.7451 +msgstr "简单文件名称"
242.7452 +
242.7453 +#. type: Content of: <book><chapter><sect1><para>
242.7454 +#: ../en/ch06-filenames.xml:13
242.7455 +msgid ""
242.7456 +"Mercurial uses a unified piece of machinery <quote>under the hood</quote> to "
242.7457 +"handle file names.  Every command behaves uniformly with respect to file "
242.7458 +"names.  The way in which commands work with file names is as follows."
242.7459 +msgstr ""
242.7460 +
242.7461 +#. type: Content of: <book><chapter><sect1><para>
242.7462 +#: ../en/ch06-filenames.xml:18
242.7463 +msgid ""
242.7464 +"If you explicitly name real files on the command line, Mercurial works with "
242.7465 +"exactly those files, as you would expect.  &interaction.filenames.files;"
242.7466 +msgstr ""
242.7467 +
242.7468 +#
242.7469 +#. type: Content of: <book><chapter><sect1><para>
242.7470 +#: ../en/ch06-filenames.xml:22
242.7471 +msgid ""
242.7472 +"When you provide a directory name, Mercurial will interpret this as "
242.7473 +"<quote>operate on every file in this directory and its subdirectories</"
242.7474 +"quote>. Mercurial traverses the files and subdirectories in a directory in "
242.7475 +"alphabetical order.  When it encounters a subdirectory, it will traverse that "
242.7476 +"subdirectory before continuing with the current directory."
242.7477 +msgstr ""
242.7478 +
242.7479 +#. type: Content of: <book><chapter><sect1><title>
242.7480 +#: ../en/ch06-filenames.xml:33
242.7481 +msgid "Running commands without any file names"
242.7482 +msgstr "不提供文件名称的执行命令"
242.7483 +
242.7484 +#. type: Content of: <book><chapter><sect1><para>
242.7485 +#: ../en/ch06-filenames.xml:35
242.7486 +msgid ""
242.7487 +"Mercurial's commands that work with file names have useful default behaviours "
242.7488 +"when you invoke them without providing any file names or patterns.  What kind "
242.7489 +"of behaviour you should expect depends on what the command does.  Here are a "
242.7490 +"few rules of thumb you can use to predict what a command is likely to do if "
242.7491 +"you don't give it any names to work with."
242.7492 +msgstr ""
242.7493 +
242.7494 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.7495 +#: ../en/ch06-filenames.xml:42
242.7496 +msgid ""
242.7497 +"Most commands will operate on the entire working directory. This is what the "
242.7498 +"<command role=\"hg-cmd\">hg add</command> command does, for example."
242.7499 +msgstr ""
242.7500 +
242.7501 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.7502 +#: ../en/ch06-filenames.xml:46
242.7503 +msgid ""
242.7504 +"If the command has effects that are difficult or impossible to reverse, it "
242.7505 +"will force you to explicitly provide at least one name or pattern (see "
242.7506 +"below).  This protects you from accidentally deleting files by running "
242.7507 +"<command role=\"hg-cmd\">hg remove</command> with no arguments, for example."
242.7508 +msgstr ""
242.7509 +
242.7510 +#
242.7511 +#. type: Content of: <book><chapter><sect1><para>
242.7512 +#: ../en/ch06-filenames.xml:54
242.7513 +msgid ""
242.7514 +"It's easy to work around these default behaviours if they don't suit you.  If "
242.7515 +"a command normally operates on the whole working directory, you can invoke it "
242.7516 +"on just the current directory and its subdirectories by giving it the name "
242.7517 +"<quote><filename class=\"directory\">.</filename></quote>."
242.7518 +msgstr ""
242.7519 +
242.7520 +#
242.7521 +#. type: Content of: <book><chapter><sect1><para>
242.7522 +#: ../en/ch06-filenames.xml:62
242.7523 +msgid ""
242.7524 +"Along the same lines, some commands normally print file names relative to the "
242.7525 +"root of the repository, even if you're invoking them from a subdirectory.  "
242.7526 +"Such a command will print file names relative to your subdirectory if you "
242.7527 +"give it explicit names.  Here, we're going to run <command role=\"hg-cmd\">hg "
242.7528 +"status</command> from a subdirectory, and get it to operate on the entire "
242.7529 +"working directory while printing file names relative to our subdirectory, by "
242.7530 +"passing it the output of the <command role=\"hg-cmd\">hg root</command> "
242.7531 +"command."
242.7532 +msgstr ""
242.7533 +
242.7534 +#. type: Content of: <book><chapter><sect1><title>
242.7535 +#: ../en/ch06-filenames.xml:76
242.7536 +msgid "Telling you what's going on"
242.7537 +msgstr "告诉你正在做什么"
242.7538 +
242.7539 +#. type: Content of: <book><chapter><sect1><para>
242.7540 +#: ../en/ch06-filenames.xml:78
242.7541 +msgid ""
242.7542 +"The <command role=\"hg-cmd\">hg add</command> example in the preceding "
242.7543 +"section illustrates something else that's helpful about Mercurial commands.  "
242.7544 +"If a command operates on a file that you didn't name explicitly on the "
242.7545 +"command line, it will usually print the name of the file, so that you will "
242.7546 +"not be surprised what's going on."
242.7547 +msgstr ""
242.7548 +
242.7549 +#. type: Content of: <book><chapter><sect1><para>
242.7550 +#: ../en/ch06-filenames.xml:85
242.7551 +msgid ""
242.7552 +"The principle here is of <emphasis>least surprise</emphasis>.  If you've "
242.7553 +"exactly named a file on the command line, there's no point in repeating it "
242.7554 +"back at you.  If Mercurial is acting on a file <emphasis>implicitly</"
242.7555 +"emphasis>, because you provided no names, or a directory, or a pattern (see "
242.7556 +"below), it's safest to tell you what it's doing."
242.7557 +msgstr ""
242.7558 +
242.7559 +#. type: Content of: <book><chapter><sect1><para>
242.7560 +#: ../en/ch06-filenames.xml:92
242.7561 +msgid ""
242.7562 +"For commands that behave this way, you can silence them using the <option "
242.7563 +"role=\"hg-opt-global\">-q</option> option.  You can also get them to print "
242.7564 +"the name of every file, even those you've named explicitly, using the <option "
242.7565 +"role=\"hg-opt-global\">-v</option> option."
242.7566 +msgstr ""
242.7567 +
242.7568 +#. type: Content of: <book><chapter><sect1><title>
242.7569 +#: ../en/ch06-filenames.xml:100
242.7570 +msgid "Using patterns to identify files"
242.7571 +msgstr "使用模式标识文件"
242.7572 +
242.7573 +#. type: Content of: <book><chapter><sect1><para>
242.7574 +#: ../en/ch06-filenames.xml:102
242.7575 +msgid ""
242.7576 +"In addition to working with file and directory names, Mercurial lets you use "
242.7577 +"<emphasis>patterns</emphasis> to identify files.  Mercurial's pattern "
242.7578 +"handling is expressive."
242.7579 +msgstr ""
242.7580 +
242.7581 +#. type: Content of: <book><chapter><sect1><para>
242.7582 +#: ../en/ch06-filenames.xml:106
242.7583 +msgid ""
242.7584 +"On Unix-like systems (Linux, MacOS, etc.), the job of matching file names to "
242.7585 +"patterns normally falls to the shell.  On these systems, you must explicitly "
242.7586 +"tell Mercurial that a name is a pattern.  On Windows, the shell does not "
242.7587 +"expand patterns, so Mercurial will automatically identify names that are "
242.7588 +"patterns, and expand them for you."
242.7589 +msgstr ""
242.7590 +
242.7591 +#. type: Content of: <book><chapter><sect1><para>
242.7592 +#: ../en/ch06-filenames.xml:113
242.7593 +msgid ""
242.7594 +"To provide a pattern in place of a regular name on the command line, the "
242.7595 +"mechanism is simple:"
242.7596 +msgstr ""
242.7597 +
242.7598 +#. type: Content of: <book><chapter><sect1><para>
242.7599 +#: ../en/ch06-filenames.xml:116
242.7600 +msgid ""
242.7601 +"That is, a pattern is identified by a short text string that says what kind "
242.7602 +"of pattern this is, followed by a colon, followed by the actual pattern."
242.7603 +msgstr ""
242.7604 +
242.7605 +#. type: Content of: <book><chapter><sect1><para>
242.7606 +#: ../en/ch06-filenames.xml:120
242.7607 +msgid ""
242.7608 +"Mercurial supports two kinds of pattern syntax.  The most frequently used is "
242.7609 +"called <literal>glob</literal>; this is the same kind of pattern matching "
242.7610 +"used by the Unix shell, and should be familiar to Windows command prompt "
242.7611 +"users, too."
242.7612 +msgstr ""
242.7613 +
242.7614 +#. type: Content of: <book><chapter><sect1><para>
242.7615 +#: ../en/ch06-filenames.xml:125
242.7616 +msgid ""
242.7617 +"When Mercurial does automatic pattern matching on Windows, it uses "
242.7618 +"<literal>glob</literal> syntax.  You can thus omit the <quote><literal>glob:</"
242.7619 +"literal></quote> prefix on Windows, but it's safe to use it, too."
242.7620 +msgstr ""
242.7621 +
242.7622 +#. type: Content of: <book><chapter><sect1><para>
242.7623 +#: ../en/ch06-filenames.xml:130
242.7624 +msgid ""
242.7625 +"The <literal>re</literal> syntax is more powerful; it lets you specify "
242.7626 +"patterns using regular expressions, also known as regexps."
242.7627 +msgstr ""
242.7628 +
242.7629 +#. type: Content of: <book><chapter><sect1><para>
242.7630 +#: ../en/ch06-filenames.xml:134
242.7631 +msgid ""
242.7632 +"By the way, in the examples that follow, notice that I'm careful to wrap all "
242.7633 +"of my patterns in quote characters, so that they won't get expanded by the "
242.7634 +"shell before Mercurial sees them."
242.7635 +msgstr ""
242.7636 +
242.7637 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.7638 +#: ../en/ch06-filenames.xml:140
242.7639 +msgid "Shell-style <literal>glob</literal> patterns"
242.7640 +msgstr "外壳风格的 <literal>glob</literal>  模式"
242.7641 +
242.7642 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7643 +#: ../en/ch06-filenames.xml:142
242.7644 +msgid ""
242.7645 +"This is an overview of the kinds of patterns you can use when you're matching "
242.7646 +"on glob patterns."
242.7647 +msgstr ""
242.7648 +
242.7649 +#
242.7650 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7651 +#: ../en/ch06-filenames.xml:145
242.7652 +msgid ""
242.7653 +"The <quote><literal>*</literal></quote> character matches any string, within "
242.7654 +"a single directory."
242.7655 +msgstr ""
242.7656 +
242.7657 +#
242.7658 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7659 +#: ../en/ch06-filenames.xml:150
242.7660 +msgid ""
242.7661 +"The <quote><literal>**</literal></quote> pattern matches any string, and "
242.7662 +"crosses directory boundaries.  It's not a standard Unix glob token, but it's "
242.7663 +"accepted by several popular Unix shells, and is very useful."
242.7664 +msgstr ""
242.7665 +
242.7666 +#
242.7667 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7668 +#: ../en/ch06-filenames.xml:157
242.7669 +msgid ""
242.7670 +"The <quote><literal>?</literal></quote> pattern matches any single character."
242.7671 +msgstr ""
242.7672 +
242.7673 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7674 +#: ../en/ch06-filenames.xml:162
242.7675 +msgid ""
242.7676 +"The <quote><literal>[</literal></quote> character begins a "
242.7677 +"<emphasis>character class</emphasis>.  This matches any single character "
242.7678 +"within the class.  The class ends with a <quote><literal>]</literal></quote> "
242.7679 +"character.  A class may contain multiple <emphasis>range</emphasis>s of the "
242.7680 +"form <quote><literal>a-f</literal></quote>, which is shorthand for "
242.7681 +"<quote><literal>abcdef</literal></quote>."
242.7682 +msgstr ""
242.7683 +
242.7684 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7685 +#: ../en/ch06-filenames.xml:172
242.7686 +msgid ""
242.7687 +"If the first character after the <quote><literal>[</literal></quote> in a "
242.7688 +"character class is a <quote><literal>!</literal></quote>, it "
242.7689 +"<emphasis>negates</emphasis> the class, making it match any single character "
242.7690 +"not in the class."
242.7691 +msgstr ""
242.7692 +
242.7693 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7694 +#: ../en/ch06-filenames.xml:178
242.7695 +msgid ""
242.7696 +"A <quote><literal>{</literal></quote> begins a group of subpatterns, where "
242.7697 +"the whole group matches if any subpattern in the group matches.  The "
242.7698 +"<quote><literal>,</literal></quote> character separates subpatterns, and "
242.7699 +"<quote><literal>}</literal></quote> ends the group."
242.7700 +msgstr ""
242.7701 +
242.7702 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title>
242.7703 +#: ../en/ch06-filenames.xml:187
242.7704 +msgid "Watch out!"
242.7705 +msgstr "千万小心!"
242.7706 +
242.7707 +#
242.7708 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.7709 +#: ../en/ch06-filenames.xml:189
242.7710 +msgid ""
242.7711 +"Don't forget that if you want to match a pattern in any directory, you should "
242.7712 +"not be using the <quote><literal>*</literal></quote> match-any token, as this "
242.7713 +"will only match within one directory.  Instead, use the <quote><literal>**</"
242.7714 +"literal></quote> token.  This small example illustrates the difference "
242.7715 +"between the two."
242.7716 +msgstr ""
242.7717 +
242.7718 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.7719 +#: ../en/ch06-filenames.xml:201
242.7720 +msgid "Regular expression matching with <literal>re</literal> patterns"
242.7721 +msgstr "使用 <literal>re</literal> 模式的正则表达式匹配"
242.7722 +
242.7723 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7724 +#: ../en/ch06-filenames.xml:204
242.7725 +msgid ""
242.7726 +"Mercurial accepts the same regular expression syntax as the Python "
242.7727 +"programming language (it uses Python's regexp engine internally). This is "
242.7728 +"based on the Perl language's regexp syntax, which is the most popular dialect "
242.7729 +"in use (it's also used in Java, for example)."
242.7730 +msgstr ""
242.7731 +
242.7732 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7733 +#: ../en/ch06-filenames.xml:210
242.7734 +msgid ""
242.7735 +"I won't discuss Mercurial's regexp dialect in any detail here, as regexps are "
242.7736 +"not often used.  Perl-style regexps are in any case already exhaustively "
242.7737 +"documented on a multitude of web sites, and in many books.  Instead, I will "
242.7738 +"focus here on a few things you should know if you find yourself needing to "
242.7739 +"use regexps with Mercurial."
242.7740 +msgstr ""
242.7741 +
242.7742 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7743 +#: ../en/ch06-filenames.xml:217
242.7744 +msgid ""
242.7745 +"A regexp is matched against an entire file name, relative to the root of the "
242.7746 +"repository.  In other words, even if you're already in subbdirectory "
242.7747 +"<filename class=\"directory\">foo</filename>, if you want to match files "
242.7748 +"under this directory, your pattern must start with <quote><literal>foo/</"
242.7749 +"literal></quote>."
242.7750 +msgstr ""
242.7751 +
242.7752 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7753 +#: ../en/ch06-filenames.xml:224
242.7754 +msgid ""
242.7755 +"One thing to note, if you're familiar with Perl-style regexps, is that "
242.7756 +"Mercurial's are <emphasis>rooted</emphasis>.  That is, a regexp starts "
242.7757 +"matching against the beginning of a string; it doesn't look for a match "
242.7758 +"anywhere within the string.  To match anywhere in a string, start your "
242.7759 +"pattern with <quote><literal>.*</literal></quote>."
242.7760 +msgstr ""
242.7761 +
242.7762 +#. type: Content of: <book><chapter><sect1><title>
242.7763 +#: ../en/ch06-filenames.xml:234
242.7764 +msgid "Filtering files"
242.7765 +msgstr "过滤文件"
242.7766 +
242.7767 +#. type: Content of: <book><chapter><sect1><para>
242.7768 +#: ../en/ch06-filenames.xml:236
242.7769 +msgid ""
242.7770 +"Not only does Mercurial give you a variety of ways to specify files; it lets "
242.7771 +"you further winnow those files using <emphasis>filters</emphasis>.  Commands "
242.7772 +"that work with file names accept two filtering options."
242.7773 +msgstr ""
242.7774 +
242.7775 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.7776 +#: ../en/ch06-filenames.xml:241
242.7777 +msgid ""
242.7778 +"<option role=\"hg-opt-global\">-I</option>, or <option role=\"hg-opt-global"
242.7779 +"\">--include</option>, lets you specify a pattern that file names must match "
242.7780 +"in order to be processed."
242.7781 +msgstr ""
242.7782 +
242.7783 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.7784 +#: ../en/ch06-filenames.xml:246
242.7785 +msgid ""
242.7786 +"<option role=\"hg-opt-global\">-X</option>, or <option role=\"hg-opt-global"
242.7787 +"\">--exclude</option>, gives you a way to <emphasis>avoid</emphasis> "
242.7788 +"processing files, if they match this pattern."
242.7789 +msgstr ""
242.7790 +
242.7791 +#. type: Content of: <book><chapter><sect1><para>
242.7792 +#: ../en/ch06-filenames.xml:251
242.7793 +msgid ""
242.7794 +"You can provide multiple <option role=\"hg-opt-global\">-I</option> and "
242.7795 +"<option role=\"hg-opt-global\">-X</option> options on the command line, and "
242.7796 +"intermix them as you please.  Mercurial interprets the patterns you provide "
242.7797 +"using glob syntax by default (but you can use regexps if you need to)."
242.7798 +msgstr ""
242.7799 +
242.7800 +#. type: Content of: <book><chapter><sect1><para>
242.7801 +#: ../en/ch06-filenames.xml:258
242.7802 +msgid ""
242.7803 +"You can read a <option role=\"hg-opt-global\">-I</option> filter as "
242.7804 +"<quote>process only the files that match this filter</quote>."
242.7805 +msgstr ""
242.7806 +
242.7807 +#. type: Content of: <book><chapter><sect1><para>
242.7808 +#: ../en/ch06-filenames.xml:264
242.7809 +msgid ""
242.7810 +"The <option role=\"hg-opt-global\">-X</option> filter is best read as "
242.7811 +"<quote>process only the files that don't match this pattern</quote>."
242.7812 +msgstr ""
242.7813 +
242.7814 +#. type: Content of: <book><chapter><sect1><title>
242.7815 +#: ../en/ch06-filenames.xml:272
242.7816 +msgid "Ignoring unwanted files and directories"
242.7817 +msgstr "忽略不需要的文件和目录"
242.7818 +
242.7819 +#. type: Content of: <book><chapter><sect1><para>
242.7820 +#: ../en/ch06-filenames.xml:274
242.7821 +msgid "XXX."
242.7822 +msgstr ""
242.7823 +
242.7824 +#. type: Content of: <book><chapter><sect1><title>
242.7825 +#: ../en/ch06-filenames.xml:278
242.7826 +msgid "Case sensitivity"
242.7827 +msgstr "大小写敏感性"
242.7828 +
242.7829 +#. type: Content of: <book><chapter><sect1><para>
242.7830 +#: ../en/ch06-filenames.xml:280
242.7831 +msgid ""
242.7832 +"If you're working in a mixed development environment that contains both Linux "
242.7833 +"(or other Unix) systems and Macs or Windows systems, you should keep in the "
242.7834 +"back of your mind the knowledge that they treat the case (<quote>N</quote> "
242.7835 +"versus <quote>n</quote>) of file names in incompatible ways.  This is not "
242.7836 +"very likely to affect you, and it's easy to deal with if it does, but it "
242.7837 +"could surprise you if you don't know about it."
242.7838 +msgstr ""
242.7839 +
242.7840 +#. type: Content of: <book><chapter><sect1><para>
242.7841 +#: ../en/ch06-filenames.xml:289
242.7842 +msgid ""
242.7843 +"Operating systems and filesystems differ in the way they handle the "
242.7844 +"<emphasis>case</emphasis> of characters in file and directory names.  There "
242.7845 +"are three common ways to handle case in names."
242.7846 +msgstr ""
242.7847 +
242.7848 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.7849 +#: ../en/ch06-filenames.xml:294
242.7850 +msgid ""
242.7851 +"Completely case insensitive.  Uppercase and lowercase versions of a letter "
242.7852 +"are treated as identical, both when creating a file and during subsequent "
242.7853 +"accesses.  This is common on older DOS-based systems."
242.7854 +msgstr ""
242.7855 +
242.7856 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.7857 +#: ../en/ch06-filenames.xml:299
242.7858 +msgid ""
242.7859 +"Case preserving, but insensitive.  When a file or directory is created, the "
242.7860 +"case of its name is stored, and can be retrieved and displayed by the "
242.7861 +"operating system.  When an existing file is being looked up, its case is "
242.7862 +"ignored.  This is the standard arrangement on Windows and MacOS.  The names "
242.7863 +"<filename>foo</filename> and <filename>FoO</filename> identify the same "
242.7864 +"file.  This treatment of uppercase and lowercase letters as interchangeable "
242.7865 +"is also referred to as <emphasis>case folding</emphasis>."
242.7866 +msgstr ""
242.7867 +
242.7868 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.7869 +#: ../en/ch06-filenames.xml:310
242.7870 +msgid ""
242.7871 +"Case sensitive.  The case of a name is significant at all times. The names "
242.7872 +"<filename>foo</filename> and {FoO} identify different files.  This is the way "
242.7873 +"Linux and Unix systems normally work."
242.7874 +msgstr ""
242.7875 +
242.7876 +#. type: Content of: <book><chapter><sect1><para>
242.7877 +#: ../en/ch06-filenames.xml:316
242.7878 +msgid ""
242.7879 +"On Unix-like systems, it is possible to have any or all of the above ways of "
242.7880 +"handling case in action at once.  For example, if you use a USB thumb drive "
242.7881 +"formatted with a FAT32 filesystem on a Linux system, Linux will handle names "
242.7882 +"on that filesystem in a case preserving, but insensitive, way."
242.7883 +msgstr ""
242.7884 +
242.7885 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.7886 +#: ../en/ch06-filenames.xml:323
242.7887 +msgid "Safe, portable repository storage"
242.7888 +msgstr "安全,可移植的版本库存储"
242.7889 +
242.7890 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7891 +#: ../en/ch06-filenames.xml:325
242.7892 +msgid ""
242.7893 +"Mercurial's repository storage mechanism is <emphasis>case safe</emphasis>.  "
242.7894 +"It translates file names so that they can be safely stored on both case "
242.7895 +"sensitive and case insensitive filesystems.  This means that you can use "
242.7896 +"normal file copying tools to transfer a Mercurial repository onto, for "
242.7897 +"example, a USB thumb drive, and safely move that drive and repository back "
242.7898 +"and forth between a Mac, a PC running Windows, and a Linux box."
242.7899 +msgstr ""
242.7900 +
242.7901 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.7902 +#: ../en/ch06-filenames.xml:336
242.7903 +msgid "Detecting case conflicts"
242.7904 +msgstr "检测大小写冲突"
242.7905 +
242.7906 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7907 +#: ../en/ch06-filenames.xml:338
242.7908 +msgid ""
242.7909 +"When operating in the working directory, Mercurial honours the naming policy "
242.7910 +"of the filesystem where the working directory is located.  If the filesystem "
242.7911 +"is case preserving, but insensitive, Mercurial will treat names that differ "
242.7912 +"only in case as the same."
242.7913 +msgstr ""
242.7914 +
242.7915 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7916 +#: ../en/ch06-filenames.xml:344
242.7917 +msgid ""
242.7918 +"An important aspect of this approach is that it is possible to commit a "
242.7919 +"changeset on a case sensitive (typically Linux or Unix) filesystem that will "
242.7920 +"cause trouble for users on case insensitive (usually Windows and MacOS) "
242.7921 +"users.  If a Linux user commits changes to two files, one named "
242.7922 +"<filename>myfile.c</filename> and the other named <filename>MyFile.C</"
242.7923 +"filename>, they will be stored correctly in the repository.  And in the "
242.7924 +"working directories of other Linux users, they will be correctly represented "
242.7925 +"as separate files."
242.7926 +msgstr ""
242.7927 +
242.7928 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7929 +#: ../en/ch06-filenames.xml:355
242.7930 +msgid ""
242.7931 +"If a Windows or Mac user pulls this change, they will not initially have a "
242.7932 +"problem, because Mercurial's repository storage mechanism is case safe.  "
242.7933 +"However, once they try to <command role=\"hg-cmd\">hg update</command> the "
242.7934 +"working directory to that changeset, or <command role=\"hg-cmd\">hg merge</"
242.7935 +"command> with that changeset, Mercurial will spot the conflict between the "
242.7936 +"two file names that the filesystem would treat as the same, and forbid the "
242.7937 +"update or merge from occurring."
242.7938 +msgstr ""
242.7939 +
242.7940 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.7941 +#: ../en/ch06-filenames.xml:367
242.7942 +msgid "Fixing a case conflict"
242.7943 +msgstr "修正大小写冲突"
242.7944 +
242.7945 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7946 +#: ../en/ch06-filenames.xml:369
242.7947 +msgid ""
242.7948 +"If you are using Windows or a Mac in a mixed environment where some of your "
242.7949 +"collaborators are using Linux or Unix, and Mercurial reports a case folding "
242.7950 +"conflict when you try to <command role=\"hg-cmd\">hg update</command> or "
242.7951 +"<command role=\"hg-cmd\">hg merge</command>, the procedure to fix the problem "
242.7952 +"is simple."
242.7953 +msgstr ""
242.7954 +
242.7955 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7956 +#: ../en/ch06-filenames.xml:376
242.7957 +msgid ""
242.7958 +"Just find a nearby Linux or Unix box, clone the problem repository onto it, "
242.7959 +"and use Mercurial's <command role=\"hg-cmd\">hg rename</command> command to "
242.7960 +"change the names of any offending files or directories so that they will no "
242.7961 +"longer cause case folding conflicts.  Commit this change, <command role=\"hg-"
242.7962 +"cmd\">hg pull</command> or <command role=\"hg-cmd\">hg push</command> it "
242.7963 +"across to your Windows or MacOS system, and <command role=\"hg-cmd\">hg "
242.7964 +"update</command> to the revision with the non-conflicting names."
242.7965 +msgstr ""
242.7966 +
242.7967 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.7968 +#: ../en/ch06-filenames.xml:386
242.7969 +msgid ""
242.7970 +"The changeset with case-conflicting names will remain in your project's "
242.7971 +"history, and you still won't be able to <command role=\"hg-cmd\">hg update</"
242.7972 +"command> your working directory to that changeset on a Windows or MacOS "
242.7973 +"system, but you can continue development unimpeded."
242.7974 +msgstr ""
242.7975 +
242.7976 +#. type: Content of: <book><chapter><sect1><sect2><note><para>
242.7977 +#: ../en/ch06-filenames.xml:393
242.7978 +msgid ""
242.7979 +"Prior to version 0.9.3, Mercurial did not use a case safe repository storage "
242.7980 +"mechanism, and did not detect case folding conflicts.  If you are using an "
242.7981 +"older version of Mercurial on Windows or MacOS, I strongly recommend that you "
242.7982 +"upgrade."
242.7983 +msgstr ""
242.7984 +
242.7985 +#. type: Content of: <book><chapter><title>
242.7986 +#: ../en/ch07-branch.xml:5
242.7987 +msgid "Managing releases and branchy development"
242.7988 +msgstr "发布管理与分支开发"
242.7989 +
242.7990 +#. type: Content of: <book><chapter><para>
242.7991 +#: ../en/ch07-branch.xml:7
242.7992 +msgid ""
242.7993 +"Mercurial provides several mechanisms for you to manage a project that is "
242.7994 +"making progress on multiple fronts at once.  To understand these mechanisms, "
242.7995 +"let's first take a brief look at a fairly normal software project structure."
242.7996 +msgstr ""
242.7997 +
242.7998 +#. type: Content of: <book><chapter><para>
242.7999 +#: ../en/ch07-branch.xml:12
242.8000 +msgid ""
242.8001 +"Many software projects issue periodic <quote>major</quote> releases that "
242.8002 +"contain substantial new features.  In parallel, they may issue <quote>minor</"
242.8003 +"quote> releases.  These are usually identical to the major releases off which "
242.8004 +"they're based, but with a few bugs fixed."
242.8005 +msgstr ""
242.8006 +
242.8007 +#. type: Content of: <book><chapter><para>
242.8008 +#: ../en/ch07-branch.xml:18
242.8009 +msgid ""
242.8010 +"In this chapter, we'll start by talking about how to keep records of project "
242.8011 +"milestones such as releases.  We'll then continue on to talk about the flow "
242.8012 +"of work between different phases of a project, and how Mercurial can help you "
242.8013 +"to isolate and manage this work."
242.8014 +msgstr ""
242.8015 +
242.8016 +#. type: Content of: <book><chapter><sect1><title>
242.8017 +#: ../en/ch07-branch.xml:25
242.8018 +msgid "Giving a persistent name to a revision"
242.8019 +msgstr "给版本指定一个永久的名称"
242.8020 +
242.8021 +#. type: Content of: <book><chapter><sect1><para>
242.8022 +#: ../en/ch07-branch.xml:27
242.8023 +msgid ""
242.8024 +"Once you decide that you'd like to call a particular revision a "
242.8025 +"<quote>release</quote>, it's a good idea to record the identity of that "
242.8026 +"revision. This will let you reproduce that release at a later date, for "
242.8027 +"whatever purpose you might need at the time (reproducing a bug, porting to a "
242.8028 +"new platform, etc).  &interaction.tag.init;"
242.8029 +msgstr ""
242.8030 +
242.8031 +#
242.8032 +#. type: Content of: <book><chapter><sect1><para>
242.8033 +#: ../en/ch07-branch.xml:34
242.8034 +msgid ""
242.8035 +"Mercurial lets you give a permanent name to any revision using the <command "
242.8036 +"role=\"hg-cmd\">hg tag</command> command.  Not surprisingly, these names are "
242.8037 +"called <quote>tags</quote>."
242.8038 +msgstr ""
242.8039 +
242.8040 +#. type: Content of: <book><chapter><sect1><para>
242.8041 +#: ../en/ch07-branch.xml:40
242.8042 +msgid ""
242.8043 +"A tag is nothing more than a <quote>symbolic name</quote> for a revision.  "
242.8044 +"Tags exist purely for your convenience, so that you have a handy permanent "
242.8045 +"way to refer to a revision; Mercurial doesn't interpret the tag names you use "
242.8046 +"in any way.  Neither does Mercurial place any restrictions on the name of a "
242.8047 +"tag, beyond a few that are necessary to ensure that a tag can be parsed "
242.8048 +"unambiguously.  A tag name cannot contain any of the following characters:"
242.8049 +msgstr ""
242.8050 +
242.8051 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.8052 +#: ../en/ch07-branch.xml:49
242.8053 +msgid "Colon (ASCII 58, <quote><literal>:</literal></quote>)"
242.8054 +msgstr ""
242.8055 +
242.8056 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.8057 +#: ../en/ch07-branch.xml:52
242.8058 +msgid "Carriage return (ASCII 13, <quote><literal>\\r</literal></quote>)"
242.8059 +msgstr ""
242.8060 +
242.8061 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.8062 +#: ../en/ch07-branch.xml:55
242.8063 +msgid "Newline (ASCII 10, <quote><literal>\\n</literal></quote>)"
242.8064 +msgstr ""
242.8065 +
242.8066 +#. type: Content of: <book><chapter><sect1><para>
242.8067 +#: ../en/ch07-branch.xml:59
242.8068 +msgid ""
242.8069 +"You can use the <command role=\"hg-cmd\">hg tags</command> command to display "
242.8070 +"the tags present in your repository.  In the output, each tagged revision is "
242.8071 +"identified first by its name, then by revision number, and finally by the "
242.8072 +"unique hash of the revision."
242.8073 +msgstr ""
242.8074 +
242.8075 +#. type: Content of: <book><chapter><sect1><para>
242.8076 +#: ../en/ch07-branch.xml:67
242.8077 +msgid ""
242.8078 +"Notice that <literal>tip</literal> is listed in the output of <command role="
242.8079 +"\"hg-cmd\">hg tags</command>.  The <literal>tip</literal> tag is a special "
242.8080 +"<quote>floating</quote> tag, which always identifies the newest revision in "
242.8081 +"the repository."
242.8082 +msgstr ""
242.8083 +
242.8084 +#. type: Content of: <book><chapter><sect1><para>
242.8085 +#: ../en/ch07-branch.xml:73
242.8086 +msgid ""
242.8087 +"In the output of the <command role=\"hg-cmd\">hg tags</command> command, tags "
242.8088 +"are listed in reverse order, by revision number.  This usually means that "
242.8089 +"recent tags are listed before older tags.  It also means that <literal>tip</"
242.8090 +"literal> is always going to be the first tag listed in the output of <command "
242.8091 +"role=\"hg-cmd\">hg tags</command>."
242.8092 +msgstr ""
242.8093 +
242.8094 +#. type: Content of: <book><chapter><sect1><para>
242.8095 +#: ../en/ch07-branch.xml:80
242.8096 +msgid ""
242.8097 +"When you run <command role=\"hg-cmd\">hg log</command>, if it displays a "
242.8098 +"revision that has tags associated with it, it will print those tags."
242.8099 +msgstr ""
242.8100 +
242.8101 +#
242.8102 +#. type: Content of: <book><chapter><sect1><para>
242.8103 +#: ../en/ch07-branch.xml:86
242.8104 +msgid ""
242.8105 +"Any time you need to provide a revision ID to a Mercurial command, the "
242.8106 +"command will accept a tag name in its place.  Internally, Mercurial will "
242.8107 +"translate your tag name into the corresponding revision ID, then use that."
242.8108 +msgstr ""
242.8109 +
242.8110 +#. type: Content of: <book><chapter><sect1><para>
242.8111 +#: ../en/ch07-branch.xml:93
242.8112 +msgid ""
242.8113 +"There's no limit on the number of tags you can have in a repository, or on "
242.8114 +"the number of tags that a single revision can have.  As a practical matter, "
242.8115 +"it's not a great idea to have <quote>too many</quote> (a number which will "
242.8116 +"vary from project to project), simply because tags are supposed to help you "
242.8117 +"to find revisions.  If you have lots of tags, the ease of using them to "
242.8118 +"identify revisions diminishes rapidly."
242.8119 +msgstr ""
242.8120 +
242.8121 +#. type: Content of: <book><chapter><sect1><para>
242.8122 +#: ../en/ch07-branch.xml:101
242.8123 +msgid ""
242.8124 +"For example, if your project has milestones as frequent as every few days, "
242.8125 +"it's perfectly reasonable to tag each one of those.  But if you have a "
242.8126 +"continuous build system that makes sure every revision can be built cleanly, "
242.8127 +"you'd be introducing a lot of noise if you were to tag every clean build.  "
242.8128 +"Instead, you could tag failed builds (on the assumption that they're rare!), "
242.8129 +"or simply not use tags to track buildability."
242.8130 +msgstr ""
242.8131 +
242.8132 +#. type: Content of: <book><chapter><sect1><para>
242.8133 +#: ../en/ch07-branch.xml:109
242.8134 +msgid ""
242.8135 +"If you want to remove a tag that you no longer want, use <command role=\"hg-"
242.8136 +"cmd\">hg tag --remove</command>."
242.8137 +msgstr ""
242.8138 +
242.8139 +#. type: Content of: <book><chapter><sect1><para>
242.8140 +#: ../en/ch07-branch.xml:114
242.8141 +msgid ""
242.8142 +"You can also modify a tag at any time, so that it identifies a different "
242.8143 +"revision, by simply issuing a new <command role=\"hg-cmd\">hg tag</command> "
242.8144 +"command. You'll have to use the <option role=\"hg-opt-tag\">-f</option> "
242.8145 +"option to tell Mercurial that you <emphasis>really</emphasis> want to update "
242.8146 +"the tag."
242.8147 +msgstr ""
242.8148 +
242.8149 +#. type: Content of: <book><chapter><sect1><para>
242.8150 +#: ../en/ch07-branch.xml:123
242.8151 +msgid ""
242.8152 +"There will still be a permanent record of the previous identity of the tag, "
242.8153 +"but Mercurial will no longer use it.  There's thus no penalty to tagging the "
242.8154 +"wrong revision; all you have to do is turn around and tag the correct "
242.8155 +"revision once you discover your error."
242.8156 +msgstr ""
242.8157 +
242.8158 +#
242.8159 +#. type: Content of: <book><chapter><sect1><para>
242.8160 +#: ../en/ch07-branch.xml:129
242.8161 +msgid ""
242.8162 +"Mercurial stores tags in a normal revision-controlled file in your "
242.8163 +"repository.  If you've created any tags, you'll find them in a file named "
242.8164 +"<filename role=\"special\">.hgtags</filename>.  When you run the <command "
242.8165 +"role=\"hg-cmd\">hg tag</command> command, Mercurial modifies this file, then "
242.8166 +"automatically commits the change to it.  This means that every time you run "
242.8167 +"<command role=\"hg-cmd\">hg tag</command>, you'll see a corresponding "
242.8168 +"changeset in the output of <command role=\"hg-cmd\">hg log</command>."
242.8169 +msgstr ""
242.8170 +
242.8171 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.8172 +#: ../en/ch07-branch.xml:142
242.8173 +msgid "Handling tag conflicts during a merge"
242.8174 +msgstr "在合并期间处理标签冲突"
242.8175 +
242.8176 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8177 +#: ../en/ch07-branch.xml:144
242.8178 +msgid ""
242.8179 +"You won't often need to care about the <filename role=\"special\">.hgtags</"
242.8180 +"filename> file, but it sometimes makes its presence known during a merge.  "
242.8181 +"The format of the file is simple: it consists of a series of lines.  Each "
242.8182 +"line starts with a changeset hash, followed by a space, followed by the name "
242.8183 +"of a tag."
242.8184 +msgstr ""
242.8185 +
242.8186 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8187 +#: ../en/ch07-branch.xml:151
242.8188 +msgid ""
242.8189 +"If you're resolving a conflict in the <filename role=\"special\">.hgtags</"
242.8190 +"filename> file during a merge, there's one twist to modifying the <filename "
242.8191 +"role=\"special\">.hgtags</filename> file: when Mercurial is parsing the tags "
242.8192 +"in a repository, it <emphasis>never</emphasis> reads the working copy of the "
242.8193 +"<filename role=\"special\">.hgtags</filename> file.  Instead, it reads the "
242.8194 +"<emphasis>most recently committed</emphasis> revision of the file."
242.8195 +msgstr ""
242.8196 +
242.8197 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8198 +#: ../en/ch07-branch.xml:161
242.8199 +msgid ""
242.8200 +"An unfortunate consequence of this design is that you can't actually verify "
242.8201 +"that your merged <filename role=\"special\">.hgtags</filename> file is "
242.8202 +"correct until <emphasis>after</emphasis> you've committed a change.  So if "
242.8203 +"you find yourself resolving a conflict on <filename role=\"special\">.hgtags</"
242.8204 +"filename> during a merge, be sure to run <command role=\"hg-cmd\">hg tags</"
242.8205 +"command> after you commit.  If it finds an error in the <filename role="
242.8206 +"\"special\">.hgtags</filename> file, it will report the location of the "
242.8207 +"error, which you can then fix and commit.  You should then run <command role="
242.8208 +"\"hg-cmd\">hg tags</command> again, just to be sure that your fix is correct."
242.8209 +msgstr ""
242.8210 +
242.8211 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.8212 +#: ../en/ch07-branch.xml:176
242.8213 +msgid "Tags and cloning"
242.8214 +msgstr "标签与克隆"
242.8215 +
242.8216 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8217 +#: ../en/ch07-branch.xml:178
242.8218 +msgid ""
242.8219 +"You may have noticed that the <command role=\"hg-cmd\">hg clone</command> "
242.8220 +"command has a <option role=\"hg-opt-clone\">-r</option> option that lets you "
242.8221 +"clone an exact copy of the repository as of a particular changeset.  The new "
242.8222 +"clone will not contain any project history that comes after the revision you "
242.8223 +"specified.  This has an interaction with tags that can surprise the unwary."
242.8224 +msgstr ""
242.8225 +
242.8226 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8227 +#: ../en/ch07-branch.xml:186
242.8228 +msgid ""
242.8229 +"Recall that a tag is stored as a revision to the <filename role=\"special\">."
242.8230 +"hgtags</filename> file, so that when you create a tag, the changeset in which "
242.8231 +"it's recorded necessarily refers to an older changeset.  When you run "
242.8232 +"<command role=\"hg-cmd\">hg clone -r foo</command> to clone a repository as "
242.8233 +"of tag <literal>foo</literal>, the new clone <emphasis>will not contain the "
242.8234 +"history that created the tag</emphasis> that you used to clone the "
242.8235 +"repository.  The result is that you'll get exactly the right subset of the "
242.8236 +"project's history in the new repository, but <emphasis>not</emphasis> the tag "
242.8237 +"you might have expected."
242.8238 +msgstr ""
242.8239 +
242.8240 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.8241 +#: ../en/ch07-branch.xml:201
242.8242 +msgid "When permanent tags are too much"
242.8243 +msgstr "当永久标签太多的时候"
242.8244 +
242.8245 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8246 +#: ../en/ch07-branch.xml:203
242.8247 +msgid ""
242.8248 +"Since Mercurial's tags are revision controlled and carried around with a "
242.8249 +"project's history, everyone you work with will see the tags you create.  But "
242.8250 +"giving names to revisions has uses beyond simply noting that revision "
242.8251 +"<literal>4237e45506ee</literal> is really <literal>v2.0.2</literal>.  If "
242.8252 +"you're trying to track down a subtle bug, you might want a tag to remind you "
242.8253 +"of something like <quote>Anne saw the symptoms with this revision</quote>."
242.8254 +msgstr ""
242.8255 +
242.8256 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8257 +#: ../en/ch07-branch.xml:213
242.8258 +msgid ""
242.8259 +"For cases like this, what you might want to use are <emphasis>local</"
242.8260 +"emphasis> tags. You can create a local tag with the <option role=\"hg-opt-tag"
242.8261 +"\">-l</option> option to the <command role=\"hg-cmd\">hg tag</command> "
242.8262 +"command.  This will store the tag in a file called <filename role=\"special"
242.8263 +"\">.hg/localtags</filename>.  Unlike <filename role=\"special\">.hgtags</"
242.8264 +"filename>, <filename role=\"special\">.hg/localtags</filename> is not "
242.8265 +"revision controlled.  Any tags you create using <option role=\"hg-opt-tag\">-"
242.8266 +"l</option> remain strictly local to the repository you're currently working "
242.8267 +"in."
242.8268 +msgstr ""
242.8269 +
242.8270 +#. type: Content of: <book><chapter><sect1><title>
242.8271 +#: ../en/ch07-branch.xml:228
242.8272 +msgid "The flow of changes&emdash;big picture vs. little"
242.8273 +msgstr "修改流程—宏观与微观"
242.8274 +
242.8275 +#. type: Content of: <book><chapter><sect1><para>
242.8276 +#: ../en/ch07-branch.xml:230
242.8277 +msgid ""
242.8278 +"To return to the outline I sketched at the beginning of a chapter, let's "
242.8279 +"think about a project that has multiple concurrent pieces of work under "
242.8280 +"development at once."
242.8281 +msgstr ""
242.8282 +
242.8283 +#. type: Content of: <book><chapter><sect1><para>
242.8284 +#: ../en/ch07-branch.xml:234
242.8285 +msgid ""
242.8286 +"There might be a push for a new <quote>main</quote> release; a new minor "
242.8287 +"bugfix release to the last main release; and an unexpected <quote>hot fix</"
242.8288 +"quote> to an old release that is now in maintenance mode."
242.8289 +msgstr ""
242.8290 +
242.8291 +#. type: Content of: <book><chapter><sect1><para>
242.8292 +#: ../en/ch07-branch.xml:239
242.8293 +msgid ""
242.8294 +"The usual way people refer to these different concurrent directions of "
242.8295 +"development is as <quote>branches</quote>.  However, we've already seen "
242.8296 +"numerous times that Mercurial treats <emphasis>all of history</emphasis> as a "
242.8297 +"series of branches and merges.  Really, what we have here is two ideas that "
242.8298 +"are peripherally related, but which happen to share a name."
242.8299 +msgstr ""
242.8300 +
242.8301 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.8302 +#: ../en/ch07-branch.xml:246
242.8303 +msgid ""
242.8304 +"<quote>Big picture</quote> branches represent the sweep of a project's "
242.8305 +"evolution; people give them names, and talk about them in conversation."
242.8306 +msgstr ""
242.8307 +
242.8308 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.8309 +#: ../en/ch07-branch.xml:250
242.8310 +msgid ""
242.8311 +"<quote>Little picture</quote> branches are artefacts of the day-to-day "
242.8312 +"activity of developing and merging changes.  They expose the narrative of how "
242.8313 +"the code was developed."
242.8314 +msgstr ""
242.8315 +
242.8316 +#. type: Content of: <book><chapter><sect1><title>
242.8317 +#: ../en/ch07-branch.xml:258
242.8318 +msgid "Managing big-picture branches in repositories"
242.8319 +msgstr "在版本库中管理分支"
242.8320 +
242.8321 +#. type: Content of: <book><chapter><sect1><para>
242.8322 +#: ../en/ch07-branch.xml:260
242.8323 +msgid ""
242.8324 +"The easiest way to isolate a <quote>big picture</quote> branch in Mercurial "
242.8325 +"is in a dedicated repository.  If you have an existing shared "
242.8326 +"repository&emdash;let's call it <literal>myproject</literal>&emdash;that "
242.8327 +"reaches a <quote>1.0</quote> milestone, you can start to prepare for future "
242.8328 +"maintenance releases on top of version 1.0 by tagging the revision from which "
242.8329 +"you prepared the 1.0 release."
242.8330 +msgstr ""
242.8331 +
242.8332 +#. type: Content of: <book><chapter><sect1><para>
242.8333 +#: ../en/ch07-branch.xml:270
242.8334 +msgid ""
242.8335 +"You can then clone a new shared <literal>myproject-1.0.1</literal> repository "
242.8336 +"as of that tag."
242.8337 +msgstr ""
242.8338 +
242.8339 +#. type: Content of: <book><chapter><sect1><para>
242.8340 +#: ../en/ch07-branch.xml:276
242.8341 +msgid ""
242.8342 +"Afterwards, if someone needs to work on a bug fix that ought to go into an "
242.8343 +"upcoming 1.0.1 minor release, they clone the <literal>myproject-1.0.1</"
242.8344 +"literal> repository, make their changes, and push them back."
242.8345 +msgstr ""
242.8346 +
242.8347 +#. type: Content of: <book><chapter><sect1><para>
242.8348 +#: ../en/ch07-branch.xml:283
242.8349 +msgid ""
242.8350 +"Meanwhile, development for the next major release can continue, isolated and "
242.8351 +"unabated, in the <literal>myproject</literal> repository."
242.8352 +msgstr ""
242.8353 +
242.8354 +#. type: Content of: <book><chapter><sect1><title>
242.8355 +#: ../en/ch07-branch.xml:291
242.8356 +msgid "Don't repeat yourself: merging across branches"
242.8357 +msgstr "不要重复劳动:在分支间合并"
242.8358 +
242.8359 +#. type: Content of: <book><chapter><sect1><para>
242.8360 +#: ../en/ch07-branch.xml:293
242.8361 +msgid ""
242.8362 +"In many cases, if you have a bug to fix on a maintenance branch, the chances "
242.8363 +"are good that the bug exists on your project's main branch (and possibly "
242.8364 +"other maintenance branches, too).  It's a rare developer who wants to fix the "
242.8365 +"same bug multiple times, so let's look at a few ways that Mercurial can help "
242.8366 +"you to manage these bugfixes without duplicating your work."
242.8367 +msgstr ""
242.8368 +
242.8369 +#. type: Content of: <book><chapter><sect1><para>
242.8370 +#: ../en/ch07-branch.xml:301
242.8371 +msgid ""
242.8372 +"In the simplest instance, all you need to do is pull changes from your "
242.8373 +"maintenance branch into your local clone of the target branch."
242.8374 +msgstr ""
242.8375 +
242.8376 +#. type: Content of: <book><chapter><sect1><para>
242.8377 +#: ../en/ch07-branch.xml:307
242.8378 +msgid ""
242.8379 +"You'll then need to merge the heads of the two branches, and push back to the "
242.8380 +"main branch."
242.8381 +msgstr ""
242.8382 +
242.8383 +#. type: Content of: <book><chapter><sect1><title>
242.8384 +#: ../en/ch07-branch.xml:314
242.8385 +msgid "Naming branches within one repository"
242.8386 +msgstr "版本库中的命名分支"
242.8387 +
242.8388 +#. type: Content of: <book><chapter><sect1><para>
242.8389 +#: ../en/ch07-branch.xml:316
242.8390 +msgid ""
242.8391 +"In most instances, isolating branches in repositories is the right approach.  "
242.8392 +"Its simplicity makes it easy to understand; and so it's hard to make "
242.8393 +"mistakes.  There's a one-to-one relationship between branches you're working "
242.8394 +"in and directories on your system.  This lets you use normal (non-Mercurial-"
242.8395 +"aware)  tools to work on files within a branch/repository."
242.8396 +msgstr ""
242.8397 +
242.8398 +#. type: Content of: <book><chapter><sect1><para>
242.8399 +#: ../en/ch07-branch.xml:323
242.8400 +msgid ""
242.8401 +"If you're more in the <quote>power user</quote> category (<emphasis>and</"
242.8402 +"emphasis> your collaborators are too), there is an alternative way of "
242.8403 +"handling branches that you can consider.  I've already mentioned the human-"
242.8404 +"level distinction between <quote>small picture</quote> and <quote>big "
242.8405 +"picture</quote> branches.  While Mercurial works with multiple <quote>small "
242.8406 +"picture</quote> branches in a repository all the time (for example after you "
242.8407 +"pull changes in, but before you merge them), it can <emphasis>also</emphasis> "
242.8408 +"work with multiple <quote>big picture</quote> branches."
242.8409 +msgstr ""
242.8410 +
242.8411 +#. type: Content of: <book><chapter><sect1><para>
242.8412 +#: ../en/ch07-branch.xml:334
242.8413 +msgid ""
242.8414 +"The key to working this way is that Mercurial lets you assign a persistent "
242.8415 +"<emphasis>name</emphasis> to a branch.  There always exists a branch named "
242.8416 +"<literal>default</literal>.  Even before you start naming branches yourself, "
242.8417 +"you can find traces of the <literal>default</literal> branch if you look for "
242.8418 +"them."
242.8419 +msgstr ""
242.8420 +
242.8421 +#. type: Content of: <book><chapter><sect1><para>
242.8422 +#: ../en/ch07-branch.xml:341
242.8423 +msgid ""
242.8424 +"As an example, when you run the <command role=\"hg-cmd\">hg commit</command> "
242.8425 +"command, and it pops up your editor so that you can enter a commit message, "
242.8426 +"look for a line that contains the text <quote><literal>HG: branch default</"
242.8427 +"literal></quote> at the bottom. This is telling you that your commit will "
242.8428 +"occur on the branch named <literal>default</literal>."
242.8429 +msgstr ""
242.8430 +
242.8431 +#. type: Content of: <book><chapter><sect1><para>
242.8432 +#: ../en/ch07-branch.xml:348
242.8433 +msgid ""
242.8434 +"To start working with named branches, use the <command role=\"hg-cmd\">hg "
242.8435 +"branches</command> command.  This command lists the named branches already "
242.8436 +"present in your repository, telling you which changeset is the tip of each."
242.8437 +msgstr ""
242.8438 +
242.8439 +#. type: Content of: <book><chapter><sect1><para>
242.8440 +#: ../en/ch07-branch.xml:355
242.8441 +msgid ""
242.8442 +"Since you haven't created any named branches yet, the only one that exists is "
242.8443 +"<literal>default</literal>."
242.8444 +msgstr ""
242.8445 +
242.8446 +#. type: Content of: <book><chapter><sect1><para>
242.8447 +#: ../en/ch07-branch.xml:358
242.8448 +msgid ""
242.8449 +"To find out what the <quote>current</quote> branch is, run the <command role="
242.8450 +"\"hg-cmd\">hg branch</command> command, giving it no arguments.  This tells "
242.8451 +"you what branch the parent of the current changeset is on."
242.8452 +msgstr ""
242.8453 +
242.8454 +#
242.8455 +#. type: Content of: <book><chapter><sect1><para>
242.8456 +#: ../en/ch07-branch.xml:365
242.8457 +msgid ""
242.8458 +"To create a new branch, run the <command role=\"hg-cmd\">hg branch</command> "
242.8459 +"command again.  This time, give it one argument: the name of the branch you "
242.8460 +"want to create."
242.8461 +msgstr ""
242.8462 +
242.8463 +#. type: Content of: <book><chapter><sect1><para>
242.8464 +#: ../en/ch07-branch.xml:371
242.8465 +msgid ""
242.8466 +"After you've created a branch, you might wonder what effect the <command role="
242.8467 +"\"hg-cmd\">hg branch</command> command has had.  What do the <command role="
242.8468 +"\"hg-cmd\">hg status</command> and <command role=\"hg-cmd\">hg tip</command> "
242.8469 +"commands report?"
242.8470 +msgstr ""
242.8471 +
242.8472 +#. type: Content of: <book><chapter><sect1><para>
242.8473 +#: ../en/ch07-branch.xml:378
242.8474 +msgid ""
242.8475 +"Nothing has changed in the working directory, and there's been no new history "
242.8476 +"created.  As this suggests, running the <command role=\"hg-cmd\">hg branch</"
242.8477 +"command> command has no permanent effect; it only tells Mercurial what branch "
242.8478 +"name to use the <emphasis>next</emphasis> time you commit a changeset."
242.8479 +msgstr ""
242.8480 +
242.8481 +#. type: Content of: <book><chapter><sect1><para>
242.8482 +#: ../en/ch07-branch.xml:385
242.8483 +msgid ""
242.8484 +"When you commit a change, Mercurial records the name of the branch on which "
242.8485 +"you committed.  Once you've switched from the <literal>default</literal> "
242.8486 +"branch to another and committed, you'll see the name of the new branch show "
242.8487 +"up in the output of <command role=\"hg-cmd\">hg log</command>, <command role="
242.8488 +"\"hg-cmd\">hg tip</command>, and other commands that display the same kind of "
242.8489 +"output."
242.8490 +msgstr ""
242.8491 +
242.8492 +#. type: Content of: <book><chapter><sect1><para>
242.8493 +#: ../en/ch07-branch.xml:395
242.8494 +msgid ""
242.8495 +"The <command role=\"hg-cmd\">hg log</command>-like commands will print the "
242.8496 +"branch name of every changeset that's not on the <literal>default</literal> "
242.8497 +"branch.  As a result, if you never use named branches, you'll never see this "
242.8498 +"information."
242.8499 +msgstr ""
242.8500 +
242.8501 +#. type: Content of: <book><chapter><sect1><para>
242.8502 +#: ../en/ch07-branch.xml:400
242.8503 +msgid ""
242.8504 +"Once you've named a branch and committed a change with that name, every "
242.8505 +"subsequent commit that descends from that change will inherit the same branch "
242.8506 +"name.  You can change the name of a branch at any time, using the <command "
242.8507 +"role=\"hg-cmd\">hg branch</command> command."
242.8508 +msgstr ""
242.8509 +
242.8510 +#. type: Content of: <book><chapter><sect1><para>
242.8511 +#: ../en/ch07-branch.xml:408
242.8512 +msgid ""
242.8513 +"In practice, this is something you won't do very often, as branch names tend "
242.8514 +"to have fairly long lifetimes.  (This isn't a rule, just an observation.)"
242.8515 +msgstr ""
242.8516 +
242.8517 +#. type: Content of: <book><chapter><sect1><title>
242.8518 +#: ../en/ch07-branch.xml:414
242.8519 +msgid "Dealing with multiple named branches in a repository"
242.8520 +msgstr "在版本库中处理多个命名分支"
242.8521 +
242.8522 +#. type: Content of: <book><chapter><sect1><para>
242.8523 +#: ../en/ch07-branch.xml:417
242.8524 +msgid ""
242.8525 +"If you have more than one named branch in a repository, Mercurial will "
242.8526 +"remember the branch that your working directory on when you start a command "
242.8527 +"like <command role=\"hg-cmd\">hg update</command> or <command role=\"hg-cmd"
242.8528 +"\">hg pull -u</command>.  It will update the working directory to the tip of "
242.8529 +"this branch, no matter what the <quote>repo-wide</quote> tip is.  To update "
242.8530 +"to a revision that's on a different named branch, you may need to use the "
242.8531 +"<option role=\"hg-opt-update\">-C</option> option to <command role=\"hg-cmd"
242.8532 +"\">hg update</command>."
242.8533 +msgstr ""
242.8534 +
242.8535 +#. type: Content of: <book><chapter><sect1><para>
242.8536 +#: ../en/ch07-branch.xml:427
242.8537 +msgid ""
242.8538 +"This behaviour is a little subtle, so let's see it in action.  First, let's "
242.8539 +"remind ourselves what branch we're currently on, and what branches are in our "
242.8540 +"repository."
242.8541 +msgstr ""
242.8542 +
242.8543 +#. type: Content of: <book><chapter><sect1><para>
242.8544 +#: ../en/ch07-branch.xml:433
242.8545 +msgid ""
242.8546 +"We're on the <literal>bar</literal> branch, but there also exists an older "
242.8547 +"<command role=\"hg-cmd\">hg foo</command> branch."
242.8548 +msgstr ""
242.8549 +
242.8550 +#. type: Content of: <book><chapter><sect1><para>
242.8551 +#: ../en/ch07-branch.xml:437
242.8552 +msgid ""
242.8553 +"We can <command role=\"hg-cmd\">hg update</command> back and forth between "
242.8554 +"the tips of the <literal>foo</literal> and <literal>bar</literal> branches "
242.8555 +"without needing to use the <option role=\"hg-opt-update\">-C</option> option, "
242.8556 +"because this only involves going backwards and forwards linearly through our "
242.8557 +"change history."
242.8558 +msgstr ""
242.8559 +
242.8560 +#
242.8561 +#. type: Content of: <book><chapter><sect1><para>
242.8562 +#: ../en/ch07-branch.xml:446
242.8563 +msgid ""
242.8564 +"If we go back to the <literal>foo</literal> branch and then run <command role="
242.8565 +"\"hg-cmd\">hg update</command>, it will keep us on <literal>foo</literal>, "
242.8566 +"not move us to the tip of <literal>bar</literal>."
242.8567 +msgstr ""
242.8568 +
242.8569 +#
242.8570 +#. type: Content of: <book><chapter><sect1><para>
242.8571 +#: ../en/ch07-branch.xml:453
242.8572 +msgid ""
242.8573 +"Committing a new change on the <literal>foo</literal> branch introduces a new "
242.8574 +"head."
242.8575 +msgstr ""
242.8576 +
242.8577 +#. type: Content of: <book><chapter><sect1><title>
242.8578 +#: ../en/ch07-branch.xml:460
242.8579 +msgid "Branch names and merging"
242.8580 +msgstr "分支名称与合并"
242.8581 +
242.8582 +#. type: Content of: <book><chapter><sect1><para>
242.8583 +#: ../en/ch07-branch.xml:462
242.8584 +msgid ""
242.8585 +"As you've probably noticed, merges in Mercurial are not symmetrical. Let's "
242.8586 +"say our repository has two heads, 17 and 23.  If I <command role=\"hg-cmd"
242.8587 +"\">hg update</command> to 17 and then <command role=\"hg-cmd\">hg merge</"
242.8588 +"command> with 23, Mercurial records 17 as the first parent of the merge, and "
242.8589 +"23 as the second.  Whereas if I <command role=\"hg-cmd\">hg update</command> "
242.8590 +"to 23 and then <command role=\"hg-cmd\">hg merge</command> with 17, it "
242.8591 +"records 23 as the first parent, and 17 as the second."
242.8592 +msgstr ""
242.8593 +
242.8594 +#. type: Content of: <book><chapter><sect1><para>
242.8595 +#: ../en/ch07-branch.xml:472
242.8596 +msgid ""
242.8597 +"This affects Mercurial's choice of branch name when you merge.  After a "
242.8598 +"merge, Mercurial will retain the branch name of the first parent when you "
242.8599 +"commit the result of the merge.  If your first parent's branch name is "
242.8600 +"<literal>foo</literal>, and you merge with <literal>bar</literal>, the branch "
242.8601 +"name will still be <literal>foo</literal> after you merge."
242.8602 +msgstr ""
242.8603 +
242.8604 +#. type: Content of: <book><chapter><sect1><para>
242.8605 +#: ../en/ch07-branch.xml:479
242.8606 +msgid ""
242.8607 +"It's not unusual for a repository to contain multiple heads, each with the "
242.8608 +"same branch name.  Let's say I'm working on the <literal>foo</literal> "
242.8609 +"branch, and so are you.  We commit different changes; I pull your changes; I "
242.8610 +"now have two heads, each claiming to be on the <literal>foo</literal> "
242.8611 +"branch.  The result of a merge will be a single head on the <literal>foo</"
242.8612 +"literal> branch, as you might hope."
242.8613 +msgstr ""
242.8614 +
242.8615 +#
242.8616 +#. type: Content of: <book><chapter><sect1><para>
242.8617 +#: ../en/ch07-branch.xml:487
242.8618 +msgid ""
242.8619 +"But if I'm working on the <literal>bar</literal> branch, and I merge work "
242.8620 +"from the <literal>foo</literal> branch, the result will remain on the "
242.8621 +"<literal>bar</literal> branch."
242.8622 +msgstr ""
242.8623 +
242.8624 +#. type: Content of: <book><chapter><sect1><para>
242.8625 +#: ../en/ch07-branch.xml:493
242.8626 +msgid ""
242.8627 +"To give a more concrete example, if I'm working on the <literal>bleeding-"
242.8628 +"edge</literal> branch, and I want to bring in the latest fixes from the "
242.8629 +"<literal>stable</literal> branch, Mercurial will choose the <quote>right</"
242.8630 +"quote> (<literal>bleeding-edge</literal>) branch name when I pull and merge "
242.8631 +"from <literal>stable</literal>."
242.8632 +msgstr ""
242.8633 +
242.8634 +#. type: Content of: <book><chapter><sect1><title>
242.8635 +#: ../en/ch07-branch.xml:502
242.8636 +msgid "Branch naming is generally useful"
242.8637 +msgstr "分支名称通常都很有用"
242.8638 +
242.8639 +#. type: Content of: <book><chapter><sect1><para>
242.8640 +#: ../en/ch07-branch.xml:504
242.8641 +msgid ""
242.8642 +"You shouldn't think of named branches as applicable only to situations where "
242.8643 +"you have multiple long-lived branches cohabiting in a single repository.  "
242.8644 +"They're very useful even in the one-branch-per-repository case."
242.8645 +msgstr ""
242.8646 +
242.8647 +#. type: Content of: <book><chapter><sect1><para>
242.8648 +#: ../en/ch07-branch.xml:509
242.8649 +msgid ""
242.8650 +"In the simplest case, giving a name to each branch gives you a permanent "
242.8651 +"record of which branch a changeset originated on.  This gives you more "
242.8652 +"context when you're trying to follow the history of a long-lived branchy "
242.8653 +"project."
242.8654 +msgstr ""
242.8655 +
242.8656 +#. type: Content of: <book><chapter><sect1><para>
242.8657 +#: ../en/ch07-branch.xml:514
242.8658 +msgid ""
242.8659 +"If you're working with shared repositories, you can set up a <literal role="
242.8660 +"\"hook\">pretxnchangegroup</literal> hook on each that will block incoming "
242.8661 +"changes that have the <quote>wrong</quote> branch name.  This provides a "
242.8662 +"simple, but effective, defence against people accidentally pushing changes "
242.8663 +"from a <quote>bleeding edge</quote> branch to a <quote>stable</quote> "
242.8664 +"branch.  Such a hook might look like this inside the shared repo's <filename "
242.8665 +"role=\"special\"> /.hgrc</filename>."
242.8666 +msgstr ""
242.8667 +
242.8668 +#. type: Content of: <book><chapter><title>
242.8669 +#: ../en/ch08-undo.xml:5
242.8670 +msgid "Finding and fixing mistakes"
242.8671 +msgstr "查找和修改错误"
242.8672 +
242.8673 +#. type: Content of: <book><chapter><para>
242.8674 +#: ../en/ch08-undo.xml:7
242.8675 +msgid ""
242.8676 +"To err might be human, but to really handle the consequences well takes a top-"
242.8677 +"notch revision control system.  In this chapter, we'll discuss some of the "
242.8678 +"techniques you can use when you find that a problem has crept into your "
242.8679 +"project.  Mercurial has some highly capable features that will help you to "
242.8680 +"isolate the sources of problems, and to handle them appropriately."
242.8681 +msgstr ""
242.8682 +
242.8683 +#. type: Content of: <book><chapter><sect1><title>
242.8684 +#: ../en/ch08-undo.xml:15
242.8685 +msgid "Erasing local history"
242.8686 +msgstr "销毁本地历史"
242.8687 +
242.8688 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.8689 +#: ../en/ch08-undo.xml:18
242.8690 +msgid "The accidental commit"
242.8691 +msgstr "意外的提交"
242.8692 +
242.8693 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8694 +#: ../en/ch08-undo.xml:20
242.8695 +msgid ""
242.8696 +"I have the occasional but persistent problem of typing rather more quickly "
242.8697 +"than I can think, which sometimes results in me committing a changeset that "
242.8698 +"is either incomplete or plain wrong.  In my case, the usual kind of "
242.8699 +"incomplete changeset is one in which I've created a new source file, but "
242.8700 +"forgotten to <command role=\"hg-cmd\">hg add</command> it.  A <quote>plain "
242.8701 +"wrong</quote> changeset is not as common, but no less annoying."
242.8702 +msgstr ""
242.8703 +
242.8704 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.8705 +#: ../en/ch08-undo.xml:31
242.8706 +msgid "Rolling back a transaction"
242.8707 +msgstr "回滚一个事务"
242.8708 +
242.8709 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8710 +#: ../en/ch08-undo.xml:33
242.8711 +msgid ""
242.8712 +"In <xref linkend=\"sec:concepts:txn\"/>, I mentioned that Mercurial treats "
242.8713 +"each modification of a repository as a <emphasis>transaction</emphasis>.  "
242.8714 +"Every time you commit a changeset or pull changes from another repository, "
242.8715 +"Mercurial remembers what you did.  You can undo, or <emphasis>roll back</"
242.8716 +"emphasis>, exactly one of these actions using the <command role=\"hg-cmd\">hg "
242.8717 +"rollback</command> command.  (See <xref linkend=\"sec:undo:rollback-after-push"
242.8718 +"\"/> for an important caveat about the use of this command.)"
242.8719 +msgstr ""
242.8720 +
242.8721 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8722 +#: ../en/ch08-undo.xml:43
242.8723 +msgid ""
242.8724 +"Here's a mistake that I often find myself making: committing a change in "
242.8725 +"which I've created a new file, but forgotten to <command role=\"hg-cmd\">hg "
242.8726 +"add</command> it."
242.8727 +msgstr ""
242.8728 +
242.8729 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8730 +#: ../en/ch08-undo.xml:50
242.8731 +msgid ""
242.8732 +"Looking at the output of <command role=\"hg-cmd\">hg status</command> after "
242.8733 +"the commit immediately confirms the error."
242.8734 +msgstr ""
242.8735 +
242.8736 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8737 +#: ../en/ch08-undo.xml:56
242.8738 +msgid ""
242.8739 +"The commit captured the changes to the file <filename>a</filename>, but not "
242.8740 +"the new file <filename>b</filename>.  If I were to push this changeset to a "
242.8741 +"repository that I shared with a colleague, the chances are high that "
242.8742 +"something in <filename>a</filename> would refer to <filename>b</filename>, "
242.8743 +"which would not be present in their repository when they pulled my changes.  "
242.8744 +"I would thus become the object of some indignation."
242.8745 +msgstr ""
242.8746 +
242.8747 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8748 +#: ../en/ch08-undo.xml:65
242.8749 +msgid ""
242.8750 +"However, luck is with me&emdash;I've caught my error before I pushed the "
242.8751 +"changeset.  I use the <command role=\"hg-cmd\">hg rollback</command> command, "
242.8752 +"and Mercurial makes that last changeset vanish."
242.8753 +msgstr ""
242.8754 +
242.8755 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8756 +#: ../en/ch08-undo.xml:72
242.8757 +msgid ""
242.8758 +"Notice that the changeset is no longer present in the repository's history, "
242.8759 +"and the working directory once again thinks that the file <filename>a</"
242.8760 +"filename> is modified.  The commit and rollback have left the working "
242.8761 +"directory exactly as it was prior to the commit; the changeset has been "
242.8762 +"completely erased.  I can now safely <command role=\"hg-cmd\">hg add</"
242.8763 +"command> the file <filename>b</filename>, and rerun my commit."
242.8764 +msgstr ""
242.8765 +
242.8766 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.8767 +#: ../en/ch08-undo.xml:85
242.8768 +msgid "The erroneous pull"
242.8769 +msgstr "错误的抓取"
242.8770 +
242.8771 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8772 +#: ../en/ch08-undo.xml:87
242.8773 +msgid ""
242.8774 +"It's common practice with Mercurial to maintain separate development branches "
242.8775 +"of a project in different repositories.  Your development team might have one "
242.8776 +"shared repository for your project's <quote>0.9</quote> release, and another, "
242.8777 +"containing different changes, for the <quote>1.0</quote> release."
242.8778 +msgstr ""
242.8779 +
242.8780 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8781 +#: ../en/ch08-undo.xml:94
242.8782 +msgid ""
242.8783 +"Given this, you can imagine that the consequences could be messy if you had a "
242.8784 +"local <quote>0.9</quote> repository, and accidentally pulled changes from the "
242.8785 +"shared <quote>1.0</quote> repository into it.  At worst, you could be paying "
242.8786 +"insufficient attention, and push those changes into the shared <quote>0.9</"
242.8787 +"quote> tree, confusing your entire team (but don't worry, we'll return to "
242.8788 +"this horror scenario later).  However, it's more likely that you'll notice "
242.8789 +"immediately, because Mercurial will display the URL it's pulling from, or you "
242.8790 +"will see it pull a suspiciously large number of changes into the repository."
242.8791 +msgstr ""
242.8792 +
242.8793 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8794 +#: ../en/ch08-undo.xml:106
242.8795 +msgid ""
242.8796 +"The <command role=\"hg-cmd\">hg rollback</command> command will work nicely "
242.8797 +"to expunge all of the changesets that you just pulled.  Mercurial groups all "
242.8798 +"changes from one <command role=\"hg-cmd\">hg pull</command> into a single "
242.8799 +"transaction, so one <command role=\"hg-cmd\">hg rollback</command> is all you "
242.8800 +"need to undo this mistake."
242.8801 +msgstr ""
242.8802 +
242.8803 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.8804 +#: ../en/ch08-undo.xml:115
242.8805 +msgid "Rolling back is useless once you've pushed"
242.8806 +msgstr "当完成推送后,回滚是无效的"
242.8807 +
242.8808 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8809 +#: ../en/ch08-undo.xml:117
242.8810 +msgid ""
242.8811 +"The value of the <command role=\"hg-cmd\">hg rollback</command> command drops "
242.8812 +"to zero once you've pushed your changes to another repository.  Rolling back "
242.8813 +"a change makes it disappear entirely, but <emphasis>only</emphasis> in the "
242.8814 +"repository in which you perform the <command role=\"hg-cmd\">hg rollback</"
242.8815 +"command>.  Because a rollback eliminates history, there's no way for the "
242.8816 +"disappearance of a change to propagate between repositories."
242.8817 +msgstr ""
242.8818 +
242.8819 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8820 +#: ../en/ch08-undo.xml:126
242.8821 +msgid ""
242.8822 +"If you've pushed a change to another repository&emdash;particularly if it's a "
242.8823 +"shared repository&emdash;it has essentially <quote>escaped into the wild,</"
242.8824 +"quote> and you'll have to recover from your mistake in a different way.  What "
242.8825 +"will happen if you push a changeset somewhere, then roll it back, then pull "
242.8826 +"from the repository you pushed to, is that the changeset will reappear in "
242.8827 +"your repository."
242.8828 +msgstr ""
242.8829 +
242.8830 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8831 +#: ../en/ch08-undo.xml:135
242.8832 +msgid ""
242.8833 +"(If you absolutely know for sure that the change you want to roll back is the "
242.8834 +"most recent change in the repository that you pushed to, <emphasis>and</"
242.8835 +"emphasis> you know that nobody else could have pulled it from that "
242.8836 +"repository, you can roll back the changeset there, too, but you really should "
242.8837 +"really not rely on this working reliably.  If you do this, sooner or later a "
242.8838 +"change really will make it into a repository that you don't directly control "
242.8839 +"(or have forgotten about), and come back to bite you.)"
242.8840 +msgstr ""
242.8841 +
242.8842 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.8843 +#: ../en/ch08-undo.xml:147
242.8844 +msgid "You can only roll back once"
242.8845 +msgstr "你只能回滚一次"
242.8846 +
242.8847 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8848 +#: ../en/ch08-undo.xml:149
242.8849 +msgid ""
242.8850 +"Mercurial stores exactly one transaction in its transaction log; that "
242.8851 +"transaction is the most recent one that occurred in the repository. This "
242.8852 +"means that you can only roll back one transaction.  If you expect to be able "
242.8853 +"to roll back one transaction, then its predecessor, this is not the behaviour "
242.8854 +"you will get."
242.8855 +msgstr ""
242.8856 +
242.8857 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8858 +#: ../en/ch08-undo.xml:158
242.8859 +msgid ""
242.8860 +"Once you've rolled back one transaction in a repository, you can't roll back "
242.8861 +"again in that repository until you perform another commit or pull."
242.8862 +msgstr ""
242.8863 +
242.8864 +#. type: Content of: <book><chapter><sect1><title>
242.8865 +#: ../en/ch08-undo.xml:165
242.8866 +msgid "Reverting the mistaken change"
242.8867 +msgstr "撤销错误的修改"
242.8868 +
242.8869 +#. type: Content of: <book><chapter><sect1><para>
242.8870 +#: ../en/ch08-undo.xml:167
242.8871 +msgid ""
242.8872 +"If you make a modification to a file, and decide that you really didn't want "
242.8873 +"to change the file at all, and you haven't yet committed your changes, the "
242.8874 +"<command role=\"hg-cmd\">hg revert</command> command is the one you'll need.  "
242.8875 +"It looks at the changeset that's the parent of the working directory, and "
242.8876 +"restores the contents of the file to their state as of that changeset. "
242.8877 +"(That's a long-winded way of saying that, in the normal case, it undoes your "
242.8878 +"modifications.)"
242.8879 +msgstr ""
242.8880 +
242.8881 +#. type: Content of: <book><chapter><sect1><para>
242.8882 +#: ../en/ch08-undo.xml:176
242.8883 +msgid ""
242.8884 +"Let's illustrate how the <command role=\"hg-cmd\">hg revert</command> command "
242.8885 +"works with yet another small example.  We'll begin by modifying a file that "
242.8886 +"Mercurial is already tracking."
242.8887 +msgstr ""
242.8888 +
242.8889 +#. type: Content of: <book><chapter><sect1><para>
242.8890 +#: ../en/ch08-undo.xml:183
242.8891 +msgid ""
242.8892 +"If we don't want that change, we can simply <command role=\"hg-cmd\">hg "
242.8893 +"revert</command> the file."
242.8894 +msgstr ""
242.8895 +
242.8896 +#. type: Content of: <book><chapter><sect1><para>
242.8897 +#: ../en/ch08-undo.xml:189
242.8898 +msgid ""
242.8899 +"The <command role=\"hg-cmd\">hg revert</command> command provides us with an "
242.8900 +"extra degree of safety by saving our modified file with a <filename>.orig</"
242.8901 +"filename> extension."
242.8902 +msgstr ""
242.8903 +
242.8904 +#. type: Content of: <book><chapter><sect1><para>
242.8905 +#: ../en/ch08-undo.xml:196
242.8906 +msgid ""
242.8907 +"Here is a summary of the cases that the <command role=\"hg-cmd\">hg revert</"
242.8908 +"command> command can deal with.  We will describe each of these in more "
242.8909 +"detail in the section that follows."
242.8910 +msgstr ""
242.8911 +
242.8912 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.8913 +#: ../en/ch08-undo.xml:201
242.8914 +msgid "If you modify a file, it will restore the file to its unmodified state."
242.8915 +msgstr ""
242.8916 +
242.8917 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.8918 +#: ../en/ch08-undo.xml:204
242.8919 +msgid ""
242.8920 +"If you <command role=\"hg-cmd\">hg add</command> a file, it will undo the "
242.8921 +"<quote>added</quote> state of the file, but leave the file itself untouched."
242.8922 +msgstr ""
242.8923 +
242.8924 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.8925 +#: ../en/ch08-undo.xml:208
242.8926 +msgid ""
242.8927 +"If you delete a file without telling Mercurial, it will restore the file to "
242.8928 +"its unmodified contents."
242.8929 +msgstr ""
242.8930 +
242.8931 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.8932 +#: ../en/ch08-undo.xml:211
242.8933 +msgid ""
242.8934 +"If you use the <command role=\"hg-cmd\">hg remove</command> command to remove "
242.8935 +"a file, it will undo the <quote>removed</quote> state of the file, and "
242.8936 +"restore the file to its unmodified contents."
242.8937 +msgstr ""
242.8938 +
242.8939 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.8940 +#: ../en/ch08-undo.xml:218
242.8941 +msgid "File management errors"
242.8942 +msgstr "文件管理错误"
242.8943 +
242.8944 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8945 +#: ../en/ch08-undo.xml:220
242.8946 +msgid ""
242.8947 +"The <command role=\"hg-cmd\">hg revert</command> command is useful for more "
242.8948 +"than just modified files.  It lets you reverse the results of all of "
242.8949 +"Mercurial's file management commands&emdash;<command role=\"hg-cmd\">hg add</"
242.8950 +"command>, <command role=\"hg-cmd\">hg remove</command>, and so on."
242.8951 +msgstr ""
242.8952 +
242.8953 +#
242.8954 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8955 +#: ../en/ch08-undo.xml:226
242.8956 +msgid ""
242.8957 +"If you <command role=\"hg-cmd\">hg add</command> a file, then decide that in "
242.8958 +"fact you don't want Mercurial to track it, use <command role=\"hg-cmd\">hg "
242.8959 +"revert</command> to undo the add.  Don't worry; Mercurial will not modify the "
242.8960 +"file in any way.  It will just <quote>unmark</quote> the file."
242.8961 +msgstr ""
242.8962 +
242.8963 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8964 +#: ../en/ch08-undo.xml:234
242.8965 +msgid ""
242.8966 +"Similarly, if you ask Mercurial to <command role=\"hg-cmd\">hg remove</"
242.8967 +"command> a file, you can use <command role=\"hg-cmd\">hg revert</command> to "
242.8968 +"restore it to the contents it had as of the parent of the working directory.  "
242.8969 +"&interaction.daily.revert.remove; This works just as well for a file that you "
242.8970 +"deleted by hand, without telling Mercurial (recall that in Mercurial "
242.8971 +"terminology, this kind of file is called <quote>missing</quote>)."
242.8972 +msgstr ""
242.8973 +
242.8974 +#
242.8975 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.8976 +#: ../en/ch08-undo.xml:245
242.8977 +msgid ""
242.8978 +"If you revert a <command role=\"hg-cmd\">hg copy</command>, the copied-to "
242.8979 +"file remains in your working directory afterwards, untracked.  Since a copy "
242.8980 +"doesn't affect the copied-from file in any way, Mercurial doesn't do anything "
242.8981 +"with the copied-from file."
242.8982 +msgstr ""
242.8983 +
242.8984 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title>
242.8985 +#: ../en/ch08-undo.xml:254
242.8986 +msgid "A slightly special case: reverting a rename"
242.8987 +msgstr "一个稍微特别的案例:撤销改名"
242.8988 +
242.8989 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.8990 +#: ../en/ch08-undo.xml:256
242.8991 +msgid ""
242.8992 +"If you <command role=\"hg-cmd\">hg rename</command> a file, there is one "
242.8993 +"small detail that you should remember.  When you <command role=\"hg-cmd\">hg "
242.8994 +"revert</command> a rename, it's not enough to provide the name of the renamed-"
242.8995 +"to file, as you can see here."
242.8996 +msgstr ""
242.8997 +
242.8998 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.8999 +#: ../en/ch08-undo.xml:264
242.9000 +msgid ""
242.9001 +"As you can see from the output of <command role=\"hg-cmd\">hg status</"
242.9002 +"command>, the renamed-to file is no longer identified as added, but the "
242.9003 +"renamed-<emphasis>from</emphasis> file is still removed! This is counter-"
242.9004 +"intuitive (at least to me), but at least it's easy to deal with."
242.9005 +msgstr ""
242.9006 +
242.9007 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.9008 +#: ../en/ch08-undo.xml:273
242.9009 +msgid ""
242.9010 +"So remember, to revert a <command role=\"hg-cmd\">hg rename</command>, you "
242.9011 +"must provide <emphasis>both</emphasis> the source and destination names."
242.9012 +msgstr ""
242.9013 +
242.9014 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.9015 +#: ../en/ch08-undo.xml:278
242.9016 +msgid "% TODO: the output doesn't look like it will be removed!"
242.9017 +msgstr ""
242.9018 +
242.9019 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.9020 +#: ../en/ch08-undo.xml:281
242.9021 +msgid ""
242.9022 +"(By the way, if you rename a file, then modify the renamed-to file, then "
242.9023 +"revert both components of the rename, when Mercurial restores the file that "
242.9024 +"was removed as part of the rename, it will be unmodified. If you need the "
242.9025 +"modifications in the renamed-to file to show up in the renamed-from file, "
242.9026 +"don't forget to copy them over.)"
242.9027 +msgstr ""
242.9028 +
242.9029 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.9030 +#: ../en/ch08-undo.xml:288
242.9031 +msgid ""
242.9032 +"These fiddly aspects of reverting a rename arguably constitute a small bug in "
242.9033 +"Mercurial."
242.9034 +msgstr ""
242.9035 +
242.9036 +#. type: Content of: <book><chapter><sect1><title>
242.9037 +#: ../en/ch08-undo.xml:295
242.9038 +msgid "Dealing with committed changes"
242.9039 +msgstr "处理已经提交的修改"
242.9040 +
242.9041 +#. type: Content of: <book><chapter><sect1><para>
242.9042 +#: ../en/ch08-undo.xml:297
242.9043 +msgid ""
242.9044 +"Consider a case where you have committed a change $a$, and another change $b$ "
242.9045 +"on top of it; you then realise that change $a$ was incorrect.  Mercurial lets "
242.9046 +"you <quote>back out</quote> an entire changeset automatically, and building "
242.9047 +"blocks that let you reverse part of a changeset by hand."
242.9048 +msgstr ""
242.9049 +
242.9050 +#. type: Content of: <book><chapter><sect1><para>
242.9051 +#: ../en/ch08-undo.xml:303
242.9052 +msgid ""
242.9053 +"Before you read this section, here's something to keep in mind: the <command "
242.9054 +"role=\"hg-cmd\">hg backout</command> command undoes changes by "
242.9055 +"<emphasis>adding</emphasis> history, not by modifying or erasing it.  It's "
242.9056 +"the right tool to use if you're fixing bugs, but not if you're trying to undo "
242.9057 +"some change that has catastrophic consequences.  To deal with those, see "
242.9058 +"<xref linkend=\"sec:undo:aaaiiieee\"/>."
242.9059 +msgstr ""
242.9060 +
242.9061 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.9062 +#: ../en/ch08-undo.xml:312
242.9063 +msgid "Backing out a changeset"
242.9064 +msgstr "恢复一个修改集"
242.9065 +
242.9066 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9067 +#: ../en/ch08-undo.xml:314
242.9068 +msgid ""
242.9069 +"The <command role=\"hg-cmd\">hg backout</command> command lets you "
242.9070 +"<quote>undo</quote> the effects of an entire changeset in an automated "
242.9071 +"fashion.  Because Mercurial's history is immutable, this command "
242.9072 +"<emphasis>does not</emphasis> get rid of the changeset you want to undo.  "
242.9073 +"Instead, it creates a new changeset that <emphasis>reverses</emphasis> the "
242.9074 +"effect of the to-be-undone changeset."
242.9075 +msgstr ""
242.9076 +
242.9077 +#
242.9078 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9079 +#: ../en/ch08-undo.xml:323
242.9080 +msgid ""
242.9081 +"The operation of the <command role=\"hg-cmd\">hg backout</command> command is "
242.9082 +"a little intricate, so let's illustrate it with some examples.  First, we'll "
242.9083 +"create a repository with some simple changes."
242.9084 +msgstr ""
242.9085 +
242.9086 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9087 +#: ../en/ch08-undo.xml:330
242.9088 +msgid ""
242.9089 +"The <command role=\"hg-cmd\">hg backout</command> command takes a single "
242.9090 +"changeset ID as its argument; this is the changeset to back out.  Normally, "
242.9091 +"<command role=\"hg-cmd\">hg backout</command> will drop you into a text "
242.9092 +"editor to write a commit message, so you can record why you're backing the "
242.9093 +"change out.  In this example, we provide a commit message on the command line "
242.9094 +"using the <option role=\"hg-opt-backout\">-m</option> option."
242.9095 +msgstr ""
242.9096 +
242.9097 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.9098 +#: ../en/ch08-undo.xml:341
242.9099 +msgid "Backing out the tip changeset"
242.9100 +msgstr "恢复顶点修改集"
242.9101 +
242.9102 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9103 +#: ../en/ch08-undo.xml:343
242.9104 +msgid "We're going to start by backing out the last changeset we committed."
242.9105 +msgstr ""
242.9106 +
242.9107 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9108 +#: ../en/ch08-undo.xml:348
242.9109 +msgid ""
242.9110 +"You can see that the second line from <filename>myfile</filename> is no "
242.9111 +"longer present.  Taking a look at the output of <command role=\"hg-cmd\">hg "
242.9112 +"log</command> gives us an idea of what the <command role=\"hg-cmd\">hg "
242.9113 +"backout</command> command has done.  &interaction.backout.simple.log; Notice "
242.9114 +"that the new changeset that <command role=\"hg-cmd\">hg backout</command> has "
242.9115 +"created is a child of the changeset we backed out.  It's easier to see this "
242.9116 +"in <xref linkend=\"fig:undo:backout\"/>, which presents a graphical view of "
242.9117 +"the change history.  As you can see, the history is nice and linear."
242.9118 +msgstr ""
242.9119 +
242.9120 +#. type: Content of: <book><chapter><sect1><sect2><figure><title>
242.9121 +#: ../en/ch08-undo.xml:361 ../en/ch08-undo.xml:473
242.9122 +msgid ""
242.9123 +"Backing out a change using the <command role=\"hg-cmd\">hg backout</command> "
242.9124 +"command"
242.9125 +msgstr "使用 <command role=\"hg-cmd\">hg backout</command> 恢复一个修改"
242.9126 +
242.9127 +#. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject>
242.9128 +#: ../en/ch08-undo.xml:364
242.9129 +msgid "<imageobject><imagedata fileref=\"figs/undo-simple.png\"/></imageobject>"
242.9130 +msgstr ""
242.9131 +
242.9132 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.9133 +#: ../en/ch08-undo.xml:371
242.9134 +msgid "Backing out a non-tip change"
242.9135 +msgstr "恢复非顶点的修改"
242.9136 +
242.9137 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9138 +#: ../en/ch08-undo.xml:373
242.9139 +msgid ""
242.9140 +"If you want to back out a change other than the last one you committed, pass "
242.9141 +"the <option role=\"hg-opt-backout\">--merge</option> option to the <command "
242.9142 +"role=\"hg-cmd\">hg backout</command> command."
242.9143 +msgstr ""
242.9144 +
242.9145 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9146 +#: ../en/ch08-undo.xml:380
242.9147 +msgid ""
242.9148 +"This makes backing out any changeset a <quote>one-shot</quote> operation "
242.9149 +"that's usually simple and fast."
242.9150 +msgstr ""
242.9151 +
242.9152 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9153 +#: ../en/ch08-undo.xml:386
242.9154 +msgid ""
242.9155 +"If you take a look at the contents of <filename>myfile</filename> after the "
242.9156 +"backout finishes, you'll see that the first and third changes are present, "
242.9157 +"but not the second."
242.9158 +msgstr ""
242.9159 +
242.9160 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9161 +#: ../en/ch08-undo.xml:393
242.9162 +msgid ""
242.9163 +"As the graphical history in <xref linkend=\"fig:undo:backout-non-tip\"/> "
242.9164 +"illustrates, Mercurial actually commits <emphasis>two</emphasis> changes in "
242.9165 +"this kind of situation (the box-shaped nodes are the ones that Mercurial "
242.9166 +"commits automatically).  Before Mercurial begins the backout process, it "
242.9167 +"first remembers what the current parent of the working directory is.  It then "
242.9168 +"backs out the target changeset, and commits that as a changeset.  Finally, it "
242.9169 +"merges back to the previous parent of the working directory, and commits the "
242.9170 +"result of the merge."
242.9171 +msgstr ""
242.9172 +
242.9173 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9174 +#: ../en/ch08-undo.xml:404
242.9175 +msgid ""
242.9176 +"% TODO: to me it looks like mercurial doesn't commit the second merge "
242.9177 +"automatically!"
242.9178 +msgstr ""
242.9179 +
242.9180 +#. type: Content of: <book><chapter><sect1><sect2><figure><title>
242.9181 +#: ../en/ch08-undo.xml:408
242.9182 +msgid ""
242.9183 +"Automated backout of a non-tip change using the <command role=\"hg-cmd\">hg "
242.9184 +"backout</command> command"
242.9185 +msgstr "使用 <command role=\"hg-cmd\">hg backout</command> 自动恢复非顶点的修改"
242.9186 +
242.9187 +#. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject>
242.9188 +#: ../en/ch08-undo.xml:411
242.9189 +msgid ""
242.9190 +"<imageobject><imagedata fileref=\"figs/undo-non-tip.png\"/></imageobject>"
242.9191 +msgstr ""
242.9192 +
242.9193 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9194 +#: ../en/ch08-undo.xml:416
242.9195 +msgid ""
242.9196 +"The result is that you end up <quote>back where you were</quote>, only with "
242.9197 +"some extra history that undoes the effect of the changeset you wanted to back "
242.9198 +"out."
242.9199 +msgstr ""
242.9200 +
242.9201 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title>
242.9202 +#: ../en/ch08-undo.xml:421
242.9203 +msgid "Always use the <option role=\"hg-opt-backout\">--merge</option> option"
242.9204 +msgstr "始终使用选项 <option role=\"hg-opt-backout\">--merge</option>"
242.9205 +
242.9206 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.9207 +#: ../en/ch08-undo.xml:424
242.9208 +msgid ""
242.9209 +"In fact, since the <option role=\"hg-opt-backout\">--merge</option> option "
242.9210 +"will do the <quote>right thing</quote> whether or not the changeset you're "
242.9211 +"backing out is the tip (i.e. it won't try to merge if it's backing out the "
242.9212 +"tip, since there's no need), you should <emphasis>always</emphasis> use this "
242.9213 +"option when you run the <command role=\"hg-cmd\">hg backout</command> command."
242.9214 +msgstr ""
242.9215 +
242.9216 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.9217 +#: ../en/ch08-undo.xml:435
242.9218 +msgid "Gaining more control of the backout process"
242.9219 +msgstr "在恢复处理中获得更多控制"
242.9220 +
242.9221 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9222 +#: ../en/ch08-undo.xml:437
242.9223 +msgid ""
242.9224 +"While I've recommended that you always use the <option role=\"hg-opt-backout"
242.9225 +"\">--merge</option> option when backing out a change, the <command role=\"hg-"
242.9226 +"cmd\">hg backout</command> command lets you decide how to merge a backout "
242.9227 +"changeset.  Taking control of the backout process by hand is something you "
242.9228 +"will rarely need to do, but it can be useful to understand what the <command "
242.9229 +"role=\"hg-cmd\">hg backout</command> command is doing for you automatically.  "
242.9230 +"To illustrate this, let's clone our first repository, but omit the backout "
242.9231 +"change that it contains."
242.9232 +msgstr ""
242.9233 +
242.9234 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9235 +#: ../en/ch08-undo.xml:450
242.9236 +msgid ""
242.9237 +"As with our earlier example, We'll commit a third changeset, then back out "
242.9238 +"its parent, and see what happens."
242.9239 +msgstr ""
242.9240 +
242.9241 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9242 +#: ../en/ch08-undo.xml:456
242.9243 +msgid ""
242.9244 +"Our new changeset is again a descendant of the changeset we backout out; it's "
242.9245 +"thus a new head, <emphasis>not</emphasis> a descendant of the changeset that "
242.9246 +"was the tip.  The <command role=\"hg-cmd\">hg backout</command> command was "
242.9247 +"quite explicit in telling us this."
242.9248 +msgstr ""
242.9249 +
242.9250 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9251 +#: ../en/ch08-undo.xml:464
242.9252 +msgid ""
242.9253 +"Again, it's easier to see what has happened by looking at a graph of the "
242.9254 +"revision history, in <xref linkend=\"fig:undo:backout-manual\"/>.  This makes "
242.9255 +"it clear that when we use <command role=\"hg-cmd\">hg backout</command> to "
242.9256 +"back out a change other than the tip, Mercurial adds a new head to the "
242.9257 +"repository (the change it committed is box-shaped)."
242.9258 +msgstr ""
242.9259 +
242.9260 +#. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject>
242.9261 +#: ../en/ch08-undo.xml:476
242.9262 +msgid "<imageobject><imagedata fileref=\"figs/undo-manual.png\"/></imageobject>"
242.9263 +msgstr ""
242.9264 +
242.9265 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9266 +#: ../en/ch08-undo.xml:481
242.9267 +msgid ""
242.9268 +"After the <command role=\"hg-cmd\">hg backout</command> command has "
242.9269 +"completed, it leaves the new <quote>backout</quote> changeset as the parent "
242.9270 +"of the working directory."
242.9271 +msgstr ""
242.9272 +
242.9273 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9274 +#: ../en/ch08-undo.xml:488
242.9275 +msgid "Now we have two isolated sets of changes."
242.9276 +msgstr ""
242.9277 +
242.9278 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9279 +#: ../en/ch08-undo.xml:492
242.9280 +msgid ""
242.9281 +"Let's think about what we expect to see as the contents of <filename>myfile</"
242.9282 +"filename> now.  The first change should be present, because we've never "
242.9283 +"backed it out.  The second change should be missing, as that's the change we "
242.9284 +"backed out.  Since the history graph shows the third change as a separate "
242.9285 +"head, we <emphasis>don't</emphasis> expect to see the third change present in "
242.9286 +"<filename>myfile</filename>."
242.9287 +msgstr ""
242.9288 +
242.9289 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9290 +#: ../en/ch08-undo.xml:502
242.9291 +msgid ""
242.9292 +"To get the third change back into the file, we just do a normal merge of our "
242.9293 +"two heads."
242.9294 +msgstr ""
242.9295 +
242.9296 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9297 +#: ../en/ch08-undo.xml:507
242.9298 +msgid ""
242.9299 +"Afterwards, the graphical history of our repository looks like <xref linkend="
242.9300 +"\"fig:undo:backout-manual-merge\"/>."
242.9301 +msgstr ""
242.9302 +
242.9303 +#. type: Content of: <book><chapter><sect1><sect2><figure><title>
242.9304 +#: ../en/ch08-undo.xml:512
242.9305 +msgid "Manually merging a backout change"
242.9306 +msgstr "手工合并恢复修改"
242.9307 +
242.9308 +#. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject>
242.9309 +#: ../en/ch08-undo.xml:514
242.9310 +msgid ""
242.9311 +"<imageobject><imagedata fileref=\"figs/undo-manual-merge.png\"/></imageobject>"
242.9312 +msgstr ""
242.9313 +
242.9314 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.9315 +#: ../en/ch08-undo.xml:521
242.9316 +msgid "Why <command role=\"hg-cmd\">hg backout</command> works as it does"
242.9317 +msgstr "<command role=\"hg-cmd\">hg backout</command> 的内幕"
242.9318 +
242.9319 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9320 +#: ../en/ch08-undo.xml:524
242.9321 +msgid ""
242.9322 +"Here's a brief description of how the <command role=\"hg-cmd\">hg backout</"
242.9323 +"command> command works."
242.9324 +msgstr ""
242.9325 +
242.9326 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.9327 +#: ../en/ch08-undo.xml:527
242.9328 +msgid ""
242.9329 +"It ensures that the working directory is <quote>clean</quote>, i.e. that the "
242.9330 +"output of <command role=\"hg-cmd\">hg status</command> would be empty."
242.9331 +msgstr ""
242.9332 +
242.9333 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.9334 +#: ../en/ch08-undo.xml:531
242.9335 +msgid ""
242.9336 +"It remembers the current parent of the working directory.  Let's call this "
242.9337 +"changeset <literal>orig</literal>"
242.9338 +msgstr ""
242.9339 +
242.9340 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.9341 +#: ../en/ch08-undo.xml:535
242.9342 +msgid ""
242.9343 +"It does the equivalent of a <command role=\"hg-cmd\">hg update</command> to "
242.9344 +"sync the working directory to the changeset you want to back out.  Let's call "
242.9345 +"this changeset <literal>backout</literal>"
242.9346 +msgstr ""
242.9347 +
242.9348 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.9349 +#: ../en/ch08-undo.xml:540
242.9350 +msgid ""
242.9351 +"It finds the parent of that changeset.  Let's call that changeset "
242.9352 +"<literal>parent</literal>."
242.9353 +msgstr ""
242.9354 +
242.9355 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.9356 +#: ../en/ch08-undo.xml:543
242.9357 +msgid ""
242.9358 +"For each file that the <literal>backout</literal> changeset affected, it does "
242.9359 +"the equivalent of a <command role=\"hg-cmd\">hg revert -r parent</command> on "
242.9360 +"that file, to restore it to the contents it had before that changeset was "
242.9361 +"committed."
242.9362 +msgstr ""
242.9363 +
242.9364 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.9365 +#: ../en/ch08-undo.xml:550
242.9366 +msgid ""
242.9367 +"It commits the result as a new changeset.  This changeset has "
242.9368 +"<literal>backout</literal> as its parent."
242.9369 +msgstr ""
242.9370 +
242.9371 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.9372 +#: ../en/ch08-undo.xml:554
242.9373 +msgid ""
242.9374 +"If you specify <option role=\"hg-opt-backout\">--merge</option> on the "
242.9375 +"command line, it merges with <literal>orig</literal>, and commits the result "
242.9376 +"of the merge."
242.9377 +msgstr ""
242.9378 +
242.9379 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9380 +#: ../en/ch08-undo.xml:560
242.9381 +msgid ""
242.9382 +"An alternative way to implement the <command role=\"hg-cmd\">hg backout</"
242.9383 +"command> command would be to <command role=\"hg-cmd\">hg export</command> the "
242.9384 +"to-be-backed-out changeset as a diff, then use the <option role=\"cmd-opt-"
242.9385 +"patch\">--reverse</option> option to the <command>patch</command> command to "
242.9386 +"reverse the effect of the change without fiddling with the working "
242.9387 +"directory.  This sounds much simpler, but it would not work nearly as well."
242.9388 +msgstr ""
242.9389 +
242.9390 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9391 +#: ../en/ch08-undo.xml:570
242.9392 +msgid ""
242.9393 +"The reason that <command role=\"hg-cmd\">hg backout</command> does an update, "
242.9394 +"a commit, a merge, and another commit is to give the merge machinery the best "
242.9395 +"chance to do a good job when dealing with all the changes <emphasis>between</"
242.9396 +"emphasis> the change you're backing out and the current tip."
242.9397 +msgstr ""
242.9398 +
242.9399 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9400 +#: ../en/ch08-undo.xml:577
242.9401 +msgid ""
242.9402 +"If you're backing out a changeset that's 100 revisions back in your project's "
242.9403 +"history, the chances that the <command>patch</command> command will be able "
242.9404 +"to apply a reverse diff cleanly are not good, because intervening changes are "
242.9405 +"likely to have <quote>broken the context</quote> that <command>patch</"
242.9406 +"command> uses to determine whether it can apply a patch (if this sounds like "
242.9407 +"gibberish, see <xref linkend=\"sec:mq:patch\"/> for a discussion of the "
242.9408 +"<command>patch</command> command).  Also, Mercurial's merge machinery will "
242.9409 +"handle files and directories being renamed, permission changes, and "
242.9410 +"modifications to binary files, none of which <command>patch</command> can "
242.9411 +"deal with."
242.9412 +msgstr ""
242.9413 +
242.9414 +#. type: Content of: <book><chapter><sect1><title>
242.9415 +#: ../en/ch08-undo.xml:594
242.9416 +msgid "Changes that should never have been"
242.9417 +msgstr "不该发生的修改"
242.9418 +
242.9419 +#. type: Content of: <book><chapter><sect1><para>
242.9420 +#: ../en/ch08-undo.xml:596
242.9421 +msgid ""
242.9422 +"Most of the time, the <command role=\"hg-cmd\">hg backout</command> command "
242.9423 +"is exactly what you need if you want to undo the effects of a change.  It "
242.9424 +"leaves a permanent record of exactly what you did, both when committing the "
242.9425 +"original changeset and when you cleaned up after it."
242.9426 +msgstr ""
242.9427 +
242.9428 +#. type: Content of: <book><chapter><sect1><para>
242.9429 +#: ../en/ch08-undo.xml:602
242.9430 +msgid ""
242.9431 +"On rare occasions, though, you may find that you've committed a change that "
242.9432 +"really should not be present in the repository at all.  For example, it would "
242.9433 +"be very unusual, and usually considered a mistake, to commit a software "
242.9434 +"project's object files as well as its source files.  Object files have almost "
242.9435 +"no intrinsic value, and they're <emphasis>big</emphasis>, so they increase "
242.9436 +"the size of the repository and the amount of time it takes to clone or pull "
242.9437 +"changes."
242.9438 +msgstr ""
242.9439 +
242.9440 +#. type: Content of: <book><chapter><sect1><para>
242.9441 +#: ../en/ch08-undo.xml:611
242.9442 +msgid ""
242.9443 +"Before I discuss the options that you have if you commit a <quote>brown paper "
242.9444 +"bag</quote> change (the kind that's so bad that you want to pull a brown "
242.9445 +"paper bag over your head), let me first discuss some approaches that probably "
242.9446 +"won't work."
242.9447 +msgstr ""
242.9448 +
242.9449 +#. type: Content of: <book><chapter><sect1><para>
242.9450 +#: ../en/ch08-undo.xml:616
242.9451 +msgid ""
242.9452 +"Since Mercurial treats history as accumulative&emdash;every change builds on "
242.9453 +"top of all changes that preceded it&emdash;you generally can't just make "
242.9454 +"disastrous changes disappear.  The one exception is when you've just "
242.9455 +"committed a change, and it hasn't been pushed or pulled into another "
242.9456 +"repository.  That's when you can safely use the <command role=\"hg-cmd\">hg "
242.9457 +"rollback</command> command, as I detailed in <xref linkend=\"sec:undo:rollback"
242.9458 +"\"/>."
242.9459 +msgstr ""
242.9460 +
242.9461 +#. type: Content of: <book><chapter><sect1><para>
242.9462 +#: ../en/ch08-undo.xml:625
242.9463 +msgid ""
242.9464 +"After you've pushed a bad change to another repository, you <emphasis>could</"
242.9465 +"emphasis> still use <command role=\"hg-cmd\">hg rollback</command> to make "
242.9466 +"your local copy of the change disappear, but it won't have the consequences "
242.9467 +"you want.  The change will still be present in the remote repository, so it "
242.9468 +"will reappear in your local repository the next time you pull."
242.9469 +msgstr ""
242.9470 +
242.9471 +#. type: Content of: <book><chapter><sect1><para>
242.9472 +#: ../en/ch08-undo.xml:633
242.9473 +msgid ""
242.9474 +"If a situation like this arises, and you know which repositories your bad "
242.9475 +"change has propagated into, you can <emphasis>try</emphasis> to get rid of "
242.9476 +"the changeefrom <emphasis>every</emphasis> one of those repositories.  This "
242.9477 +"is, of course, not a satisfactory solution: if you miss even a single "
242.9478 +"repository while you're expunging, the change is still <quote>in the wild</"
242.9479 +"quote>, and could propagate further."
242.9480 +msgstr ""
242.9481 +
242.9482 +#. type: Content of: <book><chapter><sect1><para>
242.9483 +#: ../en/ch08-undo.xml:641
242.9484 +msgid ""
242.9485 +"If you've committed one or more changes <emphasis>after</emphasis> the change "
242.9486 +"that you'd like to see disappear, your options are further reduced. Mercurial "
242.9487 +"doesn't provide a way to <quote>punch a hole</quote> in history, leaving "
242.9488 +"changesets intact."
242.9489 +msgstr ""
242.9490 +
242.9491 +#. type: Content of: <book><chapter><sect1><para>
242.9492 +#: ../en/ch08-undo.xml:647
242.9493 +msgid ""
242.9494 +"XXX This needs filling out.  The <literal>hg-replay</literal> script in the "
242.9495 +"<literal>examples</literal> directory works, but doesn't handle merge "
242.9496 +"changesets.  Kind of an important omission."
242.9497 +msgstr ""
242.9498 +
242.9499 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.9500 +#: ../en/ch08-undo.xml:653
242.9501 +msgid "Protect yourself from <quote>escaped</quote> changes"
242.9502 +msgstr "使用<quote>校验</quote>修改来保护你自己"
242.9503 +
242.9504 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9505 +#: ../en/ch08-undo.xml:656
242.9506 +msgid ""
242.9507 +"If you've committed some changes to your local repository and they've been "
242.9508 +"pushed or pulled somewhere else, this isn't necessarily a disaster.  You can "
242.9509 +"protect yourself ahead of time against some classes of bad changeset.  This "
242.9510 +"is particularly easy if your team usually pulls changes from a central "
242.9511 +"repository."
242.9512 +msgstr ""
242.9513 +
242.9514 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9515 +#: ../en/ch08-undo.xml:663
242.9516 +msgid ""
242.9517 +"By configuring some hooks on that repository to validate incoming changesets "
242.9518 +"(see chapter <xref linkend=\"chap:hook\"/>), you can automatically prevent "
242.9519 +"some kinds of bad changeset from being pushed to the central repository at "
242.9520 +"all.  With such a configuration in place, some kinds of bad changeset will "
242.9521 +"naturally tend to <quote>die out</quote> because they can't propagate into "
242.9522 +"the central repository.  Better yet, this happens without any need for "
242.9523 +"explicit intervention."
242.9524 +msgstr ""
242.9525 +
242.9526 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9527 +#: ../en/ch08-undo.xml:673
242.9528 +msgid ""
242.9529 +"For instance, an incoming change hook that verifies that a changeset will "
242.9530 +"actually compile can prevent people from inadvertantly <quote>breaking the "
242.9531 +"build</quote>."
242.9532 +msgstr ""
242.9533 +
242.9534 +#. type: Content of: <book><chapter><sect1><title>
242.9535 +#: ../en/ch08-undo.xml:680
242.9536 +msgid "Finding the source of a bug"
242.9537 +msgstr "查找问题的根源"
242.9538 +
242.9539 +#. type: Content of: <book><chapter><sect1><para>
242.9540 +#: ../en/ch08-undo.xml:682
242.9541 +msgid ""
242.9542 +"While it's all very well to be able to back out a changeset that introduced a "
242.9543 +"bug, this requires that you know which changeset to back out.  Mercurial "
242.9544 +"provides an invaluable command, called <command role=\"hg-cmd\">hg bisect</"
242.9545 +"command>, that helps you to automate this process and accomplish it very "
242.9546 +"efficiently."
242.9547 +msgstr ""
242.9548 +
242.9549 +#. type: Content of: <book><chapter><sect1><para>
242.9550 +#: ../en/ch08-undo.xml:689
242.9551 +msgid ""
242.9552 +"The idea behind the <command role=\"hg-cmd\">hg bisect</command> command is "
242.9553 +"that a changeset has introduced some change of behaviour that you can "
242.9554 +"identify with a simple binary test.  You don't know which piece of code "
242.9555 +"introduced the change, but you know how to test for the presence of the bug.  "
242.9556 +"The <command role=\"hg-cmd\">hg bisect</command> command uses your test to "
242.9557 +"direct its search for the changeset that introduced the code that caused the "
242.9558 +"bug."
242.9559 +msgstr ""
242.9560 +
242.9561 +#. type: Content of: <book><chapter><sect1><para>
242.9562 +#: ../en/ch08-undo.xml:698
242.9563 +msgid ""
242.9564 +"Here are a few scenarios to help you understand how you might apply this "
242.9565 +"command."
242.9566 +msgstr ""
242.9567 +
242.9568 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.9569 +#: ../en/ch08-undo.xml:701
242.9570 +msgid ""
242.9571 +"The most recent version of your software has a bug that you remember wasn't "
242.9572 +"present a few weeks ago, but you don't know when it was introduced.  Here, "
242.9573 +"your binary test checks for the presence of that bug."
242.9574 +msgstr ""
242.9575 +
242.9576 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.9577 +#: ../en/ch08-undo.xml:706
242.9578 +msgid ""
242.9579 +"You fixed a bug in a rush, and now it's time to close the entry in your "
242.9580 +"team's bug database.  The bug database requires a changeset ID when you close "
242.9581 +"an entry, but you don't remember which changeset you fixed the bug in.  Once "
242.9582 +"again, your binary test checks for the presence of the bug."
242.9583 +msgstr ""
242.9584 +
242.9585 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.9586 +#: ../en/ch08-undo.xml:713
242.9587 +msgid ""
242.9588 +"Your software works correctly, but runs 15% slower than the last time you "
242.9589 +"measured it.  You want to know which changeset introduced the performance "
242.9590 +"regression.  In this case, your binary test measures the performance of your "
242.9591 +"software, to see whether it's <quote>fast</quote> or <quote>slow</quote>."
242.9592 +msgstr ""
242.9593 +
242.9594 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.9595 +#: ../en/ch08-undo.xml:720
242.9596 +msgid ""
242.9597 +"The sizes of the components of your project that you ship exploded recently, "
242.9598 +"and you suspect that something changed in the way you build your project."
242.9599 +msgstr ""
242.9600 +
242.9601 +#. type: Content of: <book><chapter><sect1><para>
242.9602 +#: ../en/ch08-undo.xml:725
242.9603 +msgid ""
242.9604 +"From these examples, it should be clear that the <command role=\"hg-cmd\">hg "
242.9605 +"bisect</command> command is not useful only for finding the sources of bugs.  "
242.9606 +"You can use it to find any <quote>emergent property</quote> of a repository "
242.9607 +"(anything that you can't find from a simple text search of the files in the "
242.9608 +"tree) for which you can write a binary test."
242.9609 +msgstr ""
242.9610 +
242.9611 +#. type: Content of: <book><chapter><sect1><para>
242.9612 +#: ../en/ch08-undo.xml:732
242.9613 +msgid ""
242.9614 +"We'll introduce a little bit of terminology here, just to make it clear which "
242.9615 +"parts of the search process are your responsibility, and which are "
242.9616 +"Mercurial's.  A <emphasis>test</emphasis> is something that <emphasis>you</"
242.9617 +"emphasis> run when <command role=\"hg-cmd\">hg bisect</command> chooses a "
242.9618 +"changeset.  A <emphasis>probe</emphasis> is what <command role=\"hg-cmd\">hg "
242.9619 +"bisect</command> runs to tell whether a revision is good.  Finally, we'll use "
242.9620 +"the word <quote>bisect</quote>, as both a noun and a verb, to stand in for "
242.9621 +"the phrase <quote>search using the <command role=\"hg-cmd\">hg bisect</"
242.9622 +"command> command</quote>."
242.9623 +msgstr ""
242.9624 +
242.9625 +#. type: Content of: <book><chapter><sect1><para>
242.9626 +#: ../en/ch08-undo.xml:745
242.9627 +msgid ""
242.9628 +"One simple way to automate the searching process would be simply to probe "
242.9629 +"every changeset.  However, this scales poorly.  If it took ten minutes to "
242.9630 +"test a single changeset, and you had 10,000 changesets in your repository, "
242.9631 +"the exhaustive approach would take on average 35 <emphasis>days</emphasis> to "
242.9632 +"find the changeset that introduced a bug.  Even if you knew that the bug was "
242.9633 +"introduced by one of the last 500 changesets, and limited your search to "
242.9634 +"those, you'd still be looking at over 40 hours to find the changeset that "
242.9635 +"introduced your bug."
242.9636 +msgstr ""
242.9637 +
242.9638 +#. type: Content of: <book><chapter><sect1><para>
242.9639 +#: ../en/ch08-undo.xml:755
242.9640 +msgid ""
242.9641 +"What the <command role=\"hg-cmd\">hg bisect</command> command does is use its "
242.9642 +"knowledge of the <quote>shape</quote> of your project's revision history to "
242.9643 +"perform a search in time proportional to the <emphasis>logarithm</emphasis> "
242.9644 +"of the number of changesets to check (the kind of search it performs is "
242.9645 +"called a dichotomic search).  With this approach, searching through 10,000 "
242.9646 +"changesets will take less than three hours, even at ten minutes per test (the "
242.9647 +"search will require about 14 tests).  Limit your search to the last hundred "
242.9648 +"changesets, and it will take only about an hour (roughly seven tests)."
242.9649 +msgstr ""
242.9650 +
242.9651 +#. type: Content of: <book><chapter><sect1><para>
242.9652 +#: ../en/ch08-undo.xml:766
242.9653 +msgid ""
242.9654 +"The <command role=\"hg-cmd\">hg bisect</command> command is aware of the "
242.9655 +"<quote>branchy</quote> nature of a Mercurial project's revision history, so "
242.9656 +"it has no problems dealing with branches, merges, or multiple heads in a "
242.9657 +"repository.  It can prune entire branches of history with a single probe, "
242.9658 +"which is how it operates so efficiently."
242.9659 +msgstr ""
242.9660 +
242.9661 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.9662 +#: ../en/ch08-undo.xml:774
242.9663 +msgid "Using the <command role=\"hg-cmd\">hg bisect</command> command"
242.9664 +msgstr "使用命令 <command role=\"hg-cmd\">hg bisect</command>"
242.9665 +
242.9666 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9667 +#: ../en/ch08-undo.xml:777
242.9668 +msgid ""
242.9669 +"Here's an example of <command role=\"hg-cmd\">hg bisect</command> in action."
242.9670 +msgstr ""
242.9671 +
242.9672 +#. type: Content of: <book><chapter><sect1><sect2><note><para>
242.9673 +#: ../en/ch08-undo.xml:781
242.9674 +msgid ""
242.9675 +"In versions 0.9.5 and earlier of Mercurial, <command role=\"hg-cmd\">hg "
242.9676 +"bisect</command> was not a core command: it was distributed with Mercurial as "
242.9677 +"an extension. This section describes the built-in command, not the old "
242.9678 +"extension."
242.9679 +msgstr ""
242.9680 +
242.9681 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9682 +#: ../en/ch08-undo.xml:788
242.9683 +msgid ""
242.9684 +"Now let's create a repository, so that we can try out the <command role=\"hg-"
242.9685 +"cmd\">hg bisect</command> command in isolation."
242.9686 +msgstr ""
242.9687 +
242.9688 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9689 +#: ../en/ch08-undo.xml:794
242.9690 +msgid ""
242.9691 +"We'll simulate a project that has a bug in it in a simple-minded way: create "
242.9692 +"trivial changes in a loop, and nominate one specific change that will have "
242.9693 +"the <quote>bug</quote>.  This loop creates 35 changesets, each adding a "
242.9694 +"single file to the repository. We'll represent our <quote>bug</quote> with a "
242.9695 +"file that contains the text <quote>i have a gub</quote>."
242.9696 +msgstr ""
242.9697 +
242.9698 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9699 +#: ../en/ch08-undo.xml:804
242.9700 +msgid ""
242.9701 +"The next thing that we'd like to do is figure out how to use the <command "
242.9702 +"role=\"hg-cmd\">hg bisect</command> command.  We can use Mercurial's normal "
242.9703 +"built-in help mechanism for this."
242.9704 +msgstr ""
242.9705 +
242.9706 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9707 +#: ../en/ch08-undo.xml:811
242.9708 +msgid ""
242.9709 +"The <command role=\"hg-cmd\">hg bisect</command> command works in steps.  "
242.9710 +"Each step proceeds as follows."
242.9711 +msgstr ""
242.9712 +
242.9713 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.9714 +#: ../en/ch08-undo.xml:814
242.9715 +msgid "You run your binary test."
242.9716 +msgstr ""
242.9717 +
242.9718 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><itemizedlist><listitem><para>
242.9719 +#: ../en/ch08-undo.xml:816
242.9720 +msgid ""
242.9721 +"If the test succeeded, you tell <command role=\"hg-cmd\">hg bisect</command> "
242.9722 +"by running the <command role=\"hg-cmd\">hg bisect good</command> command."
242.9723 +msgstr ""
242.9724 +
242.9725 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><itemizedlist><listitem><para>
242.9726 +#: ../en/ch08-undo.xml:821
242.9727 +msgid ""
242.9728 +"If it failed, run the <command role=\"hg-cmd\">hg bisect bad</command> "
242.9729 +"command."
242.9730 +msgstr ""
242.9731 +
242.9732 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.9733 +#: ../en/ch08-undo.xml:825
242.9734 +msgid ""
242.9735 +"The command uses your information to decide which changeset to test next."
242.9736 +msgstr ""
242.9737 +
242.9738 +#. type: Content of: <book><chapter><sect1><sect2><orderedlist><listitem><para>
242.9739 +#: ../en/ch08-undo.xml:828
242.9740 +msgid ""
242.9741 +"It updates the working directory to that changeset, and the process begins "
242.9742 +"again."
242.9743 +msgstr ""
242.9744 +
242.9745 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9746 +#: ../en/ch08-undo.xml:831
242.9747 +msgid ""
242.9748 +"The process ends when <command role=\"hg-cmd\">hg bisect</command> identifies "
242.9749 +"a unique changeset that marks the point where your test transitioned from "
242.9750 +"<quote>succeeding</quote> to <quote>failing</quote>."
242.9751 +msgstr ""
242.9752 +
242.9753 +#
242.9754 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9755 +#: ../en/ch08-undo.xml:836
242.9756 +msgid ""
242.9757 +"To start the search, we must run the <command role=\"hg-cmd\">hg bisect --"
242.9758 +"reset</command> command."
242.9759 +msgstr ""
242.9760 +
242.9761 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9762 +#: ../en/ch08-undo.xml:841
242.9763 +msgid ""
242.9764 +"In our case, the binary test we use is simple: we check to see if any file in "
242.9765 +"the repository contains the string <quote>i have a gub</quote>.  If it does, "
242.9766 +"this changeset contains the change that <quote>caused the bug</quote>.  By "
242.9767 +"convention, a changeset that has the property we're searching for is "
242.9768 +"<quote>bad</quote>, while one that doesn't is <quote>good</quote>."
242.9769 +msgstr ""
242.9770 +
242.9771 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9772 +#: ../en/ch08-undo.xml:849
242.9773 +msgid ""
242.9774 +"Most of the time, the revision to which the working directory is synced "
242.9775 +"(usually the tip) already exhibits the problem introduced by the buggy "
242.9776 +"change, so we'll mark it as <quote>bad</quote>."
242.9777 +msgstr ""
242.9778 +
242.9779 +#
242.9780 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9781 +#: ../en/ch08-undo.xml:856
242.9782 +msgid ""
242.9783 +"Our next task is to nominate a changeset that we know <emphasis>doesn't</"
242.9784 +"emphasis> have the bug; the <command role=\"hg-cmd\">hg bisect</command> "
242.9785 +"command will <quote>bracket</quote> its search between the first pair of good "
242.9786 +"and bad changesets.  In our case, we know that revision 10 didn't have the "
242.9787 +"bug.  (I'll have more words about choosing the first <quote>good</quote> "
242.9788 +"changeset later.)"
242.9789 +msgstr ""
242.9790 +
242.9791 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9792 +#: ../en/ch08-undo.xml:866
242.9793 +msgid "Notice that this command printed some output."
242.9794 +msgstr ""
242.9795 +
242.9796 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.9797 +#: ../en/ch08-undo.xml:868
242.9798 +msgid ""
242.9799 +"It told us how many changesets it must consider before it can identify the "
242.9800 +"one that introduced the bug, and how many tests that will require."
242.9801 +msgstr ""
242.9802 +
242.9803 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.9804 +#: ../en/ch08-undo.xml:872
242.9805 +msgid ""
242.9806 +"It updated the working directory to the next changeset to test, and told us "
242.9807 +"which changeset it's testing."
242.9808 +msgstr ""
242.9809 +
242.9810 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9811 +#: ../en/ch08-undo.xml:877
242.9812 +msgid ""
242.9813 +"We now run our test in the working directory.  We use the <command>grep</"
242.9814 +"command> command to see if our <quote>bad</quote> file is present in the "
242.9815 +"working directory.  If it is, this revision is bad; if not, this revision is "
242.9816 +"good.  &interaction.bisect.search.step1;"
242.9817 +msgstr ""
242.9818 +
242.9819 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9820 +#: ../en/ch08-undo.xml:883
242.9821 +msgid ""
242.9822 +"This test looks like a perfect candidate for automation, so let's turn it "
242.9823 +"into a shell function."
242.9824 +msgstr ""
242.9825 +
242.9826 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9827 +#: ../en/ch08-undo.xml:887
242.9828 +msgid ""
242.9829 +"We can now run an entire test step with a single command, <literal>mytest</"
242.9830 +"literal>."
242.9831 +msgstr ""
242.9832 +
242.9833 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9834 +#: ../en/ch08-undo.xml:892
242.9835 +msgid "A few more invocations of our canned test step command, and we're done."
242.9836 +msgstr ""
242.9837 +
242.9838 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9839 +#: ../en/ch08-undo.xml:897
242.9840 +msgid ""
242.9841 +"Even though we had 40 changesets to search through, the <command role=\"hg-cmd"
242.9842 +"\">hg bisect</command> command let us find the changeset that introduced our "
242.9843 +"<quote>bug</quote> with only five tests.  Because the number of tests that "
242.9844 +"the <command role=\"hg-cmd\">hg bisect</command> command performs grows "
242.9845 +"logarithmically with the number of changesets to search, the advantage that "
242.9846 +"it has over the <quote>brute force</quote> search approach increases with "
242.9847 +"every changeset you add."
242.9848 +msgstr ""
242.9849 +
242.9850 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.9851 +#: ../en/ch08-undo.xml:908
242.9852 +msgid "Cleaning up after your search"
242.9853 +msgstr "搜索后的清理"
242.9854 +
242.9855 +#
242.9856 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9857 +#: ../en/ch08-undo.xml:910
242.9858 +msgid ""
242.9859 +"When you're finished using the <command role=\"hg-cmd\">hg bisect</command> "
242.9860 +"command in a repository, you can use the <command role=\"hg-cmd\">hg bisect "
242.9861 +"reset</command> command to drop the information it was using to drive your "
242.9862 +"search.  The command doesn't use much space, so it doesn't matter if you "
242.9863 +"forget to run this command.  However, <command role=\"hg-cmd\">hg bisect</"
242.9864 +"command> won't let you start a new search in that repository until you do a "
242.9865 +"<command role=\"hg-cmd\">hg bisect reset</command>."
242.9866 +msgstr ""
242.9867 +
242.9868 +#. type: Content of: <book><chapter><sect1><title>
242.9869 +#: ../en/ch08-undo.xml:925
242.9870 +msgid "Tips for finding bugs effectively"
242.9871 +msgstr "有效查找问题的技巧"
242.9872 +
242.9873 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.9874 +#: ../en/ch08-undo.xml:928
242.9875 +msgid "Give consistent input"
242.9876 +msgstr "给出一致的输入"
242.9877 +
242.9878 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9879 +#: ../en/ch08-undo.xml:930
242.9880 +msgid ""
242.9881 +"The <command role=\"hg-cmd\">hg bisect</command> command requires that you "
242.9882 +"correctly report the result of every test you perform.  If you tell it that a "
242.9883 +"test failed when it really succeeded, it <emphasis>might</emphasis> be able "
242.9884 +"to detect the inconsistency.  If it can identify an inconsistency in your "
242.9885 +"reports, it will tell you that a particular changeset is both good and bad. "
242.9886 +"However, it can't do this perfectly; it's about as likely to report the wrong "
242.9887 +"changeset as the source of the bug."
242.9888 +msgstr ""
242.9889 +
242.9890 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.9891 +#: ../en/ch08-undo.xml:942
242.9892 +msgid "Automate as much as possible"
242.9893 +msgstr "尽量自动"
242.9894 +
242.9895 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9896 +#: ../en/ch08-undo.xml:944
242.9897 +msgid ""
242.9898 +"When I started using the <command role=\"hg-cmd\">hg bisect</command> "
242.9899 +"command, I tried a few times to run my tests by hand, on the command line.  "
242.9900 +"This is an approach that I, at least, am not suited to.  After a few tries, I "
242.9901 +"found that I was making enough mistakes that I was having to restart my "
242.9902 +"searches several times before finally getting correct results."
242.9903 +msgstr ""
242.9904 +
242.9905 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9906 +#: ../en/ch08-undo.xml:952
242.9907 +msgid ""
242.9908 +"My initial problems with driving the <command role=\"hg-cmd\">hg bisect</"
242.9909 +"command> command by hand occurred even with simple searches on small "
242.9910 +"repositories; if the problem you're looking for is more subtle, or the number "
242.9911 +"of tests that <command role=\"hg-cmd\">hg bisect</command> must perform "
242.9912 +"increases, the likelihood of operator error ruining the search is much "
242.9913 +"higher.  Once I started automating my tests, I had much better results."
242.9914 +msgstr ""
242.9915 +
242.9916 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9917 +#: ../en/ch08-undo.xml:961
242.9918 +msgid "The key to automated testing is twofold:"
242.9919 +msgstr ""
242.9920 +
242.9921 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.9922 +#: ../en/ch08-undo.xml:963
242.9923 +msgid "always test for the same symptom, and"
242.9924 +msgstr ""
242.9925 +
242.9926 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.9927 +#: ../en/ch08-undo.xml:965
242.9928 +msgid ""
242.9929 +"always feed consistent input to the <command role=\"hg-cmd\">hg bisect</"
242.9930 +"command> command."
242.9931 +msgstr ""
242.9932 +
242.9933 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9934 +#: ../en/ch08-undo.xml:968
242.9935 +msgid ""
242.9936 +"In my tutorial example above, the <command>grep</command> command tests for "
242.9937 +"the symptom, and the <literal>if</literal> statement takes the result of this "
242.9938 +"check and ensures that we always feed the same input to the <command role="
242.9939 +"\"hg-cmd\">hg bisect</command> command.  The <literal>mytest</literal> "
242.9940 +"function marries these together in a reproducible way, so that every test is "
242.9941 +"uniform and consistent."
242.9942 +msgstr ""
242.9943 +
242.9944 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.9945 +#: ../en/ch08-undo.xml:978
242.9946 +msgid "Check your results"
242.9947 +msgstr "检查你的结果"
242.9948 +
242.9949 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9950 +#: ../en/ch08-undo.xml:980
242.9951 +msgid ""
242.9952 +"Because the output of a <command role=\"hg-cmd\">hg bisect</command> search "
242.9953 +"is only as good as the input you give it, don't take the changeset it reports "
242.9954 +"as the absolute truth.  A simple way to cross-check its report is to manually "
242.9955 +"run your test at each of the following changesets:"
242.9956 +msgstr ""
242.9957 +
242.9958 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.9959 +#: ../en/ch08-undo.xml:986
242.9960 +msgid ""
242.9961 +"The changeset that it reports as the first bad revision.  Your test should "
242.9962 +"still report this as bad."
242.9963 +msgstr ""
242.9964 +
242.9965 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.9966 +#: ../en/ch08-undo.xml:990
242.9967 +msgid ""
242.9968 +"The parent of that changeset (either parent, if it's a merge). Your test "
242.9969 +"should report this changeset as good."
242.9970 +msgstr ""
242.9971 +
242.9972 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.9973 +#: ../en/ch08-undo.xml:994
242.9974 +msgid ""
242.9975 +"A child of that changeset.  Your test should report this changeset as bad."
242.9976 +msgstr ""
242.9977 +
242.9978 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.9979 +#: ../en/ch08-undo.xml:1000
242.9980 +msgid "Beware interference between bugs"
242.9981 +msgstr "谨防问题之间的冲突"
242.9982 +
242.9983 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9984 +#: ../en/ch08-undo.xml:1002
242.9985 +msgid ""
242.9986 +"It's possible that your search for one bug could be disrupted by the presence "
242.9987 +"of another.  For example, let's say your software crashes at revision 100, "
242.9988 +"and worked correctly at revision 50.  Unknown to you, someone else introduced "
242.9989 +"a different crashing bug at revision 60, and fixed it at revision 80.  This "
242.9990 +"could distort your results in one of several ways."
242.9991 +msgstr ""
242.9992 +
242.9993 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.9994 +#: ../en/ch08-undo.xml:1010
242.9995 +msgid ""
242.9996 +"It is possible that this other bug completely <quote>masks</quote> yours, "
242.9997 +"which is to say that it occurs before your bug has a chance to manifest "
242.9998 +"itself.  If you can't avoid that other bug (for example, it prevents your "
242.9999 +"project from building), and so can't tell whether your bug is present in a "
242.10000 +"particular changeset, the <command role=\"hg-cmd\">hg bisect</command> "
242.10001 +"command cannot help you directly.  Instead, you can mark a changeset as "
242.10002 +"untested by running <command role=\"hg-cmd\">hg bisect --skip</command>."
242.10003 +msgstr ""
242.10004 +
242.10005 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10006 +#: ../en/ch08-undo.xml:1020
242.10007 +msgid ""
242.10008 +"A different problem could arise if your test for a bug's presence is not "
242.10009 +"specific enough.  If you check for <quote>my program crashes</quote>, then "
242.10010 +"both your crashing bug and an unrelated crashing bug that masks it will look "
242.10011 +"like the same thing, and mislead <command role=\"hg-cmd\">hg bisect</command>."
242.10012 +msgstr ""
242.10013 +
242.10014 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10015 +#: ../en/ch08-undo.xml:1027
242.10016 +msgid ""
242.10017 +"Another useful situation in which to use <command role=\"hg-cmd\">hg bisect --"
242.10018 +"skip</command> is if you can't test a revision because your project was in a "
242.10019 +"broken and hence untestable state at that revision, perhaps because someone "
242.10020 +"checked in a change that prevented the project from building."
242.10021 +msgstr ""
242.10022 +
242.10023 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.10024 +#: ../en/ch08-undo.xml:1036
242.10025 +msgid "Bracket your search lazily"
242.10026 +msgstr "减少你的查找工作"
242.10027 +
242.10028 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10029 +#: ../en/ch08-undo.xml:1038
242.10030 +msgid ""
242.10031 +"Choosing the first <quote>good</quote> and <quote>bad</quote> changesets that "
242.10032 +"will mark the end points of your search is often easy, but it bears a little "
242.10033 +"discussion nevertheless.  From the perspective of <command role=\"hg-cmd\">hg "
242.10034 +"bisect</command>, the <quote>newest</quote> changeset is conventionally "
242.10035 +"<quote>bad</quote>, and the older changeset is <quote>good</quote>."
242.10036 +msgstr ""
242.10037 +
242.10038 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10039 +#: ../en/ch08-undo.xml:1046
242.10040 +msgid ""
242.10041 +"If you're having trouble remembering when a suitable <quote>good</quote> "
242.10042 +"change was, so that you can tell <command role=\"hg-cmd\">hg bisect</"
242.10043 +"command>, you could do worse than testing changesets at random.  Just "
242.10044 +"remember to eliminate contenders that can't possibly exhibit the bug (perhaps "
242.10045 +"because the feature with the bug isn't present yet) and those where another "
242.10046 +"problem masks the bug (as I discussed above)."
242.10047 +msgstr ""
242.10048 +
242.10049 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10050 +#: ../en/ch08-undo.xml:1055
242.10051 +msgid ""
242.10052 +"Even if you end up <quote>early</quote> by thousands of changesets or months "
242.10053 +"of history, you will only add a handful of tests to the total number that "
242.10054 +"<command role=\"hg-cmd\">hg bisect</command> must perform, thanks to its "
242.10055 +"logarithmic behaviour."
242.10056 +msgstr ""
242.10057 +
242.10058 +#. type: Content of: <book><chapter><title>
242.10059 +#: ../en/ch09-hook.xml:5
242.10060 +msgid "Handling repository events with hooks"
242.10061 +msgstr "使用钩子处理版本库事件"
242.10062 +
242.10063 +#. type: Content of: <book><chapter><para>
242.10064 +#: ../en/ch09-hook.xml:7
242.10065 +msgid ""
242.10066 +"Mercurial offers a powerful mechanism to let you perform automated actions in "
242.10067 +"response to events that occur in a repository.  In some cases, you can even "
242.10068 +"control Mercurial's response to those events."
242.10069 +msgstr ""
242.10070 +
242.10071 +#. type: Content of: <book><chapter><para>
242.10072 +#: ../en/ch09-hook.xml:12
242.10073 +msgid ""
242.10074 +"The name Mercurial uses for one of these actions is a <emphasis>hook</"
242.10075 +"emphasis>. Hooks are called <quote>triggers</quote> in some revision control "
242.10076 +"systems, but the two names refer to the same idea."
242.10077 +msgstr ""
242.10078 +
242.10079 +#. type: Content of: <book><chapter><sect1><title>
242.10080 +#: ../en/ch09-hook.xml:18
242.10081 +msgid "An overview of hooks in Mercurial"
242.10082 +msgstr "Mercurial 钩子概述"
242.10083 +
242.10084 +#. type: Content of: <book><chapter><sect1><para>
242.10085 +#: ../en/ch09-hook.xml:20
242.10086 +msgid ""
242.10087 +"Here is a brief list of the hooks that Mercurial supports. We will revisit "
242.10088 +"each of these hooks in more detail later, in <xref linkend=\"sec:hook:ref\"/>."
242.10089 +msgstr ""
242.10090 +
242.10091 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.10092 +#: ../en/ch09-hook.xml:25
242.10093 +msgid ""
242.10094 +"<literal role=\"hook\">changegroup</literal>: This is run after a group of "
242.10095 +"changesets has been brought into the repository from elsewhere."
242.10096 +msgstr ""
242.10097 +
242.10098 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.10099 +#: ../en/ch09-hook.xml:29
242.10100 +msgid ""
242.10101 +"<literal role=\"hook\">commit</literal>: This is run after a new changeset "
242.10102 +"has been created in the local repository."
242.10103 +msgstr ""
242.10104 +
242.10105 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.10106 +#: ../en/ch09-hook.xml:33
242.10107 +msgid ""
242.10108 +"<literal role=\"hook\">incoming</literal>: This is run once for each new "
242.10109 +"changeset that is brought into the repository from elsewhere.  Notice the "
242.10110 +"difference from <literal role=\"hook\">changegroup</literal>, which is run "
242.10111 +"once per <emphasis>group</emphasis> of changesets brought in."
242.10112 +msgstr ""
242.10113 +
242.10114 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.10115 +#: ../en/ch09-hook.xml:40
242.10116 +msgid ""
242.10117 +"<literal role=\"hook\">outgoing</literal>: This is run after a group of "
242.10118 +"changesets has been transmitted from this repository."
242.10119 +msgstr ""
242.10120 +
242.10121 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.10122 +#: ../en/ch09-hook.xml:44
242.10123 +msgid ""
242.10124 +"<literal role=\"hook\">prechangegroup</literal>: This is run before starting "
242.10125 +"to bring a group of changesets into the repository."
242.10126 +msgstr ""
242.10127 +
242.10128 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.10129 +#: ../en/ch09-hook.xml:49
242.10130 +msgid ""
242.10131 +"<literal role=\"hook\">precommit</literal>: Controlling. This is run before "
242.10132 +"starting a commit."
242.10133 +msgstr ""
242.10134 +
242.10135 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.10136 +#: ../en/ch09-hook.xml:53
242.10137 +msgid ""
242.10138 +"<literal role=\"hook\">preoutgoing</literal>: Controlling. This is run before "
242.10139 +"starting to transmit a group of changesets from this repository."
242.10140 +msgstr ""
242.10141 +
242.10142 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.10143 +#: ../en/ch09-hook.xml:58
242.10144 +msgid ""
242.10145 +"<literal role=\"hook\">pretag</literal>: Controlling. This is run before "
242.10146 +"creating a tag."
242.10147 +msgstr ""
242.10148 +
242.10149 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.10150 +#: ../en/ch09-hook.xml:62
242.10151 +msgid ""
242.10152 +"<literal role=\"hook\">pretxnchangegroup</literal>: Controlling. This is run "
242.10153 +"after a group of changesets has been brought into the local repository from "
242.10154 +"another, but before the transaction completes that will make the changes "
242.10155 +"permanent in the repository."
242.10156 +msgstr ""
242.10157 +
242.10158 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.10159 +#: ../en/ch09-hook.xml:70
242.10160 +msgid ""
242.10161 +"<literal role=\"hook\">pretxncommit</literal>: Controlling. This is run after "
242.10162 +"a new changeset has been created in the local repository, but before the "
242.10163 +"transaction completes that will make it permanent."
242.10164 +msgstr ""
242.10165 +
242.10166 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.10167 +#: ../en/ch09-hook.xml:76
242.10168 +msgid ""
242.10169 +"<literal role=\"hook\">preupdate</literal>: Controlling. This is run before "
242.10170 +"starting an update or merge of the working directory."
242.10171 +msgstr ""
242.10172 +
242.10173 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.10174 +#: ../en/ch09-hook.xml:81
242.10175 +msgid ""
242.10176 +"<literal role=\"hook\">tag</literal>: This is run after a tag is created."
242.10177 +msgstr ""
242.10178 +
242.10179 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.10180 +#: ../en/ch09-hook.xml:85
242.10181 +msgid ""
242.10182 +"<literal role=\"hook\">update</literal>: This is run after an update or merge "
242.10183 +"of the working directory has finished."
242.10184 +msgstr ""
242.10185 +
242.10186 +#. type: Content of: <book><chapter><sect1><para>
242.10187 +#: ../en/ch09-hook.xml:90
242.10188 +msgid ""
242.10189 +"Each of the hooks whose description begins with the word <quote>Controlling</"
242.10190 +"quote> has the ability to determine whether an activity can proceed.  If the "
242.10191 +"hook succeeds, the activity may proceed; if it fails, the activity is either "
242.10192 +"not permitted or undone, depending on the hook."
242.10193 +msgstr ""
242.10194 +
242.10195 +#. type: Content of: <book><chapter><sect1><title>
242.10196 +#: ../en/ch09-hook.xml:99
242.10197 +msgid "Hooks and security"
242.10198 +msgstr "钩子与安全性"
242.10199 +
242.10200 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.10201 +#: ../en/ch09-hook.xml:102
242.10202 +msgid "Hooks are run with your privileges"
242.10203 +msgstr "钩子以你的特权执行"
242.10204 +
242.10205 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10206 +#: ../en/ch09-hook.xml:104
242.10207 +msgid ""
242.10208 +"When you run a Mercurial command in a repository, and the command causes a "
242.10209 +"hook to run, that hook runs on <emphasis>your</emphasis> system, under "
242.10210 +"<emphasis>your</emphasis> user account, with <emphasis>your</emphasis> "
242.10211 +"privilege level.  Since hooks are arbitrary pieces of executable code, you "
242.10212 +"should treat them with an appropriate level of suspicion.  Do not install a "
242.10213 +"hook unless you are confident that you know who created it and what it does."
242.10214 +msgstr ""
242.10215 +
242.10216 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10217 +#: ../en/ch09-hook.xml:115
242.10218 +msgid ""
242.10219 +"In some cases, you may be exposed to hooks that you did not install "
242.10220 +"yourself.  If you work with Mercurial on an unfamiliar system, Mercurial will "
242.10221 +"run hooks defined in that system's global <filename role=\"special\">~/.hgrc</"
242.10222 +"filename> file."
242.10223 +msgstr ""
242.10224 +
242.10225 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10226 +#: ../en/ch09-hook.xml:122
242.10227 +msgid ""
242.10228 +"If you are working with a repository owned by another user, Mercurial can run "
242.10229 +"hooks defined in that user's repository, but it will still run them as "
242.10230 +"<quote>you</quote>.  For example, if you <command role=\"hg-cmd\">hg pull</"
242.10231 +"command> from that repository, and its <filename role=\"special\">.hg/hgrc</"
242.10232 +"filename> defines a local <literal role=\"hook\">outgoing</literal> hook, "
242.10233 +"that hook will run under your user account, even though you don't own that "
242.10234 +"repository."
242.10235 +msgstr ""
242.10236 +
242.10237 +#. type: Content of: <book><chapter><sect1><sect2><note><para>
242.10238 +#: ../en/ch09-hook.xml:134
242.10239 +msgid ""
242.10240 +"This only applies if you are pulling from a repository on a local or network "
242.10241 +"filesystem.  If you're pulling over http or ssh, any <literal role=\"hook"
242.10242 +"\">outgoing</literal> hook will run under whatever account is executing the "
242.10243 +"server process, on the server."
242.10244 +msgstr ""
242.10245 +
242.10246 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10247 +#: ../en/ch09-hook.xml:142
242.10248 +msgid ""
242.10249 +"XXX To see what hooks are defined in a repository, use the <command role=\"hg-"
242.10250 +"cmd\">hg config hooks</command> command.  If you are working in one "
242.10251 +"repository, but talking to another that you do not own (e.g. using <command "
242.10252 +"role=\"hg-cmd\">hg pull</command> or <command role=\"hg-cmd\">hg incoming</"
242.10253 +"command>), remember that it is the other repository's hooks you should be "
242.10254 +"checking, not your own."
242.10255 +msgstr ""
242.10256 +
242.10257 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.10258 +#: ../en/ch09-hook.xml:153
242.10259 +msgid "Hooks do not propagate"
242.10260 +msgstr "钩子不会传播"
242.10261 +
242.10262 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10263 +#: ../en/ch09-hook.xml:155
242.10264 +msgid ""
242.10265 +"In Mercurial, hooks are not revision controlled, and do not propagate when "
242.10266 +"you clone, or pull from, a repository.  The reason for this is simple: a hook "
242.10267 +"is a completely arbitrary piece of executable code.  It runs under your user "
242.10268 +"identity, with your privilege level, on your machine."
242.10269 +msgstr ""
242.10270 +
242.10271 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10272 +#: ../en/ch09-hook.xml:162
242.10273 +msgid ""
242.10274 +"It would be extremely reckless for any distributed revision control system to "
242.10275 +"implement revision-controlled hooks, as this would offer an easily "
242.10276 +"exploitable way to subvert the accounts of users of the revision control "
242.10277 +"system."
242.10278 +msgstr ""
242.10279 +
242.10280 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10281 +#: ../en/ch09-hook.xml:168
242.10282 +msgid ""
242.10283 +"Since Mercurial does not propagate hooks, if you are collaborating with other "
242.10284 +"people on a common project, you should not assume that they are using the "
242.10285 +"same Mercurial hooks as you are, or that theirs are correctly configured.  "
242.10286 +"You should document the hooks you expect people to use."
242.10287 +msgstr ""
242.10288 +
242.10289 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10290 +#: ../en/ch09-hook.xml:175
242.10291 +msgid ""
242.10292 +"In a corporate intranet, this is somewhat easier to control, as you can for "
242.10293 +"example provide a <quote>standard</quote> installation of Mercurial on an NFS "
242.10294 +"filesystem, and use a site-wide <filename role=\"special\">~/.hgrc</filename> "
242.10295 +"file to define hooks that all users will see.  However, this too has its "
242.10296 +"limits; see below."
242.10297 +msgstr ""
242.10298 +
242.10299 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.10300 +#: ../en/ch09-hook.xml:184
242.10301 +msgid "Hooks can be overridden"
242.10302 +msgstr "钩子可以被覆盖"
242.10303 +
242.10304 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10305 +#: ../en/ch09-hook.xml:186
242.10306 +msgid ""
242.10307 +"Mercurial allows you to override a hook definition by redefining the hook.  "
242.10308 +"You can disable it by setting its value to the empty string, or change its "
242.10309 +"behaviour as you wish."
242.10310 +msgstr ""
242.10311 +
242.10312 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10313 +#: ../en/ch09-hook.xml:191
242.10314 +msgid ""
242.10315 +"If you deploy a system- or site-wide <filename role=\"special\">~/.hgrc</"
242.10316 +"filename> file that defines some hooks, you should thus understand that your "
242.10317 +"users can disable or override those hooks."
242.10318 +msgstr ""
242.10319 +
242.10320 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.10321 +#: ../en/ch09-hook.xml:199
242.10322 +msgid "Ensuring that critical hooks are run"
242.10323 +msgstr "确保关键钩子的执行"
242.10324 +
242.10325 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10326 +#: ../en/ch09-hook.xml:201
242.10327 +msgid ""
242.10328 +"Sometimes you may want to enforce a policy that you do not want others to be "
242.10329 +"able to work around.  For example, you may have a requirement that every "
242.10330 +"changeset must pass a rigorous set of tests.  Defining this requirement via a "
242.10331 +"hook in a site-wide <filename role=\"special\">~/.hgrc</filename> won't work "
242.10332 +"for remote users on laptops, and of course local users can subvert it at will "
242.10333 +"by overriding the hook."
242.10334 +msgstr ""
242.10335 +
242.10336 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10337 +#: ../en/ch09-hook.xml:210
242.10338 +msgid ""
242.10339 +"Instead, you can set up your policies for use of Mercurial so that people are "
242.10340 +"expected to propagate changes through a well-known <quote>canonical</quote> "
242.10341 +"server that you have locked down and configured appropriately."
242.10342 +msgstr ""
242.10343 +
242.10344 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10345 +#: ../en/ch09-hook.xml:216
242.10346 +msgid ""
242.10347 +"One way to do this is via a combination of social engineering and "
242.10348 +"technology.  Set up a restricted-access account; users can push changes over "
242.10349 +"the network to repositories managed by this account, but they cannot log into "
242.10350 +"the account and run normal shell commands.  In this scenario, a user can "
242.10351 +"commit a changeset that contains any old garbage they want."
242.10352 +msgstr ""
242.10353 +
242.10354 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10355 +#: ../en/ch09-hook.xml:225
242.10356 +msgid ""
242.10357 +"When someone pushes a changeset to the server that everyone pulls from, the "
242.10358 +"server will test the changeset before it accepts it as permanent, and reject "
242.10359 +"it if it fails to pass the test suite.  If people only pull changes from this "
242.10360 +"filtering server, it will serve to ensure that all changes that people pull "
242.10361 +"have been automatically vetted."
242.10362 +msgstr ""
242.10363 +
242.10364 +#. type: Content of: <book><chapter><sect1><title>
242.10365 +#: ../en/ch09-hook.xml:236
242.10366 +msgid "Care with <literal>pretxn</literal> hooks in a shared-access repository"
242.10367 +msgstr "在共享版本库中注意 <literal>pretxn</literal> 钩子"
242.10368 +
242.10369 +#. type: Content of: <book><chapter><sect1><para>
242.10370 +#: ../en/ch09-hook.xml:239
242.10371 +msgid ""
242.10372 +"If you want to use hooks to do some automated work in a repository that a "
242.10373 +"number of people have shared access to, you need to be careful in how you do "
242.10374 +"this."
242.10375 +msgstr ""
242.10376 +
242.10377 +#. type: Content of: <book><chapter><sect1><para>
242.10378 +#: ../en/ch09-hook.xml:244
242.10379 +msgid ""
242.10380 +"Mercurial only locks a repository when it is writing to the repository, and "
242.10381 +"only the parts of Mercurial that write to the repository pay attention to "
242.10382 +"locks.  Write locks are necessary to prevent multiple simultaneous writers "
242.10383 +"from scribbling on each other's work, corrupting the repository."
242.10384 +msgstr ""
242.10385 +
242.10386 +#. type: Content of: <book><chapter><sect1><para>
242.10387 +#: ../en/ch09-hook.xml:251
242.10388 +msgid ""
242.10389 +"Because Mercurial is careful with the order in which it reads and writes "
242.10390 +"data, it does not need to acquire a lock when it wants to read data from the "
242.10391 +"repository.  The parts of Mercurial that read from the repository never pay "
242.10392 +"attention to locks.  This lockless reading scheme greatly increases "
242.10393 +"performance and concurrency."
242.10394 +msgstr ""
242.10395 +
242.10396 +#. type: Content of: <book><chapter><sect1><para>
242.10397 +#: ../en/ch09-hook.xml:259
242.10398 +msgid ""
242.10399 +"With great performance comes a trade-off, though, one which has the potential "
242.10400 +"to cause you trouble unless you're aware of it.  To describe this requires a "
242.10401 +"little detail about how Mercurial adds changesets to a repository and reads "
242.10402 +"those changes."
242.10403 +msgstr ""
242.10404 +
242.10405 +#. type: Content of: <book><chapter><sect1><para>
242.10406 +#: ../en/ch09-hook.xml:266
242.10407 +msgid ""
242.10408 +"When Mercurial <emphasis>writes</emphasis> metadata, it writes it straight "
242.10409 +"into the destination file.  It writes file data first, then manifest data "
242.10410 +"(which contains pointers to the new file data), then changelog data (which "
242.10411 +"contains pointers to the new manifest data).  Before the first write to each "
242.10412 +"file, it stores a record of where the end of the file was in its transaction "
242.10413 +"log.  If the transaction must be rolled back, Mercurial simply truncates each "
242.10414 +"file back to the size it was before the transaction began."
242.10415 +msgstr ""
242.10416 +
242.10417 +#. type: Content of: <book><chapter><sect1><para>
242.10418 +#: ../en/ch09-hook.xml:277
242.10419 +msgid ""
242.10420 +"When Mercurial <emphasis>reads</emphasis> metadata, it reads the changelog "
242.10421 +"first, then everything else.  Since a reader will only access parts of the "
242.10422 +"manifest or file metadata that it can see in the changelog, it can never see "
242.10423 +"partially written data."
242.10424 +msgstr ""
242.10425 +
242.10426 +#. type: Content of: <book><chapter><sect1><para>
242.10427 +#: ../en/ch09-hook.xml:283
242.10428 +msgid ""
242.10429 +"Some controlling hooks (<literal role=\"hook\">pretxncommit</literal> and "
242.10430 +"<literal role=\"hook\">pretxnchangegroup</literal>) run when a transaction is "
242.10431 +"almost complete. All of the metadata has been written, but Mercurial can "
242.10432 +"still roll the transaction back and cause the newly-written data to disappear."
242.10433 +msgstr ""
242.10434 +
242.10435 +#. type: Content of: <book><chapter><sect1><para>
242.10436 +#: ../en/ch09-hook.xml:291
242.10437 +msgid ""
242.10438 +"If one of these hooks runs for long, it opens a window of time during which a "
242.10439 +"reader can see the metadata for changesets that are not yet permanent, and "
242.10440 +"should not be thought of as <quote>really there</quote>.  The longer the hook "
242.10441 +"runs, the longer that window is open."
242.10442 +msgstr ""
242.10443 +
242.10444 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.10445 +#: ../en/ch09-hook.xml:299
242.10446 +msgid "The problem illustrated"
242.10447 +msgstr "问题的演示"
242.10448 +
242.10449 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10450 +#: ../en/ch09-hook.xml:301
242.10451 +msgid ""
242.10452 +"In principle, a good use for the <literal role=\"hook\">pretxnchangegroup</"
242.10453 +"literal> hook would be to automatically build and test incoming changes "
242.10454 +"before they are accepted into a central repository.  This could let you "
242.10455 +"guarantee that nobody can push changes to this repository that <quote>break "
242.10456 +"the build</quote>. But if a client can pull changes while they're being "
242.10457 +"tested, the usefulness of the test is zero; an unsuspecting someone can pull "
242.10458 +"untested changes, potentially breaking their build."
242.10459 +msgstr ""
242.10460 +
242.10461 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10462 +#: ../en/ch09-hook.xml:312
242.10463 +msgid ""
242.10464 +"The safest technological answer to this challenge is to set up such a "
242.10465 +"<quote>gatekeeper</quote> repository as <emphasis>unidirectional</emphasis>.  "
242.10466 +"Let it take changes pushed in from the outside, but do not allow anyone to "
242.10467 +"pull changes from it (use the <literal role=\"hook\">preoutgoing</literal> "
242.10468 +"hook to lock it down).  Configure a <literal role=\"hook\">changegroup</"
242.10469 +"literal> hook so that if a build or test succeeds, the hook will push the new "
242.10470 +"changes out to another repository that people <emphasis>can</emphasis> pull "
242.10471 +"from."
242.10472 +msgstr ""
242.10473 +
242.10474 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10475 +#: ../en/ch09-hook.xml:324
242.10476 +msgid ""
242.10477 +"In practice, putting a centralised bottleneck like this in place is not often "
242.10478 +"a good idea, and transaction visibility has nothing to do with the problem.  "
242.10479 +"As the size of a project&emdash;and the time it takes to build and "
242.10480 +"test&emdash;grows, you rapidly run into a wall with this <quote>try before "
242.10481 +"you buy</quote> approach, where you have more changesets to test than time in "
242.10482 +"which to deal with them.  The inevitable result is frustration on the part of "
242.10483 +"all involved."
242.10484 +msgstr ""
242.10485 +
242.10486 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10487 +#: ../en/ch09-hook.xml:335
242.10488 +msgid ""
242.10489 +"An approach that scales better is to get people to build and test before they "
242.10490 +"push, then run automated builds and tests centrally <emphasis>after</"
242.10491 +"emphasis> a push, to be sure all is well.  The advantage of this approach is "
242.10492 +"that it does not impose a limit on the rate at which the repository can "
242.10493 +"accept changes."
242.10494 +msgstr ""
242.10495 +
242.10496 +#. type: Content of: <book><chapter><sect1><title>
242.10497 +#: ../en/ch09-hook.xml:346
242.10498 +msgid "A short tutorial on using hooks"
242.10499 +msgstr "使用钩子的简短指南"
242.10500 +
242.10501 +#. type: Content of: <book><chapter><sect1><para>
242.10502 +#: ../en/ch09-hook.xml:348
242.10503 +msgid ""
242.10504 +"It is easy to write a Mercurial hook.  Let's start with a hook that runs when "
242.10505 +"you finish a <command role=\"hg-cmd\">hg commit</command>, and simply prints "
242.10506 +"the hash of the changeset you just created.  The hook is called <literal role="
242.10507 +"\"hook\">commit</literal>."
242.10508 +msgstr ""
242.10509 +
242.10510 +#. type: Content of: <book><chapter><sect1><para>
242.10511 +#: ../en/ch09-hook.xml:355
242.10512 +msgid "All hooks follow the pattern in this example."
242.10513 +msgstr ""
242.10514 +
242.10515 +#. type: Content of: <book><chapter><sect1><para>
242.10516 +#: ../en/ch09-hook.xml:359
242.10517 +msgid ""
242.10518 +"You add an entry to the <literal role=\"rc-hooks\">hooks</literal> section of "
242.10519 +"your <filename role=\"special\">~/.hgrc</filename>.  On the left is the name "
242.10520 +"of the event to trigger on; on the right is the action to take.  As you can "
242.10521 +"see, you can run an arbitrary shell command in a hook.  Mercurial passes "
242.10522 +"extra information to the hook using environment variables (look for "
242.10523 +"<envar>HG_NODE</envar> in the example)."
242.10524 +msgstr ""
242.10525 +
242.10526 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.10527 +#: ../en/ch09-hook.xml:369
242.10528 +msgid "Performing multiple actions per event"
242.10529 +msgstr "每个事件执行多个操作"
242.10530 +
242.10531 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10532 +#: ../en/ch09-hook.xml:371
242.10533 +msgid ""
242.10534 +"Quite often, you will want to define more than one hook for a particular kind "
242.10535 +"of event, as shown below."
242.10536 +msgstr ""
242.10537 +
242.10538 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10539 +#: ../en/ch09-hook.xml:376
242.10540 +msgid ""
242.10541 +"Mercurial lets you do this by adding an <emphasis>extension</emphasis> to the "
242.10542 +"end of a hook's name.  You extend a hook's name by giving the name of the "
242.10543 +"hook, followed by a full stop (the <quote><literal>.</literal></quote> "
242.10544 +"character), followed by some more text of your choosing.  For example, "
242.10545 +"Mercurial will run both <literal>commit.foo</literal> and <literal>commit."
242.10546 +"bar</literal> when the <literal>commit</literal> event occurs."
242.10547 +msgstr ""
242.10548 +
242.10549 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10550 +#: ../en/ch09-hook.xml:387
242.10551 +msgid ""
242.10552 +"To give a well-defined order of execution when there are multiple hooks "
242.10553 +"defined for an event, Mercurial sorts hooks by extension, and executes the "
242.10554 +"hook commands in this sorted order.  In the above example, it will execute "
242.10555 +"<literal>commit.bar</literal> before <literal>commit.foo</literal>, and "
242.10556 +"<literal>commit</literal> before both."
242.10557 +msgstr ""
242.10558 +
242.10559 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10560 +#: ../en/ch09-hook.xml:396
242.10561 +msgid ""
242.10562 +"It is a good idea to use a somewhat descriptive extension when you define a "
242.10563 +"new hook.  This will help you to remember what the hook was for.  If the hook "
242.10564 +"fails, you'll get an error message that contains the hook name and extension, "
242.10565 +"so using a descriptive extension could give you an immediate hint as to why "
242.10566 +"the hook failed (see <xref linkend=\"sec:hook:perm\"/> for an example)."
242.10567 +msgstr ""
242.10568 +
242.10569 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.10570 +#: ../en/ch09-hook.xml:407
242.10571 +msgid "Controlling whether an activity can proceed"
242.10572 +msgstr "控制处理的活动"
242.10573 +
242.10574 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10575 +#: ../en/ch09-hook.xml:409
242.10576 +msgid ""
242.10577 +"In our earlier examples, we used the <literal role=\"hook\">commit</literal> "
242.10578 +"hook, which is run after a commit has completed.  This is one of several "
242.10579 +"Mercurial hooks that run after an activity finishes.  Such hooks have no way "
242.10580 +"of influencing the activity itself."
242.10581 +msgstr ""
242.10582 +
242.10583 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10584 +#: ../en/ch09-hook.xml:416
242.10585 +msgid ""
242.10586 +"Mercurial defines a number of events that occur before an activity starts; or "
242.10587 +"after it starts, but before it finishes.  Hooks that trigger on these events "
242.10588 +"have the added ability to choose whether the activity can continue, or will "
242.10589 +"abort."
242.10590 +msgstr ""
242.10591 +
242.10592 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10593 +#: ../en/ch09-hook.xml:422
242.10594 +msgid ""
242.10595 +"The <literal role=\"hook\">pretxncommit</literal> hook runs after a commit "
242.10596 +"has all but completed.  In other words, the metadata representing the "
242.10597 +"changeset has been written out to disk, but the transaction has not yet been "
242.10598 +"allowed to complete.  The <literal role=\"hook\">pretxncommit</literal> hook "
242.10599 +"has the ability to decide whether the transaction can complete, or must be "
242.10600 +"rolled back."
242.10601 +msgstr ""
242.10602 +
242.10603 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10604 +#: ../en/ch09-hook.xml:431
242.10605 +msgid ""
242.10606 +"If the <literal role=\"hook\">pretxncommit</literal> hook exits with a status "
242.10607 +"code of zero, the transaction is allowed to complete; the commit finishes; "
242.10608 +"and the <literal role=\"hook\">commit</literal> hook is run.  If the <literal "
242.10609 +"role=\"hook\">pretxncommit</literal> hook exits with a non-zero status code, "
242.10610 +"the transaction is rolled back; the metadata representing the changeset is "
242.10611 +"erased; and the <literal role=\"hook\">commit</literal> hook is not run."
242.10612 +msgstr ""
242.10613 +
242.10614 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10615 +#: ../en/ch09-hook.xml:443
242.10616 +msgid ""
242.10617 +"The hook in the example above checks that a commit comment contains a bug "
242.10618 +"ID.  If it does, the commit can complete.  If not, the commit is rolled back."
242.10619 +msgstr ""
242.10620 +
242.10621 +#. type: Content of: <book><chapter><sect1><title>
242.10622 +#: ../en/ch09-hook.xml:451
242.10623 +msgid "Writing your own hooks"
242.10624 +msgstr "编写钩子"
242.10625 +
242.10626 +#. type: Content of: <book><chapter><sect1><para>
242.10627 +#: ../en/ch09-hook.xml:453
242.10628 +msgid ""
242.10629 +"When you are writing a hook, you might find it useful to run Mercurial either "
242.10630 +"with the <option role=\"hg-opt-global\">-v</option> option, or the <envar "
242.10631 +"role=\"rc-item-ui\">verbose</envar> config item set to <quote>true</quote>.  "
242.10632 +"When you do so, Mercurial will print a message before it calls each hook."
242.10633 +msgstr ""
242.10634 +
242.10635 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.10636 +#: ../en/ch09-hook.xml:462
242.10637 +msgid "Choosing how your hook should run"
242.10638 +msgstr "选择钩子的执行方式"
242.10639 +
242.10640 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10641 +#: ../en/ch09-hook.xml:464
242.10642 +msgid ""
242.10643 +"You can write a hook either as a normal program&emdash;typically a shell "
242.10644 +"script&emdash;or as a Python function that is executed within the Mercurial "
242.10645 +"process."
242.10646 +msgstr ""
242.10647 +
242.10648 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10649 +#: ../en/ch09-hook.xml:469
242.10650 +msgid ""
242.10651 +"Writing a hook as an external program has the advantage that it requires no "
242.10652 +"knowledge of Mercurial's internals.  You can call normal Mercurial commands "
242.10653 +"to get any added information you need.  The trade-off is that external hooks "
242.10654 +"are slower than in-process hooks."
242.10655 +msgstr ""
242.10656 +
242.10657 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10658 +#: ../en/ch09-hook.xml:476
242.10659 +msgid ""
242.10660 +"An in-process Python hook has complete access to the Mercurial API, and does "
242.10661 +"not <quote>shell out</quote> to another process, so it is inherently faster "
242.10662 +"than an external hook.  It is also easier to obtain much of the information "
242.10663 +"that a hook requires by using the Mercurial API than by running Mercurial "
242.10664 +"commands."
242.10665 +msgstr ""
242.10666 +
242.10667 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10668 +#: ../en/ch09-hook.xml:484
242.10669 +msgid ""
242.10670 +"If you are comfortable with Python, or require high performance, writing your "
242.10671 +"hooks in Python may be a good choice.  However, when you have a "
242.10672 +"straightforward hook to write and you don't need to care about performance "
242.10673 +"(probably the majority of hooks), a shell script is perfectly fine."
242.10674 +msgstr ""
242.10675 +
242.10676 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.10677 +#: ../en/ch09-hook.xml:493
242.10678 +msgid "Hook parameters"
242.10679 +msgstr "钩子的参数"
242.10680 +
242.10681 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10682 +#: ../en/ch09-hook.xml:495
242.10683 +msgid ""
242.10684 +"Mercurial calls each hook with a set of well-defined parameters.  In Python, "
242.10685 +"a parameter is passed as a keyword argument to your hook function.  For an "
242.10686 +"external program, a parameter is passed as an environment variable."
242.10687 +msgstr ""
242.10688 +
242.10689 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10690 +#: ../en/ch09-hook.xml:501
242.10691 +msgid ""
242.10692 +"Whether your hook is written in Python or as a shell script, the hook-"
242.10693 +"specific parameter names and values will be the same.  A boolean parameter "
242.10694 +"will be represented as a boolean value in Python, but as the number 1 (for "
242.10695 +"<quote>true</quote>) or 0 (for <quote>false</quote>) as an environment "
242.10696 +"variable for an external hook.  If a hook parameter is named <literal>foo</"
242.10697 +"literal>, the keyword argument for a Python hook will also be named "
242.10698 +"<literal>foo</literal>, while the environment variable for an external hook "
242.10699 +"will be named <literal>HG_FOO</literal>."
242.10700 +msgstr ""
242.10701 +
242.10702 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.10703 +#: ../en/ch09-hook.xml:515
242.10704 +msgid "Hook return values and activity control"
242.10705 +msgstr "钩子的返回值与活动控制"
242.10706 +
242.10707 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10708 +#: ../en/ch09-hook.xml:517
242.10709 +msgid ""
242.10710 +"A hook that executes successfully must exit with a status of zero if "
242.10711 +"external, or return boolean <quote>false</quote> if in-process.  Failure is "
242.10712 +"indicated with a non-zero exit status from an external hook, or an in-process "
242.10713 +"hook returning boolean <quote>true</quote>.  If an in-process hook raises an "
242.10714 +"exception, the hook is considered to have failed."
242.10715 +msgstr ""
242.10716 +
242.10717 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10718 +#: ../en/ch09-hook.xml:525
242.10719 +msgid ""
242.10720 +"For a hook that controls whether an activity can proceed, zero/false means "
242.10721 +"<quote>allow</quote>, while non-zero/true/exception means <quote>deny</quote>."
242.10722 +msgstr ""
242.10723 +
242.10724 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.10725 +#: ../en/ch09-hook.xml:532
242.10726 +msgid "Writing an external hook"
242.10727 +msgstr "编写外部钩子"
242.10728 +
242.10729 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10730 +#: ../en/ch09-hook.xml:534
242.10731 +msgid ""
242.10732 +"When you define an external hook in your <filename role=\"special\">~/.hgrc</"
242.10733 +"filename> and the hook is run, its value is passed to your shell, which "
242.10734 +"interprets it.  This means that you can use normal shell constructs in the "
242.10735 +"body of the hook."
242.10736 +msgstr ""
242.10737 +
242.10738 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10739 +#: ../en/ch09-hook.xml:541
242.10740 +msgid ""
242.10741 +"An executable hook is always run with its current directory set to a "
242.10742 +"repository's root directory."
242.10743 +msgstr ""
242.10744 +
242.10745 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10746 +#: ../en/ch09-hook.xml:545
242.10747 +msgid ""
242.10748 +"Each hook parameter is passed in as an environment variable; the name is "
242.10749 +"upper-cased, and prefixed with the string <quote><literal>HG_</literal></"
242.10750 +"quote>."
242.10751 +msgstr ""
242.10752 +
242.10753 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10754 +#: ../en/ch09-hook.xml:550
242.10755 +msgid ""
242.10756 +"With the exception of hook parameters, Mercurial does not set or modify any "
242.10757 +"environment variables when running a hook.  This is useful to remember if you "
242.10758 +"are writing a site-wide hook that may be run by a number of different users "
242.10759 +"with differing environment variables set. In multi-user situations, you "
242.10760 +"should not rely on environment variables being set to the values you have in "
242.10761 +"your environment when testing the hook."
242.10762 +msgstr ""
242.10763 +
242.10764 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.10765 +#: ../en/ch09-hook.xml:561
242.10766 +msgid "Telling Mercurial to use an in-process hook"
242.10767 +msgstr "让 Mercurial 使用进程内钩子"
242.10768 +
242.10769 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10770 +#: ../en/ch09-hook.xml:563
242.10771 +msgid ""
242.10772 +"The <filename role=\"special\">~/.hgrc</filename> syntax for defining an in-"
242.10773 +"process hook is slightly different than for an executable hook.  The value of "
242.10774 +"the hook must start with the text <quote><literal>python:</literal></quote>, "
242.10775 +"and continue with the fully-qualified name of a callable object to use as the "
242.10776 +"hook's value."
242.10777 +msgstr ""
242.10778 +
242.10779 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10780 +#: ../en/ch09-hook.xml:571
242.10781 +msgid ""
242.10782 +"The module in which a hook lives is automatically imported when a hook is "
242.10783 +"run.  So long as you have the module name and <envar>PYTHONPATH</envar> "
242.10784 +"right, it should <quote>just work</quote>."
242.10785 +msgstr ""
242.10786 +
242.10787 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10788 +#: ../en/ch09-hook.xml:577
242.10789 +msgid ""
242.10790 +"The following <filename role=\"special\">~/.hgrc</filename> example snippet "
242.10791 +"illustrates the syntax and meaning of the notions we just described."
242.10792 +msgstr ""
242.10793 +
242.10794 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10795 +#: ../en/ch09-hook.xml:583
242.10796 +msgid ""
242.10797 +"When Mercurial runs the <literal>commit.example</literal> hook, it imports "
242.10798 +"<literal>mymodule.submodule</literal>, looks for the callable object named "
242.10799 +"<literal>myhook</literal>, and calls it."
242.10800 +msgstr ""
242.10801 +
242.10802 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.10803 +#: ../en/ch09-hook.xml:591
242.10804 +msgid "Writing an in-process hook"
242.10805 +msgstr "编写进程内钩子"
242.10806 +
242.10807 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10808 +#: ../en/ch09-hook.xml:593
242.10809 +msgid ""
242.10810 +"The simplest in-process hook does nothing, but illustrates the basic shape of "
242.10811 +"the hook API:"
242.10812 +msgstr ""
242.10813 +
242.10814 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10815 +#: ../en/ch09-hook.xml:598
242.10816 +msgid ""
242.10817 +"The first argument to a Python hook is always a <literal role=\"py-mod-"
242.10818 +"mercurial.ui\">ui</literal> object.  The second is a repository object; at "
242.10819 +"the moment, it is always an instance of <literal role=\"py-mod-mercurial."
242.10820 +"localrepo\">localrepository</literal>.  Following these two arguments are "
242.10821 +"other keyword arguments.  Which ones are passed in depends on the hook being "
242.10822 +"called, but a hook can ignore arguments it doesn't care about by dropping "
242.10823 +"them into a keyword argument dict, as with <literal>**kwargs</literal> above."
242.10824 +msgstr ""
242.10825 +
242.10826 +#. type: Content of: <book><chapter><sect1><title>
242.10827 +#: ../en/ch09-hook.xml:613
242.10828 +msgid "Some hook examples"
242.10829 +msgstr "钩子样例"
242.10830 +
242.10831 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.10832 +#: ../en/ch09-hook.xml:616
242.10833 +msgid "Writing meaningful commit messages"
242.10834 +msgstr "编写有意义的提交日志"
242.10835 +
242.10836 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10837 +#: ../en/ch09-hook.xml:618
242.10838 +msgid ""
242.10839 +"It's hard to imagine a useful commit message being very short. The simple "
242.10840 +"<literal role=\"hook\">pretxncommit</literal> hook of the example below will "
242.10841 +"prevent you from committing a changeset with a message that is less than ten "
242.10842 +"bytes long."
242.10843 +msgstr ""
242.10844 +
242.10845 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.10846 +#: ../en/ch09-hook.xml:628
242.10847 +msgid "Checking for trailing whitespace"
242.10848 +msgstr "检查行尾空格"
242.10849 +
242.10850 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10851 +#: ../en/ch09-hook.xml:630
242.10852 +msgid ""
242.10853 +"An interesting use of a commit-related hook is to help you to write cleaner "
242.10854 +"code.  A simple example of <quote>cleaner code</quote> is the dictum that a "
242.10855 +"change should not add any new lines of text that contain <quote>trailing "
242.10856 +"whitespace</quote>.  Trailing whitespace is a series of space and tab "
242.10857 +"characters at the end of a line of text.  In most cases, trailing whitespace "
242.10858 +"is unnecessary, invisible noise, but it is occasionally problematic, and "
242.10859 +"people often prefer to get rid of it."
242.10860 +msgstr ""
242.10861 +
242.10862 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10863 +#: ../en/ch09-hook.xml:641
242.10864 +msgid ""
242.10865 +"You can use either the <literal role=\"hook\">precommit</literal> or <literal "
242.10866 +"role=\"hook\">pretxncommit</literal> hook to tell whether you have a trailing "
242.10867 +"whitespace problem.  If you use the <literal role=\"hook\">precommit</"
242.10868 +"literal> hook, the hook will not know which files you are committing, so it "
242.10869 +"will have to check every modified file in the repository for trailing white "
242.10870 +"space.  If you want to commit a change to just the file <filename>foo</"
242.10871 +"filename>, but the file <filename>bar</filename> contains trailing "
242.10872 +"whitespace, doing a check in the <literal role=\"hook\">precommit</literal> "
242.10873 +"hook will prevent you from committing <filename>foo</filename> due to the "
242.10874 +"problem with <filename>bar</filename>.  This doesn't seem right."
242.10875 +msgstr ""
242.10876 +
242.10877 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10878 +#: ../en/ch09-hook.xml:657
242.10879 +msgid ""
242.10880 +"Should you choose the <literal role=\"hook\">pretxncommit</literal> hook, the "
242.10881 +"check won't occur until just before the transaction for the commit "
242.10882 +"completes.  This will allow you to check for problems only the exact files "
242.10883 +"that are being committed.  However, if you entered the commit message "
242.10884 +"interactively and the hook fails, the transaction will roll back; you'll have "
242.10885 +"to re-enter the commit message after you fix the trailing whitespace and run "
242.10886 +"<command role=\"hg-cmd\">hg commit</command> again."
242.10887 +msgstr ""
242.10888 +
242.10889 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10890 +#: ../en/ch09-hook.xml:670
242.10891 +msgid ""
242.10892 +"In this example, we introduce a simple <literal role=\"hook\">pretxncommit</"
242.10893 +"literal> hook that checks for trailing whitespace.  This hook is short, but "
242.10894 +"not very helpful.  It exits with an error status if a change adds a line with "
242.10895 +"trailing whitespace to any file, but does not print any information that "
242.10896 +"might help us to identify the offending file or line.  It also has the nice "
242.10897 +"property of not paying attention to unmodified lines; only lines that "
242.10898 +"introduce new trailing whitespace cause problems."
242.10899 +msgstr ""
242.10900 +
242.10901 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10902 +#: ../en/ch09-hook.xml:681
242.10903 +msgid ""
242.10904 +"The above version is much more complex, but also more useful.  It parses a "
242.10905 +"unified diff to see if any lines add trailing whitespace, and prints the name "
242.10906 +"of the file and the line number of each such occurrence.  Even better, if the "
242.10907 +"change adds trailing whitespace, this hook saves the commit comment and "
242.10908 +"prints the name of the save file before exiting and telling Mercurial to roll "
242.10909 +"the transaction back, so you can use the <option role=\"hg-opt-commit\">-l "
242.10910 +"filename</option> option to <command role=\"hg-cmd\">hg commit</command> to "
242.10911 +"reuse the saved commit message once you've corrected the problem."
242.10912 +msgstr ""
242.10913 +
242.10914 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10915 +#: ../en/ch09-hook.xml:695
242.10916 +msgid ""
242.10917 +"As a final aside, note in the example above the use of <command>perl</"
242.10918 +"command>'s in-place editing feature to get rid of trailing whitespace from a "
242.10919 +"file.  This is concise and useful enough that I will reproduce it here."
242.10920 +msgstr ""
242.10921 +
242.10922 +#. type: Content of: <book><chapter><sect1><title>
242.10923 +#: ../en/ch09-hook.xml:705
242.10924 +msgid "Bundled hooks"
242.10925 +msgstr "内置的钩子"
242.10926 +
242.10927 +#. type: Content of: <book><chapter><sect1><para>
242.10928 +#: ../en/ch09-hook.xml:707
242.10929 +msgid ""
242.10930 +"Mercurial ships with several bundled hooks.  You can find them in the "
242.10931 +"<filename class=\"directory\">hgext</filename> directory of a Mercurial "
242.10932 +"source tree.  If you are using a Mercurial binary package, the hooks will be "
242.10933 +"located in the <filename class=\"directory\">hgext</filename> directory of "
242.10934 +"wherever your package installer put Mercurial."
242.10935 +msgstr ""
242.10936 +
242.10937 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.10938 +#: ../en/ch09-hook.xml:716
242.10939 +msgid ""
242.10940 +"<literal role=\"hg-ext\">acl</literal>&emdash;access control for parts of a "
242.10941 +"repository"
242.10942 +msgstr "<literal role=\"hg-ext\">acl</literal>—版本库的访问控制"
242.10943 +
242.10944 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10945 +#: ../en/ch09-hook.xml:719
242.10946 +msgid ""
242.10947 +"The <literal role=\"hg-ext\">acl</literal> extension lets you control which "
242.10948 +"remote users are allowed to push changesets to a networked server.  You can "
242.10949 +"protect any portion of a repository (including the entire repo), so that a "
242.10950 +"specific remote user can push changes that do not affect the protected "
242.10951 +"portion."
242.10952 +msgstr ""
242.10953 +
242.10954 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.10955 +#: ../en/ch09-hook.xml:727
242.10956 +msgid ""
242.10957 +"This extension implements access control based on the identity of the user "
242.10958 +"performing a push, <emphasis>not</emphasis> on who committed the changesets "
242.10959 +"they're pushing.  It makes sense to use this hook only if you have a locked-"
242.10960 +"down server environment that authenticates remote users, and you want to be "
242.10961 +"sure that only specific users are allowed to push changes to that server."
242.10962 +msgstr ""
242.10963 +
242.10964 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title>
242.10965 +#: ../en/ch09-hook.xml:737
242.10966 +msgid "Configuring the <literal role=\"hook\">acl</literal> hook"
242.10967 +msgstr "配置 <literal role=\"hook\">acl</literal> 钩子"
242.10968 +
242.10969 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.10970 +#: ../en/ch09-hook.xml:740
242.10971 +msgid ""
242.10972 +"In order to manage incoming changesets, the <literal role=\"hg-ext\">acl</"
242.10973 +"literal> hook must be used as a <literal role=\"hook\">pretxnchangegroup</"
242.10974 +"literal> hook.  This lets it see which files are modified by each incoming "
242.10975 +"changeset, and roll back a group of changesets if they modify "
242.10976 +"<quote>forbidden</quote> files.  Example:"
242.10977 +msgstr ""
242.10978 +
242.10979 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.10980 +#: ../en/ch09-hook.xml:750
242.10981 +msgid ""
242.10982 +"The <literal role=\"hg-ext\">acl</literal> extension is configured using "
242.10983 +"three sections."
242.10984 +msgstr ""
242.10985 +
242.10986 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.10987 +#: ../en/ch09-hook.xml:754
242.10988 +msgid ""
242.10989 +"The <literal role=\"rc-acl\">acl</literal> section has only one entry, <envar "
242.10990 +"role=\"rc-item-acl\">sources</envar>, which lists the sources of incoming "
242.10991 +"changesets that the hook should pay attention to.  You don't normally need to "
242.10992 +"configure this section."
242.10993 +msgstr ""
242.10994 +
242.10995 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.10996 +#: ../en/ch09-hook.xml:761
242.10997 +msgid ""
242.10998 +"<envar role=\"rc-item-acl\">serve</envar>: Control incoming changesets that "
242.10999 +"are arriving from a remote repository over http or ssh.  This is the default "
242.11000 +"value of <envar role=\"rc-item-acl\">sources</envar>, and usually the only "
242.11001 +"setting you'll need for this configuration item."
242.11002 +msgstr ""
242.11003 +
242.11004 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11005 +#: ../en/ch09-hook.xml:769
242.11006 +msgid ""
242.11007 +"<envar role=\"rc-item-acl\">pull</envar>: Control incoming changesets that "
242.11008 +"are arriving via a pull from a local repository."
242.11009 +msgstr ""
242.11010 +
242.11011 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11012 +#: ../en/ch09-hook.xml:774
242.11013 +msgid ""
242.11014 +"<envar role=\"rc-item-acl\">push</envar>: Control incoming changesets that "
242.11015 +"are arriving via a push from a local repository."
242.11016 +msgstr ""
242.11017 +
242.11018 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11019 +#: ../en/ch09-hook.xml:779
242.11020 +msgid ""
242.11021 +"<envar role=\"rc-item-acl\">bundle</envar>: Control incoming changesets that "
242.11022 +"are arriving from another repository via a bundle."
242.11023 +msgstr ""
242.11024 +
242.11025 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11026 +#: ../en/ch09-hook.xml:785
242.11027 +msgid ""
242.11028 +"The <literal role=\"rc-acl.allow\">acl.allow</literal> section controls the "
242.11029 +"users that are allowed to add changesets to the repository.  If this section "
242.11030 +"is not present, all users that are not explicitly denied are allowed.  If "
242.11031 +"this section is present, all users that are not explicitly allowed are denied "
242.11032 +"(so an empty section means that all users are denied)."
242.11033 +msgstr ""
242.11034 +
242.11035 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11036 +#: ../en/ch09-hook.xml:794
242.11037 +msgid ""
242.11038 +"The <literal role=\"rc-acl.deny\">acl.deny</literal> section determines which "
242.11039 +"users are denied from adding changesets to the repository.  If this section "
242.11040 +"is not present or is empty, no users are denied."
242.11041 +msgstr ""
242.11042 +
242.11043 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11044 +#: ../en/ch09-hook.xml:800
242.11045 +msgid ""
242.11046 +"The syntaxes for the <literal role=\"rc-acl.allow\">acl.allow</literal> and "
242.11047 +"<literal role=\"rc-acl.deny\">acl.deny</literal> sections are identical.  On "
242.11048 +"the left of each entry is a glob pattern that matches files or directories, "
242.11049 +"relative to the root of the repository; on the right, a user name."
242.11050 +msgstr ""
242.11051 +
242.11052 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11053 +#: ../en/ch09-hook.xml:808
242.11054 +msgid ""
242.11055 +"In the following example, the user <literal>docwriter</literal> can only push "
242.11056 +"changes to the <filename class=\"directory\">docs</filename> subtree of the "
242.11057 +"repository, while <literal>intern</literal> can push changes to any file or "
242.11058 +"directory except <filename class=\"directory\">source/sensitive</filename>."
242.11059 +msgstr ""
242.11060 +
242.11061 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title>
242.11062 +#: ../en/ch09-hook.xml:822 ../en/ch09-hook.xml:1089 ../en/ch09-hook.xml:1279
242.11063 +msgid "Testing and troubleshooting"
242.11064 +msgstr "测试与问题处理"
242.11065 +
242.11066 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11067 +#: ../en/ch09-hook.xml:824
242.11068 +msgid ""
242.11069 +"If you want to test the <literal role=\"hg-ext\">acl</literal> hook, run it "
242.11070 +"with Mercurial's debugging output enabled.  Since you'll probably be running "
242.11071 +"it on a server where it's not convenient (or sometimes possible) to pass in "
242.11072 +"the <option role=\"hg-opt-global\">--debug</option> option, don't forget that "
242.11073 +"you can enable debugging output in your <filename role=\"special\">~/.hgrc</"
242.11074 +"filename>:"
242.11075 +msgstr ""
242.11076 +
242.11077 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11078 +#: ../en/ch09-hook.xml:835
242.11079 +msgid ""
242.11080 +"With this enabled, the <literal role=\"hg-ext\">acl</literal> hook will print "
242.11081 +"enough information to let you figure out why it is allowing or forbidding "
242.11082 +"pushes from specific users."
242.11083 +msgstr ""
242.11084 +
242.11085 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.11086 +#: ../en/ch09-hook.xml:844
242.11087 +msgid ""
242.11088 +"<literal role=\"hg-ext\">bugzilla</literal>&emdash;integration with Bugzilla"
242.11089 +msgstr "<literal role=\"hg-ext\">bugzilla</literal>—与 Bugzilla 的集成"
242.11090 +
242.11091 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11092 +#: ../en/ch09-hook.xml:848
242.11093 +msgid ""
242.11094 +"The <literal role=\"hg-ext\">bugzilla</literal> extension adds a comment to a "
242.11095 +"Bugzilla bug whenever it finds a reference to that bug ID in a commit "
242.11096 +"comment.  You can install this hook on a shared server, so that any time a "
242.11097 +"remote user pushes changes to this server, the hook gets run."
242.11098 +msgstr ""
242.11099 +
242.11100 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11101 +#: ../en/ch09-hook.xml:855
242.11102 +msgid ""
242.11103 +"It adds a comment to the bug that looks like this (you can configure the "
242.11104 +"contents of the comment&emdash;see below):"
242.11105 +msgstr ""
242.11106 +
242.11107 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11108 +#: ../en/ch09-hook.xml:864
242.11109 +msgid ""
242.11110 +"The value of this hook is that it automates the process of updating a bug any "
242.11111 +"time a changeset refers to it.  If you configure the hook properly, it makes "
242.11112 +"it easy for people to browse straight from a Bugzilla bug to a changeset that "
242.11113 +"refers to that bug."
242.11114 +msgstr ""
242.11115 +
242.11116 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11117 +#: ../en/ch09-hook.xml:871
242.11118 +msgid ""
242.11119 +"You can use the code in this hook as a starting point for some more exotic "
242.11120 +"Bugzilla integration recipes.  Here are a few possibilities:"
242.11121 +msgstr ""
242.11122 +
242.11123 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.11124 +#: ../en/ch09-hook.xml:876
242.11125 +msgid ""
242.11126 +"Require that every changeset pushed to the server have a valid bug ID in its "
242.11127 +"commit comment.  In this case, you'd want to configure the hook as a <literal "
242.11128 +"role=\"hook\">pretxncommit</literal> hook.  This would allow the hook to "
242.11129 +"reject changes that didn't contain bug IDs."
242.11130 +msgstr ""
242.11131 +
242.11132 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.11133 +#: ../en/ch09-hook.xml:884
242.11134 +msgid ""
242.11135 +"Allow incoming changesets to automatically modify the <emphasis>state</"
242.11136 +"emphasis> of a bug, as well as simply adding a comment.  For example, the "
242.11137 +"hook could recognise the string <quote>fixed bug 31337</quote> as indicating "
242.11138 +"that it should update the state of bug 31337 to <quote>requires testing</"
242.11139 +"quote>."
242.11140 +msgstr ""
242.11141 +
242.11142 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title>
242.11143 +#: ../en/ch09-hook.xml:894
242.11144 +msgid "Configuring the <literal role=\"hook\">bugzilla</literal> hook"
242.11145 +msgstr "配置 <literal role=\"hook\">bugzilla</literal> 钩子"
242.11146 +
242.11147 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11148 +#: ../en/ch09-hook.xml:897
242.11149 +msgid ""
242.11150 +"You should configure this hook in your server's <filename role=\"special\">~/."
242.11151 +"hgrc</filename> as an <literal role=\"hook\">incoming</literal> hook, for "
242.11152 +"example as follows:"
242.11153 +msgstr ""
242.11154 +
242.11155 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11156 +#: ../en/ch09-hook.xml:905
242.11157 +msgid ""
242.11158 +"Because of the specialised nature of this hook, and because Bugzilla was not "
242.11159 +"written with this kind of integration in mind, configuring this hook is a "
242.11160 +"somewhat involved process."
242.11161 +msgstr ""
242.11162 +
242.11163 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11164 +#: ../en/ch09-hook.xml:911
242.11165 +msgid ""
242.11166 +"Before you begin, you must install the MySQL bindings for Python on the host"
242.11167 +"(s) where you'll be running the hook.  If this is not available as a binary "
242.11168 +"package for your system, you can download it from <citation>web:mysql-python</"
242.11169 +"citation>."
242.11170 +msgstr ""
242.11171 +
242.11172 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11173 +#: ../en/ch09-hook.xml:918
242.11174 +msgid ""
242.11175 +"Configuration information for this hook lives in the <literal role=\"rc-"
242.11176 +"bugzilla\">bugzilla</literal> section of your <filename role=\"special\">~/."
242.11177 +"hgrc</filename>."
242.11178 +msgstr ""
242.11179 +
242.11180 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11181 +#: ../en/ch09-hook.xml:923
242.11182 +msgid ""
242.11183 +"<envar role=\"rc-item-bugzilla\">version</envar>: The version of Bugzilla "
242.11184 +"installed on the server.  The database schema that Bugzilla uses changes "
242.11185 +"occasionally, so this hook has to know exactly which schema to use. At the "
242.11186 +"moment, the only version supported is <literal>2.16</literal>."
242.11187 +msgstr ""
242.11188 +
242.11189 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11190 +#: ../en/ch09-hook.xml:932
242.11191 +msgid ""
242.11192 +"<envar role=\"rc-item-bugzilla\">host</envar>: The hostname of the MySQL "
242.11193 +"server that stores your Bugzilla data.  The database must be configured to "
242.11194 +"allow connections from whatever host you are running the <literal role=\"hook"
242.11195 +"\">bugzilla</literal> hook on."
242.11196 +msgstr ""
242.11197 +
242.11198 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11199 +#: ../en/ch09-hook.xml:939
242.11200 +msgid ""
242.11201 +"<envar role=\"rc-item-bugzilla\">user</envar>: The username with which to "
242.11202 +"connect to the MySQL server.  The database must be configured to allow this "
242.11203 +"user to connect from whatever host you are running the <literal role=\"hook"
242.11204 +"\">bugzilla</literal> hook on.  This user must be able to access and modify "
242.11205 +"Bugzilla tables.  The default value of this item is <literal>bugs</literal>, "
242.11206 +"which is the standard name of the Bugzilla user in a MySQL database."
242.11207 +msgstr ""
242.11208 +
242.11209 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11210 +#: ../en/ch09-hook.xml:950
242.11211 +msgid ""
242.11212 +"<envar role=\"rc-item-bugzilla\">password</envar>: The MySQL password for the "
242.11213 +"user you configured above.  This is stored as plain text, so you should make "
242.11214 +"sure that unauthorised users cannot read the <filename role=\"special\">~/."
242.11215 +"hgrc</filename> file where you store this information."
242.11216 +msgstr ""
242.11217 +
242.11218 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11219 +#: ../en/ch09-hook.xml:959
242.11220 +msgid ""
242.11221 +"<envar role=\"rc-item-bugzilla\">db</envar>: The name of the Bugzilla "
242.11222 +"database on the MySQL server.  The default value of this item is "
242.11223 +"<literal>bugs</literal>, which is the standard name of the MySQL database "
242.11224 +"where Bugzilla stores its data."
242.11225 +msgstr ""
242.11226 +
242.11227 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11228 +#: ../en/ch09-hook.xml:966
242.11229 +msgid ""
242.11230 +"<envar role=\"rc-item-bugzilla\">notify</envar>: If you want Bugzilla to send "
242.11231 +"out a notification email to subscribers after this hook has added a comment "
242.11232 +"to a bug, you will need this hook to run a command whenever it updates the "
242.11233 +"database.  The command to run depends on where you have installed Bugzilla, "
242.11234 +"but it will typically look something like this, if you have Bugzilla "
242.11235 +"installed in <filename class=\"directory\">/var/www/html/bugzilla</filename>:"
242.11236 +msgstr ""
242.11237 +
242.11238 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11239 +#: ../en/ch09-hook.xml:979
242.11240 +msgid ""
242.11241 +"The Bugzilla <literal>processmail</literal> program expects to be given a bug "
242.11242 +"ID (the hook replaces <quote><literal>%s</literal></quote> with the bug ID)  "
242.11243 +"and an email address.  It also expects to be able to write to some files in "
242.11244 +"the directory that it runs in.  If Bugzilla and this hook are not installed "
242.11245 +"on the same machine, you will need to find a way to run <literal>processmail</"
242.11246 +"literal> on the server where Bugzilla is installed."
242.11247 +msgstr ""
242.11248 +
242.11249 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title>
242.11250 +#: ../en/ch09-hook.xml:994
242.11251 +msgid "Mapping committer names to Bugzilla user names"
242.11252 +msgstr "提交者的名称与 Bugzilla 用户名称的映射"
242.11253 +
242.11254 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11255 +#: ../en/ch09-hook.xml:996
242.11256 +msgid ""
242.11257 +"By default, the <literal role=\"hg-ext\">bugzilla</literal> hook tries to use "
242.11258 +"the email address of a changeset's committer as the Bugzilla user name with "
242.11259 +"which to update a bug.  If this does not suit your needs, you can map "
242.11260 +"committer email addresses to Bugzilla user names using a <literal role=\"rc-"
242.11261 +"usermap\">usermap</literal> section."
242.11262 +msgstr ""
242.11263 +
242.11264 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11265 +#: ../en/ch09-hook.xml:1005
242.11266 +msgid ""
242.11267 +"Each item in the <literal role=\"rc-usermap\">usermap</literal> section "
242.11268 +"contains an email address on the left, and a Bugzilla user name on the right."
242.11269 +msgstr ""
242.11270 +
242.11271 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11272 +#: ../en/ch09-hook.xml:1012
242.11273 +msgid ""
242.11274 +"You can either keep the <literal role=\"rc-usermap\">usermap</literal> data "
242.11275 +"in a normal <filename role=\"special\">~/.hgrc</filename>, or tell the "
242.11276 +"<literal role=\"hg-ext\">bugzilla</literal> hook to read the information from "
242.11277 +"an external <filename>usermap</filename> file.  In the latter case, you can "
242.11278 +"store <filename>usermap</filename> data by itself in (for example)  a user-"
242.11279 +"modifiable repository.  This makes it possible to let your users maintain "
242.11280 +"their own <envar role=\"rc-item-bugzilla\">usermap</envar> entries.  The main "
242.11281 +"<filename role=\"special\">~/.hgrc</filename> file might look like this:"
242.11282 +msgstr ""
242.11283 +
242.11284 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11285 +#: ../en/ch09-hook.xml:1028
242.11286 +msgid ""
242.11287 +"While the <filename>usermap</filename> file that it refers to might look like "
242.11288 +"this:"
242.11289 +msgstr ""
242.11290 +
242.11291 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title>
242.11292 +#: ../en/ch09-hook.xml:1036
242.11293 +msgid "Configuring the text that gets added to a bug"
242.11294 +msgstr "配置增加到问题中的正文"
242.11295 +
242.11296 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11297 +#: ../en/ch09-hook.xml:1038
242.11298 +msgid ""
242.11299 +"You can configure the text that this hook adds as a comment; you specify it "
242.11300 +"in the form of a Mercurial template.  Several <filename role=\"special\">~/."
242.11301 +"hgrc</filename> entries (still in the <literal role=\"rc-bugzilla\">bugzilla</"
242.11302 +"literal> section) control this behaviour."
242.11303 +msgstr ""
242.11304 +
242.11305 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11306 +#: ../en/ch09-hook.xml:1045
242.11307 +msgid ""
242.11308 +"<literal>strip</literal>: The number of leading path elements to strip from a "
242.11309 +"repository's path name to construct a partial path for a URL. For example, if "
242.11310 +"the repositories on your server live under <filename class=\"directory\">/"
242.11311 +"home/hg/repos</filename>, and you have a repository whose path is <filename "
242.11312 +"class=\"directory\">/home/hg/repos/app/tests</filename>, then setting "
242.11313 +"<literal>strip</literal> to <literal>4</literal> will give a partial path of "
242.11314 +"<filename class=\"directory\">app/tests</filename>.  The hook will make this "
242.11315 +"partial path available when expanding a template, as <literal>webroot</"
242.11316 +"literal>."
242.11317 +msgstr ""
242.11318 +
242.11319 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11320 +#: ../en/ch09-hook.xml:1059
242.11321 +msgid ""
242.11322 +"<literal>template</literal>: The text of the template to use.  In addition to "
242.11323 +"the usual changeset-related variables, this template can use <literal>hgweb</"
242.11324 +"literal> (the value of the <literal>hgweb</literal> configuration item above) "
242.11325 +"and <literal>webroot</literal> (the path constructed using <literal>strip</"
242.11326 +"literal> above)."
242.11327 +msgstr ""
242.11328 +
242.11329 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11330 +#: ../en/ch09-hook.xml:1069
242.11331 +msgid ""
242.11332 +"In addition, you can add a <envar role=\"rc-item-web\">baseurl</envar> item "
242.11333 +"to the <literal role=\"rc-web\">web</literal> section of your <filename role="
242.11334 +"\"special\">~/.hgrc</filename>.  The <literal role=\"hg-ext\">bugzilla</"
242.11335 +"literal> hook will make this available when expanding a template, as the base "
242.11336 +"string to use when constructing a URL that will let users browse from a "
242.11337 +"Bugzilla comment to view a changeset.  Example:"
242.11338 +msgstr ""
242.11339 +
242.11340 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11341 +#: ../en/ch09-hook.xml:1081
242.11342 +msgid ""
242.11343 +"Here is an example set of <literal role=\"hg-ext\">bugzilla</literal> hook "
242.11344 +"config information."
242.11345 +msgstr ""
242.11346 +
242.11347 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11348 +#: ../en/ch09-hook.xml:1091
242.11349 +msgid ""
242.11350 +"The most common problems with configuring the <literal role=\"hg-ext"
242.11351 +"\">bugzilla</literal> hook relate to running Bugzilla's "
242.11352 +"<filename>processmail</filename> script and mapping committer names to user "
242.11353 +"names."
242.11354 +msgstr ""
242.11355 +
242.11356 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11357 +#: ../en/ch09-hook.xml:1097
242.11358 +msgid ""
242.11359 +"Recall from <xref linkend=\"sec:hook:bugzilla:config\"/> above that the user "
242.11360 +"that runs the Mercurial process on the server is also the one that will run "
242.11361 +"the <filename>processmail</filename> script.  The <filename>processmail</"
242.11362 +"filename> script sometimes causes Bugzilla to write to files in its "
242.11363 +"configuration directory, and Bugzilla's configuration files are usually owned "
242.11364 +"by the user that your web server runs under."
242.11365 +msgstr ""
242.11366 +
242.11367 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11368 +#: ../en/ch09-hook.xml:1108
242.11369 +msgid ""
242.11370 +"You can cause <filename>processmail</filename> to be run with the suitable "
242.11371 +"user's identity using the <command>sudo</command> command.  Here is an "
242.11372 +"example entry for a <filename>sudoers</filename> file."
242.11373 +msgstr ""
242.11374 +
242.11375 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11376 +#: ../en/ch09-hook.xml:1115
242.11377 +msgid ""
242.11378 +"This allows the <literal>hg_user</literal> user to run a "
242.11379 +"<filename>processmail-wrapper</filename> program under the identity of "
242.11380 +"<literal>httpd_user</literal>."
242.11381 +msgstr ""
242.11382 +
242.11383 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11384 +#: ../en/ch09-hook.xml:1120
242.11385 +msgid ""
242.11386 +"This indirection through a wrapper script is necessary, because "
242.11387 +"<filename>processmail</filename> expects to be run with its current directory "
242.11388 +"set to wherever you installed Bugzilla; you can't specify that kind of "
242.11389 +"constraint in a <filename>sudoers</filename> file.  The contents of the "
242.11390 +"wrapper script are simple:"
242.11391 +msgstr ""
242.11392 +
242.11393 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11394 +#: ../en/ch09-hook.xml:1129
242.11395 +msgid ""
242.11396 +"It doesn't seem to matter what email address you pass to "
242.11397 +"<filename>processmail</filename>."
242.11398 +msgstr ""
242.11399 +
242.11400 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11401 +#: ../en/ch09-hook.xml:1133
242.11402 +msgid ""
242.11403 +"If your <literal role=\"rc-usermap\">usermap</literal> is not set up "
242.11404 +"correctly, users will see an error message from the <literal role=\"hg-ext"
242.11405 +"\">bugzilla</literal> hook when they push changes to the server.  The error "
242.11406 +"message will look like this:"
242.11407 +msgstr ""
242.11408 +
242.11409 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11410 +#: ../en/ch09-hook.xml:1140
242.11411 +msgid ""
242.11412 +"What this means is that the committer's address, <literal>john.q."
242.11413 +"public@example.com</literal>, is not a valid Bugzilla user name, nor does it "
242.11414 +"have an entry in your <literal role=\"rc-usermap\">usermap</literal> that "
242.11415 +"maps it to a valid Bugzilla user name."
242.11416 +msgstr ""
242.11417 +
242.11418 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.11419 +#: ../en/ch09-hook.xml:1150
242.11420 +msgid ""
242.11421 +"<literal role=\"hg-ext\">notify</literal>&emdash;send email notifications"
242.11422 +msgstr "<literal role=\"hg-ext\">notify</literal>—邮件通知"
242.11423 +
242.11424 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11425 +#: ../en/ch09-hook.xml:1153
242.11426 +msgid ""
242.11427 +"Although Mercurial's built-in web server provides RSS feeds of changes in "
242.11428 +"every repository, many people prefer to receive change notifications via "
242.11429 +"email.  The <literal role=\"hg-ext\">notify</literal> hook lets you send out "
242.11430 +"notifications to a set of email addresses whenever changesets arrive that "
242.11431 +"those subscribers are interested in."
242.11432 +msgstr ""
242.11433 +
242.11434 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11435 +#: ../en/ch09-hook.xml:1161
242.11436 +msgid ""
242.11437 +"As with the <literal role=\"hg-ext\">bugzilla</literal> hook, the <literal "
242.11438 +"role=\"hg-ext\">notify</literal> hook is template-driven, so you can "
242.11439 +"customise the contents of the notification messages that it sends."
242.11440 +msgstr ""
242.11441 +
242.11442 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11443 +#: ../en/ch09-hook.xml:1167
242.11444 +msgid ""
242.11445 +"By default, the <literal role=\"hg-ext\">notify</literal> hook includes a "
242.11446 +"diff of every changeset that it sends out; you can limit the size of the "
242.11447 +"diff, or turn this feature off entirely.  It is useful for letting "
242.11448 +"subscribers review changes immediately, rather than clicking to follow a URL."
242.11449 +msgstr ""
242.11450 +
242.11451 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title>
242.11452 +#: ../en/ch09-hook.xml:1175
242.11453 +msgid "Configuring the <literal role=\"hg-ext\">notify</literal> hook"
242.11454 +msgstr "配置 <literal role=\"hg-ext\">notify</literal> 钩子"
242.11455 +
242.11456 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11457 +#: ../en/ch09-hook.xml:1178
242.11458 +msgid ""
242.11459 +"You can set up the <literal role=\"hg-ext\">notify</literal> hook to send one "
242.11460 +"email message per incoming changeset, or one per incoming group of changesets "
242.11461 +"(all those that arrived in a single pull or push)."
242.11462 +msgstr ""
242.11463 +
242.11464 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11465 +#: ../en/ch09-hook.xml:1190
242.11466 +msgid ""
242.11467 +"Configuration information for this hook lives in the <literal role=\"rc-notify"
242.11468 +"\">notify</literal> section of a <filename role=\"special\">~/.hgrc</"
242.11469 +"filename> file."
242.11470 +msgstr ""
242.11471 +
242.11472 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11473 +#: ../en/ch09-hook.xml:1195
242.11474 +msgid ""
242.11475 +"<envar role=\"rc-item-notify\">test</envar>: By default, this hook does not "
242.11476 +"send out email at all; instead, it prints the message that it "
242.11477 +"<emphasis>would</emphasis> send.  Set this item to <literal>false</literal> "
242.11478 +"to allow email to be sent. The reason that sending of email is turned off by "
242.11479 +"default is that it takes several tries to configure this extension exactly as "
242.11480 +"you would like, and it would be bad form to spam subscribers with a number of "
242.11481 +"<quote>broken</quote> notifications while you debug your configuration."
242.11482 +msgstr ""
242.11483 +
242.11484 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11485 +#: ../en/ch09-hook.xml:1207
242.11486 +msgid ""
242.11487 +"<envar role=\"rc-item-notify\">config</envar>: The path to a configuration "
242.11488 +"file that contains subscription information.  This is kept separate from the "
242.11489 +"main <filename role=\"special\">~/.hgrc</filename> so that you can maintain "
242.11490 +"it in a repository of its own.  People can then clone that repository, update "
242.11491 +"their subscriptions, and push the changes back to your server."
242.11492 +msgstr ""
242.11493 +
242.11494 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11495 +#: ../en/ch09-hook.xml:1216
242.11496 +msgid ""
242.11497 +"<envar role=\"rc-item-notify\">strip</envar>: The number of leading path "
242.11498 +"separator characters to strip from a repository's path, when deciding whether "
242.11499 +"a repository has subscribers.  For example, if the repositories on your "
242.11500 +"server live in <filename class=\"directory\">/home/hg/repos</filename>, and "
242.11501 +"<literal role=\"hg-ext\">notify</literal> is considering a repository named "
242.11502 +"<filename class=\"directory\">/home/hg/repos/shared/test</filename>, setting "
242.11503 +"<envar role=\"rc-item-notify\">strip</envar> to <literal>4</literal> will "
242.11504 +"cause <literal role=\"hg-ext\">notify</literal> to trim the path it considers "
242.11505 +"down to <filename class=\"directory\">shared/test</filename>, and it will "
242.11506 +"match subscribers against that."
242.11507 +msgstr ""
242.11508 +
242.11509 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11510 +#: ../en/ch09-hook.xml:1233
242.11511 +msgid ""
242.11512 +"<envar role=\"rc-item-notify\">template</envar>: The template text to use "
242.11513 +"when sending messages.  This specifies both the contents of the message "
242.11514 +"header and its body."
242.11515 +msgstr ""
242.11516 +
242.11517 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11518 +#: ../en/ch09-hook.xml:1239
242.11519 +msgid ""
242.11520 +"<envar role=\"rc-item-notify\">maxdiff</envar>: The maximum number of lines "
242.11521 +"of diff data to append to the end of a message.  If a diff is longer than "
242.11522 +"this, it is truncated.  By default, this is set to 300.  Set this to "
242.11523 +"<literal>0</literal> to omit diffs from notification emails."
242.11524 +msgstr ""
242.11525 +
242.11526 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11527 +#: ../en/ch09-hook.xml:1248
242.11528 +msgid ""
242.11529 +"<envar role=\"rc-item-notify\">sources</envar>: A list of sources of "
242.11530 +"changesets to consider.  This lets you limit <literal role=\"hg-ext\">notify</"
242.11531 +"literal> to only sending out email about changes that remote users pushed "
242.11532 +"into this repository via a server, for example.  See <xref linkend=\"sec:hook:"
242.11533 +"sources\"/> for the sources you can specify here."
242.11534 +msgstr ""
242.11535 +
242.11536 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11537 +#: ../en/ch09-hook.xml:1259
242.11538 +msgid ""
242.11539 +"If you set the <envar role=\"rc-item-web\">baseurl</envar> item in the "
242.11540 +"<literal role=\"rc-web\">web</literal> section, you can use it in a template; "
242.11541 +"it will be available as <literal>webroot</literal>."
242.11542 +msgstr ""
242.11543 +
242.11544 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11545 +#: ../en/ch09-hook.xml:1265
242.11546 +msgid ""
242.11547 +"Here is an example set of <literal role=\"hg-ext\">notify</literal> "
242.11548 +"configuration information."
242.11549 +msgstr ""
242.11550 +
242.11551 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11552 +#: ../en/ch09-hook.xml:1271
242.11553 +msgid "This will produce a message that looks like the following:"
242.11554 +msgstr ""
242.11555 +
242.11556 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11557 +#: ../en/ch09-hook.xml:1281
242.11558 +msgid ""
242.11559 +"Do not forget that by default, the <literal role=\"hg-ext\">notify</literal> "
242.11560 +"extension <emphasis>will not send any mail</emphasis> until you explicitly "
242.11561 +"configure it to do so, by setting <envar role=\"rc-item-notify\">test</envar> "
242.11562 +"to <literal>false</literal>.  Until you do that, it simply prints the message "
242.11563 +"it <emphasis>would</emphasis> send."
242.11564 +msgstr ""
242.11565 +
242.11566 +#. type: Content of: <book><chapter><sect1><title>
242.11567 +#: ../en/ch09-hook.xml:1293
242.11568 +msgid "Information for writers of hooks"
242.11569 +msgstr "编写钩子的信息"
242.11570 +
242.11571 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.11572 +#: ../en/ch09-hook.xml:1296
242.11573 +msgid "In-process hook execution"
242.11574 +msgstr "进程内钩子的执行"
242.11575 +
242.11576 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11577 +#: ../en/ch09-hook.xml:1298
242.11578 +msgid "An in-process hook is called with arguments of the following form:"
242.11579 +msgstr ""
242.11580 +
242.11581 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11582 +#: ../en/ch09-hook.xml:1302
242.11583 +msgid ""
242.11584 +"The <literal>ui</literal> parameter is a <literal role=\"py-mod-mercurial.ui"
242.11585 +"\">ui</literal> object. The <literal>repo</literal> parameter is a <literal "
242.11586 +"role=\"py-mod-mercurial.localrepo\">localrepository</literal> object.  The "
242.11587 +"names and values of the <literal>**kwargs</literal> parameters depend on the "
242.11588 +"hook being invoked, with the following common features:"
242.11589 +msgstr ""
242.11590 +
242.11591 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.11592 +#: ../en/ch09-hook.xml:1311
242.11593 +msgid ""
242.11594 +"If a parameter is named <literal>node</literal> or <literal>parentN</"
242.11595 +"literal>, it will contain a hexadecimal changeset ID. The empty string is "
242.11596 +"used to represent <quote>null changeset ID</quote> instead of a string of "
242.11597 +"zeroes."
242.11598 +msgstr ""
242.11599 +
242.11600 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.11601 +#: ../en/ch09-hook.xml:1318
242.11602 +msgid ""
242.11603 +"If a parameter is named <literal>url</literal>, it will contain the URL of a "
242.11604 +"remote repository, if that can be determined."
242.11605 +msgstr ""
242.11606 +
242.11607 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.11608 +#: ../en/ch09-hook.xml:1323
242.11609 +msgid ""
242.11610 +"Boolean-valued parameters are represented as Python <literal>bool</literal> "
242.11611 +"objects."
242.11612 +msgstr ""
242.11613 +
242.11614 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11615 +#: ../en/ch09-hook.xml:1328
242.11616 +msgid ""
242.11617 +"An in-process hook is called without a change to the process's working "
242.11618 +"directory (unlike external hooks, which are run in the root of the "
242.11619 +"repository).  It must not change the process's working directory, or it will "
242.11620 +"cause any calls it makes into the Mercurial API to fail."
242.11621 +msgstr ""
242.11622 +
242.11623 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11624 +#: ../en/ch09-hook.xml:1335
242.11625 +msgid ""
242.11626 +"If a hook returns a boolean <quote>false</quote> value, it is considered to "
242.11627 +"have succeeded.  If it returns a boolean <quote>true</quote> value or raises "
242.11628 +"an exception, it is considered to have failed.  A useful way to think of the "
242.11629 +"calling convention is <quote>tell me if you fail</quote>."
242.11630 +msgstr ""
242.11631 +
242.11632 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11633 +#: ../en/ch09-hook.xml:1342
242.11634 +msgid ""
242.11635 +"Note that changeset IDs are passed into Python hooks as hexadecimal strings, "
242.11636 +"not the binary hashes that Mercurial's APIs normally use.  To convert a hash "
242.11637 +"from hex to binary, use the <literal>bin</literal> function."
242.11638 +msgstr ""
242.11639 +
242.11640 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.11641 +#: ../en/ch09-hook.xml:1350
242.11642 +msgid "External hook execution"
242.11643 +msgstr "外部钩子的执行"
242.11644 +
242.11645 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11646 +#: ../en/ch09-hook.xml:1352
242.11647 +msgid ""
242.11648 +"An external hook is passed to the shell of the user running Mercurial. "
242.11649 +"Features of that shell, such as variable substitution and command "
242.11650 +"redirection, are available.  The hook is run in the root directory of the "
242.11651 +"repository (unlike in-process hooks, which are run in the same directory that "
242.11652 +"Mercurial was run in)."
242.11653 +msgstr ""
242.11654 +
242.11655 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11656 +#: ../en/ch09-hook.xml:1360
242.11657 +msgid ""
242.11658 +"Hook parameters are passed to the hook as environment variables.  Each "
242.11659 +"environment variable's name is converted in upper case and prefixed with the "
242.11660 +"string <quote><literal>HG_</literal></quote>.  For example, if the name of a "
242.11661 +"parameter is <quote><literal>node</literal></quote>, the name of the "
242.11662 +"environment variable representing that parameter will be "
242.11663 +"<quote><literal>HG_NODE</literal></quote>."
242.11664 +msgstr ""
242.11665 +
242.11666 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11667 +#: ../en/ch09-hook.xml:1369
242.11668 +msgid ""
242.11669 +"A boolean parameter is represented as the string <quote><literal>1</literal></"
242.11670 +"quote> for <quote>true</quote>, <quote><literal>0</literal></quote> for "
242.11671 +"<quote>false</quote>.  If an environment variable is named <envar>HG_NODE</"
242.11672 +"envar>, <envar>HG_PARENT1</envar> or <envar>HG_PARENT2</envar>, it contains a "
242.11673 +"changeset ID represented as a hexadecimal string.  The empty string is used "
242.11674 +"to represent <quote>null changeset ID</quote> instead of a string of zeroes.  "
242.11675 +"If an environment variable is named <envar>HG_URL</envar>, it will contain "
242.11676 +"the URL of a remote repository, if that can be determined."
242.11677 +msgstr ""
242.11678 +
242.11679 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11680 +#: ../en/ch09-hook.xml:1381
242.11681 +msgid ""
242.11682 +"If a hook exits with a status of zero, it is considered to have succeeded.  "
242.11683 +"If it exits with a non-zero status, it is considered to have failed."
242.11684 +msgstr ""
242.11685 +
242.11686 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.11687 +#: ../en/ch09-hook.xml:1388
242.11688 +msgid "Finding out where changesets come from"
242.11689 +msgstr "检查修改集来自何处"
242.11690 +
242.11691 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11692 +#: ../en/ch09-hook.xml:1390
242.11693 +msgid ""
242.11694 +"A hook that involves the transfer of changesets between a local repository "
242.11695 +"and another may be able to find out information about the <quote>far side</"
242.11696 +"quote>.  Mercurial knows <emphasis>how</emphasis> changes are being "
242.11697 +"transferred, and in many cases <emphasis>where</emphasis> they are being "
242.11698 +"transferred to or from."
242.11699 +msgstr ""
242.11700 +
242.11701 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title>
242.11702 +#: ../en/ch09-hook.xml:1399
242.11703 +msgid "Sources of changesets"
242.11704 +msgstr "修改集的来源"
242.11705 +
242.11706 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11707 +#: ../en/ch09-hook.xml:1401
242.11708 +msgid ""
242.11709 +"Mercurial will tell a hook what means are, or were, used to transfer "
242.11710 +"changesets between repositories.  This is provided by Mercurial in a Python "
242.11711 +"parameter named <literal>source</literal>, or an environment variable named "
242.11712 +"<envar>HG_SOURCE</envar>."
242.11713 +msgstr ""
242.11714 +
242.11715 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11716 +#: ../en/ch09-hook.xml:1409
242.11717 +msgid ""
242.11718 +"<literal>serve</literal>: Changesets are transferred to or from a remote "
242.11719 +"repository over http or ssh."
242.11720 +msgstr ""
242.11721 +
242.11722 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11723 +#: ../en/ch09-hook.xml:1414
242.11724 +msgid ""
242.11725 +"<literal>pull</literal>: Changesets are being transferred via a pull from one "
242.11726 +"repository into another."
242.11727 +msgstr ""
242.11728 +
242.11729 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11730 +#: ../en/ch09-hook.xml:1419
242.11731 +msgid ""
242.11732 +"<literal>push</literal>: Changesets are being transferred via a push from one "
242.11733 +"repository into another."
242.11734 +msgstr ""
242.11735 +
242.11736 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11737 +#: ../en/ch09-hook.xml:1424
242.11738 +msgid ""
242.11739 +"<literal>bundle</literal>: Changesets are being transferred to or from a "
242.11740 +"bundle."
242.11741 +msgstr ""
242.11742 +
242.11743 +#. type: Content of: <book><chapter><sect1><sect2><sect3><title>
242.11744 +#: ../en/ch09-hook.xml:1431
242.11745 +msgid "Where changes are going&emdash;remote repository URLs"
242.11746 +msgstr "修改集要到哪里—远程版本库的地址"
242.11747 +
242.11748 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11749 +#: ../en/ch09-hook.xml:1434
242.11750 +msgid ""
242.11751 +"When possible, Mercurial will tell a hook the location of the <quote>far "
242.11752 +"side</quote> of an activity that transfers changeset data between "
242.11753 +"repositories.  This is provided by Mercurial in a Python parameter named "
242.11754 +"<literal>url</literal>, or an environment variable named <envar>HG_URL</"
242.11755 +"envar>."
242.11756 +msgstr ""
242.11757 +
242.11758 +#. type: Content of: <book><chapter><sect1><sect2><sect3><para>
242.11759 +#: ../en/ch09-hook.xml:1442
242.11760 +msgid ""
242.11761 +"This information is not always known.  If a hook is invoked in a repository "
242.11762 +"that is being served via http or ssh, Mercurial cannot tell where the remote "
242.11763 +"repository is, but it may know where the client is connecting from.  In such "
242.11764 +"cases, the URL will take one of the following forms:"
242.11765 +msgstr ""
242.11766 +
242.11767 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11768 +#: ../en/ch09-hook.xml:1449
242.11769 +msgid ""
242.11770 +"<literal>remote:ssh:1.2.3.4</literal>&emdash;remote ssh client, at the IP "
242.11771 +"address <literal>1.2.3.4</literal>."
242.11772 +msgstr ""
242.11773 +
242.11774 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11775 +#: ../en/ch09-hook.xml:1454
242.11776 +msgid ""
242.11777 +"<literal>remote:http:1.2.3.4</literal>&emdash;remote http client, at the IP "
242.11778 +"address <literal>1.2.3.4</literal>.  If the client is using SSL, this will be "
242.11779 +"of the form <literal>remote:https:1.2.3.4</literal>."
242.11780 +msgstr ""
242.11781 +
242.11782 +#. type: Content of: <book><chapter><sect1><sect2><sect3><itemizedlist><listitem><para>
242.11783 +#: ../en/ch09-hook.xml:1461
242.11784 +msgid "Empty&emdash;no information could be discovered about the remote client."
242.11785 +msgstr ""
242.11786 +
242.11787 +#. type: Content of: <book><chapter><sect1><title>
242.11788 +#: ../en/ch09-hook.xml:1470
242.11789 +msgid "Hook reference"
242.11790 +msgstr "钩子参考"
242.11791 +
242.11792 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.11793 +#: ../en/ch09-hook.xml:1473
242.11794 +msgid ""
242.11795 +"<literal role=\"hook\">changegroup</literal>&emdash;after remote changesets "
242.11796 +"added"
242.11797 +msgstr "<literal role=\"hook\">changegroup</literal>—增加远程修改集之后"
242.11798 +
242.11799 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11800 +#: ../en/ch09-hook.xml:1476
242.11801 +msgid ""
242.11802 +"This hook is run after a group of pre-existing changesets has been added to "
242.11803 +"the repository, for example via a <command role=\"hg-cmd\">hg pull</command> "
242.11804 +"or <command role=\"hg-cmd\">hg unbundle</command>.  This hook is run once per "
242.11805 +"operation that added one or more changesets.  This is in contrast to the "
242.11806 +"<literal role=\"hook\">incoming</literal> hook, which is run once per "
242.11807 +"changeset, regardless of whether the changesets arrive in a group."
242.11808 +msgstr ""
242.11809 +
242.11810 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11811 +#: ../en/ch09-hook.xml:1486
242.11812 +msgid ""
242.11813 +"Some possible uses for this hook include kicking off an automated build or "
242.11814 +"test of the added changesets, updating a bug database, or notifying "
242.11815 +"subscribers that a repository contains new changes."
242.11816 +msgstr ""
242.11817 +
242.11818 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11819 +#: ../en/ch09-hook.xml:1492 ../en/ch09-hook.xml:1532 ../en/ch09-hook.xml:1576
242.11820 +#: ../en/ch09-hook.xml:1618 ../en/ch09-hook.xml:1673 ../en/ch09-hook.xml:1713
242.11821 +#: ../en/ch09-hook.xml:1749 ../en/ch09-hook.xml:1783 ../en/ch09-hook.xml:1846
242.11822 +#: ../en/ch09-hook.xml:1904 ../en/ch09-hook.xml:1940 ../en/ch09-hook.xml:1967
242.11823 +msgid "Parameters to this hook:"
242.11824 +msgstr ""
242.11825 +
242.11826 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.11827 +#: ../en/ch09-hook.xml:1495 ../en/ch09-hook.xml:1849
242.11828 +msgid ""
242.11829 +"<literal>node</literal>: A changeset ID.  The changeset ID of the first "
242.11830 +"changeset in the group that was added.  All changesets between this and "
242.11831 +"<literal role=\"tag\">tip</literal>, inclusive, were added by a single "
242.11832 +"<command role=\"hg-cmd\">hg pull</command>, <command role=\"hg-cmd\">hg push</"
242.11833 +"command> or <command role=\"hg-cmd\">hg unbundle</command>."
242.11834 +msgstr ""
242.11835 +
242.11836 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.11837 +#: ../en/ch09-hook.xml:1504 ../en/ch09-hook.xml:1583 ../en/ch09-hook.xml:1676
242.11838 +#: ../en/ch09-hook.xml:1859
242.11839 +msgid ""
242.11840 +"<literal>source</literal>: A string.  The source of these changes.  See <xref "
242.11841 +"linkend=\"sec:hook:sources\"/> for details."
242.11842 +msgstr ""
242.11843 +
242.11844 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.11845 +#: ../en/ch09-hook.xml:1509 ../en/ch09-hook.xml:1588 ../en/ch09-hook.xml:1639
242.11846 +#: ../en/ch09-hook.xml:1681 ../en/ch09-hook.xml:1762 ../en/ch09-hook.xml:1864
242.11847 +msgid ""
242.11848 +"<literal>url</literal>: A URL.  The location of the remote repository, if "
242.11849 +"known.  See <xref linkend=\"sec:hook:url\"/> for more information."
242.11850 +msgstr ""
242.11851 +
242.11852 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11853 +#: ../en/ch09-hook.xml:1515
242.11854 +msgid ""
242.11855 +"See also: <literal role=\"hook\">incoming</literal> (<xref linkend=\"sec:hook:"
242.11856 +"incoming\"/>), <literal role=\"hook\">prechangegroup</literal> (<xref linkend="
242.11857 +"\"sec:hook:prechangegroup\"/>), <literal role=\"hook\">pretxnchangegroup</"
242.11858 +"literal> (<xref linkend=\"sec:hook:pretxnchangegroup\"/>)"
242.11859 +msgstr ""
242.11860 +
242.11861 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.11862 +#: ../en/ch09-hook.xml:1526
242.11863 +msgid ""
242.11864 +"<literal role=\"hook\">commit</literal>&emdash;after a new changeset is "
242.11865 +"created"
242.11866 +msgstr "<literal role=\"hook\">commit</literal>—创建新修改集之后"
242.11867 +
242.11868 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11869 +#: ../en/ch09-hook.xml:1529
242.11870 +msgid "This hook is run after a new changeset has been created."
242.11871 +msgstr ""
242.11872 +
242.11873 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.11874 +#: ../en/ch09-hook.xml:1535 ../en/ch09-hook.xml:1907
242.11875 +msgid ""
242.11876 +"<literal>node</literal>: A changeset ID.  The changeset ID of the newly "
242.11877 +"committed changeset."
242.11878 +msgstr ""
242.11879 +
242.11880 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.11881 +#: ../en/ch09-hook.xml:1539 ../en/ch09-hook.xml:1911
242.11882 +msgid ""
242.11883 +"<literal>parent1</literal>: A changeset ID.  The changeset ID of the first "
242.11884 +"parent of the newly committed changeset."
242.11885 +msgstr ""
242.11886 +
242.11887 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.11888 +#: ../en/ch09-hook.xml:1544 ../en/ch09-hook.xml:1916
242.11889 +msgid ""
242.11890 +"<literal>parent2</literal>: A changeset ID.  The changeset ID of the second "
242.11891 +"parent of the newly committed changeset."
242.11892 +msgstr ""
242.11893 +
242.11894 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11895 +#: ../en/ch09-hook.xml:1550
242.11896 +msgid ""
242.11897 +"See also: <literal role=\"hook\">precommit</literal> (<xref linkend=\"sec:"
242.11898 +"hook:precommit\"/>), <literal role=\"hook\">pretxncommit</literal> (<xref "
242.11899 +"linkend=\"sec:hook:pretxncommit\"/>)"
242.11900 +msgstr ""
242.11901 +
242.11902 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.11903 +#: ../en/ch09-hook.xml:1559
242.11904 +msgid ""
242.11905 +"<literal role=\"hook\">incoming</literal>&emdash;after one remote changeset "
242.11906 +"is added"
242.11907 +msgstr "<literal role=\"hook\">incoming</literal>—增加远程修改集之后"
242.11908 +
242.11909 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11910 +#: ../en/ch09-hook.xml:1562
242.11911 +msgid ""
242.11912 +"This hook is run after a pre-existing changeset has been added to the "
242.11913 +"repository, for example via a <command role=\"hg-cmd\">hg push</command>.  If "
242.11914 +"a group of changesets was added in a single operation, this hook is called "
242.11915 +"once for each added changeset."
242.11916 +msgstr ""
242.11917 +
242.11918 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11919 +#: ../en/ch09-hook.xml:1569
242.11920 +msgid ""
242.11921 +"You can use this hook for the same purposes as the <literal role=\"hook"
242.11922 +"\">changegroup</literal> hook (<xref linkend=\"sec:hook:changegroup\"/>); "
242.11923 +"it's simply more convenient sometimes to run a hook once per group of "
242.11924 +"changesets, while other times it's handier once per changeset."
242.11925 +msgstr ""
242.11926 +
242.11927 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.11928 +#: ../en/ch09-hook.xml:1579
242.11929 +msgid ""
242.11930 +"<literal>node</literal>: A changeset ID.  The ID of the newly added changeset."
242.11931 +msgstr ""
242.11932 +
242.11933 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11934 +#: ../en/ch09-hook.xml:1594
242.11935 +msgid ""
242.11936 +"See also: <literal role=\"hook\">changegroup</literal> (<xref linkend=\"sec:"
242.11937 +"hook:changegroup\"/>) <literal role=\"hook\">prechangegroup</literal> (<xref "
242.11938 +"linkend=\"sec:hook:prechangegroup\"/>), <literal role=\"hook"
242.11939 +"\">pretxnchangegroup</literal> (<xref linkend=\"sec:hook:pretxnchangegroup\"/"
242.11940 +">)"
242.11941 +msgstr ""
242.11942 +
242.11943 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.11944 +#: ../en/ch09-hook.xml:1605
242.11945 +msgid ""
242.11946 +"<literal role=\"hook\">outgoing</literal>&emdash;after changesets are "
242.11947 +"propagated"
242.11948 +msgstr "<literal role=\"hook\">outgoing</literal>—传播修改集之后"
242.11949 +
242.11950 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11951 +#: ../en/ch09-hook.xml:1608
242.11952 +msgid ""
242.11953 +"This hook is run after a group of changesets has been propagated out of this "
242.11954 +"repository, for example by a <command role=\"hg-cmd\">hg push</command> or "
242.11955 +"<command role=\"hg-cmd\">hg bundle</command> command."
242.11956 +msgstr ""
242.11957 +
242.11958 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11959 +#: ../en/ch09-hook.xml:1614
242.11960 +msgid ""
242.11961 +"One possible use for this hook is to notify administrators that changes have "
242.11962 +"been pulled."
242.11963 +msgstr ""
242.11964 +
242.11965 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.11966 +#: ../en/ch09-hook.xml:1621
242.11967 +msgid ""
242.11968 +"<literal>node</literal>: A changeset ID.  The changeset ID of the first "
242.11969 +"changeset of the group that was sent."
242.11970 +msgstr ""
242.11971 +
242.11972 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.11973 +#: ../en/ch09-hook.xml:1626
242.11974 +msgid ""
242.11975 +"<literal>source</literal>: A string.  The source of the of the operation (see "
242.11976 +"<xref linkend=\"sec:hook:sources\"/>).  If a remote client pulled changes "
242.11977 +"from this repository, <literal>source</literal> will be <literal>serve</"
242.11978 +"literal>.  If the client that obtained changes from this repository was "
242.11979 +"local, <literal>source</literal> will be <literal>bundle</literal>, "
242.11980 +"<literal>pull</literal>, or <literal>push</literal>, depending on the "
242.11981 +"operation the client performed."
242.11982 +msgstr ""
242.11983 +
242.11984 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11985 +#: ../en/ch09-hook.xml:1645
242.11986 +msgid ""
242.11987 +"See also: <literal role=\"hook\">preoutgoing</literal> (<xref linkend=\"sec:"
242.11988 +"hook:preoutgoing\"/>)"
242.11989 +msgstr ""
242.11990 +
242.11991 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.11992 +#: ../en/ch09-hook.xml:1652
242.11993 +msgid ""
242.11994 +"<literal role=\"hook\">prechangegroup</literal>&emdash;before starting to add "
242.11995 +"remote changesets"
242.11996 +msgstr "<literal role=\"hook\">prechangegroup</literal>—增加远程修改集之前"
242.11997 +
242.11998 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.11999 +#: ../en/ch09-hook.xml:1656
242.12000 +msgid ""
242.12001 +"This controlling hook is run before Mercurial begins to add a group of "
242.12002 +"changesets from another repository."
242.12003 +msgstr ""
242.12004 +
242.12005 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12006 +#: ../en/ch09-hook.xml:1660
242.12007 +msgid ""
242.12008 +"This hook does not have any information about the changesets to be added, "
242.12009 +"because it is run before transmission of those changesets is allowed to "
242.12010 +"begin.  If this hook fails, the changesets will not be transmitted."
242.12011 +msgstr ""
242.12012 +
242.12013 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12014 +#: ../en/ch09-hook.xml:1666
242.12015 +msgid ""
242.12016 +"One use for this hook is to prevent external changes from being added to a "
242.12017 +"repository.  For example, you could use this to <quote>freeze</quote> a "
242.12018 +"server-hosted branch temporarily or permanently so that users cannot push to "
242.12019 +"it, while still allowing a local administrator to modify the repository."
242.12020 +msgstr ""
242.12021 +
242.12022 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12023 +#: ../en/ch09-hook.xml:1687
242.12024 +msgid ""
242.12025 +"See also: <literal role=\"hook\">changegroup</literal> (<xref linkend=\"sec:"
242.12026 +"hook:changegroup\"/>), <literal role=\"hook\">incoming</literal> (<xref "
242.12027 +"linkend=\"sec:hook:incoming\"/>), <literal role=\"hook\">pretxnchangegroup</"
242.12028 +"literal> (<xref linkend=\"sec:hook:pretxnchangegroup\"/>)"
242.12029 +msgstr ""
242.12030 +
242.12031 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.12032 +#: ../en/ch09-hook.xml:1698
242.12033 +msgid ""
242.12034 +"<literal role=\"hook\">precommit</literal>&emdash;before starting to commit a "
242.12035 +"changeset"
242.12036 +msgstr "<literal role=\"hook\">precommit</literal>—提交修改集之前"
242.12037 +
242.12038 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12039 +#: ../en/ch09-hook.xml:1701
242.12040 +msgid ""
242.12041 +"This hook is run before Mercurial begins to commit a new changeset. It is run "
242.12042 +"before Mercurial has any of the metadata for the commit, such as the files to "
242.12043 +"be committed, the commit message, or the commit date."
242.12044 +msgstr ""
242.12045 +
242.12046 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12047 +#: ../en/ch09-hook.xml:1707
242.12048 +msgid ""
242.12049 +"One use for this hook is to disable the ability to commit new changesets, "
242.12050 +"while still allowing incoming changesets.  Another is to run a build or test, "
242.12051 +"and only allow the commit to begin if the build or test succeeds."
242.12052 +msgstr ""
242.12053 +
242.12054 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.12055 +#: ../en/ch09-hook.xml:1716
242.12056 +msgid ""
242.12057 +"<literal>parent1</literal>: A changeset ID.  The changeset ID of the first "
242.12058 +"parent of the working directory."
242.12059 +msgstr ""
242.12060 +
242.12061 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.12062 +#: ../en/ch09-hook.xml:1721
242.12063 +msgid ""
242.12064 +"<literal>parent2</literal>: A changeset ID.  The changeset ID of the second "
242.12065 +"parent of the working directory."
242.12066 +msgstr ""
242.12067 +
242.12068 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12069 +#: ../en/ch09-hook.xml:1726
242.12070 +msgid ""
242.12071 +"If the commit proceeds, the parents of the working directory will become the "
242.12072 +"parents of the new changeset."
242.12073 +msgstr ""
242.12074 +
242.12075 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12076 +#: ../en/ch09-hook.xml:1730
242.12077 +msgid ""
242.12078 +"See also: <literal role=\"hook\">commit</literal> (<xref linkend=\"sec:hook:"
242.12079 +"commit\"/>), <literal role=\"hook\">pretxncommit</literal> (<xref linkend="
242.12080 +"\"sec:hook:pretxncommit\"/>)"
242.12081 +msgstr ""
242.12082 +
242.12083 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.12084 +#: ../en/ch09-hook.xml:1738
242.12085 +msgid ""
242.12086 +"<literal role=\"hook\">preoutgoing</literal>&emdash;before starting to "
242.12087 +"propagate changesets"
242.12088 +msgstr "<literal role=\"hook\">preoutgoing</literal>—传播修改集之前"
242.12089 +
242.12090 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12091 +#: ../en/ch09-hook.xml:1741
242.12092 +msgid ""
242.12093 +"This hook is invoked before Mercurial knows the identities of the changesets "
242.12094 +"to be transmitted."
242.12095 +msgstr ""
242.12096 +
242.12097 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12098 +#: ../en/ch09-hook.xml:1745
242.12099 +msgid ""
242.12100 +"One use for this hook is to prevent changes from being transmitted to another "
242.12101 +"repository."
242.12102 +msgstr ""
242.12103 +
242.12104 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.12105 +#: ../en/ch09-hook.xml:1752
242.12106 +msgid ""
242.12107 +"<literal>source</literal>: A string.  The source of the operation that is "
242.12108 +"attempting to obtain changes from this repository (see <xref linkend=\"sec:"
242.12109 +"hook:sources\"/>).  See the documentation for the <literal>source</literal> "
242.12110 +"parameter to the <literal role=\"hook\">outgoing</literal> hook, in <xref "
242.12111 +"linkend=\"sec:hook:outgoing\"/>, for possible values of this parameter."
242.12112 +msgstr ""
242.12113 +
242.12114 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12115 +#: ../en/ch09-hook.xml:1768
242.12116 +msgid ""
242.12117 +"See also: <literal role=\"hook\">outgoing</literal> (<xref linkend=\"sec:hook:"
242.12118 +"outgoing\"/>)"
242.12119 +msgstr ""
242.12120 +
242.12121 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.12122 +#: ../en/ch09-hook.xml:1775
242.12123 +msgid ""
242.12124 +"<literal role=\"hook\">pretag</literal>&emdash;before tagging a changeset"
242.12125 +msgstr "<literal role=\"hook\">pretag</literal>—创建标签之前"
242.12126 +
242.12127 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12128 +#: ../en/ch09-hook.xml:1778
242.12129 +msgid ""
242.12130 +"This controlling hook is run before a tag is created.  If the hook succeeds, "
242.12131 +"creation of the tag proceeds.  If the hook fails, the tag is not created."
242.12132 +msgstr ""
242.12133 +
242.12134 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.12135 +#: ../en/ch09-hook.xml:1786
242.12136 +msgid ""
242.12137 +"<literal>local</literal>: A boolean.  Whether the tag is local to this "
242.12138 +"repository instance (i.e. stored in <filename role=\"special\">.hg/localtags</"
242.12139 +"filename>) or managed by Mercurial (stored in <filename role=\"special\">."
242.12140 +"hgtags</filename>)."
242.12141 +msgstr ""
242.12142 +
242.12143 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.12144 +#: ../en/ch09-hook.xml:1793
242.12145 +msgid ""
242.12146 +"<literal>node</literal>: A changeset ID.  The ID of the changeset to be "
242.12147 +"tagged."
242.12148 +msgstr ""
242.12149 +
242.12150 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.12151 +#: ../en/ch09-hook.xml:1797
242.12152 +msgid "<literal>tag</literal>: A string.  The name of the tag to be created."
242.12153 +msgstr ""
242.12154 +
242.12155 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12156 +#: ../en/ch09-hook.xml:1802
242.12157 +msgid ""
242.12158 +"If the tag to be created is revision-controlled, the <literal role=\"hook"
242.12159 +"\">precommit</literal> and <literal role=\"hook\">pretxncommit</literal> "
242.12160 +"hooks (<xref linkend=\"sec:hook:commit\"/> and <xref linkend=\"sec:hook:"
242.12161 +"pretxncommit\"/>) will also be run."
242.12162 +msgstr ""
242.12163 +
242.12164 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12165 +#: ../en/ch09-hook.xml:1810
242.12166 +msgid ""
242.12167 +"See also: <literal role=\"hook\">tag</literal> (<xref linkend=\"sec:hook:tag"
242.12168 +"\"/>)"
242.12169 +msgstr ""
242.12170 +
242.12171 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.12172 +#: ../en/ch09-hook.xml:1815
242.12173 +msgid ""
242.12174 +"<literal role=\"hook\">pretxnchangegroup</literal>&emdash;before completing "
242.12175 +"addition of remote changesets"
242.12176 +msgstr ""
242.12177 +"<literal role=\"hook\">pretxnchangegroup</literal>—完成增加远程修改集之前"
242.12178 +
242.12179 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12180 +#: ../en/ch09-hook.xml:1819
242.12181 +msgid ""
242.12182 +"This controlling hook is run before a transaction&emdash;that manages the "
242.12183 +"addition of a group of new changesets from outside the repository&emdash;"
242.12184 +"completes.  If the hook succeeds, the transaction completes, and all of the "
242.12185 +"changesets become permanent within this repository.  If the hook fails, the "
242.12186 +"transaction is rolled back, and the data for the changesets is erased."
242.12187 +msgstr ""
242.12188 +
242.12189 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12190 +#: ../en/ch09-hook.xml:1828
242.12191 +msgid ""
242.12192 +"This hook can access the metadata associated with the almost-added "
242.12193 +"changesets, but it should not do anything permanent with this data. It must "
242.12194 +"also not modify the working directory."
242.12195 +msgstr ""
242.12196 +
242.12197 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12198 +#: ../en/ch09-hook.xml:1834
242.12199 +msgid ""
242.12200 +"While this hook is running, if other Mercurial processes access this "
242.12201 +"repository, they will be able to see the almost-added changesets as if they "
242.12202 +"are permanent.  This may lead to race conditions if you do not take steps to "
242.12203 +"avoid them."
242.12204 +msgstr ""
242.12205 +
242.12206 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12207 +#: ../en/ch09-hook.xml:1841
242.12208 +msgid ""
242.12209 +"This hook can be used to automatically vet a group of changesets.  If the "
242.12210 +"hook fails, all of the changesets are <quote>rejected</quote> when the "
242.12211 +"transaction rolls back."
242.12212 +msgstr ""
242.12213 +
242.12214 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12215 +#: ../en/ch09-hook.xml:1870
242.12216 +msgid ""
242.12217 +"See also: <literal role=\"hook\">changegroup</literal> (<xref linkend=\"sec:"
242.12218 +"hook:changegroup\"/>), <literal role=\"hook\">incoming</literal> (<xref "
242.12219 +"linkend=\"sec:hook:incoming\"/>), <literal role=\"hook\">prechangegroup</"
242.12220 +"literal> (<xref linkend=\"sec:hook:prechangegroup\"/>)"
242.12221 +msgstr ""
242.12222 +
242.12223 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.12224 +#: ../en/ch09-hook.xml:1881
242.12225 +msgid ""
242.12226 +"<literal role=\"hook\">pretxncommit</literal>&emdash;before completing commit "
242.12227 +"of new changeset"
242.12228 +msgstr "<literal role=\"hook\">pretxncommit</literal>—完成提交之前"
242.12229 +
242.12230 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12231 +#: ../en/ch09-hook.xml:1884
242.12232 +msgid ""
242.12233 +"This controlling hook is run before a transaction&emdash;that manages a new "
242.12234 +"commit&emdash;completes.  If the hook succeeds, the transaction completes and "
242.12235 +"the changeset becomes permanent within this repository.  If the hook fails, "
242.12236 +"the transaction is rolled back, and the commit data is erased."
242.12237 +msgstr ""
242.12238 +
242.12239 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12240 +#: ../en/ch09-hook.xml:1892
242.12241 +msgid ""
242.12242 +"This hook can access the metadata associated with the almost-new changeset, "
242.12243 +"but it should not do anything permanent with this data.  It must also not "
242.12244 +"modify the working directory."
242.12245 +msgstr ""
242.12246 +
242.12247 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12248 +#: ../en/ch09-hook.xml:1898
242.12249 +msgid ""
242.12250 +"While this hook is running, if other Mercurial processes access this "
242.12251 +"repository, they will be able to see the almost-new changeset as if it is "
242.12252 +"permanent.  This may lead to race conditions if you do not take steps to "
242.12253 +"avoid them."
242.12254 +msgstr ""
242.12255 +
242.12256 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12257 +#: ../en/ch09-hook.xml:1922
242.12258 +msgid ""
242.12259 +"See also: <literal role=\"hook\">precommit</literal> (<xref linkend=\"sec:"
242.12260 +"hook:precommit\"/>)"
242.12261 +msgstr ""
242.12262 +"参见: <literal role=\"hook\">precommit</literal> (<xref linkend=\"sec:hook:"
242.12263 +"precommit\"/>)"
242.12264 +
242.12265 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.12266 +#: ../en/ch09-hook.xml:1929
242.12267 +msgid ""
242.12268 +"<literal role=\"hook\">preupdate</literal>&emdash;before updating or merging "
242.12269 +"working directory"
242.12270 +msgstr "<literal role=\"hook\">preupdate</literal>—更新或合并工作目录之前"
242.12271 +
242.12272 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12273 +#: ../en/ch09-hook.xml:1932
242.12274 +msgid ""
242.12275 +"This controlling hook is run before an update or merge of the working "
242.12276 +"directory begins.  It is run only if Mercurial's normal pre-update checks "
242.12277 +"determine that the update or merge can proceed.  If the hook succeeds, the "
242.12278 +"update or merge may proceed; if it fails, the update or merge does not start."
242.12279 +msgstr ""
242.12280 +
242.12281 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.12282 +#: ../en/ch09-hook.xml:1943
242.12283 +msgid ""
242.12284 +"<literal>parent1</literal>: A changeset ID. The ID of the parent that the "
242.12285 +"working directory is to be updated to.  If the working directory is being "
242.12286 +"merged, it will not change this parent."
242.12287 +msgstr ""
242.12288 +
242.12289 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.12290 +#: ../en/ch09-hook.xml:1949
242.12291 +msgid ""
242.12292 +"<literal>parent2</literal>: A changeset ID. Only set if the working directory "
242.12293 +"is being merged.  The ID of the revision that the working directory is being "
242.12294 +"merged with."
242.12295 +msgstr ""
242.12296 +
242.12297 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12298 +#: ../en/ch09-hook.xml:1956
242.12299 +msgid ""
242.12300 +"See also: <literal role=\"hook\">update</literal> (<xref linkend=\"sec:hook:"
242.12301 +"update\"/>)"
242.12302 +msgstr ""
242.12303 +
242.12304 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.12305 +#: ../en/ch09-hook.xml:1961
242.12306 +msgid "<literal role=\"hook\">tag</literal>&emdash;after tagging a changeset"
242.12307 +msgstr "<literal role=\"hook\">tag</literal>—创建标签之后"
242.12308 +
242.12309 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12310 +#: ../en/ch09-hook.xml:1964
242.12311 +msgid "This hook is run after a tag has been created."
242.12312 +msgstr ""
242.12313 +
242.12314 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.12315 +#: ../en/ch09-hook.xml:1970
242.12316 +msgid ""
242.12317 +"<literal>local</literal>: A boolean.  Whether the new tag is local to this "
242.12318 +"repository instance (i.e.  stored in <filename role=\"special\">.hg/"
242.12319 +"localtags</filename>) or managed by Mercurial (stored in <filename role="
242.12320 +"\"special\">.hgtags</filename>)."
242.12321 +msgstr ""
242.12322 +
242.12323 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.12324 +#: ../en/ch09-hook.xml:1978
242.12325 +msgid ""
242.12326 +"<literal>node</literal>: A changeset ID.  The ID of the changeset that was "
242.12327 +"tagged."
242.12328 +msgstr ""
242.12329 +
242.12330 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.12331 +#: ../en/ch09-hook.xml:1982
242.12332 +msgid "<literal>tag</literal>: A string.  The name of the tag that was created."
242.12333 +msgstr ""
242.12334 +
242.12335 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12336 +#: ../en/ch09-hook.xml:1987
242.12337 +msgid ""
242.12338 +"If the created tag is revision-controlled, the <literal role=\"hook\">commit</"
242.12339 +"literal> hook (section <xref linkend=\"sec:hook:commit\"/>) is run before "
242.12340 +"this hook."
242.12341 +msgstr ""
242.12342 +
242.12343 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12344 +#: ../en/ch09-hook.xml:1992
242.12345 +msgid ""
242.12346 +"See also: <literal role=\"hook\">pretag</literal> (<xref linkend=\"sec:hook:"
242.12347 +"pretag\"/>)"
242.12348 +msgstr ""
242.12349 +"参见: <literal role=\"hook\">pretag</literal> (<xref linkend=\"sec:hook:pretag"
242.12350 +"\"/>)"
242.12351 +
242.12352 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.12353 +#: ../en/ch09-hook.xml:1998
242.12354 +msgid ""
242.12355 +"<literal role=\"hook\">update</literal>&emdash;after updating or merging "
242.12356 +"working directory"
242.12357 +msgstr "<literal role=\"hook\">update</literal>—更新或合并工作目录之后"
242.12358 +
242.12359 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12360 +#: ../en/ch09-hook.xml:2001
242.12361 +msgid ""
242.12362 +"This hook is run after an update or merge of the working directory "
242.12363 +"completes.  Since a merge can fail (if the external <command>hgmerge</"
242.12364 +"command> command fails to resolve conflicts in a file), this hook "
242.12365 +"communicates whether the update or merge completed cleanly."
242.12366 +msgstr ""
242.12367 +
242.12368 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.12369 +#: ../en/ch09-hook.xml:2009
242.12370 +msgid ""
242.12371 +"<literal>error</literal>: A boolean.  Indicates whether the update or merge "
242.12372 +"completed successfully."
242.12373 +msgstr ""
242.12374 +
242.12375 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.12376 +#: ../en/ch09-hook.xml:2014
242.12377 +msgid ""
242.12378 +"<literal>parent1</literal>: A changeset ID.  The ID of the parent that the "
242.12379 +"working directory was updated to.  If the working directory was merged, it "
242.12380 +"will not have changed this parent."
242.12381 +msgstr ""
242.12382 +
242.12383 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.12384 +#: ../en/ch09-hook.xml:2020
242.12385 +msgid ""
242.12386 +"<literal>parent2</literal>: A changeset ID.  Only set if the working "
242.12387 +"directory was merged.  The ID of the revision that the working directory was "
242.12388 +"merged with."
242.12389 +msgstr ""
242.12390 +
242.12391 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12392 +#: ../en/ch09-hook.xml:2026
242.12393 +msgid ""
242.12394 +"See also: <literal role=\"hook\">preupdate</literal> (<xref linkend=\"sec:"
242.12395 +"hook:preupdate\"/>)"
242.12396 +msgstr ""
242.12397 +
242.12398 +#. type: Content of: <book><chapter><title>
242.12399 +#: ../en/ch10-template.xml:5
242.12400 +msgid "Customising the output of Mercurial"
242.12401 +msgstr "定制 Mercurial 的输出"
242.12402 +
242.12403 +#. type: Content of: <book><chapter><para>
242.12404 +#: ../en/ch10-template.xml:7
242.12405 +msgid ""
242.12406 +"Mercurial provides a powerful mechanism to let you control how it displays "
242.12407 +"information.  The mechanism is based on templates.  You can use templates to "
242.12408 +"generate specific output for a single command, or to customise the entire "
242.12409 +"appearance of the built-in web interface."
242.12410 +msgstr ""
242.12411 +
242.12412 +#. type: Content of: <book><chapter><sect1><title>
242.12413 +#: ../en/ch10-template.xml:14
242.12414 +msgid "Using precanned output styles"
242.12415 +msgstr "使用预定义的输出样式"
242.12416 +
242.12417 +#. type: Content of: <book><chapter><sect1><para>
242.12418 +#: ../en/ch10-template.xml:16
242.12419 +msgid ""
242.12420 +"Packaged with Mercurial are some output styles that you can use immediately.  "
242.12421 +"A style is simply a precanned template that someone wrote and installed "
242.12422 +"somewhere that Mercurial can find."
242.12423 +msgstr ""
242.12424 +
242.12425 +#. type: Content of: <book><chapter><sect1><para>
242.12426 +#: ../en/ch10-template.xml:21
242.12427 +msgid ""
242.12428 +"Before we take a look at Mercurial's bundled styles, let's review its normal "
242.12429 +"output."
242.12430 +msgstr ""
242.12431 +
242.12432 +#. type: Content of: <book><chapter><sect1><para>
242.12433 +#: ../en/ch10-template.xml:26
242.12434 +msgid ""
242.12435 +"This is somewhat informative, but it takes up a lot of space&emdash;five "
242.12436 +"lines of output per changeset.  The <literal>compact</literal> style reduces "
242.12437 +"this to three lines, presented in a sparse manner."
242.12438 +msgstr ""
242.12439 +
242.12440 +#. type: Content of: <book><chapter><sect1><para>
242.12441 +#: ../en/ch10-template.xml:33
242.12442 +msgid ""
242.12443 +"The <literal>changelog</literal> style hints at the expressive power of "
242.12444 +"Mercurial's templating engine.  This style attempts to follow the GNU "
242.12445 +"Project's changelog guidelines<citation>web:changelog</citation>."
242.12446 +msgstr ""
242.12447 +
242.12448 +#. type: Content of: <book><chapter><sect1><para>
242.12449 +#: ../en/ch10-template.xml:40
242.12450 +msgid ""
242.12451 +"You will not be shocked to learn that Mercurial's default output style is "
242.12452 +"named <literal>default</literal>."
242.12453 +msgstr ""
242.12454 +
242.12455 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.12456 +#: ../en/ch10-template.xml:44
242.12457 +msgid "Setting a default style"
242.12458 +msgstr "设置默认样式"
242.12459 +
242.12460 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12461 +#: ../en/ch10-template.xml:46
242.12462 +msgid ""
242.12463 +"You can modify the output style that Mercurial will use for every command by "
242.12464 +"editing your <filename role=\"special\">~/.hgrc</filename> file, naming the "
242.12465 +"style you would prefer to use."
242.12466 +msgstr ""
242.12467 +
242.12468 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12469 +#: ../en/ch10-template.xml:54
242.12470 +msgid ""
242.12471 +"If you write a style of your own, you can use it by either providing the path "
242.12472 +"to your style file, or copying your style file into a location where "
242.12473 +"Mercurial can find it (typically the <literal>templates</literal> "
242.12474 +"subdirectory of your Mercurial install directory)."
242.12475 +msgstr ""
242.12476 +
242.12477 +#. type: Content of: <book><chapter><sect1><title>
242.12478 +#: ../en/ch10-template.xml:63
242.12479 +msgid "Commands that support styles and templates"
242.12480 +msgstr "支持样式和模版的命令"
242.12481 +
242.12482 +#. type: Content of: <book><chapter><sect1><para>
242.12483 +#: ../en/ch10-template.xml:65
242.12484 +msgid ""
242.12485 +"All of Mercurial's <quote><literal>log</literal>-like</quote> commands let "
242.12486 +"you use styles and templates: <command role=\"hg-cmd\">hg incoming</command>, "
242.12487 +"<command role=\"hg-cmd\">hg log</command>, <command role=\"hg-cmd\">hg "
242.12488 +"outgoing</command>, and <command role=\"hg-cmd\">hg tip</command>."
242.12489 +msgstr ""
242.12490 +
242.12491 +#. type: Content of: <book><chapter><sect1><para>
242.12492 +#: ../en/ch10-template.xml:72
242.12493 +msgid ""
242.12494 +"As I write this manual, these are so far the only commands that support "
242.12495 +"styles and templates.  Since these are the most important commands that need "
242.12496 +"customisable output, there has been little pressure from the Mercurial user "
242.12497 +"community to add style and template support to other commands."
242.12498 +msgstr ""
242.12499 +
242.12500 +#. type: Content of: <book><chapter><sect1><title>
242.12501 +#: ../en/ch10-template.xml:80
242.12502 +msgid "The basics of templating"
242.12503 +msgstr "模版基础"
242.12504 +
242.12505 +#. type: Content of: <book><chapter><sect1><para>
242.12506 +#: ../en/ch10-template.xml:82
242.12507 +msgid ""
242.12508 +"At its simplest, a Mercurial template is a piece of text.  Some of the text "
242.12509 +"never changes, while other parts are <emphasis>expanded</emphasis>, or "
242.12510 +"replaced with new text, when necessary."
242.12511 +msgstr ""
242.12512 +
242.12513 +#. type: Content of: <book><chapter><sect1><para>
242.12514 +#: ../en/ch10-template.xml:87
242.12515 +msgid ""
242.12516 +"Before we continue, let's look again at a simple example of Mercurial's "
242.12517 +"normal output."
242.12518 +msgstr ""
242.12519 +
242.12520 +#. type: Content of: <book><chapter><sect1><para>
242.12521 +#: ../en/ch10-template.xml:92
242.12522 +msgid ""
242.12523 +"Now, let's run the same command, but using a template to change its output."
242.12524 +msgstr ""
242.12525 +
242.12526 +#. type: Content of: <book><chapter><sect1><para>
242.12527 +#: ../en/ch10-template.xml:97
242.12528 +msgid ""
242.12529 +"The example above illustrates the simplest possible template; it's just a "
242.12530 +"piece of static text, printed once for each changeset.  The <option role=\"hg-"
242.12531 +"opt-log\">--template</option> option to the <command role=\"hg-cmd\">hg log</"
242.12532 +"command> command tells Mercurial to use the given text as the template when "
242.12533 +"printing each changeset."
242.12534 +msgstr ""
242.12535 +
242.12536 +#. type: Content of: <book><chapter><sect1><para>
242.12537 +#: ../en/ch10-template.xml:105
242.12538 +msgid ""
242.12539 +"Notice that the template string above ends with the text <quote><literal>\\n</"
242.12540 +"literal></quote>.  This is an <emphasis>escape sequence</emphasis>, telling "
242.12541 +"Mercurial to print a newline at the end of each template item.  If you omit "
242.12542 +"this newline, Mercurial will run each piece of output together.  See <xref "
242.12543 +"linkend=\"sec:template:escape\"/> for more details of escape sequences."
242.12544 +msgstr ""
242.12545 +
242.12546 +#. type: Content of: <book><chapter><sect1><para>
242.12547 +#: ../en/ch10-template.xml:113
242.12548 +msgid ""
242.12549 +"A template that prints a fixed string of text all the time isn't very useful; "
242.12550 +"let's try something a bit more complex."
242.12551 +msgstr ""
242.12552 +
242.12553 +#. type: Content of: <book><chapter><sect1><para>
242.12554 +#: ../en/ch10-template.xml:119
242.12555 +msgid ""
242.12556 +"As you can see, the string <quote><literal>{desc}</literal></quote> in the "
242.12557 +"template has been replaced in the output with the description of each "
242.12558 +"changeset.  Every time Mercurial finds text enclosed in curly braces "
242.12559 +"(<quote><literal>{</literal></quote> and <quote><literal>}</literal></"
242.12560 +"quote>), it will try to replace the braces and text with the expansion of "
242.12561 +"whatever is inside.  To print a literal curly brace, you must escape it, as "
242.12562 +"described in <xref linkend=\"sec:template:escape\"/>."
242.12563 +msgstr ""
242.12564 +
242.12565 +#. type: Content of: <book><chapter><sect1><title>
242.12566 +#: ../en/ch10-template.xml:131
242.12567 +msgid "Common template keywords"
242.12568 +msgstr "模版关键字"
242.12569 +
242.12570 +#. type: Content of: <book><chapter><sect1><para>
242.12571 +#: ../en/ch10-template.xml:133
242.12572 +msgid ""
242.12573 +"You can start writing simple templates immediately using the keywords below."
242.12574 +msgstr ""
242.12575 +
242.12576 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12577 +#: ../en/ch10-template.xml:137
242.12578 +msgid ""
242.12579 +"<literal role=\"template-keyword\">author</literal>: String.  The unmodified "
242.12580 +"author of the changeset."
242.12581 +msgstr ""
242.12582 +
242.12583 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12584 +#: ../en/ch10-template.xml:141
242.12585 +msgid ""
242.12586 +"<literal role=\"template-keyword\">branches</literal>: String.  The name of "
242.12587 +"the branch on which the changeset was committed.  Will be empty if the branch "
242.12588 +"name was <literal>default</literal>."
242.12589 +msgstr ""
242.12590 +
242.12591 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12592 +#: ../en/ch10-template.xml:147
242.12593 +msgid ""
242.12594 +"<literal role=\"template-keyword\">date</literal>: Date information.  The "
242.12595 +"date when the changeset was committed.  This is <emphasis>not</emphasis> "
242.12596 +"human-readable; you must pass it through a filter that will render it "
242.12597 +"appropriately.  See <xref linkend=\"sec:template:filter\"/> for more "
242.12598 +"information on filters. The date is expressed as a pair of numbers.  The "
242.12599 +"first number is a Unix UTC timestamp (seconds since January 1, 1970); the "
242.12600 +"second is the offset of the committer's timezone from UTC, in seconds."
242.12601 +msgstr ""
242.12602 +
242.12603 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12604 +#: ../en/ch10-template.xml:158
242.12605 +msgid ""
242.12606 +"<literal role=\"template-keyword\">desc</literal>: String.  The text of the "
242.12607 +"changeset description."
242.12608 +msgstr ""
242.12609 +
242.12610 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12611 +#: ../en/ch10-template.xml:161
242.12612 +msgid ""
242.12613 +"<literal role=\"template-keyword\">files</literal>: List of strings.  All "
242.12614 +"files modified, added, or removed by this changeset."
242.12615 +msgstr ""
242.12616 +
242.12617 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12618 +#: ../en/ch10-template.xml:166
242.12619 +msgid ""
242.12620 +"<literal role=\"template-keyword\">file_adds</literal>: List of strings.  "
242.12621 +"Files added by this changeset."
242.12622 +msgstr ""
242.12623 +
242.12624 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12625 +#: ../en/ch10-template.xml:170
242.12626 +msgid ""
242.12627 +"<literal role=\"template-keyword\">file_dels</literal>: List of strings.  "
242.12628 +"Files removed by this changeset."
242.12629 +msgstr ""
242.12630 +
242.12631 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12632 +#: ../en/ch10-template.xml:174
242.12633 +msgid ""
242.12634 +"<literal role=\"template-keyword\">node</literal>: String.  The changeset "
242.12635 +"identification hash, as a 40-character hexadecimal string."
242.12636 +msgstr ""
242.12637 +
242.12638 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12639 +#: ../en/ch10-template.xml:178
242.12640 +msgid ""
242.12641 +"<literal role=\"template-keyword\">parents</literal>: List of strings.  The "
242.12642 +"parents of the changeset."
242.12643 +msgstr ""
242.12644 +
242.12645 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12646 +#: ../en/ch10-template.xml:182
242.12647 +msgid ""
242.12648 +"<literal role=\"template-keyword\">rev</literal>: Integer.  The repository-"
242.12649 +"local changeset revision number."
242.12650 +msgstr ""
242.12651 +
242.12652 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12653 +#: ../en/ch10-template.xml:186
242.12654 +msgid ""
242.12655 +"<literal role=\"template-keyword\">tags</literal>: List of strings.  Any tags "
242.12656 +"associated with the changeset."
242.12657 +msgstr ""
242.12658 +
242.12659 +#. type: Content of: <book><chapter><sect1><para>
242.12660 +#: ../en/ch10-template.xml:191
242.12661 +msgid ""
242.12662 +"A few simple experiments will show us what to expect when we use these "
242.12663 +"keywords; you can see the results below."
242.12664 +msgstr ""
242.12665 +
242.12666 +#. type: Content of: <book><chapter><sect1><para>
242.12667 +#: ../en/ch10-template.xml:196
242.12668 +msgid ""
242.12669 +"As we noted above, the date keyword does not produce human-readable output, "
242.12670 +"so we must treat it specially.  This involves using a <emphasis>filter</"
242.12671 +"emphasis>, about which more in <xref linkend=\"sec:template:filter\"/>."
242.12672 +msgstr ""
242.12673 +
242.12674 +#. type: Content of: <book><chapter><sect1><title>
242.12675 +#: ../en/ch10-template.xml:205
242.12676 +msgid "Escape sequences"
242.12677 +msgstr "转义序列"
242.12678 +
242.12679 +#. type: Content of: <book><chapter><sect1><para>
242.12680 +#: ../en/ch10-template.xml:207
242.12681 +msgid ""
242.12682 +"Mercurial's templating engine recognises the most commonly used escape "
242.12683 +"sequences in strings.  When it sees a backslash (<quote><literal>\\</"
242.12684 +"literal></quote>) character, it looks at the following character and "
242.12685 +"substitutes the two characters with a single replacement, as described below."
242.12686 +msgstr ""
242.12687 +
242.12688 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12689 +#: ../en/ch10-template.xml:214
242.12690 +msgid ""
242.12691 +"<literal>\\</literal>: Backslash, <quote><literal>\\</literal></quote>, ASCII "
242.12692 +"134."
242.12693 +msgstr ""
242.12694 +
242.12695 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12696 +#: ../en/ch10-template.xml:218
242.12697 +msgid "<literal>\\n</literal>: Newline, ASCII 12."
242.12698 +msgstr ""
242.12699 +
242.12700 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12701 +#: ../en/ch10-template.xml:221
242.12702 +msgid "<literal>\\r</literal>: Carriage return, ASCII 15."
242.12703 +msgstr ""
242.12704 +
242.12705 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12706 +#: ../en/ch10-template.xml:224
242.12707 +msgid "<literal>\\t</literal>: Tab, ASCII 11."
242.12708 +msgstr ""
242.12709 +
242.12710 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12711 +#: ../en/ch10-template.xml:227
242.12712 +msgid "<literal>\\v</literal>: Vertical tab, ASCII 13."
242.12713 +msgstr ""
242.12714 +
242.12715 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12716 +#: ../en/ch10-template.xml:230
242.12717 +msgid ""
242.12718 +"<literal>{</literal>: Open curly brace, <quote><literal>{</literal></quote>, "
242.12719 +"ASCII 173."
242.12720 +msgstr ""
242.12721 +
242.12722 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12723 +#: ../en/ch10-template.xml:234
242.12724 +msgid ""
242.12725 +"<literal>}</literal>: Close curly brace, <quote><literal>}</literal></quote>, "
242.12726 +"ASCII 175."
242.12727 +msgstr ""
242.12728 +
242.12729 +#. type: Content of: <book><chapter><sect1><para>
242.12730 +#: ../en/ch10-template.xml:239
242.12731 +msgid ""
242.12732 +"As indicated above, if you want the expansion of a template to contain a "
242.12733 +"literal <quote><literal>\\</literal></quote>, <quote><literal>{</literal></"
242.12734 +"quote>, or <quote><literal>{</literal></quote> character, you must escape it."
242.12735 +msgstr ""
242.12736 +
242.12737 +#. type: Content of: <book><chapter><sect1><title>
242.12738 +#: ../en/ch10-template.xml:247
242.12739 +msgid "Filtering keywords to change their results"
242.12740 +msgstr "通过过滤关键字来修改输出结果"
242.12741 +
242.12742 +#. type: Content of: <book><chapter><sect1><para>
242.12743 +#: ../en/ch10-template.xml:249
242.12744 +msgid ""
242.12745 +"Some of the results of template expansion are not immediately easy to use.  "
242.12746 +"Mercurial lets you specify an optional chain of <emphasis>filters</emphasis> "
242.12747 +"to modify the result of expanding a keyword.  You have already seen a common "
242.12748 +"filter, <literal role=\"template-kw-filt-date\">isodate</literal>, in action "
242.12749 +"above, to make a date readable."
242.12750 +msgstr ""
242.12751 +
242.12752 +#. type: Content of: <book><chapter><sect1><para>
242.12753 +#: ../en/ch10-template.xml:256
242.12754 +msgid ""
242.12755 +"Below is a list of the most commonly used filters that Mercurial supports.  "
242.12756 +"While some filters can be applied to any text, others can only be used in "
242.12757 +"specific circumstances.  The name of each filter is followed first by an "
242.12758 +"indication of where it can be used, then a description of its effect."
242.12759 +msgstr ""
242.12760 +
242.12761 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12762 +#: ../en/ch10-template.xml:263
242.12763 +msgid ""
242.12764 +"<literal role=\"template-filter\">addbreaks</literal>: Any text. Add an XHTML "
242.12765 +"<quote><literal>&lt;br/&gt;</literal></quote> tag before the end of every "
242.12766 +"line except the last.  For example, <quote><literal>foo\\nbar</literal></"
242.12767 +"quote> becomes <quote><literal>foo&lt;br/&gt;\\nbar</literal></quote>."
242.12768 +msgstr ""
242.12769 +
242.12770 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12771 +#: ../en/ch10-template.xml:270
242.12772 +msgid ""
242.12773 +"<literal role=\"template-kw-filt-date\">age</literal>: <literal role="
242.12774 +"\"template-keyword\">date</literal> keyword.  Render the age of the date, "
242.12775 +"relative to the current time.  Yields a string like <quote><literal>10 "
242.12776 +"minutes</literal></quote>."
242.12777 +msgstr ""
242.12778 +
242.12779 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12780 +#: ../en/ch10-template.xml:277
242.12781 +msgid ""
242.12782 +"<literal role=\"template-filter\">basename</literal>: Any text, but most "
242.12783 +"useful for the <literal role=\"template-keyword\">files</literal> keyword and "
242.12784 +"its relatives.  Treat the text as a path, and return the basename. For "
242.12785 +"example, <quote><literal>foo/bar/baz</literal></quote> becomes "
242.12786 +"<quote><literal>baz</literal></quote>."
242.12787 +msgstr ""
242.12788 +
242.12789 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12790 +#: ../en/ch10-template.xml:286
242.12791 +msgid ""
242.12792 +"<literal role=\"template-kw-filt-date\">date</literal>: <literal role="
242.12793 +"\"template-keyword\">date</literal> keyword.  Render a date in a similar "
242.12794 +"format to the Unix <literal role=\"template-keyword\">date</literal> command, "
242.12795 +"but with timezone included.  Yields a string like <quote><literal>Mon Sep 04 "
242.12796 +"15:13:13 2006 -0700</literal></quote>."
242.12797 +msgstr ""
242.12798 +
242.12799 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12800 +#: ../en/ch10-template.xml:294
242.12801 +msgid ""
242.12802 +"<literal role=\"template-kw-filt-author\">domain</literal>: Any text, but "
242.12803 +"most useful for the <literal role=\"template-keyword\">author</literal> "
242.12804 +"keyword.  Finds the first string that looks like an email address, and "
242.12805 +"extract just the domain component.  For example, <quote><literal>Bryan "
242.12806 +"O'Sullivan &lt;bos@serpentine.com&gt;</literal></quote> becomes "
242.12807 +"<quote><literal>serpentine.com</literal></quote>."
242.12808 +msgstr ""
242.12809 +
242.12810 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12811 +#: ../en/ch10-template.xml:304
242.12812 +msgid ""
242.12813 +"<literal role=\"template-kw-filt-author\">email</literal>: Any text, but most "
242.12814 +"useful for the <literal role=\"template-keyword\">author</literal> keyword.  "
242.12815 +"Extract the first string that looks like an email address.  For example, "
242.12816 +"<quote><literal>Bryan O'Sullivan &lt;bos@serpentine.com&gt;</literal></quote> "
242.12817 +"becomes <quote><literal>bos@serpentine.com</literal></quote>."
242.12818 +msgstr ""
242.12819 +
242.12820 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12821 +#: ../en/ch10-template.xml:313
242.12822 +msgid ""
242.12823 +"<literal role=\"template-filter\">escape</literal>: Any text.  Replace the "
242.12824 +"special XML/XHTML characters <quote><literal>&amp;</literal></quote>, "
242.12825 +"<quote><literal>&lt;</literal></quote> and <quote><literal>&gt;</literal></"
242.12826 +"quote> with XML entities."
242.12827 +msgstr ""
242.12828 +
242.12829 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12830 +#: ../en/ch10-template.xml:321
242.12831 +msgid ""
242.12832 +"<literal role=\"template-filter\">fill68</literal>: Any text.  Wrap the text "
242.12833 +"to fit in 68 columns.  This is useful before you pass text through the "
242.12834 +"<literal role=\"template-filter\">tabindent</literal> filter, and still want "
242.12835 +"it to fit in an 80-column fixed-font window."
242.12836 +msgstr ""
242.12837 +
242.12838 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12839 +#: ../en/ch10-template.xml:329
242.12840 +msgid ""
242.12841 +"<literal role=\"template-filter\">fill76</literal>: Any text.  Wrap the text "
242.12842 +"to fit in 76 columns."
242.12843 +msgstr ""
242.12844 +
242.12845 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12846 +#: ../en/ch10-template.xml:333
242.12847 +msgid ""
242.12848 +"<literal role=\"template-filter\">firstline</literal>: Any text.  Yield the "
242.12849 +"first line of text, without any trailing newlines."
242.12850 +msgstr ""
242.12851 +
242.12852 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12853 +#: ../en/ch10-template.xml:338
242.12854 +msgid ""
242.12855 +"<literal role=\"template-kw-filt-date\">hgdate</literal>: <literal role="
242.12856 +"\"template-keyword\">date</literal> keyword.  Render the date as a pair of "
242.12857 +"readable numbers.  Yields a string like <quote><literal>1157407993 25200</"
242.12858 +"literal></quote>."
242.12859 +msgstr ""
242.12860 +
242.12861 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12862 +#: ../en/ch10-template.xml:345
242.12863 +msgid ""
242.12864 +"<literal role=\"template-kw-filt-date\">isodate</literal>: <literal role="
242.12865 +"\"template-keyword\">date</literal> keyword.  Render the date as a text "
242.12866 +"string in ISO 8601 format.  Yields a string like <quote><literal>2006-09-04 "
242.12867 +"15:13:13 -0700</literal></quote>."
242.12868 +msgstr ""
242.12869 +
242.12870 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12871 +#: ../en/ch10-template.xml:352
242.12872 +msgid ""
242.12873 +"<literal role=\"template-filter\">obfuscate</literal>: Any text, but most "
242.12874 +"useful for the <literal role=\"template-keyword\">author</literal> keyword.  "
242.12875 +"Yield the input text rendered as a sequence of XML entities.  This helps to "
242.12876 +"defeat some particularly stupid screen-scraping email harvesting spambots."
242.12877 +msgstr ""
242.12878 +
242.12879 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12880 +#: ../en/ch10-template.xml:360
242.12881 +msgid ""
242.12882 +"<literal role=\"template-kw-filt-author\">person</literal>: Any text, but "
242.12883 +"most useful for the <literal role=\"template-keyword\">author</literal> "
242.12884 +"keyword.  Yield the text before an email address. For example, "
242.12885 +"<quote><literal>Bryan O'Sullivan &lt;bos@serpentine.com&gt;</literal></quote> "
242.12886 +"becomes <quote><literal>Bryan O'Sullivan</literal></quote>."
242.12887 +msgstr ""
242.12888 +
242.12889 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12890 +#: ../en/ch10-template.xml:369
242.12891 +msgid ""
242.12892 +"<literal role=\"template-kw-filt-date\">rfc822date</literal>: <literal role="
242.12893 +"\"template-keyword\">date</literal> keyword.  Render a date using the same "
242.12894 +"format used in email headers.  Yields a string like <quote><literal>Mon, 04 "
242.12895 +"Sep 2006 15:13:13 -0700</literal></quote>."
242.12896 +msgstr ""
242.12897 +
242.12898 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12899 +#: ../en/ch10-template.xml:376
242.12900 +msgid ""
242.12901 +"<literal role=\"template-kw-filt-node\">short</literal>: Changeset hash.  "
242.12902 +"Yield the short form of a changeset hash, i.e. a 12-character hexadecimal "
242.12903 +"string."
242.12904 +msgstr ""
242.12905 +
242.12906 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12907 +#: ../en/ch10-template.xml:381
242.12908 +msgid ""
242.12909 +"<literal role=\"template-kw-filt-date\">shortdate</literal>: <literal role="
242.12910 +"\"template-keyword\">date</literal> keyword.  Render the year, month, and day "
242.12911 +"of the date.  Yields a string like <quote><literal>2006-09-04</literal></"
242.12912 +"quote>."
242.12913 +msgstr ""
242.12914 +
242.12915 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12916 +#: ../en/ch10-template.xml:387
242.12917 +msgid ""
242.12918 +"<literal role=\"template-filter\">strip</literal>: Any text.  Strip all "
242.12919 +"leading and trailing whitespace from the string."
242.12920 +msgstr ""
242.12921 +
242.12922 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12923 +#: ../en/ch10-template.xml:391
242.12924 +msgid ""
242.12925 +"<literal role=\"template-filter\">tabindent</literal>: Any text.  Yield the "
242.12926 +"text, with every line except the first starting with a tab character."
242.12927 +msgstr ""
242.12928 +
242.12929 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12930 +#: ../en/ch10-template.xml:396
242.12931 +msgid ""
242.12932 +"<literal role=\"template-filter\">urlescape</literal>: Any text.  Escape all "
242.12933 +"characters that are considered <quote>special</quote> by URL parsers.  For "
242.12934 +"example, <literal>foo bar</literal> becomes <literal>foo%20bar</literal>."
242.12935 +msgstr ""
242.12936 +
242.12937 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.12938 +#: ../en/ch10-template.xml:403
242.12939 +msgid ""
242.12940 +"<literal role=\"template-kw-filt-author\">user</literal>: Any text, but most "
242.12941 +"useful for the <literal role=\"template-keyword\">author</literal> keyword.  "
242.12942 +"Return the <quote>user</quote> portion of an email address.  For example, "
242.12943 +"<quote><literal>Bryan O'Sullivan &lt;bos@serpentine.com&gt;</literal></quote> "
242.12944 +"becomes <quote><literal>bos</literal></quote>."
242.12945 +msgstr ""
242.12946 +
242.12947 +#. type: Content of: <book><chapter><sect1><note><para>
242.12948 +#: ../en/ch10-template.xml:416
242.12949 +msgid ""
242.12950 +"If you try to apply a filter to a piece of data that it cannot process, "
242.12951 +"Mercurial will fail and print a Python exception.  For example, trying to run "
242.12952 +"the output of the <literal role=\"template-keyword\">desc</literal> keyword "
242.12953 +"into the <literal role=\"template-kw-filt-date\">isodate</literal> filter is "
242.12954 +"not a good idea."
242.12955 +msgstr ""
242.12956 +
242.12957 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.12958 +#: ../en/ch10-template.xml:425
242.12959 +msgid "Combining filters"
242.12960 +msgstr "组合过滤器"
242.12961 +
242.12962 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12963 +#: ../en/ch10-template.xml:427
242.12964 +msgid ""
242.12965 +"It is easy to combine filters to yield output in the form you would like.  "
242.12966 +"The following chain of filters tidies up a description, then makes sure that "
242.12967 +"it fits cleanly into 68 columns, then indents it by a further 8 characters "
242.12968 +"(at least on Unix-like systems, where a tab is conventionally 8 characters "
242.12969 +"wide)."
242.12970 +msgstr ""
242.12971 +
242.12972 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12973 +#: ../en/ch10-template.xml:436
242.12974 +msgid ""
242.12975 +"Note the use of <quote><literal>\\t</literal></quote> (a tab character) in "
242.12976 +"the template to force the first line to be indented; this is necessary since "
242.12977 +"<literal role=\"template-keyword\">tabindent</literal> indents all lines "
242.12978 +"<emphasis>except</emphasis> the first."
242.12979 +msgstr ""
242.12980 +
242.12981 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.12982 +#: ../en/ch10-template.xml:442
242.12983 +msgid ""
242.12984 +"Keep in mind that the order of filters in a chain is significant.  The first "
242.12985 +"filter is applied to the result of the keyword; the second to the result of "
242.12986 +"the first filter; and so on.  For example, using <literal>fill68|tabindent</"
242.12987 +"literal> gives very different results from <literal>tabindent|fill68</"
242.12988 +"literal>."
242.12989 +msgstr ""
242.12990 +
242.12991 +#. type: Content of: <book><chapter><sect1><title>
242.12992 +#: ../en/ch10-template.xml:453
242.12993 +msgid "From templates to styles"
242.12994 +msgstr "从模版到样式"
242.12995 +
242.12996 +#. type: Content of: <book><chapter><sect1><para>
242.12997 +#: ../en/ch10-template.xml:455
242.12998 +msgid ""
242.12999 +"A command line template provides a quick and simple way to format some "
242.13000 +"output.  Templates can become verbose, though, and it's useful to be able to "
242.13001 +"give a template a name.  A style file is a template with a name, stored in a "
242.13002 +"file."
242.13003 +msgstr ""
242.13004 +
242.13005 +#. type: Content of: <book><chapter><sect1><para>
242.13006 +#: ../en/ch10-template.xml:460
242.13007 +msgid ""
242.13008 +"More than that, using a style file unlocks the power of Mercurial's "
242.13009 +"templating engine in ways that are not possible using the command line "
242.13010 +"<option role=\"hg-opt-log\">--template</option> option."
242.13011 +msgstr ""
242.13012 +
242.13013 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.13014 +#: ../en/ch10-template.xml:466
242.13015 +msgid "The simplest of style files"
242.13016 +msgstr "最简单的样式文件"
242.13017 +
242.13018 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13019 +#: ../en/ch10-template.xml:468
242.13020 +msgid "Our simple style file contains just one line:"
242.13021 +msgstr ""
242.13022 +
242.13023 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13024 +#: ../en/ch10-template.xml:472
242.13025 +msgid ""
242.13026 +"This tells Mercurial, <quote>if you're printing a changeset, use the text on "
242.13027 +"the right as the template</quote>."
242.13028 +msgstr ""
242.13029 +
242.13030 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.13031 +#: ../en/ch10-template.xml:478
242.13032 +msgid "Style file syntax"
242.13033 +msgstr "样式文件语法"
242.13034 +
242.13035 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13036 +#: ../en/ch10-template.xml:480
242.13037 +msgid "The syntax rules for a style file are simple."
242.13038 +msgstr ""
242.13039 +
242.13040 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.13041 +#: ../en/ch10-template.xml:483
242.13042 +msgid "The file is processed one line at a time."
242.13043 +msgstr ""
242.13044 +
242.13045 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.13046 +#: ../en/ch10-template.xml:486
242.13047 +msgid "Leading and trailing white space are ignored."
242.13048 +msgstr ""
242.13049 +
242.13050 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.13051 +#: ../en/ch10-template.xml:489
242.13052 +msgid "Empty lines are skipped."
242.13053 +msgstr ""
242.13054 +
242.13055 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.13056 +#: ../en/ch10-template.xml:491
242.13057 +msgid ""
242.13058 +"If a line starts with either of the characters <quote><literal>#</literal></"
242.13059 +"quote> or <quote><literal>;</literal></quote>, the entire line is treated as "
242.13060 +"a comment, and skipped as if empty."
242.13061 +msgstr ""
242.13062 +
242.13063 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.13064 +#: ../en/ch10-template.xml:496
242.13065 +msgid ""
242.13066 +"A line starts with a keyword.  This must start with an alphabetic character "
242.13067 +"or underscore, and can subsequently contain any alphanumeric character or "
242.13068 +"underscore.  (In regexp notation, a keyword must match <literal>[A-Za-z_][A-"
242.13069 +"Za-z0-9_]*</literal>.)"
242.13070 +msgstr ""
242.13071 +
242.13072 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.13073 +#: ../en/ch10-template.xml:502
242.13074 +msgid ""
242.13075 +"The next element must be an <quote><literal>=</literal></quote> character, "
242.13076 +"which can be preceded or followed by an arbitrary amount of white space."
242.13077 +msgstr ""
242.13078 +
242.13079 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.13080 +#: ../en/ch10-template.xml:507
242.13081 +msgid ""
242.13082 +"If the rest of the line starts and ends with matching quote characters "
242.13083 +"(either single or double quote), it is treated as a template body."
242.13084 +msgstr ""
242.13085 +
242.13086 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.13087 +#: ../en/ch10-template.xml:511
242.13088 +msgid ""
242.13089 +"If the rest of the line <emphasis>does not</emphasis> start with a quote "
242.13090 +"character, it is treated as the name of a file; the contents of this file "
242.13091 +"will be read and used as a template body."
242.13092 +msgstr ""
242.13093 +
242.13094 +#. type: Content of: <book><chapter><sect1><title>
242.13095 +#: ../en/ch10-template.xml:520
242.13096 +msgid "Style files by example"
242.13097 +msgstr "样式文件例子"
242.13098 +
242.13099 +#. type: Content of: <book><chapter><sect1><para>
242.13100 +#: ../en/ch10-template.xml:522
242.13101 +msgid ""
242.13102 +"To illustrate how to write a style file, we will construct a few by example.  "
242.13103 +"Rather than provide a complete style file and walk through it, we'll mirror "
242.13104 +"the usual process of developing a style file by starting with something very "
242.13105 +"simple, and walking through a series of successively more complete examples."
242.13106 +msgstr ""
242.13107 +
242.13108 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.13109 +#: ../en/ch10-template.xml:529
242.13110 +msgid "Identifying mistakes in style files"
242.13111 +msgstr "在样式文件中定位错误"
242.13112 +
242.13113 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13114 +#: ../en/ch10-template.xml:531
242.13115 +msgid ""
242.13116 +"If Mercurial encounters a problem in a style file you are working on, it "
242.13117 +"prints a terse error message that, once you figure out what it means, is "
242.13118 +"actually quite useful."
242.13119 +msgstr ""
242.13120 +
242.13121 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13122 +#: ../en/ch10-template.xml:537
242.13123 +msgid ""
242.13124 +"Notice that <filename>broken.style</filename> attempts to define a "
242.13125 +"<literal>changeset</literal> keyword, but forgets to give any content for it. "
242.13126 +"When instructed to use this style file, Mercurial promptly complains."
242.13127 +msgstr ""
242.13128 +
242.13129 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13130 +#: ../en/ch10-template.xml:544
242.13131 +msgid "This error message looks intimidating, but it is not too hard to follow."
242.13132 +msgstr ""
242.13133 +
242.13134 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.13135 +#: ../en/ch10-template.xml:548
242.13136 +msgid ""
242.13137 +"The first component is simply Mercurial's way of saying <quote>I am giving "
242.13138 +"up</quote>."
242.13139 +msgstr ""
242.13140 +
242.13141 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.13142 +#: ../en/ch10-template.xml:552
242.13143 +msgid "Next comes the name of the style file that contains the error."
242.13144 +msgstr ""
242.13145 +
242.13146 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.13147 +#: ../en/ch10-template.xml:556
242.13148 +msgid ""
242.13149 +"Following the file name is the line number where the error was encountered."
242.13150 +msgstr ""
242.13151 +
242.13152 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.13153 +#: ../en/ch10-template.xml:560
242.13154 +msgid "Finally, a description of what went wrong."
242.13155 +msgstr ""
242.13156 +
242.13157 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.13158 +#: ../en/ch10-template.xml:564
242.13159 +msgid ""
242.13160 +"The description of the problem is not always clear (as in this case), but "
242.13161 +"even when it is cryptic, it is almost always trivial to visually inspect the "
242.13162 +"offending line in the style file and see what is wrong."
242.13163 +msgstr ""
242.13164 +
242.13165 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.13166 +#: ../en/ch10-template.xml:572
242.13167 +msgid "Uniquely identifying a repository"
242.13168 +msgstr "版本库的唯一标识"
242.13169 +
242.13170 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13171 +#: ../en/ch10-template.xml:574
242.13172 +msgid ""
242.13173 +"If you would like to be able to identify a Mercurial repository <quote>fairly "
242.13174 +"uniquely</quote> using a short string as an identifier, you can use the first "
242.13175 +"revision in the repository."
242.13176 +msgstr ""
242.13177 +
242.13178 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13179 +#: ../en/ch10-template.xml:581
242.13180 +msgid ""
242.13181 +"This is not guaranteed to be unique, but it is nevertheless useful in many "
242.13182 +"cases."
242.13183 +msgstr ""
242.13184 +
242.13185 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.13186 +#: ../en/ch10-template.xml:584
242.13187 +msgid ""
242.13188 +"It will not work in a completely empty repository, because such a repository "
242.13189 +"does not have a revision zero."
242.13190 +msgstr ""
242.13191 +
242.13192 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.13193 +#: ../en/ch10-template.xml:588
242.13194 +msgid ""
242.13195 +"Neither will it work in the (extremely rare)  case where a repository is a "
242.13196 +"merge of two or more formerly independent repositories, and you still have "
242.13197 +"those repositories around."
242.13198 +msgstr ""
242.13199 +
242.13200 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13201 +#: ../en/ch10-template.xml:593
242.13202 +msgid "Here are some uses to which you could put this identifier:"
242.13203 +msgstr ""
242.13204 +
242.13205 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.13206 +#: ../en/ch10-template.xml:596
242.13207 +msgid ""
242.13208 +"As a key into a table for a database that manages repositories on a server."
242.13209 +msgstr ""
242.13210 +
242.13211 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.13212 +#: ../en/ch10-template.xml:599
242.13213 +msgid ""
242.13214 +"As half of a {<emphasis>repository ID</emphasis>, <emphasis>revision ID</"
242.13215 +"emphasis>} tuple.  Save this information away when you run an automated build "
242.13216 +"or other activity, so that you can <quote>replay</quote> the build later if "
242.13217 +"necessary."
242.13218 +msgstr ""
242.13219 +
242.13220 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.13221 +#: ../en/ch10-template.xml:608
242.13222 +msgid "Mimicking Subversion's output"
242.13223 +msgstr "模仿 Subversion 的输出"
242.13224 +
242.13225 +#
242.13226 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13227 +#: ../en/ch10-template.xml:610
242.13228 +msgid ""
242.13229 +"Let's try to emulate the default output format used by another revision "
242.13230 +"control tool, Subversion."
242.13231 +msgstr ""
242.13232 +
242.13233 +#
242.13234 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13235 +#: ../en/ch10-template.xml:615
242.13236 +msgid ""
242.13237 +"Since Subversion's output style is fairly simple, it is easy to copy-and-"
242.13238 +"paste a hunk of its output into a file, and replace the text produced above "
242.13239 +"by Subversion with the template values we'd like to see expanded."
242.13240 +msgstr ""
242.13241 +
242.13242 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13243 +#: ../en/ch10-template.xml:622
242.13244 +msgid ""
242.13245 +"There are a few small ways in which this template deviates from the output "
242.13246 +"produced by Subversion."
242.13247 +msgstr ""
242.13248 +
242.13249 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.13250 +#: ../en/ch10-template.xml:625
242.13251 +msgid ""
242.13252 +"Subversion prints a <quote>readable</quote> date (the <quote><literal>Wed, 27 "
242.13253 +"Sep 2006</literal></quote> in the example output above) in parentheses.  "
242.13254 +"Mercurial's templating engine does not provide a way to display a date in "
242.13255 +"this format without also printing the time and time zone."
242.13256 +msgstr ""
242.13257 +
242.13258 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.13259 +#: ../en/ch10-template.xml:632
242.13260 +msgid ""
242.13261 +"We emulate Subversion's printing of <quote>separator</quote> lines full of "
242.13262 +"<quote><literal>-</literal></quote> characters by ending the template with "
242.13263 +"such a line. We use the templating engine's <literal role=\"template-keyword"
242.13264 +"\">header</literal> keyword to print a separator line as the first line of "
242.13265 +"output (see below), thus achieving similar output to Subversion."
242.13266 +msgstr ""
242.13267 +
242.13268 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.13269 +#: ../en/ch10-template.xml:641
242.13270 +msgid ""
242.13271 +"Subversion's output includes a count in the header of the number of lines in "
242.13272 +"the commit message.  We cannot replicate this in Mercurial; the templating "
242.13273 +"engine does not currently provide a filter that counts the number of lines "
242.13274 +"the template generates."
242.13275 +msgstr ""
242.13276 +
242.13277 +#
242.13278 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13279 +#: ../en/ch10-template.xml:647
242.13280 +msgid ""
242.13281 +"It took me no more than a minute or two of work to replace literal text from "
242.13282 +"an example of Subversion's output with some keywords and filters to give the "
242.13283 +"template above.  The style file simply refers to the template."
242.13284 +msgstr ""
242.13285 +
242.13286 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13287 +#: ../en/ch10-template.xml:654
242.13288 +msgid ""
242.13289 +"We could have included the text of the template file directly in the style "
242.13290 +"file by enclosing it in quotes and replacing the newlines with "
242.13291 +"<quote><literal>\\n</literal></quote> sequences, but it would have made the "
242.13292 +"style file too difficult to read.  Readability is a good guide when you're "
242.13293 +"trying to decide whether some text belongs in a style file, or in a template "
242.13294 +"file that the style file points to.  If the style file will look too big or "
242.13295 +"cluttered if you insert a literal piece of text, drop it into a template "
242.13296 +"instead."
242.13297 +msgstr ""
242.13298 +
242.13299 +#. type: Content of: <book><chapter><title>
242.13300 +#: ../en/ch11-mq.xml:5
242.13301 +msgid "Managing change with Mercurial Queues"
242.13302 +msgstr "使用 MQ 管理修改"
242.13303 +
242.13304 +#. type: Content of: <book><chapter><sect1><title>
242.13305 +#: ../en/ch11-mq.xml:8
242.13306 +msgid "The patch management problem"
242.13307 +msgstr "补丁的管理问题"
242.13308 +
242.13309 +#. type: Content of: <book><chapter><sect1><para>
242.13310 +#: ../en/ch11-mq.xml:10
242.13311 +msgid ""
242.13312 +"Here is a common scenario: you need to install a software package from "
242.13313 +"source, but you find a bug that you must fix in the source before you can "
242.13314 +"start using the package.  You make your changes, forget about the package for "
242.13315 +"a while, and a few months later you need to upgrade to a newer version of the "
242.13316 +"package.  If the newer version of the package still has the bug, you must "
242.13317 +"extract your fix from the older source tree and apply it against the newer "
242.13318 +"version.  This is a tedious task, and it's easy to make mistakes."
242.13319 +msgstr ""
242.13320 +
242.13321 +#. type: Content of: <book><chapter><sect1><para>
242.13322 +#: ../en/ch11-mq.xml:20
242.13323 +msgid ""
242.13324 +"This is a simple case of the <quote>patch management</quote> problem.  You "
242.13325 +"have an <quote>upstream</quote> source tree that you can't change; you need "
242.13326 +"to make some local changes on top of the upstream tree; and you'd like to be "
242.13327 +"able to keep those changes separate, so that you can apply them to newer "
242.13328 +"versions of the upstream source."
242.13329 +msgstr ""
242.13330 +
242.13331 +#. type: Content of: <book><chapter><sect1><para>
242.13332 +#: ../en/ch11-mq.xml:27
242.13333 +msgid ""
242.13334 +"The patch management problem arises in many situations.  Probably the most "
242.13335 +"visible is that a user of an open source software project will contribute a "
242.13336 +"bug fix or new feature to the project's maintainers in the form of a patch."
242.13337 +msgstr ""
242.13338 +
242.13339 +#. type: Content of: <book><chapter><sect1><para>
242.13340 +#: ../en/ch11-mq.xml:32
242.13341 +msgid ""
242.13342 +"Distributors of operating systems that include open source software often "
242.13343 +"need to make changes to the packages they distribute so that they will build "
242.13344 +"properly in their environments."
242.13345 +msgstr ""
242.13346 +
242.13347 +#. type: Content of: <book><chapter><sect1><para>
242.13348 +#: ../en/ch11-mq.xml:37
242.13349 +msgid ""
242.13350 +"When you have few changes to maintain, it is easy to manage a single patch "
242.13351 +"using the standard <command>diff</command> and <command>patch</command> "
242.13352 +"programs (see <xref linkend=\"sec:mq:patch\"/> for a discussion of these "
242.13353 +"tools). Once the number of changes grows, it starts to make sense to maintain "
242.13354 +"patches as discrete <quote>chunks of work,</quote> so that for example a "
242.13355 +"single patch will contain only one bug fix (the patch might modify several "
242.13356 +"files, but it's doing <quote>only one thing</quote>), and you may have a "
242.13357 +"number of such patches for different bugs you need fixed and local changes "
242.13358 +"you require.  In this situation, if you submit a bug fix patch to the "
242.13359 +"upstream maintainers of a package and they include your fix in a subsequent "
242.13360 +"release, you can simply drop that single patch when you're updating to the "
242.13361 +"newer release."
242.13362 +msgstr ""
242.13363 +
242.13364 +#. type: Content of: <book><chapter><sect1><para>
242.13365 +#: ../en/ch11-mq.xml:52
242.13366 +msgid ""
242.13367 +"Maintaining a single patch against an upstream tree is a little tedious and "
242.13368 +"error-prone, but not difficult.  However, the complexity of the problem grows "
242.13369 +"rapidly as the number of patches you have to maintain increases.  With more "
242.13370 +"than a tiny number of patches in hand, understanding which ones you have "
242.13371 +"applied and maintaining them moves from messy to overwhelming."
242.13372 +msgstr ""
242.13373 +
242.13374 +#. type: Content of: <book><chapter><sect1><para>
242.13375 +#: ../en/ch11-mq.xml:59
242.13376 +msgid ""
242.13377 +"Fortunately, Mercurial includes a powerful extension, Mercurial Queues (or "
242.13378 +"simply <quote>MQ</quote>), that massively simplifies the patch management "
242.13379 +"problem."
242.13380 +msgstr ""
242.13381 +
242.13382 +#. type: Content of: <book><chapter><sect1><title>
242.13383 +#: ../en/ch11-mq.xml:65
242.13384 +msgid "The prehistory of Mercurial Queues"
242.13385 +msgstr "MQ 的历史"
242.13386 +
242.13387 +#. type: Content of: <book><chapter><sect1><para>
242.13388 +#: ../en/ch11-mq.xml:67
242.13389 +msgid ""
242.13390 +"During the late 1990s, several Linux kernel developers started to maintain "
242.13391 +"<quote>patch series</quote> that modified the behaviour of the Linux kernel.  "
242.13392 +"Some of these series were focused on stability, some on feature coverage, and "
242.13393 +"others were more speculative."
242.13394 +msgstr ""
242.13395 +
242.13396 +#. type: Content of: <book><chapter><sect1><para>
242.13397 +#: ../en/ch11-mq.xml:73
242.13398 +msgid ""
242.13399 +"The sizes of these patch series grew rapidly.  In 2002, Andrew Morton "
242.13400 +"published some shell scripts he had been using to automate the task of "
242.13401 +"managing his patch queues.  Andrew was successfully using these scripts to "
242.13402 +"manage hundreds (sometimes thousands) of patches on top of the Linux kernel."
242.13403 +msgstr ""
242.13404 +
242.13405 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.13406 +#: ../en/ch11-mq.xml:80
242.13407 +msgid "A patchwork quilt"
242.13408 +msgstr ""
242.13409 +
242.13410 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13411 +#: ../en/ch11-mq.xml:82
242.13412 +msgid ""
242.13413 +"In early 2003, Andreas Gruenbacher and Martin Quinson borrowed the approach "
242.13414 +"of Andrew's scripts and published a tool called <quote>patchwork quilt</"
242.13415 +"quote> <citation>web:quilt</citation>, or simply <quote>quilt</quote> (see "
242.13416 +"<citation>gruenbacher:2005</citation> for a paper describing it).  Because "
242.13417 +"quilt substantially automated patch management, it rapidly gained a large "
242.13418 +"following among open source software developers."
242.13419 +msgstr ""
242.13420 +
242.13421 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13422 +#: ../en/ch11-mq.xml:91
242.13423 +msgid ""
242.13424 +"Quilt manages a <emphasis>stack of patches</emphasis> on top of a directory "
242.13425 +"tree. To begin, you tell quilt to manage a directory tree, and tell it which "
242.13426 +"files you want to manage; it stores away the names and contents of those "
242.13427 +"files.  To fix a bug, you create a new patch (using a single command), edit "
242.13428 +"the files you need to fix, then <quote>refresh</quote> the patch."
242.13429 +msgstr ""
242.13430 +
242.13431 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13432 +#: ../en/ch11-mq.xml:99
242.13433 +msgid ""
242.13434 +"The refresh step causes quilt to scan the directory tree; it updates the "
242.13435 +"patch with all of the changes you have made.  You can create another patch on "
242.13436 +"top of the first, which will track the changes required to modify the tree "
242.13437 +"from <quote>tree with one patch applied</quote> to <quote>tree with two "
242.13438 +"patches applied</quote>."
242.13439 +msgstr ""
242.13440 +
242.13441 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13442 +#: ../en/ch11-mq.xml:106
242.13443 +msgid ""
242.13444 +"You can <emphasis>change</emphasis> which patches are applied to the tree.  "
242.13445 +"If you <quote>pop</quote> a patch, the changes made by that patch will vanish "
242.13446 +"from the directory tree.  Quilt remembers which patches you have popped, "
242.13447 +"though, so you can <quote>push</quote> a popped patch again, and the "
242.13448 +"directory tree will be restored to contain the modifications in the patch.  "
242.13449 +"Most importantly, you can run the <quote>refresh</quote> command at any time, "
242.13450 +"and the topmost applied patch will be updated.  This means that you can, at "
242.13451 +"any time, change both which patches are applied and what modifications those "
242.13452 +"patches make."
242.13453 +msgstr ""
242.13454 +
242.13455 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13456 +#: ../en/ch11-mq.xml:118
242.13457 +msgid ""
242.13458 +"Quilt knows nothing about revision control tools, so it works equally well on "
242.13459 +"top of an unpacked tarball or a Subversion working copy."
242.13460 +msgstr ""
242.13461 +
242.13462 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.13463 +#: ../en/ch11-mq.xml:124
242.13464 +msgid "From patchwork quilt to Mercurial Queues"
242.13465 +msgstr "从 patchwork quilt 到 MQ"
242.13466 +
242.13467 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13468 +#: ../en/ch11-mq.xml:126
242.13469 +msgid ""
242.13470 +"In mid-2005, Chris Mason took the features of quilt and wrote an extension "
242.13471 +"that he called Mercurial Queues, which added quilt-like behaviour to "
242.13472 +"Mercurial."
242.13473 +msgstr ""
242.13474 +
242.13475 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13476 +#: ../en/ch11-mq.xml:130
242.13477 +msgid ""
242.13478 +"The key difference between quilt and MQ is that quilt knows nothing about "
242.13479 +"revision control systems, while MQ is <emphasis>integrated</emphasis> into "
242.13480 +"Mercurial.  Each patch that you push is represented as a Mercurial "
242.13481 +"changeset.  Pop a patch, and the changeset goes away."
242.13482 +msgstr ""
242.13483 +
242.13484 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13485 +#: ../en/ch11-mq.xml:136
242.13486 +msgid ""
242.13487 +"Because quilt does not care about revision control tools, it is still a "
242.13488 +"tremendously useful piece of software to know about for situations where you "
242.13489 +"cannot use Mercurial and MQ."
242.13490 +msgstr ""
242.13491 +
242.13492 +#. type: Content of: <book><chapter><sect1><title>
242.13493 +#: ../en/ch11-mq.xml:144
242.13494 +msgid "The huge advantage of MQ"
242.13495 +msgstr "MQ 的巨大优势"
242.13496 +
242.13497 +#. type: Content of: <book><chapter><sect1><para>
242.13498 +#: ../en/ch11-mq.xml:146
242.13499 +msgid ""
242.13500 +"I cannot overstate the value that MQ offers through the unification of "
242.13501 +"patches and revision control."
242.13502 +msgstr ""
242.13503 +
242.13504 +#. type: Content of: <book><chapter><sect1><para>
242.13505 +#: ../en/ch11-mq.xml:149
242.13506 +msgid ""
242.13507 +"A major reason that patches have persisted in the free software and open "
242.13508 +"source world&emdash;in spite of the availability of increasingly capable "
242.13509 +"revision control tools over the years&emdash;is the <emphasis>agility</"
242.13510 +"emphasis> they offer."
242.13511 +msgstr ""
242.13512 +
242.13513 +#. type: Content of: <book><chapter><sect1><para>
242.13514 +#: ../en/ch11-mq.xml:155
242.13515 +msgid ""
242.13516 +"Traditional revision control tools make a permanent, irreversible record of "
242.13517 +"everything that you do.  While this has great value, it's also somewhat "
242.13518 +"stifling.  If you want to perform a wild-eyed experiment, you have to be "
242.13519 +"careful in how you go about it, or you risk leaving unneeded&emdash;or worse, "
242.13520 +"misleading or destabilising&emdash;traces of your missteps and errors in the "
242.13521 +"permanent revision record."
242.13522 +msgstr ""
242.13523 +
242.13524 +#. type: Content of: <book><chapter><sect1><para>
242.13525 +#: ../en/ch11-mq.xml:163
242.13526 +msgid ""
242.13527 +"By contrast, MQ's marriage of distributed revision control with patches makes "
242.13528 +"it much easier to isolate your work.  Your patches live on top of normal "
242.13529 +"revision history, and you can make them disappear or reappear at will.  If "
242.13530 +"you don't like a patch, you can drop it.  If a patch isn't quite as you want "
242.13531 +"it to be, simply fix it&emdash;as many times as you need to, until you have "
242.13532 +"refined it into the form you desire."
242.13533 +msgstr ""
242.13534 +
242.13535 +#. type: Content of: <book><chapter><sect1><para>
242.13536 +#: ../en/ch11-mq.xml:171
242.13537 +msgid ""
242.13538 +"As an example, the integration of patches with revision control makes "
242.13539 +"understanding patches and debugging their effects&emdash;and their interplay "
242.13540 +"with the code they're based on&emdash;<emphasis>enormously</emphasis> easier. "
242.13541 +"Since every applied patch has an associated changeset, you can give <command "
242.13542 +"role=\"hg-cmd\">hg log</command> a file name to see which changesets and "
242.13543 +"patches affected the file.  You can use the <command role=\"hg-cmd\">hg "
242.13544 +"bisect</command> command to binary-search through all changesets and applied "
242.13545 +"patches to see where a bug got introduced or fixed.  You can use the <command "
242.13546 +"role=\"hg-cmd\">hg annotate</command> command to see which changeset or patch "
242.13547 +"modified a particular line of a source file.  And so on."
242.13548 +msgstr ""
242.13549 +
242.13550 +#. type: Content of: <book><chapter><sect1><para>
242.13551 +#: ../en/ch11-mq.xml:189
242.13552 +msgid ""
242.13553 +"Because MQ doesn't hide its patch-oriented nature, it is helpful to "
242.13554 +"understand what patches are, and a little about the tools that work with them."
242.13555 +msgstr ""
242.13556 +
242.13557 +#. type: Content of: <book><chapter><sect1><para>
242.13558 +#: ../en/ch11-mq.xml:193
242.13559 +msgid ""
242.13560 +"The traditional Unix <command>diff</command> command compares two files, and "
242.13561 +"prints a list of differences between them. The <command>patch</command> "
242.13562 +"command understands these differences as <emphasis>modifications</emphasis> "
242.13563 +"to make to a file.  Take a look below for a simple example of these commands "
242.13564 +"in action."
242.13565 +msgstr ""
242.13566 +
242.13567 +#. type: Content of: <book><chapter><sect1><para>
242.13568 +#: ../en/ch11-mq.xml:202
242.13569 +msgid ""
242.13570 +"The type of file that <command>diff</command> generates (and <command>patch</"
242.13571 +"command> takes as input) is called a <quote>patch</quote> or a <quote>diff</"
242.13572 +"quote>; there is no difference between a patch and a diff.  (We'll use the "
242.13573 +"term <quote>patch</quote>, since it's more commonly used.)"
242.13574 +msgstr ""
242.13575 +
242.13576 +#. type: Content of: <book><chapter><sect1><para>
242.13577 +#: ../en/ch11-mq.xml:208
242.13578 +msgid ""
242.13579 +"A patch file can start with arbitrary text; the <command>patch</command> "
242.13580 +"command ignores this text, but MQ uses it as the commit message when creating "
242.13581 +"changesets.  To find the beginning of the patch content, <command>patch</"
242.13582 +"command> searches for the first line that starts with the string "
242.13583 +"<quote><literal>diff -</literal></quote>."
242.13584 +msgstr ""
242.13585 +
242.13586 +#. type: Content of: <book><chapter><sect1><para>
242.13587 +#: ../en/ch11-mq.xml:215
242.13588 +msgid ""
242.13589 +"MQ works with <emphasis>unified</emphasis> diffs (<command>patch</command> "
242.13590 +"can accept several other diff formats, but MQ doesn't).  A unified diff "
242.13591 +"contains two kinds of header.  The <emphasis>file header</emphasis> describes "
242.13592 +"the file being modified; it contains the name of the file to modify.  When "
242.13593 +"<command>patch</command> sees a new file header, it looks for a file with "
242.13594 +"that name to start modifying."
242.13595 +msgstr ""
242.13596 +
242.13597 +#. type: Content of: <book><chapter><sect1><para>
242.13598 +#: ../en/ch11-mq.xml:223
242.13599 +msgid ""
242.13600 +"After the file header comes a series of <emphasis>hunks</emphasis>.  Each "
242.13601 +"hunk starts with a header; this identifies the range of line numbers within "
242.13602 +"the file that the hunk should modify.  Following the header, a hunk starts "
242.13603 +"and ends with a few (usually three) lines of text from the unmodified file; "
242.13604 +"these are called the <emphasis>context</emphasis> for the hunk.  If there's "
242.13605 +"only a small amount of context between successive hunks, <command>diff</"
242.13606 +"command> doesn't print a new hunk header; it just runs the hunks together, "
242.13607 +"with a few lines of context between modifications."
242.13608 +msgstr ""
242.13609 +
242.13610 +#. type: Content of: <book><chapter><sect1><para>
242.13611 +#: ../en/ch11-mq.xml:235
242.13612 +msgid ""
242.13613 +"Each line of context begins with a space character.  Within the hunk, a line "
242.13614 +"that begins with <quote><literal>-</literal></quote> means <quote>remove this "
242.13615 +"line,</quote> while a line that begins with <quote><literal>+</literal></"
242.13616 +"quote> means <quote>insert this line.</quote> For example, a line that is "
242.13617 +"modified is represented by one deletion and one insertion."
242.13618 +msgstr ""
242.13619 +
242.13620 +#. type: Content of: <book><chapter><sect1><para>
242.13621 +#: ../en/ch11-mq.xml:243
242.13622 +msgid ""
242.13623 +"We will return to some of the more subtle aspects of patches later (in <xref "
242.13624 +"linkend=\"sec:mq:adv-patch\"/>), but you should have enough information now "
242.13625 +"to use MQ."
242.13626 +msgstr ""
242.13627 +
242.13628 +#. type: Content of: <book><chapter><sect1><title>
242.13629 +#: ../en/ch11-mq.xml:250
242.13630 +msgid "Getting started with Mercurial Queues"
242.13631 +msgstr "开始使用 MQ"
242.13632 +
242.13633 +#. type: Content of: <book><chapter><sect1><para>
242.13634 +#: ../en/ch11-mq.xml:252
242.13635 +msgid ""
242.13636 +"Because MQ is implemented as an extension, you must explicitly enable before "
242.13637 +"you can use it.  (You don't need to download anything; MQ ships with the "
242.13638 +"standard Mercurial distribution.)  To enable MQ, edit your <filename role="
242.13639 +"\"home\">~/.hgrc</filename> file, and add the lines below."
242.13640 +msgstr ""
242.13641 +
242.13642 +#. type: Content of: <book><chapter><sect1><para>
242.13643 +#: ../en/ch11-mq.xml:262
242.13644 +msgid ""
242.13645 +"Once the extension is enabled, it will make a number of new commands "
242.13646 +"available.  To verify that the extension is working, you can use <command "
242.13647 +"role=\"hg-cmd\">hg help</command> to see if the <command role=\"hg-ext-mq"
242.13648 +"\">qinit</command> command is now available."
242.13649 +msgstr ""
242.13650 +
242.13651 +#. type: Content of: <book><chapter><sect1><para>
242.13652 +#: ../en/ch11-mq.xml:270
242.13653 +msgid ""
242.13654 +"You can use MQ with <emphasis>any</emphasis> Mercurial repository, and its "
242.13655 +"commands only operate within that repository.  To get started, simply prepare "
242.13656 +"the repository using the <command role=\"hg-ext-mq\">qinit</command> command."
242.13657 +msgstr ""
242.13658 +
242.13659 +#. type: Content of: <book><chapter><sect1><para>
242.13660 +#: ../en/ch11-mq.xml:277
242.13661 +msgid ""
242.13662 +"This command creates an empty directory called <filename role=\"special\" "
242.13663 +"class=\"directory\">.hg/patches</filename>, where MQ will keep its metadata.  "
242.13664 +"As with many Mercurial commands, the <command role=\"hg-ext-mq\">qinit</"
242.13665 +"command> command prints nothing if it succeeds."
242.13666 +msgstr ""
242.13667 +
242.13668 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.13669 +#: ../en/ch11-mq.xml:284
242.13670 +msgid "Creating a new patch"
242.13671 +msgstr "创建新补丁"
242.13672 +
242.13673 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13674 +#: ../en/ch11-mq.xml:286
242.13675 +msgid ""
242.13676 +"To begin work on a new patch, use the <command role=\"hg-ext-mq\">qnew</"
242.13677 +"command> command.  This command takes one argument, the name of the patch to "
242.13678 +"create."
242.13679 +msgstr ""
242.13680 +
242.13681 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13682 +#: ../en/ch11-mq.xml:290
242.13683 +msgid ""
242.13684 +"MQ will use this as the name of an actual file in the <filename role=\"special"
242.13685 +"\" class=\"directory\">.hg/patches</filename> directory, as you can see below."
242.13686 +msgstr ""
242.13687 +
242.13688 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13689 +#: ../en/ch11-mq.xml:297
242.13690 +msgid ""
242.13691 +"Also newly present in the <filename role=\"special\" class=\"directory\">.hg/"
242.13692 +"patches</filename> directory are two other files, <filename role=\"special"
242.13693 +"\">series</filename> and <filename role=\"special\">status</filename>.  The "
242.13694 +"<filename role=\"special\">series</filename> file lists all of the patches "
242.13695 +"that MQ knows about for this repository, with one patch per line.  Mercurial "
242.13696 +"uses the <filename role=\"special\">status</filename> file for internal book-"
242.13697 +"keeping; it tracks all of the patches that MQ has <emphasis>applied</"
242.13698 +"emphasis> in this repository."
242.13699 +msgstr ""
242.13700 +
242.13701 +#. type: Content of: <book><chapter><sect1><sect2><note><para>
242.13702 +#: ../en/ch11-mq.xml:309
242.13703 +msgid ""
242.13704 +"You may sometimes want to edit the <filename role=\"special\">series</"
242.13705 +"filename> file by hand; for example, to change the sequence in which some "
242.13706 +"patches are applied.  However, manually editing the <filename role=\"special"
242.13707 +"\">status</filename> file is almost always a bad idea, as it's easy to "
242.13708 +"corrupt MQ's idea of what is happening."
242.13709 +msgstr ""
242.13710 +
242.13711 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13712 +#: ../en/ch11-mq.xml:318
242.13713 +msgid ""
242.13714 +"Once you have created your new patch, you can edit files in the working "
242.13715 +"directory as you usually would.  All of the normal Mercurial commands, such "
242.13716 +"as <command role=\"hg-cmd\">hg diff</command> and <command role=\"hg-cmd\">hg "
242.13717 +"annotate</command>, work exactly as they did before."
242.13718 +msgstr ""
242.13719 +
242.13720 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.13721 +#: ../en/ch11-mq.xml:326
242.13722 +msgid "Refreshing a patch"
242.13723 +msgstr "刷新补丁"
242.13724 +
242.13725 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13726 +#: ../en/ch11-mq.xml:328
242.13727 +msgid ""
242.13728 +"When you reach a point where you want to save your work, use the <command "
242.13729 +"role=\"hg-ext-mq\">qrefresh</command> command to update the patch you are "
242.13730 +"working on."
242.13731 +msgstr ""
242.13732 +
242.13733 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13734 +#: ../en/ch11-mq.xml:334
242.13735 +msgid ""
242.13736 +"This command folds the changes you have made in the working directory into "
242.13737 +"your patch, and updates its corresponding changeset to contain those changes."
242.13738 +msgstr ""
242.13739 +
242.13740 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13741 +#: ../en/ch11-mq.xml:338
242.13742 +msgid ""
242.13743 +"You can run <command role=\"hg-ext-mq\">qrefresh</command> as often as you "
242.13744 +"like, so it's a good way to <quote>checkpoint</quote> your work.  Refresh "
242.13745 +"your patch at an opportune time; try an experiment; and if the experiment "
242.13746 +"doesn't work out, <command role=\"hg-cmd\">hg revert</command> your "
242.13747 +"modifications back to the last time you refreshed."
242.13748 +msgstr ""
242.13749 +
242.13750 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.13751 +#: ../en/ch11-mq.xml:349
242.13752 +msgid "Stacking and tracking patches"
242.13753 +msgstr "堆叠和跟踪补丁"
242.13754 +
242.13755 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13756 +#: ../en/ch11-mq.xml:351
242.13757 +msgid ""
242.13758 +"Once you have finished working on a patch, or need to work on another, you "
242.13759 +"can use the <command role=\"hg-ext-mq\">qnew</command> command again to "
242.13760 +"create a new patch. Mercurial will apply this patch on top of your existing "
242.13761 +"patch."
242.13762 +msgstr ""
242.13763 +
242.13764 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13765 +#: ../en/ch11-mq.xml:358
242.13766 +msgid ""
242.13767 +"Notice that the patch contains the changes in our prior patch as part of its "
242.13768 +"context (you can see this more clearly in the output of <command role=\"hg-cmd"
242.13769 +"\">hg annotate</command>)."
242.13770 +msgstr ""
242.13771 +
242.13772 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13773 +#: ../en/ch11-mq.xml:363
242.13774 +msgid ""
242.13775 +"So far, with the exception of <command role=\"hg-ext-mq\">qnew</command> and "
242.13776 +"<command role=\"hg-ext-mq\">qrefresh</command>, we've been careful to only "
242.13777 +"use regular Mercurial commands.  However, MQ provides many commands that are "
242.13778 +"easier to use when you are thinking about patches, as illustrated below."
242.13779 +msgstr ""
242.13780 +
242.13781 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.13782 +#: ../en/ch11-mq.xml:373
242.13783 +msgid ""
242.13784 +"The <command role=\"hg-ext-mq\">qseries</command> command lists every patch "
242.13785 +"that MQ knows about in this repository, from oldest to newest (most recently "
242.13786 +"<emphasis>created</emphasis>)."
242.13787 +msgstr ""
242.13788 +
242.13789 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.13790 +#: ../en/ch11-mq.xml:379
242.13791 +msgid ""
242.13792 +"The <command role=\"hg-ext-mq\">qapplied</command> command lists every patch "
242.13793 +"that MQ has <emphasis>applied</emphasis> in this repository, again from "
242.13794 +"oldest to newest (most recently applied)."
242.13795 +msgstr ""
242.13796 +
242.13797 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.13798 +#: ../en/ch11-mq.xml:388
242.13799 +msgid "Manipulating the patch stack"
242.13800 +msgstr "操作补丁堆栈"
242.13801 +
242.13802 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13803 +#: ../en/ch11-mq.xml:390
242.13804 +msgid ""
242.13805 +"The previous discussion implied that there must be a difference between "
242.13806 +"<quote>known</quote> and <quote>applied</quote> patches, and there is.  MQ "
242.13807 +"can manage a patch without it being applied in the repository."
242.13808 +msgstr ""
242.13809 +
242.13810 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13811 +#: ../en/ch11-mq.xml:395
242.13812 +msgid ""
242.13813 +"An <emphasis>applied</emphasis> patch has a corresponding changeset in the "
242.13814 +"repository, and the effects of the patch and changeset are visible in the "
242.13815 +"working directory.  You can undo the application of a patch using the "
242.13816 +"<command role=\"hg-ext-mq\">qpop</command> command.  MQ still <emphasis>knows "
242.13817 +"about</emphasis>, or manages, a popped patch, but the patch no longer has a "
242.13818 +"corresponding changeset in the repository, and the working directory does not "
242.13819 +"contain the changes made by the patch.  <xref linkend=\"fig:mq:stack\"/> "
242.13820 +"illustrates the difference between applied and tracked patches."
242.13821 +msgstr ""
242.13822 +
242.13823 +#. type: Content of: <book><chapter><sect1><sect2><figure><title>
242.13824 +#: ../en/ch11-mq.xml:408
242.13825 +msgid "Applied and unapplied patches in the MQ patch stack"
242.13826 +msgstr "在 MQ 补丁堆栈中应用和撤销补丁"
242.13827 +
242.13828 +#. type: Content of: <book><chapter><sect1><sect2><figure><mediaobject>
242.13829 +#: ../en/ch11-mq.xml:411
242.13830 +msgid "<imageobject><imagedata fileref=\"figs/mq-stack.png\"/></imageobject>"
242.13831 +msgstr ""
242.13832 +
242.13833 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13834 +#: ../en/ch11-mq.xml:416
242.13835 +msgid ""
242.13836 +"You can reapply an unapplied, or popped, patch using the <command role=\"hg-"
242.13837 +"ext-mq\">qpush</command> command.  This creates a new changeset to correspond "
242.13838 +"to the patch, and the patch's changes once again become present in the "
242.13839 +"working directory.  See below for examples of <command role=\"hg-ext-mq"
242.13840 +"\">qpop</command> and <command role=\"hg-ext-mq\">qpush</command> in action."
242.13841 +msgstr ""
242.13842 +
242.13843 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13844 +#: ../en/ch11-mq.xml:425
242.13845 +msgid ""
242.13846 +"Notice that once we have popped a patch or two patches, the output of "
242.13847 +"<command role=\"hg-ext-mq\">qseries</command> remains the same, while that of "
242.13848 +"<command role=\"hg-ext-mq\">qapplied</command> has changed."
242.13849 +msgstr ""
242.13850 +
242.13851 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.13852 +#: ../en/ch11-mq.xml:433
242.13853 +msgid "Pushing and popping many patches"
242.13854 +msgstr "压入或弹出多个补丁"
242.13855 +
242.13856 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13857 +#: ../en/ch11-mq.xml:435
242.13858 +msgid ""
242.13859 +"While <command role=\"hg-ext-mq\">qpush</command> and <command role=\"hg-ext-"
242.13860 +"mq\">qpop</command> each operate on a single patch at a time by default, you "
242.13861 +"can push and pop many patches in one go.  The <option role=\"hg-ext-mq-cmd-"
242.13862 +"qpush-opt\">hg -a</option> option to <command role=\"hg-ext-mq\">qpush</"
242.13863 +"command> causes it to push all unapplied patches, while the <option role=\"hg-"
242.13864 +"ext-mq-cmd-qpop-opt\">-a</option> option to <command role=\"hg-ext-mq\">qpop</"
242.13865 +"command> causes it to pop all applied patches.  (For some more ways to push "
242.13866 +"and pop many patches, see <xref linkend=\"sec:mq:perf\"/> below.)"
242.13867 +msgstr ""
242.13868 +
242.13869 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.13870 +#: ../en/ch11-mq.xml:451
242.13871 +msgid "Safety checks, and overriding them"
242.13872 +msgstr "安全的检查,然后覆盖它们"
242.13873 +
242.13874 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13875 +#: ../en/ch11-mq.xml:453
242.13876 +msgid ""
242.13877 +"Several MQ commands check the working directory before they do anything, and "
242.13878 +"fail if they find any modifications.  They do this to ensure that you won't "
242.13879 +"lose any changes that you have made, but not yet incorporated into a patch.  "
242.13880 +"The example below illustrates this; the <command role=\"hg-ext-mq\">qnew</"
242.13881 +"command> command will not create a new patch if there are outstanding "
242.13882 +"changes, caused in this case by the <command role=\"hg-cmd\">hg add</command> "
242.13883 +"of <filename>file3</filename>."
242.13884 +msgstr ""
242.13885 +
242.13886 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13887 +#: ../en/ch11-mq.xml:465
242.13888 +msgid ""
242.13889 +"Commands that check the working directory all take an <quote>I know what I'm "
242.13890 +"doing</quote> option, which is always named <option>-f</option>.  The exact "
242.13891 +"meaning of <option>-f</option> depends on the command.  For example, <command "
242.13892 +"role=\"hg-cmd\">hg qnew <option role=\"hg-ext-mq-cmd-qnew-opt\">hg -f</"
242.13893 +"option></command> will incorporate any outstanding changes into the new patch "
242.13894 +"it creates, but <command role=\"hg-cmd\">hg qpop <option role=\"hg-ext-mq-cmd-"
242.13895 +"qpop-opt\">hg -f</option></command> will revert modifications to any files "
242.13896 +"affected by the patch that it is popping.  Be sure to read the documentation "
242.13897 +"for a command's <option>-f</option> option before you use it!"
242.13898 +msgstr ""
242.13899 +
242.13900 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.13901 +#: ../en/ch11-mq.xml:480
242.13902 +msgid "Working on several patches at once"
242.13903 +msgstr "同时处理多个补丁"
242.13904 +
242.13905 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13906 +#: ../en/ch11-mq.xml:482
242.13907 +msgid ""
242.13908 +"The <command role=\"hg-ext-mq\">qrefresh</command> command always refreshes "
242.13909 +"the <emphasis>topmost</emphasis> applied patch.  This means that you can "
242.13910 +"suspend work on one patch (by refreshing it), pop or push to make a different "
242.13911 +"patch the top, and work on <emphasis>that</emphasis> patch for a while."
242.13912 +msgstr ""
242.13913 +
242.13914 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13915 +#: ../en/ch11-mq.xml:489
242.13916 +msgid ""
242.13917 +"Here's an example that illustrates how you can use this ability. Let's say "
242.13918 +"you're developing a new feature as two patches.  The first is a change to the "
242.13919 +"core of your software, and the second&emdash;layered on top of the "
242.13920 +"first&emdash;changes the user interface to use the code you just added to the "
242.13921 +"core.  If you notice a bug in the core while you're working on the UI patch, "
242.13922 +"it's easy to fix the core.  Simply <command role=\"hg-ext-mq\">qrefresh</"
242.13923 +"command> the UI patch to save your in-progress changes, and <command role="
242.13924 +"\"hg-ext-mq\">qpop</command> down to the core patch.  Fix the core bug, "
242.13925 +"<command role=\"hg-ext-mq\">qrefresh</command> the core patch, and <command "
242.13926 +"role=\"hg-ext-mq\">qpush</command> back to the UI patch to continue where you "
242.13927 +"left off."
242.13928 +msgstr ""
242.13929 +
242.13930 +#. type: Content of: <book><chapter><sect1><title>
242.13931 +#: ../en/ch11-mq.xml:506
242.13932 +msgid "More about patches"
242.13933 +msgstr "关于补丁的更多信息"
242.13934 +
242.13935 +#. type: Content of: <book><chapter><sect1><para>
242.13936 +#: ../en/ch11-mq.xml:508
242.13937 +msgid ""
242.13938 +"MQ uses the GNU <command>patch</command> command to apply patches, so it's "
242.13939 +"helpful to know a few more detailed aspects of how <command>patch</command> "
242.13940 +"works, and about patches themselves."
242.13941 +msgstr ""
242.13942 +
242.13943 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.13944 +#: ../en/ch11-mq.xml:514
242.13945 +msgid "The strip count"
242.13946 +msgstr "修剪计数"
242.13947 +
242.13948 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13949 +#: ../en/ch11-mq.xml:516
242.13950 +msgid ""
242.13951 +"If you look at the file headers in a patch, you will notice that the "
242.13952 +"pathnames usually have an extra component on the front that isn't present in "
242.13953 +"the actual path name.  This is a holdover from the way that people used to "
242.13954 +"generate patches (people still do this, but it's somewhat rare with modern "
242.13955 +"revision control tools)."
242.13956 +msgstr ""
242.13957 +
242.13958 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13959 +#: ../en/ch11-mq.xml:523
242.13960 +msgid ""
242.13961 +"Alice would unpack a tarball, edit her files, then decide that she wanted to "
242.13962 +"create a patch.  So she'd rename her working directory, unpack the tarball "
242.13963 +"again (hence the need for the rename), and use the <option role=\"cmd-opt-diff"
242.13964 +"\">-r</option> and <option role=\"cmd-opt-diff\">-N</option> options to "
242.13965 +"<command>diff</command> to recursively generate a patch between the "
242.13966 +"unmodified directory and the modified one.  The result would be that the name "
242.13967 +"of the unmodified directory would be at the front of the left-hand path in "
242.13968 +"every file header, and the name of the modified directory would be at the "
242.13969 +"front of the right-hand path."
242.13970 +msgstr ""
242.13971 +
242.13972 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13973 +#: ../en/ch11-mq.xml:536
242.13974 +msgid ""
242.13975 +"Since someone receiving a patch from the Alices of the net would be unlikely "
242.13976 +"to have unmodified and modified directories with exactly the same names, the "
242.13977 +"<command>patch</command> command has a <option role=\"cmd-opt-patch\">-p</"
242.13978 +"option> option that indicates the number of leading path name components to "
242.13979 +"strip when trying to apply a patch.  This number is called the "
242.13980 +"<emphasis>strip count</emphasis>."
242.13981 +msgstr ""
242.13982 +
242.13983 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13984 +#: ../en/ch11-mq.xml:544
242.13985 +msgid ""
242.13986 +"An option of <quote><literal>-p1</literal></quote> means <quote>use a strip "
242.13987 +"count of one</quote>.  If <command>patch</command> sees a file name "
242.13988 +"<filename>foo/bar/baz</filename> in a file header, it will strip "
242.13989 +"<filename>foo</filename> and try to patch a file named <filename>bar/baz</"
242.13990 +"filename>.  (Strictly speaking, the strip count refers to the number of "
242.13991 +"<emphasis>path separators</emphasis> (and the components that go with them ) "
242.13992 +"to strip.  A strip count of one will turn <filename>foo/bar</filename> into "
242.13993 +"<filename>bar</filename>, but <filename>/foo/bar</filename> (notice the extra "
242.13994 +"leading slash) into <filename>foo/bar</filename>.)"
242.13995 +msgstr ""
242.13996 +
242.13997 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.13998 +#: ../en/ch11-mq.xml:557
242.13999 +msgid ""
242.14000 +"The <quote>standard</quote> strip count for patches is one; almost all "
242.14001 +"patches contain one leading path name component that needs to be stripped. "
242.14002 +"Mercurial's <command role=\"hg-cmd\">hg diff</command> command generates path "
242.14003 +"names in this form, and the <command role=\"hg-cmd\">hg import</command> "
242.14004 +"command and MQ expect patches to have a strip count of one."
242.14005 +msgstr ""
242.14006 +
242.14007 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14008 +#: ../en/ch11-mq.xml:565
242.14009 +msgid ""
242.14010 +"If you receive a patch from someone that you want to add to your patch queue, "
242.14011 +"and the patch needs a strip count other than one, you cannot just <command "
242.14012 +"role=\"hg-ext-mq\">qimport</command> the patch, because <command role=\"hg-"
242.14013 +"ext-mq\">qimport</command> does not yet have a <literal>-p</literal> option "
242.14014 +"(see <ulink role=\"hg-bug\" url=\"http://www.selenic.com/mercurial/bts/"
242.14015 +"issue311\">issue 311</ulink>).  Your best bet is to <command role=\"hg-ext-mq"
242.14016 +"\">qnew</command> a patch of your own, then use <command>patch -pN</command> "
242.14017 +"to apply their patch, followed by <command role=\"hg-cmd\">hg addremove</"
242.14018 +"command> to pick up any files added or removed by the patch, followed by "
242.14019 +"<command role=\"hg-ext-mq\">hg qrefresh</command>. This complexity may become "
242.14020 +"unnecessary; see <ulink role=\"hg-bug\" url=\"http://www.selenic.com/"
242.14021 +"mercurial/bts/issue311\">issue 311</ulink> for details."
242.14022 +msgstr ""
242.14023 +
242.14024 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.14025 +#: ../en/ch11-mq.xml:584
242.14026 +msgid "Strategies for applying a patch"
242.14027 +msgstr "应用补丁的策略"
242.14028 +
242.14029 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14030 +#: ../en/ch11-mq.xml:586
242.14031 +msgid ""
242.14032 +"When <command>patch</command> applies a hunk, it tries a handful of "
242.14033 +"successively less accurate strategies to try to make the hunk apply. This "
242.14034 +"falling-back technique often makes it possible to take a patch that was "
242.14035 +"generated against an old version of a file, and apply it against a newer "
242.14036 +"version of that file."
242.14037 +msgstr ""
242.14038 +
242.14039 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14040 +#: ../en/ch11-mq.xml:593
242.14041 +msgid ""
242.14042 +"First, <command>patch</command> tries an exact match, where the line numbers, "
242.14043 +"the context, and the text to be modified must apply exactly.  If it cannot "
242.14044 +"make an exact match, it tries to find an exact match for the context, without "
242.14045 +"honouring the line numbering information.  If this succeeds, it prints a line "
242.14046 +"of output saying that the hunk was applied, but at some <emphasis>offset</"
242.14047 +"emphasis> from the original line number."
242.14048 +msgstr ""
242.14049 +
242.14050 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14051 +#: ../en/ch11-mq.xml:602
242.14052 +msgid ""
242.14053 +"If a context-only match fails, <command>patch</command> removes the first and "
242.14054 +"last lines of the context, and tries a <emphasis>reduced</emphasis> context-"
242.14055 +"only match.  If the hunk with reduced context succeeds, it prints a message "
242.14056 +"saying that it applied the hunk with a <emphasis>fuzz factor</emphasis> (the "
242.14057 +"number after the fuzz factor indicates how many lines of context "
242.14058 +"<command>patch</command> had to trim before the patch applied)."
242.14059 +msgstr ""
242.14060 +
242.14061 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14062 +#: ../en/ch11-mq.xml:611
242.14063 +msgid ""
242.14064 +"When neither of these techniques works, <command>patch</command> prints a "
242.14065 +"message saying that the hunk in question was rejected.  It saves rejected "
242.14066 +"hunks (also simply called <quote>rejects</quote>) to a file with the same "
242.14067 +"name, and an added <filename role=\"special\">.rej</filename> extension.  It "
242.14068 +"also saves an unmodified copy of the file with a <filename role=\"special\">."
242.14069 +"orig</filename> extension; the copy of the file without any extensions will "
242.14070 +"contain any changes made by hunks that <emphasis>did</emphasis> apply "
242.14071 +"cleanly.  If you have a patch that modifies <filename>foo</filename> with six "
242.14072 +"hunks, and one of them fails to apply, you will have: an unmodified "
242.14073 +"<filename>foo.orig</filename>, a <filename>foo.rej</filename> containing one "
242.14074 +"hunk, and <filename>foo</filename>, containing the changes made by the five "
242.14075 +"successful hunks."
242.14076 +msgstr ""
242.14077 +
242.14078 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.14079 +#: ../en/ch11-mq.xml:629
242.14080 +msgid "Some quirks of patch representation"
242.14081 +msgstr "补丁的一些特性"
242.14082 +
242.14083 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14084 +#: ../en/ch11-mq.xml:631
242.14085 +msgid ""
242.14086 +"There are a few useful things to know about how <command>patch</command> "
242.14087 +"works with files."
242.14088 +msgstr ""
242.14089 +
242.14090 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.14091 +#: ../en/ch11-mq.xml:634
242.14092 +msgid ""
242.14093 +"This should already be obvious, but <command>patch</command> cannot handle "
242.14094 +"binary files."
242.14095 +msgstr ""
242.14096 +
242.14097 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.14098 +#: ../en/ch11-mq.xml:638
242.14099 +msgid ""
242.14100 +"Neither does it care about the executable bit; it creates new files as "
242.14101 +"readable, but not executable."
242.14102 +msgstr ""
242.14103 +
242.14104 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.14105 +#: ../en/ch11-mq.xml:642
242.14106 +msgid ""
242.14107 +"<command>patch</command> treats the removal of a file as a diff between the "
242.14108 +"file to be removed and the empty file.  So your idea of <quote>I deleted this "
242.14109 +"file</quote> looks like <quote>every line of this file was deleted</quote> in "
242.14110 +"a patch."
242.14111 +msgstr ""
242.14112 +
242.14113 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.14114 +#: ../en/ch11-mq.xml:648
242.14115 +msgid ""
242.14116 +"It treats the addition of a file as a diff between the empty file and the "
242.14117 +"file to be added.  So in a patch, your idea of <quote>I added this file</"
242.14118 +"quote> looks like <quote>every line of this file was added</quote>."
242.14119 +msgstr ""
242.14120 +
242.14121 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.14122 +#: ../en/ch11-mq.xml:654
242.14123 +msgid ""
242.14124 +"It treats a renamed file as the removal of the old name, and the addition of "
242.14125 +"the new name.  This means that renamed files have a big footprint in "
242.14126 +"patches.  (Note also that Mercurial does not currently try to infer when "
242.14127 +"files have been renamed or copied in a patch.)"
242.14128 +msgstr ""
242.14129 +
242.14130 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.14131 +#: ../en/ch11-mq.xml:660
242.14132 +msgid ""
242.14133 +"<command>patch</command> cannot represent empty files, so you cannot use a "
242.14134 +"patch to represent the notion <quote>I added this empty file to the tree</"
242.14135 +"quote>."
242.14136 +msgstr ""
242.14137 +
242.14138 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.14139 +#: ../en/ch11-mq.xml:667
242.14140 +msgid "Beware the fuzz"
242.14141 +msgstr "当心毛刺"
242.14142 +
242.14143 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14144 +#: ../en/ch11-mq.xml:669
242.14145 +msgid ""
242.14146 +"While applying a hunk at an offset, or with a fuzz factor, will often be "
242.14147 +"completely successful, these inexact techniques naturally leave open the "
242.14148 +"possibility of corrupting the patched file.  The most common cases typically "
242.14149 +"involve applying a patch twice, or at an incorrect location in the file.  If "
242.14150 +"<command>patch</command> or <command role=\"hg-ext-mq\">qpush</command> ever "
242.14151 +"mentions an offset or fuzz factor, you should make sure that the modified "
242.14152 +"files are correct afterwards."
242.14153 +msgstr ""
242.14154 +
242.14155 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14156 +#: ../en/ch11-mq.xml:679
242.14157 +msgid ""
242.14158 +"It's often a good idea to refresh a patch that has applied with an offset or "
242.14159 +"fuzz factor; refreshing the patch generates new context information that will "
242.14160 +"make it apply cleanly.  I say <quote>often,</quote> not <quote>always,</"
242.14161 +"quote> because sometimes refreshing a patch will make it fail to apply "
242.14162 +"against a different revision of the underlying files.  In some cases, such as "
242.14163 +"when you're maintaining a patch that must sit on top of multiple versions of "
242.14164 +"a source tree, it's acceptable to have a patch apply with some fuzz, provided "
242.14165 +"you've verified the results of the patching process in such cases."
242.14166 +msgstr ""
242.14167 +
242.14168 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.14169 +#: ../en/ch11-mq.xml:692
242.14170 +msgid "Handling rejection"
242.14171 +msgstr "处理拒绝"
242.14172 +
242.14173 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14174 +#: ../en/ch11-mq.xml:694
242.14175 +msgid ""
242.14176 +"If <command role=\"hg-ext-mq\">qpush</command> fails to apply a patch, it "
242.14177 +"will print an error message and exit.  If it has left <filename role=\"special"
242.14178 +"\">.rej</filename> files behind, it is usually best to fix up the rejected "
242.14179 +"hunks before you push more patches or do any further work."
242.14180 +msgstr ""
242.14181 +
242.14182 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14183 +#: ../en/ch11-mq.xml:700
242.14184 +msgid ""
242.14185 +"If your patch <emphasis>used to</emphasis> apply cleanly, and no longer does "
242.14186 +"because you've changed the underlying code that your patches are based on, "
242.14187 +"Mercurial Queues can help; see <xref linkend=\"sec:mq:merge\"/> for details."
242.14188 +msgstr ""
242.14189 +
242.14190 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14191 +#: ../en/ch11-mq.xml:705
242.14192 +msgid ""
242.14193 +"Unfortunately, there aren't any great techniques for dealing with rejected "
242.14194 +"hunks.  Most often, you'll need to view the <filename role=\"special\">.rej</"
242.14195 +"filename> file and edit the target file, applying the rejected hunks by hand."
242.14196 +msgstr ""
242.14197 +
242.14198 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14199 +#: ../en/ch11-mq.xml:710
242.14200 +msgid ""
242.14201 +"If you're feeling adventurous, Neil Brown, a Linux kernel hacker, wrote a "
242.14202 +"tool called <command>wiggle</command> <citation>web:wiggle</citation>, which "
242.14203 +"is more vigorous than <command>patch</command> in its attempts to make a "
242.14204 +"patch apply."
242.14205 +msgstr ""
242.14206 +
242.14207 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14208 +#: ../en/ch11-mq.xml:716
242.14209 +msgid ""
242.14210 +"Another Linux kernel hacker, Chris Mason (the author of Mercurial Queues), "
242.14211 +"wrote a similar tool called <command>mpatch</command> <citation>web:mpatch</"
242.14212 +"citation>, which takes a simple approach to automating the application of "
242.14213 +"hunks rejected by <command>patch</command>.  The <command>mpatch</command> "
242.14214 +"command can help with four common reasons that a hunk may be rejected:"
242.14215 +msgstr ""
242.14216 +
242.14217 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.14218 +#: ../en/ch11-mq.xml:725
242.14219 +msgid "The context in the middle of a hunk has changed."
242.14220 +msgstr ""
242.14221 +
242.14222 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.14223 +#: ../en/ch11-mq.xml:728
242.14224 +msgid "A hunk is missing some context at the beginning or end."
242.14225 +msgstr ""
242.14226 +
242.14227 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.14228 +#: ../en/ch11-mq.xml:731
242.14229 +msgid ""
242.14230 +"A large hunk might apply better&emdash;either entirely or in part&emdash;if "
242.14231 +"it was broken up into smaller hunks."
242.14232 +msgstr ""
242.14233 +
242.14234 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.14235 +#: ../en/ch11-mq.xml:735
242.14236 +msgid ""
242.14237 +"A hunk removes lines with slightly different content than those currently "
242.14238 +"present in the file."
242.14239 +msgstr ""
242.14240 +
242.14241 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14242 +#: ../en/ch11-mq.xml:739
242.14243 +msgid ""
242.14244 +"If you use <command>wiggle</command> or <command>mpatch</command>, you should "
242.14245 +"be doubly careful to check your results when you're done.  In fact, "
242.14246 +"<command>mpatch</command> enforces this method of double-checking the tool's "
242.14247 +"output, by automatically dropping you into a merge program when it has done "
242.14248 +"its job, so that you can verify its work and finish off any remaining merges."
242.14249 +msgstr ""
242.14250 +
242.14251 +#. type: Content of: <book><chapter><sect1><title>
242.14252 +#: ../en/ch11-mq.xml:751
242.14253 +msgid "Getting the best performance out of MQ"
242.14254 +msgstr "MQ 的性能"
242.14255 +
242.14256 +#. type: Content of: <book><chapter><sect1><para>
242.14257 +#: ../en/ch11-mq.xml:753
242.14258 +msgid ""
242.14259 +"MQ is very efficient at handling a large number of patches.  I ran some "
242.14260 +"performance experiments in mid-2006 for a talk that I gave at the 2006 "
242.14261 +"EuroPython conference <citation>web:europython</citation>.  I used as my data "
242.14262 +"set the Linux 2.6.17-mm1 patch series, which consists of 1,738 patches.  I "
242.14263 +"applied these on top of a Linux kernel repository containing all 27,472 "
242.14264 +"revisions between Linux 2.6.12-rc2 and Linux 2.6.17."
242.14265 +msgstr ""
242.14266 +
242.14267 +#. type: Content of: <book><chapter><sect1><para>
242.14268 +#: ../en/ch11-mq.xml:762
242.14269 +msgid ""
242.14270 +"On my old, slow laptop, I was able to <command role=\"hg-cmd\">hg qpush "
242.14271 +"<option role=\"hg-ext-mq-cmd-qpush-opt\">hg -a</option></command> all 1,738 "
242.14272 +"patches in 3.5 minutes, and <command role=\"hg-cmd\">hg qpop <option role="
242.14273 +"\"hg-ext-mq-cmd-qpop-opt\">hg -a</option></command> them all in 30 seconds.  "
242.14274 +"(On a newer laptop, the time to push all patches dropped to two minutes.)  I "
242.14275 +"could <command role=\"hg-ext-mq\">qrefresh</command> one of the biggest "
242.14276 +"patches (which made 22,779 lines of changes to 287 files) in 6.6 seconds."
242.14277 +msgstr ""
242.14278 +
242.14279 +#. type: Content of: <book><chapter><sect1><para>
242.14280 +#: ../en/ch11-mq.xml:773
242.14281 +msgid ""
242.14282 +"Clearly, MQ is well suited to working in large trees, but there are a few "
242.14283 +"tricks you can use to get the best performance of it."
242.14284 +msgstr ""
242.14285 +
242.14286 +#. type: Content of: <book><chapter><sect1><para>
242.14287 +#: ../en/ch11-mq.xml:777
242.14288 +msgid ""
242.14289 +"First of all, try to <quote>batch</quote> operations together.  Every time "
242.14290 +"you run <command role=\"hg-ext-mq\">qpush</command> or <command role=\"hg-ext-"
242.14291 +"mq\">qpop</command>, these commands scan the working directory once to make "
242.14292 +"sure you haven't made some changes and then forgotten to run <command role="
242.14293 +"\"hg-ext-mq\">qrefresh</command>.  On a small tree, the time that this scan "
242.14294 +"takes is unnoticeable.  However, on a medium-sized tree (containing tens of "
242.14295 +"thousands of files), it can take a second or more."
242.14296 +msgstr ""
242.14297 +
242.14298 +#. type: Content of: <book><chapter><sect1><para>
242.14299 +#: ../en/ch11-mq.xml:788
242.14300 +msgid ""
242.14301 +"The <command role=\"hg-ext-mq\">qpush</command> and <command role=\"hg-ext-mq"
242.14302 +"\">qpop</command> commands allow you to push and pop multiple patches at a "
242.14303 +"time.  You can identify the <quote>destination patch</quote> that you want to "
242.14304 +"end up at.  When you <command role=\"hg-ext-mq\">qpush</command> with a "
242.14305 +"destination specified, it will push patches until that patch is at the top of "
242.14306 +"the applied stack.  When you <command role=\"hg-ext-mq\">qpop</command> to a "
242.14307 +"destination, MQ will pop patches until the destination patch is at the top."
242.14308 +msgstr ""
242.14309 +
242.14310 +#. type: Content of: <book><chapter><sect1><para>
242.14311 +#: ../en/ch11-mq.xml:798
242.14312 +msgid ""
242.14313 +"You can identify a destination patch using either the name of the patch, or "
242.14314 +"by number.  If you use numeric addressing, patches are counted from zero; "
242.14315 +"this means that the first patch is zero, the second is one, and so on."
242.14316 +msgstr ""
242.14317 +
242.14318 +#. type: Content of: <book><chapter><sect1><title>
242.14319 +#: ../en/ch11-mq.xml:805
242.14320 +msgid "Updating your patches when the underlying code changes"
242.14321 +msgstr "当基础代码改变时,更新补丁的方法"
242.14322 +
242.14323 +#. type: Content of: <book><chapter><sect1><para>
242.14324 +#: ../en/ch11-mq.xml:808
242.14325 +msgid ""
242.14326 +"It's common to have a stack of patches on top of an underlying repository "
242.14327 +"that you don't modify directly.  If you're working on changes to third-party "
242.14328 +"code, or on a feature that is taking longer to develop than the rate of "
242.14329 +"change of the code beneath, you will often need to sync up with the "
242.14330 +"underlying code, and fix up any hunks in your patches that no longer apply.  "
242.14331 +"This is called <emphasis>rebasing</emphasis> your patch series."
242.14332 +msgstr ""
242.14333 +
242.14334 +#. type: Content of: <book><chapter><sect1><para>
242.14335 +#: ../en/ch11-mq.xml:817
242.14336 +msgid ""
242.14337 +"The simplest way to do this is to <command role=\"hg-cmd\">hg qpop <option "
242.14338 +"role=\"hg-ext-mq-cmd-qpop-opt\">hg -a</option></command> your patches, then "
242.14339 +"<command role=\"hg-cmd\">hg pull</command> changes into the underlying "
242.14340 +"repository, and finally <command role=\"hg-cmd\">hg qpush <option role=\"hg-"
242.14341 +"ext-mq-cmd-qpop-opt\">hg -a</option></command> your patches again.  MQ will "
242.14342 +"stop pushing any time it runs across a patch that fails to apply during "
242.14343 +"conflicts, allowing you to fix your conflicts, <command role=\"hg-ext-mq"
242.14344 +"\">qrefresh</command> the affected patch, and continue pushing until you have "
242.14345 +"fixed your entire stack."
242.14346 +msgstr ""
242.14347 +
242.14348 +#. type: Content of: <book><chapter><sect1><para>
242.14349 +#: ../en/ch11-mq.xml:829
242.14350 +msgid ""
242.14351 +"This approach is easy to use and works well if you don't expect changes to "
242.14352 +"the underlying code to affect how well your patches apply. If your patch "
242.14353 +"stack touches code that is modified frequently or invasively in the "
242.14354 +"underlying repository, however, fixing up rejected hunks by hand quickly "
242.14355 +"becomes tiresome."
242.14356 +msgstr ""
242.14357 +
242.14358 +#. type: Content of: <book><chapter><sect1><para>
242.14359 +#: ../en/ch11-mq.xml:836
242.14360 +msgid ""
242.14361 +"It's possible to partially automate the rebasing process.  If your patches "
242.14362 +"apply cleanly against some revision of the underlying repo, MQ can use this "
242.14363 +"information to help you to resolve conflicts between your patches and a "
242.14364 +"different revision."
242.14365 +msgstr ""
242.14366 +
242.14367 +#. type: Content of: <book><chapter><sect1><para>
242.14368 +#: ../en/ch11-mq.xml:842
242.14369 +msgid "The process is a little involved."
242.14370 +msgstr ""
242.14371 +
242.14372 +#. type: Content of: <book><chapter><sect1><orderedlist><listitem><para>
242.14373 +#: ../en/ch11-mq.xml:844
242.14374 +msgid ""
242.14375 +"To begin, <command role=\"hg-cmd\">hg qpush -a</command> all of your patches "
242.14376 +"on top of the revision where you know that they apply cleanly."
242.14377 +msgstr ""
242.14378 +
242.14379 +#. type: Content of: <book><chapter><sect1><orderedlist><listitem><para>
242.14380 +#: ../en/ch11-mq.xml:848
242.14381 +msgid ""
242.14382 +"Save a backup copy of your patch directory using <command role=\"hg-cmd\">hg "
242.14383 +"qsave <option role=\"hg-ext-mq-cmd-qsave-opt\">hg -e</option> <option role="
242.14384 +"\"hg-ext-mq-cmd-qsave-opt\">hg -c</option></command>.  This prints the name "
242.14385 +"of the directory that it has saved the patches in.  It will save the patches "
242.14386 +"to a directory called <filename role=\"special\" class=\"directory\">.hg/"
242.14387 +"patches.N</filename>, where <literal>N</literal> is a small integer.  It also "
242.14388 +"commits a <quote>save changeset</quote> on top of your applied patches; this "
242.14389 +"is for internal book-keeping, and records the states of the <filename role="
242.14390 +"\"special\">series</filename> and <filename role=\"special\">status</"
242.14391 +"filename> files."
242.14392 +msgstr ""
242.14393 +
242.14394 +#. type: Content of: <book><chapter><sect1><orderedlist><listitem><para>
242.14395 +#: ../en/ch11-mq.xml:862
242.14396 +msgid ""
242.14397 +"Use <command role=\"hg-cmd\">hg pull</command> to bring new changes into the "
242.14398 +"underlying repository.  (Don't run <command role=\"hg-cmd\">hg pull -u</"
242.14399 +"command>; see below for why.)"
242.14400 +msgstr ""
242.14401 +
242.14402 +#. type: Content of: <book><chapter><sect1><orderedlist><listitem><para>
242.14403 +#: ../en/ch11-mq.xml:867
242.14404 +msgid ""
242.14405 +"Update to the new tip revision, using <command role=\"hg-cmd\">hg update "
242.14406 +"<option role=\"hg-opt-update\">-C</option></command> to override the patches "
242.14407 +"you have pushed."
242.14408 +msgstr ""
242.14409 +
242.14410 +#. type: Content of: <book><chapter><sect1><orderedlist><listitem><para>
242.14411 +#: ../en/ch11-mq.xml:872
242.14412 +msgid ""
242.14413 +"Merge all patches using <command>hg qpush -m -a</command>.  The <option role="
242.14414 +"\"hg-ext-mq-cmd-qpush-opt\">-m</option> option to <command role=\"hg-ext-mq"
242.14415 +"\">qpush</command> tells MQ to perform a three-way merge if the patch fails "
242.14416 +"to apply."
242.14417 +msgstr ""
242.14418 +
242.14419 +#. type: Content of: <book><chapter><sect1><para>
242.14420 +#: ../en/ch11-mq.xml:880
242.14421 +msgid ""
242.14422 +"During the <command role=\"hg-cmd\">hg qpush <option role=\"hg-ext-mq-cmd-"
242.14423 +"qpush-opt\">hg -m</option></command>, each patch in the <filename role="
242.14424 +"\"special\">series</filename> file is applied normally.  If a patch applies "
242.14425 +"with fuzz or rejects, MQ looks at the queue you <command role=\"hg-ext-mq"
242.14426 +"\">qsave</command>d, and performs a three-way merge with the corresponding "
242.14427 +"changeset.  This merge uses Mercurial's normal merge machinery, so it may pop "
242.14428 +"up a GUI merge tool to help you to resolve problems."
242.14429 +msgstr ""
242.14430 +
242.14431 +#. type: Content of: <book><chapter><sect1><para>
242.14432 +#: ../en/ch11-mq.xml:890
242.14433 +msgid ""
242.14434 +"When you finish resolving the effects of a patch, MQ refreshes your patch "
242.14435 +"based on the result of the merge."
242.14436 +msgstr ""
242.14437 +
242.14438 +#. type: Content of: <book><chapter><sect1><para>
242.14439 +#: ../en/ch11-mq.xml:893
242.14440 +msgid ""
242.14441 +"At the end of this process, your repository will have one extra head from the "
242.14442 +"old patch queue, and a copy of the old patch queue will be in <filename role="
242.14443 +"\"special\" class=\"directory\">.hg/patches.N</filename>. You can remove the "
242.14444 +"extra head using <command role=\"hg-cmd\">hg qpop -a -n patches.N</command> "
242.14445 +"or <command role=\"hg-cmd\">hg strip</command>.  You can delete <filename "
242.14446 +"role=\"special\" class=\"directory\">.hg/patches.N</filename> once you are "
242.14447 +"sure that you no longer need it as a backup."
242.14448 +msgstr ""
242.14449 +
242.14450 +#. type: Content of: <book><chapter><sect1><title>
242.14451 +#: ../en/ch11-mq.xml:905
242.14452 +msgid "Identifying patches"
242.14453 +msgstr "标识补丁"
242.14454 +
242.14455 +#. type: Content of: <book><chapter><sect1><para>
242.14456 +#: ../en/ch11-mq.xml:907
242.14457 +msgid ""
242.14458 +"MQ commands that work with patches let you refer to a patch either by using "
242.14459 +"its name or by a number.  By name is obvious enough; pass the name "
242.14460 +"<filename>foo.patch</filename> to <command role=\"hg-ext-mq\">qpush</"
242.14461 +"command>, for example, and it will push patches until <filename>foo.patch</"
242.14462 +"filename> is applied."
242.14463 +msgstr ""
242.14464 +
242.14465 +#. type: Content of: <book><chapter><sect1><para>
242.14466 +#: ../en/ch11-mq.xml:914
242.14467 +msgid ""
242.14468 +"As a shortcut, you can refer to a patch using both a name and a numeric "
242.14469 +"offset; <literal>foo.patch-2</literal> means <quote>two patches before "
242.14470 +"<literal>foo.patch</literal></quote>, while <literal>bar.patch+4</literal> "
242.14471 +"means <quote>four patches after <literal>bar.patch</literal></quote>."
242.14472 +msgstr ""
242.14473 +
242.14474 +#. type: Content of: <book><chapter><sect1><para>
242.14475 +#: ../en/ch11-mq.xml:920
242.14476 +msgid ""
242.14477 +"Referring to a patch by index isn't much different.  The first patch printed "
242.14478 +"in the output of <command role=\"hg-ext-mq\">qseries</command> is patch zero "
242.14479 +"(yes, it's one of those start-at-zero counting systems); the second is patch "
242.14480 +"one; and so on."
242.14481 +msgstr ""
242.14482 +
242.14483 +#. type: Content of: <book><chapter><sect1><para>
242.14484 +#: ../en/ch11-mq.xml:926
242.14485 +msgid ""
242.14486 +"MQ also makes it easy to work with patches when you are using normal "
242.14487 +"Mercurial commands.  Every command that accepts a changeset ID will also "
242.14488 +"accept the name of an applied patch.  MQ augments the tags normally in the "
242.14489 +"repository with an eponymous one for each applied patch.  In addition, the "
242.14490 +"special tags <literal role=\"tag\">qbase</literal> and <literal role=\"tag"
242.14491 +"\">qtip</literal> identify the <quote>bottom-most</quote> and topmost applied "
242.14492 +"patches, respectively."
242.14493 +msgstr ""
242.14494 +
242.14495 +#. type: Content of: <book><chapter><sect1><para>
242.14496 +#: ../en/ch11-mq.xml:936
242.14497 +msgid ""
242.14498 +"These additions to Mercurial's normal tagging capabilities make dealing with "
242.14499 +"patches even more of a breeze."
242.14500 +msgstr ""
242.14501 +
242.14502 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.14503 +#: ../en/ch11-mq.xml:939
242.14504 +msgid "Want to patchbomb a mailing list with your latest series of changes?"
242.14505 +msgstr ""
242.14506 +
242.14507 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.14508 +#: ../en/ch11-mq.xml:942
242.14509 +msgid ""
242.14510 +"(Don't know what <quote>patchbombing</quote> is? See <xref linkend=\"sec:"
242.14511 +"hgext:patchbomb\"/>.)"
242.14512 +msgstr ""
242.14513 +
242.14514 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.14515 +#: ../en/ch11-mq.xml:945
242.14516 +msgid ""
242.14517 +"Need to see all of the patches since <literal>foo.patch</literal> that have "
242.14518 +"touched files in a subdirectory of your tree?"
242.14519 +msgstr ""
242.14520 +
242.14521 +#. type: Content of: <book><chapter><sect1><para>
242.14522 +#: ../en/ch11-mq.xml:952
242.14523 +msgid ""
242.14524 +"Because MQ makes the names of patches available to the rest of Mercurial "
242.14525 +"through its normal internal tag machinery, you don't need to type in the "
242.14526 +"entire name of a patch when you want to identify it by name."
242.14527 +msgstr ""
242.14528 +
242.14529 +#. type: Content of: <book><chapter><sect1><para>
242.14530 +#: ../en/ch11-mq.xml:957
242.14531 +msgid ""
242.14532 +"Another nice consequence of representing patch names as tags is that when you "
242.14533 +"run the <command role=\"hg-cmd\">hg log</command> command, it will display a "
242.14534 +"patch's name as a tag, simply as part of its normal output.  This makes it "
242.14535 +"easy to visually distinguish applied patches from underlying <quote>normal</"
242.14536 +"quote> revisions.  The following example shows a few normal Mercurial "
242.14537 +"commands in use with applied patches."
242.14538 +msgstr ""
242.14539 +
242.14540 +#. type: Content of: <book><chapter><sect1><title>
242.14541 +#: ../en/ch11-mq.xml:970
242.14542 +msgid "Useful things to know about"
242.14543 +msgstr "其它需要了解的东西"
242.14544 +
242.14545 +#. type: Content of: <book><chapter><sect1><para>
242.14546 +#: ../en/ch11-mq.xml:972
242.14547 +msgid ""
242.14548 +"There are a number of aspects of MQ usage that don't fit tidily into sections "
242.14549 +"of their own, but that are good to know.  Here they are, in one place."
242.14550 +msgstr ""
242.14551 +
242.14552 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.14553 +#: ../en/ch11-mq.xml:977
242.14554 +msgid ""
242.14555 +"Normally, when you <command role=\"hg-ext-mq\">qpop</command> a patch and "
242.14556 +"<command role=\"hg-ext-mq\">qpush</command> it again, the changeset that "
242.14557 +"represents the patch after the pop/push will have a <emphasis>different "
242.14558 +"identity</emphasis> than the changeset that represented the hash beforehand.  "
242.14559 +"See <xref linkend=\"sec:mqref:cmd:qpush\"/> for information as to why this is."
242.14560 +msgstr ""
242.14561 +
242.14562 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.14563 +#: ../en/ch11-mq.xml:986
242.14564 +msgid ""
242.14565 +"It's not a good idea to <command role=\"hg-cmd\">hg merge</command> changes "
242.14566 +"from another branch with a patch changeset, at least if you want to maintain "
242.14567 +"the <quote>patchiness</quote> of that changeset and changesets below it on "
242.14568 +"the patch stack.  If you try to do this, it will appear to succeed, but MQ "
242.14569 +"will become confused."
242.14570 +msgstr ""
242.14571 +
242.14572 +#. type: Content of: <book><chapter><sect1><title>
242.14573 +#: ../en/ch11-mq.xml:997
242.14574 +msgid "Managing patches in a repository"
242.14575 +msgstr "在版本库管理补丁"
242.14576 +
242.14577 +#. type: Content of: <book><chapter><sect1><para>
242.14578 +#: ../en/ch11-mq.xml:999
242.14579 +msgid ""
242.14580 +"Because MQ's <filename role=\"special\" class=\"directory\">.hg/patches</"
242.14581 +"filename> directory resides outside a Mercurial repository's working "
242.14582 +"directory, the <quote>underlying</quote> Mercurial repository knows nothing "
242.14583 +"about the management or presence of patches."
242.14584 +msgstr ""
242.14585 +
242.14586 +#. type: Content of: <book><chapter><sect1><para>
242.14587 +#: ../en/ch11-mq.xml:1005
242.14588 +msgid ""
242.14589 +"This presents the interesting possibility of managing the contents of the "
242.14590 +"patch directory as a Mercurial repository in its own right.  This can be a "
242.14591 +"useful way to work.  For example, you can work on a patch for a while, "
242.14592 +"<command role=\"hg-ext-mq\">qrefresh</command> it, then <command role=\"hg-cmd"
242.14593 +"\">hg commit</command> the current state of the patch.  This lets you "
242.14594 +"<quote>roll back</quote> to that version of the patch later on."
242.14595 +msgstr ""
242.14596 +
242.14597 +#. type: Content of: <book><chapter><sect1><para>
242.14598 +#: ../en/ch11-mq.xml:1014
242.14599 +msgid ""
242.14600 +"You can then share different versions of the same patch stack among multiple "
242.14601 +"underlying repositories.  I use this when I am developing a Linux kernel "
242.14602 +"feature.  I have a pristine copy of my kernel sources for each of several CPU "
242.14603 +"architectures, and a cloned repository under each that contains the patches I "
242.14604 +"am working on.  When I want to test a change on a different architecture, I "
242.14605 +"push my current patches to the patch repository associated with that kernel "
242.14606 +"tree, pop and push all of my patches, and build and test that kernel."
242.14607 +msgstr ""
242.14608 +
242.14609 +#. type: Content of: <book><chapter><sect1><para>
242.14610 +#: ../en/ch11-mq.xml:1024
242.14611 +msgid ""
242.14612 +"Managing patches in a repository makes it possible for multiple developers to "
242.14613 +"work on the same patch series without colliding with each other, all on top "
242.14614 +"of an underlying source base that they may or may not control."
242.14615 +msgstr ""
242.14616 +
242.14617 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.14618 +#: ../en/ch11-mq.xml:1030
242.14619 +msgid "MQ support for patch repositories"
242.14620 +msgstr "MQ 支持补丁版本库"
242.14621 +
242.14622 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14623 +#: ../en/ch11-mq.xml:1032
242.14624 +msgid ""
242.14625 +"MQ helps you to work with the <filename role=\"special\" class=\"directory\">."
242.14626 +"hg/patches</filename> directory as a repository; when you prepare a "
242.14627 +"repository for working with patches using <command role=\"hg-ext-mq\">qinit</"
242.14628 +"command>, you can pass the <option role=\"hg-ext-mq-cmd-qinit-opt\">hg -c</"
242.14629 +"option> option to create the <filename role=\"special\" class=\"directory\">."
242.14630 +"hg/patches</filename> directory as a Mercurial repository."
242.14631 +msgstr ""
242.14632 +
242.14633 +#. type: Content of: <book><chapter><sect1><sect2><note><para>
242.14634 +#: ../en/ch11-mq.xml:1042
242.14635 +msgid ""
242.14636 +"If you forget to use the <option role=\"hg-ext-mq-cmd-qinit-opt\">hg -c</"
242.14637 +"option> option, you can simply go into the <filename role=\"special\" class="
242.14638 +"\"directory\">.hg/patches</filename> directory at any time and run <command "
242.14639 +"role=\"hg-cmd\">hg init</command>.  Don't forget to add an entry for the "
242.14640 +"<filename role=\"special\">status</filename> file to the <filename role="
242.14641 +"\"special\">.hgignore</filename> file, though"
242.14642 +msgstr ""
242.14643 +
242.14644 +#. type: Content of: <book><chapter><sect1><sect2><note><para>
242.14645 +#: ../en/ch11-mq.xml:1051
242.14646 +msgid ""
242.14647 +"(<command role=\"hg-cmd\">hg qinit <option role=\"hg-ext-mq-cmd-qinit-opt"
242.14648 +"\">hg -c</option></command> does this for you automatically); you "
242.14649 +"<emphasis>really</emphasis> don't want to manage the <filename role=\"special"
242.14650 +"\">status</filename> file."
242.14651 +msgstr ""
242.14652 +
242.14653 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14654 +#: ../en/ch11-mq.xml:1058
242.14655 +msgid ""
242.14656 +"As a convenience, if MQ notices that the <filename class=\"directory\">.hg/"
242.14657 +"patches</filename> directory is a repository, it will automatically <command "
242.14658 +"role=\"hg-cmd\">hg add</command> every patch that you create and import."
242.14659 +msgstr ""
242.14660 +
242.14661 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14662 +#: ../en/ch11-mq.xml:1063
242.14663 +msgid ""
242.14664 +"MQ provides a shortcut command, <command role=\"hg-ext-mq\">qcommit</"
242.14665 +"command>, that runs <command role=\"hg-cmd\">hg commit</command> in the "
242.14666 +"<filename role=\"special\" class=\"directory\">.hg/patches</filename> "
242.14667 +"directory.  This saves some bothersome typing."
242.14668 +msgstr ""
242.14669 +
242.14670 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14671 +#: ../en/ch11-mq.xml:1069
242.14672 +msgid ""
242.14673 +"Finally, as a convenience to manage the patch directory, you can define the "
242.14674 +"alias <command>mq</command> on Unix systems. For example, on Linux systems "
242.14675 +"using the <command>bash</command> shell, you can include the following "
242.14676 +"snippet in your <filename role=\"home\">~/.bashrc</filename>."
242.14677 +msgstr ""
242.14678 +
242.14679 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14680 +#: ../en/ch11-mq.xml:1078
242.14681 +msgid ""
242.14682 +"You can then issue commands of the form <command>mq pull</command> from the "
242.14683 +"main repository."
242.14684 +msgstr ""
242.14685 +
242.14686 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.14687 +#: ../en/ch11-mq.xml:1083
242.14688 +msgid "A few things to watch out for"
242.14689 +msgstr "需要注意的事情"
242.14690 +
242.14691 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14692 +#: ../en/ch11-mq.xml:1085
242.14693 +msgid ""
242.14694 +"MQ's support for working with a repository full of patches is limited in a "
242.14695 +"few small respects."
242.14696 +msgstr ""
242.14697 +
242.14698 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14699 +#: ../en/ch11-mq.xml:1088
242.14700 +msgid ""
242.14701 +"MQ cannot automatically detect changes that you make to the patch directory.  "
242.14702 +"If you <command role=\"hg-cmd\">hg pull</command>, manually edit, or <command "
242.14703 +"role=\"hg-cmd\">hg update</command> changes to patches or the <filename role="
242.14704 +"\"special\">series</filename> file, you will have to <command role=\"hg-cmd"
242.14705 +"\">hg qpop <option role=\"hg-ext-mq-cmd-qpop-opt\">hg -a</option></command> "
242.14706 +"and then <command role=\"hg-cmd\">hg qpush <option role=\"hg-ext-mq-cmd-qpush-"
242.14707 +"opt\">hg -a</option></command> in the underlying repository to see those "
242.14708 +"changes show up there.  If you forget to do this, you can confuse MQ's idea "
242.14709 +"of which patches are applied."
242.14710 +msgstr ""
242.14711 +
242.14712 +#. type: Content of: <book><chapter><sect1><title>
242.14713 +#: ../en/ch11-mq.xml:1104
242.14714 +msgid "Third party tools for working with patches"
242.14715 +msgstr "操作补丁的第三方工具"
242.14716 +
242.14717 +#. type: Content of: <book><chapter><sect1><para>
242.14718 +#: ../en/ch11-mq.xml:1106
242.14719 +msgid ""
242.14720 +"Once you've been working with patches for a while, you'll find yourself "
242.14721 +"hungry for tools that will help you to understand and manipulate the patches "
242.14722 +"you're dealing with."
242.14723 +msgstr ""
242.14724 +
242.14725 +#. type: Content of: <book><chapter><sect1><para>
242.14726 +#: ../en/ch11-mq.xml:1110
242.14727 +msgid ""
242.14728 +"The <command>diffstat</command> command <citation>web:diffstat</citation> "
242.14729 +"generates a histogram of the modifications made to each file in a patch.  It "
242.14730 +"provides a good way to <quote>get a sense of</quote> a patch&emdash;which "
242.14731 +"files it affects, and how much change it introduces to each file and as a "
242.14732 +"whole.  (I find that it's a good idea to use <command>diffstat</command>'s "
242.14733 +"<option role=\"cmd-opt-diffstat\">-p</option> option as a matter of course, "
242.14734 +"as otherwise it will try to do clever things with prefixes of file names that "
242.14735 +"inevitably confuse at least me.)"
242.14736 +msgstr ""
242.14737 +
242.14738 +#. type: Content of: <book><chapter><sect1><para>
242.14739 +#: ../en/ch11-mq.xml:1124
242.14740 +msgid ""
242.14741 +"The <literal role=\"package\">patchutils</literal> package <citation>web:"
242.14742 +"patchutils</citation> is invaluable. It provides a set of small utilities "
242.14743 +"that follow the <quote>Unix philosophy;</quote> each does one useful thing "
242.14744 +"with a patch.  The <literal role=\"package\">patchutils</literal> command I "
242.14745 +"use most is <command>filterdiff</command>, which extracts subsets from a "
242.14746 +"patch file.  For example, given a patch that modifies hundreds of files "
242.14747 +"across dozens of directories, a single invocation of <command>filterdiff</"
242.14748 +"command> can generate a smaller patch that only touches files whose names "
242.14749 +"match a particular glob pattern.  See <xref linkend=\"mq-collab:tips:interdiff"
242.14750 +"\"/> for another example."
242.14751 +msgstr ""
242.14752 +
242.14753 +#. type: Content of: <book><chapter><sect1><title>
242.14754 +#: ../en/ch11-mq.xml:1140
242.14755 +msgid "Good ways to work with patches"
242.14756 +msgstr "操作补丁的好习惯"
242.14757 +
242.14758 +#. type: Content of: <book><chapter><sect1><para>
242.14759 +#: ../en/ch11-mq.xml:1142
242.14760 +msgid ""
242.14761 +"Whether you are working on a patch series to submit to a free software or "
242.14762 +"open source project, or a series that you intend to treat as a sequence of "
242.14763 +"regular changesets when you're done, you can use some simple techniques to "
242.14764 +"keep your work well organised."
242.14765 +msgstr ""
242.14766 +
242.14767 +#. type: Content of: <book><chapter><sect1><para>
242.14768 +#: ../en/ch11-mq.xml:1148
242.14769 +msgid ""
242.14770 +"Give your patches descriptive names.  A good name for a patch might be "
242.14771 +"<filename>rework-device-alloc.patch</filename>, because it will immediately "
242.14772 +"give you a hint what the purpose of the patch is.  Long names shouldn't be a "
242.14773 +"problem; you won't be typing the names often, but you <emphasis>will</"
242.14774 +"emphasis> be running commands like <command role=\"hg-ext-mq\">qapplied</"
242.14775 +"command> and <command role=\"hg-ext-mq\">qtop</command> over and over. Good "
242.14776 +"naming becomes especially important when you have a number of patches to work "
242.14777 +"with, or if you are juggling a number of different tasks and your patches "
242.14778 +"only get a fraction of your attention."
242.14779 +msgstr ""
242.14780 +
242.14781 +#. type: Content of: <book><chapter><sect1><para>
242.14782 +#: ../en/ch11-mq.xml:1160
242.14783 +msgid ""
242.14784 +"Be aware of what patch you're working on.  Use the <command role=\"hg-ext-mq"
242.14785 +"\">qtop</command> command and skim over the text of your patches "
242.14786 +"frequently&emdash;for example, using <command role=\"hg-cmd\">hg tip <option "
242.14787 +"role=\"hg-opt-tip\">-p</option></command>)&emdash;to be sure of where you "
242.14788 +"stand.  I have several times worked on and <command role=\"hg-ext-mq"
242.14789 +"\">qrefresh</command>ed a patch other than the one I intended, and it's often "
242.14790 +"tricky to migrate changes into the right patch after making them in the wrong "
242.14791 +"one."
242.14792 +msgstr ""
242.14793 +
242.14794 +#. type: Content of: <book><chapter><sect1><para>
242.14795 +#: ../en/ch11-mq.xml:1170
242.14796 +msgid ""
242.14797 +"For this reason, it is very much worth investing a little time to learn how "
242.14798 +"to use some of the third-party tools I described in <xref linkend=\"sec:mq:"
242.14799 +"tools\"/>, particularly <command>diffstat</command> and <command>filterdiff</"
242.14800 +"command>.  The former will give you a quick idea of what changes your patch "
242.14801 +"is making, while the latter makes it easy to splice hunks selectively out of "
242.14802 +"one patch and into another."
242.14803 +msgstr ""
242.14804 +
242.14805 +#. type: Content of: <book><chapter><sect1><title>
242.14806 +#: ../en/ch11-mq.xml:1181
242.14807 +msgid "MQ cookbook"
242.14808 +msgstr "MQ 手册"
242.14809 +
242.14810 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.14811 +#: ../en/ch11-mq.xml:1184
242.14812 +msgid "Manage <quote>trivial</quote> patches"
242.14813 +msgstr "管理<quote>琐碎的</quote>补丁"
242.14814 +
242.14815 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14816 +#: ../en/ch11-mq.xml:1186
242.14817 +msgid ""
242.14818 +"Because the overhead of dropping files into a new Mercurial repository is so "
242.14819 +"low, it makes a lot of sense to manage patches this way even if you simply "
242.14820 +"want to make a few changes to a source tarball that you downloaded."
242.14821 +msgstr ""
242.14822 +
242.14823 +#
242.14824 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14825 +#: ../en/ch11-mq.xml:1191
242.14826 +msgid ""
242.14827 +"Begin by downloading and unpacking the source tarball, and turning it into a "
242.14828 +"Mercurial repository."
242.14829 +msgstr ""
242.14830 +
242.14831 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14832 +#: ../en/ch11-mq.xml:1196
242.14833 +msgid "Continue by creating a patch stack and making your changes."
242.14834 +msgstr ""
242.14835 +
242.14836 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14837 +#: ../en/ch11-mq.xml:1201
242.14838 +msgid ""
242.14839 +"Let's say a few weeks or months pass, and your package author releases a new "
242.14840 +"version.  First, bring their changes into the repository."
242.14841 +msgstr ""
242.14842 +
242.14843 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14844 +#: ../en/ch11-mq.xml:1207
242.14845 +msgid ""
242.14846 +"The pipeline starting with <command role=\"hg-cmd\">hg locate</command> above "
242.14847 +"deletes all files in the working directory, so that <command role=\"hg-cmd"
242.14848 +"\">hg commit</command>'s <option role=\"hg-opt-commit\">--addremove</option> "
242.14849 +"option can actually tell which files have really been removed in the newer "
242.14850 +"version of the source."
242.14851 +msgstr ""
242.14852 +
242.14853 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14854 +#: ../en/ch11-mq.xml:1215
242.14855 +msgid "Finally, you can apply your patches on top of the new tree."
242.14856 +msgstr ""
242.14857 +
242.14858 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.14859 +#: ../en/ch11-mq.xml:1222
242.14860 +msgid "Combining entire patches"
242.14861 +msgstr "组合全部的补丁"
242.14862 +
242.14863 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14864 +#: ../en/ch11-mq.xml:1224
242.14865 +msgid ""
242.14866 +"MQ provides a command, <command role=\"hg-ext-mq\">qfold</command> that lets "
242.14867 +"you combine entire patches.  This <quote>folds</quote> the patches you name, "
242.14868 +"in the order you name them, into the topmost applied patch, and concatenates "
242.14869 +"their descriptions onto the end of its description.  The patches that you "
242.14870 +"fold must be unapplied before you fold them."
242.14871 +msgstr ""
242.14872 +
242.14873 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14874 +#: ../en/ch11-mq.xml:1232
242.14875 +msgid ""
242.14876 +"The order in which you fold patches matters.  If your topmost applied patch "
242.14877 +"is <literal>foo</literal>, and you <command role=\"hg-ext-mq\">qfold</"
242.14878 +"command> <literal>bar</literal> and <literal>quux</literal> into it, you will "
242.14879 +"end up with a patch that has the same effect as if you applied first "
242.14880 +"<literal>foo</literal>, then <literal>bar</literal>, followed by "
242.14881 +"<literal>quux</literal>."
242.14882 +msgstr ""
242.14883 +
242.14884 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.14885 +#: ../en/ch11-mq.xml:1243
242.14886 +msgid "Merging part of one patch into another"
242.14887 +msgstr "合并补丁的部分内容到其它补丁"
242.14888 +
242.14889 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14890 +#: ../en/ch11-mq.xml:1245
242.14891 +msgid ""
242.14892 +"Merging <emphasis>part</emphasis> of one patch into another is more difficult "
242.14893 +"than combining entire patches."
242.14894 +msgstr ""
242.14895 +
242.14896 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14897 +#: ../en/ch11-mq.xml:1249
242.14898 +msgid ""
242.14899 +"If you want to move changes to entire files, you can use <command>filterdiff</"
242.14900 +"command>'s <option role=\"cmd-opt-filterdiff\">-i</option> and <option role="
242.14901 +"\"cmd-opt-filterdiff\">-x</option> options to choose the modifications to "
242.14902 +"snip out of one patch, concatenating its output onto the end of the patch you "
242.14903 +"want to merge into.  You usually won't need to modify the patch you've merged "
242.14904 +"the changes from.  Instead, MQ will report some rejected hunks when you "
242.14905 +"<command role=\"hg-ext-mq\">qpush</command> it (from the hunks you moved into "
242.14906 +"the other patch), and you can simply <command role=\"hg-ext-mq\">qrefresh</"
242.14907 +"command> the patch to drop the duplicate hunks."
242.14908 +msgstr ""
242.14909 +
242.14910 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14911 +#: ../en/ch11-mq.xml:1262
242.14912 +msgid ""
242.14913 +"If you have a patch that has multiple hunks modifying a file, and you only "
242.14914 +"want to move a few of those hunks, the job becomes more messy, but you can "
242.14915 +"still partly automate it.  Use <command>lsdiff -nvv</command> to print some "
242.14916 +"metadata about the patch."
242.14917 +msgstr ""
242.14918 +
242.14919 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14920 +#: ../en/ch11-mq.xml:1270
242.14921 +msgid "This command prints three different kinds of number:"
242.14922 +msgstr ""
242.14923 +
242.14924 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.14925 +#: ../en/ch11-mq.xml:1273
242.14926 +msgid ""
242.14927 +"(in the first column) a <emphasis>file number</emphasis> to identify each "
242.14928 +"file modified in the patch;"
242.14929 +msgstr ""
242.14930 +
242.14931 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.14932 +#: ../en/ch11-mq.xml:1277
242.14933 +msgid ""
242.14934 +"(on the next line, indented) the line number within a modified file where a "
242.14935 +"hunk starts; and"
242.14936 +msgstr ""
242.14937 +
242.14938 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.14939 +#: ../en/ch11-mq.xml:1280
242.14940 +msgid ""
242.14941 +"(on the same line) a <emphasis>hunk number</emphasis> to identify that hunk."
242.14942 +msgstr ""
242.14943 +
242.14944 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14945 +#: ../en/ch11-mq.xml:1284
242.14946 +msgid ""
242.14947 +"You'll have to use some visual inspection, and reading of the patch, to "
242.14948 +"identify the file and hunk numbers you'll want, but you can then pass them to "
242.14949 +"to <command>filterdiff</command>'s <option role=\"cmd-opt-filterdiff\">--"
242.14950 +"files</option> and <option role=\"cmd-opt-filterdiff\">--hunks</option> "
242.14951 +"options, to select exactly the file and hunk you want to extract."
242.14952 +msgstr ""
242.14953 +
242.14954 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.14955 +#: ../en/ch11-mq.xml:1292
242.14956 +msgid ""
242.14957 +"Once you have this hunk, you can concatenate it onto the end of your "
242.14958 +"destination patch and continue with the remainder of <xref linkend=\"sec:mq:"
242.14959 +"combine\"/>."
242.14960 +msgstr ""
242.14961 +
242.14962 +#. type: Content of: <book><chapter><sect1><title>
242.14963 +#: ../en/ch11-mq.xml:1299
242.14964 +msgid "Differences between quilt and MQ"
242.14965 +msgstr "MQ 与 quilt 的区别"
242.14966 +
242.14967 +#. type: Content of: <book><chapter><sect1><para>
242.14968 +#: ../en/ch11-mq.xml:1301
242.14969 +msgid ""
242.14970 +"If you are already familiar with quilt, MQ provides a similar command set.  "
242.14971 +"There are a few differences in the way that it works."
242.14972 +msgstr ""
242.14973 +
242.14974 +#. type: Content of: <book><chapter><sect1><para>
242.14975 +#: ../en/ch11-mq.xml:1305
242.14976 +msgid ""
242.14977 +"You will already have noticed that most quilt commands have MQ counterparts "
242.14978 +"that simply begin with a <quote><literal>q</literal></quote>.  The exceptions "
242.14979 +"are quilt's <literal>add</literal> and <literal>remove</literal> commands, "
242.14980 +"the counterparts for which are the normal Mercurial <command role=\"hg-cmd"
242.14981 +"\">hg add</command> and <command role=\"hg-cmd\">hg remove</command> "
242.14982 +"commands.  There is no MQ equivalent of the quilt <literal>edit</literal> "
242.14983 +"command."
242.14984 +msgstr ""
242.14985 +
242.14986 +#. type: Content of: <book><chapter><title>
242.14987 +#: ../en/ch12-mq-collab.xml:5
242.14988 +msgid "Advanced uses of Mercurial Queues"
242.14989 +msgstr "MQ 的高级用法"
242.14990 +
242.14991 +#. type: Content of: <book><chapter><para>
242.14992 +#: ../en/ch12-mq-collab.xml:7
242.14993 +msgid ""
242.14994 +"While it's easy to pick up straightforward uses of Mercurial Queues, use of a "
242.14995 +"little discipline and some of MQ's less frequently used capabilities makes it "
242.14996 +"possible to work in complicated development environments."
242.14997 +msgstr ""
242.14998 +
242.14999 +#. type: Content of: <book><chapter><para>
242.15000 +#: ../en/ch12-mq-collab.xml:12
242.15001 +msgid ""
242.15002 +"In this chapter, I will use as an example a technique I have used to manage "
242.15003 +"the development of an Infiniband device driver for the Linux kernel.  The "
242.15004 +"driver in question is large (at least as drivers go), with 25,000 lines of "
242.15005 +"code spread across 35 source files.  It is maintained by a small team of "
242.15006 +"developers."
242.15007 +msgstr ""
242.15008 +
242.15009 +#. type: Content of: <book><chapter><para>
242.15010 +#: ../en/ch12-mq-collab.xml:18
242.15011 +msgid ""
242.15012 +"While much of the material in this chapter is specific to Linux, the same "
242.15013 +"principles apply to any code base for which you're not the primary owner, and "
242.15014 +"upon which you need to do a lot of development."
242.15015 +msgstr ""
242.15016 +
242.15017 +#. type: Content of: <book><chapter><sect1><title>
242.15018 +#: ../en/ch12-mq-collab.xml:24
242.15019 +msgid "The problem of many targets"
242.15020 +msgstr "多个目标的问题"
242.15021 +
242.15022 +#. type: Content of: <book><chapter><sect1><para>
242.15023 +#: ../en/ch12-mq-collab.xml:26
242.15024 +msgid ""
242.15025 +"The Linux kernel changes rapidly, and has never been internally stable; "
242.15026 +"developers frequently make drastic changes between releases. This means that "
242.15027 +"a version of the driver that works well with a particular released version of "
242.15028 +"the kernel will not even <emphasis>compile</emphasis> correctly against, "
242.15029 +"typically, any other version."
242.15030 +msgstr ""
242.15031 +
242.15032 +#. type: Content of: <book><chapter><sect1><para>
242.15033 +#: ../en/ch12-mq-collab.xml:33
242.15034 +msgid ""
242.15035 +"To maintain a driver, we have to keep a number of distinct versions of Linux "
242.15036 +"in mind."
242.15037 +msgstr ""
242.15038 +
242.15039 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.15040 +#: ../en/ch12-mq-collab.xml:36
242.15041 +msgid ""
242.15042 +"One target is the main Linux kernel development tree. Maintenance of the code "
242.15043 +"is in this case partly shared by other developers in the kernel community, "
242.15044 +"who make <quote>drive-by</quote> modifications to the driver as they develop "
242.15045 +"and refine kernel subsystems."
242.15046 +msgstr ""
242.15047 +
242.15048 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.15049 +#: ../en/ch12-mq-collab.xml:42
242.15050 +msgid ""
242.15051 +"We also maintain a number of <quote>backports</quote> to older versions of "
242.15052 +"the Linux kernel, to support the needs of customers who are running older "
242.15053 +"Linux distributions that do not incorporate our drivers.  (To "
242.15054 +"<emphasis>backport</emphasis> a piece of code is to modify it to work in an "
242.15055 +"older version of its target environment than the version it was developed "
242.15056 +"for.)"
242.15057 +msgstr ""
242.15058 +
242.15059 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.15060 +#: ../en/ch12-mq-collab.xml:50
242.15061 +msgid ""
242.15062 +"Finally, we make software releases on a schedule that is necessarily not "
242.15063 +"aligned with those used by Linux distributors and kernel developers, so that "
242.15064 +"we can deliver new features to customers without forcing them to upgrade "
242.15065 +"their entire kernels or distributions."
242.15066 +msgstr ""
242.15067 +
242.15068 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.15069 +#: ../en/ch12-mq-collab.xml:58
242.15070 +msgid "Tempting approaches that don't work well"
242.15071 +msgstr "工作不好的诱人方法"
242.15072 +
242.15073 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.15074 +#: ../en/ch12-mq-collab.xml:60
242.15075 +msgid ""
242.15076 +"There are two <quote>standard</quote> ways to maintain a piece of software "
242.15077 +"that has to target many different environments."
242.15078 +msgstr ""
242.15079 +
242.15080 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.15081 +#: ../en/ch12-mq-collab.xml:64
242.15082 +msgid ""
242.15083 +"The first is to maintain a number of branches, each intended for a single "
242.15084 +"target.  The trouble with this approach is that you must maintain iron "
242.15085 +"discipline in the flow of changes between repositories. A new feature or bug "
242.15086 +"fix must start life in a <quote>pristine</quote> repository, then percolate "
242.15087 +"out to every backport repository.  Backport changes are more limited in the "
242.15088 +"branches they should propagate to; a backport change that is applied to a "
242.15089 +"branch where it doesn't belong will probably stop the driver from compiling."
242.15090 +msgstr ""
242.15091 +
242.15092 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.15093 +#: ../en/ch12-mq-collab.xml:74
242.15094 +msgid ""
242.15095 +"The second is to maintain a single source tree filled with conditional "
242.15096 +"statements that turn chunks of code on or off depending on the intended "
242.15097 +"target.  Because these <quote>ifdefs</quote> are not allowed in the Linux "
242.15098 +"kernel tree, a manual or automatic process must be followed to strip them out "
242.15099 +"and yield a clean tree.  A code base maintained in this fashion rapidly "
242.15100 +"becomes a rat's nest of conditional blocks that are difficult to understand "
242.15101 +"and maintain."
242.15102 +msgstr ""
242.15103 +
242.15104 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.15105 +#: ../en/ch12-mq-collab.xml:83
242.15106 +msgid ""
242.15107 +"Neither of these approaches is well suited to a situation where you don't "
242.15108 +"<quote>own</quote> the canonical copy of a source tree.  In the case of a "
242.15109 +"Linux driver that is distributed with the standard kernel, Linus's tree "
242.15110 +"contains the copy of the code that will be treated by the world as "
242.15111 +"canonical.  The upstream version of <quote>my</quote> driver can be modified "
242.15112 +"by people I don't know, without me even finding out about it until after the "
242.15113 +"changes show up in Linus's tree."
242.15114 +msgstr ""
242.15115 +
242.15116 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.15117 +#: ../en/ch12-mq-collab.xml:93
242.15118 +msgid ""
242.15119 +"These approaches have the added weakness of making it difficult to generate "
242.15120 +"well-formed patches to submit upstream."
242.15121 +msgstr ""
242.15122 +
242.15123 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.15124 +#: ../en/ch12-mq-collab.xml:97
242.15125 +msgid ""
242.15126 +"In principle, Mercurial Queues seems like a good candidate to manage a "
242.15127 +"development scenario such as the above.  While this is indeed the case, MQ "
242.15128 +"contains a few added features that make the job more pleasant."
242.15129 +msgstr ""
242.15130 +
242.15131 +#. type: Content of: <book><chapter><sect1><title>
242.15132 +#: ../en/ch12-mq-collab.xml:105
242.15133 +msgid "Conditionally applying patches with guards"
242.15134 +msgstr "有条件的应用补丁"
242.15135 +
242.15136 +#. type: Content of: <book><chapter><sect1><para>
242.15137 +#: ../en/ch12-mq-collab.xml:107
242.15138 +msgid ""
242.15139 +"Perhaps the best way to maintain sanity with so many targets is to be able to "
242.15140 +"choose specific patches to apply for a given situation.  MQ provides a "
242.15141 +"feature called <quote>guards</quote> (which originates with quilt's "
242.15142 +"<literal>guards</literal> command) that does just this.  To start off, let's "
242.15143 +"create a simple repository for experimenting in."
242.15144 +msgstr ""
242.15145 +
242.15146 +#. type: Content of: <book><chapter><sect1><para>
242.15147 +#: ../en/ch12-mq-collab.xml:116
242.15148 +msgid ""
242.15149 +"This gives us a tiny repository that contains two patches that don't have any "
242.15150 +"dependencies on each other, because they touch different files."
242.15151 +msgstr ""
242.15152 +
242.15153 +#. type: Content of: <book><chapter><sect1><para>
242.15154 +#: ../en/ch12-mq-collab.xml:120
242.15155 +msgid ""
242.15156 +"The idea behind conditional application is that you can <quote>tag</quote> a "
242.15157 +"patch with a <emphasis>guard</emphasis>, which is simply a text string of "
242.15158 +"your choosing, then tell MQ to select specific guards to use when applying "
242.15159 +"patches.  MQ will then either apply, or skip over, a guarded patch, depending "
242.15160 +"on the guards that you have selected."
242.15161 +msgstr ""
242.15162 +
242.15163 +#. type: Content of: <book><chapter><sect1><para>
242.15164 +#: ../en/ch12-mq-collab.xml:127
242.15165 +msgid ""
242.15166 +"A patch can have an arbitrary number of guards; each one is "
242.15167 +"<emphasis>positive</emphasis> (<quote>apply this patch if this guard is "
242.15168 +"selected</quote>) or <emphasis>negative</emphasis> (<quote>skip this patch if "
242.15169 +"this guard is selected</quote>).  A patch with no guards is always applied."
242.15170 +msgstr ""
242.15171 +
242.15172 +#. type: Content of: <book><chapter><sect1><title>
242.15173 +#: ../en/ch12-mq-collab.xml:135
242.15174 +msgid "Controlling the guards on a patch"
242.15175 +msgstr "控制补丁的应用条件"
242.15176 +
242.15177 +#. type: Content of: <book><chapter><sect1><para>
242.15178 +#: ../en/ch12-mq-collab.xml:137
242.15179 +msgid ""
242.15180 +"The <command role=\"hg-ext-mq\">qguard</command> command lets you determine "
242.15181 +"which guards should apply to a patch, or display the guards that are already "
242.15182 +"in effect. Without any arguments, it displays the guards on the current "
242.15183 +"topmost patch."
242.15184 +msgstr ""
242.15185 +
242.15186 +#. type: Content of: <book><chapter><sect1><para>
242.15187 +#: ../en/ch12-mq-collab.xml:144
242.15188 +msgid ""
242.15189 +"To set a positive guard on a patch, prefix the name of the guard with a "
242.15190 +"<quote><literal>+</literal></quote>."
242.15191 +msgstr ""
242.15192 +
242.15193 +#. type: Content of: <book><chapter><sect1><para>
242.15194 +#: ../en/ch12-mq-collab.xml:149
242.15195 +msgid ""
242.15196 +"To set a negative guard on a patch, prefix the name of the guard with a "
242.15197 +"<quote><literal>-</literal></quote>."
242.15198 +msgstr ""
242.15199 +
242.15200 +#. type: Content of: <book><chapter><sect1><note><para>
242.15201 +#: ../en/ch12-mq-collab.xml:156
242.15202 +msgid ""
242.15203 +"The <command role=\"hg-ext-mq\">qguard</command> command <emphasis>sets</"
242.15204 +"emphasis> the guards on a patch; it doesn't <emphasis>modify</emphasis> "
242.15205 +"them.  What this means is that if you run <command role=\"hg-cmd\">hg qguard "
242.15206 +"+a +b</command> on a patch, then <command role=\"hg-cmd\">hg qguard +c</"
242.15207 +"command> on the same patch, the <emphasis>only</emphasis> guard that will be "
242.15208 +"set on it afterwards is <literal>+c</literal>."
242.15209 +msgstr ""
242.15210 +
242.15211 +#
242.15212 +#. type: Content of: <book><chapter><sect1><para>
242.15213 +#: ../en/ch12-mq-collab.xml:165
242.15214 +msgid ""
242.15215 +"Mercurial stores guards in the <filename role=\"special\">series</filename> "
242.15216 +"file; the form in which they are stored is easy both to understand and to "
242.15217 +"edit by hand. (In other words, you don't have to use the <command role=\"hg-"
242.15218 +"ext-mq\">qguard</command> command if you don't want to; it's okay to simply "
242.15219 +"edit the <filename role=\"special\">series</filename> file.)"
242.15220 +msgstr ""
242.15221 +
242.15222 +#. type: Content of: <book><chapter><sect1><title>
242.15223 +#: ../en/ch12-mq-collab.xml:177
242.15224 +msgid "Selecting the guards to use"
242.15225 +msgstr "选择使用的条件"
242.15226 +
242.15227 +#. type: Content of: <book><chapter><sect1><para>
242.15228 +#: ../en/ch12-mq-collab.xml:179
242.15229 +msgid ""
242.15230 +"The <command role=\"hg-ext-mq\">qselect</command> command determines which "
242.15231 +"guards are active at a given time.  The effect of this is to determine which "
242.15232 +"patches MQ will apply the next time you run <command role=\"hg-ext-mq"
242.15233 +"\">qpush</command>.  It has no other effect; in particular, it doesn't do "
242.15234 +"anything to patches that are already applied."
242.15235 +msgstr ""
242.15236 +
242.15237 +#. type: Content of: <book><chapter><sect1><para>
242.15238 +#: ../en/ch12-mq-collab.xml:186
242.15239 +msgid ""
242.15240 +"With no arguments, the <command role=\"hg-ext-mq\">qselect</command> command "
242.15241 +"lists the guards currently in effect, one per line of output.  Each argument "
242.15242 +"is treated as the name of a guard to apply."
242.15243 +msgstr ""
242.15244 +
242.15245 +#. type: Content of: <book><chapter><sect1><para>
242.15246 +#: ../en/ch12-mq-collab.xml:193
242.15247 +msgid ""
242.15248 +"In case you're interested, the currently selected guards are stored in the "
242.15249 +"<filename role=\"special\">guards</filename> file."
242.15250 +msgstr ""
242.15251 +
242.15252 +#. type: Content of: <book><chapter><sect1><para>
242.15253 +#: ../en/ch12-mq-collab.xml:198
242.15254 +msgid ""
242.15255 +"We can see the effect the selected guards have when we run <command role=\"hg-"
242.15256 +"ext-mq\">qpush</command>."
242.15257 +msgstr ""
242.15258 +
242.15259 +#. type: Content of: <book><chapter><sect1><para>
242.15260 +#: ../en/ch12-mq-collab.xml:203
242.15261 +msgid ""
242.15262 +"A guard cannot start with a <quote><literal>+</literal></quote> or "
242.15263 +"<quote><literal>-</literal></quote> character.  The name of a guard must not "
242.15264 +"contain white space, but most other characters are acceptable.  If you try to "
242.15265 +"use a guard with an invalid name, MQ will complain:"
242.15266 +msgstr ""
242.15267 +
242.15268 +#. type: Content of: <book><chapter><sect1><para>
242.15269 +#: ../en/ch12-mq-collab.xml:212
242.15270 +msgid "Changing the selected guards changes the patches that are applied."
242.15271 +msgstr ""
242.15272 +
242.15273 +#. type: Content of: <book><chapter><sect1><para>
242.15274 +#: ../en/ch12-mq-collab.xml:217
242.15275 +msgid ""
242.15276 +"You can see in the example below that negative guards take precedence over "
242.15277 +"positive guards."
242.15278 +msgstr ""
242.15279 +
242.15280 +#. type: Content of: <book><chapter><sect1><title>
242.15281 +#: ../en/ch12-mq-collab.xml:224
242.15282 +msgid "MQ's rules for applying patches"
242.15283 +msgstr "MQ 应用补丁的规则"
242.15284 +
242.15285 +#. type: Content of: <book><chapter><sect1><para>
242.15286 +#: ../en/ch12-mq-collab.xml:226
242.15287 +msgid ""
242.15288 +"The rules that MQ uses when deciding whether to apply a patch are as follows."
242.15289 +msgstr ""
242.15290 +
242.15291 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.15292 +#: ../en/ch12-mq-collab.xml:229
242.15293 +msgid "A patch that has no guards is always applied."
242.15294 +msgstr ""
242.15295 +
242.15296 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.15297 +#: ../en/ch12-mq-collab.xml:232
242.15298 +msgid ""
242.15299 +"If the patch has any negative guard that matches any currently selected "
242.15300 +"guard, the patch is skipped."
242.15301 +msgstr ""
242.15302 +
242.15303 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.15304 +#: ../en/ch12-mq-collab.xml:235
242.15305 +msgid ""
242.15306 +"If the patch has any positive guard that matches any currently selected "
242.15307 +"guard, the patch is applied."
242.15308 +msgstr ""
242.15309 +
242.15310 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.15311 +#: ../en/ch12-mq-collab.xml:238
242.15312 +msgid ""
242.15313 +"If the patch has positive or negative guards, but none matches any currently "
242.15314 +"selected guard, the patch is skipped."
242.15315 +msgstr ""
242.15316 +
242.15317 +#. type: Content of: <book><chapter><sect1><title>
242.15318 +#: ../en/ch12-mq-collab.xml:245
242.15319 +msgid "Trimming the work environment"
242.15320 +msgstr "修剪工作环境"
242.15321 +
242.15322 +#. type: Content of: <book><chapter><sect1><para>
242.15323 +#: ../en/ch12-mq-collab.xml:247
242.15324 +msgid ""
242.15325 +"In working on the device driver I mentioned earlier, I don't apply the "
242.15326 +"patches to a normal Linux kernel tree.  Instead, I use a repository that "
242.15327 +"contains only a snapshot of the source files and headers that are relevant to "
242.15328 +"Infiniband development.  This repository is 1% the size of a kernel "
242.15329 +"repository, so it's easier to work with."
242.15330 +msgstr ""
242.15331 +
242.15332 +#. type: Content of: <book><chapter><sect1><para>
242.15333 +#: ../en/ch12-mq-collab.xml:254
242.15334 +msgid ""
242.15335 +"I then choose a <quote>base</quote> version on top of which the patches are "
242.15336 +"applied.  This is a snapshot of the Linux kernel tree as of a revision of my "
242.15337 +"choosing.  When I take the snapshot, I record the changeset ID from the "
242.15338 +"kernel repository in the commit message.  Since the snapshot preserves the "
242.15339 +"<quote>shape</quote> and content of the relevant parts of the kernel tree, I "
242.15340 +"can apply my patches on top of either my tiny repository or a normal kernel "
242.15341 +"tree."
242.15342 +msgstr ""
242.15343 +
242.15344 +#. type: Content of: <book><chapter><sect1><para>
242.15345 +#: ../en/ch12-mq-collab.xml:263
242.15346 +msgid ""
242.15347 +"Normally, the base tree atop which the patches apply should be a snapshot of "
242.15348 +"a very recent upstream tree.  This best facilitates the development of "
242.15349 +"patches that can easily be submitted upstream with few or no modifications."
242.15350 +msgstr ""
242.15351 +
242.15352 +#. type: Content of: <book><chapter><sect1><title>
242.15353 +#: ../en/ch12-mq-collab.xml:270
242.15354 +msgid "Dividing up the <filename role=\"special\">series</filename> file"
242.15355 +msgstr "分类补丁<filename role=\"special\">系列</filename>"
242.15356 +
242.15357 +#. type: Content of: <book><chapter><sect1><para>
242.15358 +#: ../en/ch12-mq-collab.xml:273
242.15359 +msgid ""
242.15360 +"I categorise the patches in the <filename role=\"special\">series</filename> "
242.15361 +"file into a number of logical groups.  Each section of like patches begins "
242.15362 +"with a block of comments that describes the purpose of the patches that "
242.15363 +"follow."
242.15364 +msgstr ""
242.15365 +
242.15366 +#. type: Content of: <book><chapter><sect1><para>
242.15367 +#: ../en/ch12-mq-collab.xml:279
242.15368 +msgid ""
242.15369 +"The sequence of patch groups that I maintain follows.  The ordering of these "
242.15370 +"groups is important; I'll describe why after I introduce the groups."
242.15371 +msgstr ""
242.15372 +
242.15373 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.15374 +#: ../en/ch12-mq-collab.xml:283
242.15375 +msgid ""
242.15376 +"The <quote>accepted</quote> group.  Patches that the development team has "
242.15377 +"submitted to the maintainer of the Infiniband subsystem, and which he has "
242.15378 +"accepted, but which are not present in the snapshot that the tiny repository "
242.15379 +"is based on.  These are <quote>read only</quote> patches, present only to "
242.15380 +"transform the tree into a similar state as it is in the upstream maintainer's "
242.15381 +"repository."
242.15382 +msgstr ""
242.15383 +
242.15384 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.15385 +#: ../en/ch12-mq-collab.xml:291
242.15386 +msgid ""
242.15387 +"The <quote>rework</quote> group.  Patches that I have submitted, but that the "
242.15388 +"upstream maintainer has requested modifications to before he will accept them."
242.15389 +msgstr ""
242.15390 +
242.15391 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.15392 +#: ../en/ch12-mq-collab.xml:296
242.15393 +msgid ""
242.15394 +"The <quote>pending</quote> group.  Patches that I have not yet submitted to "
242.15395 +"the upstream maintainer, but which we have finished working on. These will be "
242.15396 +"<quote>read only</quote> for a while.  If the upstream maintainer accepts "
242.15397 +"them upon submission, I'll move them to the end of the <quote>accepted</"
242.15398 +"quote> group.  If he requests that I modify any, I'll move them to the "
242.15399 +"beginning of the <quote>rework</quote> group."
242.15400 +msgstr ""
242.15401 +
242.15402 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.15403 +#: ../en/ch12-mq-collab.xml:305
242.15404 +msgid ""
242.15405 +"The <quote>in progress</quote> group.  Patches that are actively being "
242.15406 +"developed, and should not be submitted anywhere yet."
242.15407 +msgstr ""
242.15408 +
242.15409 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.15410 +#: ../en/ch12-mq-collab.xml:309
242.15411 +msgid ""
242.15412 +"The <quote>backport</quote> group.  Patches that adapt the source tree to "
242.15413 +"older versions of the kernel tree."
242.15414 +msgstr ""
242.15415 +
242.15416 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.15417 +#: ../en/ch12-mq-collab.xml:313
242.15418 +msgid ""
242.15419 +"The <quote>do not ship</quote> group.  Patches that for some reason should "
242.15420 +"never be submitted upstream.  For example, one such patch might change "
242.15421 +"embedded driver identification strings to make it easier to distinguish, in "
242.15422 +"the field, between an out-of-tree version of the driver and a version shipped "
242.15423 +"by a distribution vendor."
242.15424 +msgstr ""
242.15425 +
242.15426 +#. type: Content of: <book><chapter><sect1><para>
242.15427 +#: ../en/ch12-mq-collab.xml:321
242.15428 +msgid ""
242.15429 +"Now to return to the reasons for ordering groups of patches in this way.  We "
242.15430 +"would like the lowest patches in the stack to be as stable as possible, so "
242.15431 +"that we will not need to rework higher patches due to changes in context.  "
242.15432 +"Putting patches that will never be changed first in the <filename role="
242.15433 +"\"special\">series</filename> file serves this purpose."
242.15434 +msgstr ""
242.15435 +
242.15436 +#. type: Content of: <book><chapter><sect1><para>
242.15437 +#: ../en/ch12-mq-collab.xml:329
242.15438 +msgid ""
242.15439 +"We would also like the patches that we know we'll need to modify to be "
242.15440 +"applied on top of a source tree that resembles the upstream tree as closely "
242.15441 +"as possible.  This is why we keep accepted patches around for a while."
242.15442 +msgstr ""
242.15443 +
242.15444 +#. type: Content of: <book><chapter><sect1><para>
242.15445 +#: ../en/ch12-mq-collab.xml:334
242.15446 +msgid ""
242.15447 +"The <quote>backport</quote> and <quote>do not ship</quote> patches float at "
242.15448 +"the end of the <filename role=\"special\">series</filename> file.  The "
242.15449 +"backport patches must be applied on top of all other patches, and the "
242.15450 +"<quote>do not ship</quote> patches might as well stay out of harm's way."
242.15451 +msgstr ""
242.15452 +
242.15453 +#. type: Content of: <book><chapter><sect1><title>
242.15454 +#: ../en/ch12-mq-collab.xml:343
242.15455 +msgid "Maintaining the patch series"
242.15456 +msgstr "维护补丁系列"
242.15457 +
242.15458 +#. type: Content of: <book><chapter><sect1><para>
242.15459 +#: ../en/ch12-mq-collab.xml:345
242.15460 +msgid ""
242.15461 +"In my work, I use a number of guards to control which patches are to be "
242.15462 +"applied."
242.15463 +msgstr ""
242.15464 +
242.15465 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.15466 +#: ../en/ch12-mq-collab.xml:349
242.15467 +msgid ""
242.15468 +"<quote>Accepted</quote> patches are guarded with <literal>accepted</"
242.15469 +"literal>.  I enable this guard most of the time.  When I'm applying the "
242.15470 +"patches on top of a tree where the patches are already present, I can turn "
242.15471 +"this patch off, and the patches that follow it will apply cleanly."
242.15472 +msgstr ""
242.15473 +
242.15474 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.15475 +#: ../en/ch12-mq-collab.xml:356
242.15476 +msgid ""
242.15477 +"Patches that are <quote>finished</quote>, but not yet submitted, have no "
242.15478 +"guards.  If I'm applying the patch stack to a copy of the upstream tree, I "
242.15479 +"don't need to enable any guards in order to get a reasonably safe source tree."
242.15480 +msgstr ""
242.15481 +
242.15482 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.15483 +#: ../en/ch12-mq-collab.xml:362
242.15484 +msgid ""
242.15485 +"Those patches that need reworking before being resubmitted are guarded with "
242.15486 +"<literal>rework</literal>."
242.15487 +msgstr ""
242.15488 +
242.15489 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.15490 +#: ../en/ch12-mq-collab.xml:366
242.15491 +msgid ""
242.15492 +"For those patches that are still under development, I use <literal>devel</"
242.15493 +"literal>."
242.15494 +msgstr ""
242.15495 +
242.15496 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.15497 +#: ../en/ch12-mq-collab.xml:369
242.15498 +msgid ""
242.15499 +"A backport patch may have several guards, one for each version of the kernel "
242.15500 +"to which it applies.  For example, a patch that backports a piece of code to "
242.15501 +"2.6.9 will have a <literal>2.6.9</literal> guard."
242.15502 +msgstr ""
242.15503 +
242.15504 +#. type: Content of: <book><chapter><sect1><para>
242.15505 +#: ../en/ch12-mq-collab.xml:374
242.15506 +msgid ""
242.15507 +"This variety of guards gives me considerable flexibility in determining what "
242.15508 +"kind of source tree I want to end up with.  For most situations, the "
242.15509 +"selection of appropriate guards is automated during the build process, but I "
242.15510 +"can manually tune the guards to use for less common circumstances."
242.15511 +msgstr ""
242.15512 +
242.15513 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.15514 +#: ../en/ch12-mq-collab.xml:381
242.15515 +msgid "The art of writing backport patches"
242.15516 +msgstr "编写向后移植补丁的艺术"
242.15517 +
242.15518 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.15519 +#: ../en/ch12-mq-collab.xml:383
242.15520 +msgid ""
242.15521 +"Using MQ, writing a backport patch is a simple process.  All such a patch has "
242.15522 +"to do is modify a piece of code that uses a kernel feature not present in the "
242.15523 +"older version of the kernel, so that the driver continues to work correctly "
242.15524 +"under that older version."
242.15525 +msgstr ""
242.15526 +
242.15527 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.15528 +#: ../en/ch12-mq-collab.xml:389
242.15529 +msgid ""
242.15530 +"A useful goal when writing a good backport patch is to make your code look as "
242.15531 +"if it was written for the older version of the kernel you're targeting.  The "
242.15532 +"less obtrusive the patch, the easier it will be to understand and maintain.  "
242.15533 +"If you're writing a collection of backport patches to avoid the <quote>rat's "
242.15534 +"nest</quote> effect of lots of <literal>#ifdef</literal>s (hunks of source "
242.15535 +"code that are only used conditionally) in your code, don't introduce version-"
242.15536 +"dependent <literal>#ifdef</literal>s into the patches.  Instead, write "
242.15537 +"several patches, each of which makes unconditional changes, and control their "
242.15538 +"application using guards."
242.15539 +msgstr ""
242.15540 +
242.15541 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.15542 +#: ../en/ch12-mq-collab.xml:402
242.15543 +msgid ""
242.15544 +"There are two reasons to divide backport patches into a distinct group, away "
242.15545 +"from the <quote>regular</quote> patches whose effects they modify. The first "
242.15546 +"is that intermingling the two makes it more difficult to use a tool like the "
242.15547 +"<literal role=\"hg-ext\">patchbomb</literal> extension to automate the "
242.15548 +"process of submitting the patches to an upstream maintainer.  The second is "
242.15549 +"that a backport patch could perturb the context in which a subsequent regular "
242.15550 +"patch is applied, making it impossible to apply the regular patch cleanly "
242.15551 +"<emphasis>without</emphasis> the earlier backport patch already being applied."
242.15552 +msgstr ""
242.15553 +
242.15554 +#. type: Content of: <book><chapter><sect1><title>
242.15555 +#: ../en/ch12-mq-collab.xml:417
242.15556 +msgid "Useful tips for developing with MQ"
242.15557 +msgstr "使用 MQ 开发的技巧"
242.15558 +
242.15559 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.15560 +#: ../en/ch12-mq-collab.xml:420
242.15561 +msgid "Organising patches in directories"
242.15562 +msgstr "将补丁放到几个目录中"
242.15563 +
242.15564 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.15565 +#: ../en/ch12-mq-collab.xml:422
242.15566 +msgid ""
242.15567 +"If you're working on a substantial project with MQ, it's not difficult to "
242.15568 +"accumulate a large number of patches.  For example, I have one patch "
242.15569 +"repository that contains over 250 patches."
242.15570 +msgstr ""
242.15571 +
242.15572 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.15573 +#: ../en/ch12-mq-collab.xml:427
242.15574 +msgid ""
242.15575 +"If you can group these patches into separate logical categories, you can if "
242.15576 +"you like store them in different directories; MQ has no problems with patch "
242.15577 +"names that contain path separators."
242.15578 +msgstr ""
242.15579 +
242.15580 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.15581 +#: ../en/ch12-mq-collab.xml:434
242.15582 +msgid "Viewing the history of a patch"
242.15583 +msgstr "察看补丁的历史"
242.15584 +
242.15585 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.15586 +#: ../en/ch12-mq-collab.xml:436
242.15587 +msgid ""
242.15588 +"If you're developing a set of patches over a long time, it's a good idea to "
242.15589 +"maintain them in a repository, as discussed in <xref linkend=\"sec:mq:repo\"/"
242.15590 +">.  If you do so, you'll quickly discover that using the <command role=\"hg-"
242.15591 +"cmd\">hg diff</command> command to look at the history of changes to a patch "
242.15592 +"is unworkable.  This is in part because you're looking at the second "
242.15593 +"derivative of the real code (a diff of a diff), but also because MQ adds "
242.15594 +"noise to the process by modifying time stamps and directory names when it "
242.15595 +"updates a patch."
242.15596 +msgstr ""
242.15597 +
242.15598 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.15599 +#: ../en/ch12-mq-collab.xml:448
242.15600 +msgid ""
242.15601 +"However, you can use the <literal role=\"hg-ext\">extdiff</literal> "
242.15602 +"extension, which is bundled with Mercurial, to turn a diff of two versions of "
242.15603 +"a patch into something readable.  To do this, you will need a third-party "
242.15604 +"package called <literal role=\"package\">patchutils</literal> <citation>web:"
242.15605 +"patchutils</citation>.  This provides a command named <command>interdiff</"
242.15606 +"command>, which shows the differences between two diffs as a diff.  Used on "
242.15607 +"two versions of the same diff, it generates a diff that represents the diff "
242.15608 +"from the first to the second version."
242.15609 +msgstr ""
242.15610 +
242.15611 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.15612 +#: ../en/ch12-mq-collab.xml:459
242.15613 +msgid ""
242.15614 +"You can enable the <literal role=\"hg-ext\">extdiff</literal> extension in "
242.15615 +"the usual way, by adding a line to the <literal role=\"rc-extensions"
242.15616 +"\">extensions</literal> section of your <filename role=\"special\">~/.hgrc</"
242.15617 +"filename>."
242.15618 +msgstr ""
242.15619 +
242.15620 +#
242.15621 +#. 	&example.hg-interdiff;
242.15622 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.15623 +#: ../en/ch12-mq-collab.xml:466
242.15624 +msgid ""
242.15625 +"The <command>interdiff</command> command expects to be passed the names of "
242.15626 +"two files, but the <literal role=\"hg-ext\">extdiff</literal> extension "
242.15627 +"passes the program it runs a pair of directories, each of which can contain "
242.15628 +"an arbitrary number of files.  We thus need a small program that will run "
242.15629 +"<command>interdiff</command> on each pair of files in these two directories.  "
242.15630 +"This program is available as <filename role=\"special\">hg-interdiff</"
242.15631 +"filename> in the <filename class=\"directory\">examples</filename> directory "
242.15632 +"of the source code repository that accompanies this book."
242.15633 +msgstr ""
242.15634 +
242.15635 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.15636 +#: ../en/ch12-mq-collab.xml:478
242.15637 +msgid ""
242.15638 +"With the <filename role=\"special\">hg-interdiff</filename> program in your "
242.15639 +"shell's search path, you can run it as follows, from inside an MQ patch "
242.15640 +"directory:"
242.15641 +msgstr ""
242.15642 +
242.15643 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.15644 +#: ../en/ch12-mq-collab.xml:482
242.15645 +msgid ""
242.15646 +"Since you'll probably want to use this long-winded command a lot, you can get "
242.15647 +"<literal role=\"hg-ext\">hgext</literal> to make it available as a normal "
242.15648 +"Mercurial command, again by editing your <filename role=\"special\">~/.hgrc</"
242.15649 +"filename>."
242.15650 +msgstr ""
242.15651 +
242.15652 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.15653 +#: ../en/ch12-mq-collab.xml:489
242.15654 +msgid ""
242.15655 +"This directs <literal role=\"hg-ext\">hgext</literal> to make an "
242.15656 +"<literal>interdiff</literal> command available, so you can now shorten the "
242.15657 +"previous invocation of <command role=\"hg-ext-extdiff\">extdiff</command> to "
242.15658 +"something a little more wieldy."
242.15659 +msgstr ""
242.15660 +
242.15661 +#. type: Content of: <book><chapter><sect1><sect2><note><para>
242.15662 +#: ../en/ch12-mq-collab.xml:497
242.15663 +msgid ""
242.15664 +"The <command>interdiff</command> command works well only if the underlying "
242.15665 +"files against which versions of a patch are generated remain the same.  If "
242.15666 +"you create a patch, modify the underlying files, and then regenerate the "
242.15667 +"patch, <command>interdiff</command> may not produce useful output."
242.15668 +msgstr ""
242.15669 +
242.15670 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.15671 +#: ../en/ch12-mq-collab.xml:505
242.15672 +msgid ""
242.15673 +"The <literal role=\"hg-ext\">extdiff</literal> extension is useful for more "
242.15674 +"than merely improving the presentation of MQ patches.  To read more about it, "
242.15675 +"go to <xref linkend=\"sec:hgext:extdiff\"/>."
242.15676 +msgstr ""
242.15677 +
242.15678 +#. type: Content of: <book><chapter><title>
242.15679 +#: ../en/ch13-hgext.xml:5
242.15680 +msgid "Adding functionality with extensions"
242.15681 +msgstr "使用扩展增加功能"
242.15682 +
242.15683 +#. type: Content of: <book><chapter><para>
242.15684 +#: ../en/ch13-hgext.xml:7
242.15685 +msgid ""
242.15686 +"While the core of Mercurial is quite complete from a functionality "
242.15687 +"standpoint, it's deliberately shorn of fancy features.  This approach of "
242.15688 +"preserving simplicity keeps the software easy to deal with for both "
242.15689 +"maintainers and users."
242.15690 +msgstr ""
242.15691 +
242.15692 +#. type: Content of: <book><chapter><para>
242.15693 +#: ../en/ch13-hgext.xml:12
242.15694 +msgid ""
242.15695 +"However, Mercurial doesn't box you in with an inflexible command set: you can "
242.15696 +"add features to it as <emphasis>extensions</emphasis> (sometimes known as "
242.15697 +"<emphasis>plugins</emphasis>).  We've already discussed a few of these "
242.15698 +"extensions in earlier chapters."
242.15699 +msgstr ""
242.15700 +
242.15701 +#. type: Content of: <book><chapter><itemizedlist><listitem><para>
242.15702 +#: ../en/ch13-hgext.xml:18
242.15703 +msgid ""
242.15704 +"<xref linkend=\"sec:tour-merge:fetch\"/> covers the <literal role=\"hg-ext"
242.15705 +"\">fetch</literal> extension; this combines pulling new changes and merging "
242.15706 +"them with local changes into a single command, <command role=\"hg-ext-fetch"
242.15707 +"\">fetch</command>."
242.15708 +msgstr ""
242.15709 +
242.15710 +#. type: Content of: <book><chapter><itemizedlist><listitem><para>
242.15711 +#: ../en/ch13-hgext.xml:24
242.15712 +msgid ""
242.15713 +"In <xref linkend=\"chap:hook\"/>, we covered several extensions that are "
242.15714 +"useful for hook-related functionality: <literal role=\"hg-ext\">acl</literal> "
242.15715 +"adds access control lists; <literal role=\"hg-ext\">bugzilla</literal> adds "
242.15716 +"integration with the Bugzilla bug tracking system; and <literal role=\"hg-ext"
242.15717 +"\">notify</literal> sends notification emails on new changes."
242.15718 +msgstr ""
242.15719 +
242.15720 +#. type: Content of: <book><chapter><itemizedlist><listitem><para>
242.15721 +#: ../en/ch13-hgext.xml:33
242.15722 +msgid ""
242.15723 +"The Mercurial Queues patch management extension is so invaluable that it "
242.15724 +"merits two chapters and an appendix all to itself. <xref linkend=\"chap:mq\"/"
242.15725 +"> covers the basics; <xref linkend=\"chap:mq-collab\"/> discusses advanced "
242.15726 +"topics; and <xref linkend=\"chap:mqref\"/> goes into detail on each command."
242.15727 +msgstr ""
242.15728 +
242.15729 +#. type: Content of: <book><chapter><para>
242.15730 +#: ../en/ch13-hgext.xml:43
242.15731 +msgid ""
242.15732 +"In this chapter, we'll cover some of the other extensions that are available "
242.15733 +"for Mercurial, and briefly touch on some of the machinery you'll need to know "
242.15734 +"about if you want to write an extension of your own."
242.15735 +msgstr ""
242.15736 +
242.15737 +#. type: Content of: <book><chapter><itemizedlist><listitem><para>
242.15738 +#: ../en/ch13-hgext.xml:48
242.15739 +msgid ""
242.15740 +"In <xref linkend=\"sec:hgext:inotify\"/>, we'll discuss the possibility of "
242.15741 +"<emphasis>huge</emphasis> performance improvements using the <literal role="
242.15742 +"\"hg-ext\">inotify</literal> extension."
242.15743 +msgstr ""
242.15744 +
242.15745 +#. type: Content of: <book><chapter><sect1><title>
242.15746 +#: ../en/ch13-hgext.xml:55
242.15747 +msgid ""
242.15748 +"Improve performance with the <literal role=\"hg-ext\">inotify</literal> "
242.15749 +"extension"
242.15750 +msgstr "使用扩展 <literal role=\"hg-ext\">inotify</literal> 以提高性能"
242.15751 +
242.15752 +#. type: Content of: <book><chapter><sect1><para>
242.15753 +#: ../en/ch13-hgext.xml:58
242.15754 +msgid ""
242.15755 +"Are you interested in having some of the most common Mercurial operations run "
242.15756 +"as much as a hundred times faster? Read on!"
242.15757 +msgstr ""
242.15758 +
242.15759 +#. type: Content of: <book><chapter><sect1><para>
242.15760 +#: ../en/ch13-hgext.xml:62
242.15761 +msgid ""
242.15762 +"Mercurial has great performance under normal circumstances.  For example, "
242.15763 +"when you run the <command role=\"hg-cmd\">hg status</command> command, "
242.15764 +"Mercurial has to scan almost every directory and file in your repository so "
242.15765 +"that it can display file status.  Many other Mercurial commands need to do "
242.15766 +"the same work behind the scenes; for example, the <command role=\"hg-cmd\">hg "
242.15767 +"diff</command> command uses the status machinery to avoid doing an expensive "
242.15768 +"comparison operation on files that obviously haven't changed."
242.15769 +msgstr ""
242.15770 +
242.15771 +#. type: Content of: <book><chapter><sect1><para>
242.15772 +#: ../en/ch13-hgext.xml:72
242.15773 +msgid ""
242.15774 +"Because obtaining file status is crucial to good performance, the authors of "
242.15775 +"Mercurial have optimised this code to within an inch of its life.  However, "
242.15776 +"there's no avoiding the fact that when you run <command role=\"hg-cmd\">hg "
242.15777 +"status</command>, Mercurial is going to have to perform at least one "
242.15778 +"expensive system call for each managed file to determine whether it's changed "
242.15779 +"since the last time Mercurial checked.  For a sufficiently large repository, "
242.15780 +"this can take a long time."
242.15781 +msgstr ""
242.15782 +
242.15783 +#. type: Content of: <book><chapter><sect1><para>
242.15784 +#: ../en/ch13-hgext.xml:82
242.15785 +msgid ""
242.15786 +"To put a number on the magnitude of this effect, I created a repository "
242.15787 +"containing 150,000 managed files.  I timed <command role=\"hg-cmd\">hg "
242.15788 +"status</command> as taking ten seconds to run, even when <emphasis>none</"
242.15789 +"emphasis> of those files had been modified."
242.15790 +msgstr ""
242.15791 +
242.15792 +#. type: Content of: <book><chapter><sect1><para>
242.15793 +#: ../en/ch13-hgext.xml:88
242.15794 +msgid ""
242.15795 +"Many modern operating systems contain a file notification facility. If a "
242.15796 +"program signs up to an appropriate service, the operating system will notify "
242.15797 +"it every time a file of interest is created, modified, or deleted.  On Linux "
242.15798 +"systems, the kernel component that does this is called <literal>inotify</"
242.15799 +"literal>."
242.15800 +msgstr ""
242.15801 +
242.15802 +#. type: Content of: <book><chapter><sect1><para>
242.15803 +#: ../en/ch13-hgext.xml:95
242.15804 +msgid ""
242.15805 +"Mercurial's <literal role=\"hg-ext\">inotify</literal> extension talks to the "
242.15806 +"kernel's <literal>inotify</literal> component to optimise <command role=\"hg-"
242.15807 +"cmd\">hg status</command> commands.  The extension has two components.  A "
242.15808 +"daemon sits in the background and receives notifications from the "
242.15809 +"<literal>inotify</literal> subsystem.  It also listens for connections from a "
242.15810 +"regular Mercurial command.  The extension modifies Mercurial's behaviour so "
242.15811 +"that instead of scanning the filesystem, it queries the daemon.  Since the "
242.15812 +"daemon has perfect information about the state of the repository, it can "
242.15813 +"respond with a result instantaneously, avoiding the need to scan every "
242.15814 +"directory and file in the repository."
242.15815 +msgstr ""
242.15816 +
242.15817 +#. type: Content of: <book><chapter><sect1><para>
242.15818 +#: ../en/ch13-hgext.xml:108
242.15819 +msgid ""
242.15820 +"Recall the ten seconds that I measured plain Mercurial as taking to run "
242.15821 +"<command role=\"hg-cmd\">hg status</command> on a 150,000 file repository.  "
242.15822 +"With the <literal role=\"hg-ext\">inotify</literal> extension enabled, the "
242.15823 +"time dropped to 0.1 seconds, a factor of <emphasis>one hundred</emphasis> "
242.15824 +"faster."
242.15825 +msgstr ""
242.15826 +
242.15827 +#. type: Content of: <book><chapter><sect1><para>
242.15828 +#: ../en/ch13-hgext.xml:115
242.15829 +msgid "Before we continue, please pay attention to some caveats."
242.15830 +msgstr ""
242.15831 +
242.15832 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.15833 +#: ../en/ch13-hgext.xml:118
242.15834 +msgid ""
242.15835 +"The <literal role=\"hg-ext\">inotify</literal> extension is Linux-specific.  "
242.15836 +"Because it interfaces directly to the Linux kernel's <literal>inotify</"
242.15837 +"literal> subsystem, it does not work on other operating systems."
242.15838 +msgstr ""
242.15839 +
242.15840 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.15841 +#: ../en/ch13-hgext.xml:123
242.15842 +msgid ""
242.15843 +"It should work on any Linux distribution that was released after early 2005.  "
242.15844 +"Older distributions are likely to have a kernel that lacks <literal>inotify</"
242.15845 +"literal>, or a version of <literal>glibc</literal> that does not have the "
242.15846 +"necessary interfacing support."
242.15847 +msgstr ""
242.15848 +
242.15849 +#. type: Content of: <book><chapter><sect1><itemizedlist><listitem><para>
242.15850 +#: ../en/ch13-hgext.xml:130
242.15851 +msgid ""
242.15852 +"Not all filesystems are suitable for use with the <literal role=\"hg-ext"
242.15853 +"\">inotify</literal> extension.  Network filesystems such as NFS are a non-"
242.15854 +"starter, for example, particularly if you're running Mercurial on several "
242.15855 +"systems, all mounting the same network filesystem.  The kernel's "
242.15856 +"<literal>inotify</literal> system has no way of knowing about changes made on "
242.15857 +"another system.  Most local filesystems (e.g. ext3, XFS, ReiserFS) should "
242.15858 +"work fine."
242.15859 +msgstr ""
242.15860 +
242.15861 +#. type: Content of: <book><chapter><sect1><para>
242.15862 +#: ../en/ch13-hgext.xml:141
242.15863 +msgid ""
242.15864 +"The <literal role=\"hg-ext\">inotify</literal> extension is not yet shipped "
242.15865 +"with Mercurial as of May 2007, so it's a little more involved to set up than "
242.15866 +"other extensions.  But the performance improvement is worth it!"
242.15867 +msgstr ""
242.15868 +
242.15869 +#. type: Content of: <book><chapter><sect1><para>
242.15870 +#: ../en/ch13-hgext.xml:146
242.15871 +msgid ""
242.15872 +"The extension currently comes in two parts: a set of patches to the Mercurial "
242.15873 +"source code, and a library of Python bindings to the <literal>inotify</"
242.15874 +"literal> subsystem."
242.15875 +msgstr ""
242.15876 +
242.15877 +#. type: Content of: <book><chapter><sect1><note><para>
242.15878 +#: ../en/ch13-hgext.xml:150
242.15879 +msgid ""
242.15880 +"There are <emphasis>two</emphasis> Python <literal>inotify</literal> binding "
242.15881 +"libraries.  One of them is called <literal>pyinotify</literal>, and is "
242.15882 +"packaged by some Linux distributions as <literal>python-inotify</literal>.  "
242.15883 +"This is <emphasis>not</emphasis> the one you'll need, as it is too buggy and "
242.15884 +"inefficient to be practical."
242.15885 +msgstr ""
242.15886 +
242.15887 +#. type: Content of: <book><chapter><sect1><para>
242.15888 +#: ../en/ch13-hgext.xml:157
242.15889 +msgid ""
242.15890 +"To get going, it's best to already have a functioning copy of Mercurial "
242.15891 +"installed."
242.15892 +msgstr ""
242.15893 +
242.15894 +#. type: Content of: <book><chapter><sect1><note><para>
242.15895 +#: ../en/ch13-hgext.xml:160
242.15896 +msgid ""
242.15897 +"If you follow the instructions below, you'll be <emphasis>replacing</"
242.15898 +"emphasis> and overwriting any existing installation of Mercurial that you "
242.15899 +"might already have, using the latest <quote>bleeding edge</quote> Mercurial "
242.15900 +"code. Don't say you weren't warned!"
242.15901 +msgstr ""
242.15902 +
242.15903 +#. type: Content of: <book><chapter><sect1><orderedlist><listitem><para>
242.15904 +#: ../en/ch13-hgext.xml:167
242.15905 +msgid ""
242.15906 +"Clone the Python <literal>inotify</literal> binding repository.  Build and "
242.15907 +"install it."
242.15908 +msgstr ""
242.15909 +
242.15910 +#. type: Content of: <book><chapter><sect1><orderedlist><listitem><para>
242.15911 +#: ../en/ch13-hgext.xml:174
242.15912 +msgid ""
242.15913 +"Clone the <filename class=\"directory\">crew</filename> Mercurial "
242.15914 +"repository.  Clone the <literal role=\"hg-ext\">inotify</literal> patch "
242.15915 +"repository so that Mercurial Queues will be able to apply patches to your "
242.15916 +"cope of the <filename class=\"directory\">crew</filename> repository."
242.15917 +msgstr ""
242.15918 +
242.15919 +#. type: Content of: <book><chapter><sect1><orderedlist><listitem><para>
242.15920 +#: ../en/ch13-hgext.xml:184
242.15921 +msgid ""
242.15922 +"Make sure that you have the Mercurial Queues extension, <literal role=\"hg-ext"
242.15923 +"\">mq</literal>, enabled.  If you've never used MQ, read <xref linkend=\"sec:"
242.15924 +"mq:start\"/> to get started quickly."
242.15925 +msgstr ""
242.15926 +
242.15927 +#. type: Content of: <book><chapter><sect1><orderedlist><listitem><para>
242.15928 +#: ../en/ch13-hgext.xml:190
242.15929 +msgid ""
242.15930 +"Go into the <filename class=\"directory\">inotify</filename> repo, and apply "
242.15931 +"all of the <literal role=\"hg-ext\">inotify</literal> patches using the "
242.15932 +"<option role=\"hg-ext-mq-cmd-qpush-opt\">hg -a</option> option to the "
242.15933 +"<command role=\"hg-ext-mq\">qpush</command> command."
242.15934 +msgstr ""
242.15935 +
242.15936 +#. type: Content of: <book><chapter><sect1><orderedlist><listitem><para>
242.15937 +#: ../en/ch13-hgext.xml:199
242.15938 +msgid ""
242.15939 +"If you get an error message from <command role=\"hg-ext-mq\">qpush</command>, "
242.15940 +"you should not continue.  Instead, ask for help."
242.15941 +msgstr ""
242.15942 +
242.15943 +#. type: Content of: <book><chapter><sect1><orderedlist><listitem><para>
242.15944 +#: ../en/ch13-hgext.xml:203
242.15945 +msgid "Build and install the patched version of Mercurial."
242.15946 +msgstr ""
242.15947 +
242.15948 +#. type: Content of: <book><chapter><sect1><para>
242.15949 +#: ../en/ch13-hgext.xml:209
242.15950 +msgid ""
242.15951 +"Once you've build a suitably patched version of Mercurial, all you need to do "
242.15952 +"to enable the <literal role=\"hg-ext\">inotify</literal> extension is add an "
242.15953 +"entry to your <filename role=\"special\">~/.hgrc</filename>."
242.15954 +msgstr ""
242.15955 +
242.15956 +#. type: Content of: <book><chapter><sect1><para>
242.15957 +#: ../en/ch13-hgext.xml:214
242.15958 +msgid ""
242.15959 +"When the <literal role=\"hg-ext\">inotify</literal> extension is enabled, "
242.15960 +"Mercurial will automatically and transparently start the status daemon the "
242.15961 +"first time you run a command that needs status in a repository.  It runs one "
242.15962 +"status daemon per repository."
242.15963 +msgstr ""
242.15964 +
242.15965 +#. type: Content of: <book><chapter><sect1><para>
242.15966 +#: ../en/ch13-hgext.xml:220
242.15967 +msgid ""
242.15968 +"The status daemon is started silently, and runs in the background.  If you "
242.15969 +"look at a list of running processes after you've enabled the <literal role="
242.15970 +"\"hg-ext\">inotify</literal> extension and run a few commands in different "
242.15971 +"repositories, you'll thus see a few <literal>hg</literal> processes sitting "
242.15972 +"around, waiting for updates from the kernel and queries from Mercurial."
242.15973 +msgstr ""
242.15974 +
242.15975 +#. type: Content of: <book><chapter><sect1><para>
242.15976 +#: ../en/ch13-hgext.xml:228
242.15977 +msgid ""
242.15978 +"The first time you run a Mercurial command in a repository when you have the "
242.15979 +"<literal role=\"hg-ext\">inotify</literal> extension enabled, it will run "
242.15980 +"with about the same performance as a normal Mercurial command.  This is "
242.15981 +"because the status daemon needs to perform a normal status scan so that it "
242.15982 +"has a baseline against which to apply later updates from the kernel.  "
242.15983 +"However, <emphasis>every</emphasis> subsequent command that does any kind of "
242.15984 +"status check should be noticeably faster on repositories of even fairly "
242.15985 +"modest size.  Better yet, the bigger your repository is, the greater a "
242.15986 +"performance advantage you'll see.  The <literal role=\"hg-ext\">inotify</"
242.15987 +"literal> daemon makes status operations almost instantaneous on repositories "
242.15988 +"of all sizes!"
242.15989 +msgstr ""
242.15990 +
242.15991 +#. type: Content of: <book><chapter><sect1><para>
242.15992 +#: ../en/ch13-hgext.xml:242
242.15993 +msgid ""
242.15994 +"If you like, you can manually start a status daemon using the <command role="
242.15995 +"\"hg-ext-inotify\">inserve</command> command.  This gives you slightly finer "
242.15996 +"control over how the daemon ought to run.  This command will of course only "
242.15997 +"be available when the <literal role=\"hg-ext\">inotify</literal> extension is "
242.15998 +"enabled."
242.15999 +msgstr ""
242.16000 +
242.16001 +#. type: Content of: <book><chapter><sect1><para>
242.16002 +#: ../en/ch13-hgext.xml:249
242.16003 +msgid ""
242.16004 +"When you're using the <literal role=\"hg-ext\">inotify</literal> extension, "
242.16005 +"you should notice <emphasis>no difference at all</emphasis> in Mercurial's "
242.16006 +"behaviour, with the sole exception of status-related commands running a whole "
242.16007 +"lot faster than they used to.  You should specifically expect that commands "
242.16008 +"will not print different output; neither should they give different results. "
242.16009 +"If either of these situations occurs, please report a bug."
242.16010 +msgstr ""
242.16011 +
242.16012 +#. type: Content of: <book><chapter><sect1><title>
242.16013 +#: ../en/ch13-hgext.xml:260
242.16014 +msgid ""
242.16015 +"Flexible diff support with the <literal role=\"hg-ext\">extdiff</literal> "
242.16016 +"extension"
242.16017 +msgstr "使用扩展 <literal role=\"hg-ext\">extdiff</literal> 以扩展差异支持"
242.16018 +
242.16019 +#. type: Content of: <book><chapter><sect1><para>
242.16020 +#: ../en/ch13-hgext.xml:263
242.16021 +msgid ""
242.16022 +"Mercurial's built-in <command role=\"hg-cmd\">hg diff</command> command "
242.16023 +"outputs plaintext unified diffs."
242.16024 +msgstr ""
242.16025 +"Mercurial 内置命令 <command role=\"hg-cmd\">hg diff</command> 的输出与统一差异"
242.16026 +"不同。"
242.16027 +
242.16028 +#. type: Content of: <book><chapter><sect1><para>
242.16029 +#: ../en/ch13-hgext.xml:268
242.16030 +msgid ""
242.16031 +"If you would like to use an external tool to display modifications, you'll "
242.16032 +"want to use the <literal role=\"hg-ext\">extdiff</literal> extension.  This "
242.16033 +"will let you use, for example, a graphical diff tool."
242.16034 +msgstr ""
242.16035 +
242.16036 +#. type: Content of: <book><chapter><sect1><para>
242.16037 +#: ../en/ch13-hgext.xml:273
242.16038 +msgid ""
242.16039 +"The <literal role=\"hg-ext\">extdiff</literal> extension is bundled with "
242.16040 +"Mercurial, so it's easy to set up.  In the <literal role=\"rc-extensions"
242.16041 +"\">extensions</literal> section of your <filename role=\"special\">~/.hgrc</"
242.16042 +"filename>, simply add a one-line entry to enable the extension."
242.16043 +msgstr ""
242.16044 +
242.16045 +#. type: Content of: <book><chapter><sect1><para>
242.16046 +#: ../en/ch13-hgext.xml:280
242.16047 +msgid ""
242.16048 +"This introduces a command named <command role=\"hg-ext-extdiff\">extdiff</"
242.16049 +"command>, which by default uses your system's <command>diff</command> command "
242.16050 +"to generate a unified diff in the same form as the built-in <command role="
242.16051 +"\"hg-cmd\">hg diff</command> command."
242.16052 +msgstr ""
242.16053 +
242.16054 +#. type: Content of: <book><chapter><sect1><para>
242.16055 +#: ../en/ch13-hgext.xml:288
242.16056 +msgid ""
242.16057 +"The result won't be exactly the same as with the built-in <command role=\"hg-"
242.16058 +"cmd\">hg diff</command> variations, because the output of <command>diff</"
242.16059 +"command> varies from one system to another, even when passed the same options."
242.16060 +msgstr ""
242.16061 +
242.16062 +#. type: Content of: <book><chapter><sect1><para>
242.16063 +#: ../en/ch13-hgext.xml:293
242.16064 +msgid ""
242.16065 +"As the <quote><literal>making snapshot</literal></quote> lines of output "
242.16066 +"above imply, the <command role=\"hg-ext-extdiff\">extdiff</command> command "
242.16067 +"works by creating two snapshots of your source tree.  The first snapshot is "
242.16068 +"of the source revision; the second, of the target revision or working "
242.16069 +"directory.  The <command role=\"hg-ext-extdiff\">extdiff</command> command "
242.16070 +"generates these snapshots in a temporary directory, passes the name of each "
242.16071 +"directory to an external diff viewer, then deletes the temporary directory.  "
242.16072 +"For efficiency, it only snapshots the directories and files that have changed "
242.16073 +"between the two revisions."
242.16074 +msgstr ""
242.16075 +
242.16076 +#. type: Content of: <book><chapter><sect1><para>
242.16077 +#: ../en/ch13-hgext.xml:306
242.16078 +msgid ""
242.16079 +"Snapshot directory names have the same base name as your repository. If your "
242.16080 +"repository path is <filename class=\"directory\">/quux/bar/foo</filename>, "
242.16081 +"then <filename class=\"directory\">foo</filename> will be the name of each "
242.16082 +"snapshot directory.  Each snapshot directory name has its changeset ID "
242.16083 +"appended, if appropriate.  If a snapshot is of revision "
242.16084 +"<literal>a631aca1083f</literal>, the directory will be named <filename class="
242.16085 +"\"directory\">foo.a631aca1083f</filename>.  A snapshot of the working "
242.16086 +"directory won't have a changeset ID appended, so it would just be <filename "
242.16087 +"class=\"directory\">foo</filename> in this example.  To see what this looks "
242.16088 +"like in practice, look again at the <command role=\"hg-ext-extdiff\">extdiff</"
242.16089 +"command> example above.  Notice that the diff has the snapshot directory "
242.16090 +"names embedded in its header."
242.16091 +msgstr ""
242.16092 +
242.16093 +#. type: Content of: <book><chapter><sect1><para>
242.16094 +#: ../en/ch13-hgext.xml:322
242.16095 +msgid ""
242.16096 +"The <command role=\"hg-ext-extdiff\">extdiff</command> command accepts two "
242.16097 +"important options. The <option role=\"hg-ext-extdiff-cmd-extdiff-opt\">hg -p</"
242.16098 +"option> option lets you choose a program to view differences with, instead of "
242.16099 +"<command>diff</command>.  With the <option role=\"hg-ext-extdiff-cmd-extdiff-"
242.16100 +"opt\">hg -o</option> option, you can change the options that <command role="
242.16101 +"\"hg-ext-extdiff\">extdiff</command> passes to the program (by default, these "
242.16102 +"options are <quote><literal>-Npru</literal></quote>, which only make sense if "
242.16103 +"you're running <command>diff</command>).  In other respects, the <command "
242.16104 +"role=\"hg-ext-extdiff\">extdiff</command> command acts similarly to the built-"
242.16105 +"in <command role=\"hg-cmd\">hg diff</command> command: you use the same "
242.16106 +"option names, syntax, and arguments to specify the revisions you want, the "
242.16107 +"files you want, and so on."
242.16108 +msgstr ""
242.16109 +
242.16110 +#
242.16111 +#. type: Content of: <book><chapter><sect1><para>
242.16112 +#: ../en/ch13-hgext.xml:339
242.16113 +msgid ""
242.16114 +"As an example, here's how to run the normal system <command>diff</command> "
242.16115 +"command, getting it to generate context diffs (using the <option role=\"cmd-"
242.16116 +"opt-diff\">-c</option> option)  instead of unified diffs, and five lines of "
242.16117 +"context instead of the default three (passing <literal>5</literal> as the "
242.16118 +"argument to the <option role=\"cmd-opt-diff\">-C</option> option)."
242.16119 +msgstr ""
242.16120 +
242.16121 +#. type: Content of: <book><chapter><sect1><para>
242.16122 +#: ../en/ch13-hgext.xml:348
242.16123 +msgid ""
242.16124 +"Launching a visual diff tool is just as easy.  Here's how to launch the "
242.16125 +"<command>kdiff3</command> viewer."
242.16126 +msgstr ""
242.16127 +
242.16128 +#. type: Content of: <book><chapter><sect1><para>
242.16129 +#: ../en/ch13-hgext.xml:352
242.16130 +msgid ""
242.16131 +"If your diff viewing command can't deal with directories, you can easily work "
242.16132 +"around this with a little scripting.  For an example of such scripting in "
242.16133 +"action with the <literal role=\"hg-ext\">mq</literal> extension and the "
242.16134 +"<command>interdiff</command> command, see <xref linkend=\"mq-collab:tips:"
242.16135 +"interdiff\"/>."
242.16136 +msgstr ""
242.16137 +
242.16138 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.16139 +#: ../en/ch13-hgext.xml:360
242.16140 +msgid "Defining command aliases"
242.16141 +msgstr "定义命令的别名"
242.16142 +
242.16143 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.16144 +#: ../en/ch13-hgext.xml:362
242.16145 +msgid ""
242.16146 +"It can be cumbersome to remember the options to both the <command role=\"hg-"
242.16147 +"ext-extdiff\">extdiff</command> command and the diff viewer you want to use, "
242.16148 +"so the <literal role=\"hg-ext\">extdiff</literal> extension lets you define "
242.16149 +"<emphasis>new</emphasis> commands that will invoke your diff viewer with "
242.16150 +"exactly the right options."
242.16151 +msgstr ""
242.16152 +
242.16153 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.16154 +#: ../en/ch13-hgext.xml:369
242.16155 +msgid ""
242.16156 +"All you need to do is edit your <filename role=\"special\">~/.hgrc</"
242.16157 +"filename>, and add a section named <literal role=\"rc-extdiff\">extdiff</"
242.16158 +"literal>.  Inside this section, you can define multiple commands.  Here's how "
242.16159 +"to add a <literal>kdiff3</literal> command.  Once you've defined this, you "
242.16160 +"can type <quote><literal>hg kdiff3</literal></quote> and the <literal role="
242.16161 +"\"hg-ext\">extdiff</literal> extension will run <command>kdiff3</command> for "
242.16162 +"you."
242.16163 +msgstr ""
242.16164 +
242.16165 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.16166 +#: ../en/ch13-hgext.xml:379
242.16167 +msgid ""
242.16168 +"If you leave the right hand side of the definition empty, as above, the "
242.16169 +"<literal role=\"hg-ext\">extdiff</literal> extension uses the name of the "
242.16170 +"command you defined as the name of the external program to run.  But these "
242.16171 +"names don't have to be the same.  Here, we define a command named "
242.16172 +"<quote><literal>hg wibble</literal></quote>, which runs <command>kdiff3</"
242.16173 +"command>."
242.16174 +msgstr ""
242.16175 +
242.16176 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.16177 +#: ../en/ch13-hgext.xml:389
242.16178 +msgid ""
242.16179 +"You can also specify the default options that you want to invoke your diff "
242.16180 +"viewing program with.  The prefix to use is <quote><literal>opts.</literal></"
242.16181 +"quote>, followed by the name of the command to which the options apply.  This "
242.16182 +"example defines a <quote><literal>hg vimdiff</literal></quote> command that "
242.16183 +"runs the <command>vim</command> editor's <literal>DirDiff</literal> extension."
242.16184 +msgstr ""
242.16185 +
242.16186 +#. type: Content of: <book><chapter><sect1><title>
242.16187 +#: ../en/ch13-hgext.xml:403
242.16188 +msgid ""
242.16189 +"Cherrypicking changes with the <literal role=\"hg-ext\">transplant</literal> "
242.16190 +"extension"
242.16191 +msgstr "使用扩展 <literal role=\"hg-ext\">transplant</literal> 以挑选修改"
242.16192 +
242.16193 +#. type: Content of: <book><chapter><sect1><para>
242.16194 +#: ../en/ch13-hgext.xml:406
242.16195 +msgid "Need to have a long chat with Brendan about this."
242.16196 +msgstr ""
242.16197 +
242.16198 +#. type: Content of: <book><chapter><sect1><title>
242.16199 +#: ../en/ch13-hgext.xml:410
242.16200 +msgid ""
242.16201 +"Send changes via email with the <literal role=\"hg-ext\">patchbomb</literal> "
242.16202 +"extension"
242.16203 +msgstr ""
242.16204 +"使用扩展 <literal role=\"hg-ext\">patchbomb</literal> 通过 email 发送修改"
242.16205 +
242.16206 +#. type: Content of: <book><chapter><sect1><para>
242.16207 +#: ../en/ch13-hgext.xml:413
242.16208 +msgid ""
242.16209 +"Many projects have a culture of <quote>change review</quote>, in which people "
242.16210 +"send their modifications to a mailing list for others to read and comment on "
242.16211 +"before they commit the final version to a shared repository.  Some projects "
242.16212 +"have people who act as gatekeepers; they apply changes from other people to a "
242.16213 +"repository to which those others don't have access."
242.16214 +msgstr ""
242.16215 +
242.16216 +#. type: Content of: <book><chapter><sect1><para>
242.16217 +#: ../en/ch13-hgext.xml:421
242.16218 +msgid ""
242.16219 +"Mercurial makes it easy to send changes over email for review or application, "
242.16220 +"via its <literal role=\"hg-ext\">patchbomb</literal> extension.  The "
242.16221 +"extension is so named because changes are formatted as patches, and it's "
242.16222 +"usual to send one changeset per email message.  Sending a long series of "
242.16223 +"changes by email is thus much like <quote>bombing</quote> the recipient's "
242.16224 +"inbox, hence <quote>patchbomb</quote>."
242.16225 +msgstr ""
242.16226 +
242.16227 +#. type: Content of: <book><chapter><sect1><para>
242.16228 +#: ../en/ch13-hgext.xml:429
242.16229 +msgid ""
242.16230 +"As usual, the basic configuration of the <literal role=\"hg-ext\">patchbomb</"
242.16231 +"literal> extension takes just one or two lines in your <filename role="
242.16232 +"\"special\"> /.hgrc</filename>."
242.16233 +msgstr ""
242.16234 +
242.16235 +#. type: Content of: <book><chapter><sect1><para>
242.16236 +#: ../en/ch13-hgext.xml:435
242.16237 +msgid ""
242.16238 +"Once you've enabled the extension, you will have a new command available, "
242.16239 +"named <command role=\"hg-ext-patchbomb\">email</command>."
242.16240 +msgstr ""
242.16241 +
242.16242 +#. type: Content of: <book><chapter><sect1><para>
242.16243 +#: ../en/ch13-hgext.xml:439
242.16244 +msgid ""
242.16245 +"The safest and best way to invoke the <command role=\"hg-ext-patchbomb"
242.16246 +"\">email</command> command is to <emphasis>always</emphasis> run it first "
242.16247 +"with the <option role=\"hg-ext-patchbomb-cmd-email-opt\">hg -n</option> "
242.16248 +"option.  This will show you what the command <emphasis>would</emphasis> send, "
242.16249 +"without actually sending anything.  Once you've had a quick glance over the "
242.16250 +"changes and verified that you are sending the right ones, you can rerun the "
242.16251 +"same command, with the <option role=\"hg-ext-patchbomb-cmd-email-opt\">hg -n</"
242.16252 +"option> option removed."
242.16253 +msgstr ""
242.16254 +
242.16255 +#. type: Content of: <book><chapter><sect1><para>
242.16256 +#: ../en/ch13-hgext.xml:450
242.16257 +msgid ""
242.16258 +"The <command role=\"hg-ext-patchbomb\">email</command> command accepts the "
242.16259 +"same kind of revision syntax as every other Mercurial command.  For example, "
242.16260 +"this command will send every revision between 7 and <literal>tip</literal>, "
242.16261 +"inclusive."
242.16262 +msgstr ""
242.16263 +
242.16264 +#. type: Content of: <book><chapter><sect1><para>
242.16265 +#: ../en/ch13-hgext.xml:455
242.16266 +msgid ""
242.16267 +"You can also specify a <emphasis>repository</emphasis> to compare with.  If "
242.16268 +"you provide a repository but no revisions, the <command role=\"hg-ext-"
242.16269 +"patchbomb\">email</command> command will send all revisions in the local "
242.16270 +"repository that are not present in the remote repository.  If you "
242.16271 +"additionally specify revisions or a branch name (the latter using the <option "
242.16272 +"role=\"hg-ext-patchbomb-cmd-email-opt\">hg -b</option> option), this will "
242.16273 +"constrain the revisions sent."
242.16274 +msgstr ""
242.16275 +
242.16276 +#. type: Content of: <book><chapter><sect1><para>
242.16277 +#: ../en/ch13-hgext.xml:464
242.16278 +msgid ""
242.16279 +"It's perfectly safe to run the <command role=\"hg-ext-patchbomb\">email</"
242.16280 +"command> command without the names of the people you want to send to: if you "
242.16281 +"do this, it will just prompt you for those values interactively.  (If you're "
242.16282 +"using a Linux or Unix-like system, you should have enhanced "
242.16283 +"<literal>readline</literal>-style editing capabilities when entering those "
242.16284 +"headers, too, which is useful.)"
242.16285 +msgstr ""
242.16286 +
242.16287 +#. type: Content of: <book><chapter><sect1><para>
242.16288 +#: ../en/ch13-hgext.xml:472
242.16289 +msgid ""
242.16290 +"When you are sending just one revision, the <command role=\"hg-ext-patchbomb"
242.16291 +"\">email</command> command will by default use the first line of the "
242.16292 +"changeset description as the subject of the single email message it sends."
242.16293 +msgstr ""
242.16294 +
242.16295 +#. type: Content of: <book><chapter><sect1><para>
242.16296 +#: ../en/ch13-hgext.xml:477
242.16297 +msgid ""
242.16298 +"If you send multiple revisions, the <command role=\"hg-ext-patchbomb\">email</"
242.16299 +"command> command will usually send one message per changeset.  It will "
242.16300 +"preface the series with an introductory message, in which you should describe "
242.16301 +"the purpose of the series of changes you're sending."
242.16302 +msgstr ""
242.16303 +
242.16304 +#. type: Content of: <book><chapter><sect1><sect2><title>
242.16305 +#: ../en/ch13-hgext.xml:484
242.16306 +msgid "Changing the behaviour of patchbombs"
242.16307 +msgstr "修改 patchbomb 的行为"
242.16308 +
242.16309 +#. type: Content of: <book><chapter><sect1><sect2><para>
242.16310 +#: ../en/ch13-hgext.xml:486
242.16311 +msgid ""
242.16312 +"Not every project has exactly the same conventions for sending changes in "
242.16313 +"email; the <literal role=\"hg-ext\">patchbomb</literal> extension tries to "
242.16314 +"accommodate a number of variations through command line options."
242.16315 +msgstr ""
242.16316 +
242.16317 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.16318 +#: ../en/ch13-hgext.xml:492
242.16319 +msgid ""
242.16320 +"You can write a subject for the introductory message on the command line "
242.16321 +"using the <option role=\"hg-ext-patchbomb-cmd-email-opt\">hg -s</option> "
242.16322 +"option.  This takes one argument, the text of the subject to use."
242.16323 +msgstr ""
242.16324 +
242.16325 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.16326 +#: ../en/ch13-hgext.xml:498
242.16327 +msgid ""
242.16328 +"To change the email address from which the messages originate, use the "
242.16329 +"<option role=\"hg-ext-patchbomb-cmd-email-opt\">hg -f</option> option.  This "
242.16330 +"takes one argument, the email address to use."
242.16331 +msgstr ""
242.16332 +
242.16333 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.16334 +#: ../en/ch13-hgext.xml:504
242.16335 +msgid ""
242.16336 +"The default behaviour is to send unified diffs (see <xref linkend=\"sec:mq:"
242.16337 +"patch\"/> for a description of the format), one per message.  You can send a "
242.16338 +"binary bundle instead with the <option role=\"hg-ext-patchbomb-cmd-email-opt"
242.16339 +"\">hg -b</option> option."
242.16340 +msgstr ""
242.16341 +
242.16342 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.16343 +#: ../en/ch13-hgext.xml:512
242.16344 +msgid ""
242.16345 +"Unified diffs are normally prefaced with a metadata header.  You can omit "
242.16346 +"this, and send unadorned diffs, with the <option role=\"hg-ext-patchbomb-cmd-"
242.16347 +"email-opt\">hg --plain</option> option."
242.16348 +msgstr ""
242.16349 +
242.16350 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.16351 +#: ../en/ch13-hgext.xml:518
242.16352 +msgid ""
242.16353 +"Diffs are normally sent <quote>inline</quote>, in the same body part as the "
242.16354 +"description of a patch.  This makes it easiest for the largest number of "
242.16355 +"readers to quote and respond to parts of a diff, as some mail clients will "
242.16356 +"only quote the first MIME body part in a message. If you'd prefer to send the "
242.16357 +"description and the diff in separate body parts, use the <option role=\"hg-"
242.16358 +"ext-patchbomb-cmd-email-opt\">hg -a</option> option."
242.16359 +msgstr ""
242.16360 +
242.16361 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.16362 +#: ../en/ch13-hgext.xml:528
242.16363 +msgid ""
242.16364 +"Instead of sending mail messages, you can write them to an <literal>mbox</"
242.16365 +"literal>-format mail folder using the <option role=\"hg-ext-patchbomb-cmd-"
242.16366 +"email-opt\">hg -m</option> option.  That option takes one argument, the name "
242.16367 +"of the file to write to."
242.16368 +msgstr ""
242.16369 +
242.16370 +#. type: Content of: <book><chapter><sect1><sect2><itemizedlist><listitem><para>
242.16371 +#: ../en/ch13-hgext.xml:535
242.16372 +msgid ""
242.16373 +"If you would like to add a <command>diffstat</command>-format summary to each "
242.16374 +"patch, and one to the introductory message, use the <option role=\"hg-ext-"
242.16375 +"patchbomb-cmd-email-opt\">hg -d</option> option.  The <command>diffstat</"
242.16376 +"command> command displays a table containing the name of each file patched, "
242.16377 +"the number of lines affected, and a histogram showing how much each file is "
242.16378 +"modified.  This gives readers a qualitative glance at how complex a patch is."
242.16379 +msgstr ""
   243.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   243.2 +++ b/stylesheets/all-ids.xsl	Mon Apr 06 23:15:52 2009 -0700
   243.3 @@ -0,0 +1,40 @@
   243.4 +<?xml version="1.0" encoding="utf-8"?>
   243.5 +
   243.6 +<!-- Prepare an ASCII dump file of all IDs, and the pages in which
   243.7 +     they live, for loading into a database. Assumes one-level chunked
   243.8 +     HTML output, with each chunk containing either a chapter or
   243.9 +     sect1. -->
  243.10 +
  243.11 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  243.12 +                version="1.0">
  243.13 +
  243.14 +  <xsl:output method="text"/>
  243.15 +  <xsl:strip-space elements="title"/>
  243.16 +
  243.17 +  <xsl:template match="/">
  243.18 +    <xsl:for-each select="//preface|//chapter|//appendix|//bibliography|//sect1">
  243.19 +      <xsl:variable name="id">
  243.20 +        <xsl:choose>
  243.21 +          <xsl:when test="local-name(.)='sect1'">
  243.22 +            <xsl:value-of select="../@id"/>
  243.23 +          </xsl:when>
  243.24 +          <xsl:otherwise>
  243.25 +            <xsl:value-of select="@id"/>
  243.26 +          </xsl:otherwise>
  243.27 +        </xsl:choose>
  243.28 +      </xsl:variable>
  243.29 +      <xsl:variable name="sectitle">
  243.30 +        <xsl:value-of select="normalize-space(./title)"/>
  243.31 +      </xsl:variable>
  243.32 +      <xsl:for-each select=".//para[@id]|.//programlisting[@id]|.//screen[@id]">
  243.33 +        <xsl:value-of select="@id"/>
  243.34 +        <xsl:text>|</xsl:text>
  243.35 +        <xsl:copy-of select="$id"/>
  243.36 +        <xsl:text>|</xsl:text>
  243.37 +        <xsl:copy-of select="$sectitle"/>
  243.38 +        <xsl:text>&#x0a;</xsl:text>
  243.39 +      </xsl:for-each>
  243.40 +    </xsl:for-each>
  243.41 +  </xsl:template>
  243.42 +
  243.43 +</xsl:stylesheet>
   244.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   244.2 +++ b/stylesheets/base-html-stylesheet.xsl	Mon Apr 06 23:15:52 2009 -0700
   244.3 @@ -0,0 +1,127 @@
   244.4 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
   244.5 +
   244.6 +  <xsl:param name="html.stylesheet">/support/styles.css</xsl:param>
   244.7 +  <xsl:param name="toc.section.depth">3</xsl:param>
   244.8 +  <xsl:param name="annotate.toc">0</xsl:param>
   244.9 +
  244.10 +  <xsl:param name="generate.id.attributes" select="1"></xsl:param>
  244.11 +  <xsl:param name="header.rule" select="0"></xsl:param>
  244.12 +  <xsl:param name="footer.rule" select="0"></xsl:param>
  244.13 +  <xsl:param name="html.cleanup" select="1"></xsl:param>
  244.14 +  <xsl:param name="admon.style"><xsl:text></xsl:text></xsl:param>
  244.15 +  <xsl:param name="admon.graphics" select="1"></xsl:param>
  244.16 +  <xsl:param name="admon.graphics.path">/support/figs/</xsl:param>
  244.17 +
  244.18 +  <xsl:template match="sect1" mode="toc">
  244.19 +    <xsl:param name="toc-context" select="."/>
  244.20 +    <xsl:call-template name="subtoc">
  244.21 +      <xsl:with-param name="toc-context" select="$toc-context"/>
  244.22 +      <xsl:with-param name="nodes" 
  244.23 +        select="sect2|refentry|bridgehead[$bridgehead.in.toc != 0]"/>
  244.24 +    </xsl:call-template>
  244.25 +  </xsl:template>
  244.26 +
  244.27 +  <xsl:template match="sect2" mode="toc">
  244.28 +    <xsl:param name="toc-context" select="."/>
  244.29 +
  244.30 +    <xsl:call-template name="subtoc">
  244.31 +      <xsl:with-param name="toc-context" select="$toc-context"/>
  244.32 +      <xsl:with-param name="nodes" 
  244.33 +        select="sect3|refentry|bridgehead[$bridgehead.in.toc != 0]"/>
  244.34 +    </xsl:call-template>
  244.35 +  </xsl:template>
  244.36 +
  244.37 +  <!-- Add id attributes to <p> tags. This is mostly a copy of the
  244.38 +       base XSL. -->
  244.39 +  <xsl:template name="paragraph">
  244.40 +    <xsl:param name="class" select="''"/>
  244.41 +    <xsl:param name="content"/>
  244.42 +
  244.43 +    <xsl:variable name="p">
  244.44 +      <p>
  244.45 +        <xsl:call-template name="dir"/>
  244.46 +        <xsl:if test="$class != ''">
  244.47 +          <xsl:apply-templates select="." mode="class.attribute">
  244.48 +            <xsl:with-param name="class" select="$class"/>
  244.49 +          </xsl:apply-templates>
  244.50 +        </xsl:if>
  244.51 +        <!-- Here we go. -->
  244.52 +        <xsl:if test="$generate.id.attributes != 0">
  244.53 +          <xsl:attribute name="id">
  244.54 +            <xsl:call-template name="object.id"/>
  244.55 +          </xsl:attribute>
  244.56 +        </xsl:if>
  244.57 +        <xsl:copy-of select="$content"/>
  244.58 +      </p>
  244.59 +    </xsl:variable>
  244.60 +
  244.61 +    <xsl:choose>
  244.62 +      <xsl:when test="$html.cleanup != 0">
  244.63 +        <xsl:call-template name="unwrap.p">
  244.64 +          <xsl:with-param name="p" select="$p"/>
  244.65 +        </xsl:call-template>
  244.66 +      </xsl:when>
  244.67 +      <xsl:otherwise>
  244.68 +        <xsl:copy-of select="$p"/>
  244.69 +      </xsl:otherwise>
  244.70 +    </xsl:choose>
  244.71 +  </xsl:template>
  244.72 +
  244.73 +  <!-- Add id attributes to <programlisting> and <screen> tags. Once
  244.74 +       again, this is mostly a copy of the base XSL, although rather
  244.75 +       trimmed down. -->
  244.76 +  <xsl:template match="programlisting|screen">
  244.77 +    <xsl:param name="suppress-numbers" select="'0'"/>
  244.78 +
  244.79 +    <xsl:call-template name="anchor"/>
  244.80 +
  244.81 +    <pre>
  244.82 +      <!-- Here we go. -->
  244.83 +      <xsl:if test="$generate.id.attributes != 0">
  244.84 +        <xsl:attribute name="id">
  244.85 +          <xsl:call-template name="object.id"/>
  244.86 +        </xsl:attribute>
  244.87 +      </xsl:if>
  244.88 +
  244.89 +      <xsl:apply-templates select="." mode="class.attribute"/>
  244.90 +      <xsl:call-template name="apply-highlighting"/>
  244.91 +    </pre>
  244.92 +  </xsl:template>
  244.93 +
  244.94 +  <!-- The default stylesheet generates a little TOC at the beginning
  244.95 +       of each qandaset.  Uh, no thanks. -->
  244.96 +  <xsl:template name="process.qanda.toc"/>
  244.97 +
  244.98 +  <xsl:template name="user.header.navigation">
  244.99 +    <div class="navheader"><h2 class="booktitle"><a href="/">Mercurial: The Definitive Guide</a> <span class="authors">by Bryan O'Sullivan</span></h2></div>
 244.100 +  </xsl:template>
 244.101 +
 244.102 +  <xsl:template name="user.head.content">
 244.103 +    <link rel="alternate" type="application/atom+xml" title="Comments"
 244.104 +      href="/feeds/comments/"/>
 244.105 +    <link rel="shortcut icon" type="image/png" href="/support/figs/favicon.png"/>
 244.106 +    <script type="text/javascript" src="/support/jquery-min.js"></script>
 244.107 +    <script type="text/javascript" src="/support/form.js"></script>
 244.108 +    <script type="text/javascript" src="/support/hsbook.js"></script>
 244.109 +  </xsl:template>
 244.110 +
 244.111 +  <xsl:template name="user.footer.content">
 244.112 +    <div class="hgfooter">
 244.113 +      <p><img src="/support/figs/rss.png"/> Want to stay up to date? Subscribe to the comment feed for <a id="chapterfeed" class="feed" href="/feeds/comments/">this chapter</a>, or the <a class="feed" href="/feeds/comments/">entire book</a>.</p>
 244.114 +      <p>Copyright 2006, 2007, 2008, 2009 Bryan O'Sullivan.
 244.115 +      Icons by <a href="mailto:mattahan@gmail.com">Paul Davey</a> aka <a href="http://mattahan.deviantart.com/">Mattahan</a>.</p>
 244.116 +    </div>
 244.117 +  </xsl:template>
 244.118 +
 244.119 +  <xsl:template name="user.footer.navigation">
 244.120 +    <script type="text/javascript">
 244.121 +    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
 244.122 +    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
 244.123 +    </script>
 244.124 +    <script type="text/javascript">
 244.125 +    try {
 244.126 +    var pageTracker = _gat._getTracker("UA-1805907-5");
 244.127 +    pageTracker._trackPageview();
 244.128 +    } catch(err) {}</script>
 244.129 +  </xsl:template>
 244.130 +</xsl:stylesheet>
   245.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   245.2 +++ b/stylesheets/chunk-stylesheet.xsl	Mon Apr 06 23:15:52 2009 -0700
   245.3 @@ -0,0 +1,17 @@
   245.4 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
   245.5 +
   245.6 +  <xsl:import href="system-xsl/html/chunk.xsl"/>
   245.7 +  <xsl:include href="base-html-stylesheet.xsl"/>
   245.8 +
   245.9 +  <!-- PARAMETER REFERENCE:                                         -->
  245.10 +  <!-- http://docbook.sourceforge.net/release/xsl/current/doc/html/ -->
  245.11 +
  245.12 +  <!-- Uncomment this to enable auto-numbering of sections -->
  245.13 +  <!-- xsl:param name="section.autolabel" select="1" / -->
  245.14 +  <xsl:param name="chunker.output.encoding">UTF-8</xsl:param>
  245.15 +  <xsl:param name="use.id.as.filename" select="1"/>
  245.16 +  <xsl:param name="chunk.first.sections" select="0"/>
  245.17 +  <xsl:param name="chunk.section.depth" select="0"/>
  245.18 +  <xsl:param name="chunk.quietly" select="0"/>
  245.19 +
  245.20 +</xsl:stylesheet>
   246.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   246.2 +++ b/stylesheets/dtd-profile.xsl	Mon Apr 06 23:15:52 2009 -0700
   246.3 @@ -0,0 +1,15 @@
   246.4 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
   246.5 +  <xsl:import href="system-xsl/profiling/profile.xsl"></xsl:import>
   246.6 +
   246.7 +  <!-- For some reason, xsltproc omits the DTD from the file it
   246.8 +       outputs. Add a sensible one back in, because otherwise xmllint
   246.9 +       won't validate profiled documents. -->
  246.10 +
  246.11 +  <xsl:template match="/">
  246.12 +    <xsl:text disable-output-escaping="yes"><![CDATA[
  246.13 +<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
  246.14 + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
  246.15 +  ]]></xsl:text>
  246.16 +    <xsl:apply-templates select="." mode="profile"/>
  246.17 +  </xsl:template> 
  246.18 +</xsl:stylesheet>
   247.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   247.2 +++ b/stylesheets/en/fo.xsl	Mon Apr 06 23:15:52 2009 -0700
   247.3 @@ -0,0 +1,10 @@
   247.4 +<?xml version="1.0"?>
   247.5 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   247.6 +                xmlns:fo="http://www.w3.org/1999/XSL/Format"
   247.7 +                version='1.0'>
   247.8 +
   247.9 +  <xsl:import href="../fo.xsl"/>
  247.10 +
  247.11 +  <xsl:param name="l10n.gentext.language" select="'en'"/>
  247.12 +
  247.13 +</xsl:stylesheet>
   248.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   248.2 +++ b/stylesheets/en/html-single.xsl	Mon Apr 06 23:15:52 2009 -0700
   248.3 @@ -0,0 +1,8 @@
   248.4 +<?xml version="1.0"?>
   248.5 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
   248.6 +
   248.7 +  <xsl:import href="../html-single.xsl"/>
   248.8 +
   248.9 +  <xsl:param name="l10n.gentext.language" select="'en'"/>
  248.10 +
  248.11 +</xsl:stylesheet>
   249.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   249.2 +++ b/stylesheets/en/html.xsl	Mon Apr 06 23:15:52 2009 -0700
   249.3 @@ -0,0 +1,8 @@
   249.4 +<?xml version="1.0"?>
   249.5 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
   249.6 +
   249.7 +  <xsl:import href="../html.xsl"/>
   249.8 +
   249.9 +  <xsl:param name="l10n.gentext.language" select="'en'"/>
  249.10 +
  249.11 +</xsl:stylesheet>
   250.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   250.2 +++ b/stylesheets/fo.xsl	Mon Apr 06 23:15:52 2009 -0700
   250.3 @@ -0,0 +1,81 @@
   250.4 +<?xml version="1.0"?>
   250.5 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
   250.6 +
   250.7 +  <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
   250.8 +
   250.9 +  <xsl:param name="draft.mode" select="no"/>
  250.10 +
  250.11 +  <!-- These extensions are required for table printing and other stuff -->
  250.12 +  <xsl:param name="use.extensions">1</xsl:param>
  250.13 +  <xsl:param name="callouts.extension">1</xsl:param>
  250.14 +  <xsl:param name="linenumbering.extension">1</xsl:param>
  250.15 +  <xsl:param name="tablecolumns.extension">1</xsl:param>
  250.16 +  <xsl:param name="textinsert.extension">1</xsl:param>
  250.17 +
  250.18 +  <xsl:param name="admon.graphics" select="1" />
  250.19 +  <xsl:param name="admon.graphics.extension">.png</xsl:param>
  250.20 +  <xsl:param name="admon.graphics.path">figs/</xsl:param>
  250.21 +  <xsl:param name="callout.graphics" select="1" />
  250.22 +  <xsl:param name="callout.graphics.extension">.png</xsl:param>
  250.23 +  <xsl:param name="callout.graphics.path">images/callouts/</xsl:param>
  250.24 +
  250.25 +  <xsl:param name="section.autolabel" select="1" />
  250.26 +  <xsl:param name="section.label.includes.component.label">1</xsl:param>
  250.27 +
  250.28 +  <xsl:param name="variablelist.as.blocks" select="1" />        <!-- fo only -->
  250.29 +  <xsl:param name="hyphenate">false</xsl:param>                 <!-- fo only -->
  250.30 +  <xsl:param name="paper.type" select="'A4'"></xsl:param>       <!-- fo only -->
  250.31 +
  250.32 +  <!-- Default font settings -->
  250.33 +  <!--
  250.34 +  <xsl:param name="title.font.family">sans-serif</xsl:param>
  250.35 +  <xsl:param name="body.font.family">serif</xsl:param>
  250.36 +  <xsl:param name="sans.font.family">sans-serif</xsl:param>
  250.37 +  <xsl:param name="dingbat.font.family">serif</xsl:param>
  250.38 +  <xsl:param name="monospace.font.family">monospace</xsl:param>
  250.39 +  <xsl:param name="symbol.font.family">Symbol,ZapfDingbats</xsl:param>
  250.40 +  -->
  250.41 +
  250.42 +  <!-- Custom font settings - preferred truetype font -->
  250.43 +  <xsl:param name="title.font.family">Calibri,sans-serif,SimHei</xsl:param>
  250.44 +  <xsl:param name="body.font.family">Cambria,Cambria Math,serif,SimSun</xsl:param>
  250.45 +  <xsl:param name="sans.font.family">Calibri,sans-serif,SimHei</xsl:param>
  250.46 +  <xsl:param name="dingbat.font.family">Cambria,Cambria Math,serif,SimSun</xsl:param>
  250.47 +  <xsl:param name="monospace.font.family">Courier New,monospace,FangSong</xsl:param>
  250.48 +
  250.49 +  <!-- Page related Settings -->
  250.50 +  <xsl:param name="page.margin.inner">1.5cm</xsl:param>
  250.51 +  <xsl:param name="page.margin.outer">1.5cm</xsl:param>
  250.52 +  <xsl:param name="title.margin.left">0pt</xsl:param>
  250.53 +  <xsl:param name="body.start.indent">24pt</xsl:param>
  250.54 +  <xsl:param name="body.end.indent">0pt</xsl:param>
  250.55 +
  250.56 +  <!-- Breaking long lines -->
  250.57 +  <xsl:param name="hyphenate.verbatim">0</xsl:param>
  250.58 +  <xsl:attribute-set name="monospace.verbatim.properties"
  250.59 +                     use-attribute-sets="verbatim.properties monospace.properties">
  250.60 +    <xsl:attribute name="wrap-option">wrap</xsl:attribute>
  250.61 +    <xsl:attribute name="hyphenation-character">&#x25BA;</xsl:attribute>
  250.62 +  </xsl:attribute-set>
  250.63 +
  250.64 +  <!-- Prevent blank pages in output -->
  250.65 +  <xsl:template name="book.titlepage.before.verso">
  250.66 +  </xsl:template>
  250.67 +  <xsl:template name="book.titlepage.verso">
  250.68 +  </xsl:template>
  250.69 +  <xsl:template name="book.titlepage.separator">
  250.70 +  </xsl:template>
  250.71 +
  250.72 +  <!-- Colourize links in output -->
  250.73 +  <xsl:attribute-set name="xref.properties">
  250.74 +    <xsl:attribute name="color">
  250.75 +      <xsl:choose>
  250.76 +        <xsl:when test="self::ulink">blue</xsl:when>
  250.77 +        <xsl:when test="self::xref">blue</xsl:when>
  250.78 +        <xsl:when test="self::uri">blue</xsl:when>
  250.79 +        <xsl:otherwise>red</xsl:otherwise>
  250.80 +      </xsl:choose>
  250.81 +    </xsl:attribute>
  250.82 +  </xsl:attribute-set>
  250.83 +
  250.84 +</xsl:stylesheet>
   251.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   251.2 +++ b/stylesheets/hgbook.css	Mon Apr 06 23:15:52 2009 -0700
   251.3 @@ -0,0 +1,295 @@
   251.4 +body
   251.5 +{
   251.6 +    background: white;
   251.7 +    margin: 1in;
   251.8 +    font-family: Georgia,SimSun,serif;
   251.9 +}
  251.10 +
  251.11 +p, li, ul, ol, dd, dt
  251.12 +{
  251.13 +    font-style: normal;
  251.14 +    font-weight: normal;
  251.15 +    color: black;
  251.16 +}
  251.17 +
  251.18 +tt, pre
  251.19 +{
  251.20 +    font-family: Consolas,KaiTi,FangSong,SimSun,monospace;
  251.21 +}
  251.22 +
  251.23 +a
  251.24 +{
  251.25 +    color: blue;
  251.26 +    text-decoration: underline;
  251.27 +}    
  251.28 +
  251.29 +a:hover 
  251.30 +{
  251.31 +    background: rgb(75%,75%,100%);
  251.32 +    color: blue;
  251.33 +    text-decoration: underline;
  251.34 +}
  251.35 +
  251.36 +a:visited 
  251.37 +{
  251.38 +    color: purple;
  251.39 +    text-decoration: underline;
  251.40 +}
  251.41 +
  251.42 +img
  251.43 +{
  251.44 +    border: none;
  251.45 +}
  251.46 +
  251.47 +h1.title
  251.48 +{
  251.49 +    font-size: 250%;
  251.50 +    font-style: normal;
  251.51 +    font-weight: bold;
  251.52 +    color: black;
  251.53 +}
  251.54 +
  251.55 +h2.subtitle
  251.56 +{
  251.57 +    font-size: 150%;
  251.58 +    font-style: italic;
  251.59 +    color: black;
  251.60 +}
  251.61 +
  251.62 +h2.title
  251.63 +{
  251.64 +    font-size: 150%;
  251.65 +    font-style: normal;
  251.66 +    font-weight: bold;
  251.67 +    color: black;
  251.68 +}
  251.69 +
  251.70 +h3.title
  251.71 +{
  251.72 +    font-size: 125%;
  251.73 +    font-style: normal;
  251.74 +    font-weight: bold;
  251.75 +    color: black;
  251.76 +}
  251.77 +
  251.78 +h4.title
  251.79 +{
  251.80 +    font-size: 100%;
  251.81 +    font-style: normal;
  251.82 +    font-weight: bold;
  251.83 +    color: black;
  251.84 +}
  251.85 +
  251.86 +strong
  251.87 +{
  251.88 +    font-weight: normal;
  251.89 +}
  251.90 +
  251.91 +.toc b
  251.92 +{
  251.93 +    font-family: Verdana,SimHei,sans-serif;
  251.94 +    font-size: 120%;
  251.95 +    font-style: normal;
  251.96 +    font-weight: bold;
  251.97 +    color: black;
  251.98 +}
  251.99 +
 251.100 +.title
 251.101 +{
 251.102 +    font-family: Verdana,SimHei,sans-serif;
 251.103 +}
 251.104 +
 251.105 +.screen, .programlisting, .structname
 251.106 +{
 251.107 +    font-family: Consolas,KaiTi,FangSong,SimSun,monospace;
 251.108 +    font-style: normal;
 251.109 +    font-weight: normal;
 251.110 +}
 251.111 +
 251.112 +.userinput
 251.113 +{
 251.114 +    font-weight: normal;
 251.115 +}
 251.116 +
 251.117 +.command
 251.118 +{
 251.119 +    font-style: italic;
 251.120 +}
 251.121 +
 251.122 +.filename
 251.123 +{
 251.124 +    font-family: Georgia,SimSun,serif;
 251.125 +    font-style: italic;
 251.126 +}
 251.127 +
 251.128 +.figure, .example, .table
 251.129 +{
 251.130 +    margin: 0.125in 0.25in;
 251.131 +}
 251.132 +
 251.133 +.figure p.title b, .example p.title b, .table p.title b
 251.134 +{
 251.135 +    font-family: Georgia,SimSun,serif;
 251.136 +    font-size: 80%;
 251.137 +    font-style: italic;
 251.138 +    font-weight: normal;
 251.139 +}
 251.140 +
 251.141 +.table table
 251.142 +{
 251.143 +    border-width: 1px;
 251.144 +    border-style: solid;
 251.145 +    border-color: black;
 251.146 +    border-spacing: 0;
 251.147 +    background: rgb(240,240,240);
 251.148 +}
 251.149 +
 251.150 +.table td
 251.151 +{
 251.152 +    border: none;
 251.153 +    border-right: 1px black solid;
 251.154 +    border-bottom: 1px black solid;
 251.155 +    padding: 2px;
 251.156 +}
 251.157 +
 251.158 +.table th
 251.159 +{
 251.160 +    background: rgb(180,180,180);
 251.161 +    border: none;
 251.162 +    border-right: 1px black solid;
 251.163 +    border-bottom: 1px black solid;
 251.164 +    padding: 2px;
 251.165 +}
 251.166 +
 251.167 +.table p.title, .figure p.title, .example p.title
 251.168 +{
 251.169 +    text-align: left !important;
 251.170 +    font-size: 100% !important;
 251.171 +}
 251.172 +
 251.173 +.author, .pubdate
 251.174 +{
 251.175 +    margin: 0;
 251.176 +    font-size: 100%;
 251.177 +    font-style: italic;
 251.178 +    font-weight: normal;
 251.179 +    color: black;
 251.180 +}
 251.181 +
 251.182 +.preface div.author, .preface .pubdate
 251.183 +{
 251.184 +    font-size: 80%;
 251.185 +}
 251.186 +
 251.187 +.sidebar 
 251.188 +{
 251.189 +    border-top: dotted 1px black;
 251.190 +    border-left: dotted 1px black;
 251.191 +    border-right: solid 2px black;
 251.192 +    border-bottom: solid 2px black;
 251.193 +    background: rgb(240,220,170);
 251.194 +    padding: 0 0.12in;
 251.195 +    margin: 0.25in;
 251.196 +}
 251.197 +
 251.198 +.note .programlisting, .note .screen, 
 251.199 +.tip .programlisting, .tip .screen, 
 251.200 +.warning .programlisting, .warning .screen, 
 251.201 +.sidebar .programlisting, .sidebar .screen
 251.202 +{
 251.203 +    border: none;
 251.204 +    background: none;
 251.205 +}
 251.206 +
 251.207 +.sidebar p.title
 251.208 +{
 251.209 +    text-align: center;
 251.210 +    font-size: 125%;
 251.211 +}
 251.212 +
 251.213 +.note, .tip, .warning
 251.214 +{
 251.215 +    border: black solid 1px;
 251.216 +    margin: 0.125in 0;
 251.217 +    padding: 0 55px;
 251.218 +    font-size: 90%;
 251.219 +}
 251.220 +
 251.221 +/*
 251.222 +.note
 251.223 +{
 251.224 +    background: url(./figs/note.png) no-repeat rgb(252,246,220);
 251.225 +}
 251.226 +
 251.227 +.tip
 251.228 +{
 251.229 +    background: url(./figs/tip.png) no-repeat rgb(224,244,255);
 251.230 +}
 251.231 +
 251.232 +.warning
 251.233 +{
 251.234 +    background: url(./figs/warning.png) no-repeat rgb(255,210,210);
 251.235 +}
 251.236 +*/
 251.237 +
 251.238 +.note .title, .tip .title, .warning .title
 251.239 +{
 251.240 +    display: none;
 251.241 +}
 251.242 +
 251.243 +.programlisting, .screen
 251.244 +{
 251.245 +    font-size: 90%;
 251.246 +    color: black;
 251.247 +    margin: 1em 0.25in;
 251.248 +    padding: 0.5em;
 251.249 +    background: rgb(240,240,240);
 251.250 +    border-top: black dotted 1px;
 251.251 +    border-left: black dotted 1px;
 251.252 +    border-right: black solid 2px;
 251.253 +    border-bottom: black solid 2px;
 251.254 +}
 251.255 +
 251.256 +.navheader, .navfooter
 251.257 +{
 251.258 +    border: black solid 1px;
 251.259 +    background: rgb(180,180,200);
 251.260 +}
 251.261 +
 251.262 +.navheader hr, .navfooter hr
 251.263 +{
 251.264 +    display: none;
 251.265 +}
 251.266 +
 251.267 +#svn-footer
 251.268 +{
 251.269 +    font-size: 80%;
 251.270 +    text-align: center;
 251.271 +}
 251.272 +
 251.273 +#svn-footer hr
 251.274 +{
 251.275 +    display: none;
 251.276 +}
 251.277 +
 251.278 +/* --------------------- */
 251.279 +/* PRINT MEDIA OVERRIDES */
 251.280 +/* --------------------- */
 251.281 +
 251.282 +@media print
 251.283 +{
 251.284 +    body 
 251.285 +    {
 251.286 +        margin: 0;
 251.287 +    }
 251.288 +
 251.289 +    .navheader, .navfooter
 251.290 +    {
 251.291 +        display: none;
 251.292 +    }
 251.293 +
 251.294 +    #svn-footer hr
 251.295 +    {
 251.296 +        display: block;
 251.297 +    }
 251.298 +}
   252.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   252.2 +++ b/stylesheets/html-single.xsl	Mon Apr 06 23:15:52 2009 -0700
   252.3 @@ -0,0 +1,32 @@
   252.4 +<?xml version="1.0"?>
   252.5 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
   252.6 +
   252.7 +  <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
   252.8 +
   252.9 +  <xsl:param name="draft.mode" select="no"/>
  252.10 +
  252.11 +  <!-- xsltproc can't support these extensions
  252.12 +  <xsl:param name="use.extensions">1</xsl:param>
  252.13 +  <xsl:param name="callouts.extension">1</xsl:param>
  252.14 +  <xsl:param name="linenumbering.extension">1</xsl:param>
  252.15 +  <xsl:param name="tablecolumns.extension">1</xsl:param>
  252.16 +  <xsl:param name="textinsert.extension">1</xsl:param>
  252.17 +  -->
  252.18 +
  252.19 +  <xsl:param name="admon.graphics" select="1" />
  252.20 +  <xsl:param name="admon.graphics.extension">.png</xsl:param>
  252.21 +  <xsl:param name="admon.graphics.path">figs/</xsl:param>
  252.22 +  <xsl:param name="callout.graphics" select="1" />
  252.23 +  <xsl:param name="callout.graphics.extension">.png</xsl:param>
  252.24 +  <xsl:param name="callout.graphics.path">images/callouts/</xsl:param>
  252.25 +
  252.26 +  <xsl:param name="section.autolabel" select="1" />
  252.27 +  <xsl:param name="section.label.includes.component.label">1</xsl:param>
  252.28 +
  252.29 +  <xsl:output method="html" encoding="utf-8" indent="yes"/>     <!-- html only -->
  252.30 +  <xsl:param name="use.id.as.filename">0</xsl:param>            <!-- html only -->
  252.31 +  <xsl:param name="chunk.section.depth">0</xsl:param>           <!-- html only -->
  252.32 +  <xsl:param name="chunker.output.indent">yes</xsl:param>       <!-- html only -->
  252.33 +  <xsl:param name="html.stylesheet">hgbook.css</xsl:param>      <!-- html only -->
  252.34 +
  252.35 +</xsl:stylesheet>
   253.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   253.2 +++ b/stylesheets/html.xsl	Mon Apr 06 23:15:52 2009 -0700
   253.3 @@ -0,0 +1,34 @@
   253.4 +<?xml version="1.0"?>
   253.5 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
   253.6 +
   253.7 +  <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/>
   253.8 +
   253.9 +  <xsl:param name="draft.mode" select="no"/>
  253.10 +
  253.11 +  <!-- xsltproc can't support these extensions
  253.12 +  <xsl:param name="use.extensions">1</xsl:param>
  253.13 +  <xsl:param name="callouts.extension">1</xsl:param>
  253.14 +  <xsl:param name="linenumbering.extension">1</xsl:param>
  253.15 +  <xsl:param name="tablecolumns.extension">1</xsl:param>
  253.16 +  <xsl:param name="textinsert.extension">1</xsl:param>
  253.17 +  -->
  253.18 +
  253.19 +  <xsl:param name="admon.graphics" select="1" />
  253.20 +  <xsl:param name="admon.graphics.extension">.png</xsl:param>
  253.21 +  <xsl:param name="admon.graphics.path">figs/</xsl:param>
  253.22 +  <xsl:param name="callout.graphics" select="1" />
  253.23 +  <xsl:param name="callout.graphics.extension">.png</xsl:param>
  253.24 +  <xsl:param name="callout.graphics.path">images/callouts/</xsl:param>
  253.25 +
  253.26 +  <xsl:param name="section.autolabel" select="1" />
  253.27 +  <xsl:param name="section.label.includes.component.label">1</xsl:param>
  253.28 +
  253.29 +  <xsl:output method="html" encoding="utf-8" indent="yes"/>     <!-- html only -->
  253.30 +  <xsl:param name="chunker.output.encoding" select="'utf-8'"/>  <!-- html only -->
  253.31 +  <xsl:param name="chunker.output.indent" select="'yes'"/>      <!-- html only -->
  253.32 +  <xsl:param name="use.id.as.filename">0</xsl:param>            <!-- html only -->
  253.33 +  <xsl:param name="chunk.section.depth">0</xsl:param>           <!-- html only -->
  253.34 +  <xsl:param name="chunker.output.indent">yes</xsl:param>       <!-- html only -->
  253.35 +  <xsl:param name="html.stylesheet">hgbook.css</xsl:param>      <!-- html only -->
  253.36 +
  253.37 +</xsl:stylesheet>
   254.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   254.2 +++ b/stylesheets/zh/fo.xsl	Mon Apr 06 23:15:52 2009 -0700
   254.3 @@ -0,0 +1,30 @@
   254.4 +<?xml version="1.0"?>
   254.5 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   254.6 +                xmlns:fo="http://www.w3.org/1999/XSL/Format"
   254.7 +                version='1.0'>
   254.8 +
   254.9 +  <xsl:import href="../fo.xsl"/>
  254.10 +
  254.11 +  <xsl:param name="l10n.gentext.language" select="'zh'"/>
  254.12 +
  254.13 +  <!-- Chinese font related settings -->
  254.14 +  <xsl:param name="body.font.master">12</xsl:param>
  254.15 +
  254.16 +  <xsl:attribute-set name="standard.para.spacing" use-attribute-sets="normal.para.spacing">
  254.17 +    <xsl:attribute name="text-indent">24pt</xsl:attribute>
  254.18 +  </xsl:attribute-set>
  254.19 +
  254.20 +  <xsl:template match="abstract/para|appendix/para|chapter/para|colophon/para|legalnotice/para|preface/para|section/para|sect1/para|sect2/para">
  254.21 +    <fo:block xsl:use-attribute-sets="standard.para.spacing">
  254.22 +      <xsl:call-template name="anchor"/>
  254.23 +      <xsl:apply-templates/>
  254.24 +    </fo:block>
  254.25 +  </xsl:template>
  254.26 +
  254.27 +  <xsl:template match="section/para/*">
  254.28 +    <fo:wrapper text-indent="0pt">
  254.29 +      <xsl:apply-imports/>
  254.30 +    </fo:wrapper>
  254.31 +  </xsl:template>
  254.32 +
  254.33 +</xsl:stylesheet>
   255.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   255.2 +++ b/stylesheets/zh/html-single.xsl	Mon Apr 06 23:15:52 2009 -0700
   255.3 @@ -0,0 +1,8 @@
   255.4 +<?xml version="1.0"?>
   255.5 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
   255.6 +
   255.7 +  <xsl:import href="../html-single.xsl"/>
   255.8 +
   255.9 +  <xsl:param name="l10n.gentext.language" select="'zh'"/>
  255.10 +
  255.11 +</xsl:stylesheet>
   256.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   256.2 +++ b/stylesheets/zh/html.xsl	Mon Apr 06 23:15:52 2009 -0700
   256.3 @@ -0,0 +1,8 @@
   256.4 +<?xml version="1.0"?>
   256.5 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
   256.6 +
   256.7 +  <xsl:import href="../html.xsl"/>
   256.8 +
   256.9 +  <xsl:param name="l10n.gentext.language" select="'zh'"/>
  256.10 +
  256.11 +</xsl:stylesheet>
   257.1 --- a/tools/latex-to-docbook	Mon Apr 06 23:13:53 2009 -0700
   257.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   257.3 @@ -1,198 +0,0 @@
   257.4 -#!/usr/bin/python
   257.5 -#
   257.6 -# This is the most horrible of hacks. Pretend you're not looking.</para>
   257.7 -
   257.8 -import cStringIO as StringIO
   257.9 -import re, sys
  257.10 -
  257.11 -sections = {
  257.12 -    'chapter': 'chapter',
  257.13 -    'section': 'sect1',
  257.14 -    'subsection': 'sect2',
  257.15 -    'subsubsection': 'sect3',
  257.16 -    }
  257.17 -
  257.18 -envs = {
  257.19 -    'codesample2': 'programlisting',
  257.20 -    'codesample4': 'programlisting',
  257.21 -    'enumerate': 'orderedlist',
  257.22 -    'figure': 'informalfigure',
  257.23 -    'itemize': 'itemizedlist',
  257.24 -    'note': 'note',
  257.25 -    'quote': 'blockquote',
  257.26 -    }
  257.27 -
  257.28 -def process(ifp, ofp):
  257.29 -    print >> ofp, '<!-- vim: set filetype=docbkxml shiftwidth=2 autoindent expandtab tw=77 : -->\n'
  257.30 -    stack = []
  257.31 -    para = True
  257.32 -    inlist = 0
  257.33 -    for line in ifp:
  257.34 -        if line.startswith('%%% Local Variables:'):
  257.35 -            break
  257.36 -        line = (line.rstrip()
  257.37 -                .replace('~', ' ')
  257.38 -                .replace('&', '&amp;')
  257.39 -                .replace('---', '&emdash;')
  257.40 -                .replace('\_', '_')
  257.41 -                .replace('\{', '{')
  257.42 -                .replace('\}', '}')
  257.43 -                .replace('\$', '$')
  257.44 -                .replace('\%', '%')
  257.45 -                .replace('\#', '#')
  257.46 -                .replace('<', '&lt;')
  257.47 -                .replace('>', '&gt;')
  257.48 -                .replace('``', '<quote>')
  257.49 -                .replace("''", '</quote>')
  257.50 -                .replace('\\', '\\'))
  257.51 -        line = re.sub(r'\s*\\(?:centering|small)\b\s*', '', line)
  257.52 -        line = re.sub(r'\\(?:hgrc\\|hgrc)\b',
  257.53 -                      r'<filename role="special"> /.hgrc</filename>', line)
  257.54 -        line = re.sub(r'\\item\[(?P<key>[^]]+)\]', r'\item \g<key>:', line)
  257.55 -        line = re.sub(r'\\bug{(?P<id>\d+)}',
  257.56 -                      r'<ulink role="hg-bug" url="http://www.selenic.com/mercurial/bts/issue\g<id>">issue \g<id></ulink>', line)
  257.57 -        line = re.sub(r'\\cite{([^}]+)}', r'<citation>\1</citation>', line)
  257.58 -        line = re.sub(r'\\hggopt{(?P<opt>[^}]+)}',
  257.59 -                      r'<option role="hg-opt-global">\g<opt></option>', line)
  257.60 -        line = re.sub(r'\\hgxopt{(?P<ext>[^}]+)}{(?P<cmd>[^}]+)}{(?P<opt>[^}]+)}',
  257.61 -                      r'<option role="hg-ext-\g<ext>-cmd-\g<cmd>-opt">\g<opt></option>', line)
  257.62 -        line = re.sub(r'\\hgxcmd{(?P<ext>[^}]+)}{(?P<cmd>[^}]+)}',
  257.63 -                      r'<command role="hg-ext-\g<ext>">\g<cmd></command>', line)
  257.64 -        line = re.sub(r'\\hgext{(?P<ext>[^}]+)}',
  257.65 -                      r'<literal role="hg-ext">\g<ext></literal>', line)
  257.66 -        line = re.sub(r'\\hgopt{(?P<cmd>[^}]+)}{(?P<opt>[^}]+)}',
  257.67 -                      r'<option role="hg-opt-\g<cmd>">\g<opt></option>',
  257.68 -                      line)
  257.69 -        line = re.sub(r'\\cmdopt{(?P<cmd>[^}]+)}{(?P<opt>[^}]+)}',
  257.70 -                      r'<option role="cmd-opt-\g<cmd>">\g<opt></option>',
  257.71 -                      line)
  257.72 -        line = re.sub(r'\\hgcmd{(?P<cmd>[^}]+)}',
  257.73 -                      r'<command role="hg-cmd">hg \g<cmd></command>', line)
  257.74 -        line = re.sub(r'\\caption{(?P<text>[^}]+?)}',
  257.75 -                      r'<caption><para>\g<text></para></caption>', line)
  257.76 -        line = re.sub(r'\\grafix{(?P<name>[^}]+)}',
  257.77 -                      r'<mediaobject><imageobject><imagedata fileref="\g<name>"/></imageobject><textobject><phrase>XXX add text</phrase></textobject></mediaobject>', line)
  257.78 -        line = re.sub(r'\\envar{(?P<name>[^}]+)}',
  257.79 -                      r'<envar>\g<name></envar>', line)
  257.80 -        line = re.sub(r'\\rcsection{(?P<sect>[^}]+)}',
  257.81 -                      r'<literal role="rc-\g<sect>">\g<sect></literal>', line)
  257.82 -        line = re.sub(r'\\rcitem{(?P<sect>[^}]+)}{(?P<name>[^}]+)}',
  257.83 -                      r'<envar role="rc-item-\g<sect>">\g<name></envar>', line)
  257.84 -        line = re.sub(r'\\dirname{(?P<dir>[^}]+?)}',
  257.85 -                      r'<filename class="directory">\g<dir></filename>', line)
  257.86 -        line = re.sub(r'\\filename{(?P<file>[^}]+?)}',
  257.87 -                      r'<filename>\g<file></filename>', line)
  257.88 -        line = re.sub(r'\\tildefile{(?P<file>[^}]+)}',
  257.89 -                      r'<filename role="home">~/\g<file></filename>', line)
  257.90 -        line = re.sub(r'\\sfilename{(?P<file>[^}]+)}',
  257.91 -                      r'<filename role="special">\g<file></filename>', line)
  257.92 -        line = re.sub(r'\\sdirname{(?P<dir>[^}]+)}',
  257.93 -                      r'<filename role="special" class="directory">\g<dir></filename>', line)
  257.94 -        line = re.sub(r'\\interaction{(?P<id>[^}]+)}',
  257.95 -                      r'<!-- &interaction.\g<id>; -->', line)
  257.96 -        line = re.sub(r'\\excode{(?P<id>[^}]+)}',
  257.97 -                      r'<!-- &example.\g<id>; -->', line)
  257.98 -        line = re.sub(r'\\pymod{(?P<mod>[^}]+)}',
  257.99 -                      r'<literal role="py-mod">\g<mod></literal>', line)
 257.100 -        line = re.sub(r'\\pymodclass{(?P<mod>[^}]+)}{(?P<class>[^}]+)}',
 257.101 -                      r'<literal role="py-mod-\g<mod>">\g<class></literal>', line)
 257.102 -        line = re.sub(r'\\url{(?P<url>[^}]+)}',
 257.103 -                      r'<ulink url="\g<url>">\g<url></ulink>', line)
 257.104 -        line = re.sub(r'\\href{(?P<url>[^}]+)}{(?P<text>[^}]+)}',
 257.105 -                      r'<ulink url="\g<url>">\g<text></ulink>', line)
 257.106 -        line = re.sub(r'\\command{(?P<cmd>[^}]+)}',
 257.107 -                      r'<command>\g<cmd></command>', line)
 257.108 -        line = re.sub(r'\\option{(?P<opt>[^}]+)}',
 257.109 -                      r'<option>\g<opt></option>', line)
 257.110 -        line = re.sub(r'\\ref{(?P<id>[^}]+)}', r'<xref linkend="\g<id>"/>', line)
 257.111 -        line = re.sub(r'\\emph{(?P<txt>[^}]+)}',
 257.112 -                      r'<emphasis>\g<txt></emphasis>', line)
 257.113 -        line = re.sub(r'\\texttt{(?P<txt>[^}]+)}',
 257.114 -                      r'<literal>\g<txt></literal>', line)
 257.115 -        line = re.sub(r'\\textbf{(?P<txt>[^}]+)}',
 257.116 -                      r'<emphasis role="bold">\g<txt></emphasis>', line)
 257.117 -        line = re.sub(r'\\hook{(?P<name>[^}]+)}',
 257.118 -                      r'<literal role="hook">\g<name></literal>', line)
 257.119 -        line = re.sub(r'\\tplfilter{(?P<name>[^}]+)}',
 257.120 -                      r'<literal role="template-filter">\g<name></literal>', line)
 257.121 -        line = re.sub(r'\\tplkword{(?P<name>[^}]+)}',
 257.122 -                      r'<literal role="template-keyword">\g<name></literal>', line)
 257.123 -        line = re.sub(r'\\tplkwfilt{(?P<tpl>[^}]+)}{(?P<name>[^}]+)}',
 257.124 -                      r'<literal role="template-kw-filt-\g<tpl>">\g<name></literal>', line)
 257.125 -        line = re.sub(r'\\[vV]erb(.)(?P<txt>[^\1]+?)\1',
 257.126 -                      r'<literal>\g<txt></literal>', line)
 257.127 -        line = re.sub(r'\\package{(?P<name>[^}]+)}',
 257.128 -                      r'<literal role="package">\g<name></literal>', line)
 257.129 -        line = re.sub(r'\\hgcmdargs{(?P<cmd>[^}]+)}{(?P<args>[^}]+)}',
 257.130 -                      r'<command role="hg-cmd">hg \g<cmd> \g<args></command>',
 257.131 -                      line)
 257.132 -        line = re.sub(r'\\cmdargs{(?P<cmd>[^}]+)}{(?P<args>[^}]+)}',
 257.133 -                      r'<command>\g<cmd> \g<args></command>',
 257.134 -                      line)
 257.135 -        m = re.match(r'\\(chapter|section|subsection|subsubsection){(.*)}', line)
 257.136 -        if m:
 257.137 -            kind, content = m.groups()
 257.138 -            sec = sections[kind]
 257.139 -            while stack and stack[-1] >= sec:
 257.140 -                close = stack.pop()
 257.141 -                print >> ofp, '</%s>' % close
 257.142 -            stack.append(sec)
 257.143 -            print >> ofp, '<%s>\n<title>%s</title>' % (sec, content)
 257.144 -        else:
 257.145 -            m = re.match(r'\s*\\(begin|end){(?P<sect>[^}]+)}', line)
 257.146 -            if m:
 257.147 -                if not para:
 257.148 -                    print >> ofp, '</para>'
 257.149 -                    if inlist:
 257.150 -                        ofp.write('</listitem>')
 257.151 -                    para = True
 257.152 -                state, env = m.groups()
 257.153 -                env = envs[env]
 257.154 -                if state == 'begin':
 257.155 -                    ofp.write('<')
 257.156 -                    if env in ('itemizedlist', 'orderedlist'):
 257.157 -                        inlist = 1
 257.158 -                else:
 257.159 -                    ofp.write('</')
 257.160 -                    if env in ('itemizedlist', 'orderedlist'):
 257.161 -                        inlist = 0
 257.162 -                print >> ofp, env + '>'
 257.163 -            else:
 257.164 -                if line.startswith('\\item '):
 257.165 -                    if inlist > 1:
 257.166 -                        print >> ofp, '</para>'
 257.167 -                        print >> ofp, '</listitem>'
 257.168 -                    else:
 257.169 -                        inlist = 2
 257.170 -                    para = True
 257.171 -                    line = line[6:]
 257.172 -                if line and para:
 257.173 -                    if inlist:
 257.174 -                        ofp.write('<listitem>')
 257.175 -                    ofp.write('<para>')
 257.176 -                    para = False
 257.177 -                if not line and not para:
 257.178 -                    print >> ofp, '</para>'
 257.179 -                    if inlist:
 257.180 -                        ofp.write('</listitem>')
 257.181 -                    para = True
 257.182 -                print >> ofp, line
 257.183 -    while stack:
 257.184 -        print >> ofp, '</%s>' % stack.pop()
 257.185 -    ofp.write('\n'.join(['\n<!--',
 257.186 -                         'local variables: ',
 257.187 -                         'sgml-parent-document: ("00book.xml" "book" "chapter")',
 257.188 -                         'end:',
 257.189 -                         '-->']))
 257.190 -
 257.191 -
 257.192 -if __name__ == '__main__':
 257.193 -    for name in sys.argv[1:]:
 257.194 -        if not name.endswith('.tex'):
 257.195 -            continue
 257.196 -        newname = name[:-3] + 'xml'
 257.197 -        ofp = StringIO.StringIO()
 257.198 -        process(open(name), ofp)
 257.199 -        s = ofp.getvalue()
 257.200 -        s = re.sub('\n+</para>', '</para>', s, re.M)
 257.201 -        open(newname, 'w').write(s)
   258.1 --- a/xsl/all-ids.xsl	Mon Apr 06 23:13:53 2009 -0700
   258.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   258.3 @@ -1,40 +0,0 @@
   258.4 -<?xml version="1.0" encoding="utf-8"?>
   258.5 -
   258.6 -<!-- Prepare an ASCII dump file of all IDs, and the pages in which
   258.7 -     they live, for loading into a database. Assumes one-level chunked
   258.8 -     HTML output, with each chunk containing either a chapter or
   258.9 -     sect1. -->
  258.10 -
  258.11 -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  258.12 -                version="1.0">
  258.13 -
  258.14 -  <xsl:output method="text"/>
  258.15 -  <xsl:strip-space elements="title"/>
  258.16 -
  258.17 -  <xsl:template match="/">
  258.18 -    <xsl:for-each select="//preface|//chapter|//appendix|//bibliography|//sect1">
  258.19 -      <xsl:variable name="id">
  258.20 -        <xsl:choose>
  258.21 -          <xsl:when test="local-name(.)='sect1'">
  258.22 -            <xsl:value-of select="../@id"/>
  258.23 -          </xsl:when>
  258.24 -          <xsl:otherwise>
  258.25 -            <xsl:value-of select="@id"/>
  258.26 -          </xsl:otherwise>
  258.27 -        </xsl:choose>
  258.28 -      </xsl:variable>
  258.29 -      <xsl:variable name="sectitle">
  258.30 -        <xsl:value-of select="normalize-space(./title)"/>
  258.31 -      </xsl:variable>
  258.32 -      <xsl:for-each select=".//para[@id]|.//programlisting[@id]|.//screen[@id]">
  258.33 -        <xsl:value-of select="@id"/>
  258.34 -        <xsl:text>|</xsl:text>
  258.35 -        <xsl:copy-of select="$id"/>
  258.36 -        <xsl:text>|</xsl:text>
  258.37 -        <xsl:copy-of select="$sectitle"/>
  258.38 -        <xsl:text>&#x0a;</xsl:text>
  258.39 -      </xsl:for-each>
  258.40 -    </xsl:for-each>
  258.41 -  </xsl:template>
  258.42 -
  258.43 -</xsl:stylesheet>
   259.1 --- a/xsl/base-html-stylesheet.xsl	Mon Apr 06 23:13:53 2009 -0700
   259.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   259.3 @@ -1,127 +0,0 @@
   259.4 -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
   259.5 -
   259.6 -  <xsl:param name="html.stylesheet">/support/styles.css</xsl:param>
   259.7 -  <xsl:param name="toc.section.depth">3</xsl:param>
   259.8 -  <xsl:param name="annotate.toc">0</xsl:param>
   259.9 -
  259.10 -  <xsl:param name="generate.id.attributes" select="1"></xsl:param>
  259.11 -  <xsl:param name="header.rule" select="0"></xsl:param>
  259.12 -  <xsl:param name="footer.rule" select="0"></xsl:param>
  259.13 -  <xsl:param name="html.cleanup" select="1"></xsl:param>
  259.14 -  <xsl:param name="admon.style"><xsl:text></xsl:text></xsl:param>
  259.15 -  <xsl:param name="admon.graphics" select="1"></xsl:param>
  259.16 -  <xsl:param name="admon.graphics.path">/support/figs/</xsl:param>
  259.17 -
  259.18 -  <xsl:template match="sect1" mode="toc">
  259.19 -    <xsl:param name="toc-context" select="."/>
  259.20 -    <xsl:call-template name="subtoc">
  259.21 -      <xsl:with-param name="toc-context" select="$toc-context"/>
  259.22 -      <xsl:with-param name="nodes" 
  259.23 -        select="sect2|refentry|bridgehead[$bridgehead.in.toc != 0]"/>
  259.24 -    </xsl:call-template>
  259.25 -  </xsl:template>
  259.26 -
  259.27 -  <xsl:template match="sect2" mode="toc">
  259.28 -    <xsl:param name="toc-context" select="."/>
  259.29 -
  259.30 -    <xsl:call-template name="subtoc">
  259.31 -      <xsl:with-param name="toc-context" select="$toc-context"/>
  259.32 -      <xsl:with-param name="nodes" 
  259.33 -        select="sect3|refentry|bridgehead[$bridgehead.in.toc != 0]"/>
  259.34 -    </xsl:call-template>
  259.35 -  </xsl:template>
  259.36 -
  259.37 -  <!-- Add id attributes to <p> tags. This is mostly a copy of the
  259.38 -       base XSL. -->
  259.39 -  <xsl:template name="paragraph">
  259.40 -    <xsl:param name="class" select="''"/>
  259.41 -    <xsl:param name="content"/>
  259.42 -
  259.43 -    <xsl:variable name="p">
  259.44 -      <p>
  259.45 -        <xsl:call-template name="dir"/>
  259.46 -        <xsl:if test="$class != ''">
  259.47 -          <xsl:apply-templates select="." mode="class.attribute">
  259.48 -            <xsl:with-param name="class" select="$class"/>
  259.49 -          </xsl:apply-templates>
  259.50 -        </xsl:if>
  259.51 -        <!-- Here we go. -->
  259.52 -        <xsl:if test="$generate.id.attributes != 0">
  259.53 -          <xsl:attribute name="id">
  259.54 -            <xsl:call-template name="object.id"/>
  259.55 -          </xsl:attribute>
  259.56 -        </xsl:if>
  259.57 -        <xsl:copy-of select="$content"/>
  259.58 -      </p>
  259.59 -    </xsl:variable>
  259.60 -
  259.61 -    <xsl:choose>
  259.62 -      <xsl:when test="$html.cleanup != 0">
  259.63 -        <xsl:call-template name="unwrap.p">
  259.64 -          <xsl:with-param name="p" select="$p"/>
  259.65 -        </xsl:call-template>
  259.66 -      </xsl:when>
  259.67 -      <xsl:otherwise>
  259.68 -        <xsl:copy-of select="$p"/>
  259.69 -      </xsl:otherwise>
  259.70 -    </xsl:choose>
  259.71 -  </xsl:template>
  259.72 -
  259.73 -  <!-- Add id attributes to <programlisting> and <screen> tags. Once
  259.74 -       again, this is mostly a copy of the base XSL, although rather
  259.75 -       trimmed down. -->
  259.76 -  <xsl:template match="programlisting|screen">
  259.77 -    <xsl:param name="suppress-numbers" select="'0'"/>
  259.78 -
  259.79 -    <xsl:call-template name="anchor"/>
  259.80 -
  259.81 -    <pre>
  259.82 -      <!-- Here we go. -->
  259.83 -      <xsl:if test="$generate.id.attributes != 0">
  259.84 -        <xsl:attribute name="id">
  259.85 -          <xsl:call-template name="object.id"/>
  259.86 -        </xsl:attribute>
  259.87 -      </xsl:if>
  259.88 -
  259.89 -      <xsl:apply-templates select="." mode="class.attribute"/>
  259.90 -      <xsl:call-template name="apply-highlighting"/>
  259.91 -    </pre>
  259.92 -  </xsl:template>
  259.93 -
  259.94 -  <!-- The default stylesheet generates a little TOC at the beginning
  259.95 -       of each qandaset.  Uh, no thanks. -->
  259.96 -  <xsl:template name="process.qanda.toc"/>
  259.97 -
  259.98 -  <xsl:template name="user.header.navigation">
  259.99 -    <div class="navheader"><h2 class="booktitle"><a href="/">Mercurial: The Definitive Guide</a> <span class="authors">by Bryan O'Sullivan</span></h2></div>
 259.100 -  </xsl:template>
 259.101 -
 259.102 -  <xsl:template name="user.head.content">
 259.103 -    <link rel="alternate" type="application/atom+xml" title="Comments"
 259.104 -      href="/feeds/comments/"/>
 259.105 -    <link rel="shortcut icon" type="image/png" href="/support/figs/favicon.png"/>
 259.106 -    <script type="text/javascript" src="/support/jquery-min.js"></script>
 259.107 -    <script type="text/javascript" src="/support/form.js"></script>
 259.108 -    <script type="text/javascript" src="/support/hsbook.js"></script>
 259.109 -  </xsl:template>
 259.110 -
 259.111 -  <xsl:template name="user.footer.content">
 259.112 -    <div class="hgfooter">
 259.113 -      <p><img src="/support/figs/rss.png"/> Want to stay up to date? Subscribe to the comment feed for <a id="chapterfeed" class="feed" href="/feeds/comments/">this chapter</a>, or the <a class="feed" href="/feeds/comments/">entire book</a>.</p>
 259.114 -      <p>Copyright 2006, 2007, 2008, 2009 Bryan O'Sullivan.
 259.115 -      Icons by <a href="mailto:mattahan@gmail.com">Paul Davey</a> aka <a href="http://mattahan.deviantart.com/">Mattahan</a>.</p>
 259.116 -    </div>
 259.117 -  </xsl:template>
 259.118 -
 259.119 -  <xsl:template name="user.footer.navigation">
 259.120 -    <script type="text/javascript">
 259.121 -    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
 259.122 -    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
 259.123 -    </script>
 259.124 -    <script type="text/javascript">
 259.125 -    try {
 259.126 -    var pageTracker = _gat._getTracker("UA-1805907-5");
 259.127 -    pageTracker._trackPageview();
 259.128 -    } catch(err) {}</script>
 259.129 -  </xsl:template>
 259.130 -</xsl:stylesheet>
   260.1 --- a/xsl/chunk-stylesheet.xsl	Mon Apr 06 23:13:53 2009 -0700
   260.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   260.3 @@ -1,17 +0,0 @@
   260.4 -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
   260.5 -
   260.6 -  <xsl:import href="system-xsl/html/chunk.xsl"/>
   260.7 -  <xsl:include href="base-html-stylesheet.xsl"/>
   260.8 -
   260.9 -  <!-- PARAMETER REFERENCE:                                         -->
  260.10 -  <!-- http://docbook.sourceforge.net/release/xsl/current/doc/html/ -->
  260.11 -
  260.12 -  <!-- Uncomment this to enable auto-numbering of sections -->
  260.13 -  <!-- xsl:param name="section.autolabel" select="1" / -->
  260.14 -  <xsl:param name="chunker.output.encoding">UTF-8</xsl:param>
  260.15 -  <xsl:param name="use.id.as.filename" select="1"/>
  260.16 -  <xsl:param name="chunk.first.sections" select="0"/>
  260.17 -  <xsl:param name="chunk.section.depth" select="0"/>
  260.18 -  <xsl:param name="chunk.quietly" select="0"/>
  260.19 -
  260.20 -</xsl:stylesheet>
   261.1 --- a/xsl/dtd-profile.xsl	Mon Apr 06 23:13:53 2009 -0700
   261.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   261.3 @@ -1,15 +0,0 @@
   261.4 -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
   261.5 -  <xsl:import href="system-xsl/profiling/profile.xsl"></xsl:import>
   261.6 -
   261.7 -  <!-- For some reason, xsltproc omits the DTD from the file it
   261.8 -       outputs. Add a sensible one back in, because otherwise xmllint
   261.9 -       won't validate profiled documents. -->
  261.10 -
  261.11 -  <xsl:template match="/">
  261.12 -    <xsl:text disable-output-escaping="yes"><![CDATA[
  261.13 -<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
  261.14 - "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
  261.15 -  ]]></xsl:text>
  261.16 -    <xsl:apply-templates select="." mode="profile"/>
  261.17 -  </xsl:template> 
  261.18 -</xsl:stylesheet>