##// END OF EJS Templates
diffhelpers: allow clang-format oversight...
Augie Fackler -
r36074:7f8338b8 default
parent child Browse files
Show More
@@ -3,7 +3,6 b''
3 3 mercurial/cext/base85.c
4 4 mercurial/cext/charencode.c
5 5 mercurial/cext/charencode.h
6 mercurial/cext/diffhelpers.c
7 6 mercurial/cext/dirs.c
8 7 mercurial/cext/manifest.c
9 8 mercurial/cext/mpatch.c
@@ -16,7 +16,6 b''
16 16 static char diffhelpers_doc[] = "Efficient diff parsing";
17 17 static PyObject *diffhelpers_Error;
18 18
19
20 19 /* fixup the last lines of a and b when the patch has no newline at eof */
21 20 static void _fix_newline(PyObject *hunk, PyObject *a, PyObject *b)
22 21 {
@@ -50,8 +49,7 b' static void _fix_newline(PyObject *hunk,'
50 49 }
51 50
52 51 /* python callable form of _fix_newline */
53 static PyObject *
54 fix_newline(PyObject *self, PyObject *args)
52 static PyObject *fix_newline(PyObject *self, PyObject *args)
55 53 {
56 54 PyObject *hunk, *a, *b;
57 55 if (!PyArg_ParseTuple(args, "OOO", &hunk, &a, &b))
@@ -72,8 +70,7 b' static const char *addlines_format = "OO'
72 70 * The control char from the hunk is saved when inserting into a, but not b
73 71 * (for performance while deleting files)
74 72 */
75 static PyObject *
76 addlines(PyObject *self, PyObject *args)
73 static PyObject *addlines(PyObject *self, PyObject *args)
77 74 {
78 75
79 76 PyObject *fp, *hunk, *a, *b, *x;
@@ -83,8 +80,8 b' addlines(PyObject *self, PyObject *args)'
83 80 Py_ssize_t todoa, todob;
84 81 char *s, c;
85 82 PyObject *l;
86 if (!PyArg_ParseTuple(args, addlines_format,
87 &fp, &hunk, &lena, &lenb, &a, &b))
83 if (!PyArg_ParseTuple(args, addlines_format, &fp, &hunk, &lena, &lenb,
84 &a, &b))
88 85 return NULL;
89 86
90 87 while (1) {
@@ -131,8 +128,7 b' addlines(PyObject *self, PyObject *args)'
131 128 * a control char at the start of each line, this char is ignored in the
132 129 * compare
133 130 */
134 static PyObject *
135 testhunk(PyObject *self, PyObject *args)
131 static PyObject *testhunk(PyObject *self, PyObject *args)
136 132 {
137 133
138 134 PyObject *a, *b;
@@ -161,18 +157,13 b' static PyMethodDef methods[] = {'
161 157 {"addlines", addlines, METH_VARARGS, "add lines to a hunk\n"},
162 158 {"fix_newline", fix_newline, METH_VARARGS, "fixup newline counters\n"},
163 159 {"testhunk", testhunk, METH_VARARGS, "test lines in a hunk\n"},
164 {NULL, NULL}
165 };
160 {NULL, NULL}};
166 161
167 162 static const int version = 1;
168 163
169 164 #ifdef IS_PY3K
170 165 static struct PyModuleDef diffhelpers_module = {
171 PyModuleDef_HEAD_INIT,
172 "diffhelpers",
173 diffhelpers_doc,
174 -1,
175 methods
166 PyModuleDef_HEAD_INIT, "diffhelpers", diffhelpers_doc, -1, methods,
176 167 };
177 168
178 169 PyMODINIT_FUNC PyInit_diffhelpers(void)
@@ -183,8 +174,8 b' PyMODINIT_FUNC PyInit_diffhelpers(void)'
183 174 if (m == NULL)
184 175 return NULL;
185 176
186 diffhelpers_Error = PyErr_NewException("diffhelpers.diffhelpersError",
187 NULL, NULL);
177 diffhelpers_Error =
178 PyErr_NewException("diffhelpers.diffhelpersError", NULL, NULL);
188 179 Py_INCREF(diffhelpers_Error);
189 180 PyModule_AddObject(m, "diffhelpersError", diffhelpers_Error);
190 181 PyModule_AddIntConstant(m, "version", version);
@@ -192,13 +183,12 b' PyMODINIT_FUNC PyInit_diffhelpers(void)'
192 183 return m;
193 184 }
194 185 #else
195 PyMODINIT_FUNC
196 initdiffhelpers(void)
186 PyMODINIT_FUNC initdiffhelpers(void)
197 187 {
198 188 PyObject *m;
199 189 m = Py_InitModule3("diffhelpers", methods, diffhelpers_doc);
200 diffhelpers_Error = PyErr_NewException("diffhelpers.diffhelpersError",
201 NULL, NULL);
190 diffhelpers_Error =
191 PyErr_NewException("diffhelpers.diffhelpersError", NULL, NULL);
202 192 PyModule_AddIntConstant(m, "version", version);
203 193 }
204 194 #endif
General Comments 0
You need to be logged in to leave comments. Login now