martes, 13 de octubre de 2009

Stop tracking a file in Mercurial

Since I read The definitive guide to mercurial, I've been using mercurial daily at $work , and following a branch-per-feature workflow with more or less success (I'm very satisfied myself, but I keep forgetting the commands).

Today I took a project I was coding some time ago, and when I did my first commit... I saw mercurial was tracking a binary file I didn't particularly wanted to track (some temporal .o in CMakeFiles dir).

Here's what I did to untrack ChironEA.o file:

rgrau@ares [ ~/chiron ] %hg commit -m "FooBarBazQuux added"
rgrau@ares [ ~/chiron ] %hg vi
rgrau@ares [ ~/chiron ] %hg rollback
rolling back last transaction
rgrau@ares [ ~/chiron ] %hg remove src/CMakeFiles/ChironEA.dir/ChironEA.o
not removing src/CMakeFiles/ChironEA.dir/ChironEA.o: file is modified (use -f to force removal)
rgrau@ares [ ~/chiron ] %hg remove -f src/CMakeFiles/ChironEA.dir/ChironEA.o
removing src/CMakeFiles/ChironEA.dir/ChironEA.o
rgrau@ares [ ~/chiron ] %hg commit -m "FooBarBazQuux added"

Little by little, it seems I'm starting to do things the right way (tm).

Btw, I've packaged latest mercurial version for vectorlinux (yeah, that little fast distro I happen to use and recommend)