comparison tests/test-contrib-check-commit.t @ 27328:96dc6664fa9c

check-commit: add a test for the patch checking script in contrib This introduces a test for the change introduced in 8f5735b4aca5.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 11 Dec 2015 12:21:26 +0000
parents
children 374fad80ce69
comparison
equal deleted inserted replaced
27327:d500341e4f55 27328:96dc6664fa9c
1 Test the 'check-commit' script
2 ==============================
3
4 Test long lines in header (should not be reported as too long description)
5
6 $ cat > patch-with-long-header.diff << EOF
7 > # HG changeset patch
8 > # User timeless <timeless@mozdev.org>
9 > # Date 1448911706 0
10 > # Mon Nov 30 19:28:26 2015 +0000
11 > # Node ID c41cb6d2b7dbd62b1033727f8606b8c09fc4aa88
12 > # Parent 42aa0e570eaa364a622bc4443b0bcb79b1100a58
13 > # ClownJoke This is a veryly long header that should not be warned about because its not the description
14 > transplant: use Oxford comma
15 >
16 > diff --git a/hgext/transplant.py b/hgext/transplant.py
17 > --- a/hgext/transplant.py
18 > +++ b/hgext/transplant.py
19 > @@ -599,7 +599,7 @@
20 > return
21 > if not (opts.get('source') or revs or
22 > opts.get('merge') or opts.get('branch')):
23 > - raise error.Abort(_('no source URL, branch revision or revision '
24 > + raise error.Abort(_('no source URL, branch revision, or revision '
25 > 'list provided'))
26 > if opts.get('all'):
27 > EOF
28 $ cat patch-with-long-header.diff | $TESTDIR/../contrib/check-commit