[PATCH] check-commit: add an automatic testing of all draft changesets under "."

Matt Mackall mpm at selenic.com
Wed Aug 6 11:54:46 CDT 2014


On Wed, 2014-08-06 at 01:43 -0700, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at fb.com>
> # Date 1407314451 25200
> #      Wed Aug 06 01:40:51 2014 -0700
> # Node ID 1932f430cb117d77b6269dea84e2387a17062828
> # Parent  1274ff3f20a803fbf665182fa40182cfd2deeb41
> check-commit: add an automatic testing of all draft changesets under "."
> 
> We introduce a test-check-commit-hg.t file that will happily run the
> check-commit file on all draft changeset under the working directory.
> 
> This should help newcomers to catch up with the rules. (And will helps old timer
> from time to time).

I guess.

> diff --git a/tests/test-check-commit-hg.t b/tests/test-check-commit-hg.t
> new file mode 100644
> --- /dev/null
> +++ b/tests/test-check-commit-hg.t
> @@ -0,0 +1,25 @@
> +
> +
> +Enable obsolescence to avoid the warning issue when obsmarker are found
> +
> +  $ cat > obs.py << EOF
> +  > import mercurial.obsolete
> +  > mercurial.obsolete._enabled = True
> +  > EOF
> +  $ echo '[extensions]' >> $HGRCPATH
> +  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
> +
> +Go back in the hg repo
> +
> +  $ cd $TESTDIR
> +
> +Check if it is a repository
> +
> +  $ test -d ../.hg/ || exit 80

This is now #if test-repo. Wait.. [hack hack..] this is now #require
test-repo.

> +  $ cd ..
> +
> +  $ for rev in $(hg log --rev 'draft() and ::.' --template '{rev}\n'); do
> +  >    HG_NODE=$rev contrib/check-commit

You can also do: hg export $rev | contrib/check-commit

Should probably check the exit code to report which revision is failing.

If we don't care about showing revisions, you can instead do:

 hg export "draft() and ::." | contrib/check-commit

..and check them all in one go.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list