hgbook

changeset 177:c54f4c106fd5

Record the version of Mercurial used.
author Bryan O'Sullivan <bos@serpentine.com>
date Wed Mar 28 23:01:57 2007 -0700 (2007-03-28)
parents edd2acc3dbab
children 1b55292716a4
files .hgignore en/00book.tex en/Makefile
line diff
     1.1 --- a/.hgignore	Wed Mar 28 22:55:13 2007 -0700
     1.2 +++ b/.hgignore	Wed Mar 28 23:01:57 2007 -0700
     1.3 @@ -6,6 +6,7 @@
     1.4  
     1.5  beta/*.tex
     1.6  build_id.tex
     1.7 +hg_id.tex
     1.8  *.4[ct][ct]
     1.9  *.aux
    1.10  *.bbl
     2.1 --- a/en/00book.tex	Wed Mar 28 22:55:13 2007 -0700
     2.2 +++ b/en/00book.tex	Wed Mar 28 23:01:57 2007 -0700
     2.3 @@ -13,13 +13,14 @@
     2.4  
     2.5  \include{99defs}
     2.6  
     2.7 -\title{Distributed revision control with Mercurial}
     2.8 -\author{Bryan O'Sullivan}
     2.9 +\title{Distributed revision control with Mercurial} \author{Bryan
    2.10 +  O'Sullivan}
    2.11  \date{Copyright \copyright\ 2006, 2007 Bryan O'Sullivan.\\
    2.12    This material may be distributed only subject to the terms and
    2.13    conditions set forth in version 1.0 of the Open Publication License.
    2.14    Please refer to Appendix~\ref{cha:opl} for the license text.\\
    2.15 -  This book was prepared from revision \input{build_id}.}
    2.16 +  This book was prepared from revision \input{build_id} of its sources
    2.17 +  using revision \input{hg_id} of Mercurial.}
    2.18  
    2.19  \makeindex
    2.20  
     3.1 --- a/en/Makefile	Wed Mar 28 22:55:13 2007 -0700
     3.2 +++ b/en/Makefile	Wed Mar 28 23:01:57 2007 -0700
     3.3 @@ -1,7 +1,5 @@
     3.4  # This makefile requires GNU make.
     3.5  
     3.6 -hg_id := $(shell hg parents --template '{node|short}\n')
     3.7 -
     3.8  sources := \
     3.9  	00book.tex \
    3.10  	99book.bib \
    3.11 @@ -12,6 +10,7 @@
    3.12  	concepts.tex \
    3.13  	daily.tex \
    3.14  	filenames.tex \
    3.15 +	hg_id.tex \
    3.16  	hook.tex \
    3.17  	intro.tex \
    3.18  	mq.tex \
    3.19 @@ -91,6 +90,13 @@
    3.20  	-output-directory $(dir $(1)) \
    3.21  	-jobname $(basename $(notdir $(1)))
    3.22  
    3.23 +hg = $(shell which hg)
    3.24 +
    3.25 +hg-id = $(shell hg parents --template '{node|short}\n')
    3.26 +
    3.27 +hg-version = $(shell hg version -q | \
    3.28 +		     sed 's,.*(version \(unknown\|[a-f0-9]*\)),\1,')
    3.29 +
    3.30  all: pdf html
    3.31  
    3.32  pdf: pdf/hgbook.pdf
    3.33 @@ -173,7 +179,10 @@
    3.34  	cd examples && ./run-example $(notdir $<)
    3.35  
    3.36  build_id.tex: $(wildcard ../.hg/00changelog.[id])
    3.37 -	echo -n $(hg_id) > build_id.tex
    3.38 +	echo -n $(hg-id) > build_id.tex
    3.39 +
    3.40 +hg_id.tex: $(hg)
    3.41 +	echo -n $(hg-version) > hg_id.tex
    3.42  
    3.43  clean:
    3.44  	rm -rf dist html pdf \
    3.45 @@ -181,7 +190,7 @@
    3.46  		$(image-dot:%.dot=%.png) \
    3.47  		$(image-svg:%.svg=%.pdf) \
    3.48  		$(image-svg:%.svg=%.png) \
    3.49 -		examples/*.{lxo,run} examples/.run build_id.tex
    3.50 +		examples/*.{lxo,run} examples/.run build_id.tex hg_id.tex
    3.51  
    3.52  install: pdf split $(dist-sources)
    3.53  	rm -rf dist