tags:

views:

171

answers:

3

How do I find out who is responsible for a specific line of code? I know the linenumber and the filename but I would like Mercurial to tell me the author(s) of that specific line of code. Is there a command for that?

+1  A: 

If you are using TortoiseHG

hgtk annotate <filename>

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

artemb
+7  A: 

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.

djc
I love how the alias to annotate is blame.
Daniel W
+4  A: 

Hi,

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" ;-)

Cheers,
Christophe.

= The future, according to some scientists, will be exactly =
= like the past, only far more expensive. --John Sladek =

Christophe Muller