# HG changeset patch # User Bryan O'Sullivan # Date 1175148117 25200 # Node ID c54f4c106fd514bcd0f87a970a0e87a4cda4dbd2 # Parent edd2acc3dbabdb4bb8b40e794d5640713c2ac057 Record the version of Mercurial used. diff -r edd2acc3dbab -r c54f4c106fd5 .hgignore --- 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 diff -r edd2acc3dbab -r c54f4c106fd5 en/00book.tex --- 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 diff -r edd2acc3dbab -r c54f4c106fd5 en/Makefile --- 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