ANN/RFC: extension that shows evolution of a range of lines in a file

Greg Ward greg-hg at gerg.ca
Wed Apr 14 20:19:34 CDT 2010


On Wed, Apr 14, 2010 at 3:45 PM, Peter Arrenbrecht
<peter.arrenbrecht at gmail.com> wrote:
> I wrote a little extension that shows you the evolution (or maybe
> devolution as it's backwards currently) of a range of lines in a file.
> As an example, you can find the evolution of checkbranch() in
> localrepo.py below. The extension is attached.

Cool.  Very cool.  I think you need to first run it some code that you
know very well, then you can understand what it's doing in order to
run on code that you *don't* know so well.  ;-)

A couple of random thoughts...

  * you'll never pick delimiters that please everyone all the time, so
maybe you should
     add a --delim option to override the default "==================="

  * come to think of it, is it essential to repeat the delimiter after
the log entry?
    wouldn't it be enough to output e.g.

    <chunk i-1 of file data>
    ===============
    changeset: ...
    branch: ...
    parent: ...
    user: ...
    date: ...
    summary:   ...

    <chunk i of file data>
    ===============
    [...]

  With a one-line summary, then the blank line should enough of a cue
to tell the
  reader "log is over, here's the data".  I think.

  * for the "working copy", it would be nice to show "hg id -i"-style
output, i.e. changeset ID
    with "+" for local changes

Neat!

Greg


More information about the Mercurial mailing list