view tests/test-hybridencode.py @ 8529:a767998f0a78

hgweb: make hgwebdir handle dict/list paths the same as config paths Before this patch, the only way to get hgwebdir to honor the recursive paths was to create a config object or a config file with the recursive paths in it. This patch makes hgwebdir treat paths the same whether passed in as a list, tuple, config or however hgwebdir supports passing paths.
author Jeremy Whitlock <jcscoobyrs@gmail.com>
date Wed, 20 May 2009 16:04:37 +0200
parents ee5aba886108
children 1a6d702e059d
line wrap: on
line source

#!/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')