comparison mercurial/fileset.py @ 24408:caa6b6c65dc3

fileset: add a fileset for portable filenames This has mostly the same semantics as the files that the 'ui.portablefilenames' config option would warn or abort about. The only difference is filenames that case-fold to the same string -- given a set of filenames we've already checked we can check whether a new one collides with them, but we don't have a way to tell which filename it collided with.
author Siddharth Agarwal <sid0@fb.com>
date Thu, 19 Mar 2015 21:26:18 -0700
parents eda2f36889b5
children ac381dd7a21f
comparison
equal deleted inserted replaced
24406:1297480ed347 24408:caa6b6c65dc3
254 # i18n: "hgignore" is a keyword 254 # i18n: "hgignore" is a keyword
255 getargs(x, 0, 0, _("hgignore takes no arguments")) 255 getargs(x, 0, 0, _("hgignore takes no arguments"))
256 ignore = mctx.ctx.repo().dirstate._ignore 256 ignore = mctx.ctx.repo().dirstate._ignore
257 return [f for f in mctx.subset if ignore(f)] 257 return [f for f in mctx.subset if ignore(f)]
258 258
259 def portable(mctx, x):
260 """``portable()``
261 File that has a portable name. (This doesn't include filenames with case
262 collisions.)
263 """
264 # i18n: "portable" is a keyword
265 getargs(x, 0, 0, _("portable takes no arguments"))
266 checkwinfilename = util.checkwinfilename
267 return [f for f in mctx.subset if checkwinfilename(f) is None]
268
259 def grep(mctx, x): 269 def grep(mctx, x):
260 """``grep(regex)`` 270 """``grep(regex)``
261 File contains the given regular expression. 271 File contains the given regular expression.
262 """ 272 """
263 try: 273 try:
414 'exec': exec_, 424 'exec': exec_,
415 'grep': grep, 425 'grep': grep,
416 'ignored': ignored, 426 'ignored': ignored,
417 'hgignore': hgignore, 427 'hgignore': hgignore,
418 'modified': modified, 428 'modified': modified,
429 'portable': portable,
419 'removed': removed, 430 'removed': removed,
420 'resolved': resolved, 431 'resolved': resolved,
421 'size': size, 432 'size': size,
422 'symlink': symlink, 433 'symlink': symlink,
423 'unknown': unknown, 434 'unknown': unknown,