Mercurial > hg
comparison mercurial/fileset.py @ 32134:4240be02df79
fileset: use fctx.isbinary instead of util.binary(fctx.data())
filectx provides "isbinary" to test if the data is binary. Let's use it.
This enables other filectx implementations (like LFS) to override the
isbinary test.
author | Jun Wu <quark@fb.com> |
---|---|
date | Wed, 03 May 2017 18:02:00 -0700 |
parents | 992882cef7e1 |
children | bd872f64a8ba |
comparison
equal
deleted
inserted
replaced
32133:435a3842ca3a | 32134:4240be02df79 |
---|---|
254 def binary(mctx, x): | 254 def binary(mctx, x): |
255 """File that appears to be binary (contains NUL bytes). | 255 """File that appears to be binary (contains NUL bytes). |
256 """ | 256 """ |
257 # i18n: "binary" is a keyword | 257 # i18n: "binary" is a keyword |
258 getargs(x, 0, 0, _("binary takes no arguments")) | 258 getargs(x, 0, 0, _("binary takes no arguments")) |
259 return [f for f in mctx.existing() if util.binary(mctx.ctx[f].data())] | 259 return [f for f in mctx.existing() if mctx.ctx[f].isbinary()] |
260 | 260 |
261 @predicate('exec()', callexisting=True) | 261 @predicate('exec()', callexisting=True) |
262 def exec_(mctx, x): | 262 def exec_(mctx, x): |
263 """File that is marked as executable. | 263 """File that is marked as executable. |
264 """ | 264 """ |