merge with stable
authorMatt Mackall <mpm@selenic.com>
Fri, 21 Jun 2013 15:31:40 -0500
changeset 19327 cf1b0a58a0de
parent 19326 7014526d67a8 (current diff)
parent 19319 ec17ddecdf64 (diff)
child 19329 84dc9669bd71
merge with stable
tests/test-pathencode.py
--- a/doc/hgrc.5.txt	Mon Jun 17 19:44:00 2013 -0700
+++ b/doc/hgrc.5.txt	Fri Jun 21 15:31:40 2013 -0500
@@ -16,8 +16,8 @@
    :class: htmlonly
 
 
-Synopsis
-========
+Description
+===========
 
 .. include:: ../mercurial/help/config.txt
 
--- a/mercurial/pathencode.c	Mon Jun 17 19:44:00 2013 -0700
+++ b/mercurial/pathencode.c	Fri Jun 21 15:31:40 2013 -0500
@@ -585,7 +585,8 @@
 			   in a space or dot, which are unportable. */
 			if (d == '.' || d == ' ')
 				dest[destlen - 1] = '_';
-			if (destlen > maxshortdirslen)
+			/* The + 3 is to account for "dh/" in the beginning */
+			if (destlen > maxshortdirslen + 3)
 				break;
 			charcopy(dest, &destlen, destsize, src[i]);
 			p = -1;
--- a/tests/test-pathencode.py	Mon Jun 17 19:44:00 2013 -0700
+++ b/tests/test-pathencode.py	Fri Jun 21 15:31:40 2013 -0500
@@ -124,7 +124,8 @@
     p = pickfrom(rng, firsttable)(rng)
     l = len(p)
     ps = [p]
-    while l <= k:
+    maxl = rng.randint(1, k)
+    while l < maxl:
         p = pickfrom(rng, resttable)(rng)
         l += len(p)
         ps.append(p)