pathencode: skip encoding if input is already longer than maxstorepathlen
Calling basicencode may make the path longer, never shorter. If it's already
too long before, then we don't even need to basicencode it.
--- a/mercurial/pathencode.c Sun Sep 30 23:53:56 2012 +0200
+++ b/mercurial/pathencode.c Sun Sep 30 23:53:56 2012 +0200
@@ -501,6 +501,12 @@
return NULL;
}
+ if (len > maxstorepathlen) {
+ newobj = Py_None;
+ Py_INCREF(newobj);
+ return newobj;
+ }
+
newlen = len ? basicencode(NULL, 0, path, len + 1) : 1;
if (newlen <= maxstorepathlen + 1) {