tests/test-hybridencode.py
changeset 12687 34d8247a4595
parent 8659 1a6d702e059d
child 12865 4c50552fc9bc
equal deleted inserted replaced
12686:fe31f834a9ff 12687:34d8247a4595
     1 #!/usr/bin/env python
     1 #!/usr/bin/env python
     2 
     2 
     3 from mercurial import store
     3 from mercurial import store
     4 
     4 
     5 enc = store.hybridencode # used for fncache repo format
     5 auxencode = lambda f: store._auxencode(f, True)
       
     6 hybridencode = lambda f: store._hybridencode(f, auxencode)
       
     7 
       
     8 enc = hybridencode # used for 'dotencode' repo format
     6 
     9 
     7 def show(s):
    10 def show(s):
     8     print "A = '%s'" % s
    11     print "A = '%s'" % s
     9     print "B = '%s'" % enc(s)
    12     print "B = '%s'" % enc(s)
    10     print
    13     print
    20      'BROWN-FOX-JUMPS-OVER-THE-LAZY-DOG.TXT.i')
    23      'BROWN-FOX-JUMPS-OVER-THE-LAZY-DOG.TXT.i')
    21 show('data/Project Planning/Resources/AnotherLongDirectoryName/'
    24 show('data/Project Planning/Resources/AnotherLongDirectoryName/'
    22      'Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt')
    25      'Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt')
    23 show('data/Project.Planning/Resources/AnotherLongDirectoryName/'
    26 show('data/Project.Planning/Resources/AnotherLongDirectoryName/'
    24      'Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt')
    27      'Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt')
    25 show('data/foo.../foo   / /a./_. /__/.x../    bla/something.i')
    28 show('data/foo.../foo   / /a./_. /__/.x../    bla/.FOO/something.i')
       
    29