Show More
@@ -1,7 +1,7 b'' | |||
|
1 | 1 | Test the 'check-commit' script |
|
2 | 2 | ============================== |
|
3 | 3 | |
|
4 | Test long lines in header (should not be reported as too long description) | |
|
4 | A fine patch: | |
|
5 | 5 | |
|
6 | 6 | $ cat > patch-with-long-header.diff << EOF |
|
7 | 7 | > # HG changeset patch |
@@ -11,7 +11,36 b' Test long lines in header (should not be' | |||
|
11 | 11 | > # Node ID c41cb6d2b7dbd62b1033727f8606b8c09fc4aa88 |
|
12 | 12 | > # Parent 42aa0e570eaa364a622bc4443b0bcb79b1100a58 |
|
13 | 13 | > # ClownJoke This is a veryly long header that should not be warned about because its not the description |
|
14 |
> |
|
|
14 | > bundle2: use Oxford comma (issue123) (BC) | |
|
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 | > | |
|
28 | > + def blahblah(x): | |
|
29 | > + pass | |
|
30 | > EOF | |
|
31 | $ cat patch-with-long-header.diff | $TESTDIR/../contrib/check-commit | |
|
32 | ||
|
33 | A patch with lots of errors: | |
|
34 | ||
|
35 | $ cat > patch-with-long-header.diff << EOF | |
|
36 | > # HG changeset patch | |
|
37 | > # User timeless | |
|
38 | > # Date 1448911706 0 | |
|
39 | > # Mon Nov 30 19:28:26 2015 +0000 | |
|
40 | > # Node ID c41cb6d2b7dbd62b1033727f8606b8c09fc4aa88 | |
|
41 | > # Parent 42aa0e570eaa364a622bc4443b0bcb79b1100a58 | |
|
42 | > # ClownJoke This is a veryly long header that should not be warned about because its not the description | |
|
43 | > transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244) | |
|
15 | 44 | > |
|
16 | 45 | > diff --git a/hgext/transplant.py b/hgext/transplant.py |
|
17 | 46 | > --- a/hgext/transplant.py |
@@ -26,3 +55,57 b' Test long lines in header (should not be' | |||
|
26 | 55 | > if opts.get('all'): |
|
27 | 56 | > EOF |
|
28 | 57 | $ cat patch-with-long-header.diff | $TESTDIR/../contrib/check-commit |
|
58 | 7: (BC) needs to be uppercase | |
|
59 | transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244) | |
|
60 | 7: no space allowed between issue and number | |
|
61 | transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244) | |
|
62 | 7: use (issueDDDD) instead of bug | |
|
63 | transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244) | |
|
64 | 1: username is not an email address | |
|
65 | # User timeless | |
|
66 | 7: summary keyword should be most user-relevant one-word command or topic | |
|
67 | transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244) | |
|
68 | 7: summary line too long (limit is 78) | |
|
69 | transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244) | |
|
70 | [1] | |
|
71 | ||
|
72 | A patch with other errors: | |
|
73 | ||
|
74 | $ cat > patch-with-long-header.diff << EOF | |
|
75 | > # HG changeset patch | |
|
76 | > # User timeless | |
|
77 | > # Date 1448911706 0 | |
|
78 | > # Mon Nov 30 19:28:26 2015 +0000 | |
|
79 | > # Node ID c41cb6d2b7dbd62b1033727f8606b8c09fc4aa88 | |
|
80 | > # Parent 42aa0e570eaa364a622bc4443b0bcb79b1100a58 | |
|
81 | > # ClownJoke This is a veryly long header that should not be warned about because its not the description | |
|
82 | > This has no topic and ends with a period. | |
|
83 | > | |
|
84 | > diff --git a/hgext/transplant.py b/hgext/transplant.py | |
|
85 | > --- a/hgext/transplant.py | |
|
86 | > +++ b/hgext/transplant.py | |
|
87 | > @@ -599,7 +599,7 @@ | |
|
88 | > if opts.get('all'): | |
|
89 | > | |
|
90 | > + | |
|
91 | > + def blah_blah(x): | |
|
92 | > + pass | |
|
93 | > + | |
|
94 | > | |
|
95 | > EOF | |
|
96 | $ cat patch-with-long-header.diff | $TESTDIR/../contrib/check-commit | |
|
97 | 1: username is not an email address | |
|
98 | # User timeless | |
|
99 | 7: summary line doesn't start with 'topic: ' | |
|
100 | This has no topic and ends with a period. | |
|
101 | 7: don't capitalize summary lines | |
|
102 | This has no topic and ends with a period. | |
|
103 | 7: don't add trailing period on summary line | |
|
104 | This has no topic and ends with a period. | |
|
105 | 19: adds double empty line | |
|
106 | ||
|
107 | 15: adds double empty line | |
|
108 | + | |
|
109 | 16: adds a function with foo_bar naming | |
|
110 | + def blah_blah(x): | |
|
111 | [1] |
General Comments 0
You need to be logged in to leave comments.
Login now