comparison mercurial/patch.py @ 29154:9d38a2061fd8 stable

patch: show lower-ed translated message correctly Before this patch, patch.filterpatch() shows meaningless translation of help message for chunk selection in some encoding. It applies str.lower() instead of encoding.lower(str) on translated message, but some encoding uses 0x41(A) - 0x5a(Z) as the second or later byte of multi-byte character (for example, ja_JP.cp932), and str.lower() causes unexpected result. To show lower-ed translated message correctly, this patch replaces str.lower() by encoding.lower(str).
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Fri, 13 May 2016 07:19:59 +0900
parents 86db5cb55d46
children 14eee72c8d52
comparison
equal deleted inserted replaced
29094:1111e84de635 29154:9d38a2061fd8
1008 '$$ &? (display help)') 1008 '$$ &? (display help)')
1009 r = ui.promptchoice("%s %s" % (query, resps)) 1009 r = ui.promptchoice("%s %s" % (query, resps))
1010 ui.write("\n") 1010 ui.write("\n")
1011 if r == 8: # ? 1011 if r == 8: # ?
1012 for c, t in ui.extractchoices(resps)[1]: 1012 for c, t in ui.extractchoices(resps)[1]:
1013 ui.write('%s - %s\n' % (c, t.lower())) 1013 ui.write('%s - %s\n' % (c, encoding.lower(t)))
1014 continue 1014 continue
1015 elif r == 0: # yes 1015 elif r == 0: # yes
1016 ret = True 1016 ret = True
1017 elif r == 1: # no 1017 elif r == 1: # no
1018 ret = False 1018 ret = False