sreda, 7. november 2012

Find where code was changed in Mercurial

If you want to find out in which revisions a piece of code was changed then you can use a Mercurial command something like this:

hg grep --all PIECE_OF_CODE | awk 'BEGIN {FS=":"} {print $1" "$2}' | uniq
and you will get back a list of files with coresponding revisuin numbers:
repo/src/java/com/kovica/File1.java 30
repo/src/java/com/kovica/File1.java 10

Ni komentarjev: