D2182: base85: allow clang-format oversight

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Wed Feb 14 23:41:01 EST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGdf49652fafa1: base85: allow clang-format oversight (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2182?vs=5749&id=5753

REVISION DETAIL
  https://phab.mercurial-scm.org/D2182

AFFECTED FILES
  contrib/clang-format-blacklist
  mercurial/cext/base85.c

CHANGE DETAILS

diff --git a/mercurial/cext/base85.c b/mercurial/cext/base85.c
--- a/mercurial/cext/base85.c
+++ b/mercurial/cext/base85.c
@@ -14,8 +14,9 @@
 
 #include "util.h"
 
-static const char b85chars[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-	"abcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~";
+static const char b85chars[] =
+    "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+    "abcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~";
 static char b85dec[256];
 
 static void b85prep(void)
@@ -105,25 +106,25 @@
 			c = b85dec[(int)*text++] - 1;
 			if (c < 0)
 				return PyErr_Format(
-					PyExc_ValueError,
-					"bad base85 character at position %d",
-					(int)i);
+				    PyExc_ValueError,
+				    "bad base85 character at position %d",
+				    (int)i);
 			acc = acc * 85 + c;
 		}
 		if (i++ < len) {
 			c = b85dec[(int)*text++] - 1;
 			if (c < 0)
 				return PyErr_Format(
-					PyExc_ValueError,
-					"bad base85 character at position %d",
-					(int)i);
+				    PyExc_ValueError,
+				    "bad base85 character at position %d",
+				    (int)i);
 			/* overflow detection: 0xffffffff == "|NsC0",
 			 * "|NsC" == 0x03030303 */
 			if (acc > 0x03030303 || (acc *= 85) > 0xffffffff - c)
 				return PyErr_Format(
-					PyExc_ValueError,
-					"bad base85 sequence at position %d",
-					(int)i);
+				    PyExc_ValueError,
+				    "bad base85 sequence at position %d",
+				    (int)i);
 			acc += c;
 		}
 
@@ -145,23 +146,19 @@
 static char base85_doc[] = "Base85 Data Encoding";
 
 static PyMethodDef methods[] = {
-	{"b85encode", b85encode, METH_VARARGS,
-	 "Encode text in base85.\n\n"
-	 "If the second parameter is true, pad the result to a multiple of "
-	 "five characters.\n"},
-	{"b85decode", b85decode, METH_VARARGS, "Decode base85 text.\n"},
-	{NULL, NULL}
+    {"b85encode", b85encode, METH_VARARGS,
+     "Encode text in base85.\n\n"
+     "If the second parameter is true, pad the result to a multiple of "
+     "five characters.\n"},
+    {"b85decode", b85decode, METH_VARARGS, "Decode base85 text.\n"},
+    {NULL, NULL},
 };
 
 static const int version = 1;
 
 #ifdef IS_PY3K
 static struct PyModuleDef base85_module = {
-	PyModuleDef_HEAD_INIT,
-	"base85",
-	base85_doc,
-	-1,
-	methods
+    PyModuleDef_HEAD_INIT, "base85", base85_doc, -1, methods,
 };
 
 PyMODINIT_FUNC PyInit_base85(void)
diff --git a/contrib/clang-format-blacklist b/contrib/clang-format-blacklist
--- a/contrib/clang-format-blacklist
+++ b/contrib/clang-format-blacklist
@@ -1,6 +1,5 @@
 # Files that just need to be migrated to the formatter.
 # Do not add new files here!
-mercurial/cext/base85.c
 mercurial/cext/dirs.c
 mercurial/cext/manifest.c
 mercurial/cext/mpatch.c



To: durin42, #hg-reviewers, indygreg
Cc: mercurial-devel


More information about the Mercurial-devel mailing list