tests/test-newbranch
changeset 4169 0182cb2e4aac
parent 3761 9433bdcaa9ae
child 4176 fc12ac3755d5
equal deleted inserted replaced
4168:bbfe5a3fc80c 4169:0182cb2e4aac
    36 hg --debug log -r foo
    36 hg --debug log -r foo
    37 rm .hg/branches.cache
    37 rm .hg/branches.cache
    38 echo corrupted > .hg/branches.cache
    38 echo corrupted > .hg/branches.cache
    39 hg log -qr foo
    39 hg log -qr foo
    40 cat .hg/branches.cache
    40 cat .hg/branches.cache
       
    41 
       
    42 echo % test for different branch cache features
       
    43 echo '4909a3732169c0c20011c4f4b8fdff4e3d89b23f 4' > .hg/branches.cache
       
    44 hg branches --debug
       
    45 echo ' features: unnamed dummy foo bar' > .hg/branches.cache
       
    46 hg branches --debug
       
    47 echo ' features: dummy' > .hg/branches.cache
       
    48 hg branches --debug
       
    49 
       
    50 echo % test old hg reading branch cache with feature list
       
    51 python << EOF
       
    52 import binascii
       
    53 f = file('.hg/branches.cache')
       
    54 lines = f.read().split('\n')
       
    55 f.close()
       
    56 firstline = lines[0]
       
    57 last, lrev = lines.pop(0).rstrip().split(" ", 1)
       
    58 try:
       
    59     last, lrev = binascii.unhexlify(last), int(lrev)
       
    60 except ValueError, inst:
       
    61     if str(inst) == "invalid literal for int():%s" % firstline:
       
    62         print "ValueError raised correctly, good."
       
    63     else:
       
    64         print "ValueError: %s" % inst
       
    65 EOF