Search code examples
mercurialtortoisehg

Mercurial - View all changesets that modify specific line in file


Annotate gets you as far as seeing the most recent change to that line, if that change is a merge then I have no choice but to trawl through the revision history and find the next time it was modified.

I've also tried hg grep -l '[contents of line]' but:

  • a) I can't figure out how to target specific files (so it takes forever in a moderately sized repo)
  • b) It seems to only return the last revision number

The following link is vaguely similar - How to find all changsets where a reference to a function was modified?


Solution

  • Use Tortoisehg:

    1. View -> Manifest
    2. Right click on file interested in and click "File History"
    3. click "annotate with revision numbers"

    The top panel allows you to quickly see the history of the file in terms of commits, the bottom panel shows the annotated file based upon the selected version in the top panel.