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

Jun Wu quark at fb.com
Fri Dec 2 10:30:20 EST 2016


Excerpts from Yuya Nishihara's message of 2016-12-02 23:19:56 +0900:
> On Fri, 2 Dec 2016 08:38:53 +0100, Denis Laxalde wrote:
> > Yuya Nishihara a écrit :
> > > On Mon, 28 Nov 2016 11:12:35 +0100, Denis Laxalde wrote:
> > >> Denis Laxalde a écrit :
> > >>> # HG changeset patch
> > >>> # User Denis Laxalde <denis.laxalde at logilab.fr>
> > >>> # Date 1480086890 -3600
> > >>> #      Fri Nov 25 16:14:50 2016 +0100
> > >>> # Node ID e88a112076294d9b1639a486e7ef0ec9c1ffa660
> > >>> # Parent  6dd93ae7b35002531308444c87dcf47beb773648
> > >>> # EXP-Topic linerange-log/revset
> > >>> revset: add a changes(file, fromline, toline[, rev]) revset
> > >>
> > >> This is the first step of my work (in progress) about adding a "line
> > >> range" filtering for log discussed in
> > >> https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-October/088687.html .
> > >>
> > >> I would have liked to add tests for this revset but it seems to me that
> > >> the current test repositories are not complex enough for this: I'd need
> > >> files with significant content and changes in this content. Any idea how
> > >> I could do this?
> > >
> > > Maybe we can share some bits with test-annotate.t ?
> > 
> > Repositories in these are indeed more complex. So should I append tests
> > in this file or reproduce similar repositories in test-revset.t?
> 
> I *think* adding tests to test-annotate.t is okay since the behavior of
> changes() revset is somewhat similar to annotate.
> 
> Jun might have more data sets for his fastannotate extension?

fastannotate basically reuses the original annotate test cases for the core
algorithm, and with some additional tests about extra features like
wireprotocol, --deleted etc.

Because fastannotate works differently from the vanilla algorithm: it tracks
'!' blocks instead of '=' blocks and it deals with p1 and p2 differently,
the output is slightly different:

bitbucket.org/facebook/hg-experimental/src/27a94a/tests/test-fastannotate-hg.t?#test-fastannotate-hg.t-229
bitbucket.org/facebook/hg-experimental/src/27a94a/tests/test-fastannotate-hg.t?#test-fastannotate-hg.t-324

With the recent bdiff change, fastannotate became more different from the
vanilla annotate:

https://bitbucket.org/facebook/hg-experimental/commits/11c9b13fc1ef778c5636ac04e3812a06c0e4a08f


More information about the Mercurial-devel mailing list