This is actually quite doable with hg grep . The example speaks for itself:
$ hg grep 'def revrange' --all mercurial/cmdutil.py:14319:-:def revrange(repo, revs): mercurial/scmutil.py:14319:+:def revrange(repo, revs): mercurial/cmdutil.py:3707:-:def revrange(ui, repo, revs): mercurial/cmdutil.py:3707:+:def revrange(repo, revs): mercurial/cmdutil.py:3090:+:def revrange(ui, repo, revs): mercurial/commands.py:3090:-:def revrange(ui, repo, revs): mercurial/commands.py:2331:-:def revrange(ui, repo, revs, revlog=None): mercurial/commands.py:2331:+:def revrange(ui, repo, revs): mercurial/commands.py:705:-:def revrange(ui, repo, revs = [], revlog = None): mercurial/commands.py:705:+:def revrange(ui, repo, revs, revlog=None): mercurial/commands.py:697:-:def revrange(ui, repo, revs = [], revlog = None): mercurial/commands.py:697:+:def revrange(ui, repo, revs, revlog=None): mercurial/commands.py:580:+:def revrange(ui, repo, revs = [], revlog = None):
I asked hg find def revrange (function definition). Combined with the --all flag on grep , this prints each revision that contains a change in compliance state.
Thus, we can easily see the evolution of this function:
- it was first introduced in edition 580, in
commands.py - 697 removed the default argument revs
- 705 seems like a merger
- 2331 removed the argument revlog
- 3090 moved the function to
cmdutil.py - 3707 deleted the argument ui
- and finally 14319 moved the function to
scmutil.py
Of course, this is not ideal, because if the function was renamed, the chain will end after renaming. But depending on your particular use case, this may be enough.
To be more complex, you can write a relatively simple script that can even perform renames.