[PATCH 2 of 2] tests: simplify and clarify test-obsolete-bundle-strip.t a little
Martin von Zweigbergk
martinvonz at google.com
Sat Jun 3 12:01:14 EDT 2017
On Jun 3, 2017 8:22 AM, "Yuya Nishihara" <yuya at tcha.org> wrote:
On Sat, 03 Jun 2017 00:35:19 -0700, Martin von Zweigbergk via
Mercurial-devel wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz at google.com>
> # Date 1496469903 25200
> # Fri Jun 02 23:05:03 2017 -0700
> # Node ID ff06148cbf34428d71bd7ea9d2e31fa806686417
> # Parent f782e04fb7d18868cf7da00a41aaa8f15c8e8802
> tests: simplify and clarify test-obsolete-bundle-strip.t a little
>
> diff --git a/tests/test-obsolete-bundle-strip.t
b/tests/test-obsolete-bundle-strip.t
> --- a/tests/test-obsolete-bundle-strip.t
> +++ b/tests/test-obsolete-bundle-strip.t
> @@ -76,8 +76,8 @@
> > echo '### Exclusive markers ###'
> > cat "${exclufile}"
> > # if the matched revs do not have children, we also check the
result of strip
> - > orphan=`hg log --hidden -T '.\n' --rev "(not (${revs})) and
(${revs}::)" | wc -l | sed -e 's/ //g'`
> - > if [ $orphan -eq 0 ];
> + > children=`hg log --hidden -T . --rev "(${revs}::) - (${revs})" |
wc -c`
> + > if [ $children -eq 0 ];
Perhaps this can be simplified further. drop "wc -c" and test [ -z
"$children" ].
Yes, I considered that but thought that maybe Pierre-Yves wanted the faster
'.' template. But that's a pretty silly optimization to do in a test, so
I'll do as you suggested in the next version.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20170603/3ecec8ae/attachment.html>
More information about the Mercurial-devel
mailing list