99 lines
3.5 KiB
Diff
99 lines
3.5 KiB
Diff
# HG changeset patch
|
|
# User Augie Fackler <augie@google.com>
|
|
# Date 1571147645 14400
|
|
# Node ID ea62d7b06c129be54aaf0cf389b6e14dfedf638b
|
|
# Parent be178b5d91c823cf91ed28f6f369b902d3e2cdec
|
|
dirs: give formatting oversight to clang-format
|
|
|
|
Differential Revision: https://phab.mercurial-scm.org/D7104
|
|
|
|
diff -r be178b5d91c8 -r ea62d7b06c12 contrib/clang-format-ignorelist
|
|
--- a/contrib/clang-format-ignorelist Tue Oct 15 09:52:33 2019 -0400
|
|
+++ b/contrib/clang-format-ignorelist Tue Oct 15 09:54:05 2019 -0400
|
|
@@ -1,6 +1,5 @@
|
|
# Files that just need to be migrated to the formatter.
|
|
# Do not add new files here!
|
|
-mercurial/cext/dirs.c
|
|
mercurial/cext/manifest.c
|
|
mercurial/cext/osutil.c
|
|
# Vendored code that we should never format:
|
|
diff -r be178b5d91c8 -r ea62d7b06c12 mercurial/cext/dirs.c
|
|
--- a/mercurial/cext/dirs.c Tue Oct 15 09:52:33 2019 -0400
|
|
+++ b/mercurial/cext/dirs.c Tue Oct 15 09:54:05 2019 -0400
|
|
@@ -42,7 +42,7 @@
|
|
pos -= 1;
|
|
}
|
|
if (pos == -1) {
|
|
- return 0;
|
|
+ return 0;
|
|
}
|
|
|
|
return pos;
|
|
@@ -56,13 +56,13 @@
|
|
int ret = -1;
|
|
|
|
/* This loop is super critical for performance. That's why we inline
|
|
- * access to Python structs instead of going through a supported API.
|
|
- * The implementation, therefore, is heavily dependent on CPython
|
|
- * implementation details. We also commit violations of the Python
|
|
- * "protocol" such as mutating immutable objects. But since we only
|
|
- * mutate objects created in this function or in other well-defined
|
|
- * locations, the references are known so these violations should go
|
|
- * unnoticed. */
|
|
+ * access to Python structs instead of going through a supported API.
|
|
+ * The implementation, therefore, is heavily dependent on CPython
|
|
+ * implementation details. We also commit violations of the Python
|
|
+ * "protocol" such as mutating immutable objects. But since we only
|
|
+ * mutate objects created in this function or in other well-defined
|
|
+ * locations, the references are known so these violations should go
|
|
+ * unnoticed. */
|
|
while ((pos = _finddir(cpath, pos - 1)) != -1) {
|
|
PyObject *val;
|
|
|
|
@@ -120,7 +120,7 @@
|
|
val = PyDict_GetItem(dirs, key);
|
|
if (val == NULL) {
|
|
PyErr_SetString(PyExc_ValueError,
|
|
- "expected a value, found none");
|
|
+ "expected a value, found none");
|
|
goto bail;
|
|
}
|
|
|
|
@@ -152,7 +152,7 @@
|
|
if (skipchar) {
|
|
if (!dirstate_tuple_check(value)) {
|
|
PyErr_SetString(PyExc_TypeError,
|
|
- "expected a dirstate tuple");
|
|
+ "expected a dirstate tuple");
|
|
return -1;
|
|
}
|
|
if (((dirstateTupleObject *)value)->state == skipchar)
|
|
@@ -218,8 +218,8 @@
|
|
ret = dirs_fromdict(dirs, source, skipchar);
|
|
else if (skipchar)
|
|
PyErr_SetString(PyExc_ValueError,
|
|
- "skip character is only supported "
|
|
- "with a dict source");
|
|
+ "skip character is only supported "
|
|
+ "with a dict source");
|
|
else
|
|
ret = dirs_fromiter(dirs, source);
|
|
|
|
@@ -276,12 +276,12 @@
|
|
static PySequenceMethods dirs_sequence_methods;
|
|
|
|
static PyMethodDef dirs_methods[] = {
|
|
- {"addpath", (PyCFunction)dirs_addpath, METH_VARARGS, "add a path"},
|
|
- {"delpath", (PyCFunction)dirs_delpath, METH_VARARGS, "remove a path"},
|
|
- {NULL} /* Sentinel */
|
|
+ {"addpath", (PyCFunction)dirs_addpath, METH_VARARGS, "add a path"},
|
|
+ {"delpath", (PyCFunction)dirs_delpath, METH_VARARGS, "remove a path"},
|
|
+ {NULL} /* Sentinel */
|
|
};
|
|
|
|
-static PyTypeObject dirsType = { PyVarObject_HEAD_INIT(NULL, 0) };
|
|
+static PyTypeObject dirsType = {PyVarObject_HEAD_INIT(NULL, 0)};
|
|
|
|
void dirs_module_init(PyObject *mod)
|
|
{
|