[PATCH][RFC] Support for keyword expansion

Thomas Arendsen Hein thomas at intevation.de
Thu Sep 29 09:20:06 CDT 2005


* Bryan O'Sullivan <bos at serpentine.com> [20050920 18:38]:
> On Tue, 2005-09-20 at 18:20 +0200, Goffredo Baroncelli wrote:
> Put something like this in a Makefile:
> 
> .PHONY: hg_changeset.c
> 
> hg_changeset.c:
> 	hg tip -q | sed 's,.*:\(.*\),const char *hg_changeset = "@cset \1" + 6;,' > $@

Better use 'hg id' to get the hash, otherwise you might get the
wrong hash because you haven't checked out tip or modified a file:

.PHONY: hg_changeset.c

hg_changeset.c:
	echo "const char *hg_changeset = \"@cset `hg id -q`\" + 6;" > "$@"

Thomas

-- 
Email: thomas at intevation.de
http://intevation.de/~thomas/


More information about the Mercurial mailing list