Finding the author of a line of code in Mercurial

If you are using TortoiseHG

hgtk annotate <filename>

Or by finding the file in the log, rightclicking it and selecting "Annotate file"


On the command-line, you'd want to use hg annotate -u (-u can be combined with -n to get the local revision number, which might come in useful). Check hg help anno for more options.


I was a fan of "svn blame", so I've added to my ~/.hgrc:

[alias]
blame = annotate --user --number

so I can just type "hg blame" ;-)

Tags:

Mercurial