Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'exercise': 0.04; 'syntax': 0.04; 'anyway.': 0.05; 'revision': 0.07; 'subject:Question': 0.07; '22,': 0.09; 'git': 0.09; 'inserted': 0.09; 'mercurial': 0.09; 'raises': 0.09; 'subject:Source': 0.09; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'made,': 0.16; 'message-id:@cskk.homeip.net': 0.16; 'nearest': 0.16; 'received:cskk.homeip.net': 0.16; 'received:homeip.net': 0.16; 'refactoring': 0.16; 'renaming': 0.16; 'right-click': 0.16; 'simpson': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'all,': 0.19; 'trying': 0.19; 'commit': 0.19; 'file,': 0.19; 'select': 0.22; 'to:name:python-list@python.org': 0.22; 'header:User-Agent:1': 0.23; 'case.': 0.24; 'convenient': 0.24; 'cheers,': 0.24; 'question': 0.24; 'equivalent': 0.26; 'extension': 0.26; 'header :In-Reply-To:1': 0.27; 'rest': 0.29; 'chris': 0.29; 'am,': 0.29; "doesn't": 0.30; 'list:': 0.30; 'especially': 0.30; "i'm": 0.30; 'url:mailman': 0.30; 'code': 0.31; 'getting': 0.31; 'origin': 0.31; 'trace': 0.31; 'trivial': 0.31; 'file': 0.32; 'know.': 0.32; 'run': 0.32; 'brian': 0.33; 'possible.': 0.35; 'tool': 0.35; 'something': 0.35; 'but': 0.35; 'there': 0.35; 'url:listinfo': 0.36; 'charset:us-ascii': 0.36; 'to:addr:python-list': 0.38; 'use.': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'applicable': 0.60; 'expression': 0.60; 'introduced': 0.61; 'matter': 0.61; 'back': 0.62; 'content-disposition:inline': 0.62; 'kind': 0.63; 'more': 0.64; 'mar': 0.68; 'line,': 0.68; 'repeat': 0.74; 'different.': 0.84; 'received:192.168.15': 0.84; 'subject:Control': 0.84; 'thing,': 0.91; 'examine': 0.93 Date: Sat, 22 Mar 2014 13:49:33 +1100 From: Cameron Simpson To: "python-list@python.org" Subject: Re: Question about Source Control MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) References: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 43 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1395456594 news.xs4all.nl 2959 [2001:888:2000:d::a6]:33953 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:68734 On 22Mar2014 09:17, Chris Angelico wrote: > On Sat, Mar 22, 2014 at 8:32 AM, Cameron Simpson 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. You might find it is just a matter of knowing what tool to use. > 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? I don't know. You might do better to ask this kind of question on the mercurial list: http://selenic.com/mailman/listinfo/mercurial Someone there is bound to have wanted to do this kind of thing, and may know if there's a tool or extension that makes it easy. There's a whole expression syntax for getting mercurial to select from the revision tree, for example; I do not know if it is applicable in this case. Cheers, -- Cameron Simpson Do what you think is interesting, do something that you think is fun and worthwhile, because otherwise you won't do it well anyway. - Brian Kernighan