# HG changeset patch # User Matt Mackall # Date 2013-06-21 20:31:40 # Node ID cf1b0a58a0debe89bdb68e06cc9eba6c67960869 # Parent 7014526d67a856761e4436185070c72b0013c912 # Parent ec17ddecdf64362510f34bfef760298a801b693a merge with stable diff --git a/doc/hgrc.5.txt b/doc/hgrc.5.txt --- a/doc/hgrc.5.txt +++ b/doc/hgrc.5.txt @@ -16,8 +16,8 @@ configuration files for Mercurial :class: htmlonly -Synopsis -======== +Description +=========== .. include:: ../mercurial/help/config.txt diff --git a/mercurial/pathencode.c b/mercurial/pathencode.c --- a/mercurial/pathencode.c +++ b/mercurial/pathencode.c @@ -585,7 +585,8 @@ static PyObject *hashmangle(const char * 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; diff --git a/tests/test-pathencode.py b/tests/test-pathencode.py --- a/tests/test-pathencode.py +++ b/tests/test-pathencode.py @@ -124,7 +124,8 @@ def makepart(rng, k): 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)