Show More
@@ -1,139 +1,135 | |||||
1 | Test the 'check-commit' script |
|
1 | Test the 'check-commit' script | |
2 | ============================== |
|
2 | ============================== | |
3 |
|
3 | |||
4 | A fine patch: |
|
4 | A fine patch: | |
5 |
|
5 | |||
6 | $ cat > patch-with-long-header.diff << EOF |
|
6 | $ cat > patch-with-long-header.diff << EOF | |
7 | > # HG changeset patch |
|
7 | > # HG changeset patch | |
8 | > # User timeless <timeless@mozdev.org> |
|
8 | > # User timeless <timeless@mozdev.org> | |
9 | > # Date 1448911706 0 |
|
9 | > # Date 1448911706 0 | |
10 | > # Mon Nov 30 19:28:26 2015 +0000 |
|
10 | > # Mon Nov 30 19:28:26 2015 +0000 | |
11 | > # Node ID c41cb6d2b7dbd62b1033727f8606b8c09fc4aa88 |
|
11 | > # Node ID c41cb6d2b7dbd62b1033727f8606b8c09fc4aa88 | |
12 | > # Parent 42aa0e570eaa364a622bc4443b0bcb79b1100a58 |
|
12 | > # Parent 42aa0e570eaa364a622bc4443b0bcb79b1100a58 | |
13 | > # ClownJoke This is a veryly long header that should not be warned about because its not the description |
|
13 | > # ClownJoke This is a veryly long header that should not be warned about because its not the description | |
14 | > bundle2: use Oxford comma (issue123) (BC) |
|
14 | > bundle2: use Oxford comma (issue123) (BC) | |
15 | > |
|
15 | > | |
16 | > diff --git a/hgext/transplant.py b/hgext/transplant.py |
|
16 | > diff --git a/hgext/transplant.py b/hgext/transplant.py | |
17 | > --- a/hgext/transplant.py |
|
17 | > --- a/hgext/transplant.py | |
18 | > +++ b/hgext/transplant.py |
|
18 | > +++ b/hgext/transplant.py | |
19 | > @@ -599,7 +599,7 @@ |
|
19 | > @@ -599,7 +599,7 @@ | |
20 | > return |
|
20 | > return | |
21 | > if not (opts.get('source') or revs or |
|
21 | > if not (opts.get('source') or revs or | |
22 | > opts.get('merge') or opts.get('branch')): |
|
22 | > opts.get('merge') or opts.get('branch')): | |
23 | > - raise error.Abort(_('no source URL, branch revision or revision ' |
|
23 | > - raise error.Abort(_('no source URL, branch revision or revision ' | |
24 | > + raise error.Abort(_('no source URL, branch revision, or revision ' |
|
24 | > + raise error.Abort(_('no source URL, branch revision, or revision ' | |
25 | > 'list provided')) |
|
25 | > 'list provided')) | |
26 | > if opts.get('all'): |
|
26 | > if opts.get('all'): | |
27 | > |
|
27 | > | |
28 | > + def blahblah(x): |
|
28 | > + def blahblah(x): | |
29 | > + pass |
|
29 | > + pass | |
30 | > EOF |
|
30 | > EOF | |
31 | $ cat patch-with-long-header.diff | $TESTDIR/../contrib/check-commit |
|
31 | $ cat patch-with-long-header.diff | $TESTDIR/../contrib/check-commit | |
32 |
|
32 | |||
33 | This would normally be against the rules, but it's okay because that's |
|
33 | This would normally be against the rules, but it's okay because that's | |
34 | what tagging and signing looks like: |
|
34 | what tagging and signing looks like: | |
35 |
|
35 | |||
36 | $ cat > creates-a-tag.diff << EOF |
|
36 | $ cat > creates-a-tag.diff << EOF | |
37 | > # HG changeset patch |
|
37 | > # HG changeset patch | |
38 | > # User Augie Fackler <raf@durin42.com> |
|
38 | > # User Augie Fackler <raf@durin42.com> | |
39 | > # Date 1484787778 18000 |
|
39 | > # Date 1484787778 18000 | |
40 | > # Wed Jan 18 20:02:58 2017 -0500 |
|
40 | > # Wed Jan 18 20:02:58 2017 -0500 | |
41 | > # Branch stable |
|
41 | > # Branch stable | |
42 | > # Node ID c177635e4acf52923bc3aa9f72a5b1ad1197b173 |
|
42 | > # Node ID c177635e4acf52923bc3aa9f72a5b1ad1197b173 | |
43 | > # Parent a1dd2c0c479e0550040542e392e87bc91262517e |
|
43 | > # Parent a1dd2c0c479e0550040542e392e87bc91262517e | |
44 | > Added tag 4.1-rc for changeset a1dd2c0c479e |
|
44 | > Added tag 4.1-rc for changeset a1dd2c0c479e | |
45 | > |
|
45 | > | |
46 | > diff --git a/.hgtags b/.hgtags |
|
46 | > diff --git a/.hgtags b/.hgtags | |
47 | > --- a/.hgtags |
|
47 | > --- a/.hgtags | |
48 | > +++ b/.hgtags |
|
48 | > +++ b/.hgtags | |
49 | > @@ -150,3 +150,4 @@ 438173c415874f6ac653efc1099dec9c9150e90f |
|
49 | > @@ -150,3 +150,4 @@ 438173c415874f6ac653efc1099dec9c9150e90f | |
50 | > eab27446995210c334c3d06f1a659e3b9b5da769 4.0 |
|
50 | > eab27446995210c334c3d06f1a659e3b9b5da769 4.0 | |
51 | > b3b1ae98f6a0e14c1e1ba806a6c18e193b6dae5c 4.0.1 |
|
51 | > b3b1ae98f6a0e14c1e1ba806a6c18e193b6dae5c 4.0.1 | |
52 | > e69874dc1f4e142746ff3df91e678a09c6fc208c 4.0.2 |
|
52 | > e69874dc1f4e142746ff3df91e678a09c6fc208c 4.0.2 | |
53 | > +a1dd2c0c479e0550040542e392e87bc91262517e 4.1-rc |
|
53 | > +a1dd2c0c479e0550040542e392e87bc91262517e 4.1-rc | |
54 | > EOF |
|
54 | > EOF | |
55 | $ $TESTDIR/../contrib/check-commit < creates-a-tag.diff |
|
55 | $ $TESTDIR/../contrib/check-commit < creates-a-tag.diff | |
56 |
|
56 | |||
57 | A patch with lots of errors: |
|
57 | A patch with lots of errors: | |
58 |
|
58 | |||
59 | $ cat > patch-with-long-header.diff << EOF |
|
59 | $ cat > patch-with-long-header.diff << EOF | |
60 | > # HG changeset patch |
|
60 | > # HG changeset patch | |
61 | > # User timeless |
|
61 | > # User timeless | |
62 | > # Date 1448911706 0 |
|
62 | > # Date 1448911706 0 | |
63 | > # Mon Nov 30 19:28:26 2015 +0000 |
|
63 | > # Mon Nov 30 19:28:26 2015 +0000 | |
64 | > # Node ID c41cb6d2b7dbd62b1033727f8606b8c09fc4aa88 |
|
64 | > # Node ID c41cb6d2b7dbd62b1033727f8606b8c09fc4aa88 | |
65 | > # Parent 42aa0e570eaa364a622bc4443b0bcb79b1100a58 |
|
65 | > # Parent 42aa0e570eaa364a622bc4443b0bcb79b1100a58 | |
66 | > # ClownJoke This is a veryly long header that should not be warned about because its not the description |
|
66 | > # ClownJoke This is a veryly long header that should not be warned about because its not the description | |
67 | > transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244) |
|
67 | > transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244) | |
68 | > |
|
68 | > | |
69 | > diff --git a/hgext/transplant.py b/hgext/transplant.py |
|
69 | > diff --git a/hgext/transplant.py b/hgext/transplant.py | |
70 | > --- a/hgext/transplant.py |
|
70 | > --- a/hgext/transplant.py | |
71 | > +++ b/hgext/transplant.py |
|
71 | > +++ b/hgext/transplant.py | |
72 | > @@ -599,7 +599,7 @@ |
|
72 | > @@ -599,7 +599,7 @@ | |
73 | > return |
|
73 | > return | |
74 | > if not (opts.get('source') or revs or |
|
74 | > if not (opts.get('source') or revs or | |
75 | > opts.get('merge') or opts.get('branch')): |
|
75 | > opts.get('merge') or opts.get('branch')): | |
76 | > - raise error.Abort(_('no source URL, branch revision or revision ' |
|
76 | > - raise error.Abort(_('no source URL, branch revision or revision ' | |
77 | > + raise error.Abort(_('no source URL, branch revision, or revision ' |
|
77 | > + raise error.Abort(_('no source URL, branch revision, or revision ' | |
78 | > 'list provided')) |
|
78 | > 'list provided')) | |
79 | > if opts.get('all'): |
|
79 | > if opts.get('all'): | |
80 | > EOF |
|
80 | > EOF | |
81 | $ cat patch-with-long-header.diff | $TESTDIR/../contrib/check-commit |
|
81 | $ cat patch-with-long-header.diff | $TESTDIR/../contrib/check-commit | |
82 | 1: username is not an email address |
|
82 | 1: username is not an email address | |
83 | # User timeless |
|
83 | # User timeless | |
84 | 7: summary keyword should be most user-relevant one-word command or topic |
|
84 | 7: summary keyword should be most user-relevant one-word command or topic | |
85 | transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244) |
|
85 | transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244) | |
86 | 7: (BC) needs to be uppercase |
|
86 | 7: (BC) needs to be uppercase | |
87 | transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244) |
|
87 | transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244) | |
88 | 7: use (issueDDDD) instead of bug |
|
88 | 7: use (issueDDDD) instead of bug | |
89 | transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244) |
|
89 | transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244) | |
90 | 7: no space allowed between issue and number |
|
90 | 7: no space allowed between issue and number | |
91 | transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244) |
|
91 | transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244) | |
92 | 7: summary line too long (limit is 78) |
|
92 | 7: summary line too long (limit is 78) | |
93 | transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244) |
|
93 | transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244) | |
94 | [1] |
|
94 | [1] | |
95 |
|
95 | |||
96 | A patch with other errors: |
|
96 | A patch with other errors: | |
97 |
|
97 | |||
98 | $ cat > patch-with-long-header.diff << EOF |
|
98 | $ cat > patch-with-long-header.diff << EOF | |
99 | > # HG changeset patch |
|
99 | > # HG changeset patch | |
100 | > # User timeless |
|
100 | > # User timeless | |
101 | > # Date 1448911706 0 |
|
101 | > # Date 1448911706 0 | |
102 | > # Mon Nov 30 19:28:26 2015 +0000 |
|
102 | > # Mon Nov 30 19:28:26 2015 +0000 | |
103 | > # Node ID c41cb6d2b7dbd62b1033727f8606b8c09fc4aa88 |
|
103 | > # Node ID c41cb6d2b7dbd62b1033727f8606b8c09fc4aa88 | |
104 | > # Parent 42aa0e570eaa364a622bc4443b0bcb79b1100a58 |
|
104 | > # Parent 42aa0e570eaa364a622bc4443b0bcb79b1100a58 | |
105 | > # ClownJoke This is a veryly long header that should not be warned about because its not the description |
|
105 | > # ClownJoke This is a veryly long header that should not be warned about because its not the description | |
106 | > This has no topic and ends with a period. |
|
106 | > This has no topic and ends with a period. | |
107 | > |
|
107 | > | |
108 | > diff --git a/hgext/transplant.py b/hgext/transplant.py |
|
108 | > diff --git a/hgext/transplant.py b/hgext/transplant.py | |
109 | > --- a/hgext/transplant.py |
|
109 | > --- a/hgext/transplant.py | |
110 | > +++ b/hgext/transplant.py |
|
110 | > +++ b/hgext/transplant.py | |
111 | > @@ -599,7 +599,7 @@ |
|
111 | > @@ -599,7 +599,7 @@ | |
112 | > if opts.get('all'): |
|
112 | > if opts.get('all'): | |
113 | > |
|
113 | > | |
114 | > |
|
114 | > | |
115 | > + |
|
115 | > + | |
116 | > + some = otherjunk |
|
116 | > + some = otherjunk | |
117 | > + |
|
117 | > + | |
118 | > + |
|
118 | > + | |
119 | > + def blah_blah(x): |
|
119 | > + def blah_blah(x): | |
120 | > + pass |
|
120 | > + pass | |
121 | > + |
|
121 | > + | |
122 | > |
|
122 | > | |
123 | > EOF |
|
123 | > EOF | |
124 | $ cat patch-with-long-header.diff | $TESTDIR/../contrib/check-commit |
|
124 | $ cat patch-with-long-header.diff | $TESTDIR/../contrib/check-commit | |
125 | 1: username is not an email address |
|
125 | 1: username is not an email address | |
126 | # User timeless |
|
126 | # User timeless | |
127 | 7: don't capitalize summary lines |
|
127 | 7: don't capitalize summary lines | |
128 | This has no topic and ends with a period. |
|
128 | This has no topic and ends with a period. | |
129 | 7: summary line doesn't start with 'topic: ' |
|
129 | 7: summary line doesn't start with 'topic: ' | |
130 | This has no topic and ends with a period. |
|
130 | This has no topic and ends with a period. | |
131 | 7: don't add trailing period on summary line |
|
131 | 7: don't add trailing period on summary line | |
132 | This has no topic and ends with a period. |
|
132 | This has no topic and ends with a period. | |
133 | 19: adds double empty line |
|
|||
134 | + |
|
|||
135 | 20: adds a function with foo_bar naming |
|
133 | 20: adds a function with foo_bar naming | |
136 | + def blah_blah(x): |
|
134 | + def blah_blah(x): | |
137 | 23: adds double empty line |
|
|||
138 | + |
|
|||
139 | [1] |
|
135 | [1] |
General Comments 0
You need to be logged in to leave comments.
Login now