[PATCH 3 of 3 V2] revset: add a changes(file, fromline, toline[, rev]) revset

Danek Duvall danek.duvall at oracle.com
Wed Dec 28 14:59:56 EST 2016


Denis Laxalde wrote:

> # HG changeset patch
> # User Denis Laxalde <denis.laxalde at logilab.fr>
> # Date 1480086890 -3600
> #      Fri Nov 25 16:14:50 2016 +0100
> # Node ID 5e5ec2ade2cfc829cffba145193da5801c5b20e7
> # Parent  c8dfd10c5865cfe882a00595743f3f709f41317f
> # EXP-Topic linerange-log/revset
> revset: add a changes(file, fromline, toline[, rev]) revset

What's the use-case for this?  Being able to track changes to some sort of
syntax block (like a function, paragraph, etc) seems far more valuable than
a fixed line range (albeit substantially more difficult to implement).

> +  $ hg log -r 'changes(baz, 2, 40)'
> +  abort: line range exceeds file size
> +  [255]

This test seems a bit odd, since a file might change its size over time,
and you might want to track lines 2-40, even though the file might not have
at least 40 lines over the course of its history.

Perhaps the revset simply needs more user-facing documentation for those of
us without enough imagination?

Danek


More information about the Mercurial-devel mailing list