Show More
@@ -1,6 +1,5 b'' | |||
|
1 | 1 | # Files that just need to be migrated to the formatter. |
|
2 | 2 | # Do not add new files here! |
|
3 | mercurial/cext/dirs.c | |
|
4 | 3 | mercurial/cext/manifest.c |
|
5 | 4 | mercurial/cext/osutil.c |
|
6 | 5 | # Vendored code that we should never format: |
@@ -42,7 +42,7 b' static inline Py_ssize_t _finddir(const ' | |||
|
42 | 42 | pos -= 1; |
|
43 | 43 | } |
|
44 | 44 | if (pos == -1) { |
|
45 |
|
|
|
45 | return 0; | |
|
46 | 46 | } |
|
47 | 47 | |
|
48 | 48 | return pos; |
@@ -56,13 +56,13 b' static int _addpath(PyObject *dirs, PyOb' | |||
|
56 | 56 | int ret = -1; |
|
57 | 57 | |
|
58 | 58 | /* This loop is super critical for performance. That's why we inline |
|
59 | * access to Python structs instead of going through a supported API. | |
|
60 | * The implementation, therefore, is heavily dependent on CPython | |
|
61 | * implementation details. We also commit violations of the Python | |
|
62 | * "protocol" such as mutating immutable objects. But since we only | |
|
63 | * mutate objects created in this function or in other well-defined | |
|
64 | * locations, the references are known so these violations should go | |
|
65 | * unnoticed. */ | |
|
59 | * access to Python structs instead of going through a supported API. | |
|
60 | * The implementation, therefore, is heavily dependent on CPython | |
|
61 | * implementation details. We also commit violations of the Python | |
|
62 | * "protocol" such as mutating immutable objects. But since we only | |
|
63 | * mutate objects created in this function or in other well-defined | |
|
64 | * locations, the references are known so these violations should go | |
|
65 | * unnoticed. */ | |
|
66 | 66 | while ((pos = _finddir(cpath, pos - 1)) != -1) { |
|
67 | 67 | PyObject *val; |
|
68 | 68 | |
@@ -120,7 +120,7 b' static int _delpath(PyObject *dirs, PyOb' | |||
|
120 | 120 | val = PyDict_GetItem(dirs, key); |
|
121 | 121 | if (val == NULL) { |
|
122 | 122 | PyErr_SetString(PyExc_ValueError, |
|
123 |
|
|
|
123 | "expected a value, found none"); | |
|
124 | 124 | goto bail; |
|
125 | 125 | } |
|
126 | 126 | |
@@ -152,7 +152,7 b' static int dirs_fromdict(PyObject *dirs,' | |||
|
152 | 152 | if (skipchar) { |
|
153 | 153 | if (!dirstate_tuple_check(value)) { |
|
154 | 154 | PyErr_SetString(PyExc_TypeError, |
|
155 |
|
|
|
155 | "expected a dirstate tuple"); | |
|
156 | 156 | return -1; |
|
157 | 157 | } |
|
158 | 158 | if (((dirstateTupleObject *)value)->state == skipchar) |
@@ -218,8 +218,8 b' static int dirs_init(dirsObject *self, P' | |||
|
218 | 218 | ret = dirs_fromdict(dirs, source, skipchar); |
|
219 | 219 | else if (skipchar) |
|
220 | 220 | PyErr_SetString(PyExc_ValueError, |
|
221 |
|
|
|
222 |
|
|
|
221 | "skip character is only supported " | |
|
222 | "with a dict source"); | |
|
223 | 223 | else |
|
224 | 224 | ret = dirs_fromiter(dirs, source); |
|
225 | 225 | |
@@ -276,12 +276,12 b' static PyObject *dirs_iter(dirsObject *s' | |||
|
276 | 276 | static PySequenceMethods dirs_sequence_methods; |
|
277 | 277 | |
|
278 | 278 | static PyMethodDef dirs_methods[] = { |
|
279 |
|
|
|
280 |
|
|
|
281 |
|
|
|
279 | {"addpath", (PyCFunction)dirs_addpath, METH_VARARGS, "add a path"}, | |
|
280 | {"delpath", (PyCFunction)dirs_delpath, METH_VARARGS, "remove a path"}, | |
|
281 | {NULL} /* Sentinel */ | |
|
282 | 282 | }; |
|
283 | 283 | |
|
284 |
static PyTypeObject dirsType = { |
|
|
284 | static PyTypeObject dirsType = {PyVarObject_HEAD_INIT(NULL, 0)}; | |
|
285 | 285 | |
|
286 | 286 | void dirs_module_init(PyObject *mod) |
|
287 | 287 | { |
General Comments 0
You need to be logged in to leave comments.
Login now