diff --git a/mercurial/store.py b/mercurial/store.py --- a/mercurial/store.py +++ b/mercurial/store.py @@ -61,6 +61,9 @@ def auxencode(path): # encode third letter ('aux' -> 'au~78') ec = "~%02x" % ord(n[2]) n = n[0:2] + ec + n[3:] + if n[-1] in '. ': + # encode last period or space ('foo...' -> 'foo..~2e') + n = n[:-1] + "~%02x" % ord(n[-1]) res.append(n) return '/'.join(res) diff --git a/tests/test-hybridencode.py b/tests/test-hybridencode.py --- a/tests/test-hybridencode.py +++ b/tests/test-hybridencode.py @@ -16,3 +16,4 @@ show('data/enterprise/openesbaddons/cont show('data/AUX.THE-QUICK-BROWN-FOX-JU:MPS-OVER-THE-LAZY-DOG-THE-QUICK-BROWN-FOX-JUMPS-OVER-THE-LAZY-DOG.TXT.i') show('data/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt') show('data/Project.Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt') +show('data/foo.../foo / /a./_. /__/.x../ bla/something.i') diff --git a/tests/test-hybridencode.py.out b/tests/test-hybridencode.py.out --- a/tests/test-hybridencode.py.out +++ b/tests/test-hybridencode.py.out @@ -16,3 +16,6 @@ B = 'dh/project_/resource/anotherl/follo A = 'data/Project.Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt' B = 'dh/project_/resource/anotherl/followed/andanoth/andthenanextremelylongfilena0fd7c506f5c9d58204444fc67e9499006bd2d445.txt' +A = 'data/foo.../foo / /a./_. /__/.x../ bla/something.i' +B = 'data/foo..~2e/foo ~20/~20/a~2e/__.~20/____/.x.~2e/ bla/something.i' +