Patchwork check-commit: add a test for the patch checking script in contrib

login
register
mail settings
Submitter Pierre-Yves David
Date Dec. 11, 2015, 12:24 p.m.
Message ID <800add99f4a243dec945.1449836663@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/11974/
State Accepted
Headers show

Comments

Pierre-Yves David - Dec. 11, 2015, 12:24 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1449836486 0
#      Fri Dec 11 12:21:26 2015 +0000
# Node ID 800add99f4a243dec945102c767016ece33f533b
# Parent  42aa0e570eaa364a622bc4443b0bcb79b1100a58
# Available At http://hg.netv6.net/marmoute-wip/mercurial/
#              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r 800add99f4a2
check-commit: add a test for the patch checking script in contrib

This introduces a test for the change introduced in 8f5735b4aca5.
Augie Fackler - Dec. 11, 2015, 4:16 p.m.
On Fri, Dec 11, 2015 at 12:24:23PM +0000, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1449836486 0
> #      Fri Dec 11 12:21:26 2015 +0000
> # Node ID 800add99f4a243dec945102c767016ece33f533b
> # Parent  42aa0e570eaa364a622bc4443b0bcb79b1100a58
> # Available At http://hg.netv6.net/marmoute-wip/mercurial/
> #              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r 800add99f4a2
> check-commit: add a test for the patch checking script in contrib

Sure, queued.

>
> This introduces a test for the change introduced in 8f5735b4aca5.
>
> diff --git a/tests/test-contrib-check-commit.t b/tests/test-contrib-check-commit.t
> new file mode 100644
> --- /dev/null
> +++ b/tests/test-contrib-check-commit.t
> @@ -0,0 +1,28 @@
> +Test the 'check-commit' script
> +==============================
> +
> +Test long lines in header (should not be reported as too long description)
> +
> +  $ cat > patch-with-long-header.diff << EOF
> +  > # HG changeset patch
> +  > # User timeless <timeless@mozdev.org>
> +  > # Date 1448911706 0
> +  > #      Mon Nov 30 19:28:26 2015 +0000
> +  > # Node ID c41cb6d2b7dbd62b1033727f8606b8c09fc4aa88
> +  > # Parent  42aa0e570eaa364a622bc4443b0bcb79b1100a58
> +  > # ClownJoke This is a veryly long header that should not be warned about because its not the description
> +  > transplant: use Oxford comma
> +  >
> +  > diff --git a/hgext/transplant.py b/hgext/transplant.py
> +  > --- a/hgext/transplant.py
> +  > +++ b/hgext/transplant.py
> +  > @@ -599,7 +599,7 @@
> +  >              return
> +  >          if not (opts.get('source') or revs or
> +  >                  opts.get('merge') or opts.get('branch')):
> +  > -            raise error.Abort(_('no source URL, branch revision or revision '
> +  > +            raise error.Abort(_('no source URL, branch revision, or revision '
> +  >                                 'list provided'))
> +  >          if opts.get('all'):
> +  > EOF
> +  $ cat patch-with-long-header.diff | $TESTDIR/../contrib/check-commit
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/tests/test-contrib-check-commit.t b/tests/test-contrib-check-commit.t
new file mode 100644
--- /dev/null
+++ b/tests/test-contrib-check-commit.t
@@ -0,0 +1,28 @@ 
+Test the 'check-commit' script
+==============================
+
+Test long lines in header (should not be reported as too long description)
+
+  $ cat > patch-with-long-header.diff << EOF
+  > # HG changeset patch
+  > # User timeless <timeless@mozdev.org>
+  > # Date 1448911706 0
+  > #      Mon Nov 30 19:28:26 2015 +0000
+  > # Node ID c41cb6d2b7dbd62b1033727f8606b8c09fc4aa88
+  > # Parent  42aa0e570eaa364a622bc4443b0bcb79b1100a58
+  > # ClownJoke This is a veryly long header that should not be warned about because its not the description
+  > transplant: use Oxford comma
+  > 
+  > diff --git a/hgext/transplant.py b/hgext/transplant.py
+  > --- a/hgext/transplant.py
+  > +++ b/hgext/transplant.py
+  > @@ -599,7 +599,7 @@
+  >              return
+  >          if not (opts.get('source') or revs or
+  >                  opts.get('merge') or opts.get('branch')):
+  > -            raise error.Abort(_('no source URL, branch revision or revision '
+  > +            raise error.Abort(_('no source URL, branch revision, or revision '
+  >                                 'list provided'))
+  >          if opts.get('all'):
+  > EOF
+  $ cat patch-with-long-header.diff | $TESTDIR/../contrib/check-commit