Advices on Mercurial history search

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Advices on Mercurial history search

Pantxo
Hi,

I have recently submitted a patch in which I removed a piece code that prevents "drawnow" from being executed recursively. I realize that this piece of code may have been here for some good reason and I would like to know when it was added, by who and why.

Now comes the precise question: is there any magic "hg log XXX" call that would let me find the specific changeset in which current lines N to N+M  were added to graphics.cc?

Thanks in advance,

Pantxo
Reply | Threaded
Open this post in threaded view
|

Re: Advices on Mercurial history search

Mike Miller-4
On Tue, Sep 25, 2018 at 17:40:04 +0200, Pantxo Diribarne wrote:
> Now comes the precise question: is there any magic "hg log XXX" call that
> would let me find the specific changeset in which current lines N to N+M
> were added to graphics.cc?

I typically use 'hg grep --all ${pattern}' to search for when a
particular comment or line of code was added. Or if I am only looking at
a particular file, I may use 'hg log -p ${file}' and search
interactively using less.

I have not had much luck with 'hg blame' on the Octave code tree because
there are often many changes in organization, indentation, formatting,
and spelling lying between the head and the actual change I am
interested in.

--
mike

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Advices on Mercurial history search

Pantxo
Mike Miller-4 wrote

> On Tue, Sep 25, 2018 at 17:40:04 +0200, Pantxo Diribarne wrote:
>> Now comes the precise question: is there any magic "hg log XXX" call that
>> would let me find the specific changeset in which current lines N to N+M
>> were added to graphics.cc?
>
> I typically use 'hg grep --all ${pattern}' to search for when a
> particular comment or line of code was added. Or if I am only looking at
> a particular file, I may use 'hg log -p ${file}' and search
> interactively using less.
>
> I have not had much luck with 'hg blame' on the Octave code tree because
> there are often many changes in organization, indentation, formatting,
> and spelling lying between the head and the actual change I am
> interested in.
>
> --
> mike
>
>
> signature.asc (849 bytes)
> <http://octave.1599824.n4.nabble.com/attachment/4689482/0/signature.asc>

The "hg blame" method happened to work very well here because the specific
line was there untouched from the very begining of Fdrawnow. Anyway, I'll
note those methods in my hg apprentice book as well :-).

Thanks,

Pantxo



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-Maintainers-f1638794.html

Reply | Threaded
Open this post in threaded view
|

Re: Advices on Mercurial history search

Jordi Gutiérrez Hermoso-2
In reply to this post by Mike Miller-4
On Tue, 2018-09-25 at 10:54 -0700, Mike Miller wrote:
> I have not had much luck with 'hg blame' on the Octave code tree because
> there are often many changes in organization, indentation, formatting,
> and spelling lying between the head and the actual change I am
> interested in.

I use a couple of tricks for those cases.

First there's `hg ann -w somefile` that ignores whitespace changes. I
then look at the commit in question via `hg log -pvr $revnum`.

If I arrive at a line that happens to nevertheless be the result of a
trivial change, I then look at the annotation again, but starting from
one commit before the trivial change, e.g. `hg ann -wr $revnum^` (note
the caret to annotate the parent revision before the trivial commit).

signature.asc (849 bytes) Download Attachment