Mercurial > public > mercurial-scm > hg-stable
diff tests/test-hybridencode.py @ 12687:34d8247a4595
store: encode first period or space in filenames (issue1713)
- Mac OS X has problems with filenames starting with '._'
(e.g. '.FOO' -> '._f_o_o' is now encoded as '~2e_f_o_o')
- Explorer of Windows Vista and Windows 7 strip leading spaces of
path elements of filenames when copying trees
Above problems are avoided by encoding the first space (as '~20') or
period (as '~2e') of all path elements.
This introduces a new entry 'dotencode' in .hg/requires, that is,
a new repository filename layout (inside .hg/store).
Newly created repositories require 'dotencode' by default. Specifying
[format]
dotencode = False
in a config file will use the old format instead.
Prior Mercurial versions will abort with the message
abort: requirement 'dotencode' not supported!
when trying to access a local repository that requires 'dotencode'.
New 'dotencode' repositories can be converted to the previous
repository format with
hg --config format.dotencode=0 clone --pull repoA repoB
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Sat, 09 Oct 2010 21:54:50 +0200 |
parents | 1a6d702e059d |
children | 4c50552fc9bc |
line wrap: on
line diff
--- a/tests/test-hybridencode.py Tue Sep 14 23:00:39 2010 +0200 +++ b/tests/test-hybridencode.py Sat Oct 09 21:54:50 2010 +0200 @@ -2,7 +2,10 @@ from mercurial import store -enc = store.hybridencode # used for fncache repo format +auxencode = lambda f: store._auxencode(f, True) +hybridencode = lambda f: store._hybridencode(f, auxencode) + +enc = hybridencode # used for 'dotencode' repo format def show(s): print "A = '%s'" % s @@ -22,4 +25,5 @@ 'Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt') show('data/Project.Planning/Resources/AnotherLongDirectoryName/' 'Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt') -show('data/foo.../foo / /a./_. /__/.x../ bla/something.i') +show('data/foo.../foo / /a./_. /__/.x../ bla/.FOO/something.i') +