mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 08:18:15 +03:00
b2991e8893
Windows won't create directories with names ending in period or space, so we encode the last period/space character in directory names of non-hashed paths in the store using reversible ~xx encoding (' ' -> '~20', '.' -> '~2e'). With this change it is possible to remove a directory ending in period or space that was inadvertantly checked in on a linux system while still being able to clone such a repository with its full history to Windows (see also issue793).
20 lines
1011 B
Python
Executable File
20 lines
1011 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
from mercurial import store
|
|
|
|
enc = store.hybridencode # used for fncache repo format
|
|
|
|
def show(s):
|
|
print "A = '%s'" % s
|
|
print "B = '%s'" % enc(s)
|
|
print
|
|
|
|
show('data/aux.bla/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c.i')
|
|
|
|
show('data/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT.i')
|
|
show('data/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider.i')
|
|
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')
|