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