##// END OF EJS Templates
i18n: use "encoding.lower()" to normalize specified keywords for log searching...
FUJIWARA Katsunori -
r15725:988409e4 default
parent child Browse files
Show More
@@ -3897,14 +3897,21 b' def log(ui, repo, *pats, **opts):'
3897 return
3897 return
3898 if df and not df(ctx.date()[0]):
3898 if df and not df(ctx.date()[0]):
3899 return
3899 return
3900 if opts['user'] and not [k for k in opts['user']
3900
3901 if k.lower() in ctx.user().lower()]:
3901 lower = encoding.lower
3902 return
3902 if opts.get('user'):
3903 luser = lower(ctx.user())
3904 for k in [lower(x) for x in opts['user']]:
3905 if (k in luser):
3906 break
3907 else:
3908 return
3903 if opts.get('keyword'):
3909 if opts.get('keyword'):
3904 for k in [kw.lower() for kw in opts['keyword']]:
3910 luser = lower(ctx.user())
3905 if (k in ctx.user().lower() or
3911 ldesc = lower(ctx.description())
3906 k in ctx.description().lower() or
3912 lfiles = lower(" ".join(ctx.files()))
3907 k in " ".join(ctx.files()).lower()):
3913 for k in [lower(x) for x in opts['keyword']]:
3914 if (k in luser or k in ldesc or k in lfiles):
3908 break
3915 break
3909 else:
3916 else:
3910 return
3917 return
@@ -1159,3 +1159,56 b' Diff here should be the same:'
1159 $ hg log --template='{rev}:{node}\n' --hidden
1159 $ hg log --template='{rev}:{node}\n' --hidden
1160 1:a765632148dc55d38c35c4f247c618701886cb2f
1160 1:a765632148dc55d38c35c4f247c618701886cb2f
1161 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1161 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1162
1163 clear extensions configuration
1164 $ echo '[extensions]' >> $HGRCPATH
1165 $ echo "hidden=!" >> $HGRCPATH
1166 $ cd ..
1167
1168 test -u/-k for problematic encoding
1169 # unicode: cp932:
1170 # u30A2 0x83 0x41(= 'A')
1171 # u30C2 0x83 0x61(= 'a')
1172
1173 $ hg init problematicencoding
1174 $ cd problematicencoding
1175
1176 $ python > setup.sh <<EOF
1177 > print u'''
1178 > echo a > text
1179 > hg add text
1180 > hg --encoding utf-8 commit -u '\u30A2' -m none
1181 > echo b > text
1182 > hg --encoding utf-8 commit -u '\u30C2' -m none
1183 > echo c > text
1184 > hg --encoding utf-8 commit -u none -m '\u30A2'
1185 > echo d > text
1186 > hg --encoding utf-8 commit -u none -m '\u30C2'
1187 > '''.encode('utf-8')
1188 > EOF
1189 $ sh < setup.sh
1190
1191 test in problematic encoding
1192 $ python > test.sh <<EOF
1193 > print u'''
1194 > hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2'
1195 > echo ====
1196 > hg --encoding cp932 log --template '{rev}\\n' -u '\u30C2'
1197 > echo ====
1198 > hg --encoding cp932 log --template '{rev}\\n' -k '\u30A2'
1199 > echo ====
1200 > hg --encoding cp932 log --template '{rev}\\n' -k '\u30C2'
1201 > '''.encode('cp932')
1202 > EOF
1203 $ sh < test.sh
1204 0
1205 ====
1206 1
1207 ====
1208 2
1209 0
1210 ====
1211 3
1212 1
1213
1214 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now