changeset 177:c54f4c106fd5

Record the version of Mercurial used.
author Bryan O'Sullivan <bos@serpentine.com>
date Wed, 28 Mar 2007 23:01:57 -0700
parents edd2acc3dbab
children 1b55292716a4
files .hgignore en/00book.tex en/Makefile
diffstat 3 files changed, 18 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Wed Mar 28 22:55:13 2007 -0700
+++ b/.hgignore	Wed Mar 28 23:01:57 2007 -0700
@@ -6,6 +6,7 @@
 
 beta/*.tex
 build_id.tex
+hg_id.tex
 *.4[ct][ct]
 *.aux
 *.bbl
--- a/en/00book.tex	Wed Mar 28 22:55:13 2007 -0700
+++ b/en/00book.tex	Wed Mar 28 23:01:57 2007 -0700
@@ -13,13 +13,14 @@
 
 \include{99defs}
 
-\title{Distributed revision control with Mercurial}
-\author{Bryan O'Sullivan}
+\title{Distributed revision control with Mercurial} \author{Bryan
+  O'Sullivan}
 \date{Copyright \copyright\ 2006, 2007 Bryan O'Sullivan.\\
   This material may be distributed only subject to the terms and
   conditions set forth in version 1.0 of the Open Publication License.
   Please refer to Appendix~\ref{cha:opl} for the license text.\\
-  This book was prepared from revision \input{build_id}.}
+  This book was prepared from revision \input{build_id} of its sources
+  using revision \input{hg_id} of Mercurial.}
 
 \makeindex
 
--- a/en/Makefile	Wed Mar 28 22:55:13 2007 -0700
+++ b/en/Makefile	Wed Mar 28 23:01:57 2007 -0700
@@ -1,7 +1,5 @@
 # This makefile requires GNU make.
 
-hg_id := $(shell hg parents --template '{node|short}\n')
-
 sources := \
 	00book.tex \
 	99book.bib \
@@ -12,6 +10,7 @@
 	concepts.tex \
 	daily.tex \
 	filenames.tex \
+	hg_id.tex \
 	hook.tex \
 	intro.tex \
 	mq.tex \
@@ -91,6 +90,13 @@
 	-output-directory $(dir $(1)) \
 	-jobname $(basename $(notdir $(1)))
 
+hg = $(shell which hg)
+
+hg-id = $(shell hg parents --template '{node|short}\n')
+
+hg-version = $(shell hg version -q | \
+		     sed 's,.*(version \(unknown\|[a-f0-9]*\)),\1,')
+
 all: pdf html
 
 pdf: pdf/hgbook.pdf
@@ -173,7 +179,10 @@
 	cd examples && ./run-example $(notdir $<)
 
 build_id.tex: $(wildcard ../.hg/00changelog.[id])
-	echo -n $(hg_id) > build_id.tex
+	echo -n $(hg-id) > build_id.tex
+
+hg_id.tex: $(hg)
+	echo -n $(hg-version) > hg_id.tex
 
 clean:
 	rm -rf dist html pdf \
@@ -181,7 +190,7 @@
 		$(image-dot:%.dot=%.png) \
 		$(image-svg:%.svg=%.pdf) \
 		$(image-svg:%.svg=%.png) \
-		examples/*.{lxo,run} examples/.run build_id.tex
+		examples/*.{lxo,run} examples/.run build_id.tex hg_id.tex
 
 install: pdf split $(dist-sources)
 	rm -rf dist