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

Augie Fackler raf at durin42.com
Thu Aug 7 08:52:58 CDT 2014


On Wed, Aug 06, 2014 at 03:23:53PM -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 5595ac2ca511b66bc17279f3e4fb04d845a08a46
> # Parent  1274ff3f20a803fbf665182fa40182cfd2deeb41
> check-commit: add an automatic testing of all draft changesets under "."

Maybe clearer as:

test-check-commit-hg.t: automatically test all 'draft() and ::.' changesets

I'm +0 on the idea.

>
> 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).
>
> 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,26 @@
> +#require test-repo
> +
> +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/..
> +
> +  $ for node in $(hg log --rev 'draft() and ::.' --template '{node|short}\n'); do
> +  >    hg export $node | contrib/check-commit > ${TESTTMP}/check-commit.out
> +  >    if [ $? -ne 0 ]; then
> +  >        echo "Revision $node does not comply to commit message rules"
> +  >        echo '------------------------------------------------------'
> +  >        cat ${TESTTMP}/check-commit.out
> +  >        echo
> +  >   fi
> +  > done
> +
> +
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list