Mercurial > public > mercurial-scm > hg-stable
diff 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 |
line wrap: on
line diff
--- a/mercurial/patch.py Sun May 08 22:28:09 2016 -0400 +++ b/mercurial/patch.py Fri May 13 07:19:59 2016 +0900 @@ -1010,7 +1010,7 @@ ui.write("\n") if r == 8: # ? for c, t in ui.extractchoices(resps)[1]: - ui.write('%s - %s\n' % (c, t.lower())) + ui.write('%s - %s\n' % (c, encoding.lower(t))) continue elif r == 0: # yes ret = True