Patchwork check-commit: add an automatic testing of all draft changesets under "."

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 6, 2014, 8:43 a.m.
Message ID <1932f430cb117d77b626.1407314604@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5294/
State Superseded
Headers show

Comments

Pierre-Yves David - Aug. 6, 2014, 8:43 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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).
Matt Mackall - Aug. 6, 2014, 4:54 p.m.
On Wed, 2014-08-06 at 01:43 -0700, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@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.

Patch

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