Задание набора файлов
"""""""""""""""""""""

    Mercurial поддерживает функциональный язык для выбора набора
    файлов.
    
    Как и другие шаблоны имен файлов, этот шаблон обозначается префиксом
    'set:'. Язык поддерживает несколько предикатов, которые объединяются
    инфиксными операторами. Для группировки можно использовать скобки.
    
    Identifiers such as filenames or patterns must be quoted with single
    or double quotes if they contain characters outside of
    ``[.*{}[]?/\_a-zA-Z0-9\x80-\xff]`` or if they match one of the
    predefined predicates. This generally applies to file patterns other
    than globs and arguments for predicates. Pattern prefixes such as
    ``path:`` may be specified without quoting.
    
    В идентификаторах можно использовать специальные символы, экранируя их.
    Например ``\n`` интерпретируется как перевод строки. Чтобы запретить
    такую интерпретацию, поставьте перед строкой ``r``, например, ``r'...'``.
    
    See also :hg:`help patterns`.
    
    Operators
    =========
    
    Поддерживается один префиксный оператор:
    
    ``not x``
      Файлы, не входящие в x. Краткая форма: ``! x``.
    
    Поддерживаемые инфиксные операторы:
    
    ``x and y``
      Пересечение файлов из x и y. Краткая форма: ``x & y``.
    
    ``x or y``
      Объединение файлов из x и y. Существуют две краткие формы:
      ``x | y`` and ``x + y``.
    
    ``x - y``
      Файлы, входящие в x, но не в y.
    
    Predicates
    ==========
    
    Поддерживаются следующие предикаты:
    
    ``added()``
      File that is added according to :hg:`status`.
    
    ``binary()``
      Файл, который рассматривается как бинарный (содержит символы NUL).
    
    ``clean()``
      File that is clean according to :hg:`status`.
    
    ``copied()``
      Файл, записанный как копируемый.
    
    ``deleted()``
      Alias for ``missing()``.
    
    ``encoding(name)``
      File can be successfully decoded with the given character
      encoding. May not be useful for encodings other than ASCII and
      UTF-8.
    
    ``eol(style)``
      File contains newlines of the given style (dos, unix, mac). Binary
      files are excluded, files with mixed line endings match multiple
      styles.
    
    ``exec()``
      Файл, который помечен как исполняемый.
    
    ``grep(regex)``
      Файл, содержащий заданное регулярное выражение.
    
    ``hgignore()``
      Файл, подходящие под активный шаблон из .hgignore.
    
    ``ignored()``
      File that is ignored according to :hg:`status`.
    
    ``missing()``
      File that is missing according to :hg:`status`.
    
    ``modified()``
      File that is modified according to :hg:`status`.
    
    ``portable()``
      File that has a portable name. (This doesn't include filenames with case
      collisions.)
    
    ``removed()``
      File that is removed according to :hg:`status`.
    
    ``resolved()``
      File that is marked resolved according to :hg:`resolve -l`.
    
    ``revs(revs, pattern)``
      Evaluate set in the specified revisions. If the revset match multiple
      revs, this will return file matching pattern in any of the revision.
    
    ``size(expression)``
      Размер файла совпадает с данным шаблоном. Например:
      
      - size('1k') - files from 1024 to 2047 bytes
      - size('< 20k') - files less than 20480 bytes
      - size('>= .5MB') - files at least 524288 bytes
      - size('4k - 1MB') - files from 4096 bytes to 1048576 bytes
    
    ``status(base, rev, pattern)``
      Evaluate predicate using status change between ``base`` and
      ``rev``. Examples:
      
      - ``status(3, 7, added())`` - matches files added from "3" to "7"
    
    ``subrepo([шаблон])``
      Подхранилища, чьи пути совпадают с данным шаблоном
    
    ``symlink()``
      Файл, помеченный как символическая ссылка.
    
    ``tracked()``
      File that is under Mercurial control.
    
    ``unknown()``
      File that is unknown according to :hg:`status`.
    
    ``unresolved()``
      File that is marked unresolved according to :hg:`resolve -l`.
    
    Examples
    ========
    
    Примеры запросов:
    
    - Показать статус файлов, считающихся бинарными, в рабочем каталоге::
    
        hg status -A "set:binary()"
    
    - Забыть файлы, которые записаны в .hgignore, но уже контролируются::
    
        hg forget "set:hgignore() and not ignored()"
    
    - Найти текстовые файлы, содержащие строку::
    
        hg files "set:grep(magic) and not binary()"
    
    - Найти файлы С с нестандартной кодировкой::
    
        hg files "set:**.c and not encoding('UTF-8')"
    
    - Вернуть (revert) копии больших бинарных файлов::
    
        hg revert "set:copied() and binary() and size('>1M')"
    
    - Revert files that were added to the working directory::
    
        hg revert "set:revs('wdir()', added())"
    
    - Удалить файлы, перечисленные в foo.lst и содержащие букву a или b::
    
        hg remove "set: listfile:foo.lst and (**a* or **b*)"