0
     !ˆÈÇÍ486ÆÀÊ æ    !‹      Å”_o›0Åßû)îü°7¸	M«©5LDZ¤4‰Rªišöà`ÞF¶»¬ûô3!Ñ²ªÑþHÓž®�Ã½¿sŒ¡/²eš¿_Mám~;‡Õý›ù, ¾;O³<LÂÑqº @jçº+ÄívnÏCm*Ì×X»FMÐ:#rÇIrFû{ÉÐZ0î+P'�É¬åâ+èP?8+¹ˆäº±hEËK©DÈE£ÃÚ†…Ö�ÀuakÕA=ÁÎè]m|ÿÀ
U¢ÑÚáƒ5hkfvuw^Ÿ¬n)Ã=îyèFóÇsü¿�üä],l³#ë—&¡®†/LÉª�‰ÓI¨l*°¦ˆ	ÊB·7ŠµŸÃJ–˜r1ù0K—½ÎÏíßN(PÆäu/®—qF’kEö¼æÖknH2gÖA£¹,¥à'ÅwƒøN~;Ý04™°…‘�“½×ƒ½Åc«…V¶cÞë…wP›cÕ á¿Jƒ?…±ºYOy6[‘ð¾Åº¾Á$YùÒ:È¤…Óæqï} yÙnlw}¸„½3#«Ú‘ €g•G©æ8�SQôß ÇÝ•cÆ'PÑ(ºÆã A4ºŠ^üýon9îÅÝé¤8üD¾‹ßË§    5   #ˆl–Ãa¾”*_)%�¹q—”Å£�þBû‹7(l½ $xÏÏ406ÎÁË –    #from typing import Callable, TypeVar, overload

from . import _ConverterType

_T = TypeVar("_T")

def pipe(*validators: _ConverterType) -> _ConverterType: ...
def optional(converter: _ConverterType) -> _ConverterType: ...
@overload
def default_if_none(default: _T) -> _ConverterType: ...
@overload
def default_if_none(*, factory: Callable[[], _T]) -> _ConverterType: ...
def to_bool(val: str) -> bool: ...
  !   %ˆÀ�þ]yÇnP¸VDHÓ@þÏ„d_ÎÂÁË ?÷     %# templatefuncs.py - common template functions
#
# Copyright 2005, 2006 Olivia Mackall <olivia@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.


import binascii
import re

from .i18n import _
from .node import bin
from . import (
    color,
    dagop,
    diffutil,
    encoding,
    error,
    minirst,
    obsutil,
    pycompat,
    registrar,
    revset as revsetmod,
    revsetlang,
    scmutil,
    templatefilters,
    templatekw,
    templateutil,
    util,
)
from .utils import (
    dateutil,
    stringutil,
)

evalrawexp = templateutil.evalrawexp
evalwrapped = templateutil.evalwrapped
evalfuncarg = templateutil.evalfuncarg
evalboolean = templateutil.evalboolean
evaldate = templateutil.evaldate
evalinteger = templateutil.evalinteger
evalstring = templateutil.evalstring
evalstringliteral = templateutil.evalstringliteral

# dict of template built-in functions
funcs = {}
templatefunc = registrar.templatefunc(funcs)


@templatefunc(b'date(date[, fmt])')
def date(context, mapping, args):
    """Format a date. See :hg:`help dates` for formatting
    strings. The default is a Unix date format, including the timezone:
    "Mon Sep 04 15:13:13 2006 0700"."""
    if not (1 <= len(args) <= 2):
        # i18n: "date" is a keyword
        raise error.ParseError(_(b"date expects one or two arguments"))

    date = evaldate(
        context,
        mapping,
        args[0],
        # i18n: "date" is a keyword
        _(b"date expects a date information"),
    )
    fmt = None
    if len(args) == 2:
        fmt = evalstring(context, mapping, args[1])
    if fmt is None:
        return dateutil.datestr(date)
    else:
        return dateutil.datestr(date, fmt)


@templatefunc(b'dict([[key=]value...])', argspec=b'*args **kwargs')
def dict_(context, mapping, args):
    """Construct a dict from key-value pairs. A key may be omitted if
    a value expression can provide an unambiguous name."""
    data = util.sortdict()

    for v in args[b'args']:
        k = templateutil.findsymbolicname(v)
        if not k:
            raise error.ParseError(_(b'dict key cannot be inferred'))
        if k in data or k in args[b'kwargs']:
            raise error.ParseError(_(b"duplicated dict key '%s' inferred") % k)
        data[k] = evalfuncarg(context, mapping, v)

    data.update(
        (k, evalfuncarg(context, mapping, v))
        for k, v in args[b'kwargs'].items()
    )
    return templateutil.hybriddict(data)


@templatefunc(
    b'diff([includepattern [, excludepattern]])', requires={b'ctx', b'ui'}
)
def diff(context, mapping, args):
    """Show a diff, optionally
    specifying files to include or exclude."""
    if len(args) > 2:
        # i18n: "diff" is a keyword
        raise error.ParseError(_(b"diff expects zero, one, or two arguments"))

    def getpatterns(i):
        if i < len(args):
            s = evalstring(context, mapping, args[i]).strip()
            if s:
                return [s]
        return