View all revision numbers that made changes to a particular file in Mercurial

git, mercurial

Solution

Use the template system in Mercurial. To get the revision number for the file `README` you'll do:

hg log --template '{rev}\n' README

If you need the changeset hashes instead, then it's:

hg log --template '{node|short}\n' README

See `hg help templating` for more help. You can find the same help online (search for "Template Usage").

Problem

I would like to see all revision numbers that made any changes to a particular file. The output should look like follows: ``` 20 27 59 ``` If it is not possible, is it possible with Git? Thank you.

Original source