[PATCH 2 of 2] tests: simplify and clarify test-obsolete-bundle-strip.t a little

Yuya Nishihara yuya at tcha.org
Sat Jun 3 11:21:52 EDT 2017


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" ].


More information about the Mercurial-devel mailing list