Question about Source Control

Chris Angelico rosuav at
Fri Mar 21 23:17:07 CET 2014

On Sat, Mar 22, 2014 at 8:32 AM, Cameron Simpson <cs at> wrote:
> Basicly, run "hg log" for the file, and examine each of the diffs
> WRT to your target line.
> Refactoring raises the bar somewhat.

Here's one where git and hg are a lot more different.

When I'm trying to find the origin of some line of code in a git repo,
I often make a dummy edit to it, then pull up gitk, right-click the
red "deleted" line, and hit "Show origin of this line". This will
select the commit that introduced that one line, without annotating
the whole rest of the file (often a slow job, especially on a big
file), and then I can go from the green inserted line to the
corresponding red deleted line and repeat the exercise (eg if some
trivial change was made, like renaming something). I'm trying that
workflow with "hg view", the nearest equivalent to gitk, but it's way
slower and doesn't seem to have a right-click menu at all, so I'm not
sure this is possible. Is there a convenient way to trace the origin
of one line back through a few commits?


More information about the Python-list mailing list