Monday, October 17, 2011

Mercurial get a single file

If you'd like to get back a single file (file.txt) from a previous revision (23456) in mercurial, the command is:


hg revert -r 23456 file.txt

Friday, October 7, 2011

make variables

When writing make rules, there's a certain set of vital cryptic syntax that is impossible to remember.

It always takes ages to find the definitions of these damned things which are unaccountably hidden deep in the manual, or remember what they're called, even though they're the one thing you always need when writing a makefile.

Make Automatic Variables

$@ target

$< first prerequisite

$^ all prerequisites

$* the stem from the pattern match in an implicit rule

These are the four that you always use, more can be found at:
http://www.gnu.org/s/hello/manual/make/Automatic-Variables.html#Automatic-Variables