[PATCH 2 of 2] tests: replace parents with log revset RFC

Yuya Nishihara yuya at tcha.org
Tue Dec 29 22:57:03 CST 2015


On Wed, 23 Dec 2015 13:57:08 -0600, timeless wrote:
> # HG changeset patch
> # User timeless <timeless at mozdev.org>
> # Date 1450889771 0
> #      Wed Dec 23 16:56:11 2015 +0000
> # Node ID 829cb9e4e735b1ab2dfb3de5812d669c74b12c38
> # Parent  362b7b756dbc8e6e3fc7dfbcc8f0e7cc2fcc6955
> tests: replace parents with log revset RFC
> 
> Since `hg parents` is deprecated, we should avoid using it
> in general testing.
> 
> This changeset does a complete replacement of `hg parent(s)`
> outside of test-parents.t, according to the documentation
> from `hg help parents`.
> 
> Note that in many cases there is no p2() necessary for the test,
> it would be reasonable for those tests to be "optimized" to not
> include p2(), but that's left as an exercise for a later date.

I agree we should use "hg log" instead of "hg parents", but bulk-replacing
them would make tests less readable. I guess most of them just want
"parents()". And "max(::p1() and file()) + max(::p2() and file())" seems
obfuscated.


More information about the Mercurial-devel mailing list